@livenetworks/ashlar 2.1.13 → 2.2.0
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/COMPONENTS.md +80 -80
- package/components/ln-api-connector/ln-api-connector.schema.json +105 -105
- package/components/ln-chart/ln-chart-dev.scss +0 -4
- package/components/ln-core/README.md +21 -21
- package/components/ln-core/ln-core.schema.json +120 -120
- package/components/ln-core/query.js +113 -113
- package/components/ln-data-coordinator/README.md +2 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -196
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +457 -432
- package/components/ln-data-store/ln-data-store.schema.json +92 -92
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/generated-attributes.js +304 -302
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-external-links/README.md +19 -19
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/ln-external-links.schema.json +9 -0
- package/components/ln-external-links/ln-external-links.scss +12 -0
- package/components/ln-external-links/src/ln-external-links.js +3 -2
- package/components/ln-filter/README.md +2 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +157 -169
- package/components/ln-filter/src/ln-filter.js +1 -3
- package/components/ln-form/ln-form.schema.json +57 -57
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-key/ln-key.schema.json +8 -0
- package/components/ln-key/src/ln-key.js +8 -5
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.schema.json +6 -0
- package/components/ln-obfuscator/src/ln-obfuscator.js +2 -2
- package/components/ln-options/ln-options.schema.json +47 -47
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-progress/ln-progress.schema.json +0 -13
- package/components/ln-search/ln-search.schema.json +111 -111
- package/components/ln-sort/README.md +1 -0
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +100 -112
- package/components/ln-sort/src/sort-model.js +1 -6
- package/components/ln-sortable/ln-sortable.schema.json +38 -38
- package/components/ln-sortable/ln-sortable.scss +25 -25
- package/components/ln-table/README.md +8 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +195 -195
- package/components/ln-table/src/ln-table.js +43 -7
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +18 -0
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +104 -2
- package/components/ln-toast/README.md +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toast/ln-toast.schema.json +6 -0
- package/components/ln-toast/src/ln-toast.js +1 -1
- package/components/ln-validate/README.md +6 -6
- package/components/ln-validate/ln-validate-dev.scss +0 -5
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/ln-validate.schema.json +0 -6
- package/components/ln-validate/src/ln-validate.js +48 -29
- package/ln-ashlar.html-data.json +1824 -1814
- package/package.json +95 -95
- package/theme/README.md +7 -6
- package/theme/base/_global.scss +2 -2
- package/theme/base/_reset.scss +11 -0
- package/theme/components/_app-shell.scss +0 -8
- package/theme/components/_form.scss +6 -6
- package/theme/components/_ln-table.scss +6 -3
- package/theme/components/_scrollbar.scss +5 -4
- package/theme/components/_sortable.scss +19 -19
- package/theme/components/_stat-card.scss +1 -0
- package/theme/components/_table.scss +10 -33
- package/theme/config/_density.scss +236 -104
- package/theme/config/_palette.scss +71 -49
- package/theme/config/_theme.scss +27 -31
- package/theme/config/_tokens.scss +28 -26
- package/theme/config/mixins/_app-shell.scss +17 -21
- package/theme/config/mixins/_btn.scss +4 -2
- package/theme/config/mixins/_card.scss +87 -67
- package/theme/config/mixins/_colors.scss +2 -1
- package/theme/config/mixins/_display.scss +12 -0
- package/theme/config/mixins/_footer.scss +3 -1
- package/theme/config/mixins/_form.scss +48 -16
- package/theme/config/mixins/_layout.scss +9 -0
- package/theme/config/mixins/_ln-table.scss +22 -15
- package/theme/config/mixins/_modal.scss +3 -0
- package/theme/config/mixins/_nav.scss +27 -4
- package/theme/config/mixins/_sidebar.scss +2 -1
- package/theme/config/mixins/_stat-card.scss +33 -2
- package/theme/config/mixins/_status-badge.scss +1 -0
- package/theme/config/mixins/_table.scss +81 -39
- package/theme/config/mixins/_tabs.scss +31 -0
- package/theme/config/mixins/_toast.scss +0 -1
- package/theme/designs/relaxed/_card.scss +12 -0
- package/theme/designs/relaxed/_layout.scss +24 -0
- package/theme/ln-ashlar-core.scss +1 -0
- package/theme/ln-ashlar-dev.scss +0 -1
- package/theme/ln-ashlar-relaxed.scss +67 -0
- package/theme/tailwind/components.css +561 -24
- package/theme/utilities/_utilities.scss +1 -11
- package/web-types.json +2351 -2337
- package/components/ln-progress/ln-progress-dev.scss +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function N(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!S(o))return}e.apply(console,t)}}function L(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(r)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const r=e.elements,o=[],i={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=se(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const M={};function ce(e,t){M[e]=t}function de(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);const E={};function he(e,t){E[e]||(E[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=E[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(u,t[p])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(u,!!t[p])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function V(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,r,o,i,s){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(o(c));let u=l[d];if(u)i(u,c,n);else{const p=he(r,s);if(!p||(V(p,c),u=p.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=B,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function x(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function j(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function U(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return k.set(r,i),i}function P(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function K(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function Q(e,t,r,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,r){for(const o in r){const[i,s,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=H(o.values,o.fallback);break;case"integer":i=j;break;case"float":i=P;break;case"boolean":i=U;break;case"list":i=W;break;case"json":i=K;break;case"string":default:i=x;break}i||(i=x),t[o.prop]=[i,r,o.fallback]}return t}function ye(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=ge,window.lnCore.attrStr=x,window.lnCore.attrInt=j,window.lnCore.attrBool=U,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=P,window.lnCore.attrJson=K);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function G(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&A(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)A(a[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=J(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=J(),i=o.byAttr.get(t),s=N()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&S(l)){const a=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<a.length;c++)Q(a[c].spec,n,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&z(a,l,t,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(G(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function q(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function X(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Y(e){const t=O();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=q();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(s.matches&&s.matches(c)&&(n.ComponentFn&&A(s,n),n.onInit&&n.onInit(s)),l&&s.querySelectorAll)){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)n.ComponentFn&&A(d[u],n),n.onInit&&n.onInit(d[u])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(s.matches&&s.matches(c)&&X(s,n),l&&s.querySelectorAll)){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)X(d[u],n)}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Y(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Y(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){O().push(e),e.onSubtreeChange&&e.query&&q().push(e),Z()}function ee(e,t,r,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,p=u?ye(u):d,b=u?new Set(Object.keys(u)):null,m=i.persist||null;function f(I){const g=I||document.body;if(G(g,e,t,r),u&&N())for(const v in u){const Ge=u[v],D=Array.from(g.querySelectorAll("["+v+"]"));g.matches&&g.matches("["+v+"]")&&D.push(g);for(let F=0;F<D.length;F++){const T=D[F];S(T)&&Q(Ge,T.getAttribute(v),v,o,T)}}n&&n(g)}const w=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)w.push(g[1])}else w.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:b,persist:m}),Le();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=i.subtreeQuery||(h?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:y};O().push(C),a&&y&&q().push(C),Z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Ee);function oe(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function te(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,r={},o=te(t);if(!o)return r;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=R();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");te(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(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 r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=ke,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Te);function Ne(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[s,l]of i.entries())r[s]=l;return r}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ve(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function He(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=$e,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ve,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=We,window.lnCore.queryFilterDecode=He);function Pe(){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=Pe);const ne={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function re(e,t=0){return e?!!(e.valid&&t===0):t===0}function Ke(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Qe(e,t){const r=[];if(e){const o=Object.keys(ne);for(let i=0;i<o.length;i++){const s=o[i],l=ne[s];e[l]&&r.push(s)}}if(t){const o=Array.from(t);for(let i=0;i<o.length;i++)o[i]&&r.indexOf(o[i])===-1&&r.push(o[i])}return r}(function(){const e="data-ln-validate",t="lnValidate",r="data-ln-validate-errors",o="data-ln-validate-error",i="ln-validate-valid",s="ln-validate-invalid";if(window[t]!==void 0)return;const l={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,d=n.tagName,u=n.type,p=d==="SELECT"||u==="checkbox"||u==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(m){const f=m.detail&&m.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const w=n.closest(".form-element");if(w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.remove("hidden")}n.classList.remove(i),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const f=m.detail&&m.detail.error,w=n.closest(".form-element");if(f){if(c._customErrors.delete(f),w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.add("hidden")}}else c._customErrors.forEach(function(h){if(w){const y=w.querySelector("["+o+'="'+h+'"]');y&&y.classList.add("hidden")}}),c._customErrors.clear();c._touched&&c.validate()},p||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const b=n.form;return b&&(b.hasAttribute("novalidate")||b.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(m){c._touched=!0,!c.validate()&&m.detail&&m.detail.invalidFields&&m.detail.invalidFields.push(c.dom)},b.addEventListener("reset",this._onFormReset),b.addEventListener("ln-validate:request-validate",this._onValidateRequest),b._lnValidateGateBound||(b._lnValidateGateBound=!0,b.addEventListener("submit",function(m){const f={invalidFields:[]};L(b,"ln-validate:request-validate",f),f.invalidFields.length>0&&(m.preventDefault(),f.invalidFields.sort((w,h)=>w.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Ke(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=re(c,this._customErrors.size),u=Qe(c,this._customErrors),p=n.closest(".form-element");if(p){const f=p.querySelector("["+r+"]");if(f){const w=f.querySelectorAll("["+o+"]");for(let h=0;h<w.length;h++){const y=w[h].getAttribute(o),C=!u.includes(y);w[h].classList.contains("hidden")!==C&&w[h].classList.toggle("hidden",C)}}}n.classList.contains(i)!==d&&n.classList.toggle(i,d),n.classList.contains(s)===d&&n.classList.toggle(s,!d);const b=d?"false":"true";return n.getAttribute("aria-invalid")!==b&&n.setAttribute("aria-invalid",b),L(n,d?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:u}),d},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.contains(i)&&this.dom.classList.remove(i),this.dom.classList.contains(s)&&this.dom.classList.remove(s),this.dom.hasAttribute("aria-invalid")&&this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const c=n.querySelectorAll("["+o+"]");for(let d=0;d<c.length;d++)c[d].classList.contains("hidden")||c[d].classList.add("hidden")}},Object.defineProperty(a.prototype,"isValid",{get:function(){return re(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(i,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},ee(e,t,a,"ln-validate",{attributes:l})})()})();
|
|
1
|
+
(function(){"use strict";function F(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!_(o))return}e.apply(console,t)}}function A(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function 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 ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},l=e.elements,s={};if(r)for(let a=0;a<l.length;a++){const n=l[a];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[n.name]||0)+1)}for(let a=0;a<l.length;a++){const n=l[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&s[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const r=e.elements,o=[],i={};for(let l=0;l<r.length;l++){const s=r[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<r.length;l++){const s=r[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const a=s.getAttribute("data-ln-fill-as")||s.name;if(!a||!(a in t))continue;const n=t[a];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(i[s.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});s.checked=c.indexOf(s.value)!==-1}else s.checked=le(n);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<s.options.length;c++)s.options[c].selected=n.indexOf(s.options[c].value)!==-1;o.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ie);const T={};function ce(e,t){T[e]=t}function de(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);const S={};function he(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=S[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let s=0;s<r.length;s++){const a=r[s],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const a=o[s],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),h=u[1].trim();t[h]!=null&&a.setAttribute(d,t[h])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const a=i[s],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const a=l[s],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),h=u[1].trim();h in t&&a.classList.toggle(d,!!t[h])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const o=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],a=s.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function me(e,t,r,o,i,l){const s={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(s[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(o(c));let d=s[u];if(d)i(d,c,n);else{const h=he(r,l);if(!h||($(h,c),d=h.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=M,window.lnCore.lnFill=pe,window.lnCore.renderList=me);function E(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function B(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function V(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const L=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(L.has(r))return L.get(r);const o=new Set(e||[]),i=function(l,s){const a=l.getAttribute(s);return a!==null&&o.has(a)?a:t};return L.set(r,i),i}function W(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function H(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function P(e,t,r,o,i){if(!e||t===null)return!0;const l=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(s==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${l}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${l}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${l}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const o in r){const[i,l,s]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=U(o.values,o.fallback);break;case"integer":i=B;break;case"float":i=W;break;case"boolean":i=V;break;case"list":i=j;break;case"json":i=H;break;case"string":default:i=E;break}i||(i=E),t[o.prop]=[i,r,o.fallback]}return t}function ye(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=be,window.lnCore.attrSpec=ge,window.lnCore.attrStr=E,window.lnCore.attrInt=B,window.lnCore.attrBool=V,window.lnCore.attrList=j,window.lnCore.attrEnum=U,window.lnCore.attrFloat=W,window.lnCore.attrJson=H);function v(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,o){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(l)&&v(e,s),e.querySelectorAll){const a=e.querySelectorAll(l);for(let n=0;n<a.length;n++)v(a[n],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function G(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=G(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,o){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[r];s?s(t,r,o):l.onAttrChange&&(!l.declared||l.declared.has(r))&&l.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=G(),i=o.byAttr.get(t),l=F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&_(s)){const a=o.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let c=0;c<a.length;c++)P(a[c].spec,n,t,a[c].componentTag,s)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&K(a,s,t,e.oldValue),o.reactiveWildcard.length&&K(o.reactiveWildcard,s,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(Q(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function k(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function J(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=x();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=k();if(e.target&&o.length)for(let i=0;i<o.length;i++){const l=o[i],s=l.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;a&&l.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType!==1)continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(l.matches&&l.matches(c)&&(n.ComponentFn&&v(l,n),n.onInit&&n.onInit(l)),s&&l.querySelectorAll)){const u=l.querySelectorAll(c);for(let d=0;d<u.length;d++)n.ComponentFn&&v(u[d],n),n.onInit&&n.onInit(u[d])}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType!==1||document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(l.matches&&l.matches(c)&&J(l,n),s&&l.querySelectorAll)){const u=l.querySelectorAll(c);for(let d=0;d<u.length;d++)J(u[d],n)}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{z(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){x().push(e),e.onSubtreeChange&&e.query&&k().push(e),X()}function Y(e,t,r,o,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,h=d?ye(d):u,m=d?new Set(Object.keys(d)):null,b=i.persist||null;function f(O){const g=O||document.body;if(Q(g,e,t,r),d&&F())for(const y in d){const Ke=d[y],R=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&R.push(g);for(let q=0;q<R.length;q++){const D=R[q];_(D)&&P(Ke,D.getAttribute(y),y,o,D)}}n&&n(g)}const w=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let g;for(;(g=O.exec(e))!==null;)w.push(g[1])}else w.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:r,onInit:n,observed:w.concat(l),onAttributeChange:s,onAttrChange:c,effects:h,declared:m,persist:b}),Ee();const p=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ne=i.subtreeQuery||(p?e:"["+e+"]"),re={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:ne};x().push(re),a&&ne&&k().push(re),X(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Le);function oe(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function Z(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,r={},o=Z(t);if(!o)return r;const i=o.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const a=s.indexOf(":"),n=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const r=I();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(l){const s=r[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");Z(location.hash)!==i&&(location.hash=i)}function Oe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(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 r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Te);function Ne(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[l,s]of i.entries())r[l]=s;return r}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ve(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function He(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=$e,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ve,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=We,window.lnCore.queryFilterDecode=He);function Pe(){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=Pe);const ee={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function te(e,t=0){return e?!!(e.valid&&t===0):t===0}function Qe(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Ge(e,t){const r=[];if(e){const o=Object.keys(ee);for(let i=0;i<o.length;i++){const l=o[i],s=ee[l];e[s]&&r.push(l)}}if(t){const o=Array.from(t);for(let i=0;i<o.length;i++)o[i]&&r.indexOf(o[i])===-1&&r.push(o[i])}return r}(function(){const e="data-ln-validate",t="lnValidate",r="data-ln-validate-errors",o="data-ln-validate-error",i="ln-validate-valid",l="ln-validate-invalid";if(window[t]!==void 0)return;const s={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,u=n.tagName,d=n.type,h=u==="SELECT"||d==="checkbox"||d==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(b){const f=b.detail&&b.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const w=c._getErrorItems();if(w)for(let p=0;p<w.length;p++)w[p].key===f&&w[p].el.classList.remove("hidden");n.classList.remove(i),n.classList.add(l),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(b){const f=b.detail&&b.detail.error,w=c._getErrorItems();if(f){if(c._customErrors.delete(f),w)for(let p=0;p<w.length;p++)w[p].key===f&&w[p].el.classList.add("hidden")}else{if(w)for(let p=0;p<w.length;p++)c._customErrors.has(w[p].key)&&w[p].el.classList.add("hidden");c._customErrors.clear()}c._touched&&c.validate()},h||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const m=n.form;return m&&(m.hasAttribute("novalidate")||m.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(b){c._touched=!0,!c.validate()&&b.detail&&b.detail.invalidFields&&b.detail.invalidFields.push(c.dom)},m.addEventListener("reset",this._onFormReset),m.addEventListener("ln-validate:request-validate",this._onValidateRequest),m._lnValidateGateBound||(m._lnValidateGateBound=!0,m.addEventListener("submit",function(b){const f={invalidFields:[]};A(m,"ln-validate:request-validate",f),f.invalidFields.length>0&&(b.preventDefault(),f.invalidFields.sort((w,p)=>w.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Qe(n)&&(this._touched=!0,this.validate()),this}a.prototype._getErrorItems=function(){if(this._errorItems!==void 0)return this._errorItems;const n=this.dom.closest(":has(> ["+r+"])");if(n){const c=n.querySelector("["+r+"]");if(c){const u=c.querySelectorAll("["+o+"]");this._errorItems=[];for(let d=0;d<u.length;d++)this._errorItems.push({el:u[d],key:u[d].getAttribute(o)});return this._errorItems}}return this._errorItems=null,null},a.prototype.validate=function(){const n=this.dom,c=n.validity,u=te(c,this._customErrors.size),d=Ge(c,this._customErrors),h=this._getErrorItems();if(h)for(let f=0;f<h.length;f++){const w=!d.includes(h[f].key);h[f].el.classList.contains("hidden")!==w&&h[f].el.classList.toggle("hidden",w)}n.classList.contains(i)!==u&&n.classList.toggle(i,u),n.classList.contains(l)===u&&n.classList.toggle(l,!u);const m=u?"false":"true";return n.getAttribute("aria-invalid")!==m&&n.setAttribute("aria-invalid",m),A(n,u?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:d}),u},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.contains(i)&&this.dom.classList.remove(i),this.dom.classList.contains(l)&&this.dom.classList.remove(l),this.dom.hasAttribute("aria-invalid")&&this.dom.removeAttribute("aria-invalid");const n=this._getErrorItems();if(n)for(let c=0;c<n.length;c++)n[c].el.classList.contains("hidden")||n[c].el.classList.add("hidden")},Object.defineProperty(a.prototype,"isValid",{get:function(){return te(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(i,l),this.dom.removeAttribute("aria-invalid"),this._errorItems=null,delete this.dom[t]},Y(e,t,a,"ln-validate",{attributes:s})})()})();
|
|
@@ -45,10 +45,11 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
|
|
|
45
45
|
if (!error) return;
|
|
46
46
|
self._customErrors.add(error);
|
|
47
47
|
self._touched = true;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const items = self._getErrorItems();
|
|
49
|
+
if (items) {
|
|
50
|
+
for (let i = 0; i < items.length; i++) {
|
|
51
|
+
if (items[i].key === error) items[i].el.classList.remove('hidden');
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
54
|
dom.classList.remove(CSS_VALID);
|
|
54
55
|
dom.classList.add(CSS_INVALID);
|
|
@@ -57,20 +58,22 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
|
|
|
57
58
|
|
|
58
59
|
this._onClearCustom = function (e) {
|
|
59
60
|
const error = e.detail && e.detail.error;
|
|
60
|
-
const
|
|
61
|
+
const items = self._getErrorItems();
|
|
61
62
|
if (error) {
|
|
62
63
|
self._customErrors.delete(error);
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
if (items) {
|
|
65
|
+
for (let i = 0; i < items.length; i++) {
|
|
66
|
+
if (items[i].key === error) items[i].el.classList.add('hidden');
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
} else {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (items) {
|
|
71
|
+
for (let i = 0; i < items.length; i++) {
|
|
72
|
+
if (self._customErrors.has(items[i].key)) {
|
|
73
|
+
items[i].el.classList.add('hidden');
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
|
-
}
|
|
76
|
+
}
|
|
74
77
|
self._customErrors.clear();
|
|
75
78
|
}
|
|
76
79
|
if (self._touched) self.validate();
|
|
@@ -127,23 +130,39 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
|
|
|
127
130
|
return this;
|
|
128
131
|
}
|
|
129
132
|
|
|
133
|
+
_component.prototype._getErrorItems = function () {
|
|
134
|
+
if (this._errorItems !== undefined) return this._errorItems;
|
|
135
|
+
const parent = this.dom.closest(':has(> [' + ERRORS_SELECTOR + '])');
|
|
136
|
+
if (parent) {
|
|
137
|
+
const errorList = parent.querySelector('[' + ERRORS_SELECTOR + ']');
|
|
138
|
+
if (errorList) {
|
|
139
|
+
const nodeList = errorList.querySelectorAll('[' + ERROR_SELECTOR + ']');
|
|
140
|
+
this._errorItems = [];
|
|
141
|
+
for (let i = 0; i < nodeList.length; i++) {
|
|
142
|
+
this._errorItems.push({
|
|
143
|
+
el: nodeList[i],
|
|
144
|
+
key: nodeList[i].getAttribute(ERROR_SELECTOR)
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return this._errorItems;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
this._errorItems = null;
|
|
151
|
+
return null;
|
|
152
|
+
};
|
|
153
|
+
|
|
130
154
|
_component.prototype.validate = function () {
|
|
131
155
|
const dom = this.dom;
|
|
132
156
|
const validity = dom.validity;
|
|
133
157
|
const isValid = isFieldValid(validity, this._customErrors.size);
|
|
134
158
|
const activeErrors = resolveActiveErrorKeys(validity, this._customErrors);
|
|
135
159
|
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const errorKey = items[i].getAttribute(ERROR_SELECTOR);
|
|
143
|
-
const shouldHide = !activeErrors.includes(errorKey);
|
|
144
|
-
if (items[i].classList.contains('hidden') !== shouldHide) {
|
|
145
|
-
items[i].classList.toggle('hidden', shouldHide);
|
|
146
|
-
}
|
|
160
|
+
const items = this._getErrorItems();
|
|
161
|
+
if (items) {
|
|
162
|
+
for (let i = 0; i < items.length; i++) {
|
|
163
|
+
const shouldHide = !activeErrors.includes(items[i].key);
|
|
164
|
+
if (items[i].el.classList.contains('hidden') !== shouldHide) {
|
|
165
|
+
items[i].el.classList.toggle('hidden', shouldHide);
|
|
147
166
|
}
|
|
148
167
|
}
|
|
149
168
|
}
|
|
@@ -173,12 +192,11 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
|
|
|
173
192
|
if (this.dom.classList.contains(CSS_INVALID)) this.dom.classList.remove(CSS_INVALID);
|
|
174
193
|
if (this.dom.hasAttribute('aria-invalid')) this.dom.removeAttribute('aria-invalid');
|
|
175
194
|
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
const items = parent.querySelectorAll('[' + ERROR_SELECTOR + ']');
|
|
195
|
+
const items = this._getErrorItems();
|
|
196
|
+
if (items) {
|
|
179
197
|
for (let i = 0; i < items.length; i++) {
|
|
180
|
-
if (!items[i].classList.contains('hidden')) {
|
|
181
|
-
items[i].classList.add('hidden');
|
|
198
|
+
if (!items[i].el.classList.contains('hidden')) {
|
|
199
|
+
items[i].el.classList.add('hidden');
|
|
182
200
|
}
|
|
183
201
|
}
|
|
184
202
|
}
|
|
@@ -205,6 +223,7 @@ import { hasInitialValue, isFieldValid, resolveActiveErrorKeys } from './validat
|
|
|
205
223
|
|
|
206
224
|
this.dom.classList.remove(CSS_VALID, CSS_INVALID);
|
|
207
225
|
this.dom.removeAttribute('aria-invalid');
|
|
226
|
+
this._errorItems = null;
|
|
208
227
|
delete this.dom[DOM_ATTRIBUTE];
|
|
209
228
|
};
|
|
210
229
|
|