@livenetworks/ashlar 2.0.10 → 2.1.1

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 (64) 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-ajax/src/ln-ajax.js +15 -26
  4. package/components/ln-api-connector/ln-api-connector.js +1 -1
  5. package/components/ln-api-queue/ln-api-queue.js +1 -1
  6. package/components/ln-autoresize/ln-autoresize.js +1 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/helpers.js +1 -1
  12. package/components/ln-core/index.js +1 -1
  13. package/components/ln-core/lifecycle.js +106 -40
  14. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  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-dropdown/ln-dropdown.js +1 -1
  20. package/components/ln-editor/ln-editor.js +1 -1
  21. package/components/ln-editor/src/ln-editor.js +45 -12
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-external-links/src/ln-external-links.js +9 -21
  24. package/components/ln-filter/ln-filter.js +1 -1
  25. package/components/ln-form/ln-form.js +1 -1
  26. package/components/ln-icon/ln-icon.js +1 -1
  27. package/components/ln-icon/src/ln-icon.js +14 -16
  28. package/components/ln-include/ln-include.js +1 -1
  29. package/components/ln-key/ln-key.js +1 -1
  30. package/components/ln-link/ln-link.js +1 -1
  31. package/components/ln-link/src/ln-link.js +16 -26
  32. package/components/ln-list/ln-list.js +1 -1
  33. package/components/ln-modal/ln-modal.js +1 -1
  34. package/components/ln-nav/ln-nav.js +1 -1
  35. package/components/ln-nav/src/ln-nav.js +5 -4
  36. package/components/ln-number/ln-number.js +1 -1
  37. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  38. package/components/ln-options/ln-options.js +1 -1
  39. package/components/ln-persist/ln-persist.js +1 -1
  40. package/components/ln-picklist/ln-picklist.js +1 -1
  41. package/components/ln-popover/ln-popover.js +1 -1
  42. package/components/ln-progress/ln-progress.js +1 -1
  43. package/components/ln-progress/src/ln-progress.js +9 -21
  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/ln-search.js +1 -1
  47. package/components/ln-slug/ln-slug.js +1 -1
  48. package/components/ln-sort/ln-sort.js +1 -1
  49. package/components/ln-sortable/ln-sortable.js +1 -1
  50. package/components/ln-stat/ln-stat.js +1 -1
  51. package/components/ln-table/ln-table.js +1 -1
  52. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  53. package/components/ln-tabs/ln-tabs.js +1 -1
  54. package/components/ln-time/ln-time.js +1 -1
  55. package/components/ln-toast/ln-toast.js +1 -1
  56. package/components/ln-toggle/ln-toggle.js +1 -1
  57. package/components/ln-tooltip/ln-tooltip.js +1 -1
  58. package/components/ln-translations/ln-translations.js +1 -1
  59. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  60. package/components/ln-upload/ln-upload.js +1 -1
  61. package/components/ln-validate/ln-validate.js +1 -1
  62. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  63. package/package.json +1 -1
  64. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function L(){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 g(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!g(o))return}e.apply(console,t)}}function E(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function K(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function z(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&l[i.name]===1?r[i.name]=i.checked:(r[i.name]||(r[i.name]=[]),i.checked&&r[i.name].push(i.value));else if(i.type==="radio")i.checked&&(r[i.name]=i.value);else if(i.type==="select-multiple"){r[i.name]=[];for(let a=0;a<i.options.length;a++)i.options[a].selected&&r[i.name].push(i.options[a].value)}else if(n&&i.type==="hidden")r[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const a=Number(i.value);r[i.name]=i.value===""||isNaN(a)?null:a}else r[i.name]=i.value}return r}function G(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function P(e,t){const n=e.elements,o=[],r={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const i=t[c];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(r[l.name]>1){const a=String(i).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=G(i);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let a=0;a<l.options.length;a++)l.options[a].selected=i.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=P,window.lnCore.serializeForm=z,window.lnCore.resolveFormMethod=K);const I={};function X(e,t){I[e]=t}function Y(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=X,window.lnCore.getDataMapper=Y);function Z(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ee,window.lnCore.getLocaleFallback=te,window.lnCore.ensureLocaleObserver=Z);const C={};function ne(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],i=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<i.length;a++){const u=i[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const c=r[l],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],i=c.getAttribute("data-ln-class").split(",");for(let a=0;a<i.length;a++){const u=i[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function oe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=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],c=l.attributes;for(let i=0;i<c.length;i++){const a=c[i];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function re(e,t,n,o,r,s){const l={};for(let i=0;i<e.children.length;i++){const a=e.children[i],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const a=t[i],u=String(o(a));let d=l[u];if(d)r(d,a,i);else{const f=ne(n,s);if(!f||(D(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,a,i)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=$,window.lnCore.lnFill=oe,window.lnCore.renderList=re);function m(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function F(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function N(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function M(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const o=new Set(e||[]),r=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return y.set(n,r),r}function R(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function B(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function j(e,t,n,o,r){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 c=i=>{r?console.warn(i,r):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e,t,n){for(const o in n){const[r,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,s,l)},enumerable:!0,configurable:!0})}return e}function le(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=M(o.values,o.fallback);break;case"integer":r=F;break;case"float":r=R;break;case"boolean":r=N;break;case"list":r=q;break;case"json":r=B;break;case"string":default:r=m;break}r||(r=m),t[o.prop]=[r,n,o.fallback]}return t}function se(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ie,window.lnCore.attrSpec=le,window.lnCore.attrStr=m,window.lnCore.attrInt=F,window.lnCore.attrBool=N,window.lnCore.attrList=q,window.lnCore.attrEnum=M,window.lnCore.attrFloat=R,window.lnCore.attrJson=B);function A(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(i){console.error("["+n+"] init failed",c,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ue(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 W(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=W(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function U(e,t,n,o){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=W(),r=o.byAttr.get(n);if(L()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&g(t)){const s=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<s.length;c++)j(s[c].spec,l,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&U(s,t,n,e.oldValue),o.reactiveWildcard.length&&U(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const l=r[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(A(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=V();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,s=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r];A(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r],l=s.query,c=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&c.push(o);for(let i=0;i<c.length;i++){const a=c[i];if(!document.contains(a)){const u=a[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",a,d)}delete a[s.attribute]}}}}}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{he(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function H(e,t,n,o,r={}){const s=r.extraAttributes||[],l=r.onAttributeChange||null,c=r.onSubtreeChange||null,i=r.onInit||null,a=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?se(d):u,_e=d?new Set(Object.keys(d)):null,Se=r.persist||null;function p(k){const w=k||document.body;if(A(w,e,t,n),d&&L())for(const h in d){const Ee=d[h],_=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&_.push(w);for(let S=0;S<_.length;S++){const O=_[S];g(O)&&j(Ee,O.getAttribute(h),h,o,O)}}i&&i(w)}const v=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)v.push(w[1])}else v.push(e);de({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:v.concat(s),onAttributeChange:l,onAttrChange:a,effects:f,declared:_e,persist:Se}),we();const Oe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Le=r.subtreeQuery||(Oe?e:"["+e+"]");V().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:Le}),be(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=H);function J(){ae()>0?ue(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J):J(),p}function Q(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},o=Q(t);if(!o)return n;const r=o.split("&");for(let s=0;s<r.length;s++){const l=r[s];if(!l)continue;const c=l.indexOf(":"),i=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(a)}catch{n[i]=a}}return n}function pe(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Q(location.hash)!==r&&(location.hash=r)}function Ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function me(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(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 xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=pe,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=Ce,window.lnCore.resolveHashNamespace=me,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=ve);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-accordion",t="lnAccordion";if(window[t]!==void 0)return;const n={"data-ln-accordion":{type:"marker",description:"Identifies container as an accordion that coordinates single-panel expansion"}};function o(r){return this.dom=r,this._onToggleOpen=function(s){if(!s.detail||!s.detail.target||s.detail.target.closest("[data-ln-accordion]")!==r)return;const l=r.querySelectorAll("[data-ln-toggle]");for(const c of l)c!==s.detail.target&&c.closest("[data-ln-accordion]")===r&&c.getAttribute("data-ln-toggle")==="open"&&c.setAttribute("data-ln-toggle","close");E(r,"ln-accordion:change",{target:s.detail.target})},r.addEventListener("ln-toggle:open",this._onToggleOpen),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:open",this._onToggleOpen),delete this.dom[t])},H(e,t,o,"ln-accordion",{attributes:n})})()})();
1
+ (function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){i=t[n];break}if(!C(i))return}e.apply(console,t)}}function I(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function P(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,n={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const o=c[s];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<c.length;s++){const o=c[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")r&&l[o.name]===1?n[o.name]=o.checked:(n[o.name]||(n[o.name]=[]),o.checked&&n[o.name].push(o.value));else if(o.type==="radio")o.checked&&(n[o.name]=o.value);else if(o.type==="select-multiple"){n[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&n[o.name].push(o.options[a].value)}else if(r&&o.type==="hidden")n[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const a=Number(o.value);n[o.name]=o.value===""||isNaN(a)?null:a}else n[o.name]=o.value}return n}function Y(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(e,t){const r=e.elements,i=[],n={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const o=t[s];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(n[l.name]>1){const a=String(o).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=Y(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<l.options.length;a++)l.options[a].selected=o.indexOf(l.options[a].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=P);const T={};function ee(e,t){T[e]=t}function te(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function oe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];q[r]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=re,window.lnCore.ensureLocaleObserver=ne);const m={};function ie(e,t){m[e]||(m[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=m[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const s=i[l],o=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const u=o[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const s=n[l],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],o=s.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const u=o[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let c=0;c<n.length;c++){const l=n[c],s=l.attributes;for(let o=0;o<s.length;o++){const a=s[o];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function se(e,t,r,i,n,c){const l={};for(let o=0;o<e.children.length;o++){const a=e.children[o],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],u=String(i(a));let d=l[u];if(d)n(d,a,o);else{const f=ie(r,c);if(!f||($(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),n(d,a,o)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=F,window.lnCore.lnFill=le,window.lnCore.renderList=se);function y(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function N(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function M(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const n=i.trim().toLowerCase();return!(n==="false"||n==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function B(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),n=function(c,l){const s=c.getAttribute(l);return s!==null&&i.has(s)?s:t};return A.set(r,n),n}function j(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function W(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function U(e,t,r,i,n){if(!e||t===null)return!0;const c=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=o=>{n?console.warn(o,n):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${c}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${c}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${c}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,r){for(const i in r){const[n,c,l]=r[i];Object.defineProperty(e,i,{get:function(){return n(t,c,l)},enumerable:!0,configurable:!0})}return e}function ae(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let n=i.read;if(!n&&i.type)switch(i.type){case"enum":n=B(i.values,i.fallback);break;case"integer":n=N;break;case"float":n=j;break;case"boolean":n=M;break;case"list":n=R;break;case"json":n=W;break;case"string":default:n=y;break}n||(n=y),t[i.prop]=[n,r,i.fallback]}return t}function ue(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ce,window.lnCore.attrSpec=ae,window.lnCore.attrStr=y,window.lnCore.attrInt=N,window.lnCore.attrBool=M,window.lnCore.attrList=R,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function V(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let o=0;o<s.length;o++)h(s[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function H(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=H(),r=e.observed||[];for(let i=0;i<r.length;i++){const n=r[i];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).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 n=t.byDeclaredAttr.get(i);n.some(c=>c.componentTag===e.componentTag)||n.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=de(e);if(i===null)t.reactiveWildcard.push(e);else for(const n of i)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,r,i){for(let n=0;n<e.length;n++){const c=e[n];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=H(),n=i.byAttr.get(t),c=D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!n&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&C(l)){const s=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let a=0;a<s.length;a++)U(s[a].spec,o,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(r||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&Q(s,l,t,e.oldValue),i.reactiveWildcard.length&&Q(i.reactiveWildcard,l,t,e.oldValue)}if(n)for(let s=0;s<n.length;s++){const o=n[s];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(V(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=x();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}if(e.target)for(let i=0;i<t.length;i++){const n=t[i];if(n.onSubtreeChange&&n.query){const c=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&n.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const n=e.addedNodes[i];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)n.matches&&n.matches(s.query)&&h(n,s);else if(n.matches&&n.matches(s.query)&&h(n,s),n.querySelectorAll){const o=n.querySelectorAll(s.query);for(let a=0;a<o.length;a++)h(o[a],s)}}s.onInit&&s.onInit(n)}}}for(let i=0;i<e.removedNodes.length;i++){const n=e.removedNodes[i];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l],o=s.query;if(o){if(!c)n.matches&&n.matches(o)&&v(n,s);else if(n.matches&&n.matches(o)&&v(n,s),n.querySelectorAll){const a=n.querySelectorAll(o);for(let u=0;u<a.length;u++)v(a[u],s)}}}}}}function J(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{ge(i)}catch(n){console.error("[ln-core] lifecycle handler failed",i.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){x().push(e),J()}function K(e,t,r,i,n={}){const c=n.extraAttributes||[],l=n.onAttributeChange||null,s=n.onSubtreeChange||null,o=n.onInit||null,a=n.onAttrChange||null,u=n.effects||null,d=n.attributes||null,f=d?ue(d):u,Ee=d?new Set(Object.keys(d)):null,Le=n.persist||null;function g(S){const w=S||document.body;if(V(w,e,t,r),d&&D())for(const b in d){const Te=d[b],O=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&O.push(w);for(let E=0;E<O.length;E++){const L=O[E];C(L)&&U(Te,L.getAttribute(b),b,i,L)}}o&&o(w)}const k=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)k.push(w[1])}else k.push(e);he({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:r,onInit:o,observed:k.concat(c),onAttributeChange:l,onAttrChange:a,effects:f,declared:Ee,persist:Le}),pe();const De=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ie=n.subtreeQuery||(De?e:"["+e+"]");x().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:s,query:Ie}),J(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K,window.lnCore.observeLifecycle=Ce);function G(){fe()>0?we(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),g}function z(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},i=z(t);if(!i)return r;const n=i.split("&");for(let c=0;c<n.length;c++){const l=n[c];if(!l)continue;const s=l.indexOf(":"),o=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(o)try{r[o]=decodeURIComponent(a)}catch{r[o]=a}}return r}function me(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const n=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");z(location.hash)!==n&&(location.hash=n)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const 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 ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),n=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-accordion",t="lnAccordion";if(window[t]!==void 0)return;const r={"data-ln-accordion":{type:"marker",description:"Identifies container as an accordion that coordinates single-panel expansion"}};function i(n){return this.dom=n,this._onToggleOpen=function(c){if(!c.detail||!c.detail.target||c.detail.target.closest("[data-ln-accordion]")!==n)return;const l=n.querySelectorAll("[data-ln-toggle]");for(const s of l)s!==c.detail.target&&s.closest("[data-ln-accordion]")===n&&s.getAttribute("data-ln-toggle")==="open"&&s.setAttribute("data-ln-toggle","close");I(n,"ln-accordion:change",{target:c.detail.target})},n.addEventListener("ln-toggle:open",this._onToggleOpen),this}i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:open",this._onToggleOpen),delete this.dom[t])},K(e,t,i,"ln-accordion",{attributes:r})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function Q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!N(r))return}e.apply(console,t)}}function A(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 Y(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(l),l}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,o={};if(n)for(let s=0;s<a.length;s++){const i=a[s];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<a.length;s++){const i=a[s];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let f=0;f<i.options.length;f++)i.options[f].selected&&l[i.name].push(i.options[f].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const f=Number(i.value);l[i.name]=i.value===""||isNaN(f)?null:f}else l[i.name]=i.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const n=e.elements,r=[],l={};for(let a=0;a<n.length;a++){const o=n[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<n.length;a++){const o=n[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const i=t[s];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const f=String(i).split(",").map(function(b){return b.trim()});o.checked=f.indexOf(o.value)!==-1}else o.checked=ne(i);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let f=0;f<o.options.length;f++)o.options[f].selected=i.indexOf(o.options[f].value)!==-1;r.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const M={};function oe(e,t){M[e]=t}function ie(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function ae(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];q[n]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=le);const O={};function ue(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const s=n[o],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],i=s.getAttribute("data-ln-attr").split(",");for(let f=0;f<i.length;f++){const b=i[f].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),u=b[1].trim();t[u]!=null&&s.setAttribute(h,t[u])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],i=s.getAttribute("data-ln-class").split(",");for(let f=0;f<i.length;f++){const b=i[f].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),u=b[1].trim();u in t&&s.classList.toggle(h,!!t[u])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(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 B(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let i=0;i<s.length;i++){const f=s[i];f.value.indexOf("{{")!==-1&&o.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function fe(e,t,n,r,l,a){const o={};for(let i=0;i<e.children.length;i++){const f=e.children[i],b=f.getAttribute("data-ln-render-key");b&&(o[b]=f)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const f=t[i],b=String(r(f));let h=o[b];if(h)l(h,f,i);else{const u=ue(n,a);if(!u||(B(u,f),h=u.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",b),l(h,f,i)}s.appendChild(h)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=W,window.lnCore.lnFill=ce,window.lnCore.renderList=fe);function D(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function U(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function R(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const F=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(F.has(n))return F.get(n);const r=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&r.has(s)?s:t};return F.set(n,l),l}function G(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function H(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function de(e,t,n,r,l){if(!e||t===null)return!0;const a=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function we(e,t,n){for(const r in n){const[l,a,o]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=K(r.values,r.fallback);break;case"integer":l=U;break;case"float":l=G;break;case"boolean":l=R;break;case"list":l=V;break;case"json":l=H;break;case"string":default:l=D;break}l||(l=D),t[r.prop]=[l,n,r.fallback]}return t}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=we,window.lnCore.attrSpec=pe,window.lnCore.attrStr=D,window.lnCore.attrInt=U,window.lnCore.attrBool=R,window.lnCore.attrList=V,window.lnCore.attrEnum=K,window.lnCore.attrFloat=G,window.lnCore.attrJson=H);function he(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&o.push(e);for(const s of o)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new r(s)}catch(i){console.error("["+n+"] init failed",s,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=J(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function P(e,t,n,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[n];o?o(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function me(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=J(),l=r.byAttr.get(n);if(Q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(t)){const a=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let s=0;s<a.length;s++)de(a[s].spec,o,n,a[s].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=r.byReactive.get(n);a&&P(a,t,n,e.oldValue),r.reactiveWildcard.length&&P(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const o=l[a];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(he(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{me(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 ye(e,t){ge({observed:e,handler:t}),Ce()}function X(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=X(t);if(!r)return n;const l=r.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),i=s>-1?o.slice(0,s):o,f=s>-1?o.slice(s+1):"";if(i)try{n[i]=decodeURIComponent(f)}catch{n[i]=f}}return n}function Ae(e){if(!e)return null;const t=$();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const o=n[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");X(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(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 n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Ae,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Te);function Le(){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=Le),(function(){const e="data-ln-ajax",t="lnAjax",n="data-ln-data-coordinator-scope";if(window[t]!==void 0)return;let r=null;function l(u){if(!u.hasAttribute(e)||u[t])return;u[t]=!0;const c=f(u);a(c.links),o(c.forms)}function a(u){for(const c of u){if(c[t+"Trigger"]||c.hostname&&c.hostname!==window.location.hostname)continue;const w=c.getAttribute("href");if(w&&w.includes("#"))continue;const d=function(m){if(!Z(m,c))return;m.preventDefault();const C=c.getAttribute("href");C&&i("GET",C,null,c)};c.addEventListener("click",d),c[t+"Trigger"]=d}}function o(u){for(const c of u){if(c[t+"Trigger"])continue;if(c.hasAttribute(n)){c[t+"ScopeWarned"]||(c[t+"ScopeWarned"]=!0,console.warn("[ln-ajax] Form has data-ln-data-coordinator-scope — the ln-data-coordinator write pipeline takes precedence; skipping ajax interception for this form."));continue}const w=function(d){if(d.defaultPrevented)return;d.preventDefault();const m=c.method.toUpperCase(),C=c.action,T=new FormData(c);for(const k of c.querySelectorAll('button, input[type="submit"]'))k.disabled=!0;i(m,C,T,c,function(){for(const k of c.querySelectorAll('button, input[type="submit"]'))k.disabled=!1})};c.addEventListener("submit",w),c[t+"Trigger"]=w}}function s(u){if(!u[t])return;const c=f(u);for(const w of c.links)w[t+"Trigger"]&&(w.removeEventListener("click",w[t+"Trigger"]),delete w[t+"Trigger"]);for(const w of c.forms)w[t+"Trigger"]&&(w.removeEventListener("submit",w[t+"Trigger"]),delete w[t+"Trigger"]);delete u[t]}function i(u,c,w,d,m){if(Y(d,"ln-ajax:before-start",{method:u,url:c}).defaultPrevented)return;u==="GET"&&r&&r(),A(d,"ln-ajax:start",{method:u,url:c}),d.classList.add("ln-ajax--loading");const T=document.createElement("span");T.className="ln-ajax-spinner",d.appendChild(T);function k(){d.classList.remove("ln-ajax--loading");const p=d.querySelector(".ln-ajax-spinner");p&&p.remove(),m&&m()}let y=c;const z=document.querySelector('meta[name="csrf-token"]'),L=z?z.getAttribute("content"):null;w instanceof FormData&&L&&w.append("_token",L);const j={method:u,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}};if(L&&(j.headers["X-CSRF-TOKEN"]=L),u==="GET"&&w){const p=new URLSearchParams(w);y=c+(c.includes("?")?"&":"?")+p.toString()}else u!=="GET"&&w&&(j.body=w);let v=null;if(u==="GET"){const p=new AbortController;j.signal=p.signal,v=function(){r=null,p.abort(),k(),A(d,"ln-ajax:aborted",{method:u,url:y})},r=v}fetch(y,j).then(function(p){const I=p.ok,g=p.status;return p.text().then(function(S){let x=null,_=null;if(S&&S.trim())try{x=JSON.parse(S)}catch(je){_=je}return{ok:I,status:g,data:x,parseError:_}})}).then(function(p){v&&r===v&&(r=null);const I=p.status,g=p.data,S=p.parseError;if(p.ok&&!S){if(g&&g.title&&(document.title=g.title),g&&g.content)for(const x in g.content){const _=document.getElementById(x);_&&(_.innerHTML=g.content[x])}if(d.tagName==="A"){const x=d.getAttribute("href");x&&window.history.pushState({ajax:!0},"",x)}else d.tagName==="FORM"&&d.method.toUpperCase()==="GET"&&window.history.pushState({ajax:!0},"",y);A(d,"ln-ajax:success",{method:u,url:y,data:g})}else A(d,"ln-ajax:error",{method:u,url:y,status:I,data:g,error:S||null});k(),A(d,"ln-ajax:complete",{method:u,url:y})}).catch(function(p){p&&p.name==="AbortError"||(v&&r===v&&(r=null),A(d,"ln-ajax:error",{method:u,url:y,status:0,data:null,error:p}),k(),A(d,"ln-ajax:complete",{method:u,url:y}))})}function f(u){const c={links:[],forms:[]};return u.tagName==="A"&&u.getAttribute(e)!=="false"?c.links.push(u):u.tagName==="FORM"&&u.getAttribute(e)!=="false"?c.forms.push(u):(c.links=Array.from(u.querySelectorAll('a:not([data-ln-ajax="false"])')),c.forms=Array.from(u.querySelectorAll('form:not([data-ln-ajax="false"])'))),c}function b(){E(function(){new MutationObserver(function(c){for(const w of c)if(w.type==="childList"){for(const d of w.addedNodes)if(d.nodeType===1&&(l(d),!d.hasAttribute(e))){for(const C of d.querySelectorAll("["+e+"]"))l(C);const m=d.closest&&d.closest("["+e+"]");if(m&&m.getAttribute(e)!=="false"){const C=f(d);a(C.links),o(C.forms)}}}}).observe(document.body,{childList:!0,subtree:!0}),ye([e],function(c){l(c)})},"ln-ajax")}function h(){for(const u of document.querySelectorAll("["+e+"]"))l(u)}window[t]=l,window[t].destroy=s,b(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h()})()})();
1
+ (function(){"use strict";function ee(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function M(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){n=t[i];break}if(!M(n))return}e.apply(console,t)}}function y(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function te(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(i),i}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const r=t.getAttribute("href");return!(!r||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||r.startsWith("mailto:")||r.startsWith("tel:")||r==="#"||r.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,i={},a=e.elements,l={};if(r)for(let s=0;s<a.length;s++){const o=a[s];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<a.length;s++){const o=a[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")i[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const r=e.elements,n=[],i={};for(let a=0;a<r.length;a++){const l=r[a];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<r.length;a++){const l=r[a];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const o=t[s];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(w){return w.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ie(o);n.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),n.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;n.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),n.push(l)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const W={};function se(e,t){W[e]=t}function ae(e){return W[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=se,window.lnCore.getDataMapper=ae);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ce);const D={};function de(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=D[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<n.length;l++){const s=n[l],o=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const w=o[u].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),c=w[1].trim();t[c]!=null&&s.setAttribute(b,t[c])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],o=s.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const w=o[u].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),c=w[1].trim();c in t&&s.classList.toggle(b,!!t[c])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function U(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const a=r.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const n=function(a,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const l=i[a],s=l.attributes;for(let o=0;o<s.length;o++){const u=s[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function he(e,t,r,n,i,a){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],w=u.getAttribute("data-ln-render-key");w&&(l[w]=u)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],w=String(n(u));let b=l[w];if(b)i(b,u,o);else{const c=de(r,a);if(!c||(U(c,u),b=c.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",w),i(b,u,o)}s.appendChild(b)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=R,window.lnCore.lnFill=we,window.lnCore.renderList=he);function q(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function V(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function K(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const i=n.trim().toLowerCase();return!(i==="false"||i==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const F=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(F.has(r))return F.get(r);const n=new Set(e||[]),i=function(a,l){const s=a.getAttribute(l);return s!==null&&n.has(s)?s:t};return F.set(r,i),i}function J(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function P(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function pe(e,t,r,n,i){if(!e||t===null)return!0;const a=n||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${a}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${a}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${a}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const n in r){const[i,a,l]=r[n];Object.defineProperty(e,n,{get:function(){return i(t,a,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let i=n.read;if(!i&&n.type)switch(n.type){case"enum":i=H(n.values,n.fallback);break;case"integer":i=V;break;case"float":i=J;break;case"boolean":i=K;break;case"list":i=G;break;case"json":i=P;break;case"string":default:i=q;break}i||(i=q),t[n.prop]=[i,r,n.fallback]}return t}function me(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=be,window.lnCore.attrSpec=ge,window.lnCore.attrStr=q,window.lnCore.attrInt=V,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=H,window.lnCore.attrFloat=J,window.lnCore.attrJson=P);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(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ye(e,t,r,n){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(a)&&_(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let o=0;o<s.length;o++)_(s[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=X(),r=e.observed||[];for(let n=0;n<r.length;n++){const i=r[n];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 n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const i=t.byDeclaredAttr.get(n);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=me(e);if(n===null)t.reactiveWildcard.push(e);else for(const i of n)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,n){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const l=a.effects&&a.effects[r];l?l(t,r,n):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,n)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=X(),i=n.byAttr.get(t),a=ee()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!i&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&M(l)){const s=n.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<s.length;u++)pe(s[u].spec,o,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=n.byReactive.get(t);s&&z(s,l,t,e.oldValue),n.reactiveWildcard.length&&z(n.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const o=i[s];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(ye(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ke(e){const t=Q();if(!t.length)return;const r=e.target;if(r){const n=r.nodeType===1?r:r.parentElement;if(n&&(n.isContentEditable||n.closest&&n.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange&&i.query){const a=i.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&i.onSubtreeChange(l,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1){const a=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)i.matches&&i.matches(s.query)&&_(i,s);else if(i.matches&&i.matches(s.query)&&_(i,s),i.querySelectorAll){const o=i.querySelectorAll(s.query);for(let u=0;u<o.length;u++)_(o[u],s)}}s.onInit&&s.onInit(i)}}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1){const a=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l],o=s.query;if(o){if(!a)i.matches&&i.matches(o)&&I(i,s);else if(i.matches&&i.matches(o)&&I(i,s),i.querySelectorAll){const u=i.querySelectorAll(o);for(let w=0;w<u.length;w++)I(u[w],s)}}}}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ke(n)}catch(i){console.error("[ln-core] lifecycle handler failed",n.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e,t){Ce({observed:e,handler:t}),xe()}function _e(e){Q().push(e),ve()}function Y(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,r={},n=Y(t);if(!n)return r;const i=n.split("&");for(let a=0;a<i.length;a++){const l=i[a];if(!l)continue;const s=l.indexOf(":"),o=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function Ee(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Le(e,t){if(!e)return;const r=N();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(a){const l=r[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==i&&(location.hash=i)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),i=n?n.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Fe);function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ie),(function(){const e="data-ln-ajax",t="lnAjax",r="data-ln-data-coordinator-scope";if(window[t]!==void 0)return;let n=null;function i(c){if(!c.hasAttribute(e)||c[t])return;c[t]=!0;const f=u(c);a(f.links),l(f.forms)}function a(c){for(const f of c){if(f[t+"Trigger"]||f.hostname&&f.hostname!==window.location.hostname)continue;const d=f.getAttribute("href");if(d&&d.includes("#"))continue;const h=function(A){if(!ne(A,f))return;A.preventDefault();const E=f.getAttribute("href");E&&o("GET",E,null,f)};f.addEventListener("click",h),f[t+"Trigger"]=h}}function l(c){for(const f of c){if(f[t+"Trigger"])continue;if(f.hasAttribute(r)){f[t+"ScopeWarned"]||(f[t+"ScopeWarned"]=!0,console.warn("[ln-ajax] Form has data-ln-data-coordinator-scope — the ln-data-coordinator write pipeline takes precedence; skipping ajax interception for this form."));continue}const d=function(h){if(h.defaultPrevented)return;h.preventDefault();const A=f.method.toUpperCase(),E=f.action,T=new FormData(f);for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!0;o(A,E,T,f,function(){for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!1})};f.addEventListener("submit",d),f[t+"Trigger"]=d}}function s(c){if(!c[t])return;const f=u(c);for(const d of f.links)d[t+"Trigger"]&&(d.removeEventListener("click",d[t+"Trigger"]),delete d[t+"Trigger"]);for(const d of f.forms)d[t+"Trigger"]&&(d.removeEventListener("submit",d[t+"Trigger"]),delete d[t+"Trigger"]);delete c[t]}function o(c,f,d,h,A){if(te(h,"ln-ajax:before-start",{method:c,url:f}).defaultPrevented)return;c==="GET"&&n&&n(),y(h,"ln-ajax:start",{method:c,url:f}),h.classList.add("ln-ajax--loading");const T=document.createElement("span");T.className="ln-ajax-spinner",h.appendChild(T);function x(){h.classList.remove("ln-ajax--loading");const p=h.querySelector(".ln-ajax-spinner");p&&p.remove(),A&&A()}let m=f;const Z=document.querySelector('meta[name="csrf-token"]'),j=Z?Z.getAttribute("content"):null;d instanceof FormData&&j&&d.append("_token",j);const O={method:c,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}};if(j&&(O.headers["X-CSRF-TOKEN"]=j),c==="GET"&&d){const p=new URLSearchParams(d);m=f+(f.includes("?")?"&":"?")+p.toString()}else c!=="GET"&&d&&(O.body=d);let k=null;if(c==="GET"){const p=new AbortController;O.signal=p.signal,k=function(){n=null,p.abort(),x(),y(h,"ln-ajax:aborted",{method:c,url:m})},n=k}fetch(m,O).then(function(p){const $=p.ok,g=p.status;return p.text().then(function(v){let C=null,L=null;if(v&&v.trim())try{C=JSON.parse(v)}catch(Ne){L=Ne}return{ok:$,status:g,data:C,parseError:L}})}).then(function(p){k&&n===k&&(n=null);const $=p.status,g=p.data,v=p.parseError;if(p.ok&&!v){if(g&&g.title&&(document.title=g.title),g&&g.content)for(const C in g.content){const L=document.getElementById(C);L&&(L.innerHTML=g.content[C])}if(h.tagName==="A"){const C=h.getAttribute("href");C&&window.history.pushState({ajax:!0},"",C)}else h.tagName==="FORM"&&h.method.toUpperCase()==="GET"&&window.history.pushState({ajax:!0},"",m);y(h,"ln-ajax:success",{method:c,url:m,data:g})}else y(h,"ln-ajax:error",{method:c,url:m,status:$,data:g,error:v||null});x(),y(h,"ln-ajax:complete",{method:c,url:m})}).catch(function(p){p&&p.name==="AbortError"||(k&&n===k&&(n=null),y(h,"ln-ajax:error",{method:c,url:m,status:0,data:null,error:p}),x(),y(h,"ln-ajax:complete",{method:c,url:m}))})}function u(c){const f={links:[],forms:[]};return c.tagName==="A"&&c.getAttribute(e)!=="false"?f.links.push(c):c.tagName==="FORM"&&c.getAttribute(e)!=="false"?f.forms.push(c):(f.links=Array.from(c.querySelectorAll('a:not([data-ln-ajax="false"])')),f.forms=Array.from(c.querySelectorAll('form:not([data-ln-ajax="false"])'))),f}function w(){S(function(){_e({onInit:function(c){if(i(c),!c.hasAttribute(e)){for(const d of c.querySelectorAll("["+e+"]"))i(d);const f=c.closest&&c.closest("["+e+"]");if(f&&f.getAttribute(e)!=="false"){const d=u(c);a(d.links),l(d.forms)}}}}),Se([e],function(c){i(c)})},"ln-ajax")}function b(){for(const c of document.querySelectorAll("["+e+"]"))i(c)}window[t]=i,window[t].destroy=s,w(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",b):b()})()})();
@@ -1,4 +1,4 @@
1
- import { guardBody, dispatch, dispatchCancelable, shouldInterceptLink, observeAttributes } from '../../ln-core';
1
+ import { guardBody, dispatch, dispatchCancelable, shouldInterceptLink, observeAttributes, observeLifecycle } from '../../ln-core';
2
2
 
3
3
  (function () {
4
4
  const DOM_SELECTOR = 'data-ln-ajax';
@@ -257,36 +257,25 @@ import { guardBody, dispatch, dispatchCancelable, shouldInterceptLink, observeAt
257
257
 
258
258
  function _domObserver() {
259
259
  guardBody(function () {
260
- const observer = new MutationObserver(function (mutations) {
261
- for (const mutation of mutations) {
262
- if (mutation.type === 'childList') {
263
- for (const node of mutation.addedNodes) {
264
- if (node.nodeType === 1) {
265
- _constructor(node);
266
-
267
- if (!node.hasAttribute(DOM_SELECTOR)) {
268
- for (const el of node.querySelectorAll('[' + DOM_SELECTOR + ']')) {
269
- _constructor(el);
270
- }
271
-
272
- const ajaxRoot = node.closest && node.closest('[' + DOM_SELECTOR + ']');
273
- if (ajaxRoot && ajaxRoot.getAttribute(DOM_SELECTOR) !== 'false') {
274
- const items = findElements(node);
275
- _attachLinksAjax(items.links);
276
- _attachFormsAjax(items.forms);
277
- }
278
- }
279
- }
260
+ observeLifecycle({
261
+ onInit: function (node) {
262
+ _constructor(node);
263
+
264
+ if (!node.hasAttribute(DOM_SELECTOR)) {
265
+ for (const el of node.querySelectorAll('[' + DOM_SELECTOR + ']')) {
266
+ _constructor(el);
267
+ }
268
+
269
+ const ajaxRoot = node.closest && node.closest('[' + DOM_SELECTOR + ']');
270
+ if (ajaxRoot && ajaxRoot.getAttribute(DOM_SELECTOR) !== 'false') {
271
+ const items = findElements(node);
272
+ _attachLinksAjax(items.links);
273
+ _attachFormsAjax(items.forms);
280
274
  }
281
275
  }
282
276
  }
283
277
  });
284
278
 
285
- observer.observe(document.body, {
286
- childList: true,
287
- subtree: true
288
- });
289
-
290
279
  observeAttributes([DOM_SELECTOR], function (el) {
291
280
  _constructor(el);
292
281
  });
@@ -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 E(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(!E(o))return}e.apply(console,t)}}function b(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function 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 te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(n)for(let u=0;u<c.length;u++){const s=c[u];s.name&&s.type==="checkbox"&&!s.disabled&&(l[s.name]=(l[s.name]||0)+1)}for(let u=0;u<c.length;u++){const s=c[u];if(!(!s.name||s.disabled||s.type==="file"||s.type==="submit"||s.type==="button")&&!(o&&s.matches&&s.matches(o)))if(s.type==="checkbox")n&&l[s.name]===1?i[s.name]=s.checked:(i[s.name]||(i[s.name]=[]),s.checked&&i[s.name].push(s.value));else if(s.type==="radio")s.checked&&(i[s.name]=s.value);else if(s.type==="select-multiple"){i[s.name]=[];for(let r=0;r<s.options.length;r++)s.options[r].selected&&i[s.name].push(s.options[r].value)}else if(n&&s.type==="hidden")i[s.name]=s.value;else if(n&&(s.type==="number"||s.type==="range")){const r=Number(s.value);i[s.name]=s.value===""||isNaN(r)?null:r}else i[s.name]=s.value}return i}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const n=e.elements,o=[],i={};for(let c=0;c<n.length;c++){const l=n[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<n.length;c++){const l=n[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const u=l.getAttribute("data-ln-fill-as")||l.name;if(!u||!(u in t))continue;const s=t[u];if(l.type==="checkbox"){if(Array.isArray(s))l.checked=s.indexOf(l.value)!==-1;else if(i[l.name]>1){const r=String(s).split(",").map(function(f){return f.trim()});l.checked=r.indexOf(l.value)!==-1}else l.checked=re(s);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(s),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(s))for(let r=0;r<l.options.length;r++)l.options[r].selected=s.indexOf(l.options[r].value)!==-1;o.push(l)}else l.value=s,l.tagName==="SELECT"&&s!=null&&l.setAttribute("data-ln-value",s),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);function ie(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(n){return console.error(`[${t}] Invalid headers JSON:`,n),{}}}const $={};function le(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=le,window.lnCore.getDataMapper=ae);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){b(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ce(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=se);const S={};function ue(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=S[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],s=u.getAttribute("data-ln-field");t[s]!=null&&(u.textContent=t[s])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const u=o[l],s=u.getAttribute("data-ln-attr").split(",");for(let r=0;r<s.length;r++){const f=s[r].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),d=f[1].trim();t[d]!=null&&u.setAttribute(a,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const u=i[l],s=u.getAttribute("data-ln-show");s in t&&u.classList.toggle("hidden",!t[s])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const u=c[l],s=u.getAttribute("data-ln-class").split(",");for(let r=0;r<s.length;r++){const f=s[r].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),d=f[1].trim();d in t&&u.classList.toggle(a,!!t[d])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(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 c=n.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],u=l.attributes;for(let s=0;s<u.length;s++){const r=u[s];r.value.indexOf("{{")!==-1&&l.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function pe(e,t,n,o,i,c){const l={};for(let s=0;s<e.children.length;s++){const r=e.children[s],f=r.getAttribute("data-ln-render-key");f&&(l[f]=r)}const u=document.createDocumentFragment();for(let s=0;s<t.length;s++){const r=t[s],f=String(o(r));let a=l[f];if(a)i(a,r,s);else{const d=ue(n,c);if(!d||(U(d,r),a=d.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",f),i(a,r,s)}u.appendChild(a)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=R,window.lnCore.lnFill=fe,window.lnCore.renderList=pe);function C(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function B(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const O=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(O.has(n))return O.get(n);const o=new Set(e||[]),i=function(c,l){const u=c.getAttribute(l);return u!==null&&o.has(u)?u:t};return O.set(n,i),i}function Q(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function J(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function K(e,t,n,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=s=>{i?console.warn(s,i):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(u(`[${c}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(u(`[${c}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${c}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(u(`[${c}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(u(`[${c}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${c}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return u(`[${c}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,n){for(const o in n){const[i,c,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=W(o.values,o.fallback);break;case"integer":i=M;break;case"float":i=Q;break;case"boolean":i=B;break;case"list":i=H;break;case"json":i=J;break;case"string":default:i=C;break}i||(i=C),t[o.prop]=[i,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function we(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=V,window.lnCore.attrSpec=G,window.lnCore.attrStr=C,window.lnCore.attrInt=M,window.lnCore.attrBool=B,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=Q,window.lnCore.attrJson=J);function T(e,t,n,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(c));e.matches&&e.matches(c)&&l.push(e);for(const u of l)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new o(u)}catch(s){console.error("["+n+"] init failed",u,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 ge(e){const t=z(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[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(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=we(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,n,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[n];l?l(t,n,o):c.onAttrChange&&(!c.declared||c.declared.has(n))&&c.onAttrChange(t,n,o)}}function ye(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=z(),i=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&E(t)){const c=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let u=0;u<c.length;u++)K(c[u].spec,l,n,c[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const c=o.byReactive.get(n);c&&X(c,t,n,e.oldValue),o.reactiveWildcard.length&&X(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const l=i[c];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(T(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function Ce(){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{ye(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Y(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function _e(e){const t=Y();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,c=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;c&&o.onSubtreeChange(c,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const c=t[i];T(o,c.selector,c.attribute,c.ComponentFn),c.onInit&&c.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const c=t[i],l=c.query,u=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&u.push(o);for(let s=0;s<u.length;s++){const r=u[s];if(!document.contains(r)){const f=r[c.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(a){console.error("["+c.attribute+"] destroy failed",r,a)}delete r[c.attribute]}}}}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{_e(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Z(e,t,n,o,i={}){const c=i.extraAttributes||[],l=i.onAttributeChange||null,u=i.onSubtreeChange||null,s=i.onInit||null,r=i.onAttrChange||null,f=i.effects||null,a=i.attributes||null,d=a?he(a):f,p=a?new Set(Object.keys(a)):null,h=i.persist||null;function m(v){const w=v||document.body;if(T(w,e,t,n),a&&F())for(const g in a){const Fe=a[g],D=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&D.push(w);for(let I=0;I<D.length;I++){const j=D[I];E(j)&&K(Fe,j.getAttribute(g),g,o,j)}}s&&s(w)}const y=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let w;for(;(w=v.exec(e))!==null;)y.push(w[1])}else y.push(e);ge({selector:e,attribute:t,componentTag:o,attributes:a,ComponentFn:n,onInit:s,observed:y.concat(c),onAttributeChange:l,onAttrChange:r,effects:d,declared:p,persist:h}),Ce();const L=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,x=i.subtreeQuery||(L?e:"["+e+"]");Y().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:u,query:x}),Ae(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z);function A(){me()>0?be(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A(),m}function P(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},o=P(t);if(!o)return n;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const u=l.indexOf(":"),s=u>-1?l.slice(0,u):l,r=u>-1?l.slice(u+1):"";if(s)try{n[s]=decodeURIComponent(r)}catch{n[s]=r}}return n}function ve(e){if(!e)return null;const t=q();return e in t?t[e]:null}function ke(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(c){const l=n[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");P(location.hash)!==i&&(location.hash=i)}function xe(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Te(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=ve,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Te,window.lnCore.hashFilterDecode=qe);function Le(){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=Le);const De={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function _(...e){return e.filter(t=>t!=null&&t!=="").map((t,n)=>{const o=String(t);return n===0?o.replace(/\/+$/,""):o.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function Ie(e,t){if(!e||typeof e!="object")return"";const n=Object.assign({},De);if(t&&typeof t=="object")for(const i in t)t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(n[i]=t[i]);const o=new URLSearchParams;return e.search&&o.append(n.search,e.search),e.offset!=null&&o.append(n.offset,e.offset),e.limit!=null&&o.append(n.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(o.append(n.sortField,e.sort.field),o.append(n.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(i=>{const c=e.filters[i];Array.isArray(c)&&c.length>0&&o.append(i,c.join(","))}),o.toString()}function je(e,t,n){let o=_(e,t);return n&&(o+=(o.indexOf("?")!==-1?"&":"?")+n),o}function ee(e){const t=e&&e.content!==void 0?e.content:e,n=e&&e.message?e.message:null;return{record:t,message:n}}(function(){const e="data-ln-api-connector",t="lnApiConnector",n="lnConnector";if(window[t]!==void 0)return;function o(r){const f=r[t];f&&f.refreshConfig()}const i={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:C,type:"string",fallback:"",effect:o,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:C,type:"string",fallback:"",effect:o,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{prop:"path",read:C,type:"string",fallback:"",effect:o,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:C,type:"json",fallback:null,effect:o,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:o,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:o,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:o,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:o,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:o,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:o,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},c=G(i);function l(r){return r.ok?r.status===204?null:r.json():r.json().catch(()=>null).then(f=>{const a=new Error("HTTP "+r.status+": "+r.statusText);throw a.status=r.status,a.data=f,a})}function u(r){return this.dom=r,V(this,r,c),r[t]=this,r[n]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,s(this),this}u.prototype.refreshConfig=function(){const r=this.dom;this.credentials="same-origin",this.headers=ie(this.rawHeaders);const f={},a=r.getAttribute("data-ln-api-param-offset");a&&(f.offset=a);const d=r.getAttribute("data-ln-api-param-limit");d&&(f.limit=d);const p=r.getAttribute("data-ln-api-param-search");p&&(f.search=p);const h=r.getAttribute("data-ln-api-param-sort-field");h&&(f.sortField=h);const m=r.getAttribute("data-ln-api-param-sort-dir");m&&(f.sortDir=m),this.paramKeys=f;const y=r.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=y!==null?+y:300,b(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},u.prototype._reqHeaders=function(r){const f=Object.assign({},this.headers);return!f.Accept&&!f.accept&&(f.Accept="application/json"),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]="application/json"),r&&(f["X-Idempotency-Key"]=r),f},u.prototype.cancel=function(r){return r&&this._inflight.has(r)?(this._inflight.get(r).abort(),this._inflight.delete(r),!0):!1},u.prototype.fetchDelta=function(r,f){const a=this;let d=_(a.baseUrl,a.path);r!=null&&r!==""&&(d+=(d.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(r));const p=f||"sync";a._inflight.has(p)&&a._inflight.get(p).abort();const h=new AbortController;return a._inflight.set(p,h),window.fetch(d,{method:"GET",headers:a._reqHeaders(),credentials:a.credentials,signal:h.signal}).then(l).finally(function(){a._inflight.get(p)===h&&a._inflight.delete(p)})},u.prototype.query=function(r,f){const a=this,d=Ie(r,a.paramKeys),p=je(a.baseUrl,a.path,d),h=f||"query";a._inflight.has(h)&&a._inflight.get(h).abort();const m=new AbortController;return a._inflight.set(h,m),window.fetch(p,{method:"GET",headers:a._reqHeaders(),credentials:a.credentials,signal:m.signal}).then(l).finally(function(){a._inflight.get(h)===m&&a._inflight.delete(h)})},u.prototype.create=function(r,f,a){const d=this;return window.fetch(_(d.baseUrl,f||d.path),{method:"POST",headers:d._reqHeaders(a),credentials:d.credentials,body:JSON.stringify(r)}).then(l)},u.prototype.update=function(r,f,a,d,p){const h=this;a!=null&&(f=Object.assign({},f,{expected_version:a}));const m=d?_(h.baseUrl,d):_(h.baseUrl,h.path,r);return window.fetch(m,{method:"PUT",headers:h._reqHeaders(p),credentials:h.credentials,body:JSON.stringify(f)}).then(l)},u.prototype.delete=function(r,f,a){const d=this;return window.fetch(_(d.baseUrl,f||d.path,r),{method:"DELETE",headers:d._reqHeaders(a),credentials:d.credentials}).then(l)},u.prototype.bulkDelete=function(r,f,a){const d=this;return window.fetch(_(d.baseUrl,f||d.path,"bulk-delete"),{method:"DELETE",headers:d._reqHeaders(a),credentials:d.credentials,body:JSON.stringify({ids:r})}).then(l)};function s(r){r._handlers={sync:function(f){const a=f.detail||{},d=a.meta&&a.meta.targetEl?a.meta.targetEl:null;r.fetchDelta(a.since,d).then(function(p){b(r.dom,"ln-api-connector:fetched",{data:p,since:a.since,meta:a.meta||null})}).catch(function(p){p&&p.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"sync",error:p.message,status:p.status||0,data:p.data||null,since:a.since,meta:a.meta||null})})},query:function(f){const a=f.detail||{},d=a.query||a,p=a.meta&&a.meta.targetEl?a.meta.targetEl:null,h=p||"query",m=r.queryDebounce;function y(x,A,v){r.query(A,v).then(function(w){const g=w||{};b(r.dom,"ln-api-connector:fetched",{data:g.data||(Array.isArray(g)?g:[]),total:g.total,filtered:g.filtered,offset:A.offset,queryGen:A.queryGen,meta:x.meta||null})}).catch(function(w){w&&w.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"query",error:w.message,status:w.status||0,data:w.data||null,meta:x.meta||null})})}if(m===0){y(a,d,p);return}r._queryTimers.has(h)&&clearTimeout(r._queryTimers.get(h));const L=setTimeout(function(){r._queryTimers.delete(h),y(a,d,p)},m);r._queryTimers.set(h,L)},cancel:function(f){const a=f.detail||{},d=a.meta&&a.meta.targetEl?a.meta.targetEl:a.targetEl||a.key;d&&r.cancel(d)},create:function(f){const a=f.detail||{};r.create(a.data,a.url,a.idempotencyKey).then(function(d){const p=ee(d);b(r.dom,"ln-api-connector:created",{record:p.record,tempId:a.tempId,message:p.message,meta:a.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"create",error:d.message,status:d.status||0,data:d.data||null,tempId:a.tempId,meta:a.meta||null})})},update:function(f){const a=f.detail||{};r.update(a.id,a.data,a.expected_version,a.url,a.idempotencyKey).then(function(d){const p=ee(d);b(r.dom,"ln-api-connector:updated",{record:p.record,id:a.id,message:p.message,meta:a.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"update",error:d.message,status:d.status||0,data:d.data||null,id:a.id,conflictData:d.status===409?d.data:null,meta:a.meta||null})})},delete:function(f){const a=f.detail||{};r.delete(a.id,a.url,a.idempotencyKey).then(function(d){const p=d&&d.message?d.message:null;b(r.dom,"ln-api-connector:deleted",{response:d,id:a.id,message:p,meta:a.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"delete",error:d.message,status:d.status||0,data:d.data||null,id:a.id,meta:a.meta||null})})},bulkDelete:function(f){const a=f.detail||{};r.bulkDelete(a.ids,a.url,a.idempotencyKey).then(function(d){const p=d&&d.message?d.message:null;b(r.dom,"ln-api-connector:bulk-deleted",{response:d,ids:a.ids,message:p,meta:a.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(r.dom,"ln-api-connector:error",{action:"bulk-delete",error:d.message,status:d.status||0,data:d.data||null,ids:a.ids,meta:a.meta||null})})}},r.dom.addEventListener("ln-api-connector:request-sync",r._handlers.sync),r.dom.addEventListener("ln-api-connector:request-query",r._handlers.query),r.dom.addEventListener("ln-api-connector:request-cancel",r._handlers.cancel),r.dom.addEventListener("ln-api-connector:request-create",r._handlers.create),r.dom.addEventListener("ln-api-connector:request-update",r._handlers.update),r.dom.addEventListener("ln-api-connector:request-delete",r._handlers.delete),r.dom.addEventListener("ln-api-connector:request-bulk-delete",r._handlers.bulkDelete)}u.prototype.destroy=function(){if(!this.dom[t])return;const r=this;r._inflight&&(r._inflight.forEach(function(f){f.abort()}),r._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(f){f&&clearTimeout(f)}),this._queryTimers.clear()),this._handlers&&(r.dom.removeEventListener("ln-api-connector:request-sync",r._handlers.sync),r.dom.removeEventListener("ln-api-connector:request-query",r._handlers.query),r.dom.removeEventListener("ln-api-connector:request-cancel",r._handlers.cancel),r.dom.removeEventListener("ln-api-connector:request-create",r._handlers.create),r.dom.removeEventListener("ln-api-connector:request-update",r._handlers.update),r.dom.removeEventListener("ln-api-connector:request-delete",r._handlers.delete),r.dom.removeEventListener("ln-api-connector:request-bulk-delete",r._handlers.bulkDelete),r._handlers=null),delete this.dom[t],delete this.dom[n]},Z(e,t,u,"ln-api-connector",{attributes:i})})()})();
1
+ (function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!S(r))return}e.apply(console,t)}}function b(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,i={},u=e.elements,a={};if(o)for(let c=0;c<u.length;c++){const l=u[c];l.name&&l.type==="checkbox"&&!l.disabled&&(a[l.name]=(a[l.name]||0)+1)}for(let c=0;c<u.length;c++){const l=u[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")o&&a[l.name]===1?i[l.name]=l.checked:(i[l.name]||(i[l.name]=[]),l.checked&&i[l.name].push(l.value));else if(l.type==="radio")l.checked&&(i[l.name]=l.value);else if(l.type==="select-multiple"){i[l.name]=[];for(let n=0;n<l.options.length;n++)l.options[n].selected&&i[l.name].push(l.options[n].value)}else if(o&&l.type==="hidden")i[l.name]=l.value;else if(o&&(l.type==="number"||l.type==="range")){const n=Number(l.value);i[l.name]=l.value===""||isNaN(n)?null:n}else i[l.name]=l.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 ae(e,t){const o=e.elements,r=[],i={};for(let u=0;u<o.length;u++){const a=o[u];a.name&&a.type==="checkbox"&&(i[a.name]=(i[a.name]||0)+1)}for(let u=0;u<o.length;u++){const a=o[u];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const c=a.getAttribute("data-ln-fill-as")||a.name;if(!c||!(c in t))continue;const l=t[c];if(a.type==="checkbox"){if(Array.isArray(l))a.checked=l.indexOf(a.value)!==-1;else if(i[a.name]>1){const n=String(l).split(",").map(function(f){return f.trim()});a.checked=n.indexOf(a.value)!==-1}else a.checked=le(l);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(l),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(l))for(let n=0;n<a.options.length;n++)a.options[n].selected=l.indexOf(a.options[n].value)!==-1;r.push(a)}else a.value=l,a.tagName==="SELECT"&&l!=null&&a.setAttribute("data-ln-value",l),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);function se(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(o){return console.error(`[${t}] Invalid headers JSON:`,o),{}}}const R={};function ce(e,t){R[e]=t}function de(e){return R[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,E(function(){new MutationObserver(function(){b(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function fe(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];U[o]=t}function pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=pe,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 M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let a=0;a<o.length;a++){const c=o[a],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const c=r[a],l=c.getAttribute("data-ln-attr").split(",");for(let n=0;n<l.length;n++){const f=l[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(s,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let a=0;a<i.length;a++){const c=i[a],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const u=e.querySelectorAll("[data-ln-class]");for(let a=0;a<u.length;a++){const c=u[a],l=c.getAttribute("data-ln-class").split(",");for(let n=0;n<l.length;n++){const f=l[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(s,!!t[d])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function B(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const u=o.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,c){return t[c]!==void 0?t[c]:""}))}const r=function(u,a){return t[a]!==void 0?t[a]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let u=0;u<i.length;u++){const a=i[u],c=a.attributes;for(let l=0;l<c.length;l++){const n=c[l];n.value.indexOf("{{")!==-1&&a.setAttribute(n.name,n.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function me(e,t,o,r,i,u){const a={};for(let l=0;l<e.children.length;l++){const n=e.children[l],f=n.getAttribute("data-ln-render-key");f&&(a[f]=n)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const n=t[l],f=String(r(n));let s=a[f];if(s)i(s,n,l);else{const d=he(o,u);if(!d||(B(d,n),s=d.firstElementChild,!s))continue;s.setAttribute("data-ln-render-key",f),i(s,n,l)}c.appendChild(s)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=M,window.lnCore.lnFill=we,window.lnCore.renderList=me);function C(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function H(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function W(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function Q(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const L=new Map;function J(e,t){const o=(e?e.join("|"):"")+"::"+t;if(L.has(o))return L.get(o);const r=new Set(e||[]),i=function(u,a){const c=u.getAttribute(a);return c!==null&&r.has(c)?c:t};return L.set(o,i),i}function K(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function V(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function G(e,t,o,r,i){if(!e||t===null)return!0;const u=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const c=l=>{i?console.warn(l,i):console.warn(l)};if(a==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${u}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${u}] Invalid value "${t}" for attribute "${o}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return c(`[${u}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${u}] Value ${l} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${u}] Value ${l} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(c(`[${u}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${u}] Invalid JSON for attribute "${o}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function z(e,t,o){for(const r in o){const[i,u,a]=o[r];Object.defineProperty(e,r,{get:function(){return i(t,u,a)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=J(r.values,r.fallback);break;case"integer":i=H;break;case"float":i=K;break;case"boolean":i=W;break;case"list":i=Q;break;case"json":i=V;break;case"string":default:i=C;break}i||(i=C),t[r.prop]=[i,o,r.fallback]}return t}function be(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function 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=z,window.lnCore.attrSpec=X,window.lnCore.attrStr=C,window.lnCore.attrInt=H,window.lnCore.attrBool=W,window.lnCore.attrList=Q,window.lnCore.attrEnum=J,window.lnCore.attrFloat=K,window.lnCore.attrJson=V);function v(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 Y(e,t,o,r){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(u)&&v(e,a),e.querySelectorAll){const c=e.querySelectorAll(u);for(let l=0;l<c.length;l++)v(c[l],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 Z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=Z(),o=e.observed||[];for(let r=0;r<o.length;r++){const i=o[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(u=>u.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 P(e,t,o,r){for(let i=0;i<e.length;i++){const u=e[i];if(!t[u.attribute])continue;const a=u.effects&&u.effects[o];a?a(t,o,r):u.onAttrChange&&(!u.declared||u.declared.has(o))&&u.onAttrChange(t,o,r)}}function Ae(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=Z(),i=r.byAttr.get(t),u=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!i&&!u)return;const a=e.target;if(e.oldValue!==a.getAttribute(t)){if(u&&S(a)){const c=r.byDeclaredAttr.get(t),l=a.getAttribute(t);for(let n=0;n<c.length;n++)G(c[n].spec,l,t,c[n].componentTag,a)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,a,{oldValue:e.oldValue,newValue:a.getAttribute(t)}),o){const c=r.byReactive.get(t);c&&P(c,a,t,e.oldValue),r.reactiveWildcard.length&&P(r.reactiveWildcard,a,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const l=i[c];if(l.handler){l.handler(a,t,e.oldValue);continue}l.onAttributeChange&&a[l.attribute]?l.onAttributeChange(a,t):(Y(a,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(a))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ae(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ke(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}if(e.target)for(let r=0;r<t.length;r++){const i=t[r];if(i.onSubtreeChange&&i.query){const u=i.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(u)?e.target:e.target.closest?e.target.closest(u):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(u):null;a&&i.onSubtreeChange(a,e)}}for(let r=0;r<e.addedNodes.length;r++){const i=e.addedNodes[r];if(i.nodeType===1){const u=!!(i.firstElementChild||i.children&&i.children.length);for(let a=0;a<t.length;a++){const c=t[a];if(c.selector&&c.attribute&&c.ComponentFn){if(!u)i.matches&&i.matches(c.query)&&v(i,c);else if(i.matches&&i.matches(c.query)&&v(i,c),i.querySelectorAll){const l=i.querySelectorAll(c.query);for(let n=0;n<l.length;n++)v(l[n],c)}}c.onInit&&c.onInit(i)}}}for(let r=0;r<e.removedNodes.length;r++){const i=e.removedNodes[r];if(i.nodeType===1){const u=!!(i.firstElementChild||i.children&&i.children.length);for(let a=0;a<t.length;a++){const c=t[a],l=c.query;if(l){if(!u)i.matches&&i.matches(l)&&T(i,c);else if(i.matches&&i.matches(l)&&T(i,c),i.querySelectorAll){const n=i.querySelectorAll(l);for(let f=0;f<n.length;f++)T(n[f],c)}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{ke(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){O().push(e),ee()}function te(e,t,o,r,i={}){const u=i.extraAttributes||[],a=i.onAttributeChange||null,c=i.onSubtreeChange||null,l=i.onInit||null,n=i.onAttrChange||null,f=i.effects||null,s=i.attributes||null,d=s?be(s):f,p=s?new Set(Object.keys(s)):null,h=i.persist||null;function m(k){const w=k||document.body;if(Y(w,e,t,o),s&&N())for(const g in s){const Re=s[g],F=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&F.push(w);for(let j=0;j<F.length;j++){const $=F[j];S($)&&G(Re,$.getAttribute(g),g,r,$)}}l&&l(w)}const y=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)y.push(w[1])}else y.push(e);_e({selector:e,attribute:t,componentTag:r,attributes:s,ComponentFn:o,onInit:l,observed:y.concat(u),onAttributeChange:a,onAttrChange:n,effects:d,declared:p,persist:h}),ve();const I=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,x=i.subtreeQuery||(I?e:"["+e+"]");O().push({selector:e,attribute:t,ComponentFn:o,onInit:l,onSubtreeChange:c,query:x}),ee(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=Ee);function A(){ye()>0?Ce(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A(),m}function ne(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,o={},r=ne(t);if(!r)return o;const i=r.split("&");for(let u=0;u<i.length;u++){const a=i[u];if(!a)continue;const c=a.indexOf(":"),l=c>-1?a.slice(0,c):a,n=c>-1?a.slice(c+1):"";if(l)try{o[l]=decodeURIComponent(n)}catch{o[l]=n}}return o}function xe(e){if(!e)return null;const t=D();return e in t?t[e]:null}function Se(e,t){if(!e)return;const o=D();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(u){const a=o[u];return a===""?u:u+":"+encodeURIComponent(a)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=xe,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Fe(){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=Fe);const je={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function _(...e){return e.filter(t=>t!=null&&t!=="").map((t,o)=>{const r=String(t);return o===0?r.replace(/\/+$/,""):r.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function $e(e,t){if(!e||typeof e!="object")return"";const o=Object.assign({},je);if(t&&typeof t=="object")for(const i in t)t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(o[i]=t[i]);const r=new URLSearchParams;return e.search&&r.append(o.search,e.search),e.offset!=null&&r.append(o.offset,e.offset),e.limit!=null&&r.append(o.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(r.append(o.sortField,e.sort.field),r.append(o.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(i=>{const u=e.filters[i];Array.isArray(u)&&u.length>0&&r.append(i,u.join(","))}),r.toString()}function Ne(e,t,o){let r=_(e,t);return o&&(r+=(r.indexOf("?")!==-1?"&":"?")+o),r}function re(e){const t=e&&e.content!==void 0?e.content:e,o=e&&e.message?e.message:null;return{record:t,message:o}}(function(){const e="data-ln-api-connector",t="lnApiConnector",o="lnConnector";if(window[t]!==void 0)return;function r(n){const f=n[t];f&&f.refreshConfig()}const i={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:C,type:"string",fallback:"",effect:r,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:C,type:"string",fallback:"",effect:r,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{prop:"path",read:C,type:"string",fallback:"",effect:r,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:C,type:"json",fallback:null,effect:r,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:r,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:r,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:r,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:r,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:r,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:r,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},u=X(i);function a(n){return n.ok?n.status===204?null:n.json():n.json().catch(()=>null).then(f=>{const s=new Error("HTTP "+n.status+": "+n.statusText);throw s.status=n.status,s.data=f,s})}function c(n){return this.dom=n,z(this,n,u),n[t]=this,n[o]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,l(this),this}c.prototype.refreshConfig=function(){const n=this.dom;this.credentials="same-origin",this.headers=se(this.rawHeaders);const f={},s=n.getAttribute("data-ln-api-param-offset");s&&(f.offset=s);const d=n.getAttribute("data-ln-api-param-limit");d&&(f.limit=d);const p=n.getAttribute("data-ln-api-param-search");p&&(f.search=p);const h=n.getAttribute("data-ln-api-param-sort-field");h&&(f.sortField=h);const m=n.getAttribute("data-ln-api-param-sort-dir");m&&(f.sortDir=m),this.paramKeys=f;const y=n.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=y!==null?+y:300,b(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},c.prototype._reqHeaders=function(n){const f=Object.assign({},this.headers);return!f.Accept&&!f.accept&&(f.Accept="application/json"),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]="application/json"),n&&(f["X-Idempotency-Key"]=n),f},c.prototype.cancel=function(n){return n&&this._inflight.has(n)?(this._inflight.get(n).abort(),this._inflight.delete(n),!0):!1},c.prototype.fetchDelta=function(n,f){const s=this;let d=_(s.baseUrl,s.path);n!=null&&n!==""&&(d+=(d.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(n));const p=f||"sync";s._inflight.has(p)&&s._inflight.get(p).abort();const h=new AbortController;return s._inflight.set(p,h),window.fetch(d,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:h.signal}).then(a).finally(function(){s._inflight.get(p)===h&&s._inflight.delete(p)})},c.prototype.query=function(n,f){const s=this,d=$e(n,s.paramKeys),p=Ne(s.baseUrl,s.path,d),h=f||"query";s._inflight.has(h)&&s._inflight.get(h).abort();const m=new AbortController;return s._inflight.set(h,m),window.fetch(p,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:m.signal}).then(a).finally(function(){s._inflight.get(h)===m&&s._inflight.delete(h)})},c.prototype.create=function(n,f,s){const d=this;return window.fetch(_(d.baseUrl,f||d.path),{method:"POST",headers:d._reqHeaders(s),credentials:d.credentials,body:JSON.stringify(n)}).then(a)},c.prototype.update=function(n,f,s,d,p){const h=this;s!=null&&(f=Object.assign({},f,{expected_version:s}));const m=d?_(h.baseUrl,d):_(h.baseUrl,h.path,n);return window.fetch(m,{method:"PUT",headers:h._reqHeaders(p),credentials:h.credentials,body:JSON.stringify(f)}).then(a)},c.prototype.delete=function(n,f,s){const d=this;return window.fetch(_(d.baseUrl,f||d.path,n),{method:"DELETE",headers:d._reqHeaders(s),credentials:d.credentials}).then(a)},c.prototype.bulkDelete=function(n,f,s){const d=this;return window.fetch(_(d.baseUrl,f||d.path,"bulk-delete"),{method:"DELETE",headers:d._reqHeaders(s),credentials:d.credentials,body:JSON.stringify({ids:n})}).then(a)};function l(n){n._handlers={sync:function(f){const s=f.detail||{},d=s.meta&&s.meta.targetEl?s.meta.targetEl:null;n.fetchDelta(s.since,d).then(function(p){b(n.dom,"ln-api-connector:fetched",{data:p,since:s.since,meta:s.meta||null})}).catch(function(p){p&&p.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"sync",error:p.message,status:p.status||0,data:p.data||null,since:s.since,meta:s.meta||null})})},query:function(f){const s=f.detail||{},d=s.query||s,p=s.meta&&s.meta.targetEl?s.meta.targetEl:null,h=p||"query",m=n.queryDebounce;function y(x,A,k){n.query(A,k).then(function(w){const g=w||{};b(n.dom,"ln-api-connector:fetched",{data:g.data||(Array.isArray(g)?g:[]),total:g.total,filtered:g.filtered,offset:A.offset,queryGen:A.queryGen,meta:x.meta||null})}).catch(function(w){w&&w.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"query",error:w.message,status:w.status||0,data:w.data||null,meta:x.meta||null})})}if(m===0){y(s,d,p);return}n._queryTimers.has(h)&&clearTimeout(n._queryTimers.get(h));const I=setTimeout(function(){n._queryTimers.delete(h),y(s,d,p)},m);n._queryTimers.set(h,I)},cancel:function(f){const s=f.detail||{},d=s.meta&&s.meta.targetEl?s.meta.targetEl:s.targetEl||s.key;d&&n.cancel(d)},create:function(f){const s=f.detail||{};n.create(s.data,s.url,s.idempotencyKey).then(function(d){const p=re(d);b(n.dom,"ln-api-connector:created",{record:p.record,tempId:s.tempId,message:p.message,meta:s.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"create",error:d.message,status:d.status||0,data:d.data||null,tempId:s.tempId,meta:s.meta||null})})},update:function(f){const s=f.detail||{};n.update(s.id,s.data,s.expected_version,s.url,s.idempotencyKey).then(function(d){const p=re(d);b(n.dom,"ln-api-connector:updated",{record:p.record,id:s.id,message:p.message,meta:s.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"update",error:d.message,status:d.status||0,data:d.data||null,id:s.id,conflictData:d.status===409?d.data:null,meta:s.meta||null})})},delete:function(f){const s=f.detail||{};n.delete(s.id,s.url,s.idempotencyKey).then(function(d){const p=d&&d.message?d.message:null;b(n.dom,"ln-api-connector:deleted",{response:d,id:s.id,message:p,meta:s.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"delete",error:d.message,status:d.status||0,data:d.data||null,id:s.id,meta:s.meta||null})})},bulkDelete:function(f){const s=f.detail||{};n.bulkDelete(s.ids,s.url,s.idempotencyKey).then(function(d){const p=d&&d.message?d.message:null;b(n.dom,"ln-api-connector:bulk-deleted",{response:d,ids:s.ids,message:p,meta:s.meta||null})}).catch(function(d){d&&d.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"bulk-delete",error:d.message,status:d.status||0,data:d.data||null,ids:s.ids,meta:s.meta||null})})}},n.dom.addEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.addEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.addEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.addEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.addEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.addEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.addEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete)}c.prototype.destroy=function(){if(!this.dom[t])return;const n=this;n._inflight&&(n._inflight.forEach(function(f){f.abort()}),n._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(f){f&&clearTimeout(f)}),this._queryTimers.clear()),this._handlers&&(n.dom.removeEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.removeEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.removeEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.removeEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.removeEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.removeEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.removeEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete),n._handlers=null),delete this.dom[t],delete this.dom[o]},te(e,t,c,"ln-api-connector",{attributes:i})})()})();