@livenetworks/ashlar 2.0.10 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- 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-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/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +106 -40
- 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-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- 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-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- 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-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- 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-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-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-time/ln-time.js +1 -1
- 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-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 F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!A(o))return}e.apply(console,t)}}function q(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function re(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},a=e.elements,s={};if(n)for(let c=0;c<a.length;c++){const r=a[c];r.name&&r.type==="checkbox"&&!r.disabled&&(s[r.name]=(s[r.name]||0)+1)}for(let c=0;c<a.length;c++){const r=a[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&s[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let l=0;l<r.options.length;l++)r.options[l].selected&&i[r.name].push(r.options[l].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const l=Number(r.value);i[r.name]=r.value===""||isNaN(l)?null:l}else i[r.name]=r.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const n=e.elements,o=[],i={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let a=0;a<n.length;a++){const s=n[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const r=t[c];if(s.type==="checkbox"){if(Array.isArray(r))s.checked=r.indexOf(s.value)!==-1;else if(i[s.name]>1){const l=String(r).split(",").map(function(d){return d.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=se(r);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(r),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(r))for(let l=0;l<s.options.length;l++)s.options[l].selected=r.indexOf(s.options[l].value)!==-1;o.push(s)}else s.value=r,s.tagName==="SELECT"&&r!=null&&s.setAttribute("data-ln-value",r),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const D={};function le(e,t){D[e]=t}function ce(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function de(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ue);const v={};function he(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const c=o[s],r=c.getAttribute("data-ln-attr").split(",");for(let l=0;l<r.length;l++){const d=r[l].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const c=a[s],r=c.getAttribute("data-ln-class").split(",");for(let l=0;l<r.length;l++){const d=r[l].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,c){return t[c]!==void 0?t[c]:""}))}const o=function(a,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const s=i[a],c=s.attributes;for(let r=0;r<c.length;r++){const l=c[r];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,n,o,i,a){const s={};for(let r=0;r<e.children.length;r++){const l=e.children[r],d=l.getAttribute("data-ln-render-key");d&&(s[d]=l)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const l=t[r],d=String(o(l));let u=s[d];if(u)i(u,l,r);else{const f=he(n,a);if(!f||(R(f,l),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,l,r)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=$,window.lnCore.lnFill=be,window.lnCore.renderList=we);function k(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function x(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const o=new Set(e||[]),i=function(a,s){const c=a.getAttribute(s);return c!==null&&o.has(c)?c:t};return _.set(n,i),i}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(e,t,n,o,i){if(!e||t===null)return!0;const a=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(s==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,n){for(const o in n){const[i,a,s]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,a,s)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=B(o.values,o.fallback);break;case"integer":i=M;break;case"float":i=H;break;case"boolean":i=x;break;case"list":i=j;break;case"json":i=W;break;case"string":default:i=k;break}i||(i=k),t[o.prop]=[i,n,o.fallback]}return t}function pe(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=P,window.lnCore.attrSpec=V,window.lnCore.attrStr=k,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=j,window.lnCore.attrEnum=B,window.lnCore.attrFloat=H,window.lnCore.attrJson=W);function S(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&s.push(e);for(const c of s)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(r){console.error("["+n+"] init failed",c,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Ce(e){const t=Q(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ge(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,o){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function Ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),i=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&A(t)){const a=o.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let c=0;c<a.length;c++)U(a[c].spec,s,n,a[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=o.byReactive.get(n);a&&z(a,t,n,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const s=i[a];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(S(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ae(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ke(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,a=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;a&&o.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i];S(o,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i],s=a.query,c=Array.from(o.querySelectorAll(s));o.matches&&o.matches(s)&&c.push(o);for(let r=0;r<c.length;r++){const l=c[r];if(!document.contains(l)){const d=l[a.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+a.attribute+"] destroy failed",l,u)}delete l[a.attribute]}}}}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ke(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,o,i={}){const a=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,l=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?pe(u):d,h=u?new Set(Object.keys(u)):null,C=i.persist||null;function b(T){const w=T||document.body;if(S(w,e,t,n),u&&F())for(const g in u){const Fe=u[g],O=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&O.push(w);for(let K=0;K<O.length;K++){const N=O[K];A(N)&&U(Fe,N.getAttribute(g),g,o,N)}}r&&r(w)}const E=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let w;for(;(w=T.exec(e))!==null;)E.push(w[1])}else E.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:n,onInit:r,observed:E.concat(a),onAttributeChange:s,onAttrChange:l,effects:f,declared:h,persist:C}),ve();const Ke=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=i.subtreeQuery||(Ke?e:"["+e+"]");J().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:Ne}),xe(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G);function ne(){me()>0?ye(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),b}function X(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=X(t);if(!o)return n;const i=o.split("&");for(let a=0;a<i.length;a++){const s=i[a];if(!s)continue;const c=s.indexOf(":"),r=c>-1?s.slice(0,c):s,l=c>-1?s.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(l)}catch{n[r]=l}}return n}function p(e){if(!e)return null;const t=L();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Y(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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 Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=Y,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Te);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe);function Z(e,t,n,o){const i=(e||"").toLowerCase().trim();if(i)return i;if((t||"").toUpperCase()!=="A")return"";const a=n||"";if(!a.startsWith("#"))return"";const s=a.slice(1);if(!s)return"";const c=s.split("&"),r=(o||"").toLowerCase().trim();if(r)for(const u of c){const f=u.indexOf(":");if(f>0&&u.slice(0,f).toLowerCase().trim()===r)return u.slice(f+1).toLowerCase().trim()}const l=c[c.length-1]||"",d=l.indexOf(":");return(d>0?l.slice(d+1):l).toLowerCase().trim()}function ee(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(a=>(a.tagName||"").toUpperCase()==="A"&&(a.href||"").startsWith("#")),o=n.length>0&&n.length===e.length,i=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:o&&!i?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:o&&!!i,warning:null}}function te(e,t,n){const o=(e||"").toLowerCase().trim();return o&&Array.isArray(t)&&t.includes(o)?o:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(r){const l=r.getAttribute("data-ln-tabs-active");r[t]&&r[t]._applyActive(l)}function o(r,l){return(r.getAttribute(l)||r.id||"").toLowerCase().trim()}const i={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:x,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:o,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},a=V(i);function s(r){return this.dom=r,P(this,r,a),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const r=this.tabs.map(u=>({tagName:u.tagName,href:u.getAttribute("href")})),l=ee(r,this.nsKey);this.hashEnabled=l.hashEnabled,l.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):l.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const u of this.tabs){const f=Z(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=u:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',u)}for(const u of this.panels){const f=(u.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=u)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const u of this.tabs){if(u[t+"Trigger"])continue;const f=function(h){const C=u.tagName==="A";if(!C&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=Z(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),d.nsKey);b&&(C&&!Y(h)||(d.hashEnabled?p(d.nsKey)===b?d.dom.setAttribute("data-ln-tabs-active",b):y(d.nsKey,b):d.dom.setAttribute("data-ln-tabs-active",b)))};u.addEventListener("click",f),u[t+"Trigger"]=f,d._clickHandlers.push({el:u,handler:f})}if(this._onRequestSelect=function(u){const f=u.detail&&(u.detail.key||u.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const u=p(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",u!==null?u:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const u=te(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",u)}}s.prototype.select=function(r){const l=(r+"").toLowerCase().trim();l&&(this.hashEnabled?p(this.nsKey)===l?this.dom.setAttribute("data-ln-tabs-active",l):y(this.nsKey,l):this.dom.setAttribute("data-ln-tabs-active",l))},s.prototype._applyActive=function(r){var d;if(r=te(r,Object.keys(this.mapPanels),this.defaultKey),r===this.activeKey)return;const l=this.activeKey;if(l!==null&&re(this.dom,"ln-tabs:before-change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom}).defaultPrevented){l in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",l),this.hashEnabled&&p(this.nsKey)!==l&&y(this.nsKey,l));return}this.activeKey=r;for(const u in this.mapTabs){const f=this.mapTabs[u];u===r?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const u in this.mapPanels){const f=this.mapPanels[u],h=u===r;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const u=(d=this.mapPanels[r])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');u&&setTimeout(()=>u.focus({preventScroll:!0}),0)}q(this.dom,"ln-tabs:change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom})},s.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:r,handler:l}of this._clickHandlers)r.removeEventListener("click",l),delete r[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},G(e,t,s,"ln-tabs",{attributes:i,persist:{attr:"data-ln-tabs-active",hashActive:function(r){const l=Array.from(r.querySelectorAll("[data-ln-tab]")).map(function(u){return{tagName:u.tagName,href:u.getAttribute("href")}}),d=(r.getAttribute("data-ln-tabs-key")||r.id||"").toLowerCase().trim();return ee(l,d).hashEnabled}}})})()})();
|
|
1
|
+
(function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!v(i))return}e.apply(console,t)}}function I(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function se(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,r={},a=e.elements,s={};if(o)for(let l=0;l<a.length;l++){const n=a[l];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[n.name]||0)+1)}for(let l=0;l<a.length;l++){const n=a[l];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&s[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&r[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")r[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);r[n.name]=n.value===""||isNaN(c)?null:c}else r[n.name]=n.value}return r}function ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const o=e.elements,i=[],r={};for(let a=0;a<o.length;a++){const s=o[a];s.name&&s.type==="checkbox"&&(r[s.name]=(r[s.name]||0)+1)}for(let a=0;a<o.length;a++){const s=o[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const l=s.getAttribute("data-ln-fill-as")||s.name;if(!l||!(l in t))continue;const n=t[l];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(r[s.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});s.checked=c.indexOf(s.value)!==-1}else s.checked=ce(n);i.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),i.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<s.options.length;c++)s.options[c].selected=n.indexOf(s.options[c].value)!==-1;i.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),i.push(s)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=le);const $={};function de(e,t){$[e]=t}function fe(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=fe);function he(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function be(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=t}function we(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=be,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=he);const k={};function pe(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=k[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let s=0;s<o.length;s++){const l=o[s],n=l.getAttribute("data-ln-field");t[n]!=null&&(l.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<i.length;s++){const l=i[s],n=l.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&&l.setAttribute(u,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let s=0;s<r.length;s++){const l=r[s],n=l.getAttribute("data-ln-show");n in t&&l.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const l=a[s],n=l.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&&l.classList.toggle(u,!!t[f])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function j(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(s,l){return t[l]!==void 0?t[l]:""}))}const i=function(a,s){return t[s]!==void 0?t[s]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let a=0;a<r.length;a++){const s=r[a],l=s.attributes;for(let n=0;n<l.length;n++){const c=l[n];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function me(e,t,o,i,r,a){const s={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(s[d]=c)}const l=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(i(c));let u=s[d];if(u)r(u,c,n);else{const f=pe(o,a);if(!f||(j(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),r(u,c,n)}l.appendChild(u)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=ge,window.lnCore.renderList=me);function x(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function B(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function _(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const S=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(S.has(o))return S.get(o);const i=new Set(e||[]),r=function(a,s){const l=a.getAttribute(s);return l!==null&&i.has(l)?l:t};return S.set(o,r),r}function U(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function P(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function V(e,t,o,i,r){if(!e||t===null)return!0;const a=i||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const l=n=>{r?console.warn(n,r):console.warn(n)};if(s==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(l(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const n=e.values||[];return n.includes(t)?!0:(l(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return l(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(l(`[${a}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(l(`[${a}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(l(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(n){return l(`[${a}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,o){for(const i in o){const[r,a,s]=o[i];Object.defineProperty(e,i,{get:function(){return r(t,a,s)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=W(i.values,i.fallback);break;case"integer":r=B;break;case"float":r=U;break;case"boolean":r=_;break;case"list":r=H;break;case"json":r=P;break;case"string":default:r=x;break}r||(r=x),t[i.prop]=[r,o,i.fallback]}return t}function ye(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function Ce(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=Q,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=B,window.lnCore.attrBool=_,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=P);function p(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(a)&&p(e,s),e.querySelectorAll){const l=e.querySelectorAll(a);for(let n=0;n<l.length;n++)p(l[n],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(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 G(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=G(),o=e.observed||[];for(let i=0;i<o.length;i++){const r=o[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(a=>a.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Ce(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function X(e,t,o,i){for(let r=0;r<e.length;r++){const a=e[r];if(!t[a.attribute])continue;const s=a.effects&&a.effects[o];s?s(t,o,i):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,i)}}function xe(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=G(),r=i.byAttr.get(t),a=N()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!r&&!a)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(a&&v(s)){const l=i.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let c=0;c<l.length;c++)V(l[c].spec,n,t,l[c].componentTag,s)}if(window.lnCore._debugSink&&(o||r)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),o){const l=i.byReactive.get(t);l&&X(l,s,t,e.oldValue),i.reactiveWildcard.length&&X(i.reactiveWildcard,s,t,e.oldValue)}if(r)for(let l=0;l<r.length;l++){const n=r[l];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(J(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{xe(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function E(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=E();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}if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const a=r.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;s&&r.onSubtreeChange(s,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const l=t[s];if(l.selector&&l.attribute&&l.ComponentFn){if(!a)r.matches&&r.matches(l.query)&&p(r,l);else if(r.matches&&r.matches(l.query)&&p(r,l),r.querySelectorAll){const n=r.querySelectorAll(l.query);for(let c=0;c<n.length;c++)p(n[c],l)}}l.onInit&&l.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const l=t[s],n=l.query;if(n){if(!a)r.matches&&r.matches(n)&&L(r,l);else if(r.matches&&r.matches(n)&&L(r,l),r.querySelectorAll){const c=r.querySelectorAll(n);for(let d=0;d<c.length;d++)L(c[d],l)}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{Se(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){E().push(e),Y()}function Z(e,t,o,i,r={}){const a=r.extraAttributes||[],s=r.onAttributeChange||null,l=r.onSubtreeChange||null,n=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,u=r.attributes||null,f=u?ye(u):d,h=u?new Set(Object.keys(u)):null,A=r.persist||null;function b(q){const w=q||document.body;if(J(w,e,t,o),u&&N())for(const m in u){const Ie=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let F=0;F<D.length;F++){const K=D[F];v(K)&&V(Ie,K.getAttribute(m),m,i,K)}}n&&n(w)}const O=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let w;for(;(w=q.exec(e))!==null;)O.push(w[1])}else O.push(e);ke({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:o,onInit:n,observed:O.concat(a),onAttributeChange:s,onAttrChange:c,effects:f,declared:h,persist:A}),_e();const Ke=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=r.subtreeQuery||(Ke?e:"["+e+"]");E().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:l,query:Ne}),Y(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Ee);function ie(){Ae()>0?ve(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ie):ie(),b}function ee(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},i=ee(t);if(!i)return o;const r=i.split("&");for(let a=0;a<r.length;a++){const s=r[a];if(!s)continue;const l=s.indexOf(":"),n=l>-1?s.slice(0,l):s,c=l>-1?s.slice(l+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function g(e){if(!e)return null;const t=T();return e in t?t[e]:null}function C(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const r=Object.keys(o).map(function(a){const s=o[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");ee(location.hash)!==r&&(location.hash=r)}function te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),r=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=g,window.lnCore.hashSet=C,window.lnCore.hashLinkClick=te,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=De);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 ne(e,t,o,i){const r=(e||"").toLowerCase().trim();if(r)return r;if((t||"").toUpperCase()!=="A")return"";const a=o||"";if(!a.startsWith("#"))return"";const s=a.slice(1);if(!s)return"";const l=s.split("&"),n=(i||"").toLowerCase().trim();if(n)for(const u of l){const f=u.indexOf(":");if(f>0&&u.slice(0,f).toLowerCase().trim()===n)return u.slice(f+1).toLowerCase().trim()}const c=l[l.length-1]||"",d=c.indexOf(":");return(d>0?c.slice(d+1):c).toLowerCase().trim()}function re(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const o=e.filter(a=>(a.tagName||"").toUpperCase()==="A"&&(a.href||"").startsWith("#")),i=o.length>0&&o.length===e.length,r=(t||"").toLowerCase().trim();return o.length>0&&o.length!==e.length?{hashEnabled:!1,warning:"mixed"}:i&&!r?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:i&&!!r,warning:null}}function oe(e,t,o){const i=(e||"").toLowerCase().trim();return i&&Array.isArray(t)&&t.includes(i)?i:(o||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function o(n){const c=n.getAttribute("data-ln-tabs-active");n[t]&&n[t]._applyActive(c)}function i(n,c){return(n.getAttribute(c)||n.id||"").toLowerCase().trim()}const r={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:o,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:_,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:i,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},a=z(r);function s(n){return this.dom=n,Q(this,n,a),this.activeKey=null,l.call(this),this}function l(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const n=this.tabs.map(u=>({tagName:u.tagName,href:u.getAttribute("href")})),c=re(n,this.nsKey);this.hashEnabled=c.hashEnabled,c.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):c.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const u of this.tabs){const f=ne(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=u:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',u)}for(const u of this.panels){const f=(u.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=u)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const u of this.tabs){if(u[t+"Trigger"])continue;const f=function(h){const A=u.tagName==="A";if(!A&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=ne(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),d.nsKey);b&&(A&&!te(h)||(d.hashEnabled?g(d.nsKey)===b?d.dom.setAttribute("data-ln-tabs-active",b):C(d.nsKey,b):d.dom.setAttribute("data-ln-tabs-active",b)))};u.addEventListener("click",f),u[t+"Trigger"]=f,d._clickHandlers.push({el:u,handler:f})}if(this._onRequestSelect=function(u){const f=u.detail&&(u.detail.key||u.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const u=g(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",u!==null?u:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const u=oe(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",u)}}s.prototype.select=function(n){const c=(n+"").toLowerCase().trim();c&&(this.hashEnabled?g(this.nsKey)===c?this.dom.setAttribute("data-ln-tabs-active",c):C(this.nsKey,c):this.dom.setAttribute("data-ln-tabs-active",c))},s.prototype._applyActive=function(n){var d;if(n=oe(n,Object.keys(this.mapPanels),this.defaultKey),n===this.activeKey)return;const c=this.activeKey;if(c!==null&&se(this.dom,"ln-tabs:before-change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom}).defaultPrevented){c in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",c),this.hashEnabled&&g(this.nsKey)!==c&&C(this.nsKey,c));return}this.activeKey=n;for(const u in this.mapTabs){const f=this.mapTabs[u];u===n?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const u in this.mapPanels){const f=this.mapPanels[u],h=u===n;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const u=(d=this.mapPanels[n])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');u&&setTimeout(()=>u.focus({preventScroll:!0}),0)}I(this.dom,"ln-tabs:change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom})},s.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:n,handler:c}of this._clickHandlers)n.removeEventListener("click",c),delete n[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},Z(e,t,s,"ln-tabs",{attributes:r,persist:{attr:"data-ln-tabs-active",hashActive:function(n){const c=Array.from(n.querySelectorAll("[data-ln-tab]")).map(function(u){return{tagName:u.tagName,href:u.getAttribute("href")}}),d=(n.getAttribute("data-ln-tabs-key")||n.id||"").toLowerCase().trim();return re(c,d).hashEnabled}}})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function W(){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 T(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!T(o))return}e.apply(console,t)}}function ie(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&i[r.name].push(r.options[c].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const c=Number(r.value);i[r.name]=r.value===""||isNaN(c)?null:c}else i[r.name]=r.value}return i}function ae(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const r=t[a];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(r).split(",").map(function(h){return h.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ae(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<l.options.length;c++)l.options[c].selected=r.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=le);const U={};function ce(e,t){U[e]=t}function fe(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=fe);function de(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 V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){ie(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const H={};function we(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];H[n]=t}function M(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return H[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=M,window.lnCore.ensureLocaleObserver=V);const D={};function he(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],r=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const h=r[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();t[b]!=null&&a.setAttribute(w,t[b])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],r=a.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const h=r[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();b in t&&a.classList.toggle(w,!!t[b])}}return e}function me(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)J(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let r=0;r<a.length;r++){const c=a[r];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const c=e.children[r],h=c.getAttribute("data-ln-render-key");h&&(l[h]=c)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],h=String(o(c));let w=l[h];if(w)i(w,c,r);else{const b=he(n,s);if(!b||(Q(b,c),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),i(w,c,r)}a.appendChild(w)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=J,window.lnCore.lnFill=me,window.lnCore.renderList=be);function F(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function z(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function K(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return I.set(n,i),i}function G(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function X(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Z(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=Y(o.values,o.fallback);break;case"integer":i=z;break;case"float":i=G;break;case"boolean":i=K;break;case"list":i=P;break;case"json":i=X;break;case"string":default:i=F;break}i||(i=F),t[o.prop]=[i,n,o.fallback]}return t}function ye(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ge,window.lnCore.attrSpec=pe,window.lnCore.attrStr=F,window.lnCore.attrInt=z,window.lnCore.attrBool=K,window.lnCore.attrList=P,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function E(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new o(a)}catch(r){console.error("["+n+"] init failed",a,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=ee(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=ee(),i=o.byAttr.get(n);if(W()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&T(t)){const s=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)Z(s[a].spec,l,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&te(s,t,n,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(E(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ne(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=ne();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];E(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&a.push(o);for(let r=0;r<a.length;r++){const c=a[r];if(!document.contains(c)){const h=c[s.attribute];if(h&&typeof h.destroy=="function")try{h.destroy()}catch(w){console.error("["+s.attribute+"] destroy failed",c,w)}delete c[s.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Se(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function oe(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,c=i.onAttrChange||null,h=i.effects||null,w=i.attributes||null,b=w?ye(w):h,O=w?new Set(Object.keys(w)):null,L=i.persist||null;function A(v){const p=v||document.body;if(E(p,e,t,n),w&&W())for(const u in w){const f=w[u],d=Array.from(p.querySelectorAll("["+u+"]"));p.matches&&p.matches("["+u+"]")&&d.push(p);for(let g=0;g<d.length;g++){const m=d[g];T(m)&&Z(f,m.getAttribute(u),u,o,m)}}r&&r(p)}const x=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)x.push(p[1])}else x.push(e);_e({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:l,onAttrChange:c,effects:b,declared:O,persist:L}),ke();const N=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=i.subtreeQuery||(N?e:"["+e+"]");ne().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:C}),Oe(),window[t]=A,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe);function _(){ve()>0?Ae(function(){A(document.body)}):A(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),A}function re(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},o=re(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),r=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(c)}catch{n[r]=c}}return n}function Le(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Te(e,t){if(!e)return;const n=$();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("&");re(location.hash)!==i&&(location.hash=i)}function Me(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Le,window.lnCore.hashSet=Te,window.lnCore.hashLinkClick=Me,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=$e);function Ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ne);function Re(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,o=new Date(n);return isNaN(o.getTime())?null:o}if(typeof e=="string"){const n=e.trim();if(!n)return null;const o=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(o){const s=+o[1],l=+o[2],a=+o[3],r=new Date(s,l-1,a);return r.getFullYear()!==s||r.getMonth()!==l-1||r.getDate()!==a?null:r}const i=new Date(n);return isNaN(i.getTime())?null:i}return null}function qe(e,t=Date.now()){if(!e)return{value:0,unit:"second",isOlderThanMonth:!1};const n=typeof t=="number"?t:t.getTime(),o=e.getTime(),i=Math.floor((o-n)/1e3),s=Math.abs(i);return s<10?{value:0,unit:"second",isOlderThanMonth:!1}:s<60?{value:i,unit:"second",isOlderThanMonth:!1}:s<3600?{value:Math.round(i/60),unit:"minute",isOlderThanMonth:!1}:s<86400?{value:Math.round(i/3600),unit:"hour",isOlderThanMonth:!1}:s<604800?{value:Math.round(i/86400),unit:"day",isOlderThanMonth:!1}:s<2592e3?{value:Math.round(i/604800),unit:"week",isOlderThanMonth:!1}:{value:Math.round(i/2592e3),unit:"month",isOlderThanMonth:!0}}function S(e,t,n=new Date){switch(e){case"full":return{dateStyle:"long",timeStyle:"short"};case"date":return{dateStyle:"medium"};case"time":return{timeStyle:"short"};case"short":default:{const o={month:"short",day:"numeric"};return t&&t.getFullYear()!==n.getFullYear()&&(o.year="numeric"),o}}}(function(){const e="data-ln-time",t="lnTime";if(window[t]!==void 0)return;const n={"data-ln-time":{type:"enum",values:["relative","short","medium","long","iso"],fallback:"relative",effect:v,description:"Time format style preset or activator"},"data-ln-time-locale":{type:"string",effect:v,description:"BCP 47 language tag override for time formatting"}},o={},i={};function s(u){return u.getAttribute("data-ln-time-locale")||de(u)}function l(u,f){const d=(u||"")+"|"+JSON.stringify(f);return o[d]||(o[d]=new Intl.DateTimeFormat(u,f)),o[d]}function a(u){const f=u||"";return i[f]||(i[f]=new Intl.RelativeTimeFormat(u,{numeric:"auto",style:"narrow"})),i[f]}const r=new Set;let c=null;function h(){c||(c=setInterval(b,6e4))}function w(){c&&(clearInterval(c),c=null)}function b(){for(const u of r){if(!document.body.contains(u.dom)){r.delete(u);continue}C(u)}r.size===0&&w()}function O(u,f){const d=M(f),g=(f||"").toLowerCase().split("-")[0],m=l(f,S("full",u)),y=m.resolvedOptions().locale.toLowerCase().split("-")[0];if(d&&y!==g&&d.monthsLong){const R=d.monthsLong[u.getMonth()],q=u.getDate(),B=u.getFullYear(),j=String(u.getHours()).padStart(2,"0"),Be=String(u.getMinutes()).padStart(2,"0");return`${q} ${R} ${B}, ${j}:${Be}`}return m.format(u)}function L(u,f){const d=S("short",u),g=M(f),m=(f||"").toLowerCase().split("-")[0],y=l(f,d),R=y.resolvedOptions().locale.toLowerCase().split("-")[0];if(g&&R!==m&&g.monthsShort){const q=g.monthsShort[u.getMonth()],B=u.getDate(),j=d.year?" "+u.getFullYear():"";return`${B} ${q}${j}`}return y.format(u)}function A(u,f){return l(f,S("date",u)).format(u)}function x(u,f){return l(f,S("time",u)).format(u)}function N(u,f){const d=qe(u);return d.isOlderThanMonth?L(u,f):a(f).format(d.value,d.unit)}function C(u){const f=u.dom.getAttribute("datetime");if(!f)return;const d=Re(f);if(!d)return;const g=u.dom.getAttribute(e)||"short",m=s(u.dom);let y;switch(g){case"relative":y=N(d,m);break;case"full":y=O(d,m);break;case"date":y=A(d,m);break;case"time":y=x(d,m);break;default:y=L(d,m);break}u.dom.textContent=y,g!=="full"&&(u.dom.title=O(d,m))}function _(u){this.dom=u;const f=this;return this._onLocaleChange=function(){C(f)},V(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),C(this),u.getAttribute(e)==="relative"&&(r.add(this),h()),this}_.prototype.render=function(){C(this)},_.prototype.destroy=function(){this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),r.delete(this),r.size===0&&w(),delete this.dom[t]};function v(u){const f=u[t];if(!f)return;u.getAttribute(e)==="relative"?(r.add(f),h()):(r.delete(f),r.size===0&&w()),C(f)}function p(u){u.nodeType===1&&u.hasAttribute&&u.hasAttribute(e)&&u[t]&&C(u[t])}oe(e,t,_,"ln-time",{attributes:n,extraAttributes:["datetime","lang"],onAttributeChange:v,onInit:p})})()})();
|
|
1
|
+
(function(){"use strict";function V(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!D(o))return}e.apply(console,t)}}function ae(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ce(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ue(e,t){const i=!!(t&&t.typed),o=t&&t.exclude,r={},s=e.elements,l={};if(i)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")i&&l[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&r[n.name].push(n.options[u].value)}else if(i&&n.type==="hidden")r[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const u=Number(n.value);r[n.name]=n.value===""||isNaN(u)?null:u}else r[n.name]=n.value}return r}function fe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const i=e.elements,o=[],r={};for(let s=0;s<i.length;s++){const l=i[s];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let s=0;s<i.length;s++){const l=i[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(r[l.name]>1){const u=String(n).split(",").map(function(w){return w.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=fe(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<l.options.length;u++)l.options[u].selected=n.indexOf(l.options[u].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ue,window.lnCore.resolveFormMethod=ce);const H={};function we(e,t){H[e]=t}function he(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=he);function be(e){const t=e?e.closest("[lang]"):null,i=(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 i?i.trim():"en-US"}function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){ae(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function me(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];Q[i]=t}function E(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=me,window.lnCore.getLocaleFallback=E,window.lnCore.ensureLocaleObserver=J);const M={};function ge(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=M[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const w=n[u].trim().split(":");if(w.length!==2)continue;const h=w[0].trim(),m=w[1].trim();t[m]!=null&&a.setAttribute(h,t[m])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],n=a.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const w=n[u].trim().split(":");if(w.length!==2)continue;const h=w[0].trim(),m=w[1].trim();m in t&&a.classList.toggle(h,!!t[m])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<i.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[o],t??null),i[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(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 K(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const s=i.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const l=r[s],a=l.attributes;for(let n=0;n<a.length;n++){const u=a[n];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ye(e,t,i,o,r,s){const l={};for(let n=0;n<e.children.length;n++){const u=e.children[n],w=u.getAttribute("data-ln-render-key");w&&(l[w]=u)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],w=String(o(u));let h=l[w];if(h)r(h,u,n);else{const m=ge(i,s);if(!m||(K(m,u),h=m.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",w),r(h,u,n)}a.appendChild(h)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=z,window.lnCore.lnFill=pe,window.lnCore.renderList=ye);function F(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function P(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function Y(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const I=new Map;function X(e,t){const i=(e?e.join("|"):"")+"::"+t;if(I.has(i))return I.get(i);const o=new Set(e||[]),r=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return I.set(i,r),r}function Z(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function ee(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function te(e,t,i,o,r){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=n=>{r?console.warn(n,r):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ce(e,t,i){for(const o in i){const[r,s,l]=i[o];Object.defineProperty(e,o,{get:function(){return r(t,s,l)},enumerable:!0,configurable:!0})}return e}function ve(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=X(o.values,o.fallback);break;case"integer":r=P;break;case"float":r=Z;break;case"boolean":r=Y;break;case"list":r=G;break;case"json":r=ee;break;case"string":default:r=F;break}r||(r=F),t[o.prop]=[r,i,o.fallback]}return t}function Ae(e){const t={};for(const i in e){const o=e[i];o&&o.effect&&(t[i]=o.effect)}return Object.keys(t).length?t:null}function _e(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=Ce,window.lnCore.attrSpec=ve,window.lnCore.attrStr=F,window.lnCore.attrInt=P,window.lnCore.attrBool=Y,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function x(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function ne(e,t,i,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(s)&&x(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)x(a[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function re(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=re(),i=e.observed||[];for(let o=0;o<i.length;o++){const r=i[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=_e(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,i,o){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const l=s.effects&&s.effects[i];l?l(t,i,o):s.onAttrChange&&(!s.declared||s.declared.has(i))&&s.onAttrChange(t,i,o)}}function Oe(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=re(),r=o.byAttr.get(t),s=V()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!r&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&D(l)){const a=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let u=0;u<a.length;u++)te(a[u].spec,n,t,a[u].componentTag,l)}if(window.lnCore._debugSink&&(i||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const a=o.byReactive.get(t);a&&oe(a,l,t,e.oldValue),o.reactiveWildcard.length&&oe(o.reactiveWildcard,l,t,e.oldValue)}if(r)for(let a=0;a<r.length;a++){const n=r[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(ne(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{Oe(t[i])}catch(o){console.error("[ln-core] mutation handler failed",t[i].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Te(e){const t=$();if(!t.length)return;const i=e.target;if(i){const o=i.nodeType===1?i:i.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const s=r.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;l&&r.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const a=t[l];if(a.selector&&a.attribute&&a.ComponentFn){if(!s)r.matches&&r.matches(a.query)&&x(r,a);else if(r.matches&&r.matches(a.query)&&x(r,a),r.querySelectorAll){const n=r.querySelectorAll(a.query);for(let u=0;u<n.length;u++)x(n[u],a)}}a.onInit&&a.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const a=t[l],n=a.query;if(n){if(!s)r.matches&&r.matches(n)&&N(r,a);else if(r.matches&&r.matches(n)&&N(r,a),r.querySelectorAll){const u=r.querySelectorAll(n);for(let w=0;w<u.length;w++)N(u[w],a)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{Te(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function De(e){$().push(e),ie()}function le(e,t,i,o,r={}){const s=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,n=r.onInit||null,u=r.onAttrChange||null,w=r.effects||null,h=r.attributes||null,m=h?Ae(h):w,L=h?new Set(Object.keys(h)):null,T=r.persist||null;function A(v){const p=v||document.body;if(ne(p,e,t,i),h&&V())for(const c in h){const f=h[c],d=Array.from(p.querySelectorAll("["+c+"]"));p.matches&&p.matches("["+c+"]")&&d.push(p);for(let g=0;g<d.length;g++){const b=d[g];D(b)&&te(f,b.getAttribute(c),c,o,b)}}n&&n(p)}const S=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)S.push(p[1])}else S.push(e);ke({selector:e,attribute:t,componentTag:o,attributes:h,ComponentFn:i,onInit:n,observed:S.concat(s),onAttributeChange:l,onAttrChange:u,effects:m,declared:L,persist:T}),Le();const R=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=r.subtreeQuery||(R?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:a,query:C}),ie(),window[t]=A,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=De);function _(){xe()>0?Se(function(){A(document.body)}):A(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),A}function se(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,i={},o=se(t);if(!o)return i;const r=o.split("&");for(let s=0;s<r.length;s++){const l=r[s];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,u=a>-1?l.slice(a+1):"";if(n)try{i[n]=decodeURIComponent(u)}catch{i[n]=u}}return i}function Ee(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Me(e,t){if(!e)return;const i=q();t==null?delete i[e]:i[e]=String(t);const r=Object.keys(i).map(function(s){const l=i[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==r&&(location.hash=r)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ne(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:i,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=Ne,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Re);function Be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Be);function je(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const i=t<1e11?t*1e3:t,o=new Date(i);return isNaN(o.getTime())?null:o}if(typeof e=="string"){const i=e.trim();if(!i)return null;const o=/^(\d{4})-(\d{2})-(\d{2})$/.exec(i);if(o){const s=+o[1],l=+o[2],a=+o[3],n=new Date(s,l-1,a);return n.getFullYear()!==s||n.getMonth()!==l-1||n.getDate()!==a?null:n}const r=new Date(i);return isNaN(r.getTime())?null:r}return null}function We(e,t=Date.now()){if(!e)return{value:0,unit:"second",isOlderThanMonth:!1};const i=typeof t=="number"?t:t.getTime(),o=e.getTime(),r=Math.floor((o-i)/1e3),s=Math.abs(r);return s<10?{value:0,unit:"second",isOlderThanMonth:!1}:s<60?{value:r,unit:"second",isOlderThanMonth:!1}:s<3600?{value:Math.round(r/60),unit:"minute",isOlderThanMonth:!1}:s<86400?{value:Math.round(r/3600),unit:"hour",isOlderThanMonth:!1}:s<604800?{value:Math.round(r/86400),unit:"day",isOlderThanMonth:!1}:s<2592e3?{value:Math.round(r/604800),unit:"week",isOlderThanMonth:!1}:{value:Math.round(r/2592e3),unit:"month",isOlderThanMonth:!0}}function O(e,t,i=new Date){switch(e){case"full":return{dateStyle:"long",timeStyle:"short"};case"date":return{dateStyle:"medium"};case"time":return{timeStyle:"short"};case"short":default:{const o={month:"short",day:"numeric"};return t&&t.getFullYear()!==i.getFullYear()&&(o.year="numeric"),o}}}(function(){const e="data-ln-time",t="lnTime";if(window[t]!==void 0)return;const i={"data-ln-time":{type:"enum",values:["relative","short","medium","long","iso"],fallback:"relative",effect:v,description:"Time format style preset or activator"},"data-ln-time-locale":{type:"string",effect:v,description:"BCP 47 language tag override for time formatting"}},o={},r={};function s(c){return c.getAttribute("data-ln-time-locale")||be(c)}function l(c,f){const d=(c||"")+"|"+JSON.stringify(f);return o[d]||(o[d]=new Intl.DateTimeFormat(c,f)),o[d]}function a(c){const f=c||"";return r[f]||(r[f]=new Intl.RelativeTimeFormat(c,{numeric:"auto",style:"narrow"})),r[f]}const n=new Set;let u=null;function w(){u||(u=setInterval(m,6e4))}function h(){u&&(clearInterval(u),u=null)}function m(){for(const c of n){if(!document.body.contains(c.dom)){n.delete(c);continue}C(c)}n.size===0&&h()}function L(c,f){const d=E(f),g=(f||"").toLowerCase().split("-")[0],b=l(f,O("full",c)),y=b.resolvedOptions().locale.toLowerCase().split("-")[0];if(d&&y!==g&&d.monthsLong){const B=d.monthsLong[c.getMonth()],j=c.getDate(),W=c.getFullYear(),U=String(c.getHours()).padStart(2,"0"),Ue=String(c.getMinutes()).padStart(2,"0");return`${j} ${B} ${W}, ${U}:${Ue}`}return b.format(c)}function T(c,f){const d=O("short",c),g=E(f),b=(f||"").toLowerCase().split("-")[0],y=l(f,d),B=y.resolvedOptions().locale.toLowerCase().split("-")[0];if(g&&B!==b&&g.monthsShort){const j=g.monthsShort[c.getMonth()],W=c.getDate(),U=d.year?" "+c.getFullYear():"";return`${W} ${j}${U}`}return y.format(c)}function A(c,f){return l(f,O("date",c)).format(c)}function S(c,f){return l(f,O("time",c)).format(c)}function R(c,f){const d=We(c);return d.isOlderThanMonth?T(c,f):a(f).format(d.value,d.unit)}function C(c){const f=c.dom.getAttribute("datetime");if(!f)return;const d=je(f);if(!d)return;const g=c.dom.getAttribute(e)||"short",b=s(c.dom);let y;switch(g){case"relative":y=R(d,b);break;case"full":y=L(d,b);break;case"date":y=A(d,b);break;case"time":y=S(d,b);break;default:y=T(d,b);break}c.dom.textContent=y,g!=="full"&&(c.dom.title=L(d,b))}function _(c){this.dom=c;const f=this;return this._onLocaleChange=function(){C(f)},J(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),C(this),c.getAttribute(e)==="relative"&&(n.add(this),w()),this}_.prototype.render=function(){C(this)},_.prototype.destroy=function(){this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),n.delete(this),n.size===0&&h(),delete this.dom[t]};function v(c){const f=c[t];if(!f)return;c.getAttribute(e)==="relative"?(n.add(f),w()):(n.delete(f),n.size===0&&h()),C(f)}function p(c){c.nodeType===1&&c.hasAttribute&&c.hasAttribute(e)&&c[t]&&C(c[t])}le(e,t,_,"ln-time",{attributes:i,extraAttributes:["datetime","lang"],onAttributeChange:v,onInit:p})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!x(o))return}e.apply(console,t)}}function Z(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function 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 ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&l[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);l[r.name]=r.value===""||isNaN(u)?null:u}else l[r.name]=r.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[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 r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(r).split(",").map(function(p){return p.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ne(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<i.options.length;u++)i.options[u].selected=r.indexOf(i.options[u].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const $={};function re(e,t){$[e]=t}function ie(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){Z(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=se,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=le);const _={};function B(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ce(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return B(t,n)}function S(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),b=p[1].trim();t[b]!=null&&c.setAttribute(w,t[b])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),b=p[1].trim();b in t&&c.classList.toggle(w,!!t[b])}}return e}function ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)S(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 R(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(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function de(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const u=e.children[r],p=u.getAttribute("data-ln-render-key");p&&(i[p]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],p=String(o(u));let w=i[p];if(w)l(w,u,r);else{const b=B(n,s);if(!b||(R(b,u),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",p),l(w,u,r)}c.appendChild(w)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=S,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function k(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function v(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return E.set(n,l),l}function U(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function V(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function P(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=H(o.values,o.fallback);break;case"integer":l=v;break;case"float":l=U;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=V;break;case"string":default:l=k;break}l||(l=k),t[o.prop]=[l,n,o.fallback]}return t}function fe(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function we(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=J,window.lnCore.attrStr=k,window.lnCore.attrInt=v,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function L(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(r){console.error("["+n+"] init failed",c,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){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 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 me(e){const t=K(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=we(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=K(),l=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&x(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)P(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&z(s,t,n,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const i=l[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(L(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ye(e){const t=G();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];L(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,c=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&c.push(o);for(let r=0;r<c.length;r++){const u=c[r];if(!document.contains(u)){const p=u[s.attribute];if(p&&typeof p.destroy=="function")try{p.destroy()}catch(w){console.error("["+s.attribute+"] destroy failed",u,w)}delete u[s.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ye(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,r=l.onInit||null,u=l.onAttrChange||null,p=l.effects||null,w=l.attributes||null,b=w?fe(w):p,O=w?new Set(Object.keys(w)):null,q=l.persist||null;function C(m){const g=m||document.body;if(L(g,e,t,n),w&&F())for(const y in w){const Oe=w[y],I=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&I.push(g);for(let D=0;D<I.length;D++){const N=I[D];x(N)&&P(Oe,N.getAttribute(y),y,o,N)}}r&&r(g)}const a=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let g;for(;(g=m.exec(e))!==null;)a.push(g[1])}else a.push(e);me({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:a.concat(s),onAttributeChange:i,onAttrChange:u,effects:b,declared:O,persist:q}),ge();const d=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,f=l.subtreeQuery||(d?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:f}),Ce(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function h(){pe()>0?he(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),C}function Y(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Ae(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ve(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function xe(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Ae,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te),(function(){const e="data-ln-toast",t="lnToast",n="ln-toast-item";if(window[t]!==void 0)return;const o={"data-ln-toast":{type:"marker",description:"Initializes the toast notifications container"},"data-ln-toast-timeout":{prop:"timeoutDefault",type:"integer",read:v,fallback:6e3,min:500,description:"Default auto-dismiss timeout in ms"},"data-ln-toast-max":{prop:"max",type:"integer",read:v,fallback:5,min:1,description:"Maximum visible concurrent toast notifications"},"data-ln-toast-close":{type:"trigger",description:"Click dismiss trigger inside a toast item"},"data-ln-toast-item":{type:"marker",description:"Individual toast notification element"}},l=J(o);function s(a){if(!(!a||!(a instanceof HTMLElement))&&(a.hasAttribute("popover")||a.setAttribute("popover","manual"),typeof a.showPopover=="function")){if(a.matches(":popover-open"))try{a.hidePopover()}catch{}try{a.showPopover()}catch{}}}function i(a){if(!a||!(a instanceof HTMLElement))return;if(a.querySelectorAll("[data-ln-toast-item]").length===0&&typeof a.hidePopover=="function"&&a.matches(":popover-open"))try{a.hidePopover()}catch{}}function c(a){this.dom=a,Q(this,a,l);const d=Array.from(a.querySelectorAll("[data-ln-toast-item]"));for(;d.length>this.max;)a.removeChild(d.shift());for(const f of d)O(f,this);return d.length>0&&s(a),this}c.prototype.enqueue=function(a){if(!a)return;const d=r(a,this.dom);if(!d)return;const f=Number.isFinite(a.timeout)?a.timeout:this.timeoutDefault;p(this,d),f>0&&(d._timer=setTimeout(()=>w(d),f))},c.prototype.clear=function(){for(const a of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(a)},c.prototype.destroy=function(){if(this.dom[t]){for(const a of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(a);i(this.dom),delete this.dom[t]}};function r(a,d){const f=((a.type||"")+"").trim().toLowerCase(),h=ce(d,n,"ln-toast");if(!h)return console.warn('[ln-toast] Template "'+n+'" not found'),null;S(h,{type:f,title:a.title,message:typeof a.message=="string"?a.message:void 0});const m=h.firstElementChild;if(!m)return null;m.hasAttribute("data-ln-toast-item")||m.setAttribute("data-ln-toast-item",""),m.classList.add("ln-enter");const g=m.querySelector(".body");g&&u(g,a);const y=m.querySelector("[data-ln-toast-close]");return y&&y.addEventListener("click",function(){w(m)}),m}function u(a,d){if(Array.isArray(d.message)){const f=document.createElement("ul");for(const h of d.message){const m=document.createElement("li");m.textContent=h,f.appendChild(m)}a.appendChild(f)}if(d.data&&d.data.errors){const f=document.createElement("ul");for(const h of Object.values(d.data.errors).flat()){const m=document.createElement("li");m.textContent=h,f.appendChild(m)}a.appendChild(f)}}function p(a,d){const f=Array.from(a.dom.querySelectorAll("[data-ln-toast-item]"));for(;f.length>=a.max&&f.length>0;)a.dom.removeChild(f.shift());a.dom.appendChild(d),s(a.dom),requestAnimationFrame(()=>d.classList.remove("ln-enter"))}function w(a){if(!a||!a.parentNode)return;const d=a.parentNode;clearTimeout(a._timer),a.classList.remove("ln-enter"),a.classList.add("ln-out"),setTimeout(()=>{a.parentNode&&(a.parentNode.removeChild(a),i(d))},200)}function b(a){let d=a&&a.container;return typeof d=="string"&&(d=document.querySelector(d)),d instanceof HTMLElement||(d=document.querySelector("["+e+"]")||document.getElementById("ln-toast-container")),d||null}function O(a,d){if(a._lnToastHydrated)return;a._lnToastHydrated=!0;const f=a.querySelector("[data-ln-toast-close]");f&&f.addEventListener("click",function(){w(a)});const h=+(a.getAttribute("data-ln-toast-timeout")??d.timeoutDefault);h>0&&(a._timer=setTimeout(function(){w(a)},h))}function q(a){const d=a.detail||{},f=b(d);if(!f){console.warn("[ln-toast] No toast container found");return}(f[t]||(f[t]=new c(f))).enqueue(d)}function C(a){const d=a&&a.detail||{};if(d.container){const f=b(d);f&&(f[t]||(f[t]=new c(f))).clear()}else{const f=document.querySelectorAll("["+e+"]");for(const h of Array.from(f))(h[t]||(h[t]=new c(h))).clear()}}A(function(){window.addEventListener("ln-toast:enqueue",q),window.addEventListener("ln-toast:clear",C),window.addEventListener("ln-modal:open",function(){const a=document.querySelectorAll("["+e+"], #ln-toast-container");for(const d of Array.from(a))d.querySelectorAll("[data-ln-toast-item]").length>0&&s(d)})},"ln-toast"),X(e,t,c,"ln-toast",{attributes:o})})()})();
|
|
1
|
+
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(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(!x(r))return}e.apply(console,t)}}function ne(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function 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 oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,i={},a=e.elements,l={};if(o)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[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")o&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&i[n.name].push(n.options[u].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const u=Number(n.value);i[n.name]=n.value===""||isNaN(u)?null:u}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,r=[],i={};for(let a=0;a<o.length;a++){const l=o[a];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<o.length;a++){const l=o[a];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(n).split(",").map(function(h){return h.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ie(n);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<l.options.length;u++)l.options[u].selected=n.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=oe);const B={};function se(e,t){B[e]=t}function ae(e){return B[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(){ne(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ue(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ce);const S={};function j(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=S[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function fe(e,t,o){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return j(t,o)}function k(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const h=n[u].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();t[b]!=null&&s.setAttribute(w,t[b])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],n=s.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const h=n[u].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();b in t&&s.classList.toggle(w,!!t[b])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)k(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function W(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const l=i[a],s=l.attributes;for(let n=0;n<s.length;n++){const u=s[n];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function he(e,t,o,r,i,a){const l={};for(let n=0;n<e.children.length;n++){const u=e.children[n],h=u.getAttribute("data-ln-render-key");h&&(l[h]=u)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],h=String(r(u));let w=l[h];if(w)i(w,u,n);else{const b=j(o,a);if(!b||(W(b,u),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),i(w,u,n)}s.appendChild(w)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=k,window.lnCore.lnFill=we,window.lnCore.renderList=he);function E(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function _(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function H(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const L=new Map;function V(e,t){const o=(e?e.join("|"):"")+"::"+t;if(L.has(o))return L.get(o);const r=new Set(e||[]),i=function(a,l){const s=a.getAttribute(l);return s!==null&&r.has(s)?s:t};return L.set(o,i),i}function P(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function Q(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function J(e,t,o,r,i){if(!e||t===null)return!0;const a=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="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(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(l==="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 K(e,t,o){for(const r in o){const[i,a,l]=o[r];Object.defineProperty(e,r,{get:function(){return i(t,a,l)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=V(r.values,r.fallback);break;case"integer":i=_;break;case"float":i=P;break;case"boolean":i=H;break;case"list":i=U;break;case"json":i=Q;break;case"string":default:i=E;break}i||(i=E),t[r.prop]=[i,o,r.fallback]}return t}function pe(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function 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=K,window.lnCore.attrSpec=z,window.lnCore.attrStr=E,window.lnCore.attrInt=_,window.lnCore.attrBool=H,window.lnCore.attrList=U,window.lnCore.attrEnum=V,window.lnCore.attrFloat=P,window.lnCore.attrJson=Q);function v(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function G(e,t,o,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(a)&&v(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)v(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=X(),o=e.observed||[];for(let r=0;r<o.length;r++){const i=o[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=me(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 Y(e,t,o,r){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const l=a.effects&&a.effects[o];l?l(t,o,r):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,r)}}function Ce(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=X(),i=r.byAttr.get(t),a=M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!i&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&x(l)){const s=r.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let u=0;u<s.length;u++)J(s[u].spec,n,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),o){const s=r.byReactive.get(t);s&&Y(s,l,t,e.oldValue),r.reactiveWildcard.length&&Y(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(G(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Ae(){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{Ce(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ve(e){const t=q();if(!t.length)return;const o=e.target;if(o){const r=o.nodeType===1?o:o.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const i=t[r];if(i.onSubtreeChange&&i.query){const a=i.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&i.onSubtreeChange(l,e)}}for(let r=0;r<e.addedNodes.length;r++){const i=e.addedNodes[r];if(i.nodeType===1){const a=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)i.matches&&i.matches(s.query)&&v(i,s);else if(i.matches&&i.matches(s.query)&&v(i,s),i.querySelectorAll){const n=i.querySelectorAll(s.query);for(let u=0;u<n.length;u++)v(n[u],s)}}s.onInit&&s.onInit(i)}}}for(let r=0;r<e.removedNodes.length;r++){const i=e.removedNodes[r];if(i.nodeType===1){const a=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!a)i.matches&&i.matches(n)&&T(i,s);else if(i.matches&&i.matches(n)&&T(i,s),i.querySelectorAll){const u=i.querySelectorAll(n);for(let h=0;h<u.length;h++)T(u[h],s)}}}}}}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 r=t[o];if(r.type==="childList")try{ve(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){q().push(e),Z()}function ee(e,t,o,r,i={}){const a=i.extraAttributes||[],l=i.onAttributeChange||null,s=i.onSubtreeChange||null,n=i.onInit||null,u=i.onAttrChange||null,h=i.effects||null,w=i.attributes||null,b=w?pe(w):h,D=w?new Set(Object.keys(w)):null,I=i.persist||null;function C(m){const g=m||document.body;if(G(g,e,t,o),w&&M())for(const y in w){const Ie=w[y],N=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&N.push(g);for(let F=0;F<N.length;F++){const $=N[F];x($)&&J(Ie,$.getAttribute(y),y,r,$)}}n&&n(g)}const c=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let g;for(;(g=m.exec(e))!==null;)c.push(g[1])}else c.push(e);ye({selector:e,attribute:t,componentTag:r,attributes:w,ComponentFn:o,onInit:n,observed:c.concat(a),onAttributeChange:l,onAttrChange:u,effects:b,declared:D,persist:I}),Ae();const d=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,f=i.subtreeQuery||(d?e:"["+e+"]");q().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:s,query:f}),Z(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=_e);function p(){be()>0?ge(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),C}function te(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,o={},r=te(t);if(!r)return o;const i=r.split("&");for(let a=0;a<i.length;a++){const l=i[a];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(n)try{o[n]=decodeURIComponent(u)}catch{o[n]=u}}return o}function xe(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 l=o[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");te(location.hash)!==i&&(location.hash=i)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Te(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(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=xe,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Te,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-toast",t="lnToast",o="ln-toast-item";if(window[t]!==void 0)return;const r={"data-ln-toast":{type:"marker",description:"Initializes the toast notifications container"},"data-ln-toast-timeout":{prop:"timeoutDefault",type:"integer",read:_,fallback:6e3,min:500,description:"Default auto-dismiss timeout in ms"},"data-ln-toast-max":{prop:"max",type:"integer",read:_,fallback:5,min:1,description:"Maximum visible concurrent toast notifications"},"data-ln-toast-close":{type:"trigger",description:"Click dismiss trigger inside a toast item"},"data-ln-toast-item":{type:"marker",description:"Individual toast notification element"}},i=z(r);function a(c){if(!(!c||!(c instanceof HTMLElement))&&(c.hasAttribute("popover")||c.setAttribute("popover","manual"),typeof c.showPopover=="function")){if(c.matches(":popover-open"))try{c.hidePopover()}catch{}try{c.showPopover()}catch{}}}function l(c){if(!c||!(c instanceof HTMLElement))return;if(c.querySelectorAll("[data-ln-toast-item]").length===0&&typeof c.hidePopover=="function"&&c.matches(":popover-open"))try{c.hidePopover()}catch{}}function s(c){this.dom=c,K(this,c,i);const d=Array.from(c.querySelectorAll("[data-ln-toast-item]"));for(;d.length>this.max;)c.removeChild(d.shift());for(const f of d)D(f,this);return d.length>0&&a(c),this}s.prototype.enqueue=function(c){if(!c)return;const d=n(c,this.dom);if(!d)return;const f=Number.isFinite(c.timeout)?c.timeout:this.timeoutDefault;h(this,d),f>0&&(d._timer=setTimeout(()=>w(d),f))},s.prototype.clear=function(){for(const c of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(c)},s.prototype.destroy=function(){if(this.dom[t]){for(const c of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(c);l(this.dom),delete this.dom[t]}};function n(c,d){const f=((c.type||"")+"").trim().toLowerCase(),p=fe(d,o,"ln-toast");if(!p)return console.warn('[ln-toast] Template "'+o+'" not found'),null;k(p,{type:f,title:c.title,message:typeof c.message=="string"?c.message:void 0});const m=p.firstElementChild;if(!m)return null;m.hasAttribute("data-ln-toast-item")||m.setAttribute("data-ln-toast-item",""),m.classList.add("ln-enter");const g=m.querySelector(".body");g&&u(g,c);const y=m.querySelector("[data-ln-toast-close]");return y&&y.addEventListener("click",function(){w(m)}),m}function u(c,d){if(Array.isArray(d.message)){const f=document.createElement("ul");for(const p of d.message){const m=document.createElement("li");m.textContent=p,f.appendChild(m)}c.appendChild(f)}if(d.data&&d.data.errors){const f=document.createElement("ul");for(const p of Object.values(d.data.errors).flat()){const m=document.createElement("li");m.textContent=p,f.appendChild(m)}c.appendChild(f)}}function h(c,d){const f=Array.from(c.dom.querySelectorAll("[data-ln-toast-item]"));for(;f.length>=c.max&&f.length>0;)c.dom.removeChild(f.shift());c.dom.appendChild(d),a(c.dom),requestAnimationFrame(()=>d.classList.remove("ln-enter"))}function w(c){if(!c||!c.parentNode)return;const d=c.parentNode;clearTimeout(c._timer),c.classList.remove("ln-enter"),c.classList.add("ln-out"),setTimeout(()=>{c.parentNode&&(c.parentNode.removeChild(c),l(d))},200)}function b(c){let d=c&&c.container;return typeof d=="string"&&(d=document.querySelector(d)),d instanceof HTMLElement||(d=document.querySelector("["+e+"]")||document.getElementById("ln-toast-container")),d||null}function D(c,d){if(c._lnToastHydrated)return;c._lnToastHydrated=!0;const f=c.querySelector("[data-ln-toast-close]");f&&f.addEventListener("click",function(){w(c)});const p=+(c.getAttribute("data-ln-toast-timeout")??d.timeoutDefault);p>0&&(c._timer=setTimeout(function(){w(c)},p))}function I(c){const d=c.detail||{},f=b(d);if(!f){console.warn("[ln-toast] No toast container found");return}(f[t]||(f[t]=new s(f))).enqueue(d)}function C(c){const d=c&&c.detail||{};if(d.container){const f=b(d);f&&(f[t]||(f[t]=new s(f))).clear()}else{const f=document.querySelectorAll("["+e+"]");for(const p of Array.from(f))(p[t]||(p[t]=new s(p))).clear()}}A(function(){window.addEventListener("ln-toast:enqueue",I),window.addEventListener("ln-toast:clear",C),window.addEventListener("ln-modal:open",function(){const c=document.querySelectorAll("["+e+"], #ln-toast-container");for(const d of Array.from(c))d.querySelectorAll("[data-ln-toast-item]").length>0&&a(d)})},"ln-toast"),ee(e,t,s,"ln-toast",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!A(o))return}e.apply(console,t)}}function v(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function D(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});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 Y(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function Z(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let u=0;u<s.length;u++){const i=s[u];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[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")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&r[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(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(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 ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const u=r.getAttribute("data-ln-fill-as")||r.name;if(!u||!(u in t))continue;const i=t[u];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const c=String(i).split(",").map(function(f){return f.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=ne(i);o.push(r)}else if(r.type==="radio")r.checked=r.value===String(i),o.push(r);else if(r.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<r.options.length;c++)r.options[c].selected=i.indexOf(r.options[c].value)!==-1;o.push(r)}else r.value=i,r.tagName==="SELECT"&&i!=null&&r.setAttribute("data-ln-value",i),o.push(r)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const $={};function re(e,t){$[e]=t}function ie(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function ue(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=se,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=le);const _={};function ce(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const u=n[r],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const u=o[r],i=u.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const f=i[c].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),b=f[1].trim();t[b]!=null&&u.setAttribute(d,t[b])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const u=l[r],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const u=s[r],i=u.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const f=i[c].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),b=f[1].trim();b in t&&u.classList.toggle(d,!!t[b])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function B(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,u){return t[u]!==void 0?t[u]:""}))}const o=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],u=r.attributes;for(let i=0;i<u.length;i++){const c=u[i];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function de(e,t,n,o,l,s){const r={};for(let i=0;i<e.children.length;i++){const c=e.children[i],f=c.getAttribute("data-ln-render-key");f&&(r[f]=c)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],f=String(o(c));let d=r[f];if(d)l(d,c,i);else{const b=ce(n,s);if(!b||(B(b,c),d=b.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,c,i)}u.appendChild(d)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=N,window.lnCore.lnFill=ae,window.lnCore.renderList=de);function x(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function U(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const o=new Set(e||[]),l=function(s,r){const u=s.getAttribute(r);return u!==null&&o.has(u)?u:t};return k.set(n,l),l}function V(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function H(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function K(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const u=i=>{l?console.warn(i,l):console.warn(i)};if(r==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function fe(e,t,n){for(const o in n){const[l,s,r]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function we(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=U(o.values,o.fallback);break;case"integer":l=M;break;case"float":l=V;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=H;break;case"string":default:l=x;break}l||(l=x),t[o.prop]=[l,n,o.fallback]}return t}function ge(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=fe,window.lnCore.attrSpec=we,window.lnCore.attrStr=x,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function S(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const u of r)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new o(u)}catch(i){console.error("["+n+"] init failed",u,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){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 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(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=be(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ce(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),l=o.byAttr.get(n);if(R()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&A(t)){const s=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let u=0;u<s.length;u++)K(s[u].spec,r,n,s[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&J(s,t,n,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(S(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ce(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ae(e){const t=G();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];S(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,u=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&u.push(o);for(let i=0;i<u.length;i++){const c=u[i];if(!document.contains(c)){const f=c[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Ae(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,o,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,u=l.onSubtreeChange||null,i=l.onInit||null,c=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,b=d?ge(d):f,a=d?new Set(Object.keys(d)):null,w=l.persist||null;function p(E){const h=E||document.body;if(S(h,e,t,n),d&&R())for(const C in d){const Ie=d[C],T=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&T.push(h);for(let q=0;q<T.length;q++){const I=T[q];A(I)&&K(Ie,I.getAttribute(C),C,o,I)}}i&&i(h)}const g=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let h;for(;(h=E.exec(e))!==null;)g.push(h[1])}else g.push(e);me({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:g.concat(s),onAttributeChange:r,onAttrChange:c,effects:b,declared:a,persist:w}),ye();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,L=l.subtreeQuery||(m?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:u,query:L}),ve(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function X(){pe()>0?he(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),p}function z(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const u=r.indexOf(":"),i=u>-1?r.slice(0,u):r,c=u>-1?r.slice(u+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function _e(e){if(!e)return null;const t=O();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=O();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");z(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Oe(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 Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=_e,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Te);function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=qe),(function(){const e="data-ln-toggle",t="lnToggle",n="data-ln-toggle-for",o="data-ln-toggle-action";if(window[t]!==void 0)return;const l={"data-ln-toggle":{effect:b,type:"enum",values:["open","close"],fallback:"close",description:"Visibility state of toggleable element"},"data-ln-toggle-for":{type:"string",description:"Target element ID to toggle on trigger click"},"data-ln-toggle-action":{type:"enum",values:["open","close","toggle"],fallback:"toggle",description:"Action performed on target element when trigger is clicked"}},s=new Set;let r=null;function u(a,w){return w==="open"?"open":w==="close"||a==="open"?"close":"open"}function i(){r||(r=function(a){if(Y(a))return;const w=a.target.closest("["+n+"]");if(!w||Z(w))return;const p=w.getAttribute(n);if(!p)return;const g=document.getElementById(p);if(!g||!g[t])return;a.preventDefault();const m=w.getAttribute(o)||"toggle",L=g.getAttribute(e);g.setAttribute(e,u(L,m))},document.addEventListener("click",r))}function c(){s.size>0||!r||(document.removeEventListener("click",r),r=null)}function f(a,w){if(!a||!a.id)return;const p=document.querySelectorAll("["+n+'="'+a.id+'"]');for(let g=0;g<p.length;g++)p[g].setAttribute("aria-expanded",w?"true":"false")}function d(a){this.dom=a;const w=this;return this._onRequestOpen=function(){w.open()},this._onRequestClose=function(){w.close()},this._onRequestToggle=function(){w.toggle()},this.dom.addEventListener("ln-toggle:request-open",this._onRequestOpen),this.dom.addEventListener("ln-toggle:request-close",this._onRequestClose),this.dom.addEventListener("ln-toggle:request-toggle",this._onRequestToggle),this.isOpen=a.getAttribute(e)==="open",this.isOpen&&a.classList.add("open"),f(a,this.isOpen),s.add(this),i(),this}d.prototype.open=function(){this.dom.setAttribute(e,"open")},d.prototype.close=function(){this.dom.setAttribute(e,"close")},d.prototype.toggle=function(){const a=this.dom.getAttribute(e);this.dom.setAttribute(e,u(a,"toggle"))},d.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-toggle:request-close",this._onRequestClose),this.dom.removeEventListener("ln-toggle:request-toggle",this._onRequestToggle),s.delete(this),delete this.dom[t],c())};function b(a){const w=a[t];if(!w)return;const g=a.getAttribute(e)==="open";if(g!==w.isOpen)if(g){if(D(a,"ln-toggle:before-open",{target:a}).defaultPrevented){a.setAttribute(e,"close");return}w.isOpen=!0,a.classList.add("open"),f(a,!0),v(a,"ln-toggle:open",{target:a})}else{if(D(a,"ln-toggle:before-close",{target:a}).defaultPrevented){a.setAttribute(e,"open");return}w.isOpen=!1,a.classList.remove("open"),f(a,!1),v(a,"ln-toggle:close",{target:a})}}P(e,t,d,"ln-toggle",{attributes:l,persist:{attr:e,hashActive:null}})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){i=t[n];break}if(!v(i))return}e.apply(console,t)}}function _(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 $(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(n),n}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 te(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ne(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,n={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const o=c[s];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<c.length;s++){const o=c[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")r&&l[o.name]===1?n[o.name]=o.checked:(n[o.name]||(n[o.name]=[]),o.checked&&n[o.name].push(o.value));else if(o.type==="radio")o.checked&&(n[o.name]=o.value);else if(o.type==="select-multiple"){n[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&n[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")n[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);n[o.name]=o.value===""||isNaN(u)?null:u}else n[o.name]=o.value}return n}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const r=e.elements,i=[],n={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const o=t[s];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(n[l.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ie(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=oe);const N={};function se(e,t){N[e]=t}function ce(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=se,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){_(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ue);const x={};function fe(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const s=i[l],o=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),b=d[1].trim();t[b]!=null&&s.setAttribute(f,t[b])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const s=n[l],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],o=s.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),b=d[1].trim();b in t&&s.classList.toggle(f,!!t[b])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let c=0;c<n.length;c++){const l=n[c],s=l.attributes;for(let o=0;o<s.length;o++){const u=s[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function ge(e,t,r,i,n,c){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(i(u));let f=l[d];if(f)n(f,u,o);else{const b=fe(r,c);if(!b||(j(b,u),f=b.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),n(f,u,o)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=we,window.lnCore.renderList=ge);function k(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function W(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function U(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const n=i.trim().toLowerCase();return!(n==="false"||n==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const S=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(S.has(r))return S.get(r);const i=new Set(e||[]),n=function(c,l){const s=c.getAttribute(l);return s!==null&&i.has(s)?s:t};return S.set(r,n),n}function K(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function Q(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function J(e,t,r,i,n){if(!e||t===null)return!0;const c=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=o=>{n?console.warn(o,n):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${c}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${c}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${c}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const i in r){const[n,c,l]=r[i];Object.defineProperty(e,i,{get:function(){return n(t,c,l)},enumerable:!0,configurable:!0})}return e}function he(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let n=i.read;if(!n&&i.type)switch(i.type){case"enum":n=H(i.values,i.fallback);break;case"integer":n=W;break;case"float":n=K;break;case"boolean":n=U;break;case"list":n=V;break;case"json":n=Q;break;case"string":default:n=k;break}n||(n=k),t[i.prop]=[n,r,i.fallback]}return t}function pe(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=be,window.lnCore.attrSpec=he,window.lnCore.attrStr=k,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=Q);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function G(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&m(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let o=0;o<s.length;o++)m(s[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=P(),r=e.observed||[];for(let i=0;i<r.length;i++){const n=r[i];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const n=t.byDeclaredAttr.get(i);n.some(c=>c.componentTag===e.componentTag)||n.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=me(e);if(i===null)t.reactiveWildcard.push(e);else for(const n of i)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,i){for(let n=0;n<e.length;n++){const c=e[n];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function ve(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=P(),n=i.byAttr.get(t),c=F()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!n&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&v(l)){const s=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<s.length;u++)J(s[u].spec,o,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(r||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&z(s,l,t,e.oldValue),i.reactiveWildcard.length&&z(i.reactiveWildcard,l,t,e.oldValue)}if(n)for(let s=0;s<n.length;s++){const o=n[s];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(G(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ve(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=O();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const n=t[i];if(n.onSubtreeChange&&n.query){const c=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&n.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const n=e.addedNodes[i];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)n.matches&&n.matches(s.query)&&m(n,s);else if(n.matches&&n.matches(s.query)&&m(n,s),n.querySelectorAll){const o=n.querySelectorAll(s.query);for(let u=0;u<o.length;u++)m(o[u],s)}}s.onInit&&s.onInit(n)}}}for(let i=0;i<e.removedNodes.length;i++){const n=e.removedNodes[i];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l],o=s.query;if(o){if(!c)n.matches&&n.matches(o)&&E(n,s);else if(n.matches&&n.matches(o)&&E(n,s),n.querySelectorAll){const u=n.querySelectorAll(o);for(let d=0;d<u.length;d++)E(u[d],s)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{xe(i)}catch(n){console.error("[ln-core] lifecycle handler failed",i.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){O().push(e),X()}function Y(e,t,r,i,n={}){const c=n.extraAttributes||[],l=n.onAttributeChange||null,s=n.onSubtreeChange||null,o=n.onInit||null,u=n.onAttrChange||null,d=n.effects||null,f=n.attributes||null,b=f?pe(f):d,a=f?new Set(Object.keys(f)):null,w=n.persist||null;function h(T){const p=T||document.body;if(G(p,e,t,r),f&&F())for(const y in f){const Fe=f[y],I=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&I.push(p);for(let D=0;D<I.length;D++){const R=I[D];v(R)&&J(Fe,R.getAttribute(y),y,i,R)}}o&&o(p)}const g=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let p;for(;(p=T.exec(e))!==null;)g.push(p[1])}else g.push(e);Ae({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:r,onInit:o,observed:g.concat(c),onAttributeChange:l,onAttrChange:u,effects:b,declared:a,persist:w}),_e();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,q=n.subtreeQuery||(C?e:"["+e+"]");O().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:s,query:q}),X(),window[t]=h,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=ke);function ee(){Ce()>0?ye(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ee):ee(),h}function Z(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,r={},i=Z(t);if(!i)return r;const n=i.split("&");for(let c=0;c<n.length;c++){const l=n[c];if(!l)continue;const s=l.indexOf(":"),o=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function Se(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=L();t==null?delete r[e]:r[e]=String(t);const n=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");Z(location.hash)!==n&&(location.hash=n)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function qe(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 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),n=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=Se,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function Re(){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=Re),(function(){const e="data-ln-toggle",t="lnToggle",r="data-ln-toggle-for",i="data-ln-toggle-action";if(window[t]!==void 0)return;const n={"data-ln-toggle":{effect:b,type:"enum",values:["open","close"],fallback:"close",description:"Visibility state of toggleable element"},"data-ln-toggle-for":{type:"string",description:"Target element ID to toggle on trigger click"},"data-ln-toggle-action":{type:"enum",values:["open","close","toggle"],fallback:"toggle",description:"Action performed on target element when trigger is clicked"}},c=new Set;let l=null;function s(a,w){return w==="open"?"open":w==="close"||a==="open"?"close":"open"}function o(){l||(l=function(a){if(te(a))return;const w=a.target.closest("["+r+"]");if(!w||ne(w))return;const h=w.getAttribute(r);if(!h)return;const g=document.getElementById(h);if(!g||!g[t])return;a.preventDefault();const C=w.getAttribute(i)||"toggle",q=g.getAttribute(e);g.setAttribute(e,s(q,C))},document.addEventListener("click",l))}function u(){c.size>0||!l||(document.removeEventListener("click",l),l=null)}function d(a,w){if(!a||!a.id)return;const h=document.querySelectorAll("["+r+'="'+a.id+'"]');for(let g=0;g<h.length;g++)h[g].setAttribute("aria-expanded",w?"true":"false")}function f(a){this.dom=a;const w=this;return this._onRequestOpen=function(){w.open()},this._onRequestClose=function(){w.close()},this._onRequestToggle=function(){w.toggle()},this.dom.addEventListener("ln-toggle:request-open",this._onRequestOpen),this.dom.addEventListener("ln-toggle:request-close",this._onRequestClose),this.dom.addEventListener("ln-toggle:request-toggle",this._onRequestToggle),this.isOpen=a.getAttribute(e)==="open",this.isOpen&&a.classList.add("open"),d(a,this.isOpen),c.add(this),o(),this}f.prototype.open=function(){this.dom.setAttribute(e,"open")},f.prototype.close=function(){this.dom.setAttribute(e,"close")},f.prototype.toggle=function(){const a=this.dom.getAttribute(e);this.dom.setAttribute(e,s(a,"toggle"))},f.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-toggle:request-close",this._onRequestClose),this.dom.removeEventListener("ln-toggle:request-toggle",this._onRequestToggle),c.delete(this),delete this.dom[t],u())};function b(a){const w=a[t];if(!w)return;const g=a.getAttribute(e)==="open";if(g!==w.isOpen)if(g){if($(a,"ln-toggle:before-open",{target:a}).defaultPrevented){a.setAttribute(e,"close");return}w.isOpen=!0,a.classList.add("open"),d(a,!0),_(a,"ln-toggle:open",{target:a})}else{if($(a,"ln-toggle:before-close",{target:a}).defaultPrevented){a.setAttribute(e,"open");return}w.isOpen=!1,a.classList.remove("open"),d(a,!1),_(a,"ln-toggle:close",{target:a})}}Y(e,t,f,"ln-toggle",{attributes:n,persist:{attr:e,hashActive:null}})})()})();
|