@livenetworks/ashlar 2.1.8 → 2.1.9

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-autosave/ln-autosave.js +1 -1
  6. package/components/ln-chart/ln-chart.js +1 -1
  7. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  8. package/components/ln-confirm/ln-confirm.js +1 -1
  9. package/components/ln-core/README.md +25 -0
  10. package/components/ln-core/index.js +1 -0
  11. package/components/ln-core/ln-core.schema.json +14 -4
  12. package/components/ln-core/query.js +113 -0
  13. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  14. package/components/ln-data-coordinator/README.md +4 -0
  15. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  16. package/components/ln-data-store/ln-data-store.js +1 -1
  17. package/components/ln-date/ln-date.js +1 -1
  18. package/components/ln-debug/ln-debug.js +1 -1
  19. package/components/ln-debug/src/generated-attributes.js +1 -0
  20. package/components/ln-dropdown/ln-dropdown.js +1 -1
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-fill/ln-fill.js +1 -1
  24. package/components/ln-filter/README.md +1 -0
  25. package/components/ln-filter/ln-filter.js +1 -1
  26. package/components/ln-filter/ln-filter.schema.json +8 -0
  27. package/components/ln-filter/src/ln-filter.js +67 -2
  28. package/components/ln-form/ln-form.js +1 -1
  29. package/components/ln-http/ln-http.js +1 -1
  30. package/components/ln-icon/ln-icon.js +1 -1
  31. package/components/ln-include/ln-include.js +1 -1
  32. package/components/ln-key/ln-key.js +1 -1
  33. package/components/ln-link/ln-link.js +1 -1
  34. package/components/ln-list/ln-list.js +1 -1
  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-obfuscator/ln-obfuscator.js +1 -1
  39. package/components/ln-options/ln-options.js +1 -1
  40. package/components/ln-persist/ln-persist.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-progress/ln-progress.js +1 -1
  44. package/components/ln-router/ln-router.js +1 -1
  45. package/components/ln-scroll/ln-scroll.js +1 -1
  46. package/components/ln-search/README.md +1 -0
  47. package/components/ln-search/ln-search.js +1 -1
  48. package/components/ln-search/ln-search.schema.json +8 -0
  49. package/components/ln-search/src/ln-search.js +54 -2
  50. package/components/ln-slug/ln-slug.js +1 -1
  51. package/components/ln-sort/README.md +1 -0
  52. package/components/ln-sort/ln-sort.js +1 -1
  53. package/components/ln-sort/ln-sort.schema.json +112 -104
  54. package/components/ln-sort/src/ln-sort.js +78 -3
  55. package/components/ln-sortable/ln-sortable.js +1 -1
  56. package/components/ln-stat/ln-stat.js +1 -1
  57. package/components/ln-table/README.md +1 -0
  58. package/components/ln-table/ln-table.js +1 -1
  59. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  60. package/components/ln-tabs/ln-tabs.js +1 -1
  61. package/components/ln-time/ln-time.js +1 -1
  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-websocket-connector/ln-websocket-connector.js +1 -1
  70. package/ln-ashlar.html-data.json +4 -0
  71. package/package.json +1 -1
  72. package/web-types.json +8 -1
@@ -1 +1 @@
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,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function D(e,t,n){const l=n||{};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 ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function de(e,t){const n=!!(t&&t.typed),l=t&&t.exclude,i={},d=e.elements,s={};if(n)for(let u=0;u<d.length;u++){const o=d[u];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let u=0;u<d.length;u++){const o=d[u];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(l&&o.matches&&o.matches(l)))if(o.type==="checkbox")n&&s[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let r=0;r<o.options.length;r++)o.options[r].selected&&i[o.name].push(o.options[r].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const r=Number(o.value);i[o.name]=o.value===""||isNaN(r)?null:r}else i[o.name]=o.value}return i}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,l=[],i={};for(let d=0;d<n.length;d++){const s=n[d];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let d=0;d<n.length;d++){const s=n[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 o=t[u];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(i[s.name]>1){const r=String(o).split(",").map(function(a){return a.trim()});s.checked=r.indexOf(s.value)!==-1}else s.checked=ue(o);l.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),l.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let r=0;r<s.options.length;r++)s.options[r].selected=o.indexOf(s.options[r].value)!==-1;l.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),l.push(s)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=de,window.lnCore.resolveFormMethod=ae);const H={};function fe(e,t){H[e]=t}function pe(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=pe);function he(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,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 ge(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];j[n]=t}function we(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=ge,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=me);const q={};function W(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function be(e,t,n){if(e){const l=e.querySelector('[data-ln-template="'+t+'"]');if(l)return l.content.cloneNode(!0)}return W(t,n)}function _(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],o=u.getAttribute("data-ln-field");t[o]!=null&&(u.textContent=t[o])}const l=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<l.length;s++){const u=l[s],o=u.getAttribute("data-ln-attr").split(",");for(let r=0;r<o.length;r++){const a=o[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],o=u.getAttribute("data-ln-show");o in t&&u.classList.toggle("hidden",!t[o])}const d=e.querySelectorAll("[data-ln-class]");for(let s=0;s<d.length;s++){const u=d[s],o=u.getAttribute("data-ln-class").split(",");for(let r=0;r<o.length;r++){const a=o[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 ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<n.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[l],t??null),n[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)_(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.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 o=0;o<u.length;o++){const r=u[o];r.value.indexOf("{{")!==-1&&s.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Ce(e,t,n,l,i,d){const s={};for(let o=0;o<e.children.length;o++){const r=e.children[o],a=r.getAttribute("data-ln-render-key");a&&(s[a]=r)}const u=document.createDocumentFragment();for(let o=0;o<t.length;o++){const r=t[o],a=String(l(r));let c=s[a];if(c)i(c,r,o);else{const f=W(n,d);if(!f||(P(f,r),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),i(c,r,o)}u.appendChild(c)}e.textContent="",e.appendChild(u)}function ve(e,t){const n={},l=e.querySelectorAll("["+t+"]");for(let i=0;i<l.length;i++)n[l[i].getAttribute(t)]=l[i].textContent,l[i].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=_,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function S(e,t,n){const l=e.getAttribute(t);return l===null?n:l}function L(e,t,n){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?n:l}function V(e,t,n=!1){const l=e.getAttribute(t);if(l===null)return!!n;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const l=new Set(e||[]),i=function(d,s){const u=d.getAttribute(s);return u!==null&&l.has(u)?u:t};return R.set(n,i),i}function J(e,t,n){const l=parseFloat(e.getAttribute(t));return isNaN(l)?n:l}function Q(e,t,n){const l=e.getAttribute(t);if(!l)return n;try{return JSON.parse(l)}catch{return n}}function G(e,t,n,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=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(u(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(u(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(u(`[${d}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(u(`[${d}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return u(`[${d}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,n){for(const l in n){const[i,d,s]=n[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 n in e){const l=e[n];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,n,l.fallback]}return t}function Ae(e){const t={};for(const n in e){const l=e[n];l&&l.effect&&(t[n]=l.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ee(e,t,n,l){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:l};if(e.matches&&e.matches(d)&&I(e,s),e.querySelectorAll){const u=e.querySelectorAll(d);for(let o=0;o<u.length;o++)I(u[o],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 Se(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 Ie(e){const t=te(),n=e.observed||[];for(let l=0;l<n.length;l++){const i=n[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=_e(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,n,l){for(let i=0;i<e.length;i++){const d=e[i];if(!t[d.attribute])continue;const s=d.effects&&d.effects[n];s?s(t,n,l):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,l)}}function Ee(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,l=te(),i=l.byAttr.get(t),d=$()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!n&&!i&&!d)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(d&&F(s)){const u=l.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let r=0;r<u.length;r++)G(u[r].spec,o,t,u[r].componentTag,s)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){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 o=i[u];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(ee(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ee(t[n])}catch(l){console.error("[ln-core] mutation handler failed",t[n].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){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 n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=z();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.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 o=t[u];if(o.selector&&o.attribute&&o.ComponentFn){if(!s)d.matches&&d.matches(o.query)&&I(d,o);else if(d.matches&&d.matches(o.query)&&I(d,o),d.querySelectorAll){const r=d.querySelectorAll(o.query);for(let a=0;a<r.length;a++)I(r[a],o)}}o.onInit&&o.onInit(d)}}}for(let i=0;i<e.removedNodes.length;i++){const d=e.removedNodes[i];if(d.nodeType===1){if(document.contains(d))continue;const s=!!(d.firstElementChild||d.children&&d.children.length);for(let u=0;u<t.length;u++){const o=t[u],r=o.query;if(r){if(!s)d.matches&&d.matches(r)&&T(d,o);else if(d.matches&&d.matches(r)&&T(d,o),d.querySelectorAll){const a=d.querySelectorAll(r);for(let c=0;c<a.length;c++)T(a[c],o)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const l=t[n];if(l.type==="childList")try{oe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let l=0;l<n.length;l++){const i=n[l];if(i.type==="childList")try{oe(i)}catch(d){console.error("[ln-core] lifecycle handler failed",i.target,d)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Fe(e){z().push(e),e.onSubtreeChange&&e.query&&O().push(e),re()}function ie(e,t,n,l,i={}){const d=i.extraAttributes||[],s=i.onAttributeChange||null,u=i.onSubtreeChange||null,o=i.onInit||null,r=i.onAttrChange||null,a=i.effects||null,c=i.attributes||null,f=c?Ae(c):a,p=c?new Set(Object.keys(c)):null,w=i.persist||null;function b(A){const x=A||document.body;if(ee(x,e,t,n),c&&$())for(const E in c){const je=c[E],M=Array.from(x.querySelectorAll("["+E+"]"));x.matches&&x.matches("["+E+"]")&&M.push(x);for(let U=0;U<M.length;U++){const B=M[U];F(B)&&G(je,B.getAttribute(E),E,l,B)}}o&&o(x)}const g=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let x;for(;(x=A.exec(e))!==null;)g.push(x[1])}else g.push(e);Ie({selector:e,attribute:t,componentTag:l,attributes:c,ComponentFn:n,onInit:o,observed:g.concat(d),onAttributeChange:s,onAttrChange:r,effects:f,declared:p,persist:w}),ke();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,m=i.subtreeQuery||(v?e:"["+e+"]"),h={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:u,query:m};z().push(h),u&&m&&O().push(h),re(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Fe,window.lnCore.withoutLifecycle=Le);function y(){xe()>0?Se(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),b}function le(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,n={},l=le(t);if(!l)return n;const i=l.split("&");for(let d=0;d<i.length;d++){const s=i[d];if(!s)continue;const u=s.indexOf(":"),o=u>-1?s.slice(0,u):s,r=u>-1?s.slice(u+1):"";if(o)try{n[o]=decodeURIComponent(r)}catch{n[o]=r}}return n}function De(e){if(!e)return null;const t=N();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=N();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(d){const s=n[d];return s===""?d:d+":"+encodeURIComponent(s)}).join("&");le(location.hash)!==i&&(location.hash=i)}function Re(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ne(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=De,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=ze,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ne,window.lnCore.hashFilterDecode=Me);function Ue(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ue);function Be(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 se(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function $e(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=se(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 n===i})}function He(e,t="en",n={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(n["unit-b"]||"B");const l=1024,i=[n["unit-b"]||"B",n["unit-kb"]||"KB",n["unit-mb"]||"MB",n["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",n="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:n,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 He(r,a,c)}function u(){const r=document.querySelector('meta[name="csrf-token"]');return r?r.getAttribute("content"):""}function o(r){this.dom=r,Z(this,r,d),this.dict=ve(r,"data-ln-upload-dict"),this.locale=he(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=Be(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}o.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()},o.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)}},o.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)},o.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(!$e(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)}},o.prototype._uploadSingleFile=function(r){const a=this,c="file-"+ ++a.fileIdCounter,f=se(r.name);let p=null;if(this.list){const m=be(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"),_(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)),_(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)),_(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"),_(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)")},o.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"),_(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"),_(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"),_(w,{deleting:!1})),C(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:g})})},o.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",{})}},o.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return r.serverId}).filter(Boolean)},o.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return{serverId:r.serverId,name:r.name,size:r.size}})},o.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]}},ie(e,t,o,"ln-upload",{attributes:i})})()})();
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 i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!F(i))return}e.apply(console,t)}}function C(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function q(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function de(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},d=e.elements,s={};if(n)for(let u=0;u<d.length;u++){const o=d[u];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let u=0;u<d.length;u++){const o=d[u];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&s[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let r=0;r<o.options.length;r++)o.options[r].selected&&l[o.name].push(o.options[r].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const r=Number(o.value);l[o.name]=o.value===""||isNaN(r)?null:r}else l[o.name]=o.value}return l}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,i=[],l={};for(let d=0;d<n.length;d++){const s=n[d];s.name&&s.type==="checkbox"&&(l[s.name]=(l[s.name]||0)+1)}for(let d=0;d<n.length;d++){const s=n[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 o=t[u];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(l[s.name]>1){const r=String(o).split(",").map(function(a){return a.trim()});s.checked=r.indexOf(s.value)!==-1}else s.checked=ue(o);i.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),i.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let r=0;r<s.options.length;r++)s.options[r].selected=o.indexOf(s.options[r].value)!==-1;i.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),i.push(s)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=de,window.lnCore.resolveFormMethod=ae);const H={};function fe(e,t){H[e]=t}function pe(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=pe);function he(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function we(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];j[n]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=me);const D={};function W(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 be(e,t,n){if(e){const i=e.querySelector('[data-ln-template="'+t+'"]');if(i)return i.content.cloneNode(!0)}return W(t,n)}function _(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],o=u.getAttribute("data-ln-field");t[o]!=null&&(u.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<i.length;s++){const u=i[s],o=u.getAttribute("data-ln-attr").split(",");for(let r=0;r<o.length;r++){const a=o[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 l=e.querySelectorAll("[data-ln-show]");for(let s=0;s<l.length;s++){const u=l[s],o=u.getAttribute("data-ln-show");o in t&&u.classList.toggle("hidden",!t[o])}const d=e.querySelectorAll("[data-ln-class]");for(let s=0;s<d.length;s++){const u=d[s],o=u.getAttribute("data-ln-class").split(",");for(let r=0;r<o.length;r++){const a=o[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 ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)_(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.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 i=function(d,s){return t[s]!==void 0?t[s]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let d=0;d<l.length;d++){const s=l[d],u=s.attributes;for(let o=0;o<u.length;o++){const r=u[o];r.value.indexOf("{{")!==-1&&s.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ce(e,t,n,i,l,d){const s={};for(let o=0;o<e.children.length;o++){const r=e.children[o],a=r.getAttribute("data-ln-render-key");a&&(s[a]=r)}const u=document.createDocumentFragment();for(let o=0;o<t.length;o++){const r=t[o],a=String(i(r));let c=s[a];if(c)l(c,r,o);else{const f=W(n,d);if(!f||(P(f,r),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),l(c,r,o)}u.appendChild(c)}e.textContent="",e.appendChild(u)}function ve(e,t){const n={},i=e.querySelectorAll("["+t+"]");for(let l=0;l<i.length;l++)n[i[l].getAttribute(t)]=i[l].textContent,i[l].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=_,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function S(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function k(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function V(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const i=new Set(e||[]),l=function(d,s){const u=d.getAttribute(s);return u!==null&&i.has(u)?u:t};return R.set(n,l),l}function Q(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function J(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function G(e,t,n,i,l){if(!e||t===null)return!0;const d=i||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=o=>{l?console.warn(o,l):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(u(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(u(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(u(`[${d}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(u(`[${d}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return u(`[${d}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,n){for(const i in n){const[l,d,s]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,d,s)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=K(i.values,i.fallback);break;case"integer":l=k;break;case"float":l=Q;break;case"boolean":l=V;break;case"list":l=X;break;case"json":l=J;break;case"string":default:l=S;break}l||(l=S),t[i.prop]=[l,n,i.fallback]}return t}function Ae(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Z,window.lnCore.attrSpec=Y,window.lnCore.attrStr=S,window.lnCore.attrInt=k,window.lnCore.attrBool=V,window.lnCore.attrList=X,window.lnCore.attrEnum=K,window.lnCore.attrFloat=Q,window.lnCore.attrJson=J);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ee(e,t,n,i){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(d)&&E(e,s),e.querySelectorAll){const u=e.querySelectorAll(d);for(let o=0;o<u.length;o++)E(u[o],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 Se(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 Ee(e){const t=te(),n=e.observed||[];for(let i=0;i<n.length;i++){const l=n[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(d=>d.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=_e(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function ne(e,t,n,i){for(let l=0;l<e.length;l++){const d=e[l];if(!t[d.attribute])continue;const s=d.effects&&d.effects[n];s?s(t,n,i):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,i)}}function Ie(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=te(),l=i.byAttr.get(t),d=$()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!l&&!d)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(d&&F(s)){const u=i.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let r=0;r<u.length;r++)G(u[r].spec,o,t,u[r].componentTag,s)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const u=i.byReactive.get(t);u&&ne(u,s,t,e.oldValue),i.reactiveWildcard.length&&ne(i.reactiveWildcard,s,t,e.oldValue)}if(l)for(let u=0;u<l.length;u++){const o=l[u];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(ee(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){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 n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=z();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=O();if(e.target&&i.length)for(let l=0;l<i.length;l++){const d=i[l],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 l=0;l<e.addedNodes.length;l++){const d=e.addedNodes[l];if(d.nodeType===1){const s=!!(d.firstElementChild||d.children&&d.children.length);for(let u=0;u<t.length;u++){const o=t[u];if(o.selector&&o.attribute&&o.ComponentFn){if(!s)d.matches&&d.matches(o.query)&&E(d,o);else if(d.matches&&d.matches(o.query)&&E(d,o),d.querySelectorAll){const r=d.querySelectorAll(o.query);for(let a=0;a<r.length;a++)E(r[a],o)}}o.onInit&&o.onInit(d)}}}for(let l=0;l<e.removedNodes.length;l++){const d=e.removedNodes[l];if(d.nodeType===1){if(document.contains(d))continue;const s=!!(d.firstElementChild||d.children&&d.children.length);for(let u=0;u<t.length;u++){const o=t[u],r=o.query;if(r){if(!s)d.matches&&d.matches(r)&&T(d,o);else if(d.matches&&d.matches(r)&&T(d,o),d.querySelectorAll){const a=d.querySelectorAll(r);for(let c=0;c<a.length;c++)T(a[c],o)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let i=0;i<n.length;i++){const l=n[i];if(l.type==="childList")try{oe(l)}catch(d){console.error("[ln-core] lifecycle handler failed",l.target,d)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Fe(e){z().push(e),e.onSubtreeChange&&e.query&&O().push(e),re()}function ie(e,t,n,i,l={}){const d=l.extraAttributes||[],s=l.onAttributeChange||null,u=l.onSubtreeChange||null,o=l.onInit||null,r=l.onAttrChange||null,a=l.effects||null,c=l.attributes||null,f=c?Ae(c):a,p=c?new Set(Object.keys(c)):null,g=l.persist||null;function b(A){const x=A||document.body;if(ee(x,e,t,n),c&&$())for(const I in c){const Ze=c[I],N=Array.from(x.querySelectorAll("["+I+"]"));x.matches&&x.matches("["+I+"]")&&N.push(x);for(let M=0;M<N.length;M++){const B=N[M];F(B)&&G(Ze,B.getAttribute(I),I,i,B)}}o&&o(x)}const w=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let x;for(;(x=A.exec(e))!==null;)w.push(x[1])}else w.push(e);Ee({selector:e,attribute:t,componentTag:i,attributes:c,ComponentFn:n,onInit:o,observed:w.concat(d),onAttributeChange:s,onAttrChange:r,effects:f,declared:p,persist:g}),Le();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,m=l.subtreeQuery||(v?e:"["+e+"]"),h={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:u,query:m};z().push(h),u&&m&&O().push(h),re(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Fe,window.lnCore.withoutLifecycle=ke);function y(){xe()>0?Se(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),b}function le(e){return(e||"").replace(/^#/,"")}function U(e){const t=e===void 0?location.hash:e,n={},i=le(t);if(!i)return n;const l=i.split("&");for(let d=0;d<l.length;d++){const s=l[d];if(!s)continue;const u=s.indexOf(":"),o=u>-1?s.slice(0,u):s,r=u>-1?s.slice(u+1):"";if(o)try{n[o]=decodeURIComponent(r)}catch{n[o]=r}}return n}function qe(e){if(!e)return null;const t=U();return e in t?t[e]:null}function De(e,t){if(!e)return;const n=U();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(d){const s=n[d];return s===""?d:d+":"+encodeURIComponent(s)}).join("&");le(location.hash)!==l&&(location.hash=l)}function Re(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ue(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 n=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=U,window.lnCore.hashGet=qe,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=ze,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ue,window.lnCore.hashFilterDecode=Ne);function Me(e){return(e||"").replace(/^\?/,"")}function Be(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},i=Me(t);if(!i)return n;const l=new URLSearchParams(i);for(const[d,s]of l.entries())n[d]=s;return n}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function He(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const i=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",i)}function je(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"_"+t:i:t||null}function We(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Pe(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const i=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:i}}}return null}function Ve(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Xe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Be,window.lnCore.queryGet=$e,window.lnCore.querySet=He,window.lnCore.resolveQueryParam=je,window.lnCore.querySortEncode=We,window.lnCore.querySortDecode=Pe,window.lnCore.queryFilterEncode=Ve,window.lnCore.queryFilterDecode=Xe);function Ke(){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=Ke);function Qe(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 se(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function Je(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=se(e.name),i=String(e.type||"").toLowerCase();return t.some(l=>{if(l.includes("/")){if(l.endsWith("/*")){const d=l.slice(0,-1);return i.startsWith(d)}return i===l}return n===l})}function Ge(e,t="en",n={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(n["unit-b"]||"B");const i=1024,l=[n["unit-b"]||"B",n["unit-kb"]||"KB",n["unit-mb"]||"MB",n["unit-gb"]||"GB"],d=Math.floor(Math.log(e)/Math.log(i)),s=Math.min(d,l.length-1),u=e/Math.pow(i,s);return new Intl.NumberFormat(t,{maximumFractionDigits:1,minimumFractionDigits:0}).format(u)+" "+l[s]}(function(){const e="data-ln-upload",t="lnUpload",n="file",i="file_ids[]";if(window[t]!==void 0)return;const l={"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: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:S,type:"string",fallback:n,description:"Form data field name used for file payloads"},"data-ln-upload-ids-field":{prop:"idsFieldName",read:S,type:"string",fallback:i,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(l);function s(r,a,c){return Ge(r,a,c)}function u(){const r=document.querySelector('meta[name="csrf-token"]');return r?r.getAttribute("content"):""}function o(r){this.dom=r,Z(this,r,d),this.dict=ve(r,"data-ln-upload-dict"),this.locale=he(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=Qe(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}o.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],g=p.getAttribute("data-ln-upload-id"),b="file-"+ ++r.fileIdCounter;p.setAttribute("data-ln-upload-local-id",b);const w=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:g||null,name:w?w.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()},o.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)}},o.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)},o.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(!Je(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}q(a.dom,"ln-upload:before-upload",{file:p}).defaultPrevented||a._uploadSingleFile(p)}},o.prototype._uploadSingleFile=function(r){const a=this,c="file-"+ ++a.fileIdCounter,f=se(r.name);let p=null;if(this.list){const m=be(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"),_(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 g=new FormData;g.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||g.append(h.name,h.value)}const w=new XMLHttpRequest;a.uploadedFiles.set(c,{serverId:null,name:r.name,size:r.size,xhr:w}),w.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)),_(p,{sizeText:h+"%"})}C(a.dom,"ln-upload:progress",{localId:c,file:r,percent:h,loaded:m.loaded,total:m.total})}}),w.addEventListener("load",function(){const m=a.uploadedFiles.get(c);if(m&&delete m.xhr,w.status>=200&&w.status<300){let h;try{h=JSON.parse(w.responseText)}catch(A){v(a.dict.error||"Error",w.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)),_(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(w.responseText).message||""}catch{}v(h,w.status,null)}}),w.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"),_(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?(w.open("POST",a.uploadUrl),w.setRequestHeader("X-CSRF-TOKEN",u()),w.setRequestHeader("X-Requested-With","XMLHttpRequest"),w.setRequestHeader("Accept","application/json"),w.send(g)):console.warn("[ln-upload] No upload URL configured (missing data-ln-upload)")},o.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[w,v]of a.uploadedFiles)if(String(v.serverId)===String(r)){c=w,f=v;break}if(!c||!f||q(a.dom,"ln-upload:before-remove",{localId:c,serverId:f.serverId}).defaultPrevented)return;const g=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){g&&g.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){g&&g.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),C(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId});return}g&&(g.setAttribute("data-ln-upload-state","deleting"),_(g,{deleting:!0})),fetch(b,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(function(w){w.ok?(g&&g.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),C(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId})):(g&&(g.removeAttribute("data-ln-upload-state"),_(g,{deleting:!1})),C(a.dom,"ln-upload:error",{file:f,message:"",status:w.status}))}).catch(function(w){g&&(g.removeAttribute("data-ln-upload-state"),_(g,{deleting:!1})),C(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:w})})},o.prototype.clear=function(){const r=this;if(!q(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",{})}},o.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return r.serverId}).filter(Boolean)},o.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return{serverId:r.serverId,name:r.name,size:r.size}})},o.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]}},ie(e,t,o,"ln-upload",{attributes:l})})()})();
@@ -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 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 L(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 ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(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 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 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=se(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=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);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 ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function fe(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];B[o]=t}function he(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=fe,window.lnCore.getLocaleFallback=he,window.lnCore.ensureLocaleObserver=ue);const x={};function we(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 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 pe(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 be(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=we(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=pe,window.lnCore.renderList=be);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 me(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 ge(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 Ce(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 ye(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=me,window.lnCore.attrSpec=ge,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 ve(){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 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 Ae(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=ye(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 Se(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 Le(){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{Se(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 Y(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){if(document.contains(s))continue;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 Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){const e=new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{Y(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const o=t.takeRecords();for(let i=0;i<o.length;i++){const r=o[i];if(r.type==="childList")try{Y(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ee(e){O().push(e),e.onSubtreeChange&&e.query&&R().push(e),Z()}function ee(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?Ce(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 Be=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(Be,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);Ae({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}),Le();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),Z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=Ee,window.lnCore.withoutLifecycle=xe);function re(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),f}function te(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,o={},i=te(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 ke(e){if(!e)return null;const t=D();return e in t?t[e]:null}function Oe(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("&");te(location.hash)!==r&&(location.hash=r)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function qe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(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=ke,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=qe,window.lnCore.hashSortEncode=De,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Te);function Ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ne);const ne={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function oe(e,t=0){return e?!!(e.valid&&t===0):t===0}function Me(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function $e(e,t){const o=[];if(e){const i=Object.keys(ne);for(let r=0;r<i.length;r++){const s=i[r],l=ne[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:[]};L(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())}))),Me(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=oe(c,this._customErrors.size),u=$e(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),L(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 oe(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]},ee(e,t,a,"ln-validate",{attributes:l})})()})();
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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!S(o))return}e.apply(console,t)}}function L(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}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 ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(r)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")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[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 c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}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 ae(e,t){const r=e.elements,o=[],i={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const 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(i[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=se(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.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;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),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 $={};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 ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function we(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=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);const x={};function he(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[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 i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[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 pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],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,o))}}return e}function be(e,t,r,o,i,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(o(c));let u=l[d];if(u)i(u,c,n);else{const p=he(r,s);if(!p||(j(p,c),u=p.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(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=pe,window.lnCore.renderList=be);function E(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function U(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function W(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function P(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return k.set(r,i),i}function K(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function Q(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function G(e,t,r,o,i){if(!e||t===null)return!0;const s=o||"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=>{i?console.warn(n,i):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 "${r}". 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 "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,r){for(const o in r){const[i,s,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=P(o.values,o.fallback);break;case"integer":i=U;break;case"float":i=K;break;case"boolean":i=W;break;case"list":i=H;break;case"json":i=Q;break;case"string":default:i=E;break}i||(i=E),t[o.prop]=[i,r,o.fallback]}return t}function ye(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=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 r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=ge,window.lnCore.attrStr=E,window.lnCore.attrInt=U,window.lnCore.attrBool=W,window.lnCore.attrList=H,window.lnCore.attrEnum=P,window.lnCore.attrFloat=K,window.lnCore.attrJson=Q);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(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&C(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)C(a[n],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 _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 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 Ae(e){const t=z(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.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 i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function X(e,t,r,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=z(),i=o.byAttr.get(t),s=M()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&S(l)){const a=o.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&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&X(a,l,t,e.oldValue),o.reactiveWildcard.length&&X(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[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 Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).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 q(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Y(e){const t=O();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=q();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],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 i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];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)&&C(s,n);else if(s.matches&&s.matches(n.query)&&C(s,n),s.querySelectorAll){const c=s.querySelectorAll(n.query);for(let d=0;d<c.length;d++)C(c[d],n)}}n.onInit&&n.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;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)&&R(s,n);else if(s.matches&&s.matches(c)&&R(s,n),s.querySelectorAll){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)R(d[u],n)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Y(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Y(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ee(e){O().push(e),e.onSubtreeChange&&e.query&&q().push(e),Z()}function ee(e,t,r,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,p=u?ye(u):d,b=u?new Set(Object.keys(u)):null,m=i.persist||null;function f(F){const g=F||document.body;if(J(g,e,t,r),u&&M())for(const _ in u){const Ge=u[_],I=Array.from(g.querySelectorAll("["+_+"]"));g.matches&&g.matches("["+_+"]")&&I.push(g);for(let T=0;T<I.length;T++){const N=I[T];S(N)&&G(Ge,N.getAttribute(_),_,o,N)}}n&&n(g)}const w=[];if(e.indexOf("[")!==-1){const F=/\[([\w-]+)/g;let g;for(;(g=F.exec(e))!==null;)w.push(g[1])}else w.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:b,persist:m}),Le();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=i.subtreeQuery||(h?e:"["+e+"]"),v={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:y};O().push(v),a&&y&&q().push(v),Z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=Ee,window.lnCore.withoutLifecycle=xe);function oe(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function te(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,r={},o=te(t);if(!o)return r;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[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{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=D();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=D();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");te(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(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 Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=ke,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=De,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Te);function Ne(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[s,l]of i.entries())r[s]=l;return r}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ve(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.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 je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function He(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=$e,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ve,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=We,window.lnCore.queryFilterDecode=He);function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Pe);const ne={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function re(e,t=0){return e?!!(e.valid&&t===0):t===0}function Ke(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Qe(e,t){const r=[];if(e){const o=Object.keys(ne);for(let i=0;i<o.length;i++){const s=o[i],l=ne[s];e[l]&&r.push(s)}}if(t){const o=Array.from(t);for(let i=0;i<o.length;i++)o[i]&&r.indexOf(o[i])===-1&&r.push(o[i])}return r}(function(){const e="data-ln-validate",t="lnValidate",r="data-ln-validate-errors",o="data-ln-validate-error",i="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 w=n.closest(".form-element");if(w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.remove("hidden")}n.classList.remove(i),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const f=m.detail&&m.detail.error,w=n.closest(".form-element");if(f){if(c._customErrors.delete(f),w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.add("hidden")}}else c._customErrors.forEach(function(h){if(w){const y=w.querySelector("["+o+'="'+h+'"]');y&&y.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:[]};L(b,"ln-validate:request-validate",f),f.invalidFields.length>0&&(m.preventDefault(),f.invalidFields.sort((w,h)=>w.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Ke(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=re(c,this._customErrors.size),u=Qe(c,this._customErrors),p=n.closest(".form-element");if(p){const f=p.querySelector("["+r+"]");if(f){const w=f.querySelectorAll("["+o+"]");for(let h=0;h<w.length;h++){const y=w[h].getAttribute(o),v=!u.includes(y);w[h].classList.contains("hidden")!==v&&w[h].classList.toggle("hidden",v)}}}n.classList.contains(i)!==d&&n.classList.toggle(i,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),L(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(i)&&this.dom.classList.remove(i),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("["+o+"]");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 re(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(i,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},ee(e,t,a,"ln-validate",{attributes:l})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 m(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 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 ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,r={},l=e.elements,s={};if(o)for(let c=0;c<l.length;c++){const n=l[c];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[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")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&s[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 u=0;u<n.options.length;u++)n.options[u].selected&&r[n.name].push(n.options[u].value)}else if(o&&n.type==="hidden")r[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const u=Number(n.value);r[n.name]=n.value===""||isNaN(u)?null:u}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 ce(e,t){const o=e.elements,i=[],r={};for(let l=0;l<o.length;l++){const s=o[l];s.name&&s.type==="checkbox"&&(r[s.name]=(r[s.name]||0)+1)}for(let l=0;l<o.length;l++){const s=o[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const n=t[c];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(r[s.name]>1){const u=String(n).split(",").map(function(h){return h.trim()});s.checked=u.indexOf(s.value)!==-1}else s.checked=le(n);i.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),i.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<s.options.length;u++)s.options[u].selected=n.indexOf(s.options[u].value)!==-1;i.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),i.push(s)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ie);const $={};function de(e,t){$[e]=t}function ae(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ae);function ue(){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 fe(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];B[o]=t}function we(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=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);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 s=0;s<o.length;s++){const c=o[s],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<i.length;s++){const c=i[s],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const h=n[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const r=e.querySelectorAll("[data-ln-show]");for(let s=0;s<r.length;s++){const c=r[s],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const c=l[s],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const h=n[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function pe(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)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(s,c){return t[c]!==void 0?t[c]:""}))}const i=function(l,s){return t[s]!==void 0?t[s]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let l=0;l<r.length;l++){const s=r[l],c=s.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&s.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function be(e,t,o,i,r,l){const s={};for(let n=0;n<e.children.length;n++){const u=e.children[n],h=u.getAttribute("data-ln-render-key");h&&(s[h]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],h=String(i(u));let f=s[h];if(f)r(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",h),r(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=pe,window.lnCore.renderList=be);function x(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function U(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function K(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 V(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const O=new Map;function H(e,t){const o=(e?e.join("|"):"")+"::"+t;if(O.has(o))return O.get(o);const i=new Set(e||[]),r=function(l,s){const c=l.getAttribute(s);return c!==null&&i.has(c)?c:t};return O.set(o,r),r}function J(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 P(e,t,o,i,r){if(!e||t===null)return!0;const l=i||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=n=>{r?console.warn(n,r):console.warn(n)};if(s==="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(s==="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(s==="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(s==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(s==="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 i in o){const[r,l,s]=o[i];Object.defineProperty(e,i,{get:function(){return r(t,l,s)},enumerable:!0,configurable:!0})}return e}function z(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=H(i.values,i.fallback);break;case"integer":r=U;break;case"float":r=J;break;case"boolean":r=K;break;case"list":r=V;break;case"json":r=Q;break;case"string":default:r=x;break}r||(r=x),t[i.prop]=[r,o,i.fallback]}return t}function me(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 ge(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,i){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(l)&&_(e,s),e.querySelectorAll){const c=e.querySelectorAll(l);for(let n=0;n<c.length;n++)_(c[n],s)}}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 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 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 _e(e){const t=Y(),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(l=>l.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,o,i){for(let r=0;r<e.length;r++){const l=e[r];if(!t[l.attribute])continue;const s=l.effects&&l.effects[o];s?s(t,o,i):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,i)}}function ke(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=Y(),r=i.byAttr.get(t),l=F()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!r&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&S(s)){const c=i.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let u=0;u<c.length;u++)P(c[u].spec,n,t,c[u].componentTag,s)}if(window.lnCore._debugSink&&(o||r)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),o){const c=i.byReactive.get(t);c&&Z(c,s,t,e.oldValue),i.reactiveWildcard.length&&Z(i.reactiveWildcard,s,t,e.oldValue)}if(r)for(let c=0;c<r.length;c++){const n=r[c];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(X(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function Ae(){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{ke(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 E(){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(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ee(e){const t=E();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=L();if(e.target&&i.length)for(let r=0;r<i.length;r++){const l=i[r],s=l.query,c=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;c&&l.onSubtreeChange(c,e)}for(let r=0;r<e.addedNodes.length;r++){const l=e.addedNodes[r];if(l.nodeType===1){const s=!!(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(!s)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 h=0;h<u.length;h++)_(u[h],n)}}n.onInit&&n.onInit(l)}}}for(let r=0;r<e.removedNodes.length;r++){const l=e.removedNodes[r];if(l.nodeType===1){if(document.contains(l))continue;const s=!!(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(!s)l.matches&&l.matches(u)&&R(l,n);else if(l.matches&&l.matches(u)&&R(l,n),l.querySelectorAll){const h=l.querySelectorAll(u);for(let f=0;f<h.length;f++)R(h[f],n)}}}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){const e=new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{ee(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const o=t.takeRecords();for(let i=0;i<o.length;i++){const r=o[i];if(r.type==="childList")try{ee(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){E().push(e),e.onSubtreeChange&&e.query&&L().push(e),te()}function ne(e,t,o,i,r={}){const l=r.extraAttributes||[],s=r.onAttributeChange||null,c=r.onSubtreeChange||null,n=r.onInit||null,u=r.onAttrChange||null,h=r.effects||null,f=r.attributes||null,d=f?me(f):h,a=f?new Set(Object.keys(f)):null,w=r.persist||null;function p(D){const g=D||document.body;if(X(g,e,t,o),f&&F())for(const A in f){const Ne=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(Ne,M.getAttribute(A),A,i,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);_e({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:o,onInit:n,observed:b.concat(l),onAttributeChange:s,onAttrChange:u,effects:d,declared:a,persist:w}),Ae();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=r.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:k};E().push(C),c&&k&&L().push(C),te(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=ve);function re(){ye()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),p}function oe(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,o={},i=oe(t);if(!i)return o;const r=i.split("&");for(let l=0;l<r.length;l++){const s=r[l];if(!s)continue;const c=s.indexOf(":"),n=c>-1?s.slice(0,c):s,u=c>-1?s.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(u)}catch{o[n]=u}}return o}function Se(e){if(!e)return null;const t=I();return e in t?t[e]:null}function qe(e,t){if(!e)return;const o=I();t==null?delete o[e]:o[e]=String(t);const r=Object.keys(o).map(function(l){const s=o[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==r&&(location.hash=r)}function Oe(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(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 De(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(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:o,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Se,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te),(function(){const e="data-ln-websocket-connector",t="lnWebsocketConnector",o="lnConnector";if(window[t]!==void 0)return;const i=1e3,r=3e4;function l(d){const a=d[t];a&&(a.command==="connect"?a._open():a._disconnect())}function s(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:s,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 h(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(w){a._request(u[w.type],w.detail||{})};for(const w in u)d.addEventListener(w,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 w;try{w=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=w,w.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])},w.onmessage=function(p){d._receive(p.data)},w.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(i*Math.pow(2,Math.max(0,this._attempt-1)),r);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 w={ref:String(++this._seq),type:d,detail:a};this._status==="connected"?this._send(w):this.command==="connect"?this._held.push(w):this._fail(w,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},h(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 w=this._pending.get(String(a.ref));if(!w)return;this._pending.delete(w.ref),a.ok?this._resolve(w,a.content,a.message||null):this._fail(w,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,w){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:w,meta:b}):d.type==="update"?m(y,"ln-websocket-connector:updated",{record:a,id:p.id,message:w,meta:b}):d.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:a,id:p.id,message:w,meta:b}):m(y,"ln-websocket-connector:bulk-deleted",{response:a,ids:p.ids,message:w,meta:b})},f.prototype._fail=function(d,a,w,p){const b=d.detail;m(this.dom,"ln-websocket-connector:error",{action:d.type,error:w,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 w=0;w<d.length;w++)this._fail(d[w],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]}},ne(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
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 v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!v(r))return}e.apply(console,t)}}function m(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},l=e.elements,s={};if(n)for(let c=0;c<l.length;c++){const o=l[c];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<l.length;c++){const o=l[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&s[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&i[o.name].push(o.options[a].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const a=Number(o.value);i[o.name]=o.value===""||isNaN(a)?null:a}else i[o.name]=o.value}return i}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 ce(e,t){const n=e.elements,r=[],i={};for(let l=0;l<n.length;l++){const s=n[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<n.length;l++){const s=n[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const o=t[c];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(i[s.name]>1){const a=String(o).split(",").map(function(h){return h.trim()});s.checked=a.indexOf(s.value)!==-1}else s.checked=le(o);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<s.options.length;a++)s.options[a].selected=o.indexOf(s.options[a].value)!==-1;r.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),r.push(s)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ie);const $={};function de(e,t){$[e]=t}function ue(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];j[n]=t}function we(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=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const q={};function he(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const c=r[s],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const c=l[s],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(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 U(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],c=s.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&s.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function be(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const a=e.children[o],h=a.getAttribute("data-ln-render-key");h&&(s[h]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],h=String(r(a));let f=s[h];if(f)i(f,a,o);else{const d=he(n,l);if(!d||(U(d,a),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),i(f,a,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=B,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function x(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function W(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const r=new Set(e||[]),i=function(l,s){const c=l.getAttribute(s);return c!==null&&r.has(c)?c:t};return E.set(n,i),i}function P(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Q(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function J(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e,t,n){for(const r in n){const[i,l,s]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=H(r.values,r.fallback);break;case"integer":i=W;break;case"float":i=P;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[r.prop]=[i,n,r.fallback]}return t}function me(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ge(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=G,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=W,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=P,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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function X(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(l)&&_(e,s),e.querySelectorAll){const c=e.querySelectorAll(l);for(let o=0;o<c.length;o++)_(c[o],s)}}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 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 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 _e(e){const t=Y(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ge(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function ke(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Y(),i=r.byAttr.get(t),l=M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&v(s)){const c=r.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let a=0;a<c.length;a++)J(c[a].spec,o,t,c[a].componentTag,s)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&Z(c,s,t,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,s,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(X(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ke(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function 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 n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ee(e){const t=O();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=L();if(e.target&&r.length)for(let i=0;i<r.length;i++){const l=r[i],s=l.query,c=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;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!s)l.matches&&l.matches(o.query)&&_(l,o);else if(l.matches&&l.matches(o.query)&&_(l,o),l.querySelectorAll){const a=l.querySelectorAll(o.query);for(let h=0;h<a.length;h++)_(a[h],o)}}o.onInit&&o.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c],a=o.query;if(a){if(!s)l.matches&&l.matches(a)&&R(l,o);else if(l.matches&&l.matches(a)&&R(l,o),l.querySelectorAll){const h=l.querySelectorAll(a);for(let f=0;f<h.length;f++)R(h[f],o)}}}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ee(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{ee(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){O().push(e),e.onSubtreeChange&&e.query&&L().push(e),te()}function ne(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,a=i.onAttrChange||null,h=i.effects||null,f=i.attributes||null,d=f?me(f):h,u=f?new Set(Object.keys(f)):null,w=i.persist||null;function p(I){const g=I||document.body;if(X(g,e,t,n),f&&M())for(const A in f){const Ve=f[A],T=Array.from(g.querySelectorAll("["+A+"]"));g.matches&&g.matches("["+A+"]")&&T.push(g);for(let F=0;F<T.length;F++){const N=T[F];v(N)&&J(Ve,N.getAttribute(A),A,r,N)}}o&&o(g)}const b=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)b.push(g[1])}else b.push(e);_e({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:b.concat(l),onAttributeChange:s,onAttrChange:a,effects:d,declared:u,persist:w}),Ae();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=i.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:k};O().push(C),c&&k&&L().push(C),te(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Se);function re(){ye()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),p}function oe(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const c=s.indexOf(":"),o=c>-1?s.slice(0,c):s,a=c>-1?s.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(a)}catch{n[o]=a}}return n}function ve(e){if(!e)return null;const t=D();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=D();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==i&&(location.hash=i)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(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 n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=ve,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Te(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Te(t);if(!r)return n;const i=new URLSearchParams(r);for(const[l,s]of i.entries())n[l]=s;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Ne,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=$e,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Be,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ke(){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=Ke),(function(){const e="data-ln-websocket-connector",t="lnWebsocketConnector",n="lnConnector";if(window[t]!==void 0)return;const r=1e3,i=3e4;function l(d){const u=d[t];u&&(u.command==="connect"?u._open():u._disconnect())}function s(d){const u=d[t];!u||u.command!=="connect"||(u._drop("url-changed"),u._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:s,description:"WebSocket endpoint URL (ws:// or wss://)"}},o=z(c),a={"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 h(d,u){return d==="sync"?{since:u.since}:d==="query"?{query:u.query||{}}:d==="create"?{data:u.data,idempotencyKey:u.idempotencyKey}:d==="update"?{id:u.id,data:u.data,expected_version:u.expected_version,idempotencyKey:u.idempotencyKey}:d==="delete"?{id:u.id,idempotencyKey:u.idempotencyKey}:{ids:u.ids,idempotencyKey:u.idempotencyKey}}function f(d){this.dom=d,G(this,d,o),d[t]=this,d[n]=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 u=this;this._onRequest=function(w){u._request(a[w.type],w.detail||{})};for(const w in a)d.addEventListener(w,this._onRequest);return this.command==="connect"&&this._open(),this}f.prototype._open=function(){if(this._socket||this._timer)return;const d=this,u=this.url;this._attempt++,this._status="connecting",m(this.dom,"ln-websocket-connector:connecting",{url:u,attempt:this._attempt});let w;try{w=new WebSocket(u)}catch(p){this._status="disconnected",this._attempt=0,this._failAll(this._held,p.message),this._held=[],m(this.dom,"ln-websocket-connector:disconnected",{url:u,code:0,reason:p.message,willReconnect:!1});return}this._socket=w,w.onopen=function(){d._status="connected",d._attempt=0,m(d.dom,"ln-websocket-connector:connected",{url:u});const p=d._held;d._held=[];for(let b=0;b<p.length;b++)d._send(p[b])},w.onmessage=function(p){d._receive(p.data)},w.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:u,code:p.code,reason:p.reason,willReconnect:b}),b&&d._scheduleReconnect()}},f.prototype._scheduleReconnect=function(){const d=this,u=Math.min(r*Math.pow(2,Math.max(0,this._attempt-1)),i);this._timer=setTimeout(function(){d._timer=null,d._open()},u)},f.prototype._drop=function(d){const u=!!(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),u&&(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,u){const w={ref:String(++this._seq),type:d,detail:u};this._status==="connected"?this._send(w):this.command==="connect"?this._held.push(w):this._fail(w,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},h(d.type,d.detail))))},f.prototype._receive=function(d){let u;try{u=JSON.parse(d)}catch{console.warn("[ln-websocket-connector] Ignored a frame that is not JSON:",d);return}if(u.ref!==void 0){const w=this._pending.get(String(u.ref));if(!w)return;this._pending.delete(w.ref),u.ok?this._resolve(w,u.content,u.message||null):this._fail(w,u.status||0,u.error,u.data);return}u.type==="changes"&&m(this.dom,"ln-websocket-connector:fetched",{data:{data:u.data||[],deleted:u.deleted||[],synced_at:u.synced_at},since:null,meta:null})},f.prototype._resolve=function(d,u,w){const p=d.detail,b=p.meta||null,y=this.dom;if(d.type==="sync")m(y,"ln-websocket-connector:fetched",{data:u,since:p.since,meta:b});else if(d.type==="query"){const k=p.query||{},C=u||{};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:u,tempId:p.tempId,message:w,meta:b}):d.type==="update"?m(y,"ln-websocket-connector:updated",{record:u,id:p.id,message:w,meta:b}):d.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:u,id:p.id,message:w,meta:b}):m(y,"ln-websocket-connector:bulk-deleted",{response:u,ids:p.ids,message:w,meta:b})},f.prototype._fail=function(d,u,w,p){const b=d.detail;m(this.dom,"ln-websocket-connector:error",{action:d.type,error:w,status:u,data:p||null,conflictData:u===409&&p||null,since:b.since,id:b.id,ids:b.ids,tempId:b.tempId,meta:b.meta||null})},f.prototype._failAll=function(d,u){for(let w=0;w<d.length;w++)this._fail(d[w],0,u,null)},f.prototype._failPending=function(d){const u=Array.from(this._pending.values());this._pending.clear(),this._failAll(u,d)},f.prototype.destroy=function(){if(this.dom[t]){for(const d in a)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[n]}},ne(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
@@ -1052,6 +1052,10 @@
1052
1052
  "name": "data-ln-progress-max",
1053
1053
  "description": "Maximum progress scale value"
1054
1054
  },
1055
+ {
1056
+ "name": "data-ln-query",
1057
+ "description": "URL query parameter name for filter state synchronization URL query parameter name for search query state synchronization URL query parameter name for sort state persistence"
1058
+ },
1055
1059
  {
1056
1060
  "name": "data-ln-render-key",
1057
1061
  "description": "data-ln-render-key attribute"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livenetworks/ashlar",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
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.8",
4
+ "version": "2.1.9",
5
5
  "framework": "html",
6
6
  "contributions": {
7
7
  "html": {
@@ -1327,6 +1327,13 @@
1327
1327
  "type": "number"
1328
1328
  }
1329
1329
  },
1330
+ {
1331
+ "name": "data-ln-query",
1332
+ "description": "URL query parameter name for filter state synchronization URL query parameter name for search query state synchronization URL query parameter name for sort state persistence",
1333
+ "value": {
1334
+ "type": "string"
1335
+ }
1336
+ },
1330
1337
  {
1331
1338
  "name": "data-ln-render-key",
1332
1339
  "description": "data-ln-render-key attribute",