@livenetworks/ashlar 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/components/index.js +0 -1
  2. package/components/ln-accordion/ln-accordion.js +1 -1
  3. package/components/ln-ajax/ln-ajax.js +1 -1
  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-autosave/ln-autosave.js +1 -1
  7. package/components/ln-chart/ln-chart.js +1 -1
  8. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  9. package/components/ln-confirm/ln-confirm.js +1 -1
  10. package/components/ln-core/README.md +3 -3
  11. package/components/ln-core/dom.js +3 -3
  12. package/components/ln-core/helpers.js +1 -1
  13. package/components/ln-core/index.js +1 -1
  14. package/components/ln-core/lifecycle.js +41 -0
  15. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  16. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  17. package/components/ln-data-store/ln-data-store.js +1 -1
  18. package/components/ln-date/ln-date.js +1 -1
  19. package/components/ln-debug/ln-debug.js +1 -1
  20. package/components/ln-dropdown/ln-dropdown.js +1 -1
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-filter/ln-filter.js +1 -1
  24. package/components/ln-form/ln-form-dev.scss +5 -0
  25. package/components/ln-form/ln-form.js +1 -1
  26. package/components/ln-form/ln-form.schema.json +6 -0
  27. package/components/ln-icon/ln-icon.js +1 -1
  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-list/ln-list.js +1 -1
  32. package/components/ln-modal/ln-modal.js +1 -1
  33. package/components/ln-nav/ln-nav.js +1 -1
  34. package/components/ln-number/ln-number.js +1 -1
  35. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  36. package/components/ln-options/ln-options.js +1 -1
  37. package/components/ln-picklist/ln-picklist.js +1 -1
  38. package/components/ln-popover/ln-popover.js +1 -1
  39. package/components/ln-progress/ln-progress.js +1 -1
  40. package/components/ln-router/ln-router.js +1 -1
  41. package/components/ln-scroll/ln-scroll.js +1 -1
  42. package/components/ln-search/ln-search.js +1 -1
  43. package/components/ln-slug/ln-slug.js +1 -1
  44. package/components/ln-sort/README.md +4 -0
  45. package/components/ln-sort/ln-sort.js +1 -1
  46. package/components/ln-sort/src/ln-sort.js +21 -16
  47. package/components/ln-sortable/ln-sortable.js +1 -1
  48. package/components/ln-stat/ln-stat.js +1 -1
  49. package/components/ln-table/ln-table.js +1 -1
  50. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  51. package/components/ln-tabs/ln-tabs.js +1 -1
  52. package/components/ln-time/ln-time.js +1 -1
  53. package/components/ln-toast/ln-toast.js +1 -1
  54. package/components/ln-toggle/ln-toggle.js +1 -1
  55. package/components/ln-tooltip/ln-tooltip.js +1 -1
  56. package/components/ln-translations/ln-translations.js +1 -1
  57. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  58. package/components/ln-upload/ln-upload.js +1 -1
  59. package/components/ln-validate/ln-validate.js +1 -1
  60. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  61. package/ln-ashlar.html-data.json +1 -2
  62. package/package.json +1 -1
  63. package/theme/components/_form.scss +6 -0
  64. package/theme/config/mixins/_form.scss +6 -0
  65. package/theme/ln-ashlar-dev.scss +0 -1
  66. package/web-types.json +3 -3
  67. package/components/ln-autoresize/README.md +0 -129
  68. package/components/ln-autoresize/ln-autoresize-dev.scss +0 -8
  69. package/components/ln-autoresize/ln-autoresize.js +0 -1
  70. package/components/ln-autoresize/ln-autoresize.schema.json +0 -22
  71. package/components/ln-autoresize/src/ln-autoresize.js +0 -56
@@ -1 +1 @@
1
- (function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!v(l))return}e.apply(console,t)}}function q(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,i={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&o[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,l=[],i={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(i[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=oe(n);l.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),l.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;l.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),l.push(o)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const $={};function le(e,t){$[e]=t}function se(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ue(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=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const x={};function de(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 B(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const o=i[s],c=o.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function we(e,t,r,l,i,s){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(l(a));let d=o[u];if(d)i(d,a,n);else{const f=de(r,s);if(!f||(B(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=R,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function _(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function j(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function V(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const l=new Set(e||[]),i=function(s,o){const c=s.getAttribute(o);return c!==null&&l.has(c)?c:t};return k.set(r,i),i}function H(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Q(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function J(e,t,r,l,i){if(!e||t===null)return!0;const s=l||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,r){for(const l in r){const[i,s,o]=r[l];Object.defineProperty(e,l,{get:function(){return i(t,s,o)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=U(l.values,l.fallback);break;case"integer":i=j;break;case"float":i=H;break;case"boolean":i=V;break;case"list":i=W;break;case"json":i=Q;break;case"string":default:i=_;break}i||(i=_),t[l.prop]=[i,r,l.fallback]}return t}function pe(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function ge(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=he,window.lnCore.attrSpec=be,window.lnCore.attrStr=_,window.lnCore.attrInt=j,window.lnCore.attrBool=V,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=H,window.lnCore.attrJson=Q);function m(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 K(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&m(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)m(c[n],o)}}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 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 P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=P(),r=e.observed||[];for(let l=0;l<r.length;l++){const i=r[l];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=ge(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,l){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=P(),i=l.byAttr.get(t),s=T()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&v(o)){const c=l.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<c.length;a++)J(c[a].spec,n,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&G(c,o,t,e.oldValue),l.reactiveWildcard.length&&G(l.reactiveWildcard,o,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(K(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=S();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=E();if(e.target&&l.length)for(let i=0;i<l.length;i++){const s=l[i],o=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)s.matches&&s.matches(n.query)&&m(s,n);else if(s.matches&&s.matches(n.query)&&m(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let u=0;u<a.length;u++)m(a[u],n)}}n.onInit&&n.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!o)s.matches&&s.matches(a)&&O(s,n);else if(s.matches&&s.matches(a)&&O(s,n),s.querySelectorAll){const u=s.querySelectorAll(a);for(let d=0;d<u.length;d++)O(u[d],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{xe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){S().push(e),e.onSubtreeChange&&e.query&&E().push(e),z()}function X(e,t,r,l,i={}){const s=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?pe(d):u,b=d?new Set(Object.keys(d)):null,w=i.persist||null;function p(D){const h=D||document.body;if(K(h,e,t,r),d&&T())for(const C in d){const qe=d[C],I=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&I.push(h);for(let F=0;F<I.length;F++){const M=I[F];v(M)&&J(qe,M.getAttribute(C),C,l,M)}}n&&n(h)}const g=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let h;for(;(h=D.exec(e))!==null;)g.push(h[1])}else g.push(e);ye({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:g.concat(s),onAttributeChange:o,onAttrChange:a,effects:f,declared:b,persist:w}),ve();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Y=i.subtreeQuery||(A?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Y};S().push(ee),c&&Y&&E().push(ee),z(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=_e);function te(){me()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),p}function Z(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,r={},l=Z(t);if(!l)return r;const i=l.split("&");for(let s=0;s<i.length;s++){const o=i[s];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=L();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");Z(location.hash)!==i&&(location.hash=i)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ke,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Fe);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);function Te(e,t=100,r=0){const l=parseFloat(String(e))||0,i=parseFloat(String(t))||100,s=parseFloat(String(r))||0,o=Math.max(s,Math.min(l,i)),c=i-s;let n=0;return c>0&&(n=(o-s)/c*100),n=Math.max(0,Math.min(100,n)),{value:l,min:s,max:i,clampedValue:o,percentage:n}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function r(f){const b=f[t];b&&d.call(b)}const l={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:r,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:r,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:r,description:"Text label format or template inside circular progress"}},i="http://www.w3.org/2000/svg",s=36,o=16,c=2*Math.PI*o;function n(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,u.call(this),d.call(this),this}n.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,b){const w=document.createElementNS(i,f);for(const[p,g]of Object.entries(b))w.setAttribute(p,g);return w}function u(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:o,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:o,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function d(){const f=this.dom.getAttribute("data-ln-circular-progress"),b=this.dom.getAttribute("data-ln-circular-progress-max"),w=Te(f,b||100),p=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",p);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),q(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}X(e,t,n,"ln-circular-progress",{attributes:l})})()})();
1
+ (function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!v(l))return}e.apply(console,t)}}function q(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function 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),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&o[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);o[n.name]=n.value===""||isNaN(a)?null:a}else o[n.name]=n.value}return o}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=ie(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const $={};function se(e,t){$[e]=t}function ce(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=se,window.lnCore.getDataMapper=ce);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];R[r]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ae);const x={};function fe(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function 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 l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(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 B(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function he(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(l(a));let d=i[u];if(d)o(d,a,n);else{const f=fe(r,s);if(!f||(B(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),o(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=N,window.lnCore.lnFill=we,window.lnCore.renderList=he);function _(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function j(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function V(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const l=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&l.has(c)?c:t};return k.set(r,o),o}function H(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Q(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function J(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=U(l.values,l.fallback);break;case"integer":o=j;break;case"float":o=H;break;case"boolean":o=V;break;case"list":o=W;break;case"json":o=Q;break;case"string":default:o=_;break}o||(o=_),t[l.prop]=[o,r,l.fallback]}return t}function ge(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function 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=pe,window.lnCore.attrStr=_,window.lnCore.attrInt=j,window.lnCore.attrBool=V,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=H,window.lnCore.attrJson=Q);function m(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 K(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&m(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)m(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=P(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=me(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function ve(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=P(),o=l.byAttr.get(t),s=T()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&v(i)){const c=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<c.length;a++)J(c[a].spec,n,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&G(c,i,t,e.oldValue),l.reactiveWildcard.length&&G(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(K(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ve(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=S();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=E();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&m(s,n);else if(s.matches&&s.matches(n.query)&&m(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let u=0;u<a.length;u++)m(a[u],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!i)s.matches&&s.matches(a)&&O(s,n);else if(s.matches&&s.matches(a)&&O(s,n),s.querySelectorAll){const u=s.querySelectorAll(a);for(let d=0;d<u.length;d++)O(u[d],n)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{z(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let l=0;l<r.length;l++){const o=r[l];if(o.type==="childList")try{z(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ke(e){S().push(e),e.onSubtreeChange&&e.query&&E().push(e),X()}function Z(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,a=o.onAttrChange||null,u=o.effects||null,d=o.attributes||null,f=d?ge(d):u,b=d?new Set(Object.keys(d)):null,w=o.persist||null;function p(D){const h=D||document.body;if(K(h,e,t,r),d&&T())for(const C in d){const $e=d[C],I=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&I.push(h);for(let F=0;F<I.length;F++){const M=I[F];v(M)&&J($e,M.getAttribute(C),C,l,M)}}n&&n(h)}const g=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let h;for(;(h=D.exec(e))!==null;)g.push(h[1])}else g.push(e);Ae({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:g.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:b,persist:w}),xe();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=o.subtreeQuery||(A?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:ee};S().push(te),c&&ee&&E().push(te),X(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=ke,window.lnCore.withoutLifecycle=_e);function ne(){Ce()>0?ye(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),p}function Y(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,r={},l=Y(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function Se(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const r=L();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==o&&(location.hash=o)}function Oe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=Se,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=De,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Me);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te);function qe(e,t=100,r=0){const l=parseFloat(String(e))||0,o=parseFloat(String(t))||100,s=parseFloat(String(r))||0,i=Math.max(s,Math.min(l,o)),c=o-s;let n=0;return c>0&&(n=(i-s)/c*100),n=Math.max(0,Math.min(100,n)),{value:l,min:s,max:o,clampedValue:i,percentage:n}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function r(f){const b=f[t];b&&d.call(b)}const l={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:r,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:r,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:r,description:"Text label format or template inside circular progress"}},o="http://www.w3.org/2000/svg",s=36,i=16,c=2*Math.PI*i;function n(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,u.call(this),d.call(this),this}n.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,b){const w=document.createElementNS(o,f);for(const[p,g]of Object.entries(b))w.setAttribute(p,g);return w}function u(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function d(){const f=this.dom.getAttribute("data-ln-circular-progress"),b=this.dom.getAttribute("data-ln-circular-progress-max"),w=qe(f,b||100),p=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",p);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),q(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}Z(e,t,n,"ln-circular-progress",{attributes:l})})()})();
@@ -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 y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!y(o))return}e.apply(console,t)}}function F(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ie(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),o=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const r=e.elements,o=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(n).split(",").map(function(f){return f.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=le(n);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ie);const N={};function ce(e,t){N[e]=t}function ae(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=ae);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function de(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ue);const A={};function he(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(u,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(u,!!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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(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 R(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,r,o,l,s){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],f=a.getAttribute("data-ln-render-key");f&&(i[f]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],f=String(o(a));let u=i[f];if(u)l(u,a,n);else{const d=he(r,s);if(!d||(R(d,a),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",f),l(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=M,window.lnCore.lnFill=we,window.lnCore.renderList=be);function v(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function B(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function j(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const x=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(x.has(r))return x.get(r);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return x.set(r,l),l}function H(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function V(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function K(e,t,r,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,r){for(const o in r){const[l,s,i]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function Q(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=W(o.values,o.fallback);break;case"integer":l=B;break;case"float":l=H;break;case"boolean":l=j;break;case"list":l=U;break;case"json":l=V;break;case"string":default:l=v;break}l||(l=v),t[o.prop]=[l,r,o.fallback]}return t}function me(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function pe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=P,window.lnCore.attrSpec=Q,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 ye(e){const t=z(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=pe(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=z(),l=o.byAttr.get(t),s=q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&y(i)){const c=o.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<c.length;a++)K(c[a].spec,n,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=o.byReactive.get(t);c&&G(c,i,t,e.oldValue),o.reactiveWildcard.length&&G(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const n=l[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function k(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=_();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=k();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&b(s,n);else if(s.matches&&s.matches(n.query)&&b(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let f=0;f<a.length;f++)b(a[f],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!i)s.matches&&s.matches(a)&&E(s,n);else if(s.matches&&s.matches(a)&&E(s,n),s.querySelectorAll){const f=s.querySelectorAll(a);for(let u=0;u<f.length;u++)E(f[u],n)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{xe(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&k().push(e),X()}function Y(e,t,r,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,a=l.onAttrChange||null,f=l.effects||null,u=l.attributes||null,d=u?me(u):f,h=u?new Set(Object.keys(u)):null,m=l.persist||null;function C(L){const w=L||document.body;if(J(w,e,t,r),u&&q())for(const p in u){const Ne=u[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let I=0;I<O.length;I++){const D=O[I];y(D)&&K(Ne,D.getAttribute(p),p,o,D)}}n&&n(w)}const T=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)T.push(w[1])}else T.push(e);ye({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:T.concat(s),onAttributeChange:i,onAttrChange:a,effects:d,declared:h,persist:m}),ve();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=l.subtreeQuery||(Fe?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:ee};_().push(te),c&&ee&&k().push(te),X(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=_e);function ne(){ge()>0?Ce(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),C}function Z(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},o=Z(t);if(!o)return r;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Te(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Le(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 Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Te,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function qe(){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=qe),(function(){const e="data-ln-confirm",t="lnConfirm",r="data-ln-confirm-state",o="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(u,d,h){return u.getAttribute(d)||h}function i(u,d,h){const m=parseFloat(u.getAttribute(d));return isNaN(m)||m<=0?h:m}function c(u){const d=document.createElement("span");return d.setAttribute(o,""),d.setAttribute("role","alert"),d.textContent=u,d}const n={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:i,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(u,d)=>u.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},a=Q(n);function f(u){this.dom=u,P(this,u,a),this.revertTimer=null,this._submitted=!1,this.idleEl=u.querySelector("[data-ln-confirm-idle]"),this.activeEl=u.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":u.textContent.trim();const d=this;return this._onClick=function(h){if(!re(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},u.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(r,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const u=this.activeEl?this.activeEl.textContent.trim():"";u&&(this.dom.setAttribute("aria-label",u),this.dom.setAttribute("aria-live","polite"))}else{const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=u.getAttribute("href"),u.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),F(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const u=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){u._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(r),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalIconHref&&u.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+o+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Y(e,t,f,"ln-confirm",{attributes:n})})()})();
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 y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!y(i))return}e.apply(console,t)}}function F(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 g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&o[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);o[n.name]=n.value===""||isNaN(a)?null:a}else o[n.name]=n.value}return o}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const r=e.elements,i=[],o={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const n=t[c];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const a=String(n).split(",").map(function(f){return f.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=se(n);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;i.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=oe);const N={};function ae(e,t){N[e]=t}function ue(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ue);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];R[r]=t}function he(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=he,window.lnCore.ensureLocaleObserver=de);const A={};function we(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const c=r[l],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(u,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(u,!!t[d])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function M(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function me(e,t,r,i,o,s){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],f=a.getAttribute("data-ln-render-key");f&&(l[f]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],f=String(i(a));let u=l[f];if(u)o(u,a,n);else{const d=we(r,s);if(!d||(M(d,a),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",f),o(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=$,window.lnCore.lnFill=be,window.lnCore.renderList=me);function v(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function B(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function j(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const _=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(_.has(r))return _.get(r);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return _.set(r,o),o}function H(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function V(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function K(e,t,r,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,r){for(const i in r){const[o,s,l]=r[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function Q(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=W(i.values,i.fallback);break;case"integer":o=B;break;case"float":o=H;break;case"boolean":o=j;break;case"list":o=U;break;case"json":o=V;break;case"string":default:o=v;break}o||(o=v),t[i.prop]=[o,r,i.fallback]}return t}function pe(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 ge(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=P,window.lnCore.attrSpec=Q,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&b(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=z(),r=e.observed||[];for(let i=0;i<r.length;i++){const o=r[i];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function ve(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=z(),o=i.byAttr.get(t),s=q()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<c.length;a++)K(c[a].spec,n,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&G(c,l,t,e.oldValue),i.reactiveWildcard.length&&G(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(J(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ve(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 k(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function E(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 X(e){const t=x();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=k();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)s.matches&&s.matches(n.query)&&b(s,n);else if(s.matches&&s.matches(n.query)&&b(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let f=0;f<a.length;f++)b(a[f],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!l)s.matches&&s.matches(a)&&E(s,n);else if(s.matches&&s.matches(a)&&E(s,n),s.querySelectorAll){const f=s.querySelectorAll(a);for(let u=0;u<f.length;u++)E(f[u],n)}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{X(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let i=0;i<r.length;i++){const o=r[i];if(o.type==="childList")try{X(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ke(e){x().push(e),e.onSubtreeChange&&e.query&&k().push(e),Y()}function Z(e,t,r,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,a=o.onAttrChange||null,f=o.effects||null,u=o.attributes||null,d=u?pe(u):f,h=u?new Set(Object.keys(u)):null,m=o.persist||null;function C(L){const w=L||document.body;if(J(w,e,t,r),u&&q())for(const p in u){const Re=u[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let I=0;I<O.length;I++){const D=O[I];y(D)&&K(Re,D.getAttribute(p),p,i,D)}}n&&n(w)}const T=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)T.push(w[1])}else T.push(e);Ae({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:r,onInit:n,observed:T.concat(s),onAttributeChange:l,onAttrChange:a,effects:d,declared:h,persist:m}),_e();const Ne=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,te=o.subtreeQuery||(Ne?e:"["+e+"]"),ne={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:te};x().push(ne),c&&te&&k().push(ne),Y(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=ke,window.lnCore.withoutLifecycle=xe);function re(){Ce()>0?ye(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),C}function ee(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},i=ee(t);if(!i)return r;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),n=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function Ee(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ee(location.hash)!==o&&(location.hash=o)}function Te(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 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 Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function De(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 r=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=qe);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),(function(){const e="data-ln-confirm",t="lnConfirm",r="data-ln-confirm-state",i="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(u,d,h){return u.getAttribute(d)||h}function l(u,d,h){const m=parseFloat(u.getAttribute(d));return isNaN(m)||m<=0?h:m}function c(u){const d=document.createElement("span");return d.setAttribute(i,""),d.setAttribute("role","alert"),d.textContent=u,d}const n={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:l,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(u,d)=>u.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},a=Q(n);function f(u){this.dom=u,P(this,u,a),this.revertTimer=null,this._submitted=!1,this.idleEl=u.querySelector("[data-ln-confirm-idle]"),this.activeEl=u.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":u.textContent.trim();const d=this;return this._onClick=function(h){if(!ie(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},u.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(r,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const u=this.activeEl?this.activeEl.textContent.trim():"";u&&(this.dom.setAttribute("aria-label",u),this.dom.setAttribute("aria-live","polite"))}else{const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=u.getAttribute("href"),u.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),F(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const u=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){u._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(r),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalIconHref&&u.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+i+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Z(e,t,f,"ln-confirm",{attributes:n})})()})();
@@ -339,14 +339,14 @@ Read the raw machine value behind a formatted cell/item display. The single
339
339
  read path for value-based sort/filter across components.
340
340
 
341
341
  ```js
342
- const raw = readValue(td); // '1250.50' from data-ln-value, datetime on <time>, value on <data>, else trimmed text
342
+ const raw = readValue(td); // '42' from value on <data>, '1250.50' from data-ln-value, datetime on <time>, else trimmed text
343
343
  ```
344
344
 
345
+ - Returns `value` attribute value if the element has it (native machine value on `<data>`, `<input>`, `<time>`, etc.).
345
346
  - Returns `data-ln-value` attribute value if the element has it.
346
347
  - Returns `datetime` attribute if the element is `<time>` and has it.
347
- - Returns `value` attribute if the element is `<data>` and has it.
348
348
  - Otherwise falls back to `el.textContent.trim()`.
349
- - Used by `ln-table` for sort/filter.
349
+ - Used by `ln-table` and `ln-sort` for sort/filter.
350
350
 
351
351
  ### registerComponent(selector, attribute, ComponentFn, componentTag, options)
352
352
 
@@ -102,14 +102,14 @@ export function shouldInterceptLink(event, anchor) {
102
102
  * Single read path for value-based sort/filter across components.
103
103
  */
104
104
  export function readValue(el) {
105
+ if (el.hasAttribute('value')) {
106
+ return el.getAttribute('value');
107
+ }
105
108
  if (el.hasAttribute('data-ln-value')) {
106
109
  return el.getAttribute('data-ln-value');
107
110
  }
108
111
  if (el.tagName === 'TIME' && el.hasAttribute('datetime')) {
109
112
  return el.getAttribute('datetime');
110
113
  }
111
- if (el.tagName === 'DATA' && el.hasAttribute('value')) {
112
- return el.getAttribute('value');
113
- }
114
114
  return el.textContent.trim();
115
115
  }
@@ -27,7 +27,7 @@ export { getLocale, ensureLocaleObserver, registerLocaleFallback, getLocaleFallb
27
27
  export { cloneTemplate, cloneTemplateScoped, fill, lnFill, fillTemplate, renderList, buildDict } from './template.js';
28
28
 
29
29
  // Lifecycle & Kernel Registration
30
- export { findElements, holdInit, releaseInit, pendingCount, queueBoot, observeAttributes, observeLifecycle, registerComponent } from './lifecycle.js';
30
+ export { findElements, holdInit, releaseInit, pendingCount, queueBoot, observeAttributes, observeLifecycle, withoutLifecycle, registerComponent } from './lifecycle.js';
31
31
 
32
32
  // Value Comparison Primitives (re-exported from compare.js for backward compatibility)
33
33
  export { compareValues, detectValueType } from './compare.js';
@@ -1,4 +1,4 @@
1
- export { cloneTemplate, cloneTemplateScoped, dispatch, dispatchCancelable, requestData, fill, lnFill, fillTemplate, renderList, buildDict, guardBody, findElements, isVisible, shouldIgnoreClick, isTargetDisabled, isUsableTarget, isEditableTarget, serializeForm, populateForm, resolveFormMethod, getLocale, readValue, detectValueType, compareValues, registerComponent, shouldInterceptLink, buildUrl, getHeaders, parseHeaders, registerDataMapper, getDataMapper, interceptValueProperty, registerLocaleFallback, getLocaleFallback, holdInit, releaseInit, pendingCount, queueBoot, ensureLocaleObserver, observeAttributes, observeLifecycle, setDebugSink, setPersistSink, isDevMode, hasActiveDebug } from './helpers.js';
1
+ export { cloneTemplate, cloneTemplateScoped, dispatch, dispatchCancelable, requestData, fill, lnFill, fillTemplate, renderList, buildDict, guardBody, findElements, isVisible, shouldIgnoreClick, isTargetDisabled, isUsableTarget, isEditableTarget, serializeForm, populateForm, resolveFormMethod, getLocale, readValue, detectValueType, compareValues, registerComponent, shouldInterceptLink, buildUrl, getHeaders, parseHeaders, registerDataMapper, getDataMapper, interceptValueProperty, registerLocaleFallback, getLocaleFallback, holdInit, releaseInit, pendingCount, queueBoot, ensureLocaleObserver, observeAttributes, observeLifecycle, withoutLifecycle, setDebugSink, setPersistSink, isDevMode, hasActiveDebug } from './helpers.js';
2
2
  export { reactiveState, deepReactive, createBatcher } from './reactive.js';
3
3
  export { createWindowCache } from './window-cache.js';
4
4
  export { hashParse, hashGet, hashSet, hashLinkClick, resolveHashNamespace, hashSortEncode, hashSortDecode, hashFilterEncode, hashFilterDecode } from './hash.js';
@@ -309,6 +309,8 @@ function _handleChildListMutation(mutation) {
309
309
  for (let j = 0; j < mutation.removedNodes.length; j++) {
310
310
  const node = mutation.removedNodes[j];
311
311
  if (node.nodeType === 1) {
312
+ // Fast bailout: if the node is still in the document, it was simply moved or reordered!
313
+ if (document.contains(node)) continue;
312
314
  const hasDescendants = !!(node.firstElementChild || (node.children && node.children.length));
313
315
  for (let r = 0; r < registry.length; r++) {
314
316
  const entry = registry[r];
@@ -352,6 +354,7 @@ function _ensureLifecycleObserver() {
352
354
  }
353
355
  }
354
356
  });
357
+ window.lnCore._lifecycleObserver = observer;
355
358
  observer.observe(document.body, {
356
359
  childList: true,
357
360
  subtree: true
@@ -359,6 +362,43 @@ function _ensureLifecycleObserver() {
359
362
  }, 'ln-core');
360
363
  }
361
364
 
365
+ /**
366
+ * Executes a callback while temporarily disconnecting the lifecycle childList observer.
367
+ * Useful for bulk DOM operations like sorting, reordering, or virtual list windowing
368
+ * where existing initialized DOM nodes are moved rather than newly mounted.
369
+ * @param {function():*} fn - Synchronous callback to execute
370
+ * @returns {*} Return value of fn
371
+ */
372
+ export function withoutLifecycle(fn) {
373
+ if (typeof window === 'undefined') return fn();
374
+ window.lnCore = window.lnCore || {};
375
+ const obs = window.lnCore._lifecycleObserver;
376
+ if (!obs) return fn();
377
+
378
+ // Drain any pending mutations before disconnecting so they are not lost
379
+ const pending = obs.takeRecords();
380
+ for (let i = 0; i < pending.length; i++) {
381
+ const mutation = pending[i];
382
+ if (mutation.type === 'childList') {
383
+ try {
384
+ _handleChildListMutation(mutation);
385
+ } catch (err) {
386
+ console.error('[ln-core] lifecycle handler failed', mutation.target, err);
387
+ }
388
+ }
389
+ }
390
+
391
+ obs.disconnect();
392
+ try {
393
+ return fn();
394
+ } finally {
395
+ obs.observe(document.body, {
396
+ childList: true,
397
+ subtree: true
398
+ });
399
+ }
400
+ }
401
+
362
402
  /**
363
403
  * For components that own their own lifecycle and only need the attribute
364
404
  * half of the shared invariant.
@@ -466,6 +506,7 @@ export function registerComponent(selector, attribute, ComponentFn, componentTag
466
506
  window.lnCore = window.lnCore || {};
467
507
  window.lnCore.registerComponent = registerComponent;
468
508
  window.lnCore.observeLifecycle = observeLifecycle;
509
+ window.lnCore.withoutLifecycle = withoutLifecycle;
469
510
  }
470
511
 
471
512
  function boot() {
@@ -1 +1 @@
1
- (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(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 s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!q(i))return}e.apply(console,t)}}function v(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,s={},c=e.elements,r={};if(o)for(let a=0;a<c.length;a++){const n=c[a];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let a=0;a<c.length;a++){const n=c[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&r[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let f=0;f<n.options.length;f++)n.options[f].selected&&s[n.name].push(n.options[f].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const f=Number(n.value);s[n.name]=n.value===""||isNaN(f)?null:f}else s[n.name]=n.value}return s}function ae(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const o=e.elements,i=[],s={};for(let c=0;c<o.length;c++){const r=o[c];r.name&&r.type==="checkbox"&&(s[r.name]=(s[r.name]||0)+1)}for(let c=0;c<o.length;c++){const r=o[c];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const a=r.getAttribute("data-ln-fill-as")||r.name;if(!a||!(a in t))continue;const n=t[a];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(s[r.name]>1){const f=String(n).split(",").map(function(b){return b.trim()});r.checked=f.indexOf(r.value)!==-1}else r.checked=ae(n);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let f=0;f<r.options.length;f++)r.options[f].selected=n.indexOf(r.options[f].value)!==-1;i.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),i.push(r)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=le);function k(...e){return e.filter(t=>t!=null&&t!=="").map((t,o)=>o===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function T(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(o){return console.error(`[${t}] Invalid headers JSON:`,o),{}}}const H={};function fe(e,t){H[e]=t}function he(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function be(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=be,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=we);const I={};function me(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=I[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const a=o[r],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const a=i[r],n=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();t[_]!=null&&a.setAttribute(m,t[_])}}const s=e.querySelectorAll("[data-ln-show]");for(let r=0;r<s.length;r++){const a=s[r],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let r=0;r<c.length;r++){const a=c[r],n=a.getAttribute("data-ln-class").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();_ in t&&a.classList.toggle(m,!!t[_])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function J(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const c=o.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,a){return t[a]!==void 0?t[a]:""}))}const i=function(c,r){return t[r]!==void 0?t[r]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const r=s[c],a=r.attributes;for(let n=0;n<a.length;n++){const f=a[n];f.value.indexOf("{{")!==-1&&r.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ce(e,t,o,i,s,c){const r={};for(let n=0;n<e.children.length;n++){const f=e.children[n],b=f.getAttribute("data-ln-render-key");b&&(r[b]=f)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const f=t[n],b=String(i(f));let m=r[b];if(m)s(m,f,n);else{const _=me(o,c);if(!_||(J(_,f),m=_.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),s(m,f,n)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=W,window.lnCore.lnFill=ge,window.lnCore.renderList=Ce);function O(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function V(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function K(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const s=i.trim().toLowerCase();return!(s==="false"||s==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const R=new Map;function z(e,t){const o=(e?e.join("|"):"")+"::"+t;if(R.has(o))return R.get(o);const i=new Set(e||[]),s=function(c,r){const a=c.getAttribute(r);return a!==null&&i.has(a)?a:t};return R.set(o,s),s}function Q(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function X(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function Y(e,t,o,i,s){if(!e||t===null)return!0;const c=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const a=n=>{s?console.warn(n,s):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${c}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${c}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return a(`[${c}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${c}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${c}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(a(`[${c}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${c}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,o){for(const i in o){const[s,c,r]=o[i];Object.defineProperty(e,i,{get:function(){return s(t,c,r)},enumerable:!0,configurable:!0})}return e}function ee(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let s=i.read;if(!s&&i.type)switch(i.type){case"enum":s=z(i.values,i.fallback);break;case"integer":s=V;break;case"float":s=Q;break;case"boolean":s=K;break;case"list":s=G;break;case"json":s=X;break;case"string":default:s=O;break}s||(s=O),t[i.prop]=[s,o,i.fallback]}return t}function ye(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function _e(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=ee,window.lnCore.attrStr=O,window.lnCore.attrInt=V,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=z,window.lnCore.attrFloat=Q,window.lnCore.attrJson=X);function D(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 te(e,t,o,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(c)&&D(e,r),e.querySelectorAll){const a=e.querySelectorAll(c);for(let n=0;n<a.length;n++)D(a[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ne(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=ne(),o=e.observed||[];for(let i=0;i<o.length;i++){const s=o[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=_e(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,o,i){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const r=c.effects&&c.effects[o];r?r(t,o,i):c.onAttrChange&&(!c.declared||c.declared.has(o))&&c.onAttrChange(t,o,i)}}function xe(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=ne(),s=i.byAttr.get(t),c=P()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!s&&!c)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(c&&q(r)){const a=i.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let f=0;f<a.length;f++)Y(a[f].spec,n,t,a[f].componentTag,r)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const a=i.byReactive.get(t);a&&oe(a,r,t,e.oldValue),i.reactiveWildcard.length&&oe(i.reactiveWildcard,r,t,e.oldValue)}if(s)for(let a=0;a<s.length;a++){const n=s[a];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(te(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{xe(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function B(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ee(e){const t=$();if(!t.length)return;const o=e.target;if(o){const s=o.nodeType===1?o:o.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let s=0;s<i.length;s++){const c=i[s],r=c.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;a&&c.onSubtreeChange(a,e)}for(let s=0;s<e.addedNodes.length;s++){const c=e.addedNodes[s];if(c.nodeType===1){const r=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)c.matches&&c.matches(n.query)&&D(c,n);else if(c.matches&&c.matches(n.query)&&D(c,n),c.querySelectorAll){const f=c.querySelectorAll(n.query);for(let b=0;b<f.length;b++)D(f[b],n)}}n.onInit&&n.onInit(c)}}}for(let s=0;s<e.removedNodes.length;s++){const c=e.removedNodes[s];if(c.nodeType===1){const r=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a],f=n.query;if(f){if(!r)c.matches&&c.matches(f)&&B(c,n);else if(c.matches&&c.matches(f)&&B(c,n),c.querySelectorAll){const b=c.querySelectorAll(f);for(let m=0;m<b.length;m++)B(b[m],n)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{Ee(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){$().push(e),e.onSubtreeChange&&e.query&&N().push(e),re()}function ie(e,t,o,i,s={}){const c=s.extraAttributes||[],r=s.onAttributeChange||null,a=s.onSubtreeChange||null,n=s.onInit||null,f=s.onAttrChange||null,b=s.effects||null,m=s.attributes||null,_=m?ye(m):b,M=m?new Set(Object.keys(m)):null,l=s.persist||null;function u(w){const y=w||document.body;if(te(y,e,t,o),m&&P())for(const S in m){const x=m[S],E=Array.from(y.querySelectorAll("["+S+"]"));y.matches&&y.matches("["+S+"]")&&E.push(y);for(let A=0;A<E.length;A++){const j=E[A];q(j)&&Y(x,j.getAttribute(S),S,i,j)}}n&&n(y)}const d=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let y;for(;(y=w.exec(e))!==null;)d.push(y[1])}else d.push(e);ke({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:o,onInit:n,observed:d.concat(c),onAttributeChange:r,onAttrChange:f,effects:_,declared:M,persist:l}),Se();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=s.subtreeQuery||(h?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:g};$().push(C),a&&g&&N().push(C),re(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Oe);function p(){ve()>0?Ae(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),u}function se(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,o={},i=se(t);if(!i)return o;const s=i.split("&");for(let c=0;c<s.length;c++){const r=s[c];if(!r)continue;const a=r.indexOf(":"),n=a>-1?r.slice(0,a):r,f=a>-1?r.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(f)}catch{o[n]=f}}return o}function Te(e){if(!e)return null;const t=F();return e in t?t[e]:null}function De(e,t){if(!e)return;const o=F();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(c){const r=o[c];return r===""?c:c+":"+encodeURIComponent(r)}).join("&");se(location.hash)!==s&&(location.hash=s)}function Le(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Te,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=$e);function Ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ne),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",o="lnConnector";if(window[t]!==void 0)return;function i(l){const u=l[t];u&&u.refreshConfig()}const s={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:O,type:"string",fallback:"",effect:i,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:O,type:"string",fallback:"",effect:i,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:O,type:"string",fallback:"",effect:i,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:i,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},c=ee(s);function r(l){const u=l&&l.content!==void 0?l.content:l,d=l&&l.message?l.message:null;return{content:u,message:d}}function a(l){return this.dom=l,Z(this,l,c),l[t]=this,l[o]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,M(this),this}a.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin";const u=l.getAttribute("data-ln-couchdb-headers")||"";this.headers=ue(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),v(l,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function n(l,u,d){const h=Object.assign({},T(l.headers,l.auth),d||{});return u&&(h["Idempotency-Key"]=u),h}a.prototype.fetchDelta=function(l){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,h=["include_docs=true","feed=normal"];l&&h.push("since="+encodeURIComponent(l));const g=k(u.url,u.db,"_changes")+"?"+h.join("&");return window.fetch(g,{method:"GET",headers:T(u.headers,u.auth),credentials:u.credentials,signal:d}).then(C=>{if(!C.ok)throw new Error("HTTP "+C.status+": "+C.statusText);return C.json()}).then(C=>{const p=C.results||[];return{data:p.filter(w=>!w.deleted&&w.doc).map(w=>Object.assign({},w.doc,{id:w.doc._id})),deleted:p.filter(w=>w.deleted).map(w=>w.id),synced_at:C.last_seq||l||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function f(l,u,d){const h=Object.assign({_id:u.id},u);return h._id||delete h._id,window.fetch(k(l.url,l.db),{method:"POST",headers:n(l,d),credentials:l.credentials,body:JSON.stringify(h)}).then(g=>{if(!g.ok)throw new Error("HTTP "+g.status+": "+g.statusText);return g.json()}).then(g=>{const C=r(g),p=C.content;return{record:Object.assign({},h,{id:p.id,_id:p.id,_rev:p.rev}),message:C.message}})}a.prototype.create=function(l,u){return f(this,l,u).then(d=>d.record)};function b(l,u,d,h){const g=Object.assign({id:String(u),_id:String(u)},d),C=g._rev||g.rev;return(C?Promise.resolve(C):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("Could not retrieve document for revision mapping");return w.json().then(y=>y._rev)})).then(w=>{const y=Object.assign({},g,{_rev:w});delete y.rev;const S=n(l,h,{"If-Match":w});return window.fetch(k(l.url,l.db,null,u),{method:"PUT",headers:S,credentials:l.credentials,body:JSON.stringify(y)}).then(x=>{if(x.ok)return x.json().then(E=>{const A=r(E);return{record:Object.assign({},y,{_rev:A.content.rev}),message:A.message}});if(x.status===409)return x.json().then(E=>{const A=new Error("Conflict");throw A.status=409,A.data=E,A});throw new Error("HTTP "+x.status+": "+x.statusText)})})}a.prototype.update=function(l,u,d){return b(this,l,u,d).then(h=>h.record)};function m(l,u,d,h){return(d?Promise.resolve(d):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(C=>{if(!C.ok)throw new Error("Could not retrieve document for revision delete");return C.json().then(p=>p._rev)})).then(C=>{const p=k(l.url,l.db,null,u)+"?rev="+encodeURIComponent(C);return window.fetch(p,{method:"DELETE",headers:n(l,h),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("HTTP "+w.status+": "+w.statusText);return w.json()}).then(w=>{const y=r(w);return{response:y.content,message:y.message}})})}a.prototype.delete=function(l,u,d){return m(this,l,u,d).then(h=>h.response)};function _(l,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(k(l.url,l.db,"_all_docs"),{method:"POST",headers:T(l.headers,l.auth),credentials:l.credentials,body:JSON.stringify({keys:u})}).then(h=>{if(!h.ok)throw new Error("HTTP "+h.status+": "+h.statusText);return h.json()}).then(h=>{const C=(h.rows||[]).filter(p=>!p.error&&p.value&&p.value.rev).map(p=>({_id:p.id,_rev:p.value.rev,_deleted:!0}));return C.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(k(l.url,l.db,"_bulk_docs"),{method:"POST",headers:n(l,d),credentials:l.credentials,body:JSON.stringify({docs:C})}).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status+": "+p.statusText);return p.json()}).then(p=>{const w=r(p);return{response:{ok:!0,results:w.content,deletedCount:C.length},message:w.message}})})}a.prototype.bulkDelete=function(l,u){return _(this,l,u).then(d=>d.response)};function M(l){l._handlers={sync:function(u){const d=u.detail||{};l.fetchDelta(d.since).then(function(h){v(l.dom,"ln-couchdb-connector:fetched",{data:h,since:d.since,meta:d.meta||null})}).catch(function(h){h&&h.name==="AbortError"||v(l.dom,"ln-couchdb-connector:error",{action:"sync",error:h.message,status:h.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};f(l,d.data,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:created",{record:h.record,tempId:d.tempId,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"create",error:h.message,status:h.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},h=Object.assign({},d.data);d.expected_version!==void 0&&(h._rev=d.expected_version),b(l,d.id,h,d.idempotencyKey).then(function(g){v(l.dom,"ln-couchdb-connector:updated",{record:g.record,id:d.id,message:g.message,meta:d.meta||null})}).catch(function(g){v(l.dom,"ln-couchdb-connector:error",{action:"update",error:g.message,status:g.status||0,id:d.id,data:g.status===409?g.data:null,conflictData:g.status===409?g.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};m(l,d.id,d.rev,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:deleted",{response:h.response,id:d.id,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"delete",error:h.message,status:h.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};_(l,d.ids,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:bulk-deleted",{response:h.response,ids:d.ids,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:h.message,status:h.status||0,ids:d.ids,meta:d.meta||null})})}},l.dom.addEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete)}a.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._deltaController&&(l._deltaController.abort(),l._deltaController=null),l._handlers&&(l.dom.removeEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[o]},ie(e,t,a,"ln-couchdb-connector",{attributes:s})})()})();
1
+ (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(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(!q(r))return}e.apply(console,t)}}function v(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 L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ce(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,i={},c=e.elements,l={};if(o)for(let a=0;a<c.length;a++){const n=c[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<c.length;a++){const n=c[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let f=0;f<n.options.length;f++)n.options[f].selected&&i[n.name].push(n.options[f].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const f=Number(n.value);i[n.name]=n.value===""||isNaN(f)?null:f}else i[n.name]=n.value}return i}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const o=e.elements,r=[],i={};for(let c=0;c<o.length;c++){const l=o[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<o.length;c++){const l=o[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const f=String(n).split(",").map(function(b){return b.trim()});l.checked=f.indexOf(l.value)!==-1}else l.checked=de(n);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let f=0;f<l.options.length;f++)l.options[f].selected=n.indexOf(l.options[f].value)!==-1;r.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=ce);function k(...e){return e.filter(t=>t!=null&&t!=="").map((t,o)=>o===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function T(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function fe(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(o){return console.error(`[${t}] Invalid headers JSON:`,o),{}}}const H={};function he(e,t){H[e]=t}function we(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=he,window.lnCore.getDataMapper=we);function be(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function pe(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];U[o]=t}function me(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=pe,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=be);const I={};function ge(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=I[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();t[_]!=null&&a.setAttribute(m,t[_])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const a=c[l],n=a.getAttribute("data-ln-class").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();_ in t&&a.classList.toggle(m,!!t[_])}}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 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)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function J(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const c=o.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const r=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],a=l.attributes;for(let n=0;n<a.length;n++){const f=a[n];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ye(e,t,o,r,i,c){const l={};for(let n=0;n<e.children.length;n++){const f=e.children[n],b=f.getAttribute("data-ln-render-key");b&&(l[b]=f)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const f=t[n],b=String(r(f));let m=l[b];if(m)i(m,f,n);else{const _=ge(o,c);if(!_||(J(_,f),m=_.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),i(m,f,n)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=W,window.lnCore.lnFill=Ce,window.lnCore.renderList=ye);function O(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function V(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function K(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 G(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const R=new Map;function z(e,t){const o=(e?e.join("|"):"")+"::"+t;if(R.has(o))return R.get(o);const r=new Set(e||[]),i=function(c,l){const a=c.getAttribute(l);return a!==null&&r.has(a)?a:t};return R.set(o,i),i}function Q(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function X(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function Y(e,t,o,r,i){if(!e||t===null)return!0;const c=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${c}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${c}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${c}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${c}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${c}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${c}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${c}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,o){for(const r in o){const[i,c,l]=o[r];Object.defineProperty(e,r,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function ee(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=z(r.values,r.fallback);break;case"integer":i=V;break;case"float":i=Q;break;case"boolean":i=K;break;case"list":i=G;break;case"json":i=X;break;case"string":default:i=O;break}i||(i=O),t[r.prop]=[i,o,r.fallback]}return t}function _e(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 ve(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=ee,window.lnCore.attrStr=O,window.lnCore.attrInt=V,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=z,window.lnCore.attrFloat=Q,window.lnCore.attrJson=X);function D(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 te(e,t,o,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(c)&&D(e,l),e.querySelectorAll){const a=e.querySelectorAll(c);for(let n=0;n<a.length;n++)D(a[n],l)}}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 ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ne(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function xe(e){const t=ne(),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(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ve(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 oe(e,t,o,r){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[o];l?l(t,o,r):c.onAttrChange&&(!c.declared||c.declared.has(o))&&c.onAttrChange(t,o,r)}}function Se(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=ne(),i=r.byAttr.get(t),c=P()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&q(l)){const a=r.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let f=0;f<a.length;f++)Y(a[f].spec,n,t,a[f].componentTag,l)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),o){const a=r.byReactive.get(t);a&&oe(a,l,t,e.oldValue),r.reactiveWildcard.length&&oe(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(te(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Se(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function B(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 re(e){const t=$();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=N();if(e.target&&r.length)for(let i=0;i<r.length;i++){const c=r[i],l=c.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&c.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const c=e.addedNodes[i];if(c.nodeType===1){const l=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)c.matches&&c.matches(n.query)&&D(c,n);else if(c.matches&&c.matches(n.query)&&D(c,n),c.querySelectorAll){const f=c.querySelectorAll(n.query);for(let b=0;b<f.length;b++)D(f[b],n)}}n.onInit&&n.onInit(c)}}}for(let i=0;i<e.removedNodes.length;i++){const c=e.removedNodes[i];if(c.nodeType===1){if(document.contains(c))continue;const l=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a],f=n.query;if(f){if(!l)c.matches&&c.matches(f)&&B(c,n);else if(c.matches&&c.matches(f)&&B(c,n),c.querySelectorAll){const b=c.querySelectorAll(f);for(let m=0;m<b.length;m++)B(b[m],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){const e=new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{re(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const o=t.takeRecords();for(let r=0;r<o.length;r++){const i=o[r];if(i.type==="childList")try{re(i)}catch(c){console.error("[ln-core] lifecycle handler failed",i.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Te(e){$().push(e),e.onSubtreeChange&&e.query&&N().push(e),ie()}function le(e,t,o,r,i={}){const c=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,f=i.onAttrChange||null,b=i.effects||null,m=i.attributes||null,_=m?_e(m):b,M=m?new Set(Object.keys(m)):null,s=i.persist||null;function u(w){const y=w||document.body;if(te(y,e,t,o),m&&P())for(const S in m){const x=m[S],E=Array.from(y.querySelectorAll("["+S+"]"));y.matches&&y.matches("["+S+"]")&&E.push(y);for(let A=0;A<E.length;A++){const j=E[A];q(j)&&Y(x,j.getAttribute(S),S,r,j)}}n&&n(y)}const d=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let y;for(;(y=w.exec(e))!==null;)d.push(y[1])}else d.push(e);xe({selector:e,attribute:t,componentTag:r,attributes:m,ComponentFn:o,onInit:n,observed:d.concat(c),onAttributeChange:l,onAttrChange:f,effects:_,declared:M,persist:s}),Ee();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=i.subtreeQuery||(h?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:g};$().push(C),a&&g&&N().push(C),ie(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Te,window.lnCore.withoutLifecycle=Oe);function p(){Ae()>0?ke(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),u}function se(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,o={},r=se(t);if(!r)return o;const i=r.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,f=a>-1?l.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(f)}catch{o[n]=f}}return o}function De(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Le(e,t){if(!e)return;const o=F();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(c){const l=o[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==i&&(location.hash=i)}function je(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function qe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const 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 Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ne(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=De,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=je,window.lnCore.resolveHashNamespace=qe,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Ne);function Be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Be),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",o="lnConnector";if(window[t]!==void 0)return;function r(s){const u=s[t];u&&u.refreshConfig()}const i={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:O,type:"string",fallback:"",effect:r,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:O,type:"string",fallback:"",effect:r,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:O,type:"string",fallback:"",effect:r,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:r,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},c=ee(i);function l(s){const u=s&&s.content!==void 0?s.content:s,d=s&&s.message?s.message:null;return{content:u,message:d}}function a(s){return this.dom=s,Z(this,s,c),s[t]=this,s[o]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,M(this),this}a.prototype.refreshConfig=function(){const s=this.dom;this.credentials="same-origin";const u=s.getAttribute("data-ln-couchdb-headers")||"";this.headers=fe(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),v(s,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function n(s,u,d){const h=Object.assign({},T(s.headers,s.auth),d||{});return u&&(h["Idempotency-Key"]=u),h}a.prototype.fetchDelta=function(s){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,h=["include_docs=true","feed=normal"];s&&h.push("since="+encodeURIComponent(s));const g=k(u.url,u.db,"_changes")+"?"+h.join("&");return window.fetch(g,{method:"GET",headers:T(u.headers,u.auth),credentials:u.credentials,signal:d}).then(C=>{if(!C.ok)throw new Error("HTTP "+C.status+": "+C.statusText);return C.json()}).then(C=>{const p=C.results||[];return{data:p.filter(w=>!w.deleted&&w.doc).map(w=>Object.assign({},w.doc,{id:w.doc._id})),deleted:p.filter(w=>w.deleted).map(w=>w.id),synced_at:C.last_seq||s||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function f(s,u,d){const h=Object.assign({_id:u.id},u);return h._id||delete h._id,window.fetch(k(s.url,s.db),{method:"POST",headers:n(s,d),credentials:s.credentials,body:JSON.stringify(h)}).then(g=>{if(!g.ok)throw new Error("HTTP "+g.status+": "+g.statusText);return g.json()}).then(g=>{const C=l(g),p=C.content;return{record:Object.assign({},h,{id:p.id,_id:p.id,_rev:p.rev}),message:C.message}})}a.prototype.create=function(s,u){return f(this,s,u).then(d=>d.record)};function b(s,u,d,h){const g=Object.assign({id:String(u),_id:String(u)},d),C=g._rev||g.rev;return(C?Promise.resolve(C):window.fetch(k(s.url,s.db,null,u),{method:"GET",headers:T(s.headers,s.auth),credentials:s.credentials}).then(w=>{if(!w.ok)throw new Error("Could not retrieve document for revision mapping");return w.json().then(y=>y._rev)})).then(w=>{const y=Object.assign({},g,{_rev:w});delete y.rev;const S=n(s,h,{"If-Match":w});return window.fetch(k(s.url,s.db,null,u),{method:"PUT",headers:S,credentials:s.credentials,body:JSON.stringify(y)}).then(x=>{if(x.ok)return x.json().then(E=>{const A=l(E);return{record:Object.assign({},y,{_rev:A.content.rev}),message:A.message}});if(x.status===409)return x.json().then(E=>{const A=new Error("Conflict");throw A.status=409,A.data=E,A});throw new Error("HTTP "+x.status+": "+x.statusText)})})}a.prototype.update=function(s,u,d){return b(this,s,u,d).then(h=>h.record)};function m(s,u,d,h){return(d?Promise.resolve(d):window.fetch(k(s.url,s.db,null,u),{method:"GET",headers:T(s.headers,s.auth),credentials:s.credentials}).then(C=>{if(!C.ok)throw new Error("Could not retrieve document for revision delete");return C.json().then(p=>p._rev)})).then(C=>{const p=k(s.url,s.db,null,u)+"?rev="+encodeURIComponent(C);return window.fetch(p,{method:"DELETE",headers:n(s,h),credentials:s.credentials}).then(w=>{if(!w.ok)throw new Error("HTTP "+w.status+": "+w.statusText);return w.json()}).then(w=>{const y=l(w);return{response:y.content,message:y.message}})})}a.prototype.delete=function(s,u,d){return m(this,s,u,d).then(h=>h.response)};function _(s,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(k(s.url,s.db,"_all_docs"),{method:"POST",headers:T(s.headers,s.auth),credentials:s.credentials,body:JSON.stringify({keys:u})}).then(h=>{if(!h.ok)throw new Error("HTTP "+h.status+": "+h.statusText);return h.json()}).then(h=>{const C=(h.rows||[]).filter(p=>!p.error&&p.value&&p.value.rev).map(p=>({_id:p.id,_rev:p.value.rev,_deleted:!0}));return C.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(k(s.url,s.db,"_bulk_docs"),{method:"POST",headers:n(s,d),credentials:s.credentials,body:JSON.stringify({docs:C})}).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status+": "+p.statusText);return p.json()}).then(p=>{const w=l(p);return{response:{ok:!0,results:w.content,deletedCount:C.length},message:w.message}})})}a.prototype.bulkDelete=function(s,u){return _(this,s,u).then(d=>d.response)};function M(s){s._handlers={sync:function(u){const d=u.detail||{};s.fetchDelta(d.since).then(function(h){v(s.dom,"ln-couchdb-connector:fetched",{data:h,since:d.since,meta:d.meta||null})}).catch(function(h){h&&h.name==="AbortError"||v(s.dom,"ln-couchdb-connector:error",{action:"sync",error:h.message,status:h.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};f(s,d.data,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:created",{record:h.record,tempId:d.tempId,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"create",error:h.message,status:h.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},h=Object.assign({},d.data);d.expected_version!==void 0&&(h._rev=d.expected_version),b(s,d.id,h,d.idempotencyKey).then(function(g){v(s.dom,"ln-couchdb-connector:updated",{record:g.record,id:d.id,message:g.message,meta:d.meta||null})}).catch(function(g){v(s.dom,"ln-couchdb-connector:error",{action:"update",error:g.message,status:g.status||0,id:d.id,data:g.status===409?g.data:null,conflictData:g.status===409?g.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};m(s,d.id,d.rev,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:deleted",{response:h.response,id:d.id,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"delete",error:h.message,status:h.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};_(s,d.ids,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:bulk-deleted",{response:h.response,ids:d.ids,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:h.message,status:h.status||0,ids:d.ids,meta:d.meta||null})})}},s.dom.addEventListener("ln-couchdb-connector:request-sync",s._handlers.sync),s.dom.addEventListener("ln-couchdb-connector:request-create",s._handlers.create),s.dom.addEventListener("ln-couchdb-connector:request-update",s._handlers.update),s.dom.addEventListener("ln-couchdb-connector:request-delete",s._handlers.delete),s.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",s._handlers.bulkDelete)}a.prototype.destroy=function(){if(!this.dom[t])return;const s=this;s._deltaController&&(s._deltaController.abort(),s._deltaController=null),s._handlers&&(s.dom.removeEventListener("ln-couchdb-connector:request-sync",s._handlers.sync),s.dom.removeEventListener("ln-couchdb-connector:request-create",s._handlers.create),s.dom.removeEventListener("ln-couchdb-connector:request-update",s._handlers.update),s.dom.removeEventListener("ln-couchdb-connector:request-delete",s._handlers.delete),s.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",s._handlers.bulkDelete),s._handlers=null),delete this.dom[t],delete this.dom[o]},le(e,t,a,"ln-couchdb-connector",{attributes:i})})()})();