@livenetworks/ashlar 2.1.1 → 2.1.3
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.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/src/ln-autoresize.js +3 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/lifecycle.js +24 -12
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +22 -12
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-dropdown/src/ln-dropdown.js +18 -5
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +1 -1
- package/components/ln-filter/src/ln-filter.js +11 -10
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/src/ln-form.js +11 -0
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +14 -5
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +21 -10
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-popover/src/ln-popover.js +22 -5
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-search/src/ln-search.js +9 -5
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/src/ln-sortable.js +52 -7
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/src/ln-tabs.js +12 -8
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/src/ln-time.js +17 -7
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/src/ln-validate.js +21 -7
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var LnAshlarComponent=(function(x){"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 E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!E(o))return}e.apply(console,t)}}function O(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function qe(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(r),r}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 De(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function Le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Re(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},a=e.elements,l={};if(n)for(let s=0;s<a.length;s++){const i=a[s];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<a.length;s++){const i=a[s];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&l[i.name]===1?r[i.name]=i.checked:(r[i.name]||(r[i.name]=[]),i.checked&&r[i.name].push(i.value));else if(i.type==="radio")i.checked&&(r[i.name]=i.value);else if(i.type==="select-multiple"){r[i.name]=[];for(let c=0;c<i.options.length;c++)i.options[c].selected&&r[i.name].push(i.options[c].value)}else if(n&&i.type==="hidden")r[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const c=Number(i.value);r[i.name]=i.value===""||isNaN(c)?null:c}else r[i.name]=i.value}return r}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 Me(e,t){const n=e.elements,o=[],r={};for(let a=0;a<n.length;a++){const l=n[a];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let a=0;a<n.length;a++){const l=n[a];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const i=t[s];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(i).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=Ie(i);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<l.options.length;c++)l.options[c].selected=i.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Me,window.lnCore.serializeForm=Re,window.lnCore.resolveFormMethod=Le);const z={};function $e(e,t){z[e]=t}function Te(e){return z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=$e,window.lnCore.getDataMapper=Te);function Fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){O(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const J={};function Ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];J[n]=t}function Be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return J[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ne,window.lnCore.getLocaleFallback=Be,window.lnCore.ensureLocaleObserver=Fe);const q={};function We(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function G(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],i=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const d=i[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();t[p]!=null&&s.setAttribute(f,t[p])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const s=r[l],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],i=s.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const d=i[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();p in t&&s.classList.toggle(f,!!t[p])}}return e}function je(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)G(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function X(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(a,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let a=0;a<r.length;a++){const l=r[a],s=l.attributes;for(let i=0;i<s.length;i++){const c=s[i];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ke(e,t,n,o,r,a){const l={};for(let i=0;i<e.children.length;i++){const c=e.children[i],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],d=String(o(c));let f=l[d];if(f)r(f,c,i);else{const p=We(n,a);if(!p||(X(p,c),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),r(f,c,i)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=G,window.lnCore.lnFill=je,window.lnCore.renderList=Ke);function D(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function Y(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function Z(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const L=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(L.has(n))return L.get(n);const o=new Set(e||[]),r=function(a,l){const s=a.getAttribute(l);return s!==null&&o.has(s)?s:t};return L.set(n,r),r}function ne(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function re(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function oe(e,t,n,o,r){if(!e||t===null)return!0;const a=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=i=>{r?console.warn(i,r):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Pe(e,t,n){for(const o in n){const[r,a,l]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,a,l)},enumerable:!0,configurable:!0})}return e}function He(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=te(o.values,o.fallback);break;case"integer":r=Y;break;case"float":r=ne;break;case"boolean":r=Z;break;case"list":r=ee;break;case"json":r=re;break;case"string":default:r=D;break}r||(r=D),t[o.prop]=[r,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function Ve(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Pe,window.lnCore.attrSpec=He,window.lnCore.attrStr=D,window.lnCore.attrInt=Y,window.lnCore.attrBool=Z,window.lnCore.attrList=ee,window.lnCore.attrEnum=te,window.lnCore.attrFloat=ne,window.lnCore.attrJson=re);function C(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ie(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(a)&&C(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let i=0;i<s.length;i++)C(s[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Qe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ze(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 le(){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 Je(e){const t=le(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(a=>a.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ve(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function se(e,t,n,o){for(let r=0;r<e.length;r++){const a=e[r];if(!t[a.attribute])continue;const l=a.effects&&a.effects[n];l?l(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=le(),r=o.byAttr.get(t),a=Q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!r&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&E(l)){const s=o.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let c=0;c<s.length;c++)oe(s[c].spec,i,t,s[c].componentTag,l)}if(window.lnCore._debugSink&&(n||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const s=o.byReactive.get(t);s&&se(s,l,t,e.oldValue),o.reactiveWildcard.length&&se(o.reactiveWildcard,l,t,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const i=r[s];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(ie(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function Xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ye(e){const t=R();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const a=r.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&r.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)r.matches&&r.matches(s.query)&&C(r,s);else if(r.matches&&r.matches(s.query)&&C(r,s),r.querySelectorAll){const i=r.querySelectorAll(s.query);for(let c=0;c<i.length;c++)C(i[c],s)}}s.onInit&&s.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l],i=s.query;if(i){if(!a)r.matches&&r.matches(i)&&I(r,s);else if(r.matches&&r.matches(i)&&I(r,s),r.querySelectorAll){const c=r.querySelectorAll(i);for(let d=0;d<c.length;d++)I(c[d],s)}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Ye(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ze(e){R().push(e),ae()}function ce(e,t,n,o,r={}){const a=r.extraAttributes||[],l=r.onAttributeChange||null,s=r.onSubtreeChange||null,i=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,f=r.attributes||null,p=f?Ue(f):d,k=f?new Set(Object.keys(f)):null,u=r.persist||null;function h(P){const b=P||document.body;if(ie(b,e,t,n),f&&Q())for(const v in f){const gt=f[v],H=Array.from(b.querySelectorAll("["+v+"]"));b.matches&&b.matches("["+v+"]")&&H.push(b);for(let U=0;U<H.length;U++){const V=H[U];E(V)&&oe(gt,V.getAttribute(v),v,o,V)}}i&&i(b)}const w=[];if(e.indexOf("[")!==-1){const P=/\[([\w-]+)/g;let b;for(;(b=P.exec(e))!==null;)w.push(b[1])}else w.push(e);Je({selector:e,attribute:t,componentTag:o,attributes:f,ComponentFn:n,onInit:i,observed:w.concat(a),onAttributeChange:l,onAttrChange:c,effects:p,declared:k,persist:u}),Xe();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,pt=r.subtreeQuery||(m?e:"["+e+"]");R().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:s,query:pt}),ae(),window[t]=h,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ce,window.lnCore.observeLifecycle=Ze);function Oe(){Qe()>0?ze(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oe):Oe(),h}function ue(e){return(e||"").replace(/^#/,"")}function M(e){const t=e===void 0?location.hash:e,n={},o=ue(t);if(!o)return n;const r=o.split("&");for(let a=0;a<r.length;a++){const l=r[a];if(!l)continue;const s=l.indexOf(":"),i=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function et(e){if(!e)return null;const t=M();return e in t?t[e]:null}function tt(e,t){if(!e)return;const n=M();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(a){const l=n[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");ue(location.hash)!==r&&(location.hash=r)}function nt(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function rt(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function ot(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function it(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 lt(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function st(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=M,window.lnCore.hashGet=et,window.lnCore.hashSet=tt,window.lnCore.hashLinkClick=nt,window.lnCore.resolveHashNamespace=rt,window.lnCore.hashSortEncode=ot,window.lnCore.hashSortDecode=it,window.lnCore.hashFilterEncode=lt,window.lnCore.hashFilterDecode=st);function at(){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=at);function ct(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:o=null}={}){const r=n?!o:!e.some(c=>c.match),a=[],l=[];for(const c of e)if(!(!c.targetEl&&!c.isPending)){if(!c.match){const d=t&&c.hasHydrate&&c.hasChildren;!c.hasKeep&&c.hasChildren&&!d&&c.targetEl&&a.push(c);continue}c.hasKeep&&c.mountedTemplate===c.match.route.templateNode||l.push(Object.assign({},c,{skipMount:t&&c.hasHydrate&&c.hasChildren}))}l.sort((c,d)=>c.regionKey==="__primary__"?-1:d.regionKey==="__primary__"?1:0);const i=l.find(c=>c.regionKey==="__primary__")||l[0]||null;return{notFound:r,clears:a,swaps:l,owner:i}}function _(e){if(!e||typeof e!="string")return"";let t=e.trim().replace(/\/+$/,"");return!t||t==="/"?"":t.startsWith("/")?t:"/"+t}function ut(e,t){const n=_(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const o=(e||"/").replace(/\/+$/,"")||"/";return o===n?"/":o.startsWith(n+"/")?o.slice(n.length).replace(/\/+$/,"")||"/":o}function de(e,t){const n=_(t);if(!n)return e||"/";const o=e||"/",r=o.indexOf("#"),a=r!==-1?o.slice(0,r):o,l=r!==-1?o.slice(r):"",s=a.indexOf("?"),i=s!==-1?a.slice(0,s):a,c=s!==-1?a.slice(s):"";let d;if(i===n)d=n+"/";else if(i.startsWith(n+"/"))d=i;else{const f=i.startsWith("/")?i:"/"+i;d=f==="/"?n+"/":n+f}return d+c+l}function $(){if(typeof document>"u")return"";const e=document.querySelector("[data-ln-outlet]")||document.querySelector("[data-ln-router-base]");if(e&&e.hasAttribute("data-ln-router-base"))return _(e.getAttribute("data-ln-router-base"));const t=document.querySelector("base[href]");if(t)try{const n=new URL(t.getAttribute("href"),window.location.origin);return _(n.pathname)}catch{return _(t.getAttribute("href"))}return""}const T={navigate:function(e){A(e,{historyAction:"push"})},replace:function(e){A(e,{historyAction:"replace"})},base:function(){return $()},toUrl:function(e){return de(e,$())},current:function(){return S===null?null:{path:S,fullPath:pe,base:ge,params:be,query:me,route:ye,regions:he}}},F="data-ln-route",fe="lnRoute";typeof window<"u"&&(window.lnRouter=T);function N(e){xe(e),ke(e),g.size>0&&Se()}const dt={"data-ln-route":{effect:N,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:N,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:N,type:"string",description:"Document title template set when route is activated"},"data-ln-route-keep":{type:"boolean",fallback:!1,description:"Preserve mounted DOM nodes in memory instead of rebuilding"},"data-ln-router-base":{type:"string",description:'Base URL prefix for subdirectory routing (e.g. "/spa")'},"data-ln-router-hydrate":{type:"boolean",fallback:!1,description:"Hydrate existing DOM content on initial router boot"}},g=new Map,B=new WeakMap;let he=new Map,we=!1,S=null,pe=null,ge="",be={},me={},ye=null,W=!1;function Ce(e,t,n){W?queueMicrotask(function(){O(e,t,n)}):O(e,t,n)}function j(e){try{const s=new URL(e,window.location.origin);e=s.pathname+s.search+s.hash}catch{}let[t]=e.split("#"),[n,o]=t.split("?");const r={};if(o){const s=new URLSearchParams(o);for(const[i,c]of s.entries())r[i]=c}const a=$();return{path:ut(n,a),query:r,base:a}}function _e(e,t){if(e.pattern==="*")return 1;if(t.pattern==="*")return-1;const n=e.segments,o=t.segments,r=Math.max(n.length,o.length);for(let a=0;a<r;a++){const l=n[a],s=o[a];if(l===void 0)return 1;if(s===void 0)return-1;if(l==="*")return 1;if(s==="*")return-1;const i=l.startsWith(":"),c=s.startsWith(":");if(i&&!c)return 1;if(!i&&c)return-1}return 0}function Ae(e,t){const n=e.split("/").filter(Boolean);for(const o of t){if(o.pattern==="*")return{route:o,params:{wildcard:e}};const r=o.segments,a={};let l=!0;if(!(n.length>r.length&&r[r.length-1]!=="*")){for(let s=0;s<r.length;s++){const i=r[s],c=n[s];if(i==="*"){a.wildcard=n.slice(s).join("/");break}if(c===void 0){l=!1;break}if(i.startsWith(":"))a[i.slice(1)]=decodeURIComponent(c);else if(i!==c){l=!1;break}}if(l&&(r.indexOf("*")!==-1||n.length<=r.length))return{route:o,params:a}}}return null}function K(e,t={}){const n=t.warn!==!1;if(e!=="__primary__"){const r=document.getElementById(e);return!r&&n&&console.warn(`[ln-router] Explicit target element #${e} not found in DOM`),r}const o=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return!o&&n&&console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),o}function ve(e){if(!e)return;const t=Array.from(e.querySelectorAll("*")),n=[e].concat(t);for(const r of n)for(const a of Object.keys(r))if(a.startsWith("ln")&&r[a]&&typeof r[a].destroy=="function")try{r[a].destroy()}catch(l){console.error(`[ln-router] Error destroying component ${a} on element:`,r,l)}const o=document.querySelectorAll('[data-ln-popover="open"]');for(const r of o){const a=r.lnPopover;if(a&&a.trigger&&e.contains(a.trigger))try{a.destroy()}catch(l){console.error("[ln-router] Error destroying open popover:",l)}}}function A(e,t={}){const{path:n,query:o,base:r}=j(e),a=de(e,r),l=new Map;for(const[u,h]of g)l.set(u,Ae(n,h.sorted));const s=l.get("__primary__")||null,i=K("__primary__",{warn:!!s}),c=g.has("__primary__"),d=[];for(const[u,h]of l){const w=u==="__primary__"?i:K(u,{warn:!1}),m=!w&&!!(s&&s.route&&s.route.templateNode&&s.route.templateNode.content&&s.route.templateNode.content.querySelector("#"+CSS.escape(u)));!w&&!m&&h&&console.warn(`[ln-router] Explicit target element #${u} not found in DOM`),d.push({regionKey:u,match:h,targetEl:w,isPending:m,hasKeep:!!w&&w.hasAttribute("data-ln-route-keep"),hasHydrate:!!w&&w.hasAttribute("data-ln-router-hydrate"),hasChildren:!!w&&w.children.length>0,mountedTemplate:w&&B.get(w)||null})}const f=ct(d,{isHydration:!!t.isHydration,hasPrimaryRegion:c,primaryMatch:s});if(f.notFound){Ce(document.body,"ln-router:not-found",{path:n});return}if(qe(i||document.body,"ln-router:before-navigate",{from:S,to:a,path:n,params:s?s.params:{},query:o}).defaultPrevented)return;t.historyAction==="push"?window.history.pushState(null,"",a):t.historyAction==="replace"&&window.history.replaceState(null,"",a);const k=function(){for(const u of f.clears)ve(u.targetEl),u.targetEl.replaceChildren(),B.delete(u.targetEl);for(const u of f.swaps){if((u.isPending||!u.targetEl||!document.contains(u.targetEl))&&(u.targetEl=u.regionKey==="__primary__"?i:document.getElementById(u.regionKey)),!u.targetEl){console.warn(`[ln-router] Target element #${u.regionKey} could not be resolved`);continue}if(u.skipMount||(ve(u.targetEl),u.targetEl.replaceChildren(u.match.route.templateNode.content.cloneNode(!0))),B.set(u.targetEl,u.match.route.templateNode),f.owner&&u.regionKey===f.owner.regionKey){if(u.match.route.title){let h=u.match.route.title;if(u.match.params)for(const[w,m]of Object.entries(u.match.params))h=h.replace(new RegExp("\\{\\{\\s*"+w+"\\s*\\}\\}","g"),m);document.title=h}if(!t.isHydration){u.targetEl.hasAttribute("tabindex")||u.targetEl.setAttribute("tabindex","-1");const h=u.targetEl.querySelector("h1, h2, h3, h4, h5, h6");h?(h.setAttribute("tabindex","-1"),h.focus()):u.targetEl.focus(),u.regionKey==="__primary__"&&u.targetEl.scrollIntoView({block:"start",behavior:"instant"})}}Ce(u.targetEl,"ln-router:navigated",{path:n,fullPath:a,base:r,params:u.match.params,query:o,route:u.match.route,target:u.targetEl,region:u.regionKey})}S=n,pe=a,ge=r,me=o,ye=s?s.route:null,be=s?s.params:{},he=new Map(Array.from(l.entries()).map(([u,h])=>[u,h?{route:h.route,params:h.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(k):k()}function ft(e){const t=e.target.closest("a");if(!t||!De(e,t))return;const n=t.getAttribute("href"),{path:o}=j(n);for(const r of g.values())if(Ae(o,r.sorted)){e.preventDefault(),A(n,{historyAction:"push"});return}}function ht(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++){const a=n[r];if(e[a]!==t[a])return!1}return!0}function wt(){const e=window.location.pathname+window.location.search,t=T.current();if(t&&t.path!=null){const n=j(e);if(t.path===n.path&&ht(t.query,n.query))return}A(e,{historyAction:"skip"})}function Se(){we||(we=!0,y(function(){document.addEventListener("click",ft),window.addEventListener("popstate",wt),W=!0;const e=window.location.pathname+window.location.search+window.location.hash;A(e,{historyAction:"replace",isHydration:!0}),W=!1},"ln-router"))}function ke(e){const t=e.getAttribute(F);if(!t)return;const n=e.getAttribute("data-ln-route-target")||null;if(n==="__primary__"){console.warn(`[ln-router] "__primary__" is a reserved region key and cannot be used as data-ln-route-target. Route "${t}" rejected.`);return}const o=n||"__primary__";g.has(o)||g.set(o,{routes:new Map,sorted:[]});const r=g.get(o);if(r.routes.has(t)){console.warn(`[ln-router] Duplicate route pattern registered: "${t}" in region "${o}"`);return}const a=e.getAttribute("data-ln-route-title"),l=t.split("/").filter(Boolean),s={pattern:t,segments:l,target:n,title:a,templateNode:e},i=K(o);i&&i.contains(e)&&console.warn(`[ln-router] Route template with pattern "${t}" is declared inside its own outlet element:`,e),r.routes.set(t,s),r.sorted=Array.from(r.routes.values()).sort(_e)}function xe(e){const t=e.getAttribute(F);if(!t)return;const o=e.getAttribute("data-ln-route-target")||null||"__primary__",r=g.get(o);r&&(r.routes.delete(t),r.sorted=Array.from(r.routes.values()).sort(_e),r.routes.size===0&&g.delete(o))}function Ee(e){return this.dom=e,ke(e),this}return Ee.prototype.destroy=function(){xe(this.dom),delete this.dom[fe]},ce(F,fe,Ee,"ln-router",{attributes:dt,onInit:function(){g.size>0&&Se()}}),x.router=T,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
|
|
1
|
+
var LnAshlarComponent=(function(x){"use strict";function z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!E(i))return}e.apply(console,t)}}function O(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function Le(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(r),r}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 Ie(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function Me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function $e(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,r={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&l[o.name]===1?r[o.name]=o.checked:(r[o.name]||(r[o.name]=[]),o.checked&&r[o.name].push(o.value));else if(o.type==="radio")o.checked&&(r[o.name]=o.value);else if(o.type==="select-multiple"){r[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&r[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")r[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);r[o.name]=o.value===""||isNaN(c)?null:c}else r[o.name]=o.value}return r}function Te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Fe(e,t){const n=e.elements,i=[],r={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const o=t[a];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(o).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=Te(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<l.options.length;c++)l.options[c].selected=o.indexOf(l.options[c].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Fe,window.lnCore.serializeForm=$e,window.lnCore.resolveFormMethod=Me);const J={};function Ne(e,t){J[e]=t}function Be(e){return J[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ne,window.lnCore.getDataMapper=Be);function We(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){O(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function je(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function Ke(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=je,window.lnCore.getLocaleFallback=Ke,window.lnCore.ensureLocaleObserver=We);const q={};function Pe(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const a=i[l],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(f,t[p])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(f,!!t[p])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)X(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Y(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const l=r[s],a=l.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ue(e,t,n,i,r,s){const l={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],d=String(i(c));let f=l[d];if(f)r(f,c,o);else{const p=Pe(n,s);if(!p||(Y(p,c),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),r(f,c,o)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=He,window.lnCore.renderList=Ue);function R(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function Z(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function ee(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const i=new Set(e||[]),r=function(s,l){const a=s.getAttribute(l);return a!==null&&i.has(a)?a:t};return D.set(n,r),r}function re(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function oe(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function ie(e,t,n,i,r){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{r?console.warn(o,r):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ve(e,t,n){for(const i in n){const[r,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return r(t,s,l)},enumerable:!0,configurable:!0})}return e}function Qe(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=ne(i.values,i.fallback);break;case"integer":r=Z;break;case"float":r=re;break;case"boolean":r=ee;break;case"list":r=te;break;case"json":r=oe;break;case"string":default:r=R;break}r||(r=R),t[i.prop]=[r,n,i.fallback]}return t}function ze(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function Je(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ve,window.lnCore.attrSpec=Qe,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function C(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function le(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&C(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let o=0;o<a.length;o++)C(a[o],l)}}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 Xe(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 se(){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=se(),n=e.observed||[];for(let i=0;i<n.length;i++){const r=n[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Je(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function ae(e,t,n,i){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function Ze(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=se(),r=i.byAttr.get(t),s=z()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!r&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&E(l)){const a=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let c=0;c<a.length;c++)ie(a[c].spec,o,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(n||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const a=i.byReactive.get(t);a&&ae(a,l,t,e.oldValue),i.reactiveWildcard.length&&ae(i.reactiveWildcard,l,t,e.oldValue)}if(r)for(let a=0;a<r.length;a++){const o=r[a];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(le(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function et(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ze(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function tt(e){const t=L();if(!t.length)return;const n=e.target;if(n){const r=n.nodeType===1?n:n.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=I();if(e.target&&i.length)for(let r=0;r<i.length;r++){const s=i[r],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let r=0;r<e.addedNodes.length;r++){const s=e.addedNodes[r];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const o=t[a];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)s.matches&&s.matches(o.query)&&C(s,o);else if(s.matches&&s.matches(o.query)&&C(s,o),s.querySelectorAll){const c=s.querySelectorAll(o.query);for(let d=0;d<c.length;d++)C(c[d],o)}}o.onInit&&o.onInit(s)}}}for(let r=0;r<e.removedNodes.length;r++){const s=e.removedNodes[r];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const o=t[a],c=o.query;if(c){if(!l)s.matches&&s.matches(c)&&M(s,o);else if(s.matches&&s.matches(c)&&M(s,o),s.querySelectorAll){const d=s.querySelectorAll(c);for(let f=0;f<d.length;f++)M(d[f],o)}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{tt(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function nt(e){L().push(e),e.onSubtreeChange&&e.query&&I().push(e),ce()}function ue(e,t,n,i,r={}){const s=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,o=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,f=r.attributes||null,p=f?ze(f):d,k=f?new Set(Object.keys(f)):null,u=r.persist||null;function h(H){const b=H||document.body;if(le(b,e,t,n),f&&z())for(const v in f){const mt=f[v],U=Array.from(b.querySelectorAll("["+v+"]"));b.matches&&b.matches("["+v+"]")&&U.push(b);for(let V=0;V<U.length;V++){const Q=U[V];E(Q)&&ie(mt,Q.getAttribute(v),v,i,Q)}}o&&o(b)}const w=[];if(e.indexOf("[")!==-1){const H=/\[([\w-]+)/g;let b;for(;(b=H.exec(e))!==null;)w.push(b[1])}else w.push(e);Ye({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:n,onInit:o,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:k,persist:u}),et();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=r.subtreeQuery||(m?e:"["+e+"]"),Re={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:qe};L().push(Re),a&&qe&&I().push(Re),ce(),window[t]=h,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ue,window.lnCore.observeLifecycle=nt);function De(){Ge()>0?Xe(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",De):De(),h}function de(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},i=de(t);if(!i)return n;const r=i.split("&");for(let s=0;s<r.length;s++){const l=r[s];if(!l)continue;const a=l.indexOf(":"),o=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function rt(e){if(!e)return null;const t=$();return e in t?t[e]:null}function ot(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");de(location.hash)!==r&&(location.hash=r)}function it(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function lt(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function st(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function at(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 ct(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ut(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),r=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=rt,window.lnCore.hashSet=ot,window.lnCore.hashLinkClick=it,window.lnCore.resolveHashNamespace=lt,window.lnCore.hashSortEncode=st,window.lnCore.hashSortDecode=at,window.lnCore.hashFilterEncode=ct,window.lnCore.hashFilterDecode=ut);function dt(){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=dt);function ft(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:i=null}={}){const r=n?!i:!e.some(c=>c.match),s=[],l=[];for(const c of e)if(!(!c.targetEl&&!c.isPending)){if(!c.match){const d=t&&c.hasHydrate&&c.hasChildren;!c.hasKeep&&c.hasChildren&&!d&&c.targetEl&&s.push(c);continue}c.hasKeep&&c.mountedTemplate===c.match.route.templateNode||l.push(Object.assign({},c,{skipMount:t&&c.hasHydrate&&c.hasChildren}))}l.sort((c,d)=>c.regionKey==="__primary__"?-1:d.regionKey==="__primary__"?1:0);const o=l.find(c=>c.regionKey==="__primary__")||l[0]||null;return{notFound:r,clears:s,swaps:l,owner:o}}function _(e){if(!e||typeof e!="string")return"";let t=e.trim().replace(/\/+$/,"");return!t||t==="/"?"":t.startsWith("/")?t:"/"+t}function ht(e,t){const n=_(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const i=(e||"/").replace(/\/+$/,"")||"/";return i===n?"/":i.startsWith(n+"/")?i.slice(n.length).replace(/\/+$/,"")||"/":i}function fe(e,t){const n=_(t);if(!n)return e||"/";const i=e||"/",r=i.indexOf("#"),s=r!==-1?i.slice(0,r):i,l=r!==-1?i.slice(r):"",a=s.indexOf("?"),o=a!==-1?s.slice(0,a):s,c=a!==-1?s.slice(a):"";let d;if(o===n)d=n+"/";else if(o.startsWith(n+"/"))d=o;else{const f=o.startsWith("/")?o:"/"+o;d=f==="/"?n+"/":n+f}return d+c+l}function T(){if(typeof document>"u")return"";const e=document.querySelector("[data-ln-outlet]")||document.querySelector("[data-ln-router-base]");if(e&&e.hasAttribute("data-ln-router-base"))return _(e.getAttribute("data-ln-router-base"));const t=document.querySelector("base[href]");if(t)try{const n=new URL(t.getAttribute("href"),window.location.origin);return _(n.pathname)}catch{return _(t.getAttribute("href"))}return""}const F={navigate:function(e){A(e,{historyAction:"push"})},replace:function(e){A(e,{historyAction:"replace"})},base:function(){return T()},toUrl:function(e){return fe(e,T())},current:function(){return S===null?null:{path:S,fullPath:ge,base:be,params:me,query:ye,route:Ce,regions:we}}},N="data-ln-route",he="lnRoute";typeof window<"u"&&(window.lnRouter=F);function B(e){Ee(e),xe(e),g.size>0&&ke()}const wt={"data-ln-route":{effect:B,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:B,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:B,type:"string",description:"Document title template set when route is activated"},"data-ln-route-keep":{type:"boolean",fallback:!1,description:"Preserve mounted DOM nodes in memory instead of rebuilding"},"data-ln-router-base":{type:"string",description:'Base URL prefix for subdirectory routing (e.g. "/spa")'},"data-ln-router-hydrate":{type:"boolean",fallback:!1,description:"Hydrate existing DOM content on initial router boot"}},g=new Map,W=new WeakMap;let we=new Map,pe=!1,S=null,ge=null,be="",me={},ye={},Ce=null,j=!1;function _e(e,t,n){j?queueMicrotask(function(){O(e,t,n)}):O(e,t,n)}function K(e){try{const a=new URL(e,window.location.origin);e=a.pathname+a.search+a.hash}catch{}let[t]=e.split("#"),[n,i]=t.split("?");const r={};if(i){const a=new URLSearchParams(i);for(const[o,c]of a.entries())r[o]=c}const s=T();return{path:ht(n,s),query:r,base:s}}function Ae(e,t){if(e.pattern==="*")return 1;if(t.pattern==="*")return-1;const n=e.segments,i=t.segments,r=Math.max(n.length,i.length);for(let s=0;s<r;s++){const l=n[s],a=i[s];if(l===void 0)return 1;if(a===void 0)return-1;if(l==="*")return 1;if(a==="*")return-1;const o=l.startsWith(":"),c=a.startsWith(":");if(o&&!c)return 1;if(!o&&c)return-1}return 0}function ve(e,t){const n=e.split("/").filter(Boolean);for(const i of t){if(i.pattern==="*")return{route:i,params:{wildcard:e}};const r=i.segments,s={};let l=!0;if(!(n.length>r.length&&r[r.length-1]!=="*")){for(let a=0;a<r.length;a++){const o=r[a],c=n[a];if(o==="*"){s.wildcard=n.slice(a).join("/");break}if(c===void 0){l=!1;break}if(o.startsWith(":"))s[o.slice(1)]=decodeURIComponent(c);else if(o!==c){l=!1;break}}if(l&&(r.indexOf("*")!==-1||n.length<=r.length))return{route:i,params:s}}}return null}function P(e,t={}){const n=t.warn!==!1;if(e!=="__primary__"){const r=document.getElementById(e);return!r&&n&&console.warn(`[ln-router] Explicit target element #${e} not found in DOM`),r}const i=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return!i&&n&&console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),i}function Se(e){if(!e)return;const t=Array.from(e.querySelectorAll("*")),n=[e].concat(t);for(const r of n)for(const s of Object.keys(r))if(s.startsWith("ln")&&r[s]&&typeof r[s].destroy=="function")try{r[s].destroy()}catch(l){console.error(`[ln-router] Error destroying component ${s} on element:`,r,l)}const i=document.querySelectorAll('[data-ln-popover="open"]');for(const r of i){const s=r.lnPopover;if(s&&s.trigger&&e.contains(s.trigger))try{s.destroy()}catch(l){console.error("[ln-router] Error destroying open popover:",l)}}}function A(e,t={}){const{path:n,query:i,base:r}=K(e),s=fe(e,r),l=new Map;for(const[u,h]of g)l.set(u,ve(n,h.sorted));const a=l.get("__primary__")||null,o=P("__primary__",{warn:!!a}),c=g.has("__primary__"),d=[];for(const[u,h]of l){const w=u==="__primary__"?o:P(u,{warn:!1}),m=!w&&!!(a&&a.route&&a.route.templateNode&&a.route.templateNode.content&&a.route.templateNode.content.querySelector("#"+CSS.escape(u)));!w&&!m&&h&&console.warn(`[ln-router] Explicit target element #${u} not found in DOM`),d.push({regionKey:u,match:h,targetEl:w,isPending:m,hasKeep:!!w&&w.hasAttribute("data-ln-route-keep"),hasHydrate:!!w&&w.hasAttribute("data-ln-router-hydrate"),hasChildren:!!w&&w.children.length>0,mountedTemplate:w&&W.get(w)||null})}const f=ft(d,{isHydration:!!t.isHydration,hasPrimaryRegion:c,primaryMatch:a});if(f.notFound){_e(document.body,"ln-router:not-found",{path:n});return}if(Le(o||document.body,"ln-router:before-navigate",{from:S,to:s,path:n,params:a?a.params:{},query:i}).defaultPrevented)return;t.historyAction==="push"?window.history.pushState(null,"",s):t.historyAction==="replace"&&window.history.replaceState(null,"",s);const k=function(){for(const u of f.clears)Se(u.targetEl),u.targetEl.replaceChildren(),W.delete(u.targetEl);for(const u of f.swaps){if((u.isPending||!u.targetEl||!document.contains(u.targetEl))&&(u.targetEl=u.regionKey==="__primary__"?o:document.getElementById(u.regionKey)),!u.targetEl){console.warn(`[ln-router] Target element #${u.regionKey} could not be resolved`);continue}if(u.skipMount||(Se(u.targetEl),u.targetEl.replaceChildren(u.match.route.templateNode.content.cloneNode(!0))),W.set(u.targetEl,u.match.route.templateNode),f.owner&&u.regionKey===f.owner.regionKey){if(u.match.route.title){let h=u.match.route.title;if(u.match.params)for(const[w,m]of Object.entries(u.match.params))h=h.replace(new RegExp("\\{\\{\\s*"+w+"\\s*\\}\\}","g"),m);document.title=h}if(!t.isHydration){u.targetEl.hasAttribute("tabindex")||u.targetEl.setAttribute("tabindex","-1");const h=u.targetEl.querySelector("h1, h2, h3, h4, h5, h6");h?(h.setAttribute("tabindex","-1"),h.focus()):u.targetEl.focus(),u.regionKey==="__primary__"&&u.targetEl.scrollIntoView({block:"start",behavior:"instant"})}}_e(u.targetEl,"ln-router:navigated",{path:n,fullPath:s,base:r,params:u.match.params,query:i,route:u.match.route,target:u.targetEl,region:u.regionKey})}S=n,ge=s,be=r,ye=i,Ce=a?a.route:null,me=a?a.params:{},we=new Map(Array.from(l.entries()).map(([u,h])=>[u,h?{route:h.route,params:h.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(k):k()}function pt(e){const t=e.target.closest("a");if(!t||!Ie(e,t))return;const n=t.getAttribute("href"),{path:i}=K(n);for(const r of g.values())if(ve(i,r.sorted)){e.preventDefault(),A(n,{historyAction:"push"});return}}function gt(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++){const s=n[r];if(e[s]!==t[s])return!1}return!0}function bt(){const e=window.location.pathname+window.location.search,t=F.current();if(t&&t.path!=null){const n=K(e);if(t.path===n.path&>(t.query,n.query))return}A(e,{historyAction:"skip"})}function ke(){pe||(pe=!0,y(function(){document.addEventListener("click",pt),window.addEventListener("popstate",bt),j=!0;const e=window.location.pathname+window.location.search+window.location.hash;A(e,{historyAction:"replace",isHydration:!0}),j=!1},"ln-router"))}function xe(e){const t=e.getAttribute(N);if(!t)return;const n=e.getAttribute("data-ln-route-target")||null;if(n==="__primary__"){console.warn(`[ln-router] "__primary__" is a reserved region key and cannot be used as data-ln-route-target. Route "${t}" rejected.`);return}const i=n||"__primary__";g.has(i)||g.set(i,{routes:new Map,sorted:[]});const r=g.get(i);if(r.routes.has(t)){console.warn(`[ln-router] Duplicate route pattern registered: "${t}" in region "${i}"`);return}const s=e.getAttribute("data-ln-route-title"),l=t.split("/").filter(Boolean),a={pattern:t,segments:l,target:n,title:s,templateNode:e},o=P(i);o&&o.contains(e)&&console.warn(`[ln-router] Route template with pattern "${t}" is declared inside its own outlet element:`,e),r.routes.set(t,a),r.sorted=Array.from(r.routes.values()).sort(Ae)}function Ee(e){const t=e.getAttribute(N);if(!t)return;const i=e.getAttribute("data-ln-route-target")||null||"__primary__",r=g.get(i);r&&(r.routes.delete(t),r.sorted=Array.from(r.routes.values()).sort(Ae),r.routes.size===0&&g.delete(i))}function Oe(e){return this.dom=e,xe(e),this}return Oe.prototype.destroy=function(){Ee(this.dom),delete this.dom[he]},ue(N,he,Oe,"ln-router",{attributes:wt,onInit:function(){g.size>0&&ke()}}),x.router=F,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
|
|
@@ -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 A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){o=t[n];break}if(!A(o))return}e.apply(console,t)}}function F(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Y(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(n),n}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),o=t&&t.exclude,n={},s=e.elements,l={};if(i)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")i&&l[r.name]===1?n[r.name]=r.checked:(n[r.name]||(n[r.name]=[]),r.checked&&n[r.name].push(r.value));else if(r.type==="radio")r.checked&&(n[r.name]=r.value);else if(r.type==="select-multiple"){n[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&n[r.name].push(r.options[a].value)}else if(i&&r.type==="hidden")n[r.name]=r.value;else if(i&&(r.type==="number"||r.type==="range")){const a=Number(r.value);n[r.name]=r.value===""||isNaN(a)?null:a}else n[r.name]=r.value}return n}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const i=e.elements,o=[],n={};for(let s=0;s<i.length;s++){const l=i[s];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<i.length;s++){const l=i[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(n[l.name]>1){const a=String(r).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=te(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<l.options.length;a++)l.options[a].selected=r.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const N={};function oe(e,t){N[e]=t}function re(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];$[i]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ce(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=v[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const u=r[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 n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const u=r[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 ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<i.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[o],t??null),i[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)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function M(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const s=i.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let s=0;s<n.length;s++){const l=n[s],c=l.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ue(e,t,i,o,n,s){const l={};for(let r=0;r<e.children.length;r++){const a=e.children[r],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],u=String(o(a));let d=l[u];if(d)n(d,a,r);else{const f=ce(i,s);if(!f||(M(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),n(d,a,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=ue);function k(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function R(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function x(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const n=o.trim().toLowerCase();return!(n==="false"||n==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const S=new Map;function j(e,t){const i=(e?e.join("|"):"")+"::"+t;if(S.has(i))return S.get(i);const o=new Set(e||[]),n=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return S.set(i,n),n}function U(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function V(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function H(e,t,i,o,n){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{n?console.warn(r,n):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${i}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${i}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,i){for(const o in i){const[n,s,l]=i[o];Object.defineProperty(e,o,{get:function(){return n(t,s,l)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let n=o.read;if(!n&&o.type)switch(o.type){case"enum":n=j(o.values,o.fallback);break;case"integer":n=R;break;case"float":n=U;break;case"boolean":n=x;break;case"list":n=W;break;case"json":n=V;break;case"string":default:n=k;break}n||(n=k),t[o.prop]=[n,i,o.fallback]}return t}function we(e){const t={};for(const i in e){const o=e[i];o&&o.effect&&(t[i]=o.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=de,window.lnCore.attrSpec=fe,window.lnCore.attrStr=k,window.lnCore.attrInt=R,window.lnCore.attrBool=x,window.lnCore.attrList=W,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);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(i){console.error("["+t.attribute+"] init failed",e,i)}}}function K(e,t,i,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(s)&&m(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)m(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(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 Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=Q(),i=e.observed||[];for(let o=0;o<i.length;o++){const n=i[o];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const n=t.byDeclaredAttr.get(o);n.some(s=>s.componentTag===e.componentTag)||n.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=he(e);if(o===null)t.reactiveWildcard.push(e);else for(const n of o)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,o){for(let n=0;n<e.length;n++){const s=e[n];if(!t[s.attribute])continue;const l=s.effects&&s.effects[i];l?l(t,i,o):s.onAttrChange&&(!s.declared||s.declared.has(i))&&s.onAttrChange(t,i,o)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=Q(),n=o.byAttr.get(t),s=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!n&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&A(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let a=0;a<c.length;a++)H(c[a].spec,r,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(i||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const c=o.byReactive.get(t);c&&J(c,l,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,l,t,e.oldValue)}if(n)for(let c=0;c<n.length;c++){const r=n[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(K(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(t[i])}catch(o){console.error("[ln-core] mutation handler failed",t[i].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 E(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ce(e){const t=_();if(!t.length)return;const i=e.target;if(i){const o=i.nodeType===1?i:i.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const s=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;l&&n.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l];if(c.selector&&c.attribute&&c.ComponentFn){if(!s)n.matches&&n.matches(c.query)&&m(n,c);else if(n.matches&&n.matches(c.query)&&m(n,c),n.querySelectorAll){const r=n.querySelectorAll(c.query);for(let a=0;a<r.length;a++)m(r[a],c)}}c.onInit&&c.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l],r=c.query;if(r){if(!s)n.matches&&n.matches(r)&&E(n,c);else if(n.matches&&n.matches(r)&&E(n,c),n.querySelectorAll){const a=n.querySelectorAll(r);for(let u=0;u<a.length;u++)E(a[u],c)}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{Ce(o)}catch(n){console.error("[ln-core] lifecycle handler failed",o.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){_().push(e),P()}function z(e,t,i,o,n={}){const s=n.extraAttributes||[],l=n.onAttributeChange||null,c=n.onSubtreeChange||null,r=n.onInit||null,a=n.onAttrChange||null,u=n.effects||null,d=n.attributes||null,f=d?we(d):u,h=d?new Set(Object.keys(d)):null,g=n.persist||null;function w(D){const p=D||document.body;if(K(p,e,t,i),d&&T())for(const y in d){const Te=d[y],L=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&L.push(p);for(let I=0;I<L.length;I++){const q=L[I];A(q)&&H(Te,q.getAttribute(y),y,o,q)}}r&&r(p)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let p;for(;(p=D.exec(e))!==null;)b.push(p[1])}else b.push(e);ge({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:i,onInit:r,observed:b.concat(s),onAttributeChange:l,onAttrChange:a,effects:f,declared:h,persist:g}),ye();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=n.subtreeQuery||(Ie?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:i,onInit:r,onSubtreeChange:c,query:qe}),P(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ae);function X(){be()>0?pe(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),w}function G(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,i={},o=G(t);if(!o)return i;const n=o.split("&");for(let s=0;s<n.length;s++){const l=n[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(r)try{i[r]=decodeURIComponent(a)}catch{i[r]=a}}return i}function ve(e){if(!e)return null;const t=O();return e in t?t[e]:null}function ke(e,t){if(!e)return;const i=O();t==null?delete i[e]:i[e]=String(t);const n=Object.keys(i).map(function(s){const l=i[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");G(location.hash)!==n&&(location.hash=n)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.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 _e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(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 i=e.slice(0,t),o=e.slice(t+1),n=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:i,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ve,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=_e,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=De);function Le(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Le),(function(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const i={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function o(n){if(n[t])return n[t];if(!(!n||n.tagName!=="A"&&n.tagName!=="BUTTON"))return n[t]=this,this.dom=n,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}o.prototype._handleClick=function(n){if(this.dom.tagName==="A"&&(n.ctrlKey||n.metaKey||n.shiftKey||n.altKey||n.button!==0))return;let s=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(s||(s=(this.dom.getAttribute("href")||"").trim()),!s||s==="#")return;!s.startsWith("#")&&!s.startsWith(".")&&!s.startsWith("[")&&(s="#"+s);let l=null;try{l=document.querySelector(s)}catch{const g=s.replace(/^#/,"");l=document.getElementById(g)}if(!l)return;n.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const g=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(g);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(Y(this.dom,"ln-scroll:before-scroll",{target:l,link:this.dom,href:s}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(l.scrollIntoView({behavior:a,block:u}),x(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",s)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),g=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=l.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&l.getAttribute("tabindex")!==null&&(w=l),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},g)}F(this.dom,"ln-scroll:scrolled",{target:l,link:this.dom,href:s})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},z(e,t,o,"ln-scroll",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!A(l))return}e.apply(console,t)}}function N(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 te(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),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 re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const 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=re(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=ie,window.lnCore.serializeForm=oe,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,C(function(){new MutationObserver(function(){N(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];R[r]=t}function ue(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=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const v={};function de(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=v[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(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 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)B(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(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 we(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=de(r,s);if(!f||(M(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=M,window.lnCore.fill=B,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function k(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function W(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function x(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 j(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const _=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(_.has(r))return _.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 _.set(r,o),o}function V(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function H(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function K(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 he(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 be(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=W;break;case"float":o=V;break;case"boolean":o=x;break;case"list":o=j;break;case"json":o=H;break;case"string":default:o=k;break}o||(o=k),t[l.prop]=[o,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=k,window.lnCore.attrInt=W,window.lnCore.attrBool=x,window.lnCore.attrList=j,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);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 Q(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 me(){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 J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=J(),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=ge(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 P(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 Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=J(),o=l.byAttr.get(t),s=F()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&A(i)){const c=l.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||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&P(c,i,t,e.oldValue),l.reactiveWildcard.length&&P(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):(Q(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,C(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 ke(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){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 z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{ke(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){S().push(e),e.onSubtreeChange&&e.query&&E().push(e),z()}function G(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?pe(d):u,h=d?new Set(Object.keys(d)):null,g=o.persist||null;function w(L){const p=L||document.body;if(Q(p,e,t,r),d&&F())for(const y in d){const Ne=d[y],I=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&I.push(p);for(let q=0;q<I.length;q++){const T=I[q];A(T)&&K(Ne,T.getAttribute(y),y,l,T)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let p;for(;(p=L.exec(e))!==null;)b.push(p[1])}else b.push(e);Ce({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:b.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:h,persist:g}),ve();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Y=o.subtreeQuery||(Fe?e:"["+e+"]"),Z={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Y};S().push(Z),c&&Y&&E().push(Z),z(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=xe);function ee(){me()>0?ye(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ee):ee(),w}function X(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,r={},l=X(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 _e(e){if(!e)return null;const t=D();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=D();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("&");X(location.hash)!==o&&(location.hash=o)}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 De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(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),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=D,window.lnCore.hashGet=_e,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=De,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=qe);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te),(function(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const r={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function l(o){if(o[t])return o[t];if(!(!o||o.tagName!=="A"&&o.tagName!=="BUTTON"))return o[t]=this,this.dom=o,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}l.prototype._handleClick=function(o){if(this.dom.tagName==="A"&&(o.ctrlKey||o.metaKey||o.shiftKey||o.altKey||o.button!==0))return;let s=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(s||(s=(this.dom.getAttribute("href")||"").trim()),!s||s==="#")return;!s.startsWith("#")&&!s.startsWith(".")&&!s.startsWith("[")&&(s="#"+s);let i=null;try{i=document.querySelector(s)}catch{const g=s.replace(/^#/,"");i=document.getElementById(g)}if(!i)return;o.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const g=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(g);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(te(this.dom,"ln-scroll:before-scroll",{target:i,link:this.dom,href:s}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(i.scrollIntoView({behavior:a,block:u}),x(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",s)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),g=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=i.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&i.getAttribute("tabindex")!==null&&(w=i),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},g)}N(this.dom,"ln-scroll:scrolled",{target:i,link:this.dom,href:s})},l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},G(e,t,l,"ln-scroll",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function V(){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 o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!q(r))return}e.apply(console,t)}}function ue(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function de(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function fe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function he(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},c=e.elements,l={};if(n)for(let s=0;s<c.length;s++){const i=c[s];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<c.length;s++){const i=c[s];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&l[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let f=0;f<i.options.length;f++)i.options[f].selected&&o[i.name].push(i.options[f].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const f=Number(i.value);o[i.name]=i.value===""||isNaN(f)?null:f}else o[i.name]=i.value}return o}function we(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function pe(e,t){const n=e.elements,r=[],o={};for(let c=0;c<n.length;c++){const l=n[c];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<n.length;c++){const l=n[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const i=t[s];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(o[l.name]>1){const f=String(i).split(",").map(function(w){return w.trim()});l.checked=f.indexOf(l.value)!==-1}else l.checked=we(i);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let f=0;f<l.options.length;f++)l.options[f].selected=i.indexOf(l.options[f].value)!==-1;r.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pe,window.lnCore.serializeForm=he,window.lnCore.resolveFormMethod=fe);const K={};function ge(e,t){K[e]=t}function be(e){return K[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ge,window.lnCore.getDataMapper=be);function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){ue(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function ye(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];Q[n]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ye,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=me);const D={};function Ae(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const s=r[l],i=s.getAttribute("data-ln-attr").split(",");for(let f=0;f<i.length;f++){const w=i[f].trim().split(":");if(w.length!==2)continue;const p=w[0].trim(),m=w[1].trim();t[m]!=null&&s.setAttribute(p,t[m])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],i=s.getAttribute("data-ln-class").split(",");for(let f=0;f<i.length;f++){const w=i[f].trim().split(":");if(w.length!==2)continue;const p=w[0].trim(),m=w[1].trim();m in t&&s.classList.toggle(p,!!t[m])}}return e}function _e(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function J(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const c=n.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const r=function(c,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let c=0;c<o.length;c++){const l=o[c],s=l.attributes;for(let i=0;i<s.length;i++){const f=s[i];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ve(e,t,n,r,o,c){const l={};for(let i=0;i<e.children.length;i++){const f=e.children[i],w=f.getAttribute("data-ln-render-key");w&&(l[w]=f)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const f=t[i],w=String(r(f));let p=l[w];if(p)o(p,f,i);else{const m=Ae(n,c);if(!m||(J(m,f),p=m.firstElementChild,!p))continue;p.setAttribute("data-ln-render-key",w),o(p,f,i)}s.appendChild(p)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=z,window.lnCore.lnFill=_e,window.lnCore.renderList=ve);function I(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function P(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const r=new Set(e||[]),o=function(c,l){const s=c.getAttribute(l);return s!==null&&r.has(s)?s:t};return R.set(n,o),o}function Z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ee(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function te(e,t,n,r,o){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 s=i=>{o?console.warn(i,o):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${c}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${c}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${c}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ne(e,t,n){for(const r in n){const[o,c,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,c,l)},enumerable:!0,configurable:!0})}return e}function re(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Y(r.values,r.fallback);break;case"integer":o=P;break;case"float":o=Z;break;case"boolean":o=G;break;case"list":o=X;break;case"json":o=ee;break;case"string":default:o=I;break}o||(o=I),t[r.prop]=[o,n,r.fallback]}return t}function Se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ne,window.lnCore.attrSpec=re,window.lnCore.attrStr=I,window.lnCore.attrInt=P,window.lnCore.attrBool=G,window.lnCore.attrList=X,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function x(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function oe(e,t,n,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(c)&&x(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let i=0;i<s.length;i++)x(s[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function B(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 ie(){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=ie(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];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 r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(c=>c.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function le(e,t,n,r){for(let o=0;o<e.length;o++){const c=e[o];if(!t[c.attribute])continue;const l=c.effects&&c.effects[n];l?l(t,n,r):c.onAttrChange&&(!c.declared||c.declared.has(n))&&c.onAttrChange(t,n,r)}}function Te(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ie(),o=r.byAttr.get(t),c=V()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&q(l)){const s=r.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let f=0;f<s.length;f++)te(s[f].spec,i,t,s[f].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const s=r.byReactive.get(t);s&&le(s,l,t,e.oldValue),r.reactiveWildcard.length&&le(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(oe(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function Ie(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Te(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function N(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Le(e){const t=N();if(!t.length)return;const n=e.target;if(n){const r=n.nodeType===1?n:n.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const o=t[r];if(o.onSubtreeChange&&o.query){const c=o.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&o.onSubtreeChange(l,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)o.matches&&o.matches(s.query)&&x(o,s);else if(o.matches&&o.matches(s.query)&&x(o,s),o.querySelectorAll){const i=o.querySelectorAll(s.query);for(let f=0;f<i.length;f++)x(i[f],s)}}s.onInit&&s.onInit(o)}}}for(let r=0;r<e.removedNodes.length;r++){const o=e.removedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l],i=s.query;if(i){if(!c)o.matches&&o.matches(i)&&F(o,s);else if(o.matches&&o.matches(i)&&F(o,s),o.querySelectorAll){const f=o.querySelectorAll(i);for(let w=0;w<f.length;w++)F(f[w],s)}}}}}}function se(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Le(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){N().push(e),se()}function $(e,t,n,r,o={}){const c=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,i=o.onInit||null,f=o.onAttrChange||null,w=o.effects||null,p=o.attributes||null,m=p?Se(p):w,O=p?new Set(Object.keys(p)):null,W=o.persist||null;function _(d){const a=d||document.body;if(oe(a,e,t,n),p&&V())for(const u in p){const h=p[u],g=Array.from(a.querySelectorAll("["+u+"]"));a.matches&&a.matches("["+u+"]")&&g.push(a);for(let A=0;A<g.length;A++){const b=g[A];q(b)&&te(h,b.getAttribute(u),u,r,b)}}i&&i(a)}const v=[];if(e.indexOf("[")!==-1){const d=/\[([\w-]+)/g;let a;for(;(a=d.exec(e))!==null;)v.push(a[1])}else v.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:p,ComponentFn:n,onInit:i,observed:v.concat(c),onAttributeChange:l,onAttrChange:f,effects:m,declared:O,persist:W}),Ie();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,U=o.subtreeQuery||(S?e:"["+e+"]");N().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:s,query:U}),se(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=$,window.lnCore.observeLifecycle=Oe);function E(){Ee()>0?B(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E):E(),_}function qe(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ce(e){return(e||"").replace(/^#/,"")}function M(e){const t=e===void 0?location.hash:e,n={},r=ce(t);if(!r)return n;const o=r.split("&");for(let c=0;c<o.length;c++){const l=o[c];if(!l)continue;const s=l.indexOf(":"),i=s>-1?l.slice(0,s):l,f=s>-1?l.slice(s+1):"";if(i)try{n[i]=decodeURIComponent(f)}catch{n[i]=f}}return n}function H(e){if(!e)return null;const t=M();return e in t?t[e]:null}function ae(e,t){if(!e)return;const n=M();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(c){const l=n[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");ce(location.hash)!==o&&(location.hash=o)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function j(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ne(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=M,window.lnCore.hashGet=H,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=j,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=Be,window.lnCore.hashFilterEncode=Ne,window.lnCore.hashFilterDecode=Fe);function $e(){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=$e);function L(e){return String(e||"").trim().toLowerCase()}function Me(e){const t=L(e);return t?t.split(/\s+/).filter(Boolean):[]}function He(e){if(e==null)return null;const t=String(e).split(",").map(n=>n.trim()).filter(Boolean);return t.length?t:null}function je(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=String(e).toLowerCase();for(let r=0;r<t.length;r++)if(n.indexOf(t[r])===-1)return!1;return!0}function We(e){return!e||e.length===0?"":e.join(" ").replace(/\s+/g," ").trim().toLowerCase()}(function(){const e="data-ln-search",t="lnSearch",n="data-ln-search-for",r="lnSearchControl",o="data-ln-search-items",c="data-ln-search-fields",l="data-ln-search-exclude",s="data-ln-search-hide",i="data-ln-hash";if(window[t]!==void 0)return;const f={"data-ln-search":{type:"string",effect:E,description:"Active search query term on target element or container"},"data-ln-hash":{type:"string",effect:E,description:"URL hash routing key for search state persistence"},"data-ln-search-for":{prop:"targetId",type:"string",read:I,fallback:null,description:"Target table or list element ID that this input controls"},"data-ln-search-fields":{type:"list",description:"Comma-separated field names to include in client search"},"data-ln-search-items":{type:"string",description:"CSS selector matching searchable child items"},"data-ln-search-exclude":{type:"string",description:"CSS selector matching child items to exclude from search"},"data-ln-search-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-search-clear-for":{type:"trigger",description:"Click trigger to clear search input for target"}},w=re(f);function p(d){const a=j(d,"search");if(a)return a;if(d.id){const u=document.querySelector("["+n+'="'+d.id+'"]');if(u){const h=j(u,"search");if(h)return h}}return null}function m(d){return d.matches("input, textarea")?d:d.querySelector("input, textarea")}function O(d,a){const u=d.childNodes;for(let h=0;h<u.length;h++){const g=u[h];if(g.nodeType===3){a.push(g.nodeValue);continue}g.nodeType===1&&(g.hasAttribute(l)||O(g,a))}}function W(d){if(d._lnSearchText!==void 0)return d._lnSearchText;const a=[];O(d,a);const u=We(a);return d._lnSearchText=u,u}function _(d,a){if(!d.id)return;const u=document.querySelectorAll("["+n+'="'+d.id+'"]');for(const h of u){const g=m(h);g&&g.value!==a&&(g.value=a)}}function v(d){this.dom=d,this.term=d.getAttribute(e)||"",this._destroyed=!1;const a=this;return this.nsKey=p(d),this.hashEnabled=!!this.nsKey,this._queueApply=qe(function(){a._destroyed||a._apply()}),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const u=H(a.nsKey),h=a.dom.getAttribute(e)||"";u!==null&&u!==h?a.dom.setAttribute(e,u):u===null&&h!==""&&a.dom.setAttribute(e,"")},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),B(function(){if(!a._destroyed){if(a.hashEnabled){const u=H(a.nsKey);if(u!==null&&u!==a.term){a.term=u,a.dom.setAttribute(e,u),_(a.dom,u),a._apply();return}}L(a.term)&&(_(a.dom,a.term),a._apply())}}),this}v.prototype._apply=function(){const d=this.dom,a=L(this.term),u=Me(a);this.hashEnabled&&ae(this.nsKey,this.term?this.term:null);const h=He(d.getAttribute(c));if(de(d,"ln-search:change",{term:a,tokens:u,targetId:d.id,fields:h}).defaultPrevented)return;const A=d.getAttribute(o),b=A?d.querySelectorAll(A):d.children;for(let y=0;y<b.length;y++){const C=b[y];if(C.removeAttribute(s),C.hasAttribute(l)||u.length===0)continue;const k=W(C);je(k,u)||C.setAttribute(s,"true")}},v.prototype.destroy=function(){this.dom[t]&&(this._destroyed=!0,this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function S(d){if(this.dom=d,ne(this,d,w),this.input=m(d),this._attachHandler(),this.input&&this.input.value.trim()){const a=this;B(function(){const u=document.getElementById(a.targetId);u&&((u.getAttribute(e)||"").trim()||a._write(a.input.value))})}return this}S.prototype._write=function(d){const a=document.getElementById(this.targetId);a&&a.getAttribute(e)!==d&&a.setAttribute(e,d)},S.prototype._attachHandler=function(){if(!this.input)return;const d=this;this._onInput=function(){d._write(d.input.value)},this.input.addEventListener("input",this._onInput)},S.prototype.destroy=function(){this.dom[r]&&(this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),delete this.dom[r])};function U(d){const a=d.getAttribute("data-ln-search-clear-for");if(a){const b=document.getElementById(a),y=document.querySelector("["+n+'="'+a+'"]'),C=y?m(y):null;return{target:b,input:C}}const u=d.closest("["+e+"]");if(u){const b=u.id?document.querySelector("["+n+'="'+u.id+'"]'):null,y=b?m(b):null;return{target:u,input:y}}const h=d.closest("[data-ln-table-source], [data-ln-list-source]");if(h){const b=h.getAttribute("data-ln-table-source")||h.getAttribute("data-ln-list-source"),y=b?document.getElementById(b):null;if(y&&y.hasAttribute(e)){const C=document.querySelector("["+n+'="'+b+'"]'),k=C?m(C):null;return{target:y,input:k}}}const g=d.closest("["+n+"]");if(g){const b=g.getAttribute(n),y=b?document.getElementById(b):null,C=m(g);return{target:y,input:C}}const A=d.parentElement;if(A){const b=A.querySelector("["+n+"]");if(b){const y=b.getAttribute(n),C=y?document.getElementById(y):null,k=m(b);return{target:C,input:k}}}return{target:null,input:null}}document.addEventListener("click",function(d){const a=d.target.closest("[data-ln-search-clear], [data-ln-search-clear-for]");if(!a)return;const u=U(a);!u.target&&!u.input||(d.preventDefault(),u.input&&(u.input.value="",u.input.focus()),u.target&&u.target.setAttribute(e,""))});function E(d,a){const u=d[t];if(!u||u._destroyed)return;if(a===i){u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=p(d),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);return}const h=d.getAttribute(e)||"";h!==u.term&&(u.term=h,_(d,h),u._apply())}$(e,t,v,"ln-search",{attributes:f,onSubtreeChange:function(d,a){const u=a.target;u&&u._lnSearchText!==void 0&&delete u._lnSearchText,u&&u.parentElement&&u.parentElement._lnSearchText!==void 0&&delete u.parentElement._lnSearchText;const h=d[t];if(h&&!h._destroyed&&L(h.term)&&(a.addedNodes.length>0||a.removedNodes.length>0)){for(let g=0;g<a.addedNodes.length;g++){const A=a.addedNodes[g];A._lnSearchText!==void 0&&delete A._lnSearchText}h._queueApply()}},persist:{attr:e,hashActive:function(d){return!!p(d)}}}),$(n,r,S,"ln-search-control")})()})();
|
|
1
|
+
(function(){"use strict";function K(){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 D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!D(o))return}e.apply(console,t)}}function fe(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function he(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let f=0;f<r.options.length;f++)r.options[f].selected&&i[r.name].push(r.options[f].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const f=Number(r.value);i[r.name]=r.value===""||isNaN(f)?null:f}else i[r.name]=r.value}return i}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function be(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const f=String(r).split(",").map(function(p){return p.trim()});l.checked=f.indexOf(l.value)!==-1}else l.checked=ge(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let f=0;f<l.options.length;f++)l.options[f].selected=r.indexOf(l.options[f].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=be,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const Q={};function me(e,t){Q[e]=t}function ye(e){return Q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ye);function Ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){fe(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Ae(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function _e(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ae,window.lnCore.getLocaleFallback=_e,window.lnCore.ensureLocaleObserver=Ce);const R={};function ve(e,t){R[e]||(R[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=R[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let f=0;f<r.length;f++){const p=r[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),y=p[1].trim();t[y]!=null&&c.setAttribute(w,t[y])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let f=0;f<r.length;f++){const p=r[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),y=p[1].trim();y in t&&c.classList.toggle(w,!!t[y])}}return e}function Se(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)J(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const f=c[r];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function xe(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const f=e.children[r],p=f.getAttribute("data-ln-render-key");p&&(l[p]=f)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const f=t[r],p=String(o(f));let w=l[p];if(w)i(w,f,r);else{const y=ve(n,s);if(!y||(P(y,f),w=y.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",p),i(w,f,r)}c.appendChild(w)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=J,window.lnCore.lnFill=Se,window.lnCore.renderList=xe);function I(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function G(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function X(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function Y(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const B=new Map;function Z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(B.has(n))return B.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return B.set(n,i),i}function ee(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function te(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ne(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=Z(o.values,o.fallback);break;case"integer":i=G;break;case"float":i=ee;break;case"boolean":i=X;break;case"list":i=Y;break;case"json":i=te;break;case"string":default:i=I;break}i||(i=I),t[o.prop]=[i,n,o.fallback]}return t}function Ee(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ke(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=I,window.lnCore.attrInt=G,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ie(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&E(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)E(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function N(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 le(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ie(e){const t=le(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ke(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function se(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Le(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=le(),i=o.byAttr.get(t),s=K()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&D(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let f=0;f<c.length;f++)ne(c[f].spec,r,t,c[f].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&se(c,l,t,e.oldValue),o.reactiveWildcard.length&&se(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(ie(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function $(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function qe(e){const t=F();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=$();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],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 i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const f=s.querySelectorAll(r.query);for(let p=0;p<f.length;p++)E(f[p],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],f=r.query;if(f){if(!l)s.matches&&s.matches(f)&&H(s,r);else if(s.matches&&s.matches(f)&&H(s,r),s.querySelectorAll){const p=s.querySelectorAll(f);for(let w=0;w<p.length;w++)H(p[w],r)}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{qe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function De(e){F().push(e),e.onSubtreeChange&&e.query&&$().push(e),ce()}function M(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,f=i.onAttrChange||null,p=i.effects||null,w=i.attributes||null,y=w?Ee(w):p,O=w?new Set(Object.keys(w)):null,V=i.persist||null;function _(u){const a=u||document.body;if(ie(a,e,t,n),w&&K())for(const h in w){const m=w[h],A=Array.from(a.querySelectorAll("["+h+"]"));a.matches&&a.matches("["+h+"]")&&A.push(a);for(let g=0;g<A.length;g++){const b=A[g];D(b)&&ne(m,b.getAttribute(h),h,o,b)}}r&&r(a)}const v=[];if(e.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let a;for(;(a=u.exec(e))!==null;)v.push(a[1])}else v.push(e);Ie({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:v.concat(s),onAttributeChange:l,onAttrChange:f,effects:y,declared:O,persist:V}),Oe();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,q=i.subtreeQuery||(S?e:"["+e+"]"),k={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:q};F().push(k),c&&q&&$().push(k),ce(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=M,window.lnCore.observeLifecycle=De);function d(){Te()>0?N(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d):d(),_}function Re(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ae(e){return(e||"").replace(/^#/,"")}function j(e){const t=e===void 0?location.hash:e,n={},o=ae(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,f=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(f)}catch{n[r]=f}}return n}function W(e){if(!e)return null;const t=j();return e in t?t[e]:null}function ue(e,t){if(!e)return;const n=j();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ae(location.hash)!==i&&(location.hash=i)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function U(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ne(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function He(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=j,window.lnCore.hashGet=W,window.lnCore.hashSet=ue,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=U,window.lnCore.hashSortEncode=Ne,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=He);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 L(e){return String(e||"").trim().toLowerCase()}function je(e){const t=L(e);return t?t.split(/\s+/).filter(Boolean):[]}function We(e){if(e==null)return null;const t=String(e).split(",").map(n=>n.trim()).filter(Boolean);return t.length?t:null}function Ue(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=String(e).toLowerCase();for(let o=0;o<t.length;o++)if(n.indexOf(t[o])===-1)return!1;return!0}function Ve(e){return!e||e.length===0?"":e.join(" ").replace(/\s+/g," ").trim().toLowerCase()}(function(){const e="data-ln-search",t="lnSearch",n="data-ln-search-for",o="lnSearchControl",i="data-ln-search-items",s="data-ln-search-fields",l="data-ln-search-exclude",c="data-ln-search-hide",r="data-ln-hash";if(window[t]!==void 0)return;const f={"data-ln-search":{type:"string",effect:k,description:"Active search query term on target element or container"},"data-ln-hash":{type:"string",effect:k,description:"URL hash routing key for search state persistence"},"data-ln-search-for":{prop:"targetId",type:"string",read:I,fallback:null,description:"Target table or list element ID that this input controls"},"data-ln-search-fields":{type:"list",description:"Comma-separated field names to include in client search"},"data-ln-search-items":{type:"string",description:"CSS selector matching searchable child items"},"data-ln-search-exclude":{type:"string",description:"CSS selector matching child items to exclude from search"},"data-ln-search-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-search-clear-for":{type:"trigger",description:"Click trigger to clear search input for target"}},p=oe(f);function w(d){const u=U(d,"search");if(u)return u;if(d.id){const a=document.querySelector("["+n+'="'+d.id+'"]');if(a){const h=U(a,"search");if(h)return h}}return null}function y(d){return d.matches("input, textarea")?d:d.querySelector("input, textarea")}function O(d,u){const a=d.childNodes;for(let h=0;h<a.length;h++){const m=a[h];if(m.nodeType===3){u.push(m.nodeValue);continue}m.nodeType===1&&(m.hasAttribute(l)||O(m,u))}}function V(d){if(d._lnSearchText!==void 0)return d._lnSearchText;const u=[];O(d,u);const a=Ve(u);return d._lnSearchText=a,a}function _(d,u){if(!d.id)return;const a=document.querySelectorAll("["+n+'="'+d.id+'"]');for(const h of a){const m=y(h);m&&m.value!==u&&(m.value=u)}}function v(d){this.dom=d,this.term=d.getAttribute(e)||"",this._destroyed=!1;const u=this;return this.nsKey=w(d),this.hashEnabled=!!this.nsKey,this._queueApply=Re(function(){u._destroyed||u._apply()}),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const a=W(u.nsKey),h=u.dom.getAttribute(e)||"";a!==null&&a!==h?u.dom.setAttribute(e,a):a===null&&h!==""&&u.dom.setAttribute(e,"")},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),N(function(){if(!u._destroyed){if(u.hashEnabled){const a=W(u.nsKey);if(a!==null&&a!==u.term){u.term=a,u.dom.setAttribute(e,a),_(u.dom,a),u._apply();return}}L(u.term)&&(_(u.dom,u.term),u._apply())}}),this}v.prototype._apply=function(){const d=this.dom,u=L(this.term),a=je(u);this.hashEnabled&&ue(this.nsKey,this.term?this.term:null);const h=We(d.getAttribute(s));if(he(d,"ln-search:change",{term:u,tokens:a,targetId:d.id,fields:h}).defaultPrevented)return;const A=d.getAttribute(i),g=A?d.querySelectorAll(A):d.children;for(let b=0;b<g.length;b++){const C=g[b];if(C.hasAttribute(l)){C.hasAttribute(c)&&C.removeAttribute(c);continue}const x=a.length>0&&!Ue(V(C),a),de=C.hasAttribute(c);x&&!de?C.setAttribute(c,"true"):!x&&de&&C.removeAttribute(c)}},v.prototype.destroy=function(){this.dom[t]&&(this._destroyed=!0,this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function S(d){if(this.dom=d,re(this,d,p),this.input=y(d),this._attachHandler(),this.input&&this.input.value.trim()){const u=this;N(function(){const a=document.getElementById(u.targetId);a&&((a.getAttribute(e)||"").trim()||u._write(u.input.value))})}return this}S.prototype._write=function(d){const u=document.getElementById(this.targetId);u&&u.getAttribute(e)!==d&&u.setAttribute(e,d)},S.prototype._attachHandler=function(){if(!this.input)return;const d=this;this._onInput=function(){d._write(d.input.value)},this.input.addEventListener("input",this._onInput)},S.prototype.destroy=function(){this.dom[o]&&(this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),delete this.dom[o])};function q(d){const u=d.getAttribute("data-ln-search-clear-for");if(u){const g=document.getElementById(u),b=document.querySelector("["+n+'="'+u+'"]'),C=b?y(b):null;return{target:g,input:C}}const a=d.closest("["+e+"]");if(a){const g=a.id?document.querySelector("["+n+'="'+a.id+'"]'):null,b=g?y(g):null;return{target:a,input:b}}const h=d.closest("[data-ln-table-source], [data-ln-list-source]");if(h){const g=h.getAttribute("data-ln-table-source")||h.getAttribute("data-ln-list-source"),b=g?document.getElementById(g):null;if(b&&b.hasAttribute(e)){const C=document.querySelector("["+n+'="'+g+'"]'),x=C?y(C):null;return{target:b,input:x}}}const m=d.closest("["+n+"]");if(m){const g=m.getAttribute(n),b=g?document.getElementById(g):null,C=y(m);return{target:b,input:C}}const A=d.parentElement;if(A){const g=A.querySelector("["+n+"]");if(g){const b=g.getAttribute(n),C=b?document.getElementById(b):null,x=y(g);return{target:C,input:x}}}return{target:null,input:null}}document.addEventListener("click",function(d){const u=d.target.closest("[data-ln-search-clear], [data-ln-search-clear-for]");if(!u)return;const a=q(u);!a.target&&!a.input||(d.preventDefault(),a.input&&(a.input.value="",a.input.focus()),a.target&&a.target.setAttribute(e,""))});function k(d,u){const a=d[t];if(!a||a._destroyed)return;if(u===r){a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=w(d),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange);return}const h=d.getAttribute(e)||"";h!==a.term&&(a.term=h,_(d,h),a._apply())}M(e,t,v,"ln-search",{attributes:f,onSubtreeChange:function(d,u){const a=u.target;a&&a._lnSearchText!==void 0&&delete a._lnSearchText,a&&a.parentElement&&a.parentElement._lnSearchText!==void 0&&delete a.parentElement._lnSearchText;const h=d[t];if(h&&!h._destroyed&&L(h.term)&&(u.addedNodes.length>0||u.removedNodes.length>0)){for(let m=0;m<u.addedNodes.length;m++){const A=u.addedNodes[m];A._lnSearchText!==void 0&&delete A._lnSearchText}h._queueApply()}},persist:{attr:e,hashActive:function(d){return!!w(d)}}}),M(n,o,S,"ln-search-control")})()})();
|