@livenetworks/ashlar 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +33 -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 -13
- 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-editor/src/ln-editor.js +45 -12
- 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 +22 -12
- 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
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!C(n))return}e.apply(console,t)}}function X(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let u=0;u<s.length;u++){const i=s[u];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let u=0;u<s.length;u++){const i=s[u];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(n&&i.matches&&i.matches(n)))if(i.type==="checkbox")r&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let c=0;c<i.options.length;c++)i.options[c].selected&&l[i.name].push(i.options[c].value)}else if(r&&i.type==="hidden")l[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const c=Number(i.value);l[i.name]=i.value===""||isNaN(c)?null:c}else l[i.name]=i.value}return l}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const u=o.getAttribute("data-ln-fill-as")||o.name;if(!u||!(u in t))continue;const i=t[u];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(i).split(",").map(function(a){return a.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=ee(i);n.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),n.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<o.options.length;c++)o.options[c].selected=i.indexOf(o.options[c].value)!==-1;n.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),n.push(o)}return n}function ne(e,t,{get:r,set:n}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(l){n?n.call(this,l,s=>t.set.call(this,s)):t.set.call(this,l)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const $={};function re(e,t){$[e]=t}function oe(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){X(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function le(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const y={};function ue(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const u=r[o],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const n=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<n.length;o++){const u=n[o],i=u.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const a=i[c].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();t[d]!=null&&u.setAttribute(f,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const u=l[o],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const u=s[o],i=u.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const a=i[c].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();d in t&&u.classList.toggle(f,!!t[d])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function I(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,u){return t[u]!==void 0?t[u]:""}))}const n=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],u=o.attributes;for(let i=0;i<u.length;i++){const c=u[i];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ae(e,t,r,n,l,s){const o={};for(let i=0;i<e.children.length;i++){const c=e.children[i],a=c.getAttribute("data-ln-render-key");a&&(o[a]=c)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],a=String(n(c));let f=o[a];if(f)l(f,c,i);else{const d=ue(r,s);if(!d||(I(d,c),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),l(f,c,i)}u.appendChild(f)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=N,window.lnCore.lnFill=ce,window.lnCore.renderList=ae);function g(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function T(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function q(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function M(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const n=new Set(e||[]),l=function(s,o){const u=s.getAttribute(o);return u!==null&&n.has(u)?u:t};return A.set(r,l),l}function j(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function B(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function W(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const u=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${s}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${s}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${s}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const n in r){const[l,s,o]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=M(n.values,n.fallback);break;case"integer":l=T;break;case"float":l=j;break;case"boolean":l=q;break;case"list":l=R;break;case"json":l=B;break;case"string":default:l=g;break}l||(l=g),t[n.prop]=[l,r,n.fallback]}return t}function fe(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=U,window.lnCore.attrSpec=V,window.lnCore.attrStr=g,window.lnCore.attrInt=T,window.lnCore.attrBool=q,window.lnCore.attrList=R,window.lnCore.attrEnum=M,window.lnCore.attrFloat=j,window.lnCore.attrJson=B);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function H(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&h(e,o),e.querySelectorAll){const u=e.querySelectorAll(s);for(let i=0;i<u.length;i++)h(u[i],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function he(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function pe(e){const t=P(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=de(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=P(),l=n.byAttr.get(t),s=D()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&C(o)){const u=n.byDeclaredAttr.get(t),i=o.getAttribute(t);for(let c=0;c<u.length;c++)W(u[c].spec,i,t,u[c].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const u=n.byReactive.get(t);u&&Q(u,o,t,e.oldValue),n.reactiveWildcard.length&&Q(n.reactiveWildcard,o,t,e.oldValue)}if(l)for(let u=0;u<l.length;u++){const i=l[u];if(i.handler){i.handler(o,t,e.oldValue);continue}i.onAttributeChange&&o[i.attribute]?i.onAttributeChange(o,t):(H(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o))}}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function me(e){const t=v();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)n.matches&&n.matches(o.query)&&h(n,o);else if(n.matches&&n.matches(o.query)&&h(n,o),n.querySelectorAll){const u=n.querySelectorAll(o.query);for(let i=0;i<u.length;i++)h(u[i],o)}}o.onInit&&o.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s],u=o.query;if(u){if(!l)n.matches&&n.matches(u)&&_(n,o);else if(n.matches&&n.matches(u)&&_(n,o),n.querySelectorAll){const i=n.querySelectorAll(u);for(let c=0;c<i.length;c++)_(i[c],o)}}}}}}}function J(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{me(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){v().push(e),J()}function K(e,t,r,n,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,u=l.onSubtreeChange||null,i=l.onInit||null,c=l.onAttrChange||null,a=l.effects||null,f=l.attributes||null,d=f?fe(f):a,De=f?new Set(Object.keys(f)):null,$e=l.persist||null;function m(k){const w=k||document.body;if(H(w,e,t,r),f&&D())for(const p in f){const Ie=f[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const O=E[L];C(O)&&W(Ie,O.getAttribute(p),p,n,O)}}i&&i(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);pe({selector:e,attribute:t,componentTag:n,attributes:f,ComponentFn:r,onInit:i,observed:S.concat(s),onAttributeChange:o,onAttrChange:c,effects:d,declared:De,persist:$e}),ge();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=l.subtreeQuery||(Fe?e:"["+e+"]");v().push({selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:u,query:Ne}),J(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K,window.lnCore.observeLifecycle=Ce);function G(){we()>0?he(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),m}function z(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,r={},n=z(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const u=o.indexOf(":"),i=u>-1?o.slice(0,u):o,c=u>-1?o.slice(u+1):"";if(i)try{r[i]=decodeURIComponent(c)}catch{r[i]=c}}return r}function ye(e){if(!e)return null;const t=x();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const r=x();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Se(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Ee);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 Oe(e,t="-"){if(e==null)return"";const r=t||"-",n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,r).replace(new RegExp(`${n}+`,"g"),r).replace(new RegExp(`^${n}+|${n}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const r={"data-ln-slug-from":{prop:"sourceName",type:"string",read:g,fallback:"",description:"Name of the source input field to derive URL slug from"}},n=V(r),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(o){if(o.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",o.tagName),this;const u=o.form;if(!u)return console.warn("[ln-slug] Slug input is not inside a <form>:",o),this;U(this,o,n);const i=u.elements[this.sourceName];if(!i)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',o),this;if(typeof i.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',o),this;this.dom=o,this.form=u,this.source=i,this._pristine=o.value==="",this._mirroring=!1;const c=this;return ne(o,l,{get:function(){return l.get.call(o)},set:function(a){l.set.call(o,a),c._mirroring||(c._pristine=a===""||a===null||a===void 0)}}),this._onSource=function(){c._pristine&&c._mirror()},this._onSlug=function(){c._mirroring||(c._pristine=c.dom.value==="")},this._onFormReset=function(){setTimeout(function(){c._pristine=c.dom.value===""},0)},i.addEventListener("input",this._onSource),o.addEventListener("input",this._onSlug),u.addEventListener("reset",this._onFormReset),this._pristine&&i.value&&i.value.trim()!==""&&this._mirror(),this}s.prototype._mirror=function(){this._mirroring=!0,this.dom.value=Oe(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},s.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),this._onFormReset&&this.form&&this.form.removeEventListener("reset",this._onFormReset),Object.defineProperty(this.dom,"value",l),delete this.dom[t])},K(e,t,s,"ln-slug",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!C(i))return}e.apply(console,t)}}function ee(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&l[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);l[n.name]=n.value===""||isNaN(u)?null:u}else l[n.name]=n.value}return l}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const r=e.elements,i=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(n).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=re(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<o.options.length;u++)o.options[u].selected=n.indexOf(o.options[u].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}function ie(e,t,{get:r,set:i}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(l){i?i.call(this,l,s=>t.set.call(this,s)):t.set.call(this,l)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const F={};function le(e,t){F[e]=t}function se(e){return F[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,b(function(){new MutationObserver(function(){ee(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=ce);const y={};function fe(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),d=a[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function de(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function T(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],c=o.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function we(e,t,r,i,l,s){const o={};for(let n=0;n<e.children.length;n++){const u=e.children[n],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],a=String(i(u));let f=o[a];if(f)l(f,u,n);else{const d=fe(r,s);if(!d||(T(d,u),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),l(f,u,n)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=R,window.lnCore.lnFill=de,window.lnCore.renderList=we);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function I(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function q(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),l=function(s,o){const c=s.getAttribute(o);return c!==null&&i.has(c)?c:t};return A.set(r,l),l}function B(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function W(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function U(e,t,r,i,l){if(!e||t===null)return!0;const s=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,r){for(const i in r){const[l,s,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function H(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=j(i.values,i.fallback);break;case"integer":l=I;break;case"float":l=B;break;case"boolean":l=q;break;case"list":l=M;break;case"json":l=W;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function he(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function pe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=H,window.lnCore.attrStr=g,window.lnCore.attrInt=I,window.lnCore.attrBool=q,window.lnCore.attrList=M,window.lnCore.attrEnum=j,window.lnCore.attrFloat=B,window.lnCore.attrJson=W);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function P(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&h(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)h(c[n],o)}}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 ge(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 me(e){const t=Q(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=pe(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,r,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function Ce(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=Q(),l=i.byAttr.get(t),s=$()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&C(o)){const c=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let u=0;u<c.length;u++)U(c[u].spec,n,t,c[u].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&J(c,o,t,e.oldValue),i.reactiveWildcard.length&&J(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const n=l[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(P(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ce(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=_();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=v();if(e.target&&i.length)for(let l=0;l<i.length;l++){const s=i[l],o=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)s.matches&&s.matches(n.query)&&h(s,n);else if(s.matches&&s.matches(n.query)&&h(s,n),s.querySelectorAll){const u=s.querySelectorAll(n.query);for(let a=0;a<u.length;a++)h(u[a],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!o)s.matches&&s.matches(u)&&x(s,n);else if(s.matches&&s.matches(u)&&x(s,n),s.querySelectorAll){const a=s.querySelectorAll(u);for(let f=0;f<a.length;f++)x(a[f],n)}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{Ae(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&v().push(e),K()}function z(e,t,r,i,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,u=l.onAttrChange||null,a=l.effects||null,f=l.attributes||null,d=f?he(f):a,Ne=f?new Set(Object.keys(f)):null,Re=l.persist||null;function m(E){const w=E||document.body;if(P(w,e,t,r),f&&$())for(const p in f){const Ie=f[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const D=L[O];C(D)&&U(Ie,D.getAttribute(p),p,i,D)}}n&&n(w)}const k=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)k.push(w[1])}else k.push(e);me({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:r,onInit:n,observed:k.concat(s),onAttributeChange:o,onAttrChange:u,effects:d,declared:Ne,persist:Re}),ye();const Te=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,X=l.subtreeQuery||(Te?e:"["+e+"]"),Y={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:X};_().push(Y),c&&X&&v().push(Y),K(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=_e);function Z(){be()>0?ge(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),m}function G(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},i=G(t);if(!i)return r;const l=i.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function ve(e){if(!e)return null;const t=S();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Ee(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 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 r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=De);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 Fe(e,t="-"){if(e==null)return"";const r=t||"-",i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,r).replace(new RegExp(`${i}+`,"g"),r).replace(new RegExp(`^${i}+|${i}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const r={"data-ln-slug-from":{prop:"sourceName",type:"string",read:g,fallback:"",description:"Name of the source input field to derive URL slug from"}},i=H(r),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(o){if(o.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",o.tagName),this;const c=o.form;if(!c)return console.warn("[ln-slug] Slug input is not inside a <form>:",o),this;V(this,o,i);const n=c.elements[this.sourceName];if(!n)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',o),this;if(typeof n.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',o),this;this.dom=o,this.form=c,this.source=n,this._pristine=o.value==="",this._mirroring=!1;const u=this;return ie(o,l,{get:function(){return l.get.call(o)},set:function(a){l.set.call(o,a),u._mirroring||(u._pristine=a===""||a===null||a===void 0)}}),this._onSource=function(){u._pristine&&u._mirror()},this._onSlug=function(){u._mirroring||(u._pristine=u.dom.value==="")},this._onFormReset=function(){setTimeout(function(){u._pristine=u.dom.value===""},0)},n.addEventListener("input",this._onSource),o.addEventListener("input",this._onSlug),c.addEventListener("reset",this._onFormReset),this._pristine&&n.value&&n.value.trim()!==""&&this._mirror(),this}s.prototype._mirror=function(){this._mirroring=!0,this.dom.value=Fe(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},s.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),this._onFormReset&&this.form&&this.form.removeEventListener("reset",this._onFormReset),Object.defineProperty(this.dom,"value",l),delete this.dom[t])},z(e,t,s,"ln-slug",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!O(n))return}e.apply(console,t)}}function he(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function K(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(l),l}function I(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){I(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function D(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&l[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);l[o.name]=o.value===""||isNaN(u)?null:u}else l[o.name]=o.value}return l}function be(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ge(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(o).split(",").map(function(b){return b.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=be(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<i.options.length;u++)i.options[u].selected=o.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const z={};function me(e,t){z[e]=t}function ye(e){return z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ye);function Ce(e){const t=e?e.closest("[lang]"):null,r=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function Ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,I(function(){new MutationObserver(function(){he(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function ve(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=_e,window.lnCore.getLocaleFallback=ve,window.lnCore.ensureLocaleObserver=Ae);const q={};function Se(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(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],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const b=o[u].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),C=b[1].trim();t[C]!=null&&c.setAttribute(h,t[C])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const b=o[u].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),C=b[1].trim();C in t&&c.classList.toggle(h,!!t[C])}}return e}function xe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)Q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function J(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ke(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const u=e.children[o],b=u.getAttribute("data-ln-render-key");b&&(i[b]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],b=String(n(u));let h=i[b];if(h)l(h,u,o);else{const C=Se(r,s);if(!C||(J(C,u),h=C.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",b),l(h,u,o)}c.appendChild(h)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=Q,window.lnCore.lnFill=xe,window.lnCore.renderList=ke);function T(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function G(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function X(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function Y(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const F=new Map;function Z(e,t){const r=(e?e.join("|"):"")+"::"+t;if(F.has(r))return F.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return F.set(r,l),l}function ee(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function te(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function ne(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.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 o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} 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(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=Z(n.values,n.fallback);break;case"integer":l=G;break;case"float":l=ee;break;case"boolean":l=X;break;case"list":l=Y;break;case"json":l=te;break;case"string":default:l=T;break}l||(l=T),t[n.prop]=[l,r,n.fallback]}return t}function Ee(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function Ie(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=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=T,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 S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ie(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&S(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)S(c[o],i)}}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 Le(e){const t=le(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=Ie(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function se(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=le(),l=n.byAttr.get(t),s=U()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&O(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let u=0;u<c.length;u++)ne(c[u].spec,o,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&se(c,i,t,e.oldValue),n.reactiveWildcard.length&&se(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(ie(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function qe(e){const t=$();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&S(n,i);else if(n.matches&&n.matches(i.query)&&S(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)S(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&R(n,i);else if(n.matches&&n.matches(c)&&R(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let u=0;u<o.length;u++)R(o[u],i)}}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{qe(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){$().push(e),ce()}function ae(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,b=l.effects||null,h=l.attributes||null,C=h?Ee(h):b,d=h?new Set(Object.keys(h)):null,m=l.persist||null;function a(v){const w=v||document.body;if(ie(w,e,t,r),h&&U())for(const A in h){const V=h[A],x=Array.from(w.querySelectorAll("["+A+"]"));w.matches&&w.matches("["+A+"]")&&x.push(w);for(let k=0;k<x.length;k++){const E=x[k];O(E)&&ne(V,E.getAttribute(A),A,n,E)}}o&&o(w)}const g=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let w;for(;(w=v.exec(e))!==null;)g.push(w[1])}else g.push(e);Le({selector:e,attribute:t,componentTag:n,attributes:h,ComponentFn:r,onInit:o,observed:g.concat(s),onAttributeChange:i,onAttrChange:u,effects:C,declared:d,persist:m}),De();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,p=l.subtreeQuery||(f?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:p}),ce(),window[t]=a,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ae,window.lnCore.observeLifecycle=Fe);function y(){Te()>0?N(function(){a(document.body)}):a(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),a}function Ne(e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];if(!(n===""||n==null)&&(t=!0,!Number.isFinite(Number(n))))return"string"}return t?"number":"string"}function $e(e,t,r,n){if(r==="number"){const i=parseFloat(e),c=parseFloat(t);return(isNaN(i)?0:i)-(isNaN(c)?0:c)}const l=e!=null?String(e):"",s=t!=null?String(t):"";return n?n.compare(l,s):l<s?-1:l>s?1:0}function ue(e){return(e||"").replace(/^#/,"")}function B(e){const t=e===void 0?location.hash:e,r={},n=ue(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function M(e){if(!e)return null;const t=B();return e in t?t[e]:null}function de(e,t){if(!e)return;const r=B();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ue(location.hash)!==l&&(location.hash=l)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function L(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function j(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 Be(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=M,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=L,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=j,window.lnCore.hashFilterEncode=Be,window.lnCore.hashFilterDecode=Me);function je(){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=je);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function He(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function Ve(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function We(e,t,r,n){const l=_(e);if(l==="none")return()=>0;const s=l==="desc"?-1:1,i=typeof n=="function"?n:c=>c;return function(c,o){const u=i(c),b=i(o);return $e(u,b,t,r)*s}}function H(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Ue(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const r=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(r&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(r));if(e.tagName==="TABLE"){const n=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(n)return Array.from(n.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",r="data-ln-sort-field",n="data-ln-sort-state",l="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function i(d,m){return d.getAttribute(m)||null}const c={"data-ln-sort":{prop:"targetId",type:"string",read:T,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:i,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:i,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},o=oe(c),u=new WeakMap;function b(d,m,a){if(m){const g=d.querySelector('[data-ln-field="'+m+'"]');return g?D(g):""}return a!=null&&d.cells&&d.cells[a]?D(d.cells[a]):D(d)}function h(d){this.dom=d,re(this,d,o);const m=d.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(d.getAttribute(n)),d.hasAttribute(n)||d.setAttribute(n,this._state),this._destroyed=!1,this.nsKey=L(d,"sort"),this.hashEnabled=!!this.nsKey;const a=this;this._onClick=function(f){const p=f.target.closest("["+l+"]");if(!p)return;const y=_(p.getAttribute(l));a._apply(y)},d.addEventListener("click",this._onClick),this._onSortChange=function(f){if(a._destroyed||!f.detail)return;const p=a._resolveTarget();if(!(p&&(f.target===p||p.contains(f.target))||f.detail.targetId&&f.detail.targetId===a.targetId))return;if(Ve({field:a.field,column:a.column},{field:f.detail.field,column:f.detail.column})){const w=_(f.detail.direction);w&&d.getAttribute(n)!==w&&(a._state=w,d.setAttribute(n,w),a._updateAriaSort(w));return}d.getAttribute(n)!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const f=M(a.nsKey),p=j(f);if(p)a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn?a._state!==p.direction&&a._apply(p.direction,!0):a._state!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"));else if(a._state!=="none"){a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none");const y=a._resolveTarget();y&&(K(y,"ln-sort:change",{field:a.field,column:a.column,direction:"none",targetId:a.targetId}).defaultPrevented||a._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const f=M(this.nsKey),p=j(f);p&&((a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn)&&N(function(){a._destroyed||a._apply(p.direction,!0)}),g=!0)}if(!g){const f=_(d.getAttribute(n));f&&f!=="none"&&N(function(){a._destroyed||a._apply(f,!0)})}return this}h.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},h.prototype._updateAriaSort=function(d){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",He(d))},h.prototype._apply=function(d,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const a=_(d);this._state=a,this.dom.getAttribute(n)!==a&&this.dom.setAttribute(n,a),this._updateAriaSort(a);const g=this._resolveTarget();if(!g)return;const f={field:this.field,column:this.column,direction:a,targetId:this.targetId};if(!m&&this.hashEnabled){const y=fe(this.field!==null?this.field:this.column,a);de(this.nsKey,y)}K(g,"ln-sort:change",f).defaultPrevented||this._defaultSort(g,a)},h.prototype._defaultSort=function(d,m){const a=Ue(d,this.itemsSelector);if(!a.length)return;const g=a[0].parentNode,f=a.filter(function(w){return!H(w)});if(!f.length)return;u.has(d)||u.set(d,f.slice());let p;if(m==="none"){const w=u.get(d)||f;u.delete(d),p=w.filter(function(A){return A.parentNode===g&&!H(A)})}else{const w=this.field,A=this.column,V=f.map(function(W){return b(W,w,A)}),x=Ne(V),k=typeof Intl<"u"?new Intl.Collator(Ce(this.dom),{sensitivity:"base",numeric:!0}):null,E=We(m,x,k,function(W){return b(W,w,A)});p=f.slice().sort(E)}const y=document.createDocumentFragment();let v=0;for(let w=0;w<a.length;w++){const A=a[w];H(A)?y.appendChild(A):v<p.length&&y.appendChild(p[v++])}g.appendChild(y)},h.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(d,m){const a=d[t];if(!(!a||a._destroyed))if(m===r){const g=d.closest("th");a.column=!a.field&&g?g.cellIndex:null}else if(m===n){const g=_(d.getAttribute(n));g!==a._state&&a._apply(g)}else m===s&&(a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=L(d,"sort"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange))}ae(e,t,h,"ln-sort",{attributes:c,persist:{attr:n,hashActive:function(d){return!!L(d,"sort")}}})})()})();
|
|
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 r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!D(r))return}e.apply(console,t)}}function we(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 z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});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 q(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function pe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function be(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function ge(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,r=[],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 o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(h){return h.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ge(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=me,window.lnCore.serializeForm=be,window.lnCore.resolveFormMethod=pe);const P={};function ye(e,t){P[e]=t}function Ce(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=Ce);function Ae(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function _e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){we(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function ve(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];Q[n]=t}function Se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ve,window.lnCore.getLocaleFallback=Se,window.lnCore.ensureLocaleObserver=_e);const F={};function xe(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[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],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const h=o[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),A=h[1].trim();t[A]!=null&&c.setAttribute(f,t[A])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const h=o[u].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),A=h[1].trim();A in t&&c.classList.toggle(f,!!t[A])}}return e}function ke(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)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 G(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 r=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 o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ee(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],h=u.getAttribute("data-ln-render-key");h&&(l[h]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],h=String(r(u));let f=l[h];if(f)i(f,u,o);else{const A=xe(n,s);if(!A||(G(A,u),f=A.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),i(f,u,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=J,window.lnCore.lnFill=ke,window.lnCore.renderList=Ee);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function X(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Y(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function Z(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const N=new Map;function ee(e,t){const n=(e?e.join("|"):"")+"::"+t;if(N.has(n))return N.get(n);const r=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return N.set(n,i),i}function te(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ne(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function re(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${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:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.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 o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} 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(o){return c(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ie(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=ee(r.values,r.fallback);break;case"integer":i=X;break;case"float":i=te;break;case"boolean":i=Y;break;case"list":i=Z;break;case"json":i=ne;break;case"string":default:i=L;break}i||(i=L),t[r.prop]=[i,n,r.fallback]}return t}function Ie(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 Te(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=oe,window.lnCore.attrSpec=ie,window.lnCore.attrStr=L,window.lnCore.attrInt=X,window.lnCore.attrBool=Y,window.lnCore.attrList=Z,window.lnCore.attrEnum=ee,window.lnCore.attrFloat=te,window.lnCore.attrJson=ne);function k(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,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&k(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)k(c[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function R(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 Oe(e){const t=se(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Te(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,r){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,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function De(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=se(),i=r.byAttr.get(t),s=K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&D(l)){const c=r.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<c.length;u++)re(c[u].spec,o,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ce(c,l,t,e.oldValue),r.reactiveWildcard.length&&ce(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];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 qe(){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{De(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function B(){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(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Fe(e){const t=$();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=B();if(e.target&&r.length)for(let i=0;i<r.length;i++){const s=r[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 o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)s.matches&&s.matches(o.query)&&k(s,o);else if(s.matches&&s.matches(o.query)&&k(s,o),s.querySelectorAll){const u=s.querySelectorAll(o.query);for(let h=0;h<u.length;h++)k(u[h],o)}}o.onInit&&o.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 o=t[c],u=o.query;if(u){if(!l)s.matches&&s.matches(u)&&M(s,o);else if(s.matches&&s.matches(u)&&M(s,o),s.querySelectorAll){const h=s.querySelectorAll(u);for(let f=0;f<h.length;f++)M(h[f],o)}}}}}}function ae(){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{Fe(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){$().push(e),e.onSubtreeChange&&e.query&&B().push(e),ae()}function ue(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,h=i.effects||null,f=i.attributes||null,A=f?Ie(f):h,d=f?new Set(Object.keys(f)):null,g=i.persist||null;function a(y){const C=y||document.body;if(le(C,e,t,n),f&&K())for(const S in f){const U=f[S],E=Array.from(C.querySelectorAll("["+S+"]"));C.matches&&C.matches("["+S+"]")&&E.push(C);for(let I=0;I<E.length;I++){const x=E[I];D(x)&&re(U,x.getAttribute(S),S,r,x)}}o&&o(C)}const b=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let C;for(;(C=y.exec(e))!==null;)b.push(C[1])}else b.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:b.concat(s),onAttributeChange:l,onAttrChange:u,effects:A,declared:d,persist:g}),qe();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,p=i.subtreeQuery||(w?e:"["+e+"]"),m={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:p};$().push(m),c&&p&&B().push(m),ae(),window[t]=a,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ue,window.lnCore.observeLifecycle=Ne);function v(){Le()>0?R(function(){a(document.body)}):a(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),a}function Re(e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(!(r===""||r==null)&&(t=!0,!Number.isFinite(Number(r))))return"string"}return t?"number":"string"}function $e(e,t,n,r){if(n==="number"){const l=parseFloat(e),c=parseFloat(t);return(isNaN(l)?0:l)-(isNaN(c)?0:c)}const i=e!=null?String(e):"",s=t!=null?String(t):"";return r?r.compare(i,s):i<s?-1:i>s?1:0}function de(e){return(e||"").replace(/^#/,"")}function j(e){const t=e===void 0?location.hash:e,n={},r=de(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function H(e){if(!e)return null;const t=j();return e in t?t[e]:null}function fe(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("&");de(location.hash)!==i&&(location.hash=i)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function O(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 he(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function V(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 Me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(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=H,window.lnCore.hashSet=fe,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=O,window.lnCore.hashSortEncode=he,window.lnCore.hashSortDecode=V,window.lnCore.hashFilterEncode=Me,window.lnCore.hashFilterDecode=je);function He(){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=He);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function Ve(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function We(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function Ue(e,t,n,r){const i=_(e);if(i==="none")return()=>0;const s=i==="desc"?-1:1,l=typeof r=="function"?r:c=>c;return function(c,o){const u=l(c),h=l(o);return $e(u,h,t,n)*s}}function W(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Ke(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const n=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(n&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(n));if(e.tagName==="TABLE"){const r=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(r)return Array.from(r.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",n="data-ln-sort-field",r="data-ln-sort-state",i="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function l(d,g){return d.getAttribute(g)||null}const c={"data-ln-sort":{prop:"targetId",type:"string",read:L,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:l,effect:A,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:l,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:A,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:A,description:"URL hash routing key for sort state persistence"}},o=ie(c),u=new WeakMap;function h(d,g,a){if(g){const b=d.querySelector('[data-ln-field="'+g+'"]');return b?q(b):""}return a!=null&&d.cells&&d.cells[a]?q(d.cells[a]):q(d)}function f(d){this.dom=d,oe(this,d,o);const g=d.closest("th");this.column=!this.field&&g?g.cellIndex:null,this._state=_(d.getAttribute(r)),d.hasAttribute(r)||d.setAttribute(r,this._state),this._destroyed=!1,this.nsKey=O(d,"sort"),this.hashEnabled=!!this.nsKey;const a=this;this._onClick=function(w){const p=w.target.closest("["+i+"]");if(!p)return;const m=_(p.getAttribute(i));a._apply(m)},d.addEventListener("click",this._onClick),this._onSortChange=function(w){if(a._destroyed||!w.detail)return;const p=a._resolveTarget();if(!(p&&(w.target===p||p.contains(w.target))||w.detail.targetId&&w.detail.targetId===a.targetId))return;if(We({field:a.field,column:a.column},{field:w.detail.field,column:w.detail.column})){const y=_(w.detail.direction);y&&d.getAttribute(r)!==y&&(a._state=y,d.setAttribute(r,y),a._updateAriaSort(y));return}d.getAttribute(r)!=="none"&&(a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const w=H(a.nsKey),p=V(w);if(p)a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn?a._state!==p.direction&&a._apply(p.direction,!0):a._state!=="none"&&(a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none"));else if(a._state!=="none"){a._state="none",d.setAttribute(r,"none"),a._updateAriaSort("none");const m=a._resolveTarget();m&&(z(m,"ln-sort:change",{field:a.field,column:a.column,direction:"none",targetId:a.targetId}).defaultPrevented||a._defaultSort(m,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const w=H(this.nsKey),p=V(w);p&&((a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn)&&R(function(){a._destroyed||a._apply(p.direction,!0)}),b=!0)}if(!b){const w=_(d.getAttribute(r));w&&w!=="none"&&R(function(){a._destroyed||a._apply(w,!0)})}return this}f.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},f.prototype._updateAriaSort=function(d){const g=this.dom.closest("th");g&&g.setAttribute("aria-sort",Ve(d))},f.prototype._apply=function(d,g){if(this._destroyed)return;if(!this.field&&this.column===null){const m=this.dom.closest("th");m&&m.cellIndex!==void 0&&(this.column=m.cellIndex)}const a=_(d);this._state=a,this.dom.getAttribute(r)!==a&&this.dom.setAttribute(r,a),this._updateAriaSort(a);const b=this._resolveTarget();if(!b)return;const w={field:this.field,column:this.column,direction:a,targetId:this.targetId};if(!g&&this.hashEnabled){const m=he(this.field!==null?this.field:this.column,a);fe(this.nsKey,m)}z(b,"ln-sort:change",w).defaultPrevented||this._defaultSort(b,a)},f.prototype._defaultSort=function(d,g){const a=Ke(d,this.itemsSelector);if(!a.length)return;const b=a[0].parentNode,w=a.filter(function(y){return!W(y)});if(!w.length)return;u.has(d)||u.set(d,w.slice());let p;if(g==="none"){const y=u.get(d)||w;u.delete(d),p=y.filter(function(C){return C.parentNode===b&&!W(C)})}else{const y=this.field,C=this.column,S=w.map(function(x){return h(x,y,C)}),U=Re(S),E=typeof Intl<"u"?new Intl.Collator(Ae(this.dom),{sensitivity:"base",numeric:!0}):null,I=Ue(g,U,E,function(x){return h(x,y,C)});p=w.slice().sort(I)}const m=document.createDocumentFragment();let v=0;for(let y=0;y<a.length;y++){const C=a[y];W(C)?m.appendChild(C):v<p.length&&m.appendChild(p[v++])}b.appendChild(m)},f.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function A(d,g){const a=d[t];if(!(!a||a._destroyed))if(g===n){const b=d.closest("th");a.column=!a.field&&b?b.cellIndex:null}else if(g===r){const b=_(d.getAttribute(r));b!==a._state&&a._apply(b)}else g===s&&(a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=O(d,"sort"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange))}ue(e,t,f,"ln-sort",{attributes:c,persist:{attr:r,hashActive:function(d){return!!O(d,"sort")}}})})()})();
|
|
@@ -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 r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!A(r))return}e.apply(console,t)}}function C(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function X(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(l),l}function 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 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),r=t&&t.exclude,l={},a=e.elements,o={};if(i)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")i&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")l[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function 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,r=[],l={};for(let a=0;a<i.length;a++){const o=i[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<i.length;a++){const o=i[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=te(n);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;r.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const F={};function re(e,t){F[e]=t}function oe(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){C(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 ae(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 M(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function B(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function de(e,t,i,r,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=o[d];if(u)l(u,c,n);else{const f=ae(i,a);if(!f||(B(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function x(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function N(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function R(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const _=new Map;function W(e,t){const i=(e?e.join("|"):"")+"::"+t;if(_.has(i))return _.get(i);const r=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&r.has(s)?s:t};return _.set(i,l),l}function P(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function U(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function V(e,t,i,r,l){if(!e||t===null)return!0;const a=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,i){for(const r in i){const[l,a,o]=i[r];Object.defineProperty(e,r,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=W(r.values,r.fallback);break;case"integer":l=N;break;case"float":l=P;break;case"boolean":l=R;break;case"list":l=j;break;case"json":l=U;break;case"string":default:l=x;break}l||(l=x),t[r.prop]=[l,i,r.fallback]}return t}function we(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function be(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=ue,window.lnCore.attrSpec=fe,window.lnCore.attrStr=x,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);function g(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 H(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(a)&&g(e,o),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)g(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){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 r=0;r<i.length;r++){const l=i[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[i];o?o(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=Q(),l=r.byAttr.get(t),a=T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!l&&!a)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(a&&A(o)){const s=r.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<s.length;c++)V(s[c].spec,n,t,s[c].componentTag,o)}if(window.lnCore._debugSink&&(i||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&J(s,o,t,e.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(H(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=k();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const l=r.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&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)r.matches&&r.matches(o.query)&&g(r,o);else if(r.matches&&r.matches(o.query)&&g(r,o),r.querySelectorAll){const s=r.querySelectorAll(o.query);for(let n=0;n<s.length;n++)g(s[n],o)}}o.onInit&&o.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a],s=o.query;if(s){if(!l)r.matches&&r.matches(s)&&S(r,o);else if(r.matches&&r.matches(s)&&S(r,o),r.querySelectorAll){const n=r.querySelectorAll(s);for(let c=0;c<n.length;c++)S(n[c],o)}}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{ye(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){k().push(e),K()}function Y(e,t,i,r,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?we(u):d,h=u?new Set(Object.keys(u)):null,p=l.persist||null;function b(O){const w=O||document.body;if(H(w,e,t,i),u&&T())for(const m in u){const Te=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let I=0;I<D.length;I++){const q=D[I];A(q)&&V(Te,q.getAttribute(m),m,r,q)}}n&&n(w)}const L=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)L.push(w[1])}else L.push(e);ge({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:i,onInit:n,observed:L.concat(a),onAttributeChange:o,onAttrChange:c,effects:f,declared:h,persist:p}),Ce();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=l.subtreeQuery||(Ie?e:"["+e+"]");k().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:qe}),K(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=Ae);function G(){he()>0?pe(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function z(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,i={},r=z(t);if(!r)return i;const l=r.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function ve(e){if(!e)return null;const t=E();return e in t?t[e]:null}function xe(e,t){if(!e)return;const i=E();t==null?delete i[e]:i[e]=String(t);const l=Object.keys(i).map(function(a){const o=i[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(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 r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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 Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=De),(function(){const e="data-ln-sortable",t="lnSortable",i="data-ln-sortable-handle";if(window[t]!==void 0)return;const r={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function l(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},o.addEventListener("pointerdown",this._onPointerDown),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},l.prototype._handlePointerDown=function(o){let s=o.target.closest("["+i+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+i+"]"))return;for(n=o.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(X(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;for(const c of s)c.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const c of s){if(c===n)continue;const d=c.getBoundingClientRect(),u=d.top+d.height/2;if(o.clientY>=d.top&&o.clientY<u){c.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=d.bottom){c.classList.add("ln-sortable--drop-after");break}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}for(const f of n)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);C(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:h})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const n=o.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,C(o,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}Y(e,t,l,"ln-sortable",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function _(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!_(l))return}e.apply(console,t)}}function v(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function ne(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(i),i}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,i={},a=e.elements,r={};if(o)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")o&&r[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const o=e.elements,l=[],i={};for(let a=0;a<o.length;a++){const r=o[a];r.name&&r.type==="checkbox"&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<o.length;a++){const r=o[a];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const s=r.getAttribute("data-ln-fill-as")||r.name;if(!s||!(s in t))continue;const n=t[s];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(i[r.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=ie(n);l.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),l.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<r.options.length;c++)r.options[c].selected=n.indexOf(r.options[c].value)!==-1;l.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),l.push(r)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const M={};function se(e,t){M[e]=t}function ae(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=se,window.lnCore.getDataMapper=ae);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function de(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=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=de,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const x={};function fe(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const s=o[r],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<l.length;r++){const s=l[r],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let r=0;r<i.length;r++){const s=i[r],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let r=0;r<a.length;r++){const s=a[r],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function N(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,s){return t[s]!==void 0?t[s]:""}))}const l=function(a,r){return t[r]!==void 0?t[r]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const r=i[a],s=r.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function be(e,t,o,l,i,a){const r={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(r[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(l(c));let u=r[d];if(u)i(u,c,n);else{const f=fe(o,a);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=B,window.lnCore.lnFill=we,window.lnCore.renderList=be);function k(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function j(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function P(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const E=new Map;function U(e,t){const o=(e?e.join("|"):"")+"::"+t;if(E.has(o))return E.get(o);const l=new Set(e||[]),i=function(a,r){const s=a.getAttribute(r);return s!==null&&l.has(s)?s:t};return E.set(o,i),i}function V(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function H(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function Q(e,t,o,l,i){if(!e||t===null)return!0;const a=l||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,o){for(const l in o){const[i,a,r]=o[l];Object.defineProperty(e,l,{get:function(){return i(t,a,r)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=U(l.values,l.fallback);break;case"integer":i=j;break;case"float":i=V;break;case"boolean":i=P;break;case"list":i=W;break;case"json":i=H;break;case"string":default:i=k;break}i||(i=k),t[l.prop]=[i,o,l.fallback]}return t}function ge(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=he,window.lnCore.attrSpec=pe,window.lnCore.attrStr=k,window.lnCore.attrInt=j,window.lnCore.attrBool=P,window.lnCore.attrList=W,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(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,l){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:l};if(e.matches&&e.matches(a)&&m(e,r),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)m(s[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){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 ve(e){const t=K(),o=e.observed||[];for(let l=0;l<o.length;l++){const i=o[l];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=me(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,o,l){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const r=a.effects&&a.effects[o];r?r(t,o,l):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,l)}}function Ae(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,l=K(),i=l.byAttr.get(t),a=$()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!o&&!i&&!a)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(a&&_(r)){const s=l.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let c=0;c<s.length;c++)Q(s[c].spec,n,t,s[c].componentTag,r)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const s=l.byReactive.get(t);s&&Y(s,r,t,e.oldValue),l.reactiveWildcard.length&&Y(l.reactiveWildcard,r,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(J(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ae(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].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 L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function D(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=S();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=L();if(e.target&&l.length)for(let i=0;i<l.length;i++){const a=l[i],r=a.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;s&&a.onSubtreeChange(s,e)}for(let i=0;i<e.addedNodes.length;i++){const a=e.addedNodes[i];if(a.nodeType===1){const r=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)a.matches&&a.matches(n.query)&&m(a,n);else if(a.matches&&a.matches(n.query)&&m(a,n),a.querySelectorAll){const c=a.querySelectorAll(n.query);for(let d=0;d<c.length;d++)m(c[d],n)}}n.onInit&&n.onInit(a)}}}for(let i=0;i<e.removedNodes.length;i++){const a=e.removedNodes[i];if(a.nodeType===1){const r=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s],c=n.query;if(c){if(!r)a.matches&&a.matches(c)&&D(a,n);else if(a.matches&&a.matches(c)&&D(a,n),a.querySelectorAll){const d=a.querySelectorAll(c);for(let u=0;u<d.length;u++)D(d[u],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{xe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){S().push(e),e.onSubtreeChange&&e.query&&L().push(e),z()}function G(e,t,o,l,i={}){const a=i.extraAttributes||[],r=i.onAttributeChange||null,s=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?ge(u):d,w=u?new Set(Object.keys(u)):null,h=i.persist||null;function g(T){const b=T||document.body;if(J(b,e,t,o),u&&$())for(const y in u){const $e=u[y],I=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&I.push(b);for(let q=0;q<I.length;q++){const F=I[q];_(F)&&Q($e,F.getAttribute(y),y,l,F)}}n&&n(b)}const p=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let b;for(;(b=T.exec(e))!==null;)p.push(b[1])}else p.push(e);ve({selector:e,attribute:t,componentTag:l,attributes:u,ComponentFn:o,onInit:n,observed:p.concat(a),onAttributeChange:r,onAttrChange:c,effects:f,declared:w,persist:h}),_e();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=i.subtreeQuery||(C?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:s,query:Z};S().push(ee),s&&Z&&L().push(ee),z(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=ke);function te(){Ce()>0?ye(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),g}function X(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,o={},l=X(t);if(!l)return o;const i=l.split("&");for(let a=0;a<i.length;a++){const r=i[a];if(!r)continue;const s=r.indexOf(":"),n=s>-1?r.slice(0,s):r,c=s>-1?r.slice(s+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Ee(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Se(e,t){if(!e)return;const o=O();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(a){const r=o[a];return r===""?a:a+":"+encodeURIComponent(r)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function 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 o=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=qe);function Fe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Fe),(function(){const e="data-ln-sortable",t="lnSortable",o="data-ln-sortable-handle";if(window[t]!==void 0)return;const l={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function i(r){this.dom=r,this.isEnabled=r.getAttribute(e)!=="disabled",this._dragging=null,r.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},r.addEventListener("pointerdown",this._onPointerDown),this}i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},i.prototype._handlePointerDown=function(r){let s=r.target.closest("["+o+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+o+"]"))return;for(n=r.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(ne(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;r.preventDefault(),s.setPointerCapture(r.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),v(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this;let w=null,h=null;const g=function(C){h=C,!w&&(w=requestAnimationFrame(function(){w=null,h&&f._handlePointerMove(h)}))},p=function(C){w&&(cancelAnimationFrame(w),w=null),f._handlePointerEnd(C),s.removeEventListener("pointermove",g),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",g),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},i.prototype._handlePointerMove=function(r){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;let c=null,d=null;for(let u=0;u<s.length;u++){const f=s[u];if(f===n)continue;const w=f.getBoundingClientRect(),h=w.top+w.height/2;if(r.clientY>=w.top&&r.clientY<h){c=f,d="before";break}else if(r.clientY>=h&&r.clientY<=w.bottom){c=f,d="after";break}}if(!(this._lastDropTarget===c&&this._lastDropPos===d)){this._lastDropTarget&&this._lastDropTarget!==c&&this._lastDropTarget.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after"),this._lastDropTarget=c,this._lastDropPos=d;for(let u=0;u<s.length;u++){const f=s[u];f!==c&&(f.classList.contains("ln-sortable--drop-before")&&f.classList.remove("ln-sortable--drop-before"),f.classList.contains("ln-sortable--drop-after")&&f.classList.remove("ln-sortable--drop-after"))}if(c){const u=d==="before"?"ln-sortable--drop-before":"ln-sortable--drop-after",f=d==="before"?"ln-sortable--drop-after":"ln-sortable--drop-before";c.classList.contains(f)&&c.classList.remove(f),c.classList.contains(u)||c.classList.add(u)}}},i.prototype._handlePointerEnd=function(r){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}this._lastDropTarget=null,this._lastDropPos=null;for(const f of n)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const w=Array.from(this.dom.children).indexOf(s);v(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:w})}this._dragging=null};function a(r){const s=r[t];if(!s)return;const n=r.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,v(r,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:r}))}G(e,t,i,"ln-sortable",{attributes:l})})()})();
|
|
@@ -90,8 +90,22 @@ import { registerComponent, dispatch, dispatchCancelable } from '../../ln-core';
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
const self = this;
|
|
93
|
-
|
|
93
|
+
let rafMove = null;
|
|
94
|
+
let lastEvent = null;
|
|
95
|
+
|
|
96
|
+
const onMove = function (ev) {
|
|
97
|
+
lastEvent = ev;
|
|
98
|
+
if (rafMove) return;
|
|
99
|
+
rafMove = requestAnimationFrame(function () {
|
|
100
|
+
rafMove = null;
|
|
101
|
+
if (lastEvent) self._handlePointerMove(lastEvent);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
94
104
|
const onEnd = function (ev) {
|
|
105
|
+
if (rafMove) {
|
|
106
|
+
cancelAnimationFrame(rafMove);
|
|
107
|
+
rafMove = null;
|
|
108
|
+
}
|
|
95
109
|
self._handlePointerEnd(ev);
|
|
96
110
|
handle.removeEventListener('pointermove', onMove);
|
|
97
111
|
handle.removeEventListener('pointerup', onEnd);
|
|
@@ -109,24 +123,52 @@ import { registerComponent, dispatch, dispatchCancelable } from '../../ln-core';
|
|
|
109
123
|
const children = Array.from(this.dom.children);
|
|
110
124
|
const dragging = this._dragging;
|
|
111
125
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
126
|
+
let targetChild = null;
|
|
127
|
+
let targetPos = null;
|
|
115
128
|
|
|
116
|
-
for (
|
|
129
|
+
for (let i = 0; i < children.length; i++) {
|
|
130
|
+
const child = children[i];
|
|
117
131
|
if (child === dragging) continue;
|
|
118
132
|
|
|
119
133
|
const rect = child.getBoundingClientRect();
|
|
120
134
|
const mid = rect.top + rect.height / 2;
|
|
121
135
|
|
|
122
136
|
if (e.clientY >= rect.top && e.clientY < mid) {
|
|
123
|
-
child
|
|
137
|
+
targetChild = child;
|
|
138
|
+
targetPos = 'before';
|
|
124
139
|
break;
|
|
125
140
|
} else if (e.clientY >= mid && e.clientY <= rect.bottom) {
|
|
126
|
-
child
|
|
141
|
+
targetChild = child;
|
|
142
|
+
targetPos = 'after';
|
|
127
143
|
break;
|
|
128
144
|
}
|
|
129
145
|
}
|
|
146
|
+
|
|
147
|
+
if (this._lastDropTarget === targetChild && this._lastDropPos === targetPos) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (this._lastDropTarget && this._lastDropTarget !== targetChild) {
|
|
152
|
+
this._lastDropTarget.classList.remove('ln-sortable--drop-before', 'ln-sortable--drop-after');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
this._lastDropTarget = targetChild;
|
|
156
|
+
this._lastDropPos = targetPos;
|
|
157
|
+
|
|
158
|
+
for (let i = 0; i < children.length; i++) {
|
|
159
|
+
const child = children[i];
|
|
160
|
+
if (child !== targetChild) {
|
|
161
|
+
if (child.classList.contains('ln-sortable--drop-before')) child.classList.remove('ln-sortable--drop-before');
|
|
162
|
+
if (child.classList.contains('ln-sortable--drop-after')) child.classList.remove('ln-sortable--drop-after');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (targetChild) {
|
|
167
|
+
const cls = targetPos === 'before' ? 'ln-sortable--drop-before' : 'ln-sortable--drop-after';
|
|
168
|
+
const otherCls = targetPos === 'before' ? 'ln-sortable--drop-after' : 'ln-sortable--drop-before';
|
|
169
|
+
if (targetChild.classList.contains(otherCls)) targetChild.classList.remove(otherCls);
|
|
170
|
+
if (!targetChild.classList.contains(cls)) targetChild.classList.add(cls);
|
|
171
|
+
}
|
|
130
172
|
};
|
|
131
173
|
|
|
132
174
|
_component.prototype._handlePointerEnd = function (e) {
|
|
@@ -152,6 +194,9 @@ import { registerComponent, dispatch, dispatchCancelable } from '../../ln-core';
|
|
|
152
194
|
}
|
|
153
195
|
}
|
|
154
196
|
|
|
197
|
+
this._lastDropTarget = null;
|
|
198
|
+
this._lastDropPos = null;
|
|
199
|
+
|
|
155
200
|
for (const child of children) {
|
|
156
201
|
child.classList.remove('ln-sortable--drop-before', 'ln-sortable--drop-after');
|
|
157
202
|
}
|