@livenetworks/ashlar 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autoresize/ln-autoresize.js +1 -1
  6. package/components/ln-autoresize/src/ln-autoresize.js +3 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/lifecycle.js +33 -12
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/ln-data-store.js +1 -1
  15. package/components/ln-date/ln-date.js +1 -1
  16. package/components/ln-date/src/ln-date.js +22 -13
  17. package/components/ln-debug/ln-debug.js +1 -1
  18. package/components/ln-dropdown/ln-dropdown.js +1 -1
  19. package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
  20. package/components/ln-dropdown/src/ln-dropdown.js +18 -5
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-editor/src/ln-editor.js +45 -12
  23. package/components/ln-external-links/ln-external-links.js +1 -1
  24. package/components/ln-filter/ln-filter.js +1 -1
  25. package/components/ln-filter/ln-filter.schema.json +1 -1
  26. package/components/ln-filter/src/ln-filter.js +11 -10
  27. package/components/ln-form/ln-form.js +1 -1
  28. package/components/ln-form/src/ln-form.js +11 -0
  29. package/components/ln-icon/ln-icon.js +1 -1
  30. package/components/ln-include/ln-include.js +1 -1
  31. package/components/ln-key/ln-key.js +1 -1
  32. package/components/ln-link/ln-link.js +1 -1
  33. package/components/ln-list/ln-list.js +1 -1
  34. package/components/ln-list/src/ln-list.js +14 -5
  35. package/components/ln-modal/ln-modal.js +1 -1
  36. package/components/ln-nav/ln-nav.js +1 -1
  37. package/components/ln-number/ln-number.js +1 -1
  38. package/components/ln-number/src/ln-number.js +22 -12
  39. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  40. package/components/ln-options/ln-options.js +1 -1
  41. package/components/ln-picklist/ln-picklist.js +1 -1
  42. package/components/ln-popover/ln-popover.js +1 -1
  43. package/components/ln-popover/ln-popover.schema.json +82 -82
  44. package/components/ln-popover/src/ln-popover.js +22 -5
  45. package/components/ln-progress/ln-progress.js +1 -1
  46. package/components/ln-router/ln-router.js +1 -1
  47. package/components/ln-scroll/ln-scroll.js +1 -1
  48. package/components/ln-search/ln-search.js +1 -1
  49. package/components/ln-search/ln-search.schema.json +103 -103
  50. package/components/ln-search/src/ln-search.js +9 -5
  51. package/components/ln-slug/ln-slug.js +1 -1
  52. package/components/ln-sort/ln-sort.js +1 -1
  53. package/components/ln-sortable/ln-sortable.js +1 -1
  54. package/components/ln-sortable/src/ln-sortable.js +52 -7
  55. package/components/ln-stat/ln-stat.js +1 -1
  56. package/components/ln-table/ln-table.js +1 -1
  57. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  58. package/components/ln-tabs/ln-tabs.js +1 -1
  59. package/components/ln-tabs/src/ln-tabs.js +12 -8
  60. package/components/ln-time/ln-time.js +1 -1
  61. package/components/ln-time/src/ln-time.js +17 -7
  62. package/components/ln-toast/ln-toast.js +1 -1
  63. package/components/ln-toggle/ln-toggle.js +1 -1
  64. package/components/ln-tooltip/ln-tooltip.js +1 -1
  65. package/components/ln-translations/ln-translations.js +1 -1
  66. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  67. package/components/ln-upload/ln-upload.js +1 -1
  68. package/components/ln-validate/ln-validate.js +1 -1
  69. package/components/ln-validate/src/ln-validate.js +21 -7
  70. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  71. package/package.json +1 -1
  72. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){o=t[s];break}if(!L(o))return}e.apply(console,t)}}function v(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function F(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(s),s}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,s={},d=e.elements,l={};if(n)for(let u=0;u<d.length;u++){const r=d[u];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let u=0;u<d.length;u++){const r=d[u];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?s[r.name]=r.checked:(s[r.name]||(s[r.name]=[]),r.checked&&s[r.name].push(r.value));else if(r.type==="radio")r.checked&&(s[r.name]=r.value);else if(r.type==="select-multiple"){s[r.name]=[];for(let i=0;i<r.options.length;i++)r.options[i].selected&&s[r.name].push(r.options[i].value)}else if(n&&r.type==="hidden")s[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const i=Number(r.value);s[r.name]=r.value===""||isNaN(i)?null:i}else s[r.name]=r.value}return s}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const n=e.elements,o=[],s={};for(let d=0;d<n.length;d++){const l=n[d];l.name&&l.type==="checkbox"&&(s[l.name]=(s[l.name]||0)+1)}for(let d=0;d<n.length;d++){const l=n[d];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const u=l.getAttribute("data-ln-fill-as")||l.name;if(!u||!(u in t))continue;const r=t[u];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(s[l.name]>1){const i=String(r).split(",").map(function(a){return a.trim()});l.checked=i.indexOf(l.value)!==-1}else l.checked=se(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let i=0;i<l.options.length;i++)l.options[i].selected=r.indexOf(l.options[i].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const B={};function de(e,t){B[e]=t}function ue(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function ce(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function he(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=he,window.lnCore.ensureLocaleObserver=fe);const D={};function H(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function me(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return H(t,n)}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 u=n[l],r=u.getAttribute("data-ln-field");t[r]!=null&&(u.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const u=o[l],r=u.getAttribute("data-ln-attr").split(",");for(let i=0;i<r.length;i++){const a=r[i].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();t[f]!=null&&u.setAttribute(c,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let l=0;l<s.length;l++){const u=s[l],r=u.getAttribute("data-ln-show");r in t&&u.classList.toggle("hidden",!t[r])}const d=e.querySelectorAll("[data-ln-class]");for(let l=0;l<d.length;l++){const u=d[l],r=u.getAttribute("data-ln-class").split(",");for(let i=0;i<r.length;i++){const a=r[i].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();f in t&&u.classList.toggle(c,!!t[f])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const o=function(d,l){return t[l]!==void 0?t[l]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let d=0;d<s.length;d++){const l=s[d],u=l.attributes;for(let r=0;r<u.length;r++){const i=u[r];i.value.indexOf("{{")!==-1&&l.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,n,o,s,d){const l={};for(let r=0;r<e.children.length;r++){const i=e.children[r],a=i.getAttribute("data-ln-render-key");a&&(l[a]=i)}const u=document.createDocumentFragment();for(let r=0;r<t.length;r++){const i=t[r],a=String(o(i));let c=l[a];if(c)s(c,i,r);else{const f=H(n,d);if(!f||(j(f,i),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),s(c,i,r)}u.appendChild(c)}e.textContent="",e.appendChild(u)}function be(e,t){const n={},o=e.querySelectorAll("["+t+"]");for(let s=0;s<o.length;s++)n[o[s].getAttribute(t)]=o[s].textContent,o[s].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=x,window.lnCore.lnFill=ge,window.lnCore.renderList=we);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function k(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function W(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const s=o.trim().toLowerCase();return!(s==="false"||s==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const o=new Set(e||[]),s=function(d,l){const u=d.getAttribute(l);return u!==null&&o.has(u)?u:t};return q.set(n,s),s}function X(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function K(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function J(e,t,n,o,s){if(!e||t===null)return!0;const d=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=r=>{s?console.warn(r,s):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(u(`[${d}] 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:(u(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(u(`[${d}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(u(`[${d}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return u(`[${d}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,n){for(const o in n){const[s,d,l]=n[o];Object.defineProperty(e,o,{get:function(){return s(t,d,l)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let s=o.read;if(!s&&o.type)switch(o.type){case"enum":s=V(o.values,o.fallback);break;case"integer":s=k;break;case"float":s=X;break;case"boolean":s=W;break;case"list":s=P;break;case"json":s=K;break;case"string":default:s=_;break}s||(s=_),t[o.prop]=[s,n,o.fallback]}return t}function ye(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=G,window.lnCore.attrStr=_,window.lnCore.attrInt=k,window.lnCore.attrBool=W,window.lnCore.attrList=P,window.lnCore.attrEnum=V,window.lnCore.attrFloat=X,window.lnCore.attrJson=K);function S(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 Z(e,t,n,o){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(d)&&S(e,l),e.querySelectorAll){const u=e.querySelectorAll(d);for(let r=0;r<u.length;r++)S(u[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(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 Y(){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 xe(e){const t=Y(),n=e.observed||[];for(let o=0;o<n.length;o++){const s=n[o];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const s=t.byDeclaredAttr.get(o);s.some(d=>d.componentTag===e.componentTag)||s.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const s of o)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,n,o){for(let s=0;s<e.length;s++){const d=e[s];if(!t[d.attribute])continue;const l=d.effects&&d.effects[n];l?l(t,n,o):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,o)}}function _e(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=Y(),s=o.byAttr.get(t),d=U()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!s&&!d)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(d&&L(l)){const u=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let i=0;i<u.length;i++)J(u[i].spec,r,t,u[i].componentTag,l)}if(window.lnCore._debugSink&&(n||s)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const u=o.byReactive.get(t);u&&ee(u,l,t,e.oldValue),o.reactiveWildcard.length&&ee(o.reactiveWildcard,l,t,e.oldValue)}if(s)for(let u=0;u<s.length;u++){const r=s[u];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(Z(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{_e(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ie(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange&&o.query){const s=o.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;d&&o.onSubtreeChange(d,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1){const s=!!(o.firstElementChild||o.children&&o.children.length);for(let d=0;d<t.length;d++){const l=t[d];if(l.selector&&l.attribute&&l.ComponentFn){if(!s)o.matches&&o.matches(l.query)&&S(o,l);else if(o.matches&&o.matches(l.query)&&S(o,l),o.querySelectorAll){const u=o.querySelectorAll(l.query);for(let r=0;r<u.length;r++)S(u[r],l)}}l.onInit&&l.onInit(o)}}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1){const s=!!(o.firstElementChild||o.children&&o.children.length);for(let d=0;d<t.length;d++){const l=t[d],u=l.query;if(u){if(!s)o.matches&&o.matches(u)&&R(o,l);else if(o.matches&&o.matches(u)&&R(o,l),o.querySelectorAll){const r=o.querySelectorAll(u);for(let i=0;i<r.length;i++)R(r[i],l)}}}}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Ie(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){z().push(e),te()}function ne(e,t,n,o,s={}){const d=s.extraAttributes||[],l=s.onAttributeChange||null,u=s.onSubtreeChange||null,r=s.onInit||null,i=s.onAttrChange||null,a=s.effects||null,c=s.attributes||null,f=c?ye(c):a,p=c?new Set(Object.keys(c)):null,w=s.persist||null;function b(y){const C=y||document.body;if(Z(C,e,t,n),c&&U())for(const I in c){const Be=c[I],T=Array.from(C.querySelectorAll("["+I+"]"));C.matches&&C.matches("["+I+"]")&&T.push(C);for(let N=0;N<T.length;N++){const M=T[N];L(M)&&J(Be,M.getAttribute(I),I,o,M)}}r&&r(C)}const m=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let C;for(;(C=y.exec(e))!==null;)m.push(C[1])}else m.push(e);xe({selector:e,attribute:t,componentTag:o,attributes:c,ComponentFn:n,onInit:r,observed:m.concat(d),onAttributeChange:l,onAttrChange:i,effects:f,declared:p,persist:w}),Se();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=s.subtreeQuery||(A?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:u,query:g}),te(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=Ee);function h(){ve()>0?Ae(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),b}function oe(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,n={},o=oe(t);if(!o)return n;const s=o.split("&");for(let d=0;d<s.length;d++){const l=s[d];if(!l)continue;const u=l.indexOf(":"),r=u>-1?l.slice(0,u):l,i=u>-1?l.slice(u+1):"";if(r)try{n[r]=decodeURIComponent(i)}catch{n[r]=i}}return n}function ke(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Le(e,t){if(!e)return;const n=O();t==null?delete n[e]:n[e]=String(t);const s=Object.keys(n).map(function(d){const l=n[d];return l===""?d:d+":"+encodeURIComponent(l)}).join("&");oe(location.hash)!==s&&(location.hash=s)}function Fe(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ze(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),s=o?o.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ke,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=ze,window.lnCore.hashFilterEncode=Re,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 Ne(e){if(!e)return null;const t=String(e).split(",").map(n=>n.trim().toLowerCase()).filter(Boolean).map(n=>n.startsWith(".")?n.slice(1):n);return t.length?t:null}function re(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function Me(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=re(e.name),o=String(e.type||"").toLowerCase();return t.some(s=>{if(s.includes("/")){if(s.endsWith("/*")){const d=s.slice(0,-1);return o.startsWith(d)}return o===s}return n===s})}function Ue(e,t="en",n={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(n["unit-b"]||"B");const o=1024,s=[n["unit-b"]||"B",n["unit-kb"]||"KB",n["unit-mb"]||"MB",n["unit-gb"]||"GB"],d=Math.floor(Math.log(e)/Math.log(o)),l=Math.min(d,s.length-1),u=e/Math.pow(o,l);return new Intl.NumberFormat(t,{maximumFractionDigits:1,minimumFractionDigits:0}).format(u)+" "+s[l]}(function(){const e="data-ln-upload",t="lnUpload",n="file",o="file_ids[]";if(window[t]!==void 0)return;const s={"data-ln-upload":{prop:"uploadUrl",read:_,type:"string",fallback:"",description:"Endpoint URL for file uploads"},"data-ln-upload-accept":{type:"string",description:"Comma-separated list of allowed file extensions or MIME types"},"data-ln-upload-delete":{prop:"deleteUrlPattern",read:_,type:"string",fallback:"",description:"Endpoint URL pattern for deleting uploaded files"},"data-ln-upload-max-size":{prop:"maxSize",read:k,type:"integer",fallback:0,min:0,description:"Maximum allowed file size in bytes (0 for unlimited)"},"data-ln-upload-max-files":{prop:"maxFiles",read:k,type:"integer",fallback:0,min:0,description:"Maximum number of files allowed in upload queue (0 for unlimited)"},"data-ln-upload-file-field":{prop:"fileFieldName",read:_,type:"string",fallback:n,description:"Form data field name used for file payloads"},"data-ln-upload-ids-field":{prop:"idsFieldName",read:_,type:"string",fallback:o,description:"Form field name for submitting uploaded file IDs"},"data-ln-upload-dict":{type:"string",description:"Dictionary key prefix mapping for translatable upload messages"},"data-ln-upload-zone":{type:"marker",description:"Designates container as dropzone for drag-and-drop file uploads"},"data-ln-upload-list":{type:"marker",description:"Container element holding rendered upload items"},"data-ln-upload-item":{type:"marker",description:"Container element for an individual file upload item"},"data-ln-upload-action":{type:"enum",values:["remove","retry"],description:"Action button within upload item"},"data-ln-upload-state":{type:"enum",values:["ready","dragover","pending","uploading","success","error"],description:"Runtime status of dropzone or individual upload item"},"data-ln-upload-id":{type:"string",description:"Server-assigned file identifier for completed upload"},"data-ln-upload-local-id":{type:"string",description:"Client-generated unique ID for tracking file item in DOM"},"data-ln-upload-size":{type:"integer",min:0,description:"File size in bytes"},"data-ln-upload-ext":{type:"string",description:"Normalized file extension"}},d=G(s);function l(i,a,c){return Ue(i,a,c)}function u(){const i=document.querySelector('meta[name="csrf-token"]');return i?i.getAttribute("content"):""}function r(i){this.dom=i,Q(this,i,d),this.dict=be(i,"data-ln-upload-dict"),this.locale=ce(i),this.zone=i.querySelector("[data-ln-upload-zone]")||i,this.list=i.querySelector("[data-ln-upload-list]"),this.input=i.querySelector('input[type="file"]'),this.input||console.warn('[ln-upload] Missing <input type="file"> in container:',i);const a=i.getAttribute("data-ln-upload-accept")||(this.input?this.input.getAttribute("accept"):"");return this.allowedExts=Ne(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}r.prototype._hydrate=function(){const i=this;if(!this.list)return;const a=this.list.querySelectorAll("[data-ln-upload-item]");for(let f=0;f<a.length;f++){const p=a[f],w=p.getAttribute("data-ln-upload-id"),b="file-"+ ++i.fileIdCounter;p.setAttribute("data-ln-upload-local-id",b);const m=p.querySelector('[data-ln-field="name"]'),A=p.querySelector('[data-ln-field="sizeText"]'),g=p.getAttribute("data-ln-upload-size"),h=g?parseInt(g,10):null;i.uploadedFiles.set(b,{serverId:w||null,name:m?m.textContent.trim():"",size:h!==null&&!isNaN(h)?h:A?A.textContent.trim():""})}const c=this.dom.querySelectorAll('input[type="hidden"]');for(let f=0;f<c.length;f++){const p=c[f];if(p.name===i.idsFieldName&&p.value&&!Array.from(i.uploadedFiles.values()).some(function(b){return String(b.serverId)===String(p.value)})){const b="file-"+ ++i.fileIdCounter;i.uploadedFiles.set(b,{serverId:p.value,name:"",size:""})}}this._syncHiddenInputs()},r.prototype._syncHiddenInputs=function(){const i=this,a=this.dom.querySelectorAll('input[type="hidden"]');for(let c=0;c<a.length;c++)a[c].name===i.idsFieldName&&a[c].remove();for(const[,c]of this.uploadedFiles)if(c.serverId){const f=document.createElement("input");f.type="hidden",f.name=i.idsFieldName,f.value=c.serverId,i.dom.appendChild(f)}},r.prototype._bindEvents=function(){const i=this;this._onZoneClick=function(a){i.zone===i.dom&&a.target.closest("[data-ln-upload-list], [data-ln-upload-action], input, button, a")||i.input&&a.target!==i.input&&i.input.click()},this._onInputChange=function(){i.input&&i.input.files&&(i.upload(i.input.files),i.input.value="")},this._onDragEnter=function(a){a.preventDefault(),a.stopPropagation(),i._dragDepth++,i.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragOver=function(a){a.preventDefault(),a.stopPropagation(),i.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragLeave=function(a){a.preventDefault(),a.stopPropagation(),i._dragDepth--,i._dragDepth<=0&&(i._dragDepth=0,i.zone.removeAttribute("data-ln-upload-state"))},this._onDrop=function(a){a.preventDefault(),a.stopPropagation(),i._dragDepth=0,i.zone.removeAttribute("data-ln-upload-state"),a.dataTransfer&&a.dataTransfer.files&&i.upload(a.dataTransfer.files)},this._onListClick=function(a){const c=a.target.closest('[data-ln-upload-action="remove"]');if(!c||!i.list||!i.list.contains(c)||c.disabled)return;const f=c.closest("[data-ln-upload-item]");if(f){const p=f.getAttribute("data-ln-upload-local-id");p&&i.remove(p)}},this._onRequestUpload=function(a){a.detail&&a.detail.files&&i.upload(a.detail.files)},this._onRequestRemove=function(a){if(a.detail){const c=a.detail.localId!==void 0?a.detail.localId:a.detail.serverId;c!==void 0&&i.remove(c)}},this._onRequestClear=function(){i.clear()},this.zone.addEventListener("click",this._onZoneClick),this.input&&this.input.addEventListener("change",this._onInputChange),this.zone.addEventListener("dragenter",this._onDragEnter),this.zone.addEventListener("dragover",this._onDragOver),this.zone.addEventListener("dragleave",this._onDragLeave),this.zone.addEventListener("drop",this._onDrop),this.list&&this.list.addEventListener("click",this._onListClick),this.dom.addEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.addEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.addEventListener("ln-upload:request-clear",this._onRequestClear)},r.prototype.upload=function(i){const a=this,c=Array.from(i);for(let f=0;f<c.length;f++){const p=c[f];if(a.maxFiles>0&&a.uploadedFiles.size>=a.maxFiles){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-files"});continue}if(!Me(p,a.allowedExts)){v(a.dom,"ln-upload:invalid",{file:p,reason:"accept"});continue}if(a.maxSize>0&&p.size>a.maxSize){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-size"});continue}F(a.dom,"ln-upload:before-upload",{file:p}).defaultPrevented||a._uploadSingleFile(p)}},r.prototype._uploadSingleFile=function(i){const a=this,c="file-"+ ++a.fileIdCounter,f=re(i.name);let p=null;if(this.list){const g=me(this.dom,"ln-upload-item","ln-upload");if(g&&(p=g.firstElementChild,p)){p.setAttribute("data-ln-upload-item",""),p.setAttribute("data-ln-upload-local-id",c),p.setAttribute("data-ln-upload-ext",f),p.setAttribute("data-ln-upload-state","uploading"),x(p,{name:i.name,sizeText:"0%",removeLabel:a.dict.remove||"Remove",uploading:!0,error:!1,deleting:!1});const h=p.querySelector('[data-ln-upload-action="remove"]');h&&(h.disabled=!0);const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress","0"),a.list.appendChild(p)}}const w=new FormData;w.append(a.fileFieldName,i);const b=this.dom.querySelectorAll("input, select, textarea");for(let g=0;g<b.length;g++){const h=b[g];!h.name||h.name===a.idsFieldName||h.type==="file"||(h.type==="checkbox"||h.type==="radio")&&!h.checked||w.append(h.name,h.value)}const m=new XMLHttpRequest;a.uploadedFiles.set(c,{serverId:null,name:i.name,size:i.size,xhr:m}),m.upload.addEventListener("progress",function(g){if(g.lengthComputable){const h=Math.round(g.loaded/g.total*100);if(p){const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress",String(h)),x(p,{sizeText:h+"%"})}v(a.dom,"ln-upload:progress",{localId:c,file:i,percent:h,loaded:g.loaded,total:g.total})}}),m.addEventListener("load",function(){const g=a.uploadedFiles.get(c);if(g&&delete g.xhr,m.status>=200&&m.status<300){let h;try{h=JSON.parse(m.responseText)}catch(C){A(a.dict.error||"Error",m.status,C);return}const y=h.id||h.serverId;if(p){p.removeAttribute("data-ln-upload-state"),y&&p.setAttribute("data-ln-upload-id",String(y)),x(p,{sizeText:l(h.size||i.size,a.locale,a.dict),uploading:!1});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}g&&(g.serverId=y,g.size=h.size||i.size,g.name=h.name||i.name),a._syncHiddenInputs(),v(a.dom,"ln-upload:uploaded",{localId:c,serverId:y,name:h.name||i.name,size:h.size||i.size,response:h})}else{let h="";try{h=JSON.parse(m.responseText).message||""}catch{}A(h,m.status,null)}}),m.addEventListener("error",function(){const g=a.uploadedFiles.get(c);g&&delete g.xhr,A("",0,null)});function A(g,h,y){if(p){p.setAttribute("data-ln-upload-state","error"),x(p,{sizeText:a.dict.error||"Error",uploading:!1,error:!0});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}v(a.dom,"ln-upload:error",{file:i,message:g,status:h,error:y})}a.uploadUrl?(m.open("POST",a.uploadUrl),m.setRequestHeader("X-CSRF-TOKEN",u()),m.setRequestHeader("X-Requested-With","XMLHttpRequest"),m.setRequestHeader("Accept","application/json"),m.send(w)):console.warn("[ln-upload] No upload URL configured (missing data-ln-upload)")},r.prototype.remove=function(i){const a=this;let c=null,f=null;if(a.uploadedFiles.has(i))c=i,f=a.uploadedFiles.get(i);else for(const[m,A]of a.uploadedFiles)if(String(A.serverId)===String(i)){c=m,f=A;break}if(!c||!f||F(a.dom,"ln-upload:before-remove",{localId:c,serverId:f.serverId}).defaultPrevented)return;const w=a.list?a.list.querySelector('[data-ln-upload-local-id="'+c+'"]'):null;if(f.xhr&&typeof f.xhr.abort=="function"&&f.xhr.abort(),!f.serverId){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:null});return}let b=null;if(a.deleteUrlPattern?b=a.deleteUrlPattern.replace("{id}",encodeURIComponent(f.serverId)):a.uploadUrl&&a.uploadUrl.includes("{id}")&&(b=a.uploadUrl.replace("{id}",encodeURIComponent(f.serverId))),!b){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId});return}w&&(w.setAttribute("data-ln-upload-state","deleting"),x(w,{deleting:!0})),fetch(b,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(function(m){m.ok?(w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId})):(w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:m.status}))}).catch(function(m){w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:m})})},r.prototype.clear=function(){const i=this;if(!F(i.dom,"ln-upload:before-clear",{}).defaultPrevented){for(const[,c]of this.uploadedFiles)if(c.xhr&&typeof c.xhr.abort=="function"&&c.xhr.abort(),c.serverId){let f=null;i.deleteUrlPattern?f=i.deleteUrlPattern.replace("{id}",encodeURIComponent(c.serverId)):i.uploadUrl&&i.uploadUrl.includes("{id}")&&(f=i.uploadUrl.replace("{id}",encodeURIComponent(c.serverId))),f&&fetch(f,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).catch(function(){})}i.uploadedFiles.clear(),i.list&&(i.list.innerHTML=""),i._syncHiddenInputs(),v(i.dom,"ln-upload:cleared",{})}},r.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(i){return i.serverId}).filter(Boolean)},r.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(i){return{serverId:i.serverId,name:i.name,size:i.size}})},r.prototype.destroy=function(){if(this.dom[t]){for(const[,i]of this.uploadedFiles)i.xhr&&typeof i.xhr.abort=="function"&&i.xhr.abort();this.zone.removeEventListener("click",this._onZoneClick),this.input&&this.input.removeEventListener("change",this._onInputChange),this.zone.removeEventListener("dragenter",this._onDragEnter),this.zone.removeEventListener("dragover",this._onDragOver),this.zone.removeEventListener("dragleave",this._onDragLeave),this.zone.removeEventListener("drop",this._onDrop),this.list&&this.list.removeEventListener("click",this._onListClick),this.dom.removeEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.removeEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.removeEventListener("ln-upload:request-clear",this._onRequestClear),this.uploadedFiles.clear(),this.dict={},delete this.dom[t]}},ne(e,t,r,"ln-upload",{attributes:s})})()})();
1
+ (function(){"use strict";function $(){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 F(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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!F(l))return}e.apply(console,t)}}function C(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function D(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(i),i}function k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,i={},d=e.elements,s={};if(o)for(let u=0;u<d.length;u++){const n=d[u];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[n.name]||0)+1)}for(let u=0;u<d.length;u++){const n=d[u];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")o&&s[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 r=0;r<n.options.length;r++)n.options[r].selected&&i[n.name].push(n.options[r].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const r=Number(n.value);i[n.name]=n.value===""||isNaN(r)?null:r}else i[n.name]=n.value}return i}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const o=e.elements,l=[],i={};for(let d=0;d<o.length;d++){const s=o[d];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let d=0;d<o.length;d++){const s=o[d];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const u=s.getAttribute("data-ln-fill-as")||s.name;if(!u||!(u in t))continue;const n=t[u];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(i[s.name]>1){const r=String(n).split(",").map(function(a){return a.trim()});s.checked=r.indexOf(s.value)!==-1}else s.checked=de(n);l.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),l.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let r=0;r<s.options.length;r++)s.options[r].selected=n.indexOf(s.options[r].value)!==-1;l.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),l.push(s)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=se);const H={};function ce(e,t){H[e]=t}function fe(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=fe);function pe(e){const t=e?e.closest("[lang]"):null,o=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return o?o.trim():"en-US"}function he(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function me(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];j[o]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=me,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=he);const q={};function W(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=q[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function we(e,t,o){if(e){const l=e.querySelector('[data-ln-template="'+t+'"]');if(l)return l.content.cloneNode(!0)}return W(t,o)}function x(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let s=0;s<o.length;s++){const u=o[s],n=u.getAttribute("data-ln-field");t[n]!=null&&(u.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<l.length;s++){const u=l[s],n=u.getAttribute("data-ln-attr").split(",");for(let r=0;r<n.length;r++){const a=n[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();t[f]!=null&&u.setAttribute(c,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const u=i[s],n=u.getAttribute("data-ln-show");n in t&&u.classList.toggle("hidden",!t[n])}const d=e.querySelectorAll("[data-ln-class]");for(let s=0;s<d.length;s++){const u=d[s],n=u.getAttribute("data-ln-class").split(",");for(let r=0;r<n.length;r++){const a=n[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();f in t&&u.classList.toggle(c,!!t[f])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[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 o=0;o<t.length;o++)t[o].textContent=""}})));function P(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const d=o.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return t[u]!==void 0?t[u]:""}))}const l=function(d,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let d=0;d<i.length;d++){const s=i[d],u=s.attributes;for(let n=0;n<u.length;n++){const r=u[n];r.value.indexOf("{{")!==-1&&s.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function ye(e,t,o,l,i,d){const s={};for(let n=0;n<e.children.length;n++){const r=e.children[n],a=r.getAttribute("data-ln-render-key");a&&(s[a]=r)}const u=document.createDocumentFragment();for(let n=0;n<t.length;n++){const r=t[n],a=String(l(r));let c=s[a];if(c)i(c,r,n);else{const f=W(o,d);if(!f||(P(f,r),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),i(c,r,n)}u.appendChild(c)}e.textContent="",e.appendChild(u)}function Ce(e,t){const o={},l=e.querySelectorAll("["+t+"]");for(let i=0;i<l.length;i++)o[l[i].getAttribute(t)]=l[i].textContent,l[i].remove();return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=x,window.lnCore.lnFill=be,window.lnCore.renderList=ye);function S(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function L(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function V(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const z=new Map;function K(e,t){const o=(e?e.join("|"):"")+"::"+t;if(z.has(o))return z.get(o);const l=new Set(e||[]),i=function(d,s){const u=d.getAttribute(s);return u!==null&&l.has(u)?u:t};return z.set(o,i),i}function J(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function Q(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function G(e,t,o,l,i){if(!e||t===null)return!0;const d=l||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=n=>{i?console.warn(n,i):console.warn(n)};if(s==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(u(`[${d}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const n=e.values||[];return n.includes(t)?!0:(u(`[${d}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${d}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(u(`[${d}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(u(`[${d}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${d}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(n){return u(`[${d}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,o){for(const l in o){const[i,d,s]=o[l];Object.defineProperty(e,l,{get:function(){return i(t,d,s)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=K(l.values,l.fallback);break;case"integer":i=L;break;case"float":i=J;break;case"boolean":i=V;break;case"list":i=X;break;case"json":i=Q;break;case"string":default:i=S;break}i||(i=S),t[l.prop]=[i,o,l.fallback]}return t}function ve(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.effect)}return Object.keys(t).length?t:null}function Ae(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Z,window.lnCore.attrSpec=Y,window.lnCore.attrStr=S,window.lnCore.attrInt=L,window.lnCore.attrBool=V,window.lnCore.attrList=X,window.lnCore.attrEnum=K,window.lnCore.attrFloat=J,window.lnCore.attrJson=Q);function I(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function ee(e,t,o,l){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:o,ComponentFn:l};if(e.matches&&e.matches(d)&&I(e,s),e.querySelectorAll){const u=e.querySelectorAll(d);for(let n=0;n<u.length;n++)I(u[n],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function te(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Se(e){const t=te(),o=e.observed||[];for(let l=0;l<o.length;l++){const i=o[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(d=>d.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Ae(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ne(e,t,o,l){for(let i=0;i<e.length;i++){const d=e[i];if(!t[d.attribute])continue;const s=d.effects&&d.effects[o];s?s(t,o,l):d.onAttrChange&&(!d.declared||d.declared.has(o))&&d.onAttrChange(t,o,l)}}function Ie(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,l=te(),i=l.byAttr.get(t),d=$()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!o&&!i&&!d)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(d&&F(s)){const u=l.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let r=0;r<u.length;r++)G(u[r].spec,n,t,u[r].componentTag,s)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),o){const u=l.byReactive.get(t);u&&ne(u,s,t,e.oldValue),l.reactiveWildcard.length&&ne(l.reactiveWildcard,s,t,e.oldValue)}if(i)for(let u=0;u<i.length;u++){const n=i[u];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(ee(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ie(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function O(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ke(e){const t=R();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=O();if(e.target&&l.length)for(let i=0;i<l.length;i++){const d=l[i],s=d.query,u=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;u&&d.onSubtreeChange(u,e)}for(let i=0;i<e.addedNodes.length;i++){const d=e.addedNodes[i];if(d.nodeType===1){const s=!!(d.firstElementChild||d.children&&d.children.length);for(let u=0;u<t.length;u++){const n=t[u];if(n.selector&&n.attribute&&n.ComponentFn){if(!s)d.matches&&d.matches(n.query)&&I(d,n);else if(d.matches&&d.matches(n.query)&&I(d,n),d.querySelectorAll){const r=d.querySelectorAll(n.query);for(let a=0;a<r.length;a++)I(r[a],n)}}n.onInit&&n.onInit(d)}}}for(let i=0;i<e.removedNodes.length;i++){const d=e.removedNodes[i];if(d.nodeType===1){const s=!!(d.firstElementChild||d.children&&d.children.length);for(let u=0;u<t.length;u++){const n=t[u],r=n.query;if(r){if(!s)d.matches&&d.matches(r)&&T(d,n);else if(d.matches&&d.matches(r)&&T(d,n),d.querySelectorAll){const a=d.querySelectorAll(r);for(let c=0;c<a.length;c++)T(a[c],n)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{ke(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(e){R().push(e),e.onSubtreeChange&&e.query&&O().push(e),oe()}function re(e,t,o,l,i={}){const d=i.extraAttributes||[],s=i.onAttributeChange||null,u=i.onSubtreeChange||null,n=i.onInit||null,r=i.onAttrChange||null,a=i.effects||null,c=i.attributes||null,f=c?ve(c):a,p=c?new Set(Object.keys(c)):null,w=i.persist||null;function b(A){const _=A||document.body;if(ee(_,e,t,o),c&&$())for(const E in c){const He=c[E],M=Array.from(_.querySelectorAll("["+E+"]"));_.matches&&_.matches("["+E+"]")&&M.push(_);for(let U=0;U<M.length;U++){const B=M[U];F(B)&&G(He,B.getAttribute(E),E,l,B)}}n&&n(_)}const g=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let _;for(;(_=A.exec(e))!==null;)g.push(_[1])}else g.push(e);Se({selector:e,attribute:t,componentTag:l,attributes:c,ComponentFn:o,onInit:n,observed:g.concat(d),onAttributeChange:s,onAttrChange:r,effects:f,declared:p,persist:w}),Ee();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,m=i.subtreeQuery||(v?e:"["+e+"]"),h={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:u,query:m};R().push(h),u&&m&&O().push(h),oe(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=Le);function y(){xe()>0?_e(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),b}function ie(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,o={},l=ie(t);if(!l)return o;const i=l.split("&");for(let d=0;d<i.length;d++){const s=i[d];if(!s)continue;const u=s.indexOf(":"),n=u>-1?s.slice(0,u):s,r=u>-1?s.slice(u+1):"";if(n)try{o[n]=decodeURIComponent(r)}catch{o[n]=r}}return o}function Fe(e){if(!e)return null;const t=N();return e in t?t[e]:null}function De(e,t){if(!e)return;const o=N();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(d){const s=o[d];return s===""?d:d+":"+encodeURIComponent(s)}).join("&");ie(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ze(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const 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 Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Te(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ne(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Fe,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=ze,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Te,window.lnCore.hashFilterDecode=Ne);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);function Ue(e){if(!e)return null;const t=String(e).split(",").map(o=>o.trim().toLowerCase()).filter(Boolean).map(o=>o.startsWith(".")?o.slice(1):o);return t.length?t:null}function le(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function Be(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const o=le(e.name),l=String(e.type||"").toLowerCase();return t.some(i=>{if(i.includes("/")){if(i.endsWith("/*")){const d=i.slice(0,-1);return l.startsWith(d)}return l===i}return o===i})}function $e(e,t="en",o={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(o["unit-b"]||"B");const l=1024,i=[o["unit-b"]||"B",o["unit-kb"]||"KB",o["unit-mb"]||"MB",o["unit-gb"]||"GB"],d=Math.floor(Math.log(e)/Math.log(l)),s=Math.min(d,i.length-1),u=e/Math.pow(l,s);return new Intl.NumberFormat(t,{maximumFractionDigits:1,minimumFractionDigits:0}).format(u)+" "+i[s]}(function(){const e="data-ln-upload",t="lnUpload",o="file",l="file_ids[]";if(window[t]!==void 0)return;const i={"data-ln-upload":{prop:"uploadUrl",read:S,type:"string",fallback:"",description:"Endpoint URL for file uploads"},"data-ln-upload-accept":{type:"string",description:"Comma-separated list of allowed file extensions or MIME types"},"data-ln-upload-delete":{prop:"deleteUrlPattern",read:S,type:"string",fallback:"",description:"Endpoint URL pattern for deleting uploaded files"},"data-ln-upload-max-size":{prop:"maxSize",read:L,type:"integer",fallback:0,min:0,description:"Maximum allowed file size in bytes (0 for unlimited)"},"data-ln-upload-max-files":{prop:"maxFiles",read:L,type:"integer",fallback:0,min:0,description:"Maximum number of files allowed in upload queue (0 for unlimited)"},"data-ln-upload-file-field":{prop:"fileFieldName",read:S,type:"string",fallback:o,description:"Form data field name used for file payloads"},"data-ln-upload-ids-field":{prop:"idsFieldName",read:S,type:"string",fallback:l,description:"Form field name for submitting uploaded file IDs"},"data-ln-upload-dict":{type:"string",description:"Dictionary key prefix mapping for translatable upload messages"},"data-ln-upload-zone":{type:"marker",description:"Designates container as dropzone for drag-and-drop file uploads"},"data-ln-upload-list":{type:"marker",description:"Container element holding rendered upload items"},"data-ln-upload-item":{type:"marker",description:"Container element for an individual file upload item"},"data-ln-upload-action":{type:"enum",values:["remove","retry"],description:"Action button within upload item"},"data-ln-upload-state":{type:"enum",values:["ready","dragover","pending","uploading","success","error"],description:"Runtime status of dropzone or individual upload item"},"data-ln-upload-id":{type:"string",description:"Server-assigned file identifier for completed upload"},"data-ln-upload-local-id":{type:"string",description:"Client-generated unique ID for tracking file item in DOM"},"data-ln-upload-size":{type:"integer",min:0,description:"File size in bytes"},"data-ln-upload-ext":{type:"string",description:"Normalized file extension"}},d=Y(i);function s(r,a,c){return $e(r,a,c)}function u(){const r=document.querySelector('meta[name="csrf-token"]');return r?r.getAttribute("content"):""}function n(r){this.dom=r,Z(this,r,d),this.dict=Ce(r,"data-ln-upload-dict"),this.locale=pe(r),this.zone=r.querySelector("[data-ln-upload-zone]")||r,this.list=r.querySelector("[data-ln-upload-list]"),this.input=r.querySelector('input[type="file"]'),this.input||console.warn('[ln-upload] Missing <input type="file"> in container:',r);const a=r.getAttribute("data-ln-upload-accept")||(this.input?this.input.getAttribute("accept"):"");return this.allowedExts=Ue(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}n.prototype._hydrate=function(){const r=this;if(!this.list)return;const a=this.list.querySelectorAll("[data-ln-upload-item]");for(let f=0;f<a.length;f++){const p=a[f],w=p.getAttribute("data-ln-upload-id"),b="file-"+ ++r.fileIdCounter;p.setAttribute("data-ln-upload-local-id",b);const g=p.querySelector('[data-ln-field="name"]'),v=p.querySelector('[data-ln-field="sizeText"]'),m=p.getAttribute("data-ln-upload-size"),h=m?parseInt(m,10):null;r.uploadedFiles.set(b,{serverId:w||null,name:g?g.textContent.trim():"",size:h!==null&&!isNaN(h)?h:v?v.textContent.trim():""})}const c=this.dom.querySelectorAll('input[type="hidden"]');for(let f=0;f<c.length;f++){const p=c[f];if(p.name===r.idsFieldName&&p.value&&!Array.from(r.uploadedFiles.values()).some(function(b){return String(b.serverId)===String(p.value)})){const b="file-"+ ++r.fileIdCounter;r.uploadedFiles.set(b,{serverId:p.value,name:"",size:""})}}this._syncHiddenInputs()},n.prototype._syncHiddenInputs=function(){const r=this,a=this.dom.querySelectorAll('input[type="hidden"]');for(let c=0;c<a.length;c++)a[c].name===r.idsFieldName&&a[c].remove();for(const[,c]of this.uploadedFiles)if(c.serverId){const f=document.createElement("input");f.type="hidden",f.name=r.idsFieldName,f.value=c.serverId,r.dom.appendChild(f)}},n.prototype._bindEvents=function(){const r=this;this._onZoneClick=function(a){r.zone===r.dom&&a.target.closest("[data-ln-upload-list], [data-ln-upload-action], input, button, a")||r.input&&a.target!==r.input&&r.input.click()},this._onInputChange=function(){r.input&&r.input.files&&(r.upload(r.input.files),r.input.value="")},this._onDragEnter=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth++,r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragOver=function(a){a.preventDefault(),a.stopPropagation(),r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragLeave=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth--,r._dragDepth<=0&&(r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"))},this._onDrop=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"),a.dataTransfer&&a.dataTransfer.files&&r.upload(a.dataTransfer.files)},this._onListClick=function(a){const c=a.target.closest('[data-ln-upload-action="remove"]');if(!c||!r.list||!r.list.contains(c)||c.disabled)return;const f=c.closest("[data-ln-upload-item]");if(f){const p=f.getAttribute("data-ln-upload-local-id");p&&r.remove(p)}},this._onRequestUpload=function(a){a.detail&&a.detail.files&&r.upload(a.detail.files)},this._onRequestRemove=function(a){if(a.detail){const c=a.detail.localId!==void 0?a.detail.localId:a.detail.serverId;c!==void 0&&r.remove(c)}},this._onRequestClear=function(){r.clear()},this.zone.addEventListener("click",this._onZoneClick),this.input&&this.input.addEventListener("change",this._onInputChange),this.zone.addEventListener("dragenter",this._onDragEnter),this.zone.addEventListener("dragover",this._onDragOver),this.zone.addEventListener("dragleave",this._onDragLeave),this.zone.addEventListener("drop",this._onDrop),this.list&&this.list.addEventListener("click",this._onListClick),this.dom.addEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.addEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.addEventListener("ln-upload:request-clear",this._onRequestClear)},n.prototype.upload=function(r){const a=this,c=Array.from(r);for(let f=0;f<c.length;f++){const p=c[f];if(a.maxFiles>0&&a.uploadedFiles.size>=a.maxFiles){C(a.dom,"ln-upload:invalid",{file:p,reason:"max-files"});continue}if(!Be(p,a.allowedExts)){C(a.dom,"ln-upload:invalid",{file:p,reason:"accept"});continue}if(a.maxSize>0&&p.size>a.maxSize){C(a.dom,"ln-upload:invalid",{file:p,reason:"max-size"});continue}D(a.dom,"ln-upload:before-upload",{file:p}).defaultPrevented||a._uploadSingleFile(p)}},n.prototype._uploadSingleFile=function(r){const a=this,c="file-"+ ++a.fileIdCounter,f=le(r.name);let p=null;if(this.list){const m=we(this.dom,"ln-upload-item","ln-upload");if(m&&(p=m.firstElementChild,p)){p.setAttribute("data-ln-upload-item",""),p.setAttribute("data-ln-upload-local-id",c),p.setAttribute("data-ln-upload-ext",f),p.setAttribute("data-ln-upload-state","uploading"),x(p,{name:r.name,sizeText:"0%",removeLabel:a.dict.remove||"Remove",uploading:!0,error:!1,deleting:!1});const h=p.querySelector('[data-ln-upload-action="remove"]');h&&(h.disabled=!0);const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress","0"),a.list.appendChild(p)}}const w=new FormData;w.append(a.fileFieldName,r);const b=this.dom.querySelectorAll("input, select, textarea");for(let m=0;m<b.length;m++){const h=b[m];!h.name||h.name===a.idsFieldName||h.type==="file"||(h.type==="checkbox"||h.type==="radio")&&!h.checked||w.append(h.name,h.value)}const g=new XMLHttpRequest;a.uploadedFiles.set(c,{serverId:null,name:r.name,size:r.size,xhr:g}),g.upload.addEventListener("progress",function(m){if(m.lengthComputable){const h=Math.round(m.loaded/m.total*100);if(p){const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress",String(h)),x(p,{sizeText:h+"%"})}C(a.dom,"ln-upload:progress",{localId:c,file:r,percent:h,loaded:m.loaded,total:m.total})}}),g.addEventListener("load",function(){const m=a.uploadedFiles.get(c);if(m&&delete m.xhr,g.status>=200&&g.status<300){let h;try{h=JSON.parse(g.responseText)}catch(A){v(a.dict.error||"Error",g.status,A);return}const y=h.id||h.serverId;if(p){p.removeAttribute("data-ln-upload-state"),y&&p.setAttribute("data-ln-upload-id",String(y)),x(p,{sizeText:s(h.size||r.size,a.locale,a.dict),uploading:!1});const A=p.querySelector('[data-ln-upload-action="remove"]');A&&(A.disabled=!1)}m&&(m.serverId=y,m.size=h.size||r.size,m.name=h.name||r.name),a._syncHiddenInputs(),C(a.dom,"ln-upload:uploaded",{localId:c,serverId:y,name:h.name||r.name,size:h.size||r.size,response:h})}else{let h="";try{h=JSON.parse(g.responseText).message||""}catch{}v(h,g.status,null)}}),g.addEventListener("error",function(){const m=a.uploadedFiles.get(c);m&&delete m.xhr,v("",0,null)});function v(m,h,y){if(p){p.setAttribute("data-ln-upload-state","error"),x(p,{sizeText:a.dict.error||"Error",uploading:!1,error:!0});const A=p.querySelector('[data-ln-upload-action="remove"]');A&&(A.disabled=!1)}C(a.dom,"ln-upload:error",{file:r,message:m,status:h,error:y})}a.uploadUrl?(g.open("POST",a.uploadUrl),g.setRequestHeader("X-CSRF-TOKEN",u()),g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.setRequestHeader("Accept","application/json"),g.send(w)):console.warn("[ln-upload] No upload URL configured (missing data-ln-upload)")},n.prototype.remove=function(r){const a=this;let c=null,f=null;if(a.uploadedFiles.has(r))c=r,f=a.uploadedFiles.get(r);else for(const[g,v]of a.uploadedFiles)if(String(v.serverId)===String(r)){c=g,f=v;break}if(!c||!f||D(a.dom,"ln-upload:before-remove",{localId:c,serverId:f.serverId}).defaultPrevented)return;const w=a.list?a.list.querySelector('[data-ln-upload-local-id="'+c+'"]'):null;if(f.xhr&&typeof f.xhr.abort=="function"&&f.xhr.abort(),!f.serverId){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),C(a.dom,"ln-upload:removed",{localId:c,serverId:null});return}let b=null;if(a.deleteUrlPattern?b=a.deleteUrlPattern.replace("{id}",encodeURIComponent(f.serverId)):a.uploadUrl&&a.uploadUrl.includes("{id}")&&(b=a.uploadUrl.replace("{id}",encodeURIComponent(f.serverId))),!b){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),C(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId});return}w&&(w.setAttribute("data-ln-upload-state","deleting"),x(w,{deleting:!0})),fetch(b,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(function(g){g.ok?(w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),C(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId})):(w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),C(a.dom,"ln-upload:error",{file:f,message:"",status:g.status}))}).catch(function(g){w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),C(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:g})})},n.prototype.clear=function(){const r=this;if(!D(r.dom,"ln-upload:before-clear",{}).defaultPrevented){for(const[,c]of this.uploadedFiles)if(c.xhr&&typeof c.xhr.abort=="function"&&c.xhr.abort(),c.serverId){let f=null;r.deleteUrlPattern?f=r.deleteUrlPattern.replace("{id}",encodeURIComponent(c.serverId)):r.uploadUrl&&r.uploadUrl.includes("{id}")&&(f=r.uploadUrl.replace("{id}",encodeURIComponent(c.serverId))),f&&fetch(f,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).catch(function(){})}r.uploadedFiles.clear(),r.list&&(r.list.innerHTML=""),r._syncHiddenInputs(),C(r.dom,"ln-upload:cleared",{})}},n.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return r.serverId}).filter(Boolean)},n.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return{serverId:r.serverId,name:r.name,size:r.size}})},n.prototype.destroy=function(){if(this.dom[t]){for(const[,r]of this.uploadedFiles)r.xhr&&typeof r.xhr.abort=="function"&&r.xhr.abort();this.zone.removeEventListener("click",this._onZoneClick),this.input&&this.input.removeEventListener("change",this._onInputChange),this.zone.removeEventListener("dragenter",this._onDragEnter),this.zone.removeEventListener("dragover",this._onDragOver),this.zone.removeEventListener("dragleave",this._onDragLeave),this.zone.removeEventListener("drop",this._onDrop),this.list&&this.list.removeEventListener("click",this._onListClick),this.dom.removeEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.removeEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.removeEventListener("ln-upload:request-clear",this._onRequestClear),this.uploadedFiles.clear(),this.dict={},delete this.dom[t]}},re(e,t,n,"ln-upload",{attributes:i})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!A(r))return}e.apply(console,t)}}function S(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(o)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const o=e.elements,r=[],l={};for(let s=0;s<o.length;s++){const i=o[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<o.length;s++){const i=o[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const n=t[a];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=oe(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const T={};function le(e,t){T[e]=t}function se(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){S(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function ce(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];M[o]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ae);const x={};function ue(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const a=o[i],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),w=d[1].trim();t[w]!=null&&a.setAttribute(u,t[w])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),w=d[1].trim();w in t&&a.classList.toggle(u,!!t[w])}}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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function B(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function he(e,t,o,r,l,s){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=i[d];if(u)l(u,c,n);else{const w=ue(o,s);if(!w||(B(w,c),u=w.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=$,window.lnCore.lnFill=fe,window.lnCore.renderList=he);function k(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function V(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function j(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const E=new Map;function U(e,t){const o=(e?e.join("|"):"")+"::"+t;if(E.has(o))return E.get(o);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return E.set(o,l),l}function H(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function K(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function P(e,t,o,r,l){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function we(e,t,o){for(const r in o){const[l,s,i]=o[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=U(r.values,r.fallback);break;case"integer":l=V;break;case"float":l=H;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=K;break;case"string":default:l=k;break}l||(l=k),t[r.prop]=[l,o,r.fallback]}return t}function be(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=we,window.lnCore.attrSpec=pe,window.lnCore.attrStr=k,window.lnCore.attrInt=V,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=H,window.lnCore.attrJson=K);function C(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Q(e,t,o,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(s)&&C(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)C(a[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function G(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=G(),o=e.observed||[];for(let r=0;r<o.length;r++){const l=o[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=me(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,o,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[o];i?i(t,o,r):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,r)}}function ve(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=G(),l=r.byAttr.get(t),s=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&A(i)){const a=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<a.length;c++)P(a[c].spec,n,t,a[c].componentTag,i)}if(window.lnCore._debugSink&&(o||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const a=r.byReactive.get(t);a&&J(a,i,t,e.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,i,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const n=l[a];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(Q(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ve(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=L();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const l=r.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&r.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)r.matches&&r.matches(i.query)&&C(r,i);else if(r.matches&&r.matches(i.query)&&C(r,i),r.querySelectorAll){const a=r.querySelectorAll(i.query);for(let n=0;n<a.length;n++)C(a[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s],a=i.query;if(a){if(!l)r.matches&&r.matches(a)&&O(r,i);else if(r.matches&&r.matches(a)&&O(r,i),r.querySelectorAll){const n=r.querySelectorAll(a);for(let c=0;c<n.length;c++)O(n[c],i)}}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{Ae(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){L().push(e),z()}function X(e,t,o,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,w=u?be(u):d,m=u?new Set(Object.keys(u)):null,p=l.persist||null;function f(D){const g=D||document.body;if(Q(g,e,t,o),u&&N())for(const y in u){const Te=u[y],I=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&I.push(g);for(let R=0;R<I.length;R++){const F=I[R];A(F)&&P(Te,F.getAttribute(y),y,r,F)}}n&&n(g)}const h=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)h.push(g[1])}else h.push(e);ye({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:o,onInit:n,observed:h.concat(s),onAttributeChange:i,onAttrChange:c,effects:w,declared:m,persist:p}),_e();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,_=l.subtreeQuery||(b?e:"["+e+"]");L().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:_}),z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=Se);function te(){ge()>0?Ce(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),f}function Y(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,o={},r=Y(t);if(!r)return o;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),n=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function xe(e){if(!e)return null;const t=q();return e in t?t[e]:null}function ke(e,t){if(!e)return;const o=q();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const i=o[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=xe,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Re(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Re);const Z={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function ee(e,t=0){return e?!!(e.valid&&t===0):t===0}function Fe(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Ne(e,t){const o=[];if(e){const r=Object.keys(Z);for(let l=0;l<r.length;l++){const s=r[l],i=Z[s];e[i]&&o.push(s)}}if(t){const r=Array.from(t);for(let l=0;l<r.length;l++)r[l]&&o.indexOf(r[l])===-1&&o.push(r[l])}return o}(function(){const e="data-ln-validate",t="lnValidate",o="data-ln-validate-errors",r="data-ln-validate-error",l="ln-validate-valid",s="ln-validate-invalid";if(window[t]!==void 0)return;const i={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,d=n.tagName,u=n.type,w=d==="SELECT"||u==="checkbox"||u==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(p){const f=p.detail&&p.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const h=n.closest(".form-element");if(h){const b=h.querySelector("["+r+'="'+f+'"]');b&&b.classList.remove("hidden")}n.classList.remove(l),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(p){const f=p.detail&&p.detail.error,h=n.closest(".form-element");if(f){if(c._customErrors.delete(f),h){const b=h.querySelector("["+r+'="'+f+'"]');b&&b.classList.add("hidden")}}else c._customErrors.forEach(function(b){if(h){const _=h.querySelector("["+r+'="'+b+'"]');_&&_.classList.add("hidden")}}),c._customErrors.clear();c._touched&&c.validate()},w||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const m=n.form;return m&&(m.hasAttribute("novalidate")||m.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(p){c._touched=!0,!c.validate()&&p.detail&&p.detail.invalidFields&&p.detail.invalidFields.push(c.dom)},m.addEventListener("reset",this._onFormReset),m.addEventListener("ln-validate:request-validate",this._onValidateRequest),m._lnValidateGateBound||(m._lnValidateGateBound=!0,m.addEventListener("submit",function(p){const f={invalidFields:[]};S(m,"ln-validate:request-validate",f),f.invalidFields.length>0&&(p.preventDefault(),f.invalidFields.sort((h,b)=>h.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Fe(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=ee(c,this._customErrors.size),u=Ne(c,this._customErrors),w=n.closest(".form-element");if(w){const p=w.querySelector("["+o+"]");if(p){const f=p.querySelectorAll("["+r+"]");for(let h=0;h<f.length;h++){const b=f[h].getAttribute(r);f[h].classList.toggle("hidden",!u.includes(b))}}}return n.classList.toggle(l,d),n.classList.toggle(s,!d),n.setAttribute("aria-invalid",d?"false":"true"),S(n,d?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:u}),d},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.remove(l,s),this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const c=n.querySelectorAll("["+r+"]");for(let d=0;d<c.length;d++)c[d].classList.add("hidden")}},Object.defineProperty(a.prototype,"isValid",{get:function(){return ee(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(l,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},X(e,t,a,"ln-validate",{attributes:i})})()})();
1
+ (function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!S(i))return}e.apply(console,t)}}function x(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,r={},s=e.elements,l={};if(o)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&l[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&r[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")r[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);r[n.name]=n.value===""||isNaN(c)?null:c}else r[n.name]=n.value}return r}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const o=e.elements,i=[],r={};for(let s=0;s<o.length;s++){const l=o[s];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let s=0;s<o.length;s++){const l=o[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=le(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 c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].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=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=re);const $={};function ae(e,t){$[e]=t}function ce(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ue(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];B[o]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=de);const L={};function he(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=L[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function V(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(u,t[p])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(u,!!t[p])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[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 o=0;o<t.length;o++)t[o].textContent=""}})));function j(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const l=r[s],a=l.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function pe(e,t,o,i,r,s){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(i(c));let u=l[d];if(u)r(u,c,n);else{const p=he(o,s);if(!p||(j(p,c),u=p.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),r(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=V,window.lnCore.lnFill=we,window.lnCore.renderList=pe);function E(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function W(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function U(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const k=new Map;function K(e,t){const o=(e?e.join("|"):"")+"::"+t;if(k.has(o))return k.get(o);const i=new Set(e||[]),r=function(s,l){const a=s.getAttribute(l);return a!==null&&i.has(a)?a:t};return k.set(o,r),r}function P(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function Q(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function G(e,t,o,i,r){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 a=n=>{r?console.warn(n,r):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,o){for(const i in o){const[r,s,l]=o[i];Object.defineProperty(e,i,{get:function(){return r(t,s,l)},enumerable:!0,configurable:!0})}return e}function me(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=K(i.values,i.fallback);break;case"integer":r=W;break;case"float":r=P;break;case"boolean":r=U;break;case"list":r=H;break;case"json":r=Q;break;case"string":default:r=E;break}r||(r=E),t[i.prop]=[r,o,i.fallback]}return t}function ge(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=be,window.lnCore.attrSpec=me,window.lnCore.attrStr=E,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=H,window.lnCore.attrEnum=K,window.lnCore.attrFloat=P,window.lnCore.attrJson=Q);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(s)&&y(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)y(a[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=z(),o=e.observed||[];for(let i=0;i<o.length;i++){const r=o[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Ce(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function X(e,t,o,i){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const l=s.effects&&s.effects[o];l?l(t,o,i):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,i)}}function Ae(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=z(),r=i.byAttr.get(t),s=M()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!r&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&S(l)){const a=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<a.length;c++)G(a[c].spec,n,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(o||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),o){const a=i.byReactive.get(t);a&&X(a,l,t,e.oldValue),i.reactiveWildcard.length&&X(i.reactiveWildcard,l,t,e.oldValue)}if(r)for(let a=0;a<r.length;a++){const n=r[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(J(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ae(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){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 q(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=O();if(!t.length)return;const o=e.target;if(o){const r=o.nodeType===1?o:o.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=R();if(e.target&&i.length)for(let r=0;r<i.length;r++){const s=i[r],l=s.query,a=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;a&&s.onSubtreeChange(a,e)}for(let r=0;r<e.addedNodes.length;r++){const s=e.addedNodes[r];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)s.matches&&s.matches(n.query)&&y(s,n);else if(s.matches&&s.matches(n.query)&&y(s,n),s.querySelectorAll){const c=s.querySelectorAll(n.query);for(let d=0;d<c.length;d++)y(c[d],n)}}n.onInit&&n.onInit(s)}}}for(let r=0;r<e.removedNodes.length;r++){const s=e.removedNodes[r];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c){if(!l)s.matches&&s.matches(c)&&q(s,n);else if(s.matches&&s.matches(c)&&q(s,n),s.querySelectorAll){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)q(d[u],n)}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{xe(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(e){O().push(e),e.onSubtreeChange&&e.query&&R().push(e),Y()}function Z(e,t,o,i,r={}){const s=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,n=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,u=r.attributes||null,p=u?ge(u):d,b=u?new Set(Object.keys(u)):null,m=r.persist||null;function f(I){const g=I||document.body;if(J(g,e,t,o),u&&M())for(const _ in u){const $e=u[_],F=Array.from(g.querySelectorAll("["+_+"]"));g.matches&&g.matches("["+_+"]")&&F.push(g);for(let T=0;T<F.length;T++){const N=F[T];S(N)&&G($e,N.getAttribute(_),_,i,N)}}n&&n(g)}const h=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)h.push(g[1])}else h.push(e);_e({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:o,onInit:n,observed:h.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:b,persist:m}),Se();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=r.subtreeQuery||(w?e:"["+e+"]"),v={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:C};O().push(v),a&&C&&R().push(v),Y(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Le);function oe(){ye()>0?ve(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function ee(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,o={},i=ee(t);if(!i)return o;const r=i.split("&");for(let s=0;s<r.length;s++){const l=r[s];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Ee(e){if(!e)return null;const t=D();return e in t?t[e]:null}function ke(e,t){if(!e)return;const o=D();t==null?delete o[e]:o[e]=String(t);const r=Object.keys(o).map(function(s){const l=o[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ee(location.hash)!==r&&(location.hash=r)}function Oe(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.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 De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),r=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=Ee,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Fe);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);const te={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function ne(e,t=0){return e?!!(e.valid&&t===0):t===0}function Ne(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Me(e,t){const o=[];if(e){const i=Object.keys(te);for(let r=0;r<i.length;r++){const s=i[r],l=te[s];e[l]&&o.push(s)}}if(t){const i=Array.from(t);for(let r=0;r<i.length;r++)i[r]&&o.indexOf(i[r])===-1&&o.push(i[r])}return o}(function(){const e="data-ln-validate",t="lnValidate",o="data-ln-validate-errors",i="data-ln-validate-error",r="ln-validate-valid",s="ln-validate-invalid";if(window[t]!==void 0)return;const l={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,d=n.tagName,u=n.type,p=d==="SELECT"||u==="checkbox"||u==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(m){const f=m.detail&&m.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const h=n.closest(".form-element");if(h){const w=h.querySelector("["+i+'="'+f+'"]');w&&w.classList.remove("hidden")}n.classList.remove(r),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const f=m.detail&&m.detail.error,h=n.closest(".form-element");if(f){if(c._customErrors.delete(f),h){const w=h.querySelector("["+i+'="'+f+'"]');w&&w.classList.add("hidden")}}else c._customErrors.forEach(function(w){if(h){const C=h.querySelector("["+i+'="'+w+'"]');C&&C.classList.add("hidden")}}),c._customErrors.clear();c._touched&&c.validate()},p||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const b=n.form;return b&&(b.hasAttribute("novalidate")||b.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(m){c._touched=!0,!c.validate()&&m.detail&&m.detail.invalidFields&&m.detail.invalidFields.push(c.dom)},b.addEventListener("reset",this._onFormReset),b.addEventListener("ln-validate:request-validate",this._onValidateRequest),b._lnValidateGateBound||(b._lnValidateGateBound=!0,b.addEventListener("submit",function(m){const f={invalidFields:[]};x(b,"ln-validate:request-validate",f),f.invalidFields.length>0&&(m.preventDefault(),f.invalidFields.sort((h,w)=>h.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Ne(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=ne(c,this._customErrors.size),u=Me(c,this._customErrors),p=n.closest(".form-element");if(p){const f=p.querySelector("["+o+"]");if(f){const h=f.querySelectorAll("["+i+"]");for(let w=0;w<h.length;w++){const C=h[w].getAttribute(i),v=!u.includes(C);h[w].classList.contains("hidden")!==v&&h[w].classList.toggle("hidden",v)}}}n.classList.contains(r)!==d&&n.classList.toggle(r,d),n.classList.contains(s)===d&&n.classList.toggle(s,!d);const b=d?"false":"true";return n.getAttribute("aria-invalid")!==b&&n.setAttribute("aria-invalid",b),x(n,d?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:u}),d},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.contains(r)&&this.dom.classList.remove(r),this.dom.classList.contains(s)&&this.dom.classList.remove(s),this.dom.hasAttribute("aria-invalid")&&this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const c=n.querySelectorAll("["+i+"]");for(let d=0;d<c.length;d++)c[d].classList.contains("hidden")||c[d].classList.add("hidden")}},Object.defineProperty(a.prototype,"isValid",{get:function(){return ne(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(r,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},Z(e,t,a,"ln-validate",{attributes:l})})()})();
@@ -140,14 +140,25 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
140
140
  const items = errorList.querySelectorAll('[' + ERROR_SELECTOR + ']');
141
141
  for (let i = 0; i < items.length; i++) {
142
142
  const errorKey = items[i].getAttribute(ERROR_SELECTOR);
143
- items[i].classList.toggle('hidden', !activeErrors.includes(errorKey));
143
+ const shouldHide = !activeErrors.includes(errorKey);
144
+ if (items[i].classList.contains('hidden') !== shouldHide) {
145
+ items[i].classList.toggle('hidden', shouldHide);
146
+ }
144
147
  }
145
148
  }
146
149
  }
147
150
 
148
- dom.classList.toggle(CSS_VALID, isValid);
149
- dom.classList.toggle(CSS_INVALID, !isValid);
150
- dom.setAttribute('aria-invalid', isValid ? 'false' : 'true');
151
+ if (dom.classList.contains(CSS_VALID) !== isValid) {
152
+ dom.classList.toggle(CSS_VALID, isValid);
153
+ }
154
+ if (dom.classList.contains(CSS_INVALID) === isValid) {
155
+ dom.classList.toggle(CSS_INVALID, !isValid);
156
+ }
157
+
158
+ const ariaStr = isValid ? 'false' : 'true';
159
+ if (dom.getAttribute('aria-invalid') !== ariaStr) {
160
+ dom.setAttribute('aria-invalid', ariaStr);
161
+ }
151
162
 
152
163
  const eventName = isValid ? 'ln-validate:valid' : 'ln-validate:invalid';
153
164
  dispatch(dom, eventName, { target: dom, field: dom.name, errors: activeErrors });
@@ -158,14 +169,17 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
158
169
  _component.prototype.reset = function () {
159
170
  this._touched = false;
160
171
  this._customErrors.clear();
161
- this.dom.classList.remove(CSS_VALID, CSS_INVALID);
162
- this.dom.removeAttribute('aria-invalid');
172
+ if (this.dom.classList.contains(CSS_VALID)) this.dom.classList.remove(CSS_VALID);
173
+ if (this.dom.classList.contains(CSS_INVALID)) this.dom.classList.remove(CSS_INVALID);
174
+ if (this.dom.hasAttribute('aria-invalid')) this.dom.removeAttribute('aria-invalid');
163
175
 
164
176
  const parent = this.dom.closest('.form-element');
165
177
  if (parent) {
166
178
  const items = parent.querySelectorAll('[' + ERROR_SELECTOR + ']');
167
179
  for (let i = 0; i < items.length; i++) {
168
- items[i].classList.add('hidden');
180
+ if (!items[i].classList.contains('hidden')) {
181
+ items[i].classList.add('hidden');
182
+ }
169
183
  }
170
184
  }
171
185
  };
@@ -1 +1 @@
1
- (function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){n=t[s];break}if(!S(n))return}e.apply(console,t)}}function m(e,t,o){const n=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(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 o=!!(t&&t.typed),n=t&&t.exclude,s={},l=e.elements,i={};if(o)for(let c=0;c<l.length;c++){const r=l[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let c=0;c<l.length;c++){const r=l[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(n&&r.matches&&r.matches(n)))if(r.type==="checkbox")o&&i[r.name]===1?s[r.name]=r.checked:(s[r.name]||(s[r.name]=[]),r.checked&&s[r.name].push(r.value));else if(r.type==="radio")r.checked&&(s[r.name]=r.value);else if(r.type==="select-multiple"){s[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&s[r.name].push(r.options[u].value)}else if(o&&r.type==="hidden")s[r.name]=r.value;else if(o&&(r.type==="number"||r.type==="range")){const u=Number(r.value);s[r.name]=r.value===""||isNaN(u)?null:u}else s[r.name]=r.value}return s}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 ie(e,t){const o=e.elements,n=[],s={};for(let l=0;l<o.length;l++){const i=o[l];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let l=0;l<o.length;l++){const i=o[l];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 r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(s[i.name]>1){const u=String(r).split(",").map(function(b){return b.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=re(r);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<i.options.length;u++)i.options[u].selected=r.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ne);const F={};function se(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=se,window.lnCore.getDataMapper=le);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function ae(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];$[o]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ce);const q={};function ue(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=q[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const b=r[u].trim().split(":");if(b.length!==2)continue;const f=b[0].trim(),a=b[1].trim();t[a]!=null&&c.setAttribute(f,t[a])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const l=e.querySelectorAll("[data-ln-class]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const b=r[u].trim().split(":");if(b.length!==2)continue;const f=b[0].trim(),a=b[1].trim();a in t&&c.classList.toggle(f,!!t[a])}}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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<o.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[n],t??null),o[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function j(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(l,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let l=0;l<s.length;l++){const i=s[l],c=i.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function he(e,t,o,n,s,l){const i={};for(let r=0;r<e.children.length;r++){const u=e.children[r],b=u.getAttribute("data-ln-render-key");b&&(i[b]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],b=String(n(u));let f=i[b];if(f)s(f,u,r);else{const a=ue(o,l);if(!a||(j(a,u),f=a.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",b),s(f,u,r)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=B,window.lnCore.lnFill=fe,window.lnCore.renderList=he);function v(e,t,o){const n=e.getAttribute(t);return n===null?o:n}function W(e,t,o){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?o:n}function U(e,t,o=!1){const n=e.getAttribute(t);if(n===null)return!!o;const s=n.trim().toLowerCase();return!(s==="false"||s==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const O=new Map;function V(e,t){const o=(e?e.join("|"):"")+"::"+t;if(O.has(o))return O.get(o);const n=new Set(e||[]),s=function(l,i){const c=l.getAttribute(i);return c!==null&&n.has(c)?c:t};return O.set(o,s),s}function H(e,t,o){const n=parseFloat(e.getAttribute(t));return isNaN(n)?o:n}function J(e,t,o){const n=e.getAttribute(t);if(!n)return o;try{return JSON.parse(n)}catch{return o}}function Q(e,t,o,n,s){if(!e||t===null)return!0;const l=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{s?console.warn(r,s):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${o}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${l}] Value ${r} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${l}] Value ${r} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${l}] Invalid JSON for attribute "${o}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,o){for(const n in o){const[s,l,i]=o[n];Object.defineProperty(e,n,{get:function(){return s(t,l,i)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const o in e){const n=e[o];if(!n||!n.prop)continue;let s=n.read;if(!s&&n.type)switch(n.type){case"enum":s=V(n.values,n.fallback);break;case"integer":s=W;break;case"float":s=H;break;case"boolean":s=U;break;case"list":s=K;break;case"json":s=J;break;case"string":default:s=v;break}s||(s=v),t[n.prop]=[s,o,n.fallback]}return t}function we(e){const t={};for(const o in e){const n=e[o];n&&n.effect&&(t[o]=n.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=P,window.lnCore.attrSpec=G,window.lnCore.attrStr=v,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=K,window.lnCore.attrEnum=V,window.lnCore.attrFloat=H,window.lnCore.attrJson=J);function _(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function z(e,t,o,n){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:n};if(e.matches&&e.matches(l)&&_(e,i),e.querySelectorAll){const c=e.querySelectorAll(l);for(let r=0;r<c.length;r++)_(c[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function me(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=X(),o=e.observed||[];for(let n=0;n<o.length;n++){const s=o[n];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const s=t.byDeclaredAttr.get(n);s.some(l=>l.componentTag===e.componentTag)||s.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=pe(e);if(n===null)t.reactiveWildcard.push(e);else for(const s of n)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,o,n){for(let s=0;s<e.length;s++){const l=e[s];if(!t[l.attribute])continue;const i=l.effects&&l.effects[o];i?i(t,o,n):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,n)}}function ye(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,n=X(),s=n.byAttr.get(t),l=M()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!o&&!s&&!l)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(l&&S(i)){const c=n.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let u=0;u<c.length;u++)Q(c[u].spec,r,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const c=n.byReactive.get(t);c&&Y(c,i,t,e.oldValue),n.reactiveWildcard.length&&Y(n.reactiveWildcard,i,t,e.oldValue)}if(s)for(let c=0;c<s.length;c++){const r=s[c];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(z(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ye(t[o])}catch(n){console.error("[ln-core] mutation handler failed",t[o].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function E(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function _e(e){const t=E();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const s=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;l&&n.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const i=t[l];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)n.matches&&n.matches(i.query)&&_(n,i);else if(n.matches&&n.matches(i.query)&&_(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let r=0;r<c.length;r++)_(c[r],i)}}i.onInit&&i.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const i=t[l],c=i.query;if(c){if(!s)n.matches&&n.matches(c)&&L(n,i);else if(n.matches&&n.matches(c)&&L(n,i),n.querySelectorAll){const r=n.querySelectorAll(c);for(let u=0;u<r.length;u++)L(r[u],i)}}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const n=t[o];if(n.type==="childList")try{_e(n)}catch(s){console.error("[ln-core] lifecycle handler failed",n.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){E().push(e),Z()}function ee(e,t,o,n,s={}){const l=s.extraAttributes||[],i=s.onAttributeChange||null,c=s.onSubtreeChange||null,r=s.onInit||null,u=s.onAttrChange||null,b=s.effects||null,f=s.attributes||null,a=f?we(f):b,d=f?new Set(Object.keys(f)):null,h=s.persist||null;function w(D){const g=D||document.body;if(z(g,e,t,o),f&&M())for(const k in f){const De=f[k],R=Array.from(g.querySelectorAll("["+k+"]"));g.matches&&g.matches("["+k+"]")&&R.push(g);for(let T=0;T<R.length;T++){const N=R[T];S(N)&&Q(De,N.getAttribute(k),k,n,N)}}r&&r(g)}const p=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)p.push(g[1])}else p.push(e);ge({selector:e,attribute:t,componentTag:n,attributes:f,ComponentFn:o,onInit:r,observed:p.concat(l),onAttributeChange:i,onAttrChange:u,effects:a,declared:d,persist:h}),Ce();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,x=s.subtreeQuery||(y?e:"["+e+"]");E().push({selector:e,attribute:t,ComponentFn:o,onInit:r,onSubtreeChange:c,query:x}),Z(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=ke);function C(){be()>0?me(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",C):C(),w}function te(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,o={},n=te(t);if(!n)return o;const s=n.split("&");for(let l=0;l<s.length;l++){const i=s[l];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(r)try{o[r]=decodeURIComponent(u)}catch{o[r]=u}}return o}function Ae(e){if(!e)return null;const t=I();return e in t?t[e]:null}function ve(e,t){if(!e)return;const o=I();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(l){const i=o[l];return i===""?l:l+":"+encodeURIComponent(i)}).join("&");te(location.hash)!==s&&(location.hash=s)}function xe(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),n=e.slice(t+1),s=n?n.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Ae,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);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-websocket-connector",t="lnWebsocketConnector",o="lnConnector";if(window[t]!==void 0)return;const n=1e3,s=3e4;function l(a){const d=a[t];d&&(d.command==="connect"?d._open():d._disconnect())}function i(a){const d=a[t];!d||d.command!=="connect"||(d._drop("url-changed"),d._open())}const c={"data-ln-websocket-connector":{prop:"command",type:"enum",values:["connect","disconnect"],fallback:"connect",effect:l,description:"Connection command set from outside: connect or disconnect"},"data-ln-websocket-connector-url":{prop:"url",read:v,type:"string",fallback:"",effect:i,description:"WebSocket endpoint URL (ws:// or wss://)"}},r=G(c),u={"ln-websocket-connector:request-sync":"sync","ln-websocket-connector:request-query":"query","ln-websocket-connector:request-create":"create","ln-websocket-connector:request-update":"update","ln-websocket-connector:request-delete":"delete","ln-websocket-connector:request-bulk-delete":"bulk-delete"};function b(a,d){return a==="sync"?{since:d.since}:a==="query"?{query:d.query||{}}:a==="create"?{data:d.data,idempotencyKey:d.idempotencyKey}:a==="update"?{id:d.id,data:d.data,expected_version:d.expected_version,idempotencyKey:d.idempotencyKey}:a==="delete"?{id:d.id,idempotencyKey:d.idempotencyKey}:{ids:d.ids,idempotencyKey:d.idempotencyKey}}function f(a){this.dom=a,P(this,a,r),a[t]=this,a[o]=this,this.namespace="ln-websocket-connector",this._socket=null,this._status="disconnected",this._attempt=0,this._timer=null,this._seq=0,this._pending=new Map,this._held=[];const d=this;this._onRequest=function(h){d._request(u[h.type],h.detail||{})};for(const h in u)a.addEventListener(h,this._onRequest);return this.command==="connect"&&this._open(),this}f.prototype._open=function(){if(this._socket||this._timer)return;const a=this,d=this.url;this._attempt++,this._status="connecting",m(this.dom,"ln-websocket-connector:connecting",{url:d,attempt:this._attempt});let h;try{h=new WebSocket(d)}catch(w){this._status="disconnected",this._attempt=0,this._failAll(this._held,w.message),this._held=[],m(this.dom,"ln-websocket-connector:disconnected",{url:d,code:0,reason:w.message,willReconnect:!1});return}this._socket=h,h.onopen=function(){a._status="connected",a._attempt=0,m(a.dom,"ln-websocket-connector:connected",{url:d});const w=a._held;a._held=[];for(let p=0;p<w.length;p++)a._send(w[p])},h.onmessage=function(w){a._receive(w.data)},h.onclose=function(w){a._socket=null,a._status="disconnected",a._failPending("connection closed");const p=a.command==="connect";m(a.dom,"ln-websocket-connector:disconnected",{url:d,code:w.code,reason:w.reason,willReconnect:p}),p&&a._scheduleReconnect()}},f.prototype._scheduleReconnect=function(){const a=this,d=Math.min(n*Math.pow(2,Math.max(0,this._attempt-1)),s);this._timer=setTimeout(function(){a._timer=null,a._open()},d)},f.prototype._drop=function(a){const d=!!(this._socket||this._timer);clearTimeout(this._timer),this._timer=null,this._attempt=0,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,a),this._socket=null),d&&(this._status="disconnected",this._failPending("connection closed"),m(this.dom,"ln-websocket-connector:disconnected",{url:this.url,code:1e3,reason:a,willReconnect:!1}))},f.prototype._disconnect=function(){this._drop("disconnect"),this._failAll(this._held,"disconnected"),this._held=[]},f.prototype._request=function(a,d){const h={ref:String(++this._seq),type:a,detail:d};this._status==="connected"?this._send(h):this.command==="connect"?this._held.push(h):this._fail(h,0,"disconnected",null)},f.prototype._send=function(a){this._pending.set(a.ref,a),this._socket.send(JSON.stringify(Object.assign({ref:a.ref,type:a.type},b(a.type,a.detail))))},f.prototype._receive=function(a){let d;try{d=JSON.parse(a)}catch{console.warn("[ln-websocket-connector] Ignored a frame that is not JSON:",a);return}if(d.ref!==void 0){const h=this._pending.get(String(d.ref));if(!h)return;this._pending.delete(h.ref),d.ok?this._resolve(h,d.content,d.message||null):this._fail(h,d.status||0,d.error,d.data);return}d.type==="changes"&&m(this.dom,"ln-websocket-connector:fetched",{data:{data:d.data||[],deleted:d.deleted||[],synced_at:d.synced_at},since:null,meta:null})},f.prototype._resolve=function(a,d,h){const w=a.detail,p=w.meta||null,y=this.dom;if(a.type==="sync")m(y,"ln-websocket-connector:fetched",{data:d,since:w.since,meta:p});else if(a.type==="query"){const x=w.query||{},C=d||{};m(y,"ln-websocket-connector:fetched",{data:C.data||[],total:C.total,filtered:C.filtered,offset:x.offset,queryGen:x.queryGen,meta:p})}else a.type==="create"?m(y,"ln-websocket-connector:created",{record:d,tempId:w.tempId,message:h,meta:p}):a.type==="update"?m(y,"ln-websocket-connector:updated",{record:d,id:w.id,message:h,meta:p}):a.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:d,id:w.id,message:h,meta:p}):m(y,"ln-websocket-connector:bulk-deleted",{response:d,ids:w.ids,message:h,meta:p})},f.prototype._fail=function(a,d,h,w){const p=a.detail;m(this.dom,"ln-websocket-connector:error",{action:a.type,error:h,status:d,data:w||null,conflictData:d===409&&w||null,since:p.since,id:p.id,ids:p.ids,tempId:p.tempId,meta:p.meta||null})},f.prototype._failAll=function(a,d){for(let h=0;h<a.length;h++)this._fail(a[h],0,d,null)},f.prototype._failPending=function(a){const d=Array.from(this._pending.values());this._pending.clear(),this._failAll(d,a)},f.prototype.destroy=function(){if(this.dom[t]){for(const a in u)this.dom.removeEventListener(a,this._onRequest);clearTimeout(this._timer),this._timer=null,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,"destroy"),this._socket=null),this._pending.clear(),this._held=[],delete this.dom[t],delete this.dom[o]}},ee(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
1
+ (function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let s=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){s=t[i];break}if(!S(s))return}e.apply(console,t)}}function m(e,t,o){const s=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const o=!!(t&&t.typed),s=t&&t.exclude,i={},l=e.elements,r={};if(o)for(let c=0;c<l.length;c++){const n=l[c];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[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")o&&r[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 u=0;u<n.options.length;u++)n.options[u].selected&&i[n.name].push(n.options[u].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const u=Number(n.value);i[n.name]=n.value===""||isNaN(u)?null:u}else i[n.name]=n.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const o=e.elements,s=[],i={};for(let l=0;l<o.length;l++){const r=o[l];r.name&&r.type==="checkbox"&&(i[r.name]=(i[r.name]||0)+1)}for(let l=0;l<o.length;l++){const r=o[l];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const n=t[c];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(i[r.name]>1){const u=String(n).split(",").map(function(w){return w.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=se(n);s.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),s.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<r.options.length;u++)r.options[u].selected=n.indexOf(r.options[u].value)!==-1;s.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),s.push(r)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=re);const $={};function ce(e,t){$[e]=t}function de(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ue(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];B[o]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ae);const q={};function he(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=q[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function j(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const c=o[r],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const s=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<s.length;r++){const c=s[r],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const w=n[u].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),d=w[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let r=0;r<i.length;r++){const c=i[r],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let r=0;r<l.length;r++){const c=l[r],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const w=n[u].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),d=w[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<o.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[s],t??null),o[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)j(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function W(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const s=function(l,r){return t[r]!==void 0?t[r]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const r=i[l],c=r.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return e}function pe(e,t,o,s,i,l){const r={};for(let n=0;n<e.children.length;n++){const u=e.children[n],w=u.getAttribute("data-ln-render-key");w&&(r[w]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],w=String(s(u));let f=r[w];if(f)i(f,u,n);else{const d=he(o,l);if(!d||(W(d,u),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",w),i(f,u,n)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=j,window.lnCore.lnFill=we,window.lnCore.renderList=pe);function x(e,t,o){const s=e.getAttribute(t);return s===null?o:s}function U(e,t,o){const s=parseInt(e.getAttribute(t),10);return isNaN(s)?o:s}function K(e,t,o=!1){const s=e.getAttribute(t);if(s===null)return!!o;const i=s.trim().toLowerCase();return!(i==="false"||i==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const E=new Map;function H(e,t){const o=(e?e.join("|"):"")+"::"+t;if(E.has(o))return E.get(o);const s=new Set(e||[]),i=function(l,r){const c=l.getAttribute(r);return c!==null&&s.has(c)?c:t};return E.set(o,i),i}function J(e,t,o){const s=parseFloat(e.getAttribute(t));return isNaN(s)?o:s}function Q(e,t,o){const s=e.getAttribute(t);if(!s)return o;try{return JSON.parse(s)}catch{return o}}function P(e,t,o,s,i){if(!e||t===null)return!0;const l=s||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${l}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${l}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${l}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e,t,o){for(const s in o){const[i,l,r]=o[s];Object.defineProperty(e,s,{get:function(){return i(t,l,r)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const o in e){const s=e[o];if(!s||!s.prop)continue;let i=s.read;if(!i&&s.type)switch(s.type){case"enum":i=H(s.values,s.fallback);break;case"integer":i=U;break;case"float":i=J;break;case"boolean":i=K;break;case"list":i=V;break;case"json":i=Q;break;case"string":default:i=x;break}i||(i=x),t[s.prop]=[i,o,s.fallback]}return t}function be(e){const t={};for(const o in e){const s=e[o];s&&s.effect&&(t[o]=s.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=G,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=U,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=J,window.lnCore.attrJson=Q);function _(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function X(e,t,o,s){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:s};if(e.matches&&e.matches(l)&&_(e,r),e.querySelectorAll){const c=e.querySelectorAll(l);for(let n=0;n<c.length;n++)_(c[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=Y(),o=e.observed||[];for(let s=0;s<o.length;s++){const i=o[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=me(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 Z(e,t,o,s){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const r=l.effects&&l.effects[o];r?r(t,o,s):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,s)}}function _e(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,s=Y(),i=s.byAttr.get(t),l=F()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(t);if(!o&&!i&&!l)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(l&&S(r)){const c=s.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let u=0;u<c.length;u++)P(c[u].spec,n,t,c[u].componentTag,r)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const c=s.byReactive.get(t);c&&Z(c,r,t,e.oldValue),s.reactiveWildcard.length&&Z(s.reactiveWildcard,r,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(X(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{_e(t[o])}catch(s){console.error("[ln-core] mutation handler failed",t[o].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(s){console.error("["+t.attribute+"] destroy failed",e,s)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=O();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const s=L();if(e.target&&s.length)for(let i=0;i<s.length;i++){const l=s[i],r=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):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 r=!!(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(!r)l.matches&&l.matches(n.query)&&_(l,n);else if(l.matches&&l.matches(n.query)&&_(l,n),l.querySelectorAll){const u=l.querySelectorAll(n.query);for(let w=0;w<u.length;w++)_(u[w],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 r=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!r)l.matches&&l.matches(u)&&R(l,n);else if(l.matches&&l.matches(u)&&R(l,n),l.querySelectorAll){const w=l.querySelectorAll(u);for(let f=0;f<w.length;f++)R(w[f],n)}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const s=t[o];if(s.type==="childList")try{Ae(s)}catch(i){console.error("[ln-core] lifecycle handler failed",s.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e){O().push(e),e.onSubtreeChange&&e.query&&L().push(e),ee()}function te(e,t,o,s,i={}){const l=i.extraAttributes||[],r=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,u=i.onAttrChange||null,w=i.effects||null,f=i.attributes||null,d=f?be(f):w,a=f?new Set(Object.keys(f)):null,h=i.persist||null;function p(D){const g=D||document.body;if(X(g,e,t,o),f&&F())for(const A in f){const Te=f[A],T=Array.from(g.querySelectorAll("["+A+"]"));g.matches&&g.matches("["+A+"]")&&T.push(g);for(let N=0;N<T.length;N++){const M=T[N];S(M)&&P(Te,M.getAttribute(A),A,s,M)}}n&&n(g)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)b.push(g[1])}else b.push(e);Ce({selector:e,attribute:t,componentTag:s,attributes:f,ComponentFn:o,onInit:n,observed:b.concat(l),onAttributeChange:r,onAttrChange:u,effects:d,declared:a,persist:h}),ke();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=i.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:k};O().push(C),c&&k&&L().push(C),ee(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=ve);function oe(){ge()>0?ye(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),p}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,o={},s=ne(t);if(!s)return o;const i=s.split("&");for(let l=0;l<i.length;l++){const r=i[l];if(!r)continue;const c=r.indexOf(":"),n=c>-1?r.slice(0,c):r,u=c>-1?r.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(u)}catch{o[n]=u}}return o}function xe(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Se(e,t){if(!e)return;const o=I();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(l){const r=o[l];return r===""?l:l+":"+encodeURIComponent(r)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const 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 Oe(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 Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=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:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=xe,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=Ie);function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=De),(function(){const e="data-ln-websocket-connector",t="lnWebsocketConnector",o="lnConnector";if(window[t]!==void 0)return;const s=1e3,i=3e4;function l(d){const a=d[t];a&&(a.command==="connect"?a._open():a._disconnect())}function r(d){const a=d[t];!a||a.command!=="connect"||(a._drop("url-changed"),a._open())}const c={"data-ln-websocket-connector":{prop:"command",type:"enum",values:["connect","disconnect"],fallback:"connect",effect:l,description:"Connection command set from outside: connect or disconnect"},"data-ln-websocket-connector-url":{prop:"url",read:x,type:"string",fallback:"",effect:r,description:"WebSocket endpoint URL (ws:// or wss://)"}},n=z(c),u={"ln-websocket-connector:request-sync":"sync","ln-websocket-connector:request-query":"query","ln-websocket-connector:request-create":"create","ln-websocket-connector:request-update":"update","ln-websocket-connector:request-delete":"delete","ln-websocket-connector:request-bulk-delete":"bulk-delete"};function w(d,a){return d==="sync"?{since:a.since}:d==="query"?{query:a.query||{}}:d==="create"?{data:a.data,idempotencyKey:a.idempotencyKey}:d==="update"?{id:a.id,data:a.data,expected_version:a.expected_version,idempotencyKey:a.idempotencyKey}:d==="delete"?{id:a.id,idempotencyKey:a.idempotencyKey}:{ids:a.ids,idempotencyKey:a.idempotencyKey}}function f(d){this.dom=d,G(this,d,n),d[t]=this,d[o]=this,this.namespace="ln-websocket-connector",this._socket=null,this._status="disconnected",this._attempt=0,this._timer=null,this._seq=0,this._pending=new Map,this._held=[];const a=this;this._onRequest=function(h){a._request(u[h.type],h.detail||{})};for(const h in u)d.addEventListener(h,this._onRequest);return this.command==="connect"&&this._open(),this}f.prototype._open=function(){if(this._socket||this._timer)return;const d=this,a=this.url;this._attempt++,this._status="connecting",m(this.dom,"ln-websocket-connector:connecting",{url:a,attempt:this._attempt});let h;try{h=new WebSocket(a)}catch(p){this._status="disconnected",this._attempt=0,this._failAll(this._held,p.message),this._held=[],m(this.dom,"ln-websocket-connector:disconnected",{url:a,code:0,reason:p.message,willReconnect:!1});return}this._socket=h,h.onopen=function(){d._status="connected",d._attempt=0,m(d.dom,"ln-websocket-connector:connected",{url:a});const p=d._held;d._held=[];for(let b=0;b<p.length;b++)d._send(p[b])},h.onmessage=function(p){d._receive(p.data)},h.onclose=function(p){d._socket=null,d._status="disconnected",d._failPending("connection closed");const b=d.command==="connect";m(d.dom,"ln-websocket-connector:disconnected",{url:a,code:p.code,reason:p.reason,willReconnect:b}),b&&d._scheduleReconnect()}},f.prototype._scheduleReconnect=function(){const d=this,a=Math.min(s*Math.pow(2,Math.max(0,this._attempt-1)),i);this._timer=setTimeout(function(){d._timer=null,d._open()},a)},f.prototype._drop=function(d){const a=!!(this._socket||this._timer);clearTimeout(this._timer),this._timer=null,this._attempt=0,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,d),this._socket=null),a&&(this._status="disconnected",this._failPending("connection closed"),m(this.dom,"ln-websocket-connector:disconnected",{url:this.url,code:1e3,reason:d,willReconnect:!1}))},f.prototype._disconnect=function(){this._drop("disconnect"),this._failAll(this._held,"disconnected"),this._held=[]},f.prototype._request=function(d,a){const h={ref:String(++this._seq),type:d,detail:a};this._status==="connected"?this._send(h):this.command==="connect"?this._held.push(h):this._fail(h,0,"disconnected",null)},f.prototype._send=function(d){this._pending.set(d.ref,d),this._socket.send(JSON.stringify(Object.assign({ref:d.ref,type:d.type},w(d.type,d.detail))))},f.prototype._receive=function(d){let a;try{a=JSON.parse(d)}catch{console.warn("[ln-websocket-connector] Ignored a frame that is not JSON:",d);return}if(a.ref!==void 0){const h=this._pending.get(String(a.ref));if(!h)return;this._pending.delete(h.ref),a.ok?this._resolve(h,a.content,a.message||null):this._fail(h,a.status||0,a.error,a.data);return}a.type==="changes"&&m(this.dom,"ln-websocket-connector:fetched",{data:{data:a.data||[],deleted:a.deleted||[],synced_at:a.synced_at},since:null,meta:null})},f.prototype._resolve=function(d,a,h){const p=d.detail,b=p.meta||null,y=this.dom;if(d.type==="sync")m(y,"ln-websocket-connector:fetched",{data:a,since:p.since,meta:b});else if(d.type==="query"){const k=p.query||{},C=a||{};m(y,"ln-websocket-connector:fetched",{data:C.data||[],total:C.total,filtered:C.filtered,offset:k.offset,queryGen:k.queryGen,meta:b})}else d.type==="create"?m(y,"ln-websocket-connector:created",{record:a,tempId:p.tempId,message:h,meta:b}):d.type==="update"?m(y,"ln-websocket-connector:updated",{record:a,id:p.id,message:h,meta:b}):d.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:a,id:p.id,message:h,meta:b}):m(y,"ln-websocket-connector:bulk-deleted",{response:a,ids:p.ids,message:h,meta:b})},f.prototype._fail=function(d,a,h,p){const b=d.detail;m(this.dom,"ln-websocket-connector:error",{action:d.type,error:h,status:a,data:p||null,conflictData:a===409&&p||null,since:b.since,id:b.id,ids:b.ids,tempId:b.tempId,meta:b.meta||null})},f.prototype._failAll=function(d,a){for(let h=0;h<d.length;h++)this._fail(d[h],0,a,null)},f.prototype._failPending=function(d){const a=Array.from(this._pending.values());this._pending.clear(),this._failAll(a,d)},f.prototype.destroy=function(){if(this.dom[t]){for(const d in u)this.dom.removeEventListener(d,this._onRequest);clearTimeout(this._timer),this._timer=null,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,"destroy"),this._socket=null),this._pending.clear(),this._held=[],delete this.dom[t],delete this.dom[o]}},te(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livenetworks/ashlar",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Live Networks",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@livenetworks/ashlar",
4
- "version": "2.1.0",
4
+ "version": "2.1.2",
5
5
  "framework": "html",
6
6
  "contributions": {
7
7
  "html": {