@livenetworks/ashlar 2.0.9 → 2.0.10
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-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/lifecycle.js +1 -1
- 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-debug/src/generated-attributes.js +1 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +161 -153
- package/components/ln-filter/src/ln-filter.js +77 -5
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- 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-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-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-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/src/ln-search.js +17 -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/ln-ashlar.html-data.json +5 -0
- package/package.json +1 -1
- package/web-types.json +8 -1
|
@@ -1 +1 @@
|
|
|
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 _(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(!_(r))return}e.apply(console,t)}}function v(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function Z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function 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 R(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function $(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const o=t[a];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=te(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=$,window.lnCore.serializeForm=R,window.lnCore.resolveFormMethod=ee);const M={};function ne(e,t){M[e]=t}function oe(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=oe);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ie(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];B[n]=t}function le(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=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=re);const x={};function se(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=x[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],o=a.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 c=d[0].trim(),w=d[1].trim();t[w]!=null&&a.setAttribute(c,t[w])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],o=a.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const c=d[0].trim(),w=d[1].trim();w in t&&a.classList.toggle(c,!!t[w])}}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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const 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 r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let o=0;o<a.length;o++){const u=a[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ue(e,t,n,r,i,s){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 a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(r(u));let c=l[d];if(c)i(c,u,o);else{const w=se(n,s);if(!w||(j(w,u),c=w.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",d),i(c,u,o)}a.appendChild(c)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=q,window.lnCore.lnFill=ae,window.lnCore.renderList=ue);function k(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function U(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function W(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const S=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(S.has(n))return S.get(n);const r=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return S.set(n,i),i}function J(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function K(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function P(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=V(r.values,r.fallback);break;case"integer":i=U;break;case"float":i=J;break;case"boolean":i=W;break;case"list":i=H;break;case"json":i=K;break;case"string":default:i=k;break}i||(i=k),t[r.prop]=[i,n,r.fallback]}return t}function fe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function 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=ce,window.lnCore.attrSpec=de,window.lnCore.attrStr=k,window.lnCore.attrInt=U,window.lnCore.attrBool=W,window.lnCore.attrList=H,window.lnCore.attrEnum=V,window.lnCore.attrFloat=J,window.lnCore.attrJson=K);function E(e,t,n,r){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 r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 pe(e){const t=Q(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=we(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 X(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function ge(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=Q(),i=r.byAttr.get(n);if(N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&_(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)P(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=r.byReactive.get(n);s&&X(s,t,n,e.oldValue),r.reactiveWildcard.length&&X(r.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 Ce(){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{ge(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];E(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let o=0;o<a.length;o++){const u=a[o];if(!document.contains(u)){const d=u[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(c){console.error("["+s.attribute+"] destroy failed",u,c)}delete u[s.attribute]}}}}}}function ye(){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 r=t[n];if(r.type==="childList")try{me(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,d=i.effects||null,c=i.attributes||null,w=c?fe(c):d,m=c?new Set(Object.keys(c)):null,O=i.persist||null;function p(g){const b=g||document.body;if(E(b,e,t,n),c&&N())for(const y in c){const Ne=c[y],I=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&I.push(b);for(let D=0;D<I.length;D++){const F=I[D];_(F)&&P(Ne,F.getAttribute(y),y,r,F)}}o&&o(b)}const C=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let b;for(;(b=g.exec(e))!==null;)C.push(b[1])}else C.push(e);pe({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:n,onInit:o,observed:C.concat(s),onAttributeChange:l,onAttrChange:u,effects:w,declared:m,persist:O}),Ce();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:f}),ye(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G);function T(){he()>0?be(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T):T(),p}function Y(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},r=Y(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),o=a>-1?l.slice(0,a):l,u=a>-1?l.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function ve(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=L();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("&");Y(location.hash)!==i&&(location.hash=i)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Se(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function 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),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ve,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);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);const Te="ln-autosave:",Ie=1e3;function De(e,t){return t?Te+(e||"")+":"+t:null}function Fe(e,t=Ie){if(e==null)return 0;if(e==="")return t;const n=parseInt(String(e),10);return isNaN(n)||n<0?t:n}(function(){const e="data-ln-autosave",t="lnAutosave",n="data-ln-autosave-clear",r="data-ln-autosave-debounce-input",i='[data-ln-autosave-exclude], input[type="password"]';if(window[t]!==void 0)return;const s={"data-ln-autosave":{type:"string",description:"Form autosave storage key identifier"},"data-ln-autosave-debounce-input":{type:"integer",fallback:500,min:0,description:"Debounce delay in milliseconds before saving on input events"},"data-ln-autosave-clear":{type:"marker",description:"Designates a button that clears saved form data from localStorage"},"data-ln-autosave-exclude":{type:"marker",description:"Excludes form control from autosave serialization"}};function l(o){const u=o.tagName;return u==="INPUT"||u==="TEXTAREA"||u==="SELECT"}function a(o){const d=o.getAttribute(e)||o.id,c=De(window.location.pathname,d);if(!c){console.warn("ln-autosave: form needs an id or data-ln-autosave value",o);return}this.dom=o,this.key=c;let w=null;function m(){const h=R(o,{exclude:i});try{localStorage.setItem(c,JSON.stringify(h))}catch{return}v(o,"ln-autosave:saved",{target:o,data:h})}function O(){let h;try{h=localStorage.getItem(c)}catch{return}if(!h)return;let f;try{f=JSON.parse(h)}catch{return}if(Z(o,"ln-autosave:before-restore",{target:o,data:f}).defaultPrevented)return;const g=$(o,f);for(let b=0;b<g.length;b++)g[b].dispatchEvent(new Event("input",{bubbles:!0})),g[b].dispatchEvent(new Event("change",{bubbles:!0}));v(o,"ln-autosave:restored",{target:o,data:f})}function p(){try{localStorage.removeItem(c)}catch{return}v(o,"ln-autosave:cleared",{target:o})}this._onFocusout=function(h){const f=h.target;l(f)&&f.name&&!f.matches(i)&&m()},this._onChange=function(h){const f=h.target;l(f)&&f.name&&!f.matches(i)&&m()},this._onSubmit=function(){p()},this._onReset=function(){p()},this._onClearClick=function(h){h.target.closest("["+n+"]")&&p()},o.addEventListener("focusout",this._onFocusout),o.addEventListener("change",this._onChange),o.addEventListener("submit",this._onSubmit),o.addEventListener("reset",this._onReset),o.addEventListener("click",this._onClearClick);const C=Fe(o.getAttribute(r));return C>0&&(this._onInput=function(h){const f=h.target;!l(f)||!f.name||f.matches(i)||(w!==null&&clearTimeout(w),w=setTimeout(m,C))},o.addEventListener("input",this._onInput)),this._getInputTimer=function(){return w},O(),this}a.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("focusout",this._onFocusout),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("reset",this._onReset),this.dom.removeEventListener("click",this._onClearClick),this._onInput){this.dom.removeEventListener("input",this._onInput);const o=this._getInputTimer();o!==null&&clearTimeout(o)}delete this.dom[t]}},G(e,t,a,"ln-autosave",{attributes:s})})()})();
|
|
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 _(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(!_(r))return}e.apply(console,t)}}function v(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function Z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function 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 R(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function $(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const o=t[a];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=te(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=$,window.lnCore.serializeForm=R,window.lnCore.resolveFormMethod=ee);const M={};function ne(e,t){M[e]=t}function oe(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=oe);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function ie(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];B[n]=t}function le(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=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=re);const x={};function se(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=x[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],o=a.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 c=d[0].trim(),h=d[1].trim();t[h]!=null&&a.setAttribute(c,t[h])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],o=a.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const c=d[0].trim(),h=d[1].trim();h in t&&a.classList.toggle(c,!!t[h])}}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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const 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 r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let o=0;o<a.length;o++){const u=a[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ue(e,t,n,r,i,s){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 a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(r(u));let c=l[d];if(c)i(c,u,o);else{const h=se(n,s);if(!h||(j(h,u),c=h.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",d),i(c,u,o)}a.appendChild(c)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=q,window.lnCore.lnFill=ae,window.lnCore.renderList=ue);function k(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function U(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function W(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const S=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(S.has(n))return S.get(n);const r=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return S.set(n,i),i}function J(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function K(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Q(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=V(r.values,r.fallback);break;case"integer":i=U;break;case"float":i=J;break;case"boolean":i=W;break;case"list":i=H;break;case"json":i=K;break;case"string":default:i=k;break}i||(i=k),t[r.prop]=[i,n,r.fallback]}return t}function fe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function 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=ce,window.lnCore.attrSpec=de,window.lnCore.attrStr=k,window.lnCore.attrInt=U,window.lnCore.attrBool=W,window.lnCore.attrList=H,window.lnCore.attrEnum=V,window.lnCore.attrFloat=J,window.lnCore.attrJson=K);function E(e,t,n,r){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 r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function pe(e){const t=P(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=we(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 X(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function ge(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=P(),i=r.byAttr.get(n);if(N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&_(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)Q(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=r.byReactive.get(n);s&&X(s,t,n,e.oldValue),r.reactiveWildcard.length&&X(r.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 Ce(){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{ge(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];E(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let o=0;o<a.length;o++){const u=a[o];if(!document.contains(u)){const d=u[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(c){console.error("["+s.attribute+"] destroy failed",u,c)}delete u[s.attribute]}}}}}}function ye(){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 r=t[n];if(r.type==="childList")try{me(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,d=i.effects||null,c=i.attributes||null,h=c?fe(c):d,m=c?new Set(Object.keys(c)):null,O=i.persist||null;function p(g){const b=g||document.body;if(E(b,e,t,n),c&&N())for(const y in c){const Ne=c[y],I=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&I.push(b);for(let D=0;D<I.length;D++){const F=I[D];_(F)&&Q(Ne,F.getAttribute(y),y,r,F)}}o&&o(b)}const C=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let b;for(;(b=g.exec(e))!==null;)C.push(b[1])}else C.push(e);pe({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:n,onInit:o,observed:C.concat(s),onAttributeChange:l,onAttrChange:u,effects:h,declared:m,persist:O}),Ce();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,f=i.subtreeQuery||(w?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:f}),ye(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G);function T(){he()>0?be(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T):T(),p}function Y(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},r=Y(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),o=a>-1?l.slice(0,a):l,u=a>-1?l.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function ve(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=L();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("&");Y(location.hash)!==i&&(location.hash=i)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Se(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function 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),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ve,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);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);const Te="ln-autosave:",Ie=1e3;function De(e,t){return t?Te+(e||"")+":"+t:null}function Fe(e,t=Ie){if(e==null)return 0;if(e==="")return t;const n=parseInt(String(e),10);return isNaN(n)||n<0?t:n}(function(){const e="data-ln-autosave",t="lnAutosave",n="data-ln-autosave-clear",r="data-ln-autosave-debounce-input",i='[data-ln-autosave-exclude], input[type="password"]';if(window[t]!==void 0)return;const s={"data-ln-autosave":{type:"string",description:"Form autosave storage key identifier"},"data-ln-autosave-debounce-input":{type:"integer",fallback:500,min:0,description:"Debounce delay in milliseconds before saving on input events"},"data-ln-autosave-clear":{type:"marker",description:"Designates a button that clears saved form data from localStorage"},"data-ln-autosave-exclude":{type:"marker",description:"Excludes form control from autosave serialization"}};function l(o){const u=o.tagName;return u==="INPUT"||u==="TEXTAREA"||u==="SELECT"}function a(o){const d=o.getAttribute(e)||o.id,c=De(window.location.pathname,d);if(!c){console.warn("ln-autosave: form needs an id or data-ln-autosave value",o);return}this.dom=o,this.key=c;let h=null;function m(){const w=R(o,{exclude:i});try{localStorage.setItem(c,JSON.stringify(w))}catch{return}v(o,"ln-autosave:saved",{target:o,data:w})}function O(){let w;try{w=localStorage.getItem(c)}catch{return}if(!w)return;let f;try{f=JSON.parse(w)}catch{return}if(Z(o,"ln-autosave:before-restore",{target:o,data:f}).defaultPrevented)return;const g=$(o,f);for(let b=0;b<g.length;b++)g[b].dispatchEvent(new Event("input",{bubbles:!0})),g[b].dispatchEvent(new Event("change",{bubbles:!0}));v(o,"ln-autosave:restored",{target:o,data:f})}function p(){try{localStorage.removeItem(c)}catch{return}v(o,"ln-autosave:cleared",{target:o})}this._onFocusout=function(w){const f=w.target;l(f)&&f.name&&!f.matches(i)&&m()},this._onChange=function(w){const f=w.target;l(f)&&f.name&&!f.matches(i)&&m()},this._onSubmit=function(){p()},this._onReset=function(){p()},this._onClearClick=function(w){w.target.closest("["+n+"]")&&p()},o.addEventListener("focusout",this._onFocusout),o.addEventListener("change",this._onChange),o.addEventListener("submit",this._onSubmit),o.addEventListener("reset",this._onReset),o.addEventListener("click",this._onClearClick);const C=Fe(o.getAttribute(r));return C>0&&(this._onInput=function(w){const f=w.target;!l(f)||!f.name||f.matches(i)||(h!==null&&clearTimeout(h),h=setTimeout(m,C))},o.addEventListener("input",this._onInput)),this._getInputTimer=function(){return h},O(),this}a.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("focusout",this._onFocusout),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("reset",this._onReset),this.dom.removeEventListener("click",this._onClearClick),this._onInput){this.dom.removeEventListener("input",this._onInput);const o=this._getInputTimer();o!==null&&clearTimeout(o)}delete this.dom[t]}},G(e,t,a,"ln-autosave",{attributes:s})})()})();
|
|
@@ -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 O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!O(r))return}e.apply(console,t)}}function E(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function 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 ae(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,i={};if(n)for(let c=0;c<a.length;c++){const o=a[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<a.length;c++){const o=a[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let s=0;s<o.options.length;s++)o.options[s].selected&&l[o.name].push(o.options[s].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const s=Number(o.value);l[o.name]=o.value===""||isNaN(s)?null:s}else l[o.name]=o.value}return l}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],l={};for(let a=0;a<n.length;a++){const i=n[a];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<n.length;a++){const i=n[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const s=String(o).split(",").map(function(u){return u.trim()});i.checked=s.indexOf(i.value)!==-1}else i.checked=se(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let s=0;s<i.options.length;s++)i.options[s].selected=o.indexOf(i.options[s].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=le);const j={};function ue(e,t){j[e]=t}function de(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=de);function W(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 fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=fe);const N={};function P(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function pe(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return P(t,n)}function U(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],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-attr").split(",");for(let s=0;s<o.length;s++){const u=o[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const c=a[i],o=c.getAttribute("data-ln-class").split(",");for(let s=0;s<o.length;s++){const u=o[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function 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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)U(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 a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(a,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const i=l[a],c=i.attributes;for(let o=0;o<c.length;o++){const s=c[o];s.value.indexOf("{{")!==-1&&i.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ge(e,t,n,r,l,a){const i={};for(let o=0;o<e.children.length;o++){const s=e.children[o],u=s.getAttribute("data-ln-render-key");u&&(i[u]=s)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const s=t[o],u=String(r(s));let d=i[u];if(d)l(d,s,o);else{const f=P(n,a);if(!f||(q(f,s),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,s,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=U,window.lnCore.lnFill=me,window.lnCore.renderList=ge);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function H(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function G(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),l=function(a,i){const c=a.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,l),l}function J(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Q(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Y(e,t,n,r,l){if(!e||t===null)return!0;const a=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${a}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${a}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${a}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,n){for(const r in n){const[l,a,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,a,i)},enumerable:!0,configurable:!0})}return e}function Z(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=G(r.values,r.fallback);break;case"integer":l=H;break;case"float":l=J;break;case"boolean":l=K;break;case"list":l=z;break;case"json":l=Q;break;case"string":default:l=L;break}l||(l=L),t[r.prop]=[l,n,r.fallback]}return t}function be(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ye(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=X,window.lnCore.attrSpec=Z,window.lnCore.attrStr=L,window.lnCore.attrInt=H,window.lnCore.attrBool=K,window.lnCore.attrList=z,window.lnCore.attrEnum=G,window.lnCore.attrFloat=J,window.lnCore.attrJson=Q);function M(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&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 r(c)}catch(o){console.error("["+n+"] init failed",c,o)}}}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 xe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Ae(e){const t=ee(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ye(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const i=a.effects&&a.effects[n];i?i(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function ve(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ee(),l=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const a=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<a.length;c++)Y(a[c].spec,i,n,a[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 a=r.byReactive.get(n);a&&te(a,t,n,e.oldValue),r.reactiveWildcard.length&&te(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const i=l[a];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(M(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function _e(){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{ve(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function 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 r=t[n];if(r.onSubtreeChange){const l=r.query,a=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;a&&r.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];M(r,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],i=a.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let o=0;o<c.length;o++){const s=c[o];if(!document.contains(s)){const u=s[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",s,d)}delete s[a.attribute]}}}}}}function ke(){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 r=t[n];if(r.type==="childList")try{Se(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function re(e,t,n,r,l={}){const a=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,s=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?be(d):u,_=d?new Set(Object.keys(d)):null,y=l.persist||null;function m(h){const w=h||document.body;if(M(w,e,t,n),d&&R())for(const p in d){const A=d[p],v=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&v.push(w);for(let $=0;$<v.length;$++){const B=v[$];O(B)&&Y(A,B.getAttribute(p),p,r,B)}}o&&o(w)}const C=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let w;for(;(w=h.exec(e))!==null;)C.push(w[1])}else C.push(e);Ae({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:C.concat(a),onAttributeChange:i,onAttrChange:s,effects:f,declared:_,persist:y}),_e();const D=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";ne().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:D}),ke(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re);function S(){Ce()>0?xe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),m}function oe(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const l=r.split("&");for(let a=0;a<l.length;a++){const i=l[a];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,s=c>-1?i.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(s)}catch{n[o]=s}}return n}function Le(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const i=n[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");oe(location.hash)!==l&&(location.hash=l)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ee(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 Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Le,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Ne,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Ie);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);const g={};function Te(e){const t=e||"default";if(!g[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let l="",a=".";for(let i=0;i<r.length;i++)r[i].type==="group"&&(l=r[i].value),r[i].type==="decimal"&&(a=r[i].value);g[t]={groupSep:l,decimalSep:a,fmt:n}}return g[t]}function F(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",l=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,a=n.userDecimals!=null?n.userDecimals:null;if(l!==null){const i=r+"|max:"+l;return g[i]||(g[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:l})),g[i].format(e)}if(a!==null&&a>0){const i=r+"|exact:"+a;return g[i]||(g[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),g[i].format(e)}return Te(t).fmt.format(e)}function ie(e){if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function x(e){return String(Math.round(e*1e3)/1e3)}function $e(e,t,n){const r=ie(e);return r===null||r<0?0:Math.min(r,Math.min(t,n)/2)}function Be(e){if(typeof e!="string")return null;const t=e.trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(n=>!Number.isFinite(n))||t[2]<=0||t[3]<=0?null:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Re(e){if(!e||typeof e!="string")return null;const t=e.split(":"),n=t[0].trim();return n?{field:n,direction:t[1]&&t[1].trim().toLowerCase()==="desc"?"desc":"asc"}:null}function je(e,t){t=t||{};const n=t.viewBox||{x:0,y:0,width:1e3,height:320},r=t.xField||"label",l=t.yField||"value",a=t.includeZero!==!1,i=$e(t.padding,n.width,n.height),c=Array.isArray(e)?e:[],o=[];for(let h=0;h<c.length;h++){const w=c[h]||{},p=ie(w[l]);p!==null&&o.push({record:w,sourceIndex:h,label:w[r]==null?String(h+1):String(w[r]),value:p})}if(o.length===0)return{points:[],linePoints:"",areaPoints:"",count:0,min:null,max:null,domainMin:0,domainMax:1,baselineY:n.y+n.height-i};let s=o[0].value,u=o[0].value;for(let h=1;h<o.length;h++)o[h].value<s&&(s=o[h].value),o[h].value>u&&(u=o[h].value);let d=s,f=u;a&&(d=Math.min(0,d),f=Math.max(0,f)),d===f&&(f===0?f=1:f>0?d=0:f=0);const _=Math.max(1,n.width-i*2),y=Math.max(1,n.height-i*2),m=f-d,C=n.y+n.height-i-(0-d)/m*y,b=[];for(let h=0;h<o.length;h++){const w=o[h],p=o.length===1?.5:h/(o.length-1),A=n.x+i+p*_,v=n.y+n.height-i-(w.value-d)/m*y;b.push({record:w.record,sourceIndex:w.sourceIndex,label:w.label,value:w.value,x:A,y:v,pointString:x(A)+","+x(v)})}const D=b.map(h=>h.pointString).join(" ");let S="";if(b.length>0){const h=b[0],w=b[b.length-1],p=x(h.x)+","+x(C),A=x(w.x)+","+x(C);S=p+" "+D+" "+A}return{points:b,linePoints:D,areaPoints:S,count:b.length,min:s,max:u,domainMin:d,domainMax:f,baselineY:C}}(function(){const e="data-ln-chart",t="lnChart",n={x:0,y:0,width:1e3,height:320};if(window[t]!==void 0)return;function r(s){const u=s[t];u&&u.requestData()}function l(s){const u=s[t];u&&u._render()}const a={"data-ln-chart":{prop:"name",type:"string",read:L,fallback:"",effect:l,description:"Chart instance name or identifier"},"data-ln-chart-source":{type:"string",effect:r,description:"Source store or coordinator identifier"},"data-ln-chart-sort":{type:"string",effect:r,description:"Field name to sort chart series data by"},"data-ln-chart-type":{type:"enum",values:["line","bar","area","scatter"],fallback:"line",effect:l,description:"Visual chart render type"},"data-ln-chart-x":{type:"string",effect:l,description:"Field name mapping to X axis"},"data-ln-chart-y":{type:"string",effect:l,description:"Field name mapping to Y axis"},"data-ln-chart-padding":{type:"integer",fallback:20,min:0,effect:l,description:"Internal plot padding in pixels"},"data-ln-chart-zero":{type:"boolean",effect:l,description:"Forces Y axis scale to start at zero"}},i=Z(a);function c(s,u){s&&(s.textContent=u)}function o(s){this.dom=s,X(this,s,i),this.source=s.getAttribute("data-ln-chart-source")||this.name,this.plot=s.querySelector("[data-ln-chart-plot]"),this.line=s.querySelector("[data-ln-chart-line]"),this.area=s.querySelector("[data-ln-chart-area]"),this.labels=s.querySelector("[data-ln-chart-labels]"),this.empty=s.querySelector("[data-ln-chart-empty]"),this.minimum=s.querySelector("[data-ln-chart-min]"),this.maximum=s.querySelector("[data-ln-chart-max]"),this.count=s.querySelector("[data-ln-chart-count]"),this._data=[],this.model=null,this.isLoaded=!1;const u=this;return this._onSetData=function(d){const f=d.detail||{};u._data=Array.isArray(f.data)?f.data:[],u.isLoaded=!0,u._setLoading(!1),u._render()},this._onSetLoading=function(d){u._setLoading(!!(d.detail&&d.detail.loading))},this._onRefresh=function(){u.requestData()},s.addEventListener("ln-chart:set-data",this._onSetData),s.addEventListener("ln-chart:set-loading",this._onSetLoading),s.addEventListener("ln-chart:request-refresh",this._onRefresh),this.requestData(),this}o.prototype._readOptions=function(){const s=this.dom.getAttribute("data-ln-chart-padding"),u=s===null?NaN:Number(s),d=(this.dom.getAttribute("data-ln-chart-type")||"line").toLowerCase();return{xField:this.dom.getAttribute("data-ln-chart-x")||"label",yField:this.dom.getAttribute("data-ln-chart-y")||"value",includeZero:this.dom.getAttribute("data-ln-chart-zero")!=="false",padding:Number.isFinite(u)&&u>=0?u:16,type:d==="area"||d==="polygon"?"area":"line",viewBox:this.plot&&Be(this.plot.getAttribute("viewBox"))||n}},o.prototype._setLoading=function(s){this.dom.classList.toggle("ln-chart--loading",s),this.dom.setAttribute("aria-busy",s?"true":"false")},o.prototype._renderLabels=function(s){if(!this.labels||(this.labels.replaceChildren(),s.count===0))return;const u=this.name+"-label",d='[data-ln-template="'+u+'"]';if(!this.dom.querySelector(d)&&!document.querySelector(d))return;const f=pe(this.dom,u,"ln-chart");if(!f)return;const _=W(this.dom);for(const y of s.points){const m=f.cloneNode(!0);q(m,{label:y.label,value:F(y.value,_)}),this.labels.appendChild(m)}},o.prototype._render=function(){const s=this._readOptions(),u=je(this._data,s);this.model=u,this.line&&(this.line.setAttribute("points",u.linePoints),this.line.toggleAttribute("hidden",u.count===0)),this.area&&(this.area.setAttribute("points",u.areaPoints),this.area.toggleAttribute("hidden",u.count===0||s.type!=="area"));const d=u.count===0;this.dom.classList.toggle("ln-chart--empty",d),this.empty&&this.empty.toggleAttribute("hidden",!d);const f=W(this.dom);c(this.minimum,F(u.min,f)),c(this.maximum,F(u.max,f)),c(this.count,F(u.count,f)),this._renderLabels(u),E(this.dom,"ln-chart:rendered",{chart:this.name,count:u.count,min:u.min,max:u.max})},o.prototype.requestData=function(){this.source=this.dom.getAttribute("data-ln-chart-source")||this.name,E(this.dom,"ln-chart:request-data",{chart:this.name,source:this.source,sort:Re(this.dom.getAttribute("data-ln-chart-sort")),filters:{},search:""})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-chart:set-data",this._onSetData),this.dom.removeEventListener("ln-chart:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-chart:request-refresh",this._onRefresh),this._data=[],this.model=null,delete this.dom[t])},re(e,t,o,"ln-chart",{attributes:a})})()})();
|
|
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 O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!O(r))return}e.apply(console,t)}}function E(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function 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 ae(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,i={};if(n)for(let c=0;c<a.length;c++){const o=a[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<a.length;c++){const o=a[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let s=0;s<o.options.length;s++)o.options[s].selected&&l[o.name].push(o.options[s].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const s=Number(o.value);l[o.name]=o.value===""||isNaN(s)?null:s}else l[o.name]=o.value}return l}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],l={};for(let a=0;a<n.length;a++){const i=n[a];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<n.length;a++){const i=n[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const s=String(o).split(",").map(function(u){return u.trim()});i.checked=s.indexOf(i.value)!==-1}else i.checked=se(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let s=0;s<i.options.length;s++)i.options[s].selected=o.indexOf(i.options[s].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=le);const j={};function ue(e,t){j[e]=t}function de(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=de);function W(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 fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=fe);const N={};function P(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function pe(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return P(t,n)}function U(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],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-attr").split(",");for(let s=0;s<o.length;s++){const u=o[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const c=a[i],o=c.getAttribute("data-ln-class").split(",");for(let s=0;s<o.length;s++){const u=o[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function 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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)U(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 a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(a,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const i=l[a],c=i.attributes;for(let o=0;o<c.length;o++){const s=c[o];s.value.indexOf("{{")!==-1&&i.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ge(e,t,n,r,l,a){const i={};for(let o=0;o<e.children.length;o++){const s=e.children[o],u=s.getAttribute("data-ln-render-key");u&&(i[u]=s)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const s=t[o],u=String(r(s));let d=i[u];if(d)l(d,s,o);else{const f=P(n,a);if(!f||(q(f,s),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,s,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=U,window.lnCore.lnFill=me,window.lnCore.renderList=ge);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function H(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function Q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),l=function(a,i){const c=a.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,l),l}function G(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Y(e,t,n,r,l){if(!e||t===null)return!0;const a=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${a}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${a}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${a}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,n){for(const r in n){const[l,a,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,a,i)},enumerable:!0,configurable:!0})}return e}function Z(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=z(r.values,r.fallback);break;case"integer":l=H;break;case"float":l=G;break;case"boolean":l=K;break;case"list":l=Q;break;case"json":l=J;break;case"string":default:l=L;break}l||(l=L),t[r.prop]=[l,n,r.fallback]}return t}function be(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ye(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=X,window.lnCore.attrSpec=Z,window.lnCore.attrStr=L,window.lnCore.attrInt=H,window.lnCore.attrBool=K,window.lnCore.attrList=Q,window.lnCore.attrEnum=z,window.lnCore.attrFloat=G,window.lnCore.attrJson=J);function M(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&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 r(c)}catch(o){console.error("["+n+"] init failed",c,o)}}}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 xe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Ae(e){const t=ee(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ye(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const i=a.effects&&a.effects[n];i?i(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function ve(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ee(),l=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const a=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<a.length;c++)Y(a[c].spec,i,n,a[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 a=r.byReactive.get(n);a&&te(a,t,n,e.oldValue),r.reactiveWildcard.length&&te(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const i=l[a];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(M(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function _e(){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{ve(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function 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 r=t[n];if(r.onSubtreeChange){const l=r.query,a=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;a&&r.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];M(r,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],i=a.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let o=0;o<c.length;o++){const s=c[o];if(!document.contains(s)){const u=s[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",s,d)}delete s[a.attribute]}}}}}}function ke(){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 r=t[n];if(r.type==="childList")try{Se(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function re(e,t,n,r,l={}){const a=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,s=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?be(d):u,_=d?new Set(Object.keys(d)):null,y=l.persist||null;function m(h){const w=h||document.body;if(M(w,e,t,n),d&&R())for(const p in d){const A=d[p],v=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&v.push(w);for(let $=0;$<v.length;$++){const B=v[$];O(B)&&Y(A,B.getAttribute(p),p,r,B)}}o&&o(w)}const C=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let w;for(;(w=h.exec(e))!==null;)C.push(w[1])}else C.push(e);Ae({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:C.concat(a),onAttributeChange:i,onAttrChange:s,effects:f,declared:_,persist:y}),_e();const g=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=l.subtreeQuery||(g?e:"["+e+"]");ne().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:D}),ke(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re);function S(){Ce()>0?xe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),m}function oe(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const l=r.split("&");for(let a=0;a<l.length;a++){const i=l[a];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,s=c>-1?i.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(s)}catch{n[o]=s}}return n}function Le(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const i=n[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");oe(location.hash)!==l&&(location.hash=l)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ee(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 Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Le,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Ne,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Ie);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);const b={};function Te(e){const t=e||"default";if(!b[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let l="",a=".";for(let i=0;i<r.length;i++)r[i].type==="group"&&(l=r[i].value),r[i].type==="decimal"&&(a=r[i].value);b[t]={groupSep:l,decimalSep:a,fmt:n}}return b[t]}function F(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",l=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,a=n.userDecimals!=null?n.userDecimals:null;if(l!==null){const i=r+"|max:"+l;return b[i]||(b[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:l})),b[i].format(e)}if(a!==null&&a>0){const i=r+"|exact:"+a;return b[i]||(b[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),b[i].format(e)}return Te(t).fmt.format(e)}function ie(e){if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function x(e){return String(Math.round(e*1e3)/1e3)}function $e(e,t,n){const r=ie(e);return r===null||r<0?0:Math.min(r,Math.min(t,n)/2)}function Be(e){if(typeof e!="string")return null;const t=e.trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(n=>!Number.isFinite(n))||t[2]<=0||t[3]<=0?null:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Re(e){if(!e||typeof e!="string")return null;const t=e.split(":"),n=t[0].trim();return n?{field:n,direction:t[1]&&t[1].trim().toLowerCase()==="desc"?"desc":"asc"}:null}function je(e,t){t=t||{};const n=t.viewBox||{x:0,y:0,width:1e3,height:320},r=t.xField||"label",l=t.yField||"value",a=t.includeZero!==!1,i=$e(t.padding,n.width,n.height),c=Array.isArray(e)?e:[],o=[];for(let h=0;h<c.length;h++){const w=c[h]||{},p=ie(w[l]);p!==null&&o.push({record:w,sourceIndex:h,label:w[r]==null?String(h+1):String(w[r]),value:p})}if(o.length===0)return{points:[],linePoints:"",areaPoints:"",count:0,min:null,max:null,domainMin:0,domainMax:1,baselineY:n.y+n.height-i};let s=o[0].value,u=o[0].value;for(let h=1;h<o.length;h++)o[h].value<s&&(s=o[h].value),o[h].value>u&&(u=o[h].value);let d=s,f=u;a&&(d=Math.min(0,d),f=Math.max(0,f)),d===f&&(f===0?f=1:f>0?d=0:f=0);const _=Math.max(1,n.width-i*2),y=Math.max(1,n.height-i*2),m=f-d,C=n.y+n.height-i-(0-d)/m*y,g=[];for(let h=0;h<o.length;h++){const w=o[h],p=o.length===1?.5:h/(o.length-1),A=n.x+i+p*_,v=n.y+n.height-i-(w.value-d)/m*y;g.push({record:w.record,sourceIndex:w.sourceIndex,label:w.label,value:w.value,x:A,y:v,pointString:x(A)+","+x(v)})}const D=g.map(h=>h.pointString).join(" ");let S="";if(g.length>0){const h=g[0],w=g[g.length-1],p=x(h.x)+","+x(C),A=x(w.x)+","+x(C);S=p+" "+D+" "+A}return{points:g,linePoints:D,areaPoints:S,count:g.length,min:s,max:u,domainMin:d,domainMax:f,baselineY:C}}(function(){const e="data-ln-chart",t="lnChart",n={x:0,y:0,width:1e3,height:320};if(window[t]!==void 0)return;function r(s){const u=s[t];u&&u.requestData()}function l(s){const u=s[t];u&&u._render()}const a={"data-ln-chart":{prop:"name",type:"string",read:L,fallback:"",effect:l,description:"Chart instance name or identifier"},"data-ln-chart-source":{type:"string",effect:r,description:"Source store or coordinator identifier"},"data-ln-chart-sort":{type:"string",effect:r,description:"Field name to sort chart series data by"},"data-ln-chart-type":{type:"enum",values:["line","bar","area","scatter"],fallback:"line",effect:l,description:"Visual chart render type"},"data-ln-chart-x":{type:"string",effect:l,description:"Field name mapping to X axis"},"data-ln-chart-y":{type:"string",effect:l,description:"Field name mapping to Y axis"},"data-ln-chart-padding":{type:"integer",fallback:20,min:0,effect:l,description:"Internal plot padding in pixels"},"data-ln-chart-zero":{type:"boolean",effect:l,description:"Forces Y axis scale to start at zero"}},i=Z(a);function c(s,u){s&&(s.textContent=u)}function o(s){this.dom=s,X(this,s,i),this.source=s.getAttribute("data-ln-chart-source")||this.name,this.plot=s.querySelector("[data-ln-chart-plot]"),this.line=s.querySelector("[data-ln-chart-line]"),this.area=s.querySelector("[data-ln-chart-area]"),this.labels=s.querySelector("[data-ln-chart-labels]"),this.empty=s.querySelector("[data-ln-chart-empty]"),this.minimum=s.querySelector("[data-ln-chart-min]"),this.maximum=s.querySelector("[data-ln-chart-max]"),this.count=s.querySelector("[data-ln-chart-count]"),this._data=[],this.model=null,this.isLoaded=!1;const u=this;return this._onSetData=function(d){const f=d.detail||{};u._data=Array.isArray(f.data)?f.data:[],u.isLoaded=!0,u._setLoading(!1),u._render()},this._onSetLoading=function(d){u._setLoading(!!(d.detail&&d.detail.loading))},this._onRefresh=function(){u.requestData()},s.addEventListener("ln-chart:set-data",this._onSetData),s.addEventListener("ln-chart:set-loading",this._onSetLoading),s.addEventListener("ln-chart:request-refresh",this._onRefresh),this.requestData(),this}o.prototype._readOptions=function(){const s=this.dom.getAttribute("data-ln-chart-padding"),u=s===null?NaN:Number(s),d=(this.dom.getAttribute("data-ln-chart-type")||"line").toLowerCase();return{xField:this.dom.getAttribute("data-ln-chart-x")||"label",yField:this.dom.getAttribute("data-ln-chart-y")||"value",includeZero:this.dom.getAttribute("data-ln-chart-zero")!=="false",padding:Number.isFinite(u)&&u>=0?u:16,type:d==="area"||d==="polygon"?"area":"line",viewBox:this.plot&&Be(this.plot.getAttribute("viewBox"))||n}},o.prototype._setLoading=function(s){this.dom.classList.toggle("ln-chart--loading",s),this.dom.setAttribute("aria-busy",s?"true":"false")},o.prototype._renderLabels=function(s){if(!this.labels||(this.labels.replaceChildren(),s.count===0))return;const u=this.name+"-label",d='[data-ln-template="'+u+'"]';if(!this.dom.querySelector(d)&&!document.querySelector(d))return;const f=pe(this.dom,u,"ln-chart");if(!f)return;const _=W(this.dom);for(const y of s.points){const m=f.cloneNode(!0);q(m,{label:y.label,value:F(y.value,_)}),this.labels.appendChild(m)}},o.prototype._render=function(){const s=this._readOptions(),u=je(this._data,s);this.model=u,this.line&&(this.line.setAttribute("points",u.linePoints),this.line.toggleAttribute("hidden",u.count===0)),this.area&&(this.area.setAttribute("points",u.areaPoints),this.area.toggleAttribute("hidden",u.count===0||s.type!=="area"));const d=u.count===0;this.dom.classList.toggle("ln-chart--empty",d),this.empty&&this.empty.toggleAttribute("hidden",!d);const f=W(this.dom);c(this.minimum,F(u.min,f)),c(this.maximum,F(u.max,f)),c(this.count,F(u.count,f)),this._renderLabels(u),E(this.dom,"ln-chart:rendered",{chart:this.name,count:u.count,min:u.min,max:u.max})},o.prototype.requestData=function(){this.source=this.dom.getAttribute("data-ln-chart-source")||this.name,E(this.dom,"ln-chart:request-data",{chart:this.name,source:this.source,sort:Re(this.dom.getAttribute("data-ln-chart-sort")),filters:{},search:""})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-chart:set-data",this._onSetData),this.dom.removeEventListener("ln-chart:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-chart:request-refresh",this._onRefresh),this._data=[],this.model=null,delete this.dom[t])},re(e,t,o,"ln-chart",{attributes:a})})()})();
|
|
@@ -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 y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!y(r))return}e.apply(console,t)}}function M(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&l[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);l[o.name]=o.value===""||isNaN(c)?null:c}else l[o.name]=o.value}return l}function Z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,r=[],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 a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const o=t[a];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(o).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=Z(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<i.options.length;c++)i.options[c].selected=o.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=z);const D={};function ee(e,t){D[e]=t}function te(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){M(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const A={};function ie(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[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 i=0;i<n.length;i++){const a=n[i],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&a.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&a.classList.toggle(u,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 N(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,a){return t[a]!==void 0?t[a]:""}))}const r=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],a=i.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function se(e,t,n,r,l,s){const i={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],d=String(r(c));let u=i[d];if(u)l(u,c,o);else{const f=ie(n,s);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,o)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=le,window.lnCore.renderList=se);function v(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function R(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const x=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(x.has(n))return x.get(n);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return x.set(n,l),l}function V(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function W(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function U(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const r in n){const[l,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function ce(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=j(r.values,r.fallback);break;case"integer":l=R;break;case"float":l=V;break;case"boolean":l=q;break;case"list":l=B;break;case"json":l=W;break;case"string":default:l=v;break}l||(l=v),t[r.prop]=[l,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function de(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=ae,window.lnCore.attrSpec=ce,window.lnCore.attrStr=v,window.lnCore.attrInt=R,window.lnCore.attrBool=q,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=V,window.lnCore.attrJson=W);function k(e,t,n,r){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 a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function H(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=H(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,r){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,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=H(),l=r.byAttr.get(n);if(F()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&y(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)U(s[a].spec,i,n,s[a].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=r.byReactive.get(n);s&&J(s,t,n,e.oldValue),r.reactiveWildcard.length&&J(r.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):(k(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function K(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=K();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];k(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const d=c[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+s.attribute+"] destroy failed",c,u)}delete c[s.attribute]}}}}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,o=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?ue(u):d,p=u?new Set(Object.keys(u)):null,w=l.persist||null;function b(E){const h=E||document.body;if(k(h,e,t,n),u&&F())for(const m in u){const Ie=u[m],O=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&O.push(h);for(let L=0;L<O.length;L++){const I=O[L];y(I)&&U(Ie,I.getAttribute(m),m,r,I)}}o&&o(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);he({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:p,persist:w}),be();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";K().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le}),me(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function G(){fe()>0?we(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function Q(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},r=Q(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),o=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function Ce(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=_();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("&");Q(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function xe(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 _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.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=_,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Se);function Ee(){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=Ee);function Oe(e,t=100,n=0){const r=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(n))||0,i=Math.max(s,Math.min(r,l)),a=l-s;let o=0;return a>0&&(o=(i-s)/a*100),o=Math.max(0,Math.min(100,o)),{value:r,min:s,max:l,clampedValue:i,percentage:o}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function n(f){const p=f[t];p&&u.call(p)}const r={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:n,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:n,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:n,description:"Text label format or template inside circular progress"}},l="http://www.w3.org/2000/svg",s=36,i=16,a=2*Math.PI*i;function o(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,d.call(this),u.call(this),this}o.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function c(f,p){const w=document.createElementNS(l,f);for(const[b,g]of Object.entries(p))w.setAttribute(b,g);return w}function d(){this.svg=c("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=c("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=c("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":a,"stroke-dashoffset":a,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function u(){const f=this.dom.getAttribute("data-ln-circular-progress"),p=this.dom.getAttribute("data-ln-circular-progress-max"),w=Oe(f,p||100),b=a-w.percentage/100*a;this.progressCircle.setAttribute("stroke-dashoffset",b);const g=this.dom.getAttribute("data-ln-circular-progress-label"),S=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=S,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",S),M(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}P(e,t,o,"ln-circular-progress",{attributes:r})})()})();
|
|
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 r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!A(r))return}e.apply(console,t)}}function M(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&l[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);l[o.name]=o.value===""||isNaN(c)?null:c}else l[o.name]=o.value}return l}function Z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,r=[],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 a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const o=t[a];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(o).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=Z(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<i.options.length;c++)i.options[c].selected=o.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=z);const D={};function ee(e,t){D[e]=t}function te(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){M(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const v={};function ie(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 i=0;i<n.length;i++){const a=n[i],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&a.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&a.classList.toggle(u,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 N(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,a){return t[a]!==void 0?t[a]:""}))}const r=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],a=i.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function se(e,t,n,r,l,s){const i={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],d=String(r(c));let u=i[d];if(u)l(u,c,o);else{const f=ie(n,s);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,o)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=le,window.lnCore.renderList=se);function x(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function R(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return k.set(n,l),l}function V(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function W(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function U(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const r in n){const[l,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function ce(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=j(r.values,r.fallback);break;case"integer":l=R;break;case"float":l=V;break;case"boolean":l=q;break;case"list":l=B;break;case"json":l=W;break;case"string":default:l=x;break}l||(l=x),t[r.prop]=[l,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function de(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=ae,window.lnCore.attrSpec=ce,window.lnCore.attrStr=x,window.lnCore.attrInt=R,window.lnCore.attrBool=q,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=V,window.lnCore.attrJson=W);function _(e,t,n,r){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 a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function H(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=H(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,n,r){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,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=H(),l=r.byAttr.get(n);if(F()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)U(s[a].spec,i,n,s[a].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=r.byReactive.get(n);s&&Q(s,t,n,e.oldValue),r.reactiveWildcard.length&&Q(r.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):(_(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];_(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const d=c[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+s.attribute+"] destroy failed",c,u)}delete c[s.attribute]}}}}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function K(e,t,n,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,o=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?ue(u):d,p=u?new Set(Object.keys(u)):null,w=l.persist||null;function b(E){const h=E||document.body;if(_(h,e,t,n),u&&F())for(const m in u){const Ie=u[m],O=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&O.push(h);for(let L=0;L<O.length;L++){const I=O[L];A(I)&&U(Ie,I.getAttribute(m),m,r,I)}}o&&o(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);he({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:p,persist:w}),be();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Le=l.subtreeQuery||(y?e:"["+e+"]");J().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le}),me(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K);function G(){fe()>0?we(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function P(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=P(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),o=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function Ce(e){if(!e)return null;const t=S();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=S();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("&");P(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function xe(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 _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.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=S,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Se);function Ee(){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=Ee);function Oe(e,t=100,n=0){const r=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(n))||0,i=Math.max(s,Math.min(r,l)),a=l-s;let o=0;return a>0&&(o=(i-s)/a*100),o=Math.max(0,Math.min(100,o)),{value:r,min:s,max:l,clampedValue:i,percentage:o}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function n(f){const p=f[t];p&&u.call(p)}const r={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:n,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:n,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:n,description:"Text label format or template inside circular progress"}},l="http://www.w3.org/2000/svg",s=36,i=16,a=2*Math.PI*i;function o(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,d.call(this),u.call(this),this}o.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function c(f,p){const w=document.createElementNS(l,f);for(const[b,g]of Object.entries(p))w.setAttribute(b,g);return w}function d(){this.svg=c("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=c("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=c("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":a,"stroke-dashoffset":a,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function u(){const f=this.dom.getAttribute("data-ln-circular-progress"),p=this.dom.getAttribute("data-ln-circular-progress-max"),w=Oe(f,p||100),b=a-w.percentage/100*a;this.progressCircle.setAttribute("stroke-dashoffset",b);const g=this.dom.getAttribute("data-ln-circular-progress-label"),y=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=y,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",y),M(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}K(e,t,o,"ln-circular-progress",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function O(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!C(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function X(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,o={};if(n)for(let a=0;a<s.length;a++){const i=s[a];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let a=0;a<s.length;a++){const i=s[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.value}return l}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const n=e.elements,r=[],l={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const a=o.getAttribute("data-ln-fill-as")||o.name;if(!a||!(a in t))continue;const i=t[a];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=ee(i);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<o.options.length;u++)o.options[u].selected=i.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const D={};function ne(e,t){D[e]=t}function re(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function le(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=oe,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=ie);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[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 o=0;o<n.length;o++){const a=n[o],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const a=r[o],i=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const c=f[0].trim(),d=f[1].trim();t[d]!=null&&a.setAttribute(c,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const a=l[o],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const a=s[o],i=a.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const c=f[0].trim(),d=f[1].trim();d in t&&a.classList.toggle(c,!!t[d])}}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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 $(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(o,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],a=o.attributes;for(let i=0;i<a.length;i++){const u=a[i];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ce(e,t,n,r,l,s){const o={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(o[f]=u)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(r(u));let c=o[f];if(c)l(c,u,i);else{const d=se(n,s);if(!d||($(d,u),c=d.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",f),l(c,u,i)}a.appendChild(c)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=N,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function A(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),l=function(s,o){const a=s.getAttribute(o);return a!==null&&r.has(a)?a:t};return v.set(n,l),l}function j(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function U(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function W(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const a=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,n){for(const r in n){const[l,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=B(r.values,r.fallback);break;case"integer":l=M;break;case"float":l=j;break;case"boolean":l=q;break;case"list":l=R;break;case"json":l=U;break;case"string":default:l=A;break}l||(l=A),t[r.prop]=[l,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function de(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=H,window.lnCore.attrSpec=V,window.lnCore.attrStr=A,window.lnCore.attrInt=M,window.lnCore.attrBool=q,window.lnCore.attrList=R,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=U);function x(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const a of o)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(i){console.error("["+n+"] init failed",a,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 we(e){const t=K(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function P(e,t,n,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),l=r.byAttr.get(n);if(O()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let a=0;a<s.length;a++)W(s[a].spec,o,n,s[a].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=r.byReactive.get(n);s&&P(s,t,n,e.oldValue),r.reactiveWildcard.length&&P(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(x(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function pe(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];x(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],o=s.query,a=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&a.push(r);for(let i=0;i<a.length;i++){const u=a[i];if(!document.contains(u)){const f=u[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(c){console.error("["+s.attribute+"] destroy failed",u,c)}delete u[s.attribute]}}}}}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{pe(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Q(e,t,n,r,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,a=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,c=l.attributes||null,d=c?ue(c):f,h=c?new Set(Object.keys(c)):null,b=l.persist||null;function g(T){const w=T||document.body;if(x(w,e,t,n),c&&O())for(const m in c){const Le=c[m],S=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&S.push(w);for(let E=0;E<S.length;E++){const L=S[E];C(L)&&W(Le,L.getAttribute(m),m,r,L)}}i&&i(w)}const k=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let w;for(;(w=T.exec(e))!==null;)k.push(w[1])}else k.push(e);we({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:n,onInit:i,observed:k.concat(s),onAttributeChange:o,onAttrChange:u,effects:d,declared:h,persist:b}),me();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";J().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:a,query:Ee}),ge(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function G(){fe()>0?he(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),g}function z(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},r=z(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const a=o.indexOf(":"),i=a>-1?o.slice(0,a):o,u=a>-1?o.slice(a+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Ce(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(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=_,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Te);function Se(){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=Se),(function(){const e="data-ln-confirm",t="lnConfirm",n="data-ln-confirm-state",r="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(c,d,h){return c.getAttribute(d)||h}function o(c,d,h){const b=parseFloat(c.getAttribute(d));return isNaN(b)||b<=0?h:b}function a(c){const d=document.createElement("span");return d.setAttribute(r,""),d.setAttribute("role","alert"),d.textContent=c,d}const i={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:o,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(c,d)=>c.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},u=V(i);function f(c){this.dom=c,H(this,c,u),this.revertTimer=null,this._submitted=!1,this.idleEl=c.querySelector("[data-ln-confirm-idle]"),this.activeEl=c.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":c.textContent.trim();const d=this;return this._onClick=function(h){if(!X(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},c.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(n,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const c=this.activeEl?this.activeEl.textContent.trim():"";c&&(this.dom.setAttribute("aria-label",c),this.dom.setAttribute("aria-live","polite"))}else{const c=this.dom.querySelector("svg.ln-icon use");c&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=c.getAttribute("href"),c.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(a(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),I(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const c=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){c._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(n),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const c=this.dom.querySelector("svg.ln-icon use");c&&this.originalIconHref&&c.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+r+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Q(e,t,f,"ln-confirm",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function O(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!C(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function X(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,o={};if(n)for(let a=0;a<s.length;a++){const i=s[a];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let a=0;a<s.length;a++){const i=s[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.value}return l}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const n=e.elements,r=[],l={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const a=o.getAttribute("data-ln-fill-as")||o.name;if(!a||!(a in t))continue;const i=t[a];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=ee(i);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<o.options.length;u++)o.options[u].selected=i.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const D={};function ne(e,t){D[e]=t}function re(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function le(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=oe,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=ie);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[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 o=0;o<n.length;o++){const a=n[o],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const a=r[o],i=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const c=f[0].trim(),d=f[1].trim();t[d]!=null&&a.setAttribute(c,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const a=l[o],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const a=s[o],i=a.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const c=f[0].trim(),d=f[1].trim();d in t&&a.classList.toggle(c,!!t[d])}}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 r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 $(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(o,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],a=o.attributes;for(let i=0;i<a.length;i++){const u=a[i];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ce(e,t,n,r,l,s){const o={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(o[f]=u)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(r(u));let c=o[f];if(c)l(c,u,i);else{const d=se(n,s);if(!d||($(d,u),c=d.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",f),l(c,u,i)}a.appendChild(c)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=N,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function A(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),l=function(s,o){const a=s.getAttribute(o);return a!==null&&r.has(a)?a:t};return v.set(n,l),l}function j(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function U(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function W(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const a=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,n){for(const r in n){const[l,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=B(r.values,r.fallback);break;case"integer":l=M;break;case"float":l=j;break;case"boolean":l=q;break;case"list":l=R;break;case"json":l=U;break;case"string":default:l=A;break}l||(l=A),t[r.prop]=[l,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function de(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=H,window.lnCore.attrSpec=V,window.lnCore.attrStr=A,window.lnCore.attrInt=M,window.lnCore.attrBool=q,window.lnCore.attrList=R,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=U);function x(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const a of o)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(i){console.error("["+n+"] init failed",a,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 we(e){const t=K(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function P(e,t,n,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),l=r.byAttr.get(n);if(O()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let a=0;a<s.length;a++)W(s[a].spec,o,n,s[a].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=r.byReactive.get(n);s&&P(s,t,n,e.oldValue),r.reactiveWildcard.length&&P(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(x(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function pe(e){const t=Q();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.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&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];x(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],o=s.query,a=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&a.push(r);for(let i=0;i<a.length;i++){const u=a[i];if(!document.contains(u)){const f=u[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(c){console.error("["+s.attribute+"] destroy failed",u,c)}delete u[s.attribute]}}}}}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{pe(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function J(e,t,n,r,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,a=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,c=l.attributes||null,d=c?ue(c):f,h=c?new Set(Object.keys(c)):null,b=l.persist||null;function g(T){const w=T||document.body;if(x(w,e,t,n),c&&O())for(const m in c){const Oe=c[m],S=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&S.push(w);for(let E=0;E<S.length;E++){const L=S[E];C(L)&&W(Oe,L.getAttribute(m),m,r,L)}}i&&i(w)}const k=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let w;for(;(w=T.exec(e))!==null;)k.push(w[1])}else k.push(e);we({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:n,onInit:i,observed:k.concat(s),onAttributeChange:o,onAttrChange:u,effects:d,declared:h,persist:b}),me();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Le=l.subtreeQuery||(Ee?e:"["+e+"]");Q().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:a,query:Le}),ge(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=J);function G(){fe()>0?he(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),g}function z(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},r=z(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const a=o.indexOf(":"),i=a>-1?o.slice(0,a):o,u=a>-1?o.slice(a+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Ce(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(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=_,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Te);function Se(){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=Se),(function(){const e="data-ln-confirm",t="lnConfirm",n="data-ln-confirm-state",r="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(c,d,h){return c.getAttribute(d)||h}function o(c,d,h){const b=parseFloat(c.getAttribute(d));return isNaN(b)||b<=0?h:b}function a(c){const d=document.createElement("span");return d.setAttribute(r,""),d.setAttribute("role","alert"),d.textContent=c,d}const i={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:o,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(c,d)=>c.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},u=V(i);function f(c){this.dom=c,H(this,c,u),this.revertTimer=null,this._submitted=!1,this.idleEl=c.querySelector("[data-ln-confirm-idle]"),this.activeEl=c.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":c.textContent.trim();const d=this;return this._onClick=function(h){if(!X(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},c.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(n,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const c=this.activeEl?this.activeEl.textContent.trim():"";c&&(this.dom.setAttribute("aria-label",c),this.dom.setAttribute("aria-live","polite"))}else{const c=this.dom.querySelector("svg.ln-icon use");c&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=c.getAttribute("href"),c.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(a(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),I(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const c=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){c._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(n),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const c=this.dom.querySelector("svg.ln-icon use");c&&this.originalIconHref&&c.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+r+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},J(e,t,f,"ln-confirm",{attributes:i})})()})();
|
|
@@ -371,7 +371,7 @@ export function registerComponent(selector, attribute, ComponentFn, componentTag
|
|
|
371
371
|
_ensureAttrObserver();
|
|
372
372
|
|
|
373
373
|
const isComplex = selector.indexOf('[') !== -1 || selector.indexOf('.') !== -1 || selector.indexOf('#') !== -1;
|
|
374
|
-
const query = isComplex ? selector : '[' + selector + ']';
|
|
374
|
+
const query = options.subtreeQuery || (isComplex ? selector : '[' + selector + ']');
|
|
375
375
|
|
|
376
376
|
_lifecycleRegistry().push({
|
|
377
377
|
selector: selector,
|