@livenetworks/ashlar 2.0.10 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +106 -40
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/src/ln-editor.js +45 -12
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!E(o))return}e.apply(console,t)}}function Y(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let u=0;u<s.length;u++){const r=s[u];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let u=0;u<s.length;u++){const r=s[u];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&l[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);l[r.name]=r.value===""||isNaN(a)?null:a}else l[r.name]=r.value}return l}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const u=i.getAttribute("data-ln-fill-as")||i.name;if(!u||!(u in t))continue;const r=t[u];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(r).split(",").map(function(f){return f.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=te(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<i.options.length;a++)i.options[a].selected=r.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const B={};function oe(e,t){B[e]=t}function re(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){Y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];q[n]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const L={};function ue(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=L[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const u=n[i],r=u.getAttribute("data-ln-field");t[r]!=null&&(u.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const u=o[i],r=u.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const f=r[a].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),p=f[1].trim();t[p]!=null&&u.setAttribute(d,t[p])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const u=l[i],r=u.getAttribute("data-ln-show");r in t&&u.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const u=s[i],r=u.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const f=r[a].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),p=f[1].trim();p in t&&u.classList.toggle(d,!!t[p])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(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(i,u){return t[u]!==void 0?t[u]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],u=i.attributes;for(let r=0;r<u.length;r++){const a=u[r];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ce(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const a=e.children[r],f=a.getAttribute("data-ln-render-key");f&&(i[f]=a)}const u=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],f=String(o(a));let d=i[f];if(d)l(d,a,r);else{const p=ue(n,s);if(!p||(j(p,a),d=p.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,a,r)}u.appendChild(d)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function R(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function W(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const T=new Map;function P(e,t){const n=(e?e.join("|"):"")+"::"+t;if(T.has(n))return T.get(n);const o=new Set(e||[]),l=function(s,i){const u=s.getAttribute(i);return u!==null&&o.has(u)?u:t};return T.set(n,l),l}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function V(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Q(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const u=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(u(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(u(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return u(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=P(o.values,o.fallback);break;case"integer":l=R;break;case"float":l=H;break;case"boolean":l=W;break;case"list":l=U;break;case"json":l=V;break;case"string":default:l=O;break}l||(l=O),t[o.prop]=[l,n,o.fallback]}return t}function we(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function pe(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=de,window.lnCore.attrSpec=fe,window.lnCore.attrStr=O,window.lnCore.attrInt=R,window.lnCore.attrBool=W,window.lnCore.attrList=U,window.lnCore.attrEnum=P,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function I(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const u of i)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new o(u)}catch(r){console.error("["+n+"] init failed",u,r)}}}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 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 me(e){const t=J(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=pe(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function K(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ge(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=J(),l=o.byAttr.get(n);if($()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&E(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let u=0;u<s.length;u++)Q(s[u].spec,i,n,s[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&K(s,t,n,e.oldValue),o.reactiveWildcard.length&&K(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const i=l[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(I(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ce(e){const t=G();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];I(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,u=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&u.push(o);for(let r=0;r<u.length;r++){const a=u[r];if(!document.contains(a)){const f=a[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",a,d)}delete a[s.attribute]}}}}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Ce(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,u=l.onSubtreeChange||null,r=l.onInit||null,a=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,p=d?we(d):f,A=d?new Set(Object.keys(d)):null,v=l.persist||null;function C(b){const h=b||document.body;if(I(h,e,t,n),d&&$())for(const w in d){const F=d[w],_=Array.from(h.querySelectorAll("["+w+"]"));h.matches&&h.matches("["+w+"]")&&_.push(h);for(let x=0;x<_.length;x++){const k=_[x];E(k)&&Q(F,k.getAttribute(w),w,o,k)}}r&&r(h)}const g=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let h;for(;(h=b.exec(e))!==null;)g.push(h[1])}else g.push(e);me({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:g.concat(s),onAttributeChange:i,onAttrChange:a,effects:p,declared:A,persist:v}),ye();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=l.subtreeQuery||(m?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:u,query:y}),ve(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function c(){he()>0?be(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",c):c(),C}function z(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const u=i.indexOf(":"),r=u>-1?i.slice(0,u):i,a=u>-1?i.slice(u+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function Ae(e){if(!e)return null;const t=D();return e in t?t[e]:null}function _e(e,t){if(!e)return;const n=D();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("&");z(location.hash)!==l&&(location.hash=l)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=Ae,window.lnCore.hashSet=_e,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function Te(e,t,n,o){const l=o,s=window.innerWidth,i=window.innerHeight,u=t.width,r=t.height,a=n.split("-"),f=a[0],d=a[1]==="start"||a[1]==="end"?a[1]:"center",p={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=p[f]||p.bottom;function v(c){return c==="top"||c==="bottom"?d==="start"?e.left:d==="end"?e.right-u:e.left+(e.width-u)/2:d==="start"?e.top:d==="end"?e.bottom-r:e.top+(e.height-r)/2}function C(c){let b,h,w=!0;return c==="top"?(b=e.top-l-r,h=v(c),b<0&&(w=!1)):c==="bottom"?(b=e.bottom+l,h=v(c),b+r>i&&(w=!1)):c==="left"?(b=v(c),h=e.left-l-u,h<0&&(w=!1)):(b=v(c),h=e.right+l,h+u>s&&(w=!1)),{top:b,left:h,side:c,fits:w}}let g=null;for(let c=0;c<A.length;c++){const b=C(A[c]);if(b.fits){g=b;break}}g||(g=C(A[0]));let m=g.top,y=g.left;return u>=s?y=0:(y<0&&(y=0),y+u>s&&(y=s-u)),r>=i?m=0:(m<0&&(m=0),m+r>i&&(m=i-r)),{top:m,left:y,placement:g.side}}function Ie(){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=Ie),(function(){const e="data-ln-tooltip-enhance",t="data-ln-tooltip",n="data-ln-tooltip-position",o="lnTooltipEnhance",l="ln-tooltip-portal";if(window[o]!==void 0)return;const s={"data-ln-tooltip-enhance":{type:"marker",description:"Activates enhanced tooltip behavior on element or container"},"data-ln-tooltip-enhanced":{type:"marker",description:"Runtime marker applied to enhanced tooltip trigger"},"data-ln-tooltip":{type:"string",description:"Tooltip text content to display"},"data-ln-tooltip-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"top",description:"Preferred positioning anchor"},"data-ln-tooltip-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}};let i=0,u=null,r=null,a=null,f=null,d=null,p=null;function A(){return u&&u.parentNode||(u=document.getElementById(l),u||(u=document.createElement("div"),u.id=l,document.body.appendChild(u)),u.hasAttribute("popover")||u.setAttribute("popover","manual")),u}function v(){p||(p=function(c){c.key==="Escape"&&m()},document.addEventListener("keydown",p))}function C(){p&&(document.removeEventListener("keydown",p),p=null)}function g(c){if(a===c)return;m();const b=c.getAttribute(t)||c.getAttribute("title");if(!b)return;A(),typeof u.showPopover=="function"&&u.showPopover(),c.hasAttribute("title")&&(f=c.getAttribute("title"),c.removeAttribute("title"));const h=c.getAttribute("aria-describedby");h?d=h:d=null;const w=document.createElement("div");w.className="ln-tooltip",w.textContent=b,c[o+"Uid"]||(i+=1,c[o+"Uid"]="ln-tooltip-"+i),w.id=c[o+"Uid"],u.appendChild(w);const F=w.offsetWidth,_=w.offsetHeight,x=c.getBoundingClientRect(),k=c.getAttribute(n)||"top",N=Te(x,{width:F,height:_},k,6);w.style.top=N.top+"px",w.style.left=N.left+"px",w.setAttribute("data-ln-tooltip-placement",N.placement),d?c.setAttribute("aria-describedby",d+" "+w.id):c.setAttribute("aria-describedby",w.id),r=w,a=c,v()}function m(){if(!r){C();return}a&&(d!==null?a.setAttribute("aria-describedby",d):a.removeAttribute("aria-describedby"),d=null,f!==null&&a.setAttribute("title",f)),f=null,r.parentNode&&r.parentNode.removeChild(r),r=null,a=null,u&&typeof u.hidePopover=="function"&&u.matches(":popover-open")&&u.hidePopover(),C()}function y(c){return this.dom=c,c.hasAttribute("data-ln-tooltip-enhanced")||(c.setAttribute("data-ln-tooltip-enhanced",""),this._addedEnhancedAttr=!0),this._onEnter=function(){g(c)},this._onLeave=function(){a===c&&!c.contains(document.activeElement)&&m()},this._onFocus=function(){g(c)},this._onBlur=function(){a===c&&!c.matches(":hover")&&m()},c.addEventListener("mouseenter",this._onEnter),c.addEventListener("mouseleave",this._onLeave),c.addEventListener("focus",this._onFocus,!0),c.addEventListener("blur",this._onBlur,!0),this}y.prototype.destroy=function(){const c=this.dom;c.removeEventListener("mouseenter",this._onEnter),c.removeEventListener("mouseleave",this._onLeave),c.removeEventListener("focus",this._onFocus,!0),c.removeEventListener("blur",this._onBlur,!0),a===c&&m(),this._addedEnhancedAttr&&c.removeAttribute("data-ln-tooltip-enhanced"),delete c[o],delete c[o+"Uid"]},X("["+e+"], [data-ln-tooltip-enhanced], ["+t+"][title]",o,y,"ln-tooltip",{attributes:s})})()})();
|
|
1
|
+
(function(){"use strict";function B(){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 L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!L(r))return}e.apply(console,t)}}function te(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},c=e.elements,l={};if(i)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")i&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&o[n.name].push(n.options[a].value)}else if(i&&n.type==="hidden")o[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const a=Number(n.value);o[n.name]=n.value===""||isNaN(a)?null:a}else o[n.name]=n.value}return o}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const i=e.elements,r=[],o={};for(let c=0;c<i.length;c++){const l=i[c];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<i.length;c++){const l=i[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const a=String(n).split(",").map(function(f){return f.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=re(n);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;r.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ne);const M={};function le(e,t){M[e]=t}function se(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){te(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function ae(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];j[i]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const O={};function de(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=O[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),p=f[1].trim();t[p]!=null&&s.setAttribute(d,t[p])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),p=f[1].trim();p in t&&s.classList.toggle(d,!!t[p])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function W(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const c=i.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const r=function(c,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let c=0;c<o.length;c++){const l=o[c],s=l.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function we(e,t,i,r,o,c){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],f=a.getAttribute("data-ln-render-key");f&&(l[f]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],f=String(r(a));let d=l[f];if(d)o(d,a,n);else{const p=de(i,c);if(!p||(W(p,a),d=p.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),o(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=R,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function T(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function U(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function P(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const D=new Map;function V(e,t){const i=(e?e.join("|"):"")+"::"+t;if(D.has(i))return D.get(i);const r=new Set(e||[]),o=function(c,l){const s=c.getAttribute(l);return s!==null&&r.has(s)?s:t};return D.set(i,o),o}function Q(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function J(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function K(e,t,i,r,o){if(!e||t===null)return!0;const c=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,i){for(const r in i){const[o,c,l]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,c,l)},enumerable:!0,configurable:!0})}return e}function he(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=V(r.values,r.fallback);break;case"integer":o=U;break;case"float":o=Q;break;case"boolean":o=P;break;case"list":o=H;break;case"json":o=J;break;case"string":default:o=T;break}o||(o=T),t[r.prop]=[o,i,r.fallback]}return t}function be(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pe,window.lnCore.attrSpec=he,window.lnCore.attrStr=T,window.lnCore.attrInt=U,window.lnCore.attrBool=P,window.lnCore.attrList=H,window.lnCore.attrEnum=V,window.lnCore.attrFloat=Q,window.lnCore.attrJson=J);function _(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function G(e,t,i,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(c)&&_(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)_(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=X(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(c=>c.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=me(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function z(e,t,i,r){for(let o=0;o<e.length;o++){const c=e[o];if(!t[c.attribute])continue;const l=c.effects&&c.effects[i];l?l(t,i,r):c.onAttrChange&&(!c.declared||c.declared.has(i))&&c.onAttrChange(t,i,r)}}function ve(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=X(),o=r.byAttr.get(t),c=B()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!o&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&L(l)){const s=r.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<s.length;a++)K(s[a].spec,n,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(i||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&z(s,l,t,e.oldValue),r.reactiveWildcard.length&&z(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const n=o[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(G(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{ve(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function _e(e){const t=I();if(!t.length)return;const i=e.target;if(i){const r=i.nodeType===1?i:i.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const o=t[r];if(o.onSubtreeChange&&o.query){const c=o.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&o.onSubtreeChange(l,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)o.matches&&o.matches(s.query)&&_(o,s);else if(o.matches&&o.matches(s.query)&&_(o,s),o.querySelectorAll){const n=o.querySelectorAll(s.query);for(let a=0;a<n.length;a++)_(n[a],s)}}s.onInit&&s.onInit(o)}}}for(let r=0;r<e.removedNodes.length;r++){const o=e.removedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!c)o.matches&&o.matches(n)&&F(o,s);else if(o.matches&&o.matches(n)&&F(o,s),o.querySelectorAll){const a=o.querySelectorAll(n);for(let f=0;f<a.length;f++)F(a[f],s)}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{_e(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){I().push(e),Y()}function Z(e,t,i,r,o={}){const c=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,n=o.onInit||null,a=o.onAttrChange||null,f=o.effects||null,d=o.attributes||null,p=d?be(d):f,A=d?new Set(Object.keys(d)):null,v=o.persist||null;function C(b){const h=b||document.body;if(G(h,e,t,i),d&&B())for(const w in d){const q=d[w],x=Array.from(h.querySelectorAll("["+w+"]"));h.matches&&h.matches("["+w+"]")&&x.push(h);for(let k=0;k<x.length;k++){const E=x[k];L(E)&&K(q,E.getAttribute(w),w,r,E)}}n&&n(h)}const g=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let h;for(;(h=b.exec(e))!==null;)g.push(h[1])}else g.push(e);Ce({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:i,onInit:n,observed:g.concat(c),onAttributeChange:l,onAttrChange:a,effects:p,declared:A,persist:v}),Ae();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=o.subtreeQuery||(m?e:"["+e+"]");I().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:y}),Y(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=xe);function u(){ge()>0?ye(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),C}function ee(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,i={},r=ee(t);if(!r)return i;const o=r.split("&");for(let c=0;c<o.length;c++){const l=o[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(a)}catch{i[n]=a}}return i}function ke(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const i=N();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(c){const l=i[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");ee(location.hash)!==o&&(location.hash=o)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function De(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 i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Fe(e,t,i,r){const o=r,c=window.innerWidth,l=window.innerHeight,s=t.width,n=t.height,a=i.split("-"),f=a[0],d=a[1]==="start"||a[1]==="end"?a[1]:"center",p={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=p[f]||p.bottom;function v(u){return u==="top"||u==="bottom"?d==="start"?e.left:d==="end"?e.right-s:e.left+(e.width-s)/2:d==="start"?e.top:d==="end"?e.bottom-n:e.top+(e.height-n)/2}function C(u){let b,h,w=!0;return u==="top"?(b=e.top-o-n,h=v(u),b<0&&(w=!1)):u==="bottom"?(b=e.bottom+o,h=v(u),b+n>l&&(w=!1)):u==="left"?(b=v(u),h=e.left-o-s,h<0&&(w=!1)):(b=v(u),h=e.right+o,h+s>c&&(w=!1)),{top:b,left:h,side:u,fits:w}}let g=null;for(let u=0;u<A.length;u++){const b=C(A[u]);if(b.fits){g=b;break}}g||(g=C(A[0]));let m=g.top,y=g.left;return s>=c?y=0:(y<0&&(y=0),y+s>c&&(y=c-s)),n>=l?m=0:(m<0&&(m=0),m+n>l&&(m=l-n)),{top:m,left:y,placement:g.side}}function Ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ne),(function(){const e="data-ln-tooltip-enhance",t="data-ln-tooltip",i="data-ln-tooltip-position",r="lnTooltipEnhance",o="ln-tooltip-portal";if(window[r]!==void 0)return;const c={"data-ln-tooltip-enhance":{type:"marker",description:"Activates enhanced tooltip behavior on element or container"},"data-ln-tooltip-enhanced":{type:"marker",description:"Runtime marker applied to enhanced tooltip trigger"},"data-ln-tooltip":{type:"string",description:"Tooltip text content to display"},"data-ln-tooltip-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"top",description:"Preferred positioning anchor"},"data-ln-tooltip-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}};let l=0,s=null,n=null,a=null,f=null,d=null,p=null;function A(){return s&&s.parentNode||(s=document.getElementById(o),s||(s=document.createElement("div"),s.id=o,document.body.appendChild(s)),s.hasAttribute("popover")||s.setAttribute("popover","manual")),s}function v(){p||(p=function(u){u.key==="Escape"&&m()},document.addEventListener("keydown",p))}function C(){p&&(document.removeEventListener("keydown",p),p=null)}function g(u){if(a===u)return;m();const b=u.getAttribute(t)||u.getAttribute("title");if(!b)return;A(),typeof s.showPopover=="function"&&s.showPopover(),u.hasAttribute("title")&&(f=u.getAttribute("title"),u.removeAttribute("title"));const h=u.getAttribute("aria-describedby");h?d=h:d=null;const w=document.createElement("div");w.className="ln-tooltip",w.textContent=b,u[r+"Uid"]||(l+=1,u[r+"Uid"]="ln-tooltip-"+l),w.id=u[r+"Uid"],s.appendChild(w);const q=w.offsetWidth,x=w.offsetHeight,k=u.getBoundingClientRect(),E=u.getAttribute(i)||"top",$=Fe(k,{width:q,height:x},E,6);w.style.top=$.top+"px",w.style.left=$.left+"px",w.setAttribute("data-ln-tooltip-placement",$.placement),d?u.setAttribute("aria-describedby",d+" "+w.id):u.setAttribute("aria-describedby",w.id),n=w,a=u,v()}function m(){if(!n){C();return}a&&(d!==null?a.setAttribute("aria-describedby",d):a.removeAttribute("aria-describedby"),d=null,f!==null&&a.setAttribute("title",f)),f=null,n.parentNode&&n.parentNode.removeChild(n),n=null,a=null,s&&typeof s.hidePopover=="function"&&s.matches(":popover-open")&&s.hidePopover(),C()}function y(u){return this.dom=u,u.hasAttribute("data-ln-tooltip-enhanced")||(u.setAttribute("data-ln-tooltip-enhanced",""),this._addedEnhancedAttr=!0),this._onEnter=function(){g(u)},this._onLeave=function(){a===u&&!u.contains(document.activeElement)&&m()},this._onFocus=function(){g(u)},this._onBlur=function(){a===u&&!u.matches(":hover")&&m()},u.addEventListener("mouseenter",this._onEnter),u.addEventListener("mouseleave",this._onLeave),u.addEventListener("focus",this._onFocus,!0),u.addEventListener("blur",this._onBlur,!0),this}y.prototype.destroy=function(){const u=this.dom;u.removeEventListener("mouseenter",this._onEnter),u.removeEventListener("mouseleave",this._onLeave),u.removeEventListener("focus",this._onFocus,!0),u.removeEventListener("blur",this._onBlur,!0),a===u&&m(),this._addedEnhancedAttr&&u.removeAttribute("data-ln-tooltip-enhanced"),delete u[r],delete u[r+"Uid"]},Z("["+e+"], [data-ln-tooltip-enhanced], ["+t+"][title]",r,y,"ln-tooltip",{attributes:c})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function x(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function T(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}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 ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,n={};if(o)for(let s=0;s<a.length;s++){const r=a[s];r.name&&r.type==="checkbox"&&!r.disabled&&(n[r.name]=(n[r.name]||0)+1)}for(let s=0;s<a.length;s++){const r=a[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")o&&n[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&l[r.name].push(r.options[c].value)}else if(o&&r.type==="hidden")l[r.name]=r.value;else if(o&&(r.type==="number"||r.type==="range")){const c=Number(r.value);l[r.name]=r.value===""||isNaN(c)?null:c}else l[r.name]=r.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const o=e.elements,i=[],l={};for(let a=0;a<o.length;a++){const n=o[a];n.name&&n.type==="checkbox"&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<o.length;a++){const n=o[a];if(n.type==="file"||n.type==="submit"||n.type==="button")continue;const s=n.getAttribute("data-ln-fill-as")||n.name;if(!s||!(s in t))continue;const r=t[s];if(n.type==="checkbox"){if(Array.isArray(r))n.checked=r.indexOf(n.value)!==-1;else if(l[n.name]>1){const c=String(r).split(",").map(function(u){return u.trim()});n.checked=c.indexOf(n.value)!==-1}else n.checked=ne(r);i.push(n)}else if(n.type==="radio")n.checked=n.value===String(r),i.push(n);else if(n.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<n.options.length;c++)n.options[c].selected=r.indexOf(n.options[c].value)!==-1;i.push(n)}else n.value=r,n.tagName==="SELECT"&&r!=null&&n.setAttribute("data-ln-value",r),i.push(n)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const I={};function re(e,t){I[e]=t}function ie(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function ae(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];$[o]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=le);const _={};function S(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=_[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let n=0;n<o.length;n++){const s=o[n],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<i.length;n++){const s=i[n],r=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let n=0;n<l.length;n++){const s=l[n],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],r=s.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function B(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,n){return t[n]!==void 0?t[n]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const n=l[a],s=n.attributes;for(let r=0;r<s.length;r++){const c=s[r];c.value.indexOf("{{")!==-1&&n.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function de(e,t,o,i,l,a){const n={};for(let r=0;r<e.children.length;r++){const c=e.children[r],u=c.getAttribute("data-ln-render-key");u&&(n[u]=c)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],u=String(i(c));let d=n[u];if(d)l(d,c,r);else{const f=S(o,a);if(!f||(B(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,r)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=F,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function h(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function M(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function j(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const L=new Map;function U(e,t){const o=(e?e.join("|"):"")+"::"+t;if(L.has(o))return L.get(o);const i=new Set(e||[]),l=function(a,n){const s=a.getAttribute(n);return s!==null&&i.has(s)?s:t};return L.set(o,l),l}function V(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function P(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function H(e,t,o,i,l){if(!e||t===null)return!0;const a=i||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=r=>{l?console.warn(r,l):console.warn(r)};if(n==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${a}] Value ${r} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${a}] Value ${r} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${a}] Invalid JSON for attribute "${o}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function K(e,t,o){for(const i in o){const[l,a,n]=o[i];Object.defineProperty(e,i,{get:function(){return l(t,a,n)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=U(i.values,i.fallback);break;case"integer":l=M;break;case"float":l=V;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=P;break;case"string":default:l=h;break}l||(l=h),t[i.prop]=[l,o,i.fallback]}return t}function ue(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function fe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=K,window.lnCore.attrSpec=J,window.lnCore.attrStr=h,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=P);function k(e,t,o,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&n.push(e);for(const s of n)if(!s[o]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[o]=new i(s)}catch(r){console.error("["+o+"] init failed",s,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=Q(),o=e.observed||[];for(let i=0;i<o.length;i++){const l=o[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=fe(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,o,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const n=a.effects&&a.effects[o];n?n(t,o,i):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,i)}}function he(e){const t=e.target,o=e.attributeName;if(e.oldValue===t.getAttribute(o))return;const i=Q(),l=i.byAttr.get(o);if(R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(o)&&A(t)){const a=i.byDeclaredAttr.get(o),n=t.getAttribute(o);for(let s=0;s<a.length;s++)H(a[s].spec,n,o,a[s].componentTag,t)}if(window.lnCore._debugSink&&(o.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",o,t,{oldValue:e.oldValue,newValue:t.getAttribute(o)}),o.indexOf("data-ln-")===0){const a=i.byReactive.get(o);a&&z(a,t,o,e.oldValue),i.reactiveWildcard.length&&z(i.reactiveWildcard,t,o,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const n=l[a];if(n.handler){n.handler(t,o,e.oldValue);continue}n.onAttributeChange&&t[n.attribute]?n.onAttributeChange(t,o):(k(t,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{he(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=G();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const i=t[o];if(i.onSubtreeChange){const l=i.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&&i.onSubtreeChange(a,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];k(i,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(i)}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],n=a.query,s=Array.from(i.querySelectorAll(n));i.matches&&i.matches(n)&&s.push(i);for(let r=0;r<s.length;r++){const c=s[r];if(!document.contains(c)){const u=c[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",c,d)}delete c[a.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{me(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,o,i,l={}){const a=l.extraAttributes||[],n=l.onAttributeChange||null,s=l.onSubtreeChange||null,r=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?ue(d):u,g=d?new Set(Object.keys(d)):null,m=l.persist||null;function p(q){const w=q||document.body;if(k(w,e,t,o),d&&R())for(const y in d){const Oe=d[y],O=Array.from(w.querySelectorAll("["+y+"]"));w.matches&&w.matches("["+y+"]")&&O.push(w);for(let D=0;D<O.length;D++){const N=O[D];A(N)&&H(Oe,N.getAttribute(y),y,i,N)}}r&&r(w)}const b=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let w;for(;(w=q.exec(e))!==null;)b.push(w[1])}else b.push(e);we({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:o,onInit:r,observed:b.concat(a),onAttributeChange:n,onAttrChange:c,effects:f,declared:g,persist:m}),be();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=l.subtreeQuery||(v?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:o,onInit:r,onSubtreeChange:s,query:qe}),ye(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function Z(){pe()>0?ge(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),p}function Y(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,o={},i=Y(t);if(!i)return o;const l=i.split("&");for(let a=0;a<l.length;a++){const n=l[a];if(!n)continue;const s=n.indexOf(":"),r=s>-1?n.slice(0,s):n,c=s>-1?n.slice(s+1):"";if(r)try{o[r]=decodeURIComponent(c)}catch{o[r]=c}}return o}function Ce(e){if(!e)return null;const t=E();return e in t?t[e]:null}function ve(e,t){if(!e)return;const o=E();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(a){const n=o[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Ae(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function _e(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 Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=_e,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=ke);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(){const e="data-ln-translations",t="lnTranslations";if(window[t]!==void 0)return;const o={"data-ln-translations":{type:"marker",description:"Mounts multi-language translation manager on form container"},"data-ln-translations-default":{prop:"defaultLang",read:h,type:"string",fallback:"",description:"Default primary language code (e.g. en)"},"data-ln-translations-placeholder":{prop:"placeholderLabel",read:h,type:"string",fallback:"{lang} translation",description:"Placeholder label pattern for cloned translation inputs"},"data-ln-translations-remove-label":{prop:"removeLabel",read:h,type:"string",fallback:"Remove {lang}",description:"Accessible label template for translation removal buttons"},"data-ln-translations-locales":{prop:"_localesRaw",read:h,type:"json",fallback:"",description:"JSON dictionary of supported locale codes and display labels"},"data-ln-translations-active":{type:"marker",description:"Container holding active language badge tags"},"data-ln-translations-add":{type:"string",description:"Trigger button action to add specified language translation fields"},"data-ln-translations-lang":{type:"string",description:"Language code associated with active language badge"},"data-ln-translations-prefix":{type:"string",description:"Prefix format pattern for cloned translated field names"},"data-ln-translatable":{type:"marker",description:"Marks form control as translatable into multiple languages"},"data-ln-translatable-lang":{type:"string",description:"Language code assigned to specific translatable input instance"}},i=J(o),l={en:"English",sq:"Shqip",sr:"Srpski"};function a(n){if(this.dom=n,K(this,n,i),this.activeLanguages=new Set,this.badgesEl=n.querySelector("[data-ln-translations-active]"),this.menuEl=n.querySelector("[data-ln-dropdown] > [data-ln-toggle]"),this.locales=l,this._localesRaw)try{this.locales=JSON.parse(this._localesRaw)}catch{console.warn("[ln-translations] Invalid JSON in data-ln-translations-locales")}this._applyDefaultLang(),this._updateDropdown();const s=this;return this._onRequestAdd=function(r){r.detail&&r.detail.lang&&s.addLanguage(r.detail.lang)},this._onRequestRemove=function(r){r.detail&&r.detail.lang&&s.removeLanguage(r.detail.lang)},n.addEventListener("ln-translations:request-add",this._onRequestAdd),n.addEventListener("ln-translations:request-remove",this._onRequestRemove),this._detectExisting(),this}a.prototype._applyDefaultLang=function(){if(!this.defaultLang)return;const n=this.dom.querySelectorAll("[data-ln-translatable]");for(const s of n){const r=s.querySelectorAll("input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");for(const c of r)c.setAttribute("data-ln-translatable-lang",this.defaultLang)}},a.prototype._detectExisting=function(){const n=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const s of n){const r=s.getAttribute("data-ln-translatable-lang");r&&r!==this.defaultLang&&this.activeLanguages.add(r)}this.activeLanguages.size>0&&(this._updateBadges(),this._updateDropdown())},a.prototype._updateDropdown=function(){if(!this.menuEl)return;this.menuEl.textContent="";const n=this;let s=0;for(const c in this.locales){if(!this.locales.hasOwnProperty(c)||this.activeLanguages.has(c))continue;s++;const u=S("ln-translations-menu-item","ln-translations");if(!u)return;const d=u.querySelector("[data-ln-translations-lang]");d.setAttribute("data-ln-translations-lang",c),d.textContent=this.locales[c],d.addEventListener("click",function(f){f.ctrlKey||f.metaKey||f.button===1||(f.preventDefault(),f.stopPropagation(),n.menuEl.getAttribute("data-ln-toggle")==="open"&&n.menuEl.setAttribute("data-ln-toggle","close"),n.addLanguage(c))}),this.menuEl.appendChild(u)}const r=this.dom.querySelector("[data-ln-translations-add]");r&&(r.hidden=s===0)},a.prototype._updateBadges=function(){if(!this.badgesEl)return;this.badgesEl.textContent="";const n=this;this.activeLanguages.forEach(function(s){const r=S("ln-translations-badge","ln-translations");if(!r)return;const c=r.querySelector("[data-ln-translations-lang]");c.setAttribute("data-ln-translations-lang",s);const u=c.querySelector("span");u.textContent=n.locales[s]||s.toUpperCase();const d=c.querySelector("button"),f=n.locales[s]||s.toUpperCase();d.setAttribute("aria-label",n.removeLabel.replace("{lang}",f)),d.addEventListener("click",function(g){g.ctrlKey||g.metaKey||g.button===1||(g.preventDefault(),g.stopPropagation(),n.removeLanguage(s))}),n.badgesEl.appendChild(r)})},a.prototype.addLanguage=function(n,s){if(this.activeLanguages.has(n))return;const r=this.locales[n]||n;if(T(this.dom,"ln-translations:before-add",{target:this.dom,lang:n,langName:r}).defaultPrevented)return;this.activeLanguages.add(n),s=s||{};const u=this.dom.querySelectorAll("[data-ln-translatable]");for(const d of u){const f=d.getAttribute("data-ln-translatable"),g=d.getAttribute("data-ln-translations-prefix")||"",m=d.querySelector(this.defaultLang?'[data-ln-translatable-lang="'+this.defaultLang+'"]':"input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");if(!m)continue;const p=m.cloneNode(m.tagName==="SELECT");g?p.name=g+"[trans]["+n+"]["+f+"]":p.name="trans["+n+"]["+f+"]",p.value=s[f]!==void 0?s[f]:"",p.removeAttribute("id"),"placeholder"in p&&(p.placeholder=this.placeholderLabel.replace("{lang}",r)),p.setAttribute("data-ln-translatable-lang",n);const b=d.querySelectorAll('[data-ln-translatable-lang]:not([data-ln-translatable-lang="'+this.defaultLang+'"])'),v=b.length>0?b[b.length-1]:m;v.parentNode.insertBefore(p,v.nextSibling)}this._updateDropdown(),this._updateBadges(),x(this.dom,"ln-translations:added",{target:this.dom,lang:n,langName:r})},a.prototype.removeLanguage=function(n){if(!this.activeLanguages.has(n)||T(this.dom,"ln-translations:before-remove",{target:this.dom,lang:n}).defaultPrevented)return;const r=this.dom.querySelectorAll('[data-ln-translatable-lang="'+n+'"]');for(const c of r)c.parentNode.removeChild(c);this.activeLanguages.delete(n),this._updateDropdown(),this._updateBadges(),x(this.dom,"ln-translations:removed",{target:this.dom,lang:n})},a.prototype.getActiveLanguages=function(){return new Set(this.activeLanguages)},a.prototype.hasLanguage=function(n){return this.activeLanguages.has(n)},a.prototype.destroy=function(){if(!this.dom[t])return;const n=this.defaultLang,s=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const r of s)r.getAttribute("data-ln-translatable-lang")!==n&&r.parentNode.removeChild(r);this.dom.removeEventListener("ln-translations:request-add",this._onRequestAdd),this.dom.removeEventListener("ln-translations:request-remove",this._onRequestRemove),delete this.dom[t]},X(e,t,a,"ln-translations",{attributes:o})})()})();
|
|
1
|
+
(function(){"use strict";function I(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){l=t[r];break}if(!x(l))return}e.apply(console,t)}}function _(e,t,i){const l=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function F(e,t,i){const l=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(r),r}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const i=!!(t&&t.typed),l=t&&t.exclude,r={},s=e.elements,o={};if(i)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[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")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")i&&o[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&r[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")r[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);r[n.name]=n.value===""||isNaN(c)?null:c}else r[n.name]=n.value}return r}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const i=e.elements,l=[],r={};for(let s=0;s<i.length;s++){const o=i[s];o.name&&o.type==="checkbox"&&(r[o.name]=(r[o.name]||0)+1)}for(let s=0;s<i.length;s++){const o=i[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 n=t[a];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(r[o.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=ie(n);l.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),l.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;l.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),l.push(o)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=oe);const $={};function ae(e,t){$[e]=t}function se(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){_(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function de(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];B[i]=t}function ue(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=de,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const S={};function L(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=S[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let o=0;o<i.length;o++){const a=i[o],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<l.length;o++){const a=l[o],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(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let o=0;o<r.length;o++){const a=r[o],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const a=s[o],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(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<i.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[l],t??null),i[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function j(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const s=i.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,a){return t[a]!==void 0?t[a]:""}))}const l=function(s,o){return t[o]!==void 0?t[o]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const o=r[s],a=o.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function ge(e,t,i,l,r,s){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(l(c));let d=o[u];if(d)r(d,c,n);else{const f=L(i,s);if(!f||(j(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=fe,window.lnCore.renderList=ge);function w(e,t,i){const l=e.getAttribute(t);return l===null?i:l}function W(e,t,i){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?i:l}function U(e,t,i=!1){const l=e.getAttribute(t);if(l===null)return!!i;const r=l.trim().toLowerCase();return!(r==="false"||r==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const k=new Map;function P(e,t){const i=(e?e.join("|"):"")+"::"+t;if(k.has(i))return k.get(i);const l=new Set(e||[]),r=function(s,o){const a=s.getAttribute(o);return a!==null&&l.has(a)?a:t};return k.set(i,r),r}function H(e,t,i){const l=parseFloat(e.getAttribute(t));return isNaN(l)?i:l}function K(e,t,i){const l=e.getAttribute(t);if(!l)return i;try{return JSON.parse(l)}catch{return i}}function J(e,t,i,l,r){if(!e||t===null)return!0;const s=l||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const a=n=>{r?console.warn(n,r):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,i){for(const l in i){const[r,s,o]=i[l];Object.defineProperty(e,l,{get:function(){return r(t,s,o)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const i in e){const l=e[i];if(!l||!l.prop)continue;let r=l.read;if(!r&&l.type)switch(l.type){case"enum":r=P(l.values,l.fallback);break;case"integer":r=W;break;case"float":r=H;break;case"boolean":r=U;break;case"list":r=V;break;case"json":r=K;break;case"string":default:r=w;break}r||(r=w),t[l.prop]=[r,i,l.fallback]}return t}function he(e){const t={};for(const i in e){const l=e[i];l&&l.effect&&(t[i]=l.effect)}return Object.keys(t).length?t:null}function pe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=z,window.lnCore.attrStr=w,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=P,window.lnCore.attrFloat=H,window.lnCore.attrJson=K);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function G(e,t,i,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:i,ComponentFn:l};if(e.matches&&e.matches(s)&&y(e,o),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)y(a[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function me(e){const t=X(),i=e.observed||[];for(let l=0;l<i.length;l++){const r=i[l];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const r=t.byDeclaredAttr.get(l);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=pe(e);if(l===null)t.reactiveWildcard.push(e);else for(const r of l)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,i,l){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const o=s.effects&&s.effects[i];o?o(t,i,l):s.onAttrChange&&(!s.declared||s.declared.has(i))&&s.onAttrChange(t,i,l)}}function ye(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,l=X(),r=l.byAttr.get(t),s=I()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!i&&!r&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&x(o)){const a=l.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<a.length;c++)J(a[c].spec,n,t,a[c].componentTag,o)}if(window.lnCore._debugSink&&(i||r)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),i){const a=l.byReactive.get(t);a&&Y(a,o,t,e.oldValue),l.reactiveWildcard.length&&Y(l.reactiveWildcard,o,t,e.oldValue)}if(r)for(let a=0;a<r.length;a++){const n=r[a];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(G(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{ye(t[i])}catch(l){console.error("[ln-core] mutation handler failed",t[i].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function E(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function q(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ve(e){const t=E();if(!t.length)return;const i=e.target;if(i){const l=i.nodeType===1?i:i.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let l=0;l<t.length;l++){const r=t[l];if(r.onSubtreeChange&&r.query){const s=r.query,o=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;o&&r.onSubtreeChange(o,e)}}for(let l=0;l<e.addedNodes.length;l++){const r=e.addedNodes[l];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const a=t[o];if(a.selector&&a.attribute&&a.ComponentFn){if(!s)r.matches&&r.matches(a.query)&&y(r,a);else if(r.matches&&r.matches(a.query)&&y(r,a),r.querySelectorAll){const n=r.querySelectorAll(a.query);for(let c=0;c<n.length;c++)y(n[c],a)}}a.onInit&&a.onInit(r)}}}for(let l=0;l<e.removedNodes.length;l++){const r=e.removedNodes[l];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const a=t[o],n=a.query;if(n){if(!s)r.matches&&r.matches(n)&&q(r,a);else if(r.matches&&r.matches(n)&&q(r,a),r.querySelectorAll){const c=r.querySelectorAll(n);for(let u=0;u<c.length;u++)q(c[u],a)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const l=t[i];if(l.type==="childList")try{ve(l)}catch(r){console.error("[ln-core] lifecycle handler failed",l.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){E().push(e),Z()}function ee(e,t,i,l,r={}){const s=r.extraAttributes||[],o=r.onAttributeChange||null,a=r.onSubtreeChange||null,n=r.onInit||null,c=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?he(d):u,h=d?new Set(Object.keys(d)):null,m=r.persist||null;function g(D){const p=D||document.body;if(G(p,e,t,i),d&&I())for(const C in d){const Re=d[C],N=Array.from(p.querySelectorAll("["+C+"]"));p.matches&&p.matches("["+C+"]")&&N.push(p);for(let R=0;R<N.length;R++){const T=N[R];x(T)&&J(Re,T.getAttribute(C),C,l,T)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let p;for(;(p=D.exec(e))!==null;)b.push(p[1])}else b.push(e);me({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:i,onInit:n,observed:b.concat(s),onAttributeChange:o,onAttrChange:c,effects:f,declared:h,persist:m}),Ce();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=r.subtreeQuery||(A?e:"["+e+"]");E().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:a,query:Ne}),Z(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=Ae);function ne(){we()>0?be(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),g}function te(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,i={},l=te(t);if(!l)return i;const r=l.split("&");for(let s=0;s<r.length;s++){const o=r[s];if(!o)continue;const a=o.indexOf(":"),n=a>-1?o.slice(0,a):o,c=a>-1?o.slice(a+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function xe(e){if(!e)return null;const t=O();return e in t?t[e]:null}function _e(e,t){if(!e)return;const i=O();t==null?delete i[e]:i[e]=String(t);const r=Object.keys(i).map(function(s){const o=i[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");te(location.hash)!==r&&(location.hash=r)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),l=e.slice(t+1),r=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:i,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=xe,window.lnCore.hashSet=_e,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Oe);function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=De),(function(){const e="data-ln-translations",t="lnTranslations";if(window[t]!==void 0)return;const i={"data-ln-translations":{type:"marker",description:"Mounts multi-language translation manager on form container"},"data-ln-translations-default":{prop:"defaultLang",read:w,type:"string",fallback:"",description:"Default primary language code (e.g. en)"},"data-ln-translations-placeholder":{prop:"placeholderLabel",read:w,type:"string",fallback:"{lang} translation",description:"Placeholder label pattern for cloned translation inputs"},"data-ln-translations-remove-label":{prop:"removeLabel",read:w,type:"string",fallback:"Remove {lang}",description:"Accessible label template for translation removal buttons"},"data-ln-translations-locales":{prop:"_localesRaw",read:w,type:"json",fallback:"",description:"JSON dictionary of supported locale codes and display labels"},"data-ln-translations-active":{type:"marker",description:"Container holding active language badge tags"},"data-ln-translations-add":{type:"string",description:"Trigger button action to add specified language translation fields"},"data-ln-translations-lang":{type:"string",description:"Language code associated with active language badge"},"data-ln-translations-prefix":{type:"string",description:"Prefix format pattern for cloned translated field names"},"data-ln-translatable":{type:"marker",description:"Marks form control as translatable into multiple languages"},"data-ln-translatable-lang":{type:"string",description:"Language code assigned to specific translatable input instance"}},l=z(i),r={en:"English",sq:"Shqip",sr:"Srpski"};function s(o){if(this.dom=o,Q(this,o,l),this.activeLanguages=new Set,this.badgesEl=o.querySelector("[data-ln-translations-active]"),this.menuEl=o.querySelector("[data-ln-dropdown] > [data-ln-toggle]"),this.locales=r,this._localesRaw)try{this.locales=JSON.parse(this._localesRaw)}catch{console.warn("[ln-translations] Invalid JSON in data-ln-translations-locales")}this._applyDefaultLang(),this._updateDropdown();const a=this;return this._onRequestAdd=function(n){n.detail&&n.detail.lang&&a.addLanguage(n.detail.lang)},this._onRequestRemove=function(n){n.detail&&n.detail.lang&&a.removeLanguage(n.detail.lang)},o.addEventListener("ln-translations:request-add",this._onRequestAdd),o.addEventListener("ln-translations:request-remove",this._onRequestRemove),this._detectExisting(),this}s.prototype._applyDefaultLang=function(){if(!this.defaultLang)return;const o=this.dom.querySelectorAll("[data-ln-translatable]");for(const a of o){const n=a.querySelectorAll("input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");for(const c of n)c.setAttribute("data-ln-translatable-lang",this.defaultLang)}},s.prototype._detectExisting=function(){const o=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const a of o){const n=a.getAttribute("data-ln-translatable-lang");n&&n!==this.defaultLang&&this.activeLanguages.add(n)}this.activeLanguages.size>0&&(this._updateBadges(),this._updateDropdown())},s.prototype._updateDropdown=function(){if(!this.menuEl)return;this.menuEl.textContent="";const o=this;let a=0;for(const c in this.locales){if(!this.locales.hasOwnProperty(c)||this.activeLanguages.has(c))continue;a++;const u=L("ln-translations-menu-item","ln-translations");if(!u)return;const d=u.querySelector("[data-ln-translations-lang]");d.setAttribute("data-ln-translations-lang",c),d.textContent=this.locales[c],d.addEventListener("click",function(f){f.ctrlKey||f.metaKey||f.button===1||(f.preventDefault(),f.stopPropagation(),o.menuEl.getAttribute("data-ln-toggle")==="open"&&o.menuEl.setAttribute("data-ln-toggle","close"),o.addLanguage(c))}),this.menuEl.appendChild(u)}const n=this.dom.querySelector("[data-ln-translations-add]");n&&(n.hidden=a===0)},s.prototype._updateBadges=function(){if(!this.badgesEl)return;this.badgesEl.textContent="";const o=this;this.activeLanguages.forEach(function(a){const n=L("ln-translations-badge","ln-translations");if(!n)return;const c=n.querySelector("[data-ln-translations-lang]");c.setAttribute("data-ln-translations-lang",a);const u=c.querySelector("span");u.textContent=o.locales[a]||a.toUpperCase();const d=c.querySelector("button"),f=o.locales[a]||a.toUpperCase();d.setAttribute("aria-label",o.removeLabel.replace("{lang}",f)),d.addEventListener("click",function(h){h.ctrlKey||h.metaKey||h.button===1||(h.preventDefault(),h.stopPropagation(),o.removeLanguage(a))}),o.badgesEl.appendChild(n)})},s.prototype.addLanguage=function(o,a){if(this.activeLanguages.has(o))return;const n=this.locales[o]||o;if(F(this.dom,"ln-translations:before-add",{target:this.dom,lang:o,langName:n}).defaultPrevented)return;this.activeLanguages.add(o),a=a||{};const u=this.dom.querySelectorAll("[data-ln-translatable]");for(const d of u){const f=d.getAttribute("data-ln-translatable"),h=d.getAttribute("data-ln-translations-prefix")||"",m=d.querySelector(this.defaultLang?'[data-ln-translatable-lang="'+this.defaultLang+'"]':"input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");if(!m)continue;const g=m.cloneNode(m.tagName==="SELECT");h?g.name=h+"[trans]["+o+"]["+f+"]":g.name="trans["+o+"]["+f+"]",g.value=a[f]!==void 0?a[f]:"",g.removeAttribute("id"),"placeholder"in g&&(g.placeholder=this.placeholderLabel.replace("{lang}",n)),g.setAttribute("data-ln-translatable-lang",o);const b=d.querySelectorAll('[data-ln-translatable-lang]:not([data-ln-translatable-lang="'+this.defaultLang+'"])'),A=b.length>0?b[b.length-1]:m;A.parentNode.insertBefore(g,A.nextSibling)}this._updateDropdown(),this._updateBadges(),_(this.dom,"ln-translations:added",{target:this.dom,lang:o,langName:n})},s.prototype.removeLanguage=function(o){if(!this.activeLanguages.has(o)||F(this.dom,"ln-translations:before-remove",{target:this.dom,lang:o}).defaultPrevented)return;const n=this.dom.querySelectorAll('[data-ln-translatable-lang="'+o+'"]');for(const c of n)c.parentNode.removeChild(c);this.activeLanguages.delete(o),this._updateDropdown(),this._updateBadges(),_(this.dom,"ln-translations:removed",{target:this.dom,lang:o})},s.prototype.getActiveLanguages=function(){return new Set(this.activeLanguages)},s.prototype.hasLanguage=function(o){return this.activeLanguages.has(o)},s.prototype.destroy=function(){if(!this.dom[t])return;const o=this.defaultLang,a=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const n of a)n.getAttribute("data-ln-translatable-lang")!==o&&n.parentNode.removeChild(n);this.dom.removeEventListener("ln-translations:request-add",this._onRequestAdd),this.dom.removeEventListener("ln-translations:request-remove",this._onRequestRemove),delete this.dom[t]},ee(e,t,s,"ln-translations",{attributes:i})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 h(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 g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function P(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 Y(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(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=Y(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=Z,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=P);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,g(function(){new MutationObserver(function(){h(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=re,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 q(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)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 F(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||(F(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=F,window.lnCore.fill=q,window.lnCore.lnFill=le,window.lnCore.renderList=se);function x(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function T(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function N(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 v=new Map;function R(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.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 v.set(n,l),l}function j(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=R(r.values,r.fallback);break;case"integer":l=T;break;case"float":l=j;break;case"boolean":l=N;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 de(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 ue(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=T,window.lnCore.attrBool=N,window.lnCore.attrList=B,window.lnCore.attrEnum=R,window.lnCore.attrFloat=j,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=ue(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 V(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(M()&&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&&V(s,t,n,e.oldValue),r.reactiveWildcard.length&&V(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,g(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,g(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 Q(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?de(u):d,_e=u?new Set(Object.keys(u)):null,Se=l.persist||null;function C(O){const w=O||document.body;if(k(w,e,t,n),u&&M())for(const b in u){const Le=u[b],E=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&E.push(w);for(let L=0;L<E.length;L++){const I=E[L];y(I)&&U(Le,I.getAttribute(b),b,r,I)}}o&&o(w)}const S=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)S.push(w[1])}else S.push(e);he({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:S.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:_e,persist:Se}),be();const Oe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ee=l.subtreeQuery||(Oe?e:"["+e+"]");K().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Ee}),me(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function G(){fe()>0?we(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),C}function J(e){return(e||"").replace(/^#/,"")}function p(e){const t=e===void 0?location.hash:e,n={},r=J(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 _(e){if(!e)return null;const t=p();return e in t?t[e]:null}function m(e,t){if(!e)return;const n=p();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("&");J(location.hash)!==l&&(location.hash=l)}function z(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(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 ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(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 xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(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=p,window.lnCore.hashGet=_,window.lnCore.hashSet=m,window.lnCore.hashLinkClick=z,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=ve);function ke(){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=ke),(function(){const e="data-ln-ui-coordinator",t="lnUiCoordinator";if(window[t]!==void 0)return;const n={"data-ln-ui-coordinator":{type:"marker",description:"Mounts UI coordinator mediating global hash-routing, modals, and toasts"}};document.addEventListener("click",function(s){if(s.ctrlKey||s.metaKey||s.button===1)return;const i=s.target.closest('a[href^="#"]');if(!i)return;const a=i.getAttribute("href"),o=p(a);for(const c in o){const d=document.getElementById(c);if(d&&d.lnModal){if(!z(s))return;m(c,o[c]),d.lnModal.isOpen||h(d,"ln-modal:request-open",{});return}}});function r(){const s=location.hash;if(!s)return;const i=p(s);for(const a in i){const o=document.getElementById(a);o&&o.lnModal&&!o.lnModal.isOpen&&h(o,"ln-modal:request-open",{})}}window.addEventListener("hashchange",r),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r(),document.addEventListener("ln-modal:close",function(s){const i=s.target;i&&i.id&&_(i.id)!==null&&m(i.id,null)}),document.addEventListener("ln-ajax:success",function(s){const a=(s.detail||{}).data;if(a&&a.message){const c=a.message;h(window,"ln-toast:enqueue",{type:c.type||"success",title:c.title||"",message:typeof c=="string"?c:c.body||""})}const o=s.target.closest("[data-ln-modal]");o&&o.lnModal&&(o.id&&_(o.id)!==null&&m(o.id,null),h(o,"ln-modal:request-close",{}))}),document.addEventListener("ln-ajax:error",function(s){const a=(s.detail||{}).data;if(a&&a.message){const o=a.message;h(window,"ln-toast:enqueue",{type:o.type||"error",title:o.title||"",message:typeof o=="string"?o:o.body||""})}}),document.addEventListener("ln-upload:error",function(s){const i=s.detail||{};i.message&&h(window,"ln-toast:enqueue",{type:"error",title:"",message:i.message})});function l(s){return this.dom=s,this}l.prototype.destroy=function(){delete this.dom[t]},Q(e,t,l,"ln-ui-coordinator",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!A(i))return}e.apply(console,t)}}function h(e,t,l){const i=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const l=!!(t&&t.typed),i=t&&t.exclude,r={},s=e.elements,o={};if(l)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")l&&o[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&r[n.name].push(n.options[a].value)}else if(l&&n.type==="hidden")r[n.name]=n.value;else if(l&&(n.type==="number"||n.type==="range")){const a=Number(n.value);r[n.name]=n.value===""||isNaN(a)?null:a}else r[n.name]=n.value}return r}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const l=e.elements,i=[],r={};for(let s=0;s<l.length;s++){const o=l[s];o.name&&o.type==="checkbox"&&(r[o.name]=(r[o.name]||0)+1)}for(let s=0;s<l.length;s++){const o=l[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(r[o.name]>1){const a=String(n).split(",").map(function(d){return d.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=te(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const F={};function oe(e,t){F[e]=t}function re(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){h(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const l=e.toLowerCase().split("-")[0];$[l]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ce(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const l=v[e];return l?l.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const l=e.querySelectorAll("[data-ln-field]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function 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 l=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<l.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[i],t??null),l[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)T(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let l=0;l<t.length;l++)t[l].textContent=""}})));function N(e,t){if(!e||!t)return e;const l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const s=l.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,o){return t[o]!==void 0?t[o]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const o=r[s],c=o.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function de(e,t,l,i,r,s){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],d=a.getAttribute("data-ln-render-key");d&&(o[d]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],d=String(i(a));let u=o[d];if(u)r(u,a,n);else{const f=ce(l,s);if(!f||(N(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),r(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=T,window.lnCore.lnFill=ae,window.lnCore.renderList=de);function x(e,t,l){const i=e.getAttribute(t);return i===null?l:i}function B(e,t,l){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?l:i}function R(e,t,l=!1){const i=e.getAttribute(t);if(i===null)return!!l;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(l=>l.trim()).filter(Boolean)}const k=new Map;function W(e,t){const l=(e?e.join("|"):"")+"::"+t;if(k.has(l))return k.get(l);const i=new Set(e||[]),r=function(s,o){const c=s.getAttribute(o);return c!==null&&i.has(c)?c:t};return k.set(l,r),r}function U(e,t,l){const i=parseFloat(e.getAttribute(t));return isNaN(i)?l:i}function H(e,t,l){const i=e.getAttribute(t);if(!i)return l;try{return JSON.parse(i)}catch{return l}}function V(e,t,l,i,r){if(!e||t===null)return!0;const s=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{r?console.warn(n,r):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${l}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${l}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${l}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${l}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,l){for(const i in l){const[r,s,o]=l[i];Object.defineProperty(e,i,{get:function(){return r(t,s,o)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const l in e){const i=e[l];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=W(i.values,i.fallback);break;case"integer":r=B;break;case"float":r=U;break;case"boolean":r=R;break;case"list":r=j;break;case"json":r=H;break;case"string":default:r=x;break}r||(r=x),t[i.prop]=[r,l,i.fallback]}return t}function we(e){const t={};for(const l in e){const i=e[l];i&&i.effect&&(t[l]=i.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const l in e.effects)t.add(l);if(e.onAttrChange&&e.declared)for(const l of e.declared)t.add(l);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ue,window.lnCore.attrSpec=fe,window.lnCore.attrStr=x,window.lnCore.attrInt=B,window.lnCore.attrBool=R,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=H);function b(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(l){console.error("["+t.attribute+"] init failed",e,l)}}}function K(e,t,l,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:l,ComponentFn:i};if(e.matches&&e.matches(s)&&b(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=Q(),l=e.observed||[];for(let i=0;i<l.length;i++){const r=l[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=he(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function J(e,t,l,i){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const o=s.effects&&s.effects[l];o?o(t,l,i):s.onAttrChange&&(!s.declared||s.declared.has(l))&&s.onAttrChange(t,l,i)}}function me(e){const t=e.attributeName,l=t.indexOf("data-ln-")===0,i=Q(),r=i.byAttr.get(t),s=M()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!l&&!r&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&A(o)){const c=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<c.length;a++)V(c[a].spec,n,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(l||r)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),l){const c=i.byReactive.get(t);c&&J(c,o,t,e.oldValue),i.reactiveWildcard.length&&J(i.reactiveWildcard,o,t,e.oldValue)}if(r)for(let c=0;c<r.length;c++){const n=r[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(K(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++)try{me(t[l])}catch(i){console.error("[ln-core] mutation handler failed",t[l].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const l=e[t.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=_();if(!t.length)return;const l=e.target;if(l){const i=l.nodeType===1?l:l.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const s=r.query,o=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;o&&r.onSubtreeChange(o,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const c=t[o];if(c.selector&&c.attribute&&c.ComponentFn){if(!s)r.matches&&r.matches(c.query)&&b(r,c);else if(r.matches&&r.matches(c.query)&&b(r,c),r.querySelectorAll){const n=r.querySelectorAll(c.query);for(let a=0;a<n.length;a++)b(n[a],c)}}c.onInit&&c.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const c=t[o],n=c.query;if(n){if(!s)r.matches&&r.matches(n)&&S(r,c);else if(r.matches&&r.matches(n)&&S(r,c),r.querySelectorAll){const a=r.querySelectorAll(n);for(let d=0;d<a.length;d++)S(a[d],c)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++){const i=t[l];if(i.type==="childList")try{ye(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){_().push(e),z()}function G(e,t,l,i,r={}){const s=r.extraAttributes||[],o=r.onAttributeChange||null,c=r.onSubtreeChange||null,n=r.onInit||null,a=r.onAttrChange||null,d=r.effects||null,u=r.attributes||null,f=u?we(u):d,Oe=u?new Set(Object.keys(u)):null,Le=r.persist||null;function y(L){const w=L||document.body;if(K(w,e,t,l),u&&M())for(const g in u){const Ie=u[g],q=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&q.push(w);for(let D=0;D<q.length;D++){const I=q[D];A(I)&&V(Ie,I.getAttribute(g),g,i,I)}}n&&n(w)}const O=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)O.push(w[1])}else O.push(e);ge({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:l,onInit:n,observed:O.concat(s),onAttributeChange:o,onAttrChange:a,effects:f,declared:Oe,persist:Le}),Ce();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,De=r.subtreeQuery||(qe?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:l,onInit:n,onSubtreeChange:c,query:De}),z(),window[t]=y,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=Ae);function Y(){be()>0?pe(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Y):Y(),y}function P(e){return(e||"").replace(/^#/,"")}function p(e){const t=e===void 0?location.hash:e,l={},i=P(t);if(!i)return l;const r=i.split("&");for(let s=0;s<r.length;s++){const o=r[s];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(n)try{l[n]=decodeURIComponent(a)}catch{l[n]=a}}return l}function E(e){if(!e)return null;const t=p();return e in t?t[e]:null}function C(e,t){if(!e)return;const l=p();t==null?delete l[e]:l[e]=String(t);const r=Object.keys(l).map(function(s){const o=l[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");P(location.hash)!==r&&(location.hash=r)}function X(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 l=e.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function 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 l=e.slice(0,t),i=e.slice(t+1),r=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:l,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=p,window.lnCore.hashGet=E,window.lnCore.hashSet=C,window.lnCore.hashLinkClick=X,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(){const e="data-ln-ui-coordinator",t="lnUiCoordinator";if(window[t]!==void 0)return;const l={"data-ln-ui-coordinator":{type:"marker",description:"Mounts UI coordinator mediating global hash-routing, modals, and toasts"}};document.addEventListener("click",function(s){if(s.ctrlKey||s.metaKey||s.button===1)return;const o=s.target.closest('a[href^="#"]');if(!o)return;const c=o.getAttribute("href"),n=p(c);for(const a in n){const d=document.getElementById(a);if(d&&d.lnModal){if(!X(s))return;C(a,n[a]),d.lnModal.isOpen||h(d,"ln-modal:request-open",{});return}}});function i(){const s=location.hash;if(!s)return;const o=p(s);for(const c in o){const n=document.getElementById(c);n&&n.lnModal&&!n.lnModal.isOpen&&h(n,"ln-modal:request-open",{})}}window.addEventListener("hashchange",i),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),document.addEventListener("ln-modal:close",function(s){const o=s.target;o&&o.id&&E(o.id)!==null&&C(o.id,null)}),document.addEventListener("ln-ajax:success",function(s){const c=(s.detail||{}).data;if(c&&c.message){const a=c.message;h(window,"ln-toast:enqueue",{type:a.type||"success",title:a.title||"",message:typeof a=="string"?a:a.body||""})}const n=s.target.closest("[data-ln-modal]");n&&n.lnModal&&(n.id&&E(n.id)!==null&&C(n.id,null),h(n,"ln-modal:request-close",{}))}),document.addEventListener("ln-ajax:error",function(s){const c=(s.detail||{}).data;if(c&&c.message){const n=c.message;h(window,"ln-toast:enqueue",{type:n.type||"error",title:n.title||"",message:typeof n=="string"?n:n.body||""})}}),document.addEventListener("ln-upload:error",function(s){const o=s.detail||{};o.message&&h(window,"ln-toast:enqueue",{type:"error",title:"",message:o.message})});function r(s){return this.dom=s,this}r.prototype.destroy=function(){delete this.dom[t]},G(e,t,r,"ln-ui-coordinator",{attributes:l})})()})();
|
|
@@ -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(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(!E(o))return}e.apply(console,t)}}function v(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function L(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function I(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){I(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},d=e.elements,s={};if(n)for(let u=0;u<d.length;u++){const l=d[u];l.name&&l.type==="checkbox"&&!l.disabled&&(s[l.name]=(s[l.name]||0)+1)}for(let u=0;u<d.length;u++){const l=d[u];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(o&&l.matches&&l.matches(o)))if(l.type==="checkbox")n&&s[l.name]===1?i[l.name]=l.checked:(i[l.name]||(i[l.name]=[]),l.checked&&i[l.name].push(l.value));else if(l.type==="radio")l.checked&&(i[l.name]=l.value);else if(l.type==="select-multiple"){i[l.name]=[];for(let r=0;r<l.options.length;r++)l.options[r].selected&&i[l.name].push(l.options[r].value)}else if(n&&l.type==="hidden")i[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const r=Number(l.value);i[l.name]=l.value===""||isNaN(r)?null:r}else i[l.name]=l.value}return i}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const n=e.elements,o=[],i={};for(let d=0;d<n.length;d++){const s=n[d];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let d=0;d<n.length;d++){const s=n[d];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const u=s.getAttribute("data-ln-fill-as")||s.name;if(!u||!(u in t))continue;const l=t[u];if(s.type==="checkbox"){if(Array.isArray(l))s.checked=l.indexOf(s.value)!==-1;else if(i[s.name]>1){const r=String(l).split(",").map(function(a){return a.trim()});s.checked=r.indexOf(s.value)!==-1}else s.checked=re(l);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(l),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(l))for(let r=0;r<s.options.length;r++)s.options[r].selected=l.indexOf(s.options[r].value)!==-1;o.push(s)}else s.value=l,s.tagName==="SELECT"&&l!=null&&s.setAttribute("data-ln-value",l),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ne);const M={};function le(e,t){M[e]=t}function ae(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=ae);function se(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 de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,I(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function ue(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];U[n]=t}function ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=ce,window.lnCore.ensureLocaleObserver=de);const F={};function B(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function fe(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return B(t,n)}function x(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],l=u.getAttribute("data-ln-field");t[l]!=null&&(u.textContent=t[l])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const u=o[s],l=u.getAttribute("data-ln-attr").split(",");for(let r=0;r<l.length;r++){const a=l[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();t[f]!=null&&u.setAttribute(c,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const u=i[s],l=u.getAttribute("data-ln-show");l in t&&u.classList.toggle("hidden",!t[l])}const d=e.querySelectorAll("[data-ln-class]");for(let s=0;s<d.length;s++){const u=d[s],l=u.getAttribute("data-ln-class").split(",");for(let r=0;r<l.length;r++){const a=l[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();f in t&&u.classList.toggle(c,!!t[f])}}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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)x(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return t[u]!==void 0?t[u]:""}))}const o=function(d,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let d=0;d<i.length;d++){const s=i[d],u=s.attributes;for(let l=0;l<u.length;l++){const r=u[l];r.value.indexOf("{{")!==-1&&s.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function he(e,t,n,o,i,d){const s={};for(let l=0;l<e.children.length;l++){const r=e.children[l],a=r.getAttribute("data-ln-render-key");a&&(s[a]=r)}const u=document.createDocumentFragment();for(let l=0;l<t.length;l++){const r=t[l],a=String(o(r));let c=s[a];if(c)i(c,r,l);else{const f=B(n,d);if(!f||($(f,r),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),i(c,r,l)}u.appendChild(c)}e.textContent="",e.appendChild(u)}function me(e,t){const n={},o=e.querySelectorAll("["+t+"]");for(let i=0;i<o.length;i++)n[o[i].getAttribute(t)]=o[i].textContent,o[i].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=x,window.lnCore.lnFill=pe,window.lnCore.renderList=he);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function k(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function H(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const o=new Set(e||[]),i=function(d,s){const u=d.getAttribute(s);return u!==null&&o.has(u)?u:t};return D.set(n,i),i}function P(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function V(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function X(e,t,n,o,i){if(!e||t===null)return!0;const d=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=l=>{i?console.warn(l,i):console.warn(l)};if(s==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(u(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const l=e.values||[];return l.includes(t)?!0:(u(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(u(`[${d}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(u(`[${d}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(l){return u(`[${d}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function K(e,t,n){for(const o in n){const[i,d,s]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,d,s)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=W(o.values,o.fallback);break;case"integer":i=k;break;case"float":i=P;break;case"boolean":i=H;break;case"list":i=j;break;case"json":i=V;break;case"string":default:i=_;break}i||(i=_),t[o.prop]=[i,n,o.fallback]}return t}function ge(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function 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=K,window.lnCore.attrSpec=J,window.lnCore.attrStr=_,window.lnCore.attrInt=k,window.lnCore.attrBool=H,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=V);function q(e,t,n,o){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(d));e.matches&&e.matches(d)&&s.push(e);for(const u of s)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new o(u)}catch(l){console.error("["+n+"] init failed",u,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=Q(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(d=>d.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=we(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function G(e,t,n,o){for(let i=0;i<e.length;i++){const d=e[i];if(!t[d.attribute])continue;const s=d.effects&&d.effects[n];s?s(t,n,o):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,o)}}function ve(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),i=o.byAttr.get(n);if(N()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&E(t)){const d=o.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let u=0;u<d.length;u++)X(d[u].spec,s,n,d[u].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 d=o.byReactive.get(n);d&&G(d,t,n,e.oldValue),o.reactiveWildcard.length&&G(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let d=0;d<i.length;d++){const s=i[d];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(q(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,I(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ve(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function xe(e){const t=Z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,d=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;d&&o.onSubtreeChange(d,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const d=t[i];q(o,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const d=t[i],s=d.query,u=Array.from(o.querySelectorAll(s));o.matches&&o.matches(s)&&u.push(o);for(let l=0;l<u.length;l++){const r=u[l];if(!document.contains(r)){const a=r[d.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(c){console.error("["+d.attribute+"] destroy failed",r,c)}delete r[d.attribute]}}}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,I(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{xe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Y(e,t,n,o,i={}){const d=i.extraAttributes||[],s=i.onAttributeChange||null,u=i.onSubtreeChange||null,l=i.onInit||null,r=i.onAttrChange||null,a=i.effects||null,c=i.attributes||null,f=c?ge(c):a,p=c?new Set(Object.keys(c)):null,w=i.persist||null;function b(y){const C=y||document.body;if(q(C,e,t,n),c&&N())for(const S in c){const Ne=c[S],R=Array.from(C.querySelectorAll("["+S+"]"));C.matches&&C.matches("["+S+"]")&&R.push(C);for(let O=0;O<R.length;O++){const T=R[O];E(T)&&X(Ne,T.getAttribute(S),S,o,T)}}l&&l(C)}const m=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let C;for(;(C=y.exec(e))!==null;)m.push(C[1])}else m.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:c,ComponentFn:n,onInit:l,observed:m.concat(d),onAttributeChange:s,onAttrChange:r,effects:f,declared:p,persist:w}),Ae();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=i.subtreeQuery||(A?e:"["+e+"]");Z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:u,query:g}),_e(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y);function h(){be()>0?ye(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),b}function ee(e){return(e||"").replace(/^#/,"")}function z(e){const t=e===void 0?location.hash:e,n={},o=ee(t);if(!o)return n;const i=o.split("&");for(let d=0;d<i.length;d++){const s=i[d];if(!s)continue;const u=s.indexOf(":"),l=u>-1?s.slice(0,u):s,r=u>-1?s.slice(u+1):"";if(l)try{n[l]=decodeURIComponent(r)}catch{n[l]=r}}return n}function Se(e){if(!e)return null;const t=z();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const n=z();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(d){const s=n[d];return s===""?d:d+":"+encodeURIComponent(s)}).join("&");ee(location.hash)!==i&&(location.hash=i)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=z,window.lnCore.hashGet=Se,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=qe);function ze(){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=ze);function Re(e){if(!e)return null;const t=String(e).split(",").map(n=>n.trim().toLowerCase()).filter(Boolean).map(n=>n.startsWith(".")?n.slice(1):n);return t.length?t:null}function te(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function Oe(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=te(e.name),o=String(e.type||"").toLowerCase();return t.some(i=>{if(i.includes("/")){if(i.endsWith("/*")){const d=i.slice(0,-1);return o.startsWith(d)}return o===i}return n===i})}function Te(e,t="en",n={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(n["unit-b"]||"B");const o=1024,i=[n["unit-b"]||"B",n["unit-kb"]||"KB",n["unit-mb"]||"MB",n["unit-gb"]||"GB"],d=Math.floor(Math.log(e)/Math.log(o)),s=Math.min(d,i.length-1),u=e/Math.pow(o,s);return new Intl.NumberFormat(t,{maximumFractionDigits:1,minimumFractionDigits:0}).format(u)+" "+i[s]}(function(){const e="data-ln-upload",t="lnUpload",n="file",o="file_ids[]";if(window[t]!==void 0)return;const i={"data-ln-upload":{prop:"uploadUrl",read:_,type:"string",fallback:"",description:"Endpoint URL for file uploads"},"data-ln-upload-accept":{type:"string",description:"Comma-separated list of allowed file extensions or MIME types"},"data-ln-upload-delete":{prop:"deleteUrlPattern",read:_,type:"string",fallback:"",description:"Endpoint URL pattern for deleting uploaded files"},"data-ln-upload-max-size":{prop:"maxSize",read:k,type:"integer",fallback:0,min:0,description:"Maximum allowed file size in bytes (0 for unlimited)"},"data-ln-upload-max-files":{prop:"maxFiles",read:k,type:"integer",fallback:0,min:0,description:"Maximum number of files allowed in upload queue (0 for unlimited)"},"data-ln-upload-file-field":{prop:"fileFieldName",read:_,type:"string",fallback:n,description:"Form data field name used for file payloads"},"data-ln-upload-ids-field":{prop:"idsFieldName",read:_,type:"string",fallback:o,description:"Form field name for submitting uploaded file IDs"},"data-ln-upload-dict":{type:"string",description:"Dictionary key prefix mapping for translatable upload messages"},"data-ln-upload-zone":{type:"marker",description:"Designates container as dropzone for drag-and-drop file uploads"},"data-ln-upload-list":{type:"marker",description:"Container element holding rendered upload items"},"data-ln-upload-item":{type:"marker",description:"Container element for an individual file upload item"},"data-ln-upload-action":{type:"enum",values:["remove","retry"],description:"Action button within upload item"},"data-ln-upload-state":{type:"enum",values:["ready","dragover","pending","uploading","success","error"],description:"Runtime status of dropzone or individual upload item"},"data-ln-upload-id":{type:"string",description:"Server-assigned file identifier for completed upload"},"data-ln-upload-local-id":{type:"string",description:"Client-generated unique ID for tracking file item in DOM"},"data-ln-upload-size":{type:"integer",min:0,description:"File size in bytes"},"data-ln-upload-ext":{type:"string",description:"Normalized file extension"}},d=J(i);function s(r,a,c){return Te(r,a,c)}function u(){const r=document.querySelector('meta[name="csrf-token"]');return r?r.getAttribute("content"):""}function l(r){this.dom=r,K(this,r,d),this.dict=me(r,"data-ln-upload-dict"),this.locale=se(r),this.zone=r.querySelector("[data-ln-upload-zone]")||r,this.list=r.querySelector("[data-ln-upload-list]"),this.input=r.querySelector('input[type="file"]'),this.input||console.warn('[ln-upload] Missing <input type="file"> in container:',r);const a=r.getAttribute("data-ln-upload-accept")||(this.input?this.input.getAttribute("accept"):"");return this.allowedExts=Re(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}l.prototype._hydrate=function(){const r=this;if(!this.list)return;const a=this.list.querySelectorAll("[data-ln-upload-item]");for(let f=0;f<a.length;f++){const p=a[f],w=p.getAttribute("data-ln-upload-id"),b="file-"+ ++r.fileIdCounter;p.setAttribute("data-ln-upload-local-id",b);const m=p.querySelector('[data-ln-field="name"]'),A=p.querySelector('[data-ln-field="sizeText"]'),g=p.getAttribute("data-ln-upload-size"),h=g?parseInt(g,10):null;r.uploadedFiles.set(b,{serverId:w||null,name:m?m.textContent.trim():"",size:h!==null&&!isNaN(h)?h:A?A.textContent.trim():""})}const c=this.dom.querySelectorAll('input[type="hidden"]');for(let f=0;f<c.length;f++){const p=c[f];if(p.name===r.idsFieldName&&p.value&&!Array.from(r.uploadedFiles.values()).some(function(b){return String(b.serverId)===String(p.value)})){const b="file-"+ ++r.fileIdCounter;r.uploadedFiles.set(b,{serverId:p.value,name:"",size:""})}}this._syncHiddenInputs()},l.prototype._syncHiddenInputs=function(){const r=this,a=this.dom.querySelectorAll('input[type="hidden"]');for(let c=0;c<a.length;c++)a[c].name===r.idsFieldName&&a[c].remove();for(const[,c]of this.uploadedFiles)if(c.serverId){const f=document.createElement("input");f.type="hidden",f.name=r.idsFieldName,f.value=c.serverId,r.dom.appendChild(f)}},l.prototype._bindEvents=function(){const r=this;this._onZoneClick=function(a){r.zone===r.dom&&a.target.closest("[data-ln-upload-list], [data-ln-upload-action], input, button, a")||r.input&&a.target!==r.input&&r.input.click()},this._onInputChange=function(){r.input&&r.input.files&&(r.upload(r.input.files),r.input.value="")},this._onDragEnter=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth++,r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragOver=function(a){a.preventDefault(),a.stopPropagation(),r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragLeave=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth--,r._dragDepth<=0&&(r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"))},this._onDrop=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"),a.dataTransfer&&a.dataTransfer.files&&r.upload(a.dataTransfer.files)},this._onListClick=function(a){const c=a.target.closest('[data-ln-upload-action="remove"]');if(!c||!r.list||!r.list.contains(c)||c.disabled)return;const f=c.closest("[data-ln-upload-item]");if(f){const p=f.getAttribute("data-ln-upload-local-id");p&&r.remove(p)}},this._onRequestUpload=function(a){a.detail&&a.detail.files&&r.upload(a.detail.files)},this._onRequestRemove=function(a){if(a.detail){const c=a.detail.localId!==void 0?a.detail.localId:a.detail.serverId;c!==void 0&&r.remove(c)}},this._onRequestClear=function(){r.clear()},this.zone.addEventListener("click",this._onZoneClick),this.input&&this.input.addEventListener("change",this._onInputChange),this.zone.addEventListener("dragenter",this._onDragEnter),this.zone.addEventListener("dragover",this._onDragOver),this.zone.addEventListener("dragleave",this._onDragLeave),this.zone.addEventListener("drop",this._onDrop),this.list&&this.list.addEventListener("click",this._onListClick),this.dom.addEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.addEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.addEventListener("ln-upload:request-clear",this._onRequestClear)},l.prototype.upload=function(r){const a=this,c=Array.from(r);for(let f=0;f<c.length;f++){const p=c[f];if(a.maxFiles>0&&a.uploadedFiles.size>=a.maxFiles){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-files"});continue}if(!Oe(p,a.allowedExts)){v(a.dom,"ln-upload:invalid",{file:p,reason:"accept"});continue}if(a.maxSize>0&&p.size>a.maxSize){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-size"});continue}L(a.dom,"ln-upload:before-upload",{file:p}).defaultPrevented||a._uploadSingleFile(p)}},l.prototype._uploadSingleFile=function(r){const a=this,c="file-"+ ++a.fileIdCounter,f=te(r.name);let p=null;if(this.list){const g=fe(this.dom,"ln-upload-item","ln-upload");if(g&&(p=g.firstElementChild,p)){p.setAttribute("data-ln-upload-item",""),p.setAttribute("data-ln-upload-local-id",c),p.setAttribute("data-ln-upload-ext",f),p.setAttribute("data-ln-upload-state","uploading"),x(p,{name:r.name,sizeText:"0%",removeLabel:a.dict.remove||"Remove",uploading:!0,error:!1,deleting:!1});const h=p.querySelector('[data-ln-upload-action="remove"]');h&&(h.disabled=!0);const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress","0"),a.list.appendChild(p)}}const w=new FormData;w.append(a.fileFieldName,r);const b=this.dom.querySelectorAll("input, select, textarea");for(let g=0;g<b.length;g++){const h=b[g];!h.name||h.name===a.idsFieldName||h.type==="file"||(h.type==="checkbox"||h.type==="radio")&&!h.checked||w.append(h.name,h.value)}const m=new XMLHttpRequest;a.uploadedFiles.set(c,{serverId:null,name:r.name,size:r.size,xhr:m}),m.upload.addEventListener("progress",function(g){if(g.lengthComputable){const h=Math.round(g.loaded/g.total*100);if(p){const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress",String(h)),x(p,{sizeText:h+"%"})}v(a.dom,"ln-upload:progress",{localId:c,file:r,percent:h,loaded:g.loaded,total:g.total})}}),m.addEventListener("load",function(){const g=a.uploadedFiles.get(c);if(g&&delete g.xhr,m.status>=200&&m.status<300){let h;try{h=JSON.parse(m.responseText)}catch(C){A(a.dict.error||"Error",m.status,C);return}const y=h.id||h.serverId;if(p){p.removeAttribute("data-ln-upload-state"),y&&p.setAttribute("data-ln-upload-id",String(y)),x(p,{sizeText:s(h.size||r.size,a.locale,a.dict),uploading:!1});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}g&&(g.serverId=y,g.size=h.size||r.size,g.name=h.name||r.name),a._syncHiddenInputs(),v(a.dom,"ln-upload:uploaded",{localId:c,serverId:y,name:h.name||r.name,size:h.size||r.size,response:h})}else{let h="";try{h=JSON.parse(m.responseText).message||""}catch{}A(h,m.status,null)}}),m.addEventListener("error",function(){const g=a.uploadedFiles.get(c);g&&delete g.xhr,A("",0,null)});function A(g,h,y){if(p){p.setAttribute("data-ln-upload-state","error"),x(p,{sizeText:a.dict.error||"Error",uploading:!1,error:!0});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}v(a.dom,"ln-upload:error",{file:r,message:g,status:h,error:y})}a.uploadUrl?(m.open("POST",a.uploadUrl),m.setRequestHeader("X-CSRF-TOKEN",u()),m.setRequestHeader("X-Requested-With","XMLHttpRequest"),m.setRequestHeader("Accept","application/json"),m.send(w)):console.warn("[ln-upload] No upload URL configured (missing data-ln-upload)")},l.prototype.remove=function(r){const a=this;let c=null,f=null;if(a.uploadedFiles.has(r))c=r,f=a.uploadedFiles.get(r);else for(const[m,A]of a.uploadedFiles)if(String(A.serverId)===String(r)){c=m,f=A;break}if(!c||!f||L(a.dom,"ln-upload:before-remove",{localId:c,serverId:f.serverId}).defaultPrevented)return;const w=a.list?a.list.querySelector('[data-ln-upload-local-id="'+c+'"]'):null;if(f.xhr&&typeof f.xhr.abort=="function"&&f.xhr.abort(),!f.serverId){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:null});return}let b=null;if(a.deleteUrlPattern?b=a.deleteUrlPattern.replace("{id}",encodeURIComponent(f.serverId)):a.uploadUrl&&a.uploadUrl.includes("{id}")&&(b=a.uploadUrl.replace("{id}",encodeURIComponent(f.serverId))),!b){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId});return}w&&(w.setAttribute("data-ln-upload-state","deleting"),x(w,{deleting:!0})),fetch(b,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(function(m){m.ok?(w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId})):(w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:m.status}))}).catch(function(m){w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:m})})},l.prototype.clear=function(){const r=this;if(!L(r.dom,"ln-upload:before-clear",{}).defaultPrevented){for(const[,c]of this.uploadedFiles)if(c.xhr&&typeof c.xhr.abort=="function"&&c.xhr.abort(),c.serverId){let f=null;r.deleteUrlPattern?f=r.deleteUrlPattern.replace("{id}",encodeURIComponent(c.serverId)):r.uploadUrl&&r.uploadUrl.includes("{id}")&&(f=r.uploadUrl.replace("{id}",encodeURIComponent(c.serverId))),f&&fetch(f,{method:"DELETE",headers:{"X-CSRF-TOKEN":u(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).catch(function(){})}r.uploadedFiles.clear(),r.list&&(r.list.innerHTML=""),r._syncHiddenInputs(),v(r.dom,"ln-upload:cleared",{})}},l.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return r.serverId}).filter(Boolean)},l.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return{serverId:r.serverId,name:r.name,size:r.size}})},l.prototype.destroy=function(){if(this.dom[t]){for(const[,r]of this.uploadedFiles)r.xhr&&typeof r.xhr.abort=="function"&&r.xhr.abort();this.zone.removeEventListener("click",this._onZoneClick),this.input&&this.input.removeEventListener("change",this._onInputChange),this.zone.removeEventListener("dragenter",this._onDragEnter),this.zone.removeEventListener("dragover",this._onDragOver),this.zone.removeEventListener("dragleave",this._onDragLeave),this.zone.removeEventListener("drop",this._onDrop),this.list&&this.list.removeEventListener("click",this._onListClick),this.dom.removeEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.removeEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.removeEventListener("ln-upload:request-clear",this._onRequestClear),this.uploadedFiles.clear(),this.dict={},delete this.dom[t]}},Y(e,t,l,"ln-upload",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!L(i))return}e.apply(console,t)}}function v(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function F(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(o),o}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(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 n=!!(t&&t.typed),i=t&&t.exclude,o={},u=e.elements,s={};if(n)for(let d=0;d<u.length;d++){const l=u[d];l.name&&l.type==="checkbox"&&!l.disabled&&(s[l.name]=(s[l.name]||0)+1)}for(let d=0;d<u.length;d++){const l=u[d];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(i&&l.matches&&l.matches(i)))if(l.type==="checkbox")n&&s[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let r=0;r<l.options.length;r++)l.options[r].selected&&o[l.name].push(l.options[r].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const r=Number(l.value);o[l.name]=l.value===""||isNaN(r)?null:r}else o[l.name]=l.value}return o}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const n=e.elements,i=[],o={};for(let u=0;u<n.length;u++){const s=n[u];s.name&&s.type==="checkbox"&&(o[s.name]=(o[s.name]||0)+1)}for(let u=0;u<n.length;u++){const s=n[u];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const d=s.getAttribute("data-ln-fill-as")||s.name;if(!d||!(d in t))continue;const l=t[d];if(s.type==="checkbox"){if(Array.isArray(l))s.checked=l.indexOf(s.value)!==-1;else if(o[s.name]>1){const r=String(l).split(",").map(function(a){return a.trim()});s.checked=r.indexOf(s.value)!==-1}else s.checked=se(l);i.push(s)}else if(s.type==="radio")s.checked=s.value===String(l),i.push(s);else if(s.type==="select-multiple"){if(Array.isArray(l))for(let r=0;r<s.options.length;r++)s.options[r].selected=l.indexOf(s.options[r].value)!==-1;i.push(s)}else s.value=l,s.tagName==="SELECT"&&l!=null&&s.setAttribute("data-ln-value",l),i.push(s)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const B={};function de(e,t){B[e]=t}function ue(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function ce(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,E(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function he(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=he,window.lnCore.ensureLocaleObserver=fe);const D={};function H(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function me(e,t,n){if(e){const i=e.querySelector('[data-ln-template="'+t+'"]');if(i)return i.content.cloneNode(!0)}return H(t,n)}function x(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const d=n[s],l=d.getAttribute("data-ln-field");t[l]!=null&&(d.textContent=t[l])}const i=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<i.length;s++){const d=i[s],l=d.getAttribute("data-ln-attr").split(",");for(let r=0;r<l.length;r++){const a=l[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();t[f]!=null&&d.setAttribute(c,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const d=o[s],l=d.getAttribute("data-ln-show");l in t&&d.classList.toggle("hidden",!t[l])}const u=e.querySelectorAll("[data-ln-class]");for(let s=0;s<u.length;s++){const d=u[s],l=d.getAttribute("data-ln-class").split(",");for(let r=0;r<l.length;r++){const a=l[r].trim().split(":");if(a.length!==2)continue;const c=a[0].trim(),f=a[1].trim();f in t&&d.classList.toggle(c,!!t[f])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)x(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const u=n.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,d){return t[d]!==void 0?t[d]:""}))}const i=function(u,s){return t[s]!==void 0?t[s]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let u=0;u<o.length;u++){const s=o[u],d=s.attributes;for(let l=0;l<d.length;l++){const r=d[l];r.value.indexOf("{{")!==-1&&s.setAttribute(r.name,r.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function we(e,t,n,i,o,u){const s={};for(let l=0;l<e.children.length;l++){const r=e.children[l],a=r.getAttribute("data-ln-render-key");a&&(s[a]=r)}const d=document.createDocumentFragment();for(let l=0;l<t.length;l++){const r=t[l],a=String(i(r));let c=s[a];if(c)o(c,r,l);else{const f=H(n,u);if(!f||(j(f,r),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",a),o(c,r,l)}d.appendChild(c)}e.textContent="",e.appendChild(d)}function be(e,t){const n={},i=e.querySelectorAll("["+t+"]");for(let o=0;o<i.length;o++)n[i[o].getAttribute(t)]=i[o].textContent,i[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=x,window.lnCore.lnFill=ge,window.lnCore.renderList=we);function _(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function k(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function W(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const i=new Set(e||[]),o=function(u,s){const d=u.getAttribute(s);return d!==null&&i.has(d)?d:t};return q.set(n,o),o}function X(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function K(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function J(e,t,n,i,o){if(!e||t===null)return!0;const u=i||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const d=l=>{o?console.warn(l,o):console.warn(l)};if(s==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(d(`[${u}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const l=e.values||[];return l.includes(t)?!0:(d(`[${u}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return d(`[${u}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(d(`[${u}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(d(`[${u}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(d(`[${u}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(l){return d(`[${u}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,n){for(const i in n){const[o,u,s]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,u,s)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=V(i.values,i.fallback);break;case"integer":o=k;break;case"float":o=X;break;case"boolean":o=W;break;case"list":o=P;break;case"json":o=K;break;case"string":default:o=_;break}o||(o=_),t[i.prop]=[o,n,i.fallback]}return t}function ye(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=G,window.lnCore.attrStr=_,window.lnCore.attrInt=k,window.lnCore.attrBool=W,window.lnCore.attrList=P,window.lnCore.attrEnum=V,window.lnCore.attrFloat=X,window.lnCore.attrJson=K);function S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Z(e,t,n,i){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(u)&&S(e,s),e.querySelectorAll){const d=e.querySelectorAll(u);for(let l=0;l<d.length;l++)S(d[l],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 Ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){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 xe(e){const t=Y(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[i];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(u=>u.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Ce(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,n,i){for(let o=0;o<e.length;o++){const u=e[o];if(!t[u.attribute])continue;const s=u.effects&&u.effects[n];s?s(t,n,i):u.onAttrChange&&(!u.declared||u.declared.has(n))&&u.onAttrChange(t,n,i)}}function _e(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=Y(),o=i.byAttr.get(t),u=U()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!u)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(u&&L(s)){const d=i.byDeclaredAttr.get(t),l=s.getAttribute(t);for(let r=0;r<d.length;r++)J(d[r].spec,l,t,d[r].componentTag,s)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const d=i.byReactive.get(t);d&&ee(d,s,t,e.oldValue),i.reactiveWildcard.length&&ee(i.reactiveWildcard,s,t,e.oldValue)}if(o)for(let d=0;d<o.length;d++){const l=o[d];if(l.handler){l.handler(s,t,e.oldValue);continue}l.onAttributeChange&&s[l.attribute]?l.onAttributeChange(s,t):(Z(s,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(s))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{_e(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ie(e){const t=z();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const o=t[i];if(o.onSubtreeChange&&o.query){const u=o.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(u)?e.target:e.target.closest?e.target.closest(u):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(u):null;s&&o.onSubtreeChange(s,e)}}for(let i=0;i<e.addedNodes.length;i++){const o=e.addedNodes[i];if(o.nodeType===1){const u=!!(o.firstElementChild||o.children&&o.children.length);for(let s=0;s<t.length;s++){const d=t[s];if(d.selector&&d.attribute&&d.ComponentFn){if(!u)o.matches&&o.matches(d.query)&&S(o,d);else if(o.matches&&o.matches(d.query)&&S(o,d),o.querySelectorAll){const l=o.querySelectorAll(d.query);for(let r=0;r<l.length;r++)S(l[r],d)}}d.onInit&&d.onInit(o)}}}for(let i=0;i<e.removedNodes.length;i++){const o=e.removedNodes[i];if(o.nodeType===1){const u=!!(o.firstElementChild||o.children&&o.children.length);for(let s=0;s<t.length;s++){const d=t[s],l=d.query;if(l){if(!u)o.matches&&o.matches(l)&&R(o,d);else if(o.matches&&o.matches(l)&&R(o,d),o.querySelectorAll){const r=o.querySelectorAll(l);for(let a=0;a<r.length;a++)R(r[a],d)}}}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{Ie(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){z().push(e),te()}function ne(e,t,n,i,o={}){const u=o.extraAttributes||[],s=o.onAttributeChange||null,d=o.onSubtreeChange||null,l=o.onInit||null,r=o.onAttrChange||null,a=o.effects||null,c=o.attributes||null,f=c?ye(c):a,p=c?new Set(Object.keys(c)):null,w=o.persist||null;function b(y){const C=y||document.body;if(Z(C,e,t,n),c&&U())for(const I in c){const Be=c[I],T=Array.from(C.querySelectorAll("["+I+"]"));C.matches&&C.matches("["+I+"]")&&T.push(C);for(let N=0;N<T.length;N++){const M=T[N];L(M)&&J(Be,M.getAttribute(I),I,i,M)}}l&&l(C)}const m=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let C;for(;(C=y.exec(e))!==null;)m.push(C[1])}else m.push(e);xe({selector:e,attribute:t,componentTag:i,attributes:c,ComponentFn:n,onInit:l,observed:m.concat(u),onAttributeChange:s,onAttrChange:r,effects:f,declared:p,persist:w}),Se();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=o.subtreeQuery||(A?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:d,query:g}),te(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=Ee);function h(){ve()>0?Ae(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),b}function oe(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,n={},i=oe(t);if(!i)return n;const o=i.split("&");for(let u=0;u<o.length;u++){const s=o[u];if(!s)continue;const d=s.indexOf(":"),l=d>-1?s.slice(0,d):s,r=d>-1?s.slice(d+1):"";if(l)try{n[l]=decodeURIComponent(r)}catch{n[l]=r}}return n}function ke(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Le(e,t){if(!e)return;const n=O();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(u){const s=n[u];return s===""?u:u+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ze(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 Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ke,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=ze,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=Oe);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te);function Ne(e){if(!e)return null;const t=String(e).split(",").map(n=>n.trim().toLowerCase()).filter(Boolean).map(n=>n.startsWith(".")?n.slice(1):n);return t.length?t:null}function re(e){return!e||typeof e!="string"||!e.includes(".")?"":e.split(".").pop().toLowerCase()}function Me(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=re(e.name),i=String(e.type||"").toLowerCase();return t.some(o=>{if(o.includes("/")){if(o.endsWith("/*")){const u=o.slice(0,-1);return i.startsWith(u)}return i===o}return n===o})}function Ue(e,t="en",n={}){if(typeof e!="number"||isNaN(e)||e===0)return"0 "+(n["unit-b"]||"B");const i=1024,o=[n["unit-b"]||"B",n["unit-kb"]||"KB",n["unit-mb"]||"MB",n["unit-gb"]||"GB"],u=Math.floor(Math.log(e)/Math.log(i)),s=Math.min(u,o.length-1),d=e/Math.pow(i,s);return new Intl.NumberFormat(t,{maximumFractionDigits:1,minimumFractionDigits:0}).format(d)+" "+o[s]}(function(){const e="data-ln-upload",t="lnUpload",n="file",i="file_ids[]";if(window[t]!==void 0)return;const o={"data-ln-upload":{prop:"uploadUrl",read:_,type:"string",fallback:"",description:"Endpoint URL for file uploads"},"data-ln-upload-accept":{type:"string",description:"Comma-separated list of allowed file extensions or MIME types"},"data-ln-upload-delete":{prop:"deleteUrlPattern",read:_,type:"string",fallback:"",description:"Endpoint URL pattern for deleting uploaded files"},"data-ln-upload-max-size":{prop:"maxSize",read:k,type:"integer",fallback:0,min:0,description:"Maximum allowed file size in bytes (0 for unlimited)"},"data-ln-upload-max-files":{prop:"maxFiles",read:k,type:"integer",fallback:0,min:0,description:"Maximum number of files allowed in upload queue (0 for unlimited)"},"data-ln-upload-file-field":{prop:"fileFieldName",read:_,type:"string",fallback:n,description:"Form data field name used for file payloads"},"data-ln-upload-ids-field":{prop:"idsFieldName",read:_,type:"string",fallback:i,description:"Form field name for submitting uploaded file IDs"},"data-ln-upload-dict":{type:"string",description:"Dictionary key prefix mapping for translatable upload messages"},"data-ln-upload-zone":{type:"marker",description:"Designates container as dropzone for drag-and-drop file uploads"},"data-ln-upload-list":{type:"marker",description:"Container element holding rendered upload items"},"data-ln-upload-item":{type:"marker",description:"Container element for an individual file upload item"},"data-ln-upload-action":{type:"enum",values:["remove","retry"],description:"Action button within upload item"},"data-ln-upload-state":{type:"enum",values:["ready","dragover","pending","uploading","success","error"],description:"Runtime status of dropzone or individual upload item"},"data-ln-upload-id":{type:"string",description:"Server-assigned file identifier for completed upload"},"data-ln-upload-local-id":{type:"string",description:"Client-generated unique ID for tracking file item in DOM"},"data-ln-upload-size":{type:"integer",min:0,description:"File size in bytes"},"data-ln-upload-ext":{type:"string",description:"Normalized file extension"}},u=G(o);function s(r,a,c){return Ue(r,a,c)}function d(){const r=document.querySelector('meta[name="csrf-token"]');return r?r.getAttribute("content"):""}function l(r){this.dom=r,Q(this,r,u),this.dict=be(r,"data-ln-upload-dict"),this.locale=ce(r),this.zone=r.querySelector("[data-ln-upload-zone]")||r,this.list=r.querySelector("[data-ln-upload-list]"),this.input=r.querySelector('input[type="file"]'),this.input||console.warn('[ln-upload] Missing <input type="file"> in container:',r);const a=r.getAttribute("data-ln-upload-accept")||(this.input?this.input.getAttribute("accept"):"");return this.allowedExts=Ne(a),this.uploadedFiles=new Map,this.fileIdCounter=0,this._dragDepth=0,this._hydrate(),this._bindEvents(),this}l.prototype._hydrate=function(){const r=this;if(!this.list)return;const a=this.list.querySelectorAll("[data-ln-upload-item]");for(let f=0;f<a.length;f++){const p=a[f],w=p.getAttribute("data-ln-upload-id"),b="file-"+ ++r.fileIdCounter;p.setAttribute("data-ln-upload-local-id",b);const m=p.querySelector('[data-ln-field="name"]'),A=p.querySelector('[data-ln-field="sizeText"]'),g=p.getAttribute("data-ln-upload-size"),h=g?parseInt(g,10):null;r.uploadedFiles.set(b,{serverId:w||null,name:m?m.textContent.trim():"",size:h!==null&&!isNaN(h)?h:A?A.textContent.trim():""})}const c=this.dom.querySelectorAll('input[type="hidden"]');for(let f=0;f<c.length;f++){const p=c[f];if(p.name===r.idsFieldName&&p.value&&!Array.from(r.uploadedFiles.values()).some(function(b){return String(b.serverId)===String(p.value)})){const b="file-"+ ++r.fileIdCounter;r.uploadedFiles.set(b,{serverId:p.value,name:"",size:""})}}this._syncHiddenInputs()},l.prototype._syncHiddenInputs=function(){const r=this,a=this.dom.querySelectorAll('input[type="hidden"]');for(let c=0;c<a.length;c++)a[c].name===r.idsFieldName&&a[c].remove();for(const[,c]of this.uploadedFiles)if(c.serverId){const f=document.createElement("input");f.type="hidden",f.name=r.idsFieldName,f.value=c.serverId,r.dom.appendChild(f)}},l.prototype._bindEvents=function(){const r=this;this._onZoneClick=function(a){r.zone===r.dom&&a.target.closest("[data-ln-upload-list], [data-ln-upload-action], input, button, a")||r.input&&a.target!==r.input&&r.input.click()},this._onInputChange=function(){r.input&&r.input.files&&(r.upload(r.input.files),r.input.value="")},this._onDragEnter=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth++,r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragOver=function(a){a.preventDefault(),a.stopPropagation(),r.zone.setAttribute("data-ln-upload-state","dragover")},this._onDragLeave=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth--,r._dragDepth<=0&&(r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"))},this._onDrop=function(a){a.preventDefault(),a.stopPropagation(),r._dragDepth=0,r.zone.removeAttribute("data-ln-upload-state"),a.dataTransfer&&a.dataTransfer.files&&r.upload(a.dataTransfer.files)},this._onListClick=function(a){const c=a.target.closest('[data-ln-upload-action="remove"]');if(!c||!r.list||!r.list.contains(c)||c.disabled)return;const f=c.closest("[data-ln-upload-item]");if(f){const p=f.getAttribute("data-ln-upload-local-id");p&&r.remove(p)}},this._onRequestUpload=function(a){a.detail&&a.detail.files&&r.upload(a.detail.files)},this._onRequestRemove=function(a){if(a.detail){const c=a.detail.localId!==void 0?a.detail.localId:a.detail.serverId;c!==void 0&&r.remove(c)}},this._onRequestClear=function(){r.clear()},this.zone.addEventListener("click",this._onZoneClick),this.input&&this.input.addEventListener("change",this._onInputChange),this.zone.addEventListener("dragenter",this._onDragEnter),this.zone.addEventListener("dragover",this._onDragOver),this.zone.addEventListener("dragleave",this._onDragLeave),this.zone.addEventListener("drop",this._onDrop),this.list&&this.list.addEventListener("click",this._onListClick),this.dom.addEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.addEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.addEventListener("ln-upload:request-clear",this._onRequestClear)},l.prototype.upload=function(r){const a=this,c=Array.from(r);for(let f=0;f<c.length;f++){const p=c[f];if(a.maxFiles>0&&a.uploadedFiles.size>=a.maxFiles){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-files"});continue}if(!Me(p,a.allowedExts)){v(a.dom,"ln-upload:invalid",{file:p,reason:"accept"});continue}if(a.maxSize>0&&p.size>a.maxSize){v(a.dom,"ln-upload:invalid",{file:p,reason:"max-size"});continue}F(a.dom,"ln-upload:before-upload",{file:p}).defaultPrevented||a._uploadSingleFile(p)}},l.prototype._uploadSingleFile=function(r){const a=this,c="file-"+ ++a.fileIdCounter,f=re(r.name);let p=null;if(this.list){const g=me(this.dom,"ln-upload-item","ln-upload");if(g&&(p=g.firstElementChild,p)){p.setAttribute("data-ln-upload-item",""),p.setAttribute("data-ln-upload-local-id",c),p.setAttribute("data-ln-upload-ext",f),p.setAttribute("data-ln-upload-state","uploading"),x(p,{name:r.name,sizeText:"0%",removeLabel:a.dict.remove||"Remove",uploading:!0,error:!1,deleting:!1});const h=p.querySelector('[data-ln-upload-action="remove"]');h&&(h.disabled=!0);const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress","0"),a.list.appendChild(p)}}const w=new FormData;w.append(a.fileFieldName,r);const b=this.dom.querySelectorAll("input, select, textarea");for(let g=0;g<b.length;g++){const h=b[g];!h.name||h.name===a.idsFieldName||h.type==="file"||(h.type==="checkbox"||h.type==="radio")&&!h.checked||w.append(h.name,h.value)}const m=new XMLHttpRequest;a.uploadedFiles.set(c,{serverId:null,name:r.name,size:r.size,xhr:m}),m.upload.addEventListener("progress",function(g){if(g.lengthComputable){const h=Math.round(g.loaded/g.total*100);if(p){const y=p.querySelector("[data-ln-progress]");y&&y.setAttribute("data-ln-progress",String(h)),x(p,{sizeText:h+"%"})}v(a.dom,"ln-upload:progress",{localId:c,file:r,percent:h,loaded:g.loaded,total:g.total})}}),m.addEventListener("load",function(){const g=a.uploadedFiles.get(c);if(g&&delete g.xhr,m.status>=200&&m.status<300){let h;try{h=JSON.parse(m.responseText)}catch(C){A(a.dict.error||"Error",m.status,C);return}const y=h.id||h.serverId;if(p){p.removeAttribute("data-ln-upload-state"),y&&p.setAttribute("data-ln-upload-id",String(y)),x(p,{sizeText:s(h.size||r.size,a.locale,a.dict),uploading:!1});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}g&&(g.serverId=y,g.size=h.size||r.size,g.name=h.name||r.name),a._syncHiddenInputs(),v(a.dom,"ln-upload:uploaded",{localId:c,serverId:y,name:h.name||r.name,size:h.size||r.size,response:h})}else{let h="";try{h=JSON.parse(m.responseText).message||""}catch{}A(h,m.status,null)}}),m.addEventListener("error",function(){const g=a.uploadedFiles.get(c);g&&delete g.xhr,A("",0,null)});function A(g,h,y){if(p){p.setAttribute("data-ln-upload-state","error"),x(p,{sizeText:a.dict.error||"Error",uploading:!1,error:!0});const C=p.querySelector('[data-ln-upload-action="remove"]');C&&(C.disabled=!1)}v(a.dom,"ln-upload:error",{file:r,message:g,status:h,error:y})}a.uploadUrl?(m.open("POST",a.uploadUrl),m.setRequestHeader("X-CSRF-TOKEN",d()),m.setRequestHeader("X-Requested-With","XMLHttpRequest"),m.setRequestHeader("Accept","application/json"),m.send(w)):console.warn("[ln-upload] No upload URL configured (missing data-ln-upload)")},l.prototype.remove=function(r){const a=this;let c=null,f=null;if(a.uploadedFiles.has(r))c=r,f=a.uploadedFiles.get(r);else for(const[m,A]of a.uploadedFiles)if(String(A.serverId)===String(r)){c=m,f=A;break}if(!c||!f||F(a.dom,"ln-upload:before-remove",{localId:c,serverId:f.serverId}).defaultPrevented)return;const w=a.list?a.list.querySelector('[data-ln-upload-local-id="'+c+'"]'):null;if(f.xhr&&typeof f.xhr.abort=="function"&&f.xhr.abort(),!f.serverId){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:null});return}let b=null;if(a.deleteUrlPattern?b=a.deleteUrlPattern.replace("{id}",encodeURIComponent(f.serverId)):a.uploadUrl&&a.uploadUrl.includes("{id}")&&(b=a.uploadUrl.replace("{id}",encodeURIComponent(f.serverId))),!b){w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId});return}w&&(w.setAttribute("data-ln-upload-state","deleting"),x(w,{deleting:!0})),fetch(b,{method:"DELETE",headers:{"X-CSRF-TOKEN":d(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(function(m){m.ok?(w&&w.remove(),a.uploadedFiles.delete(c),a._syncHiddenInputs(),v(a.dom,"ln-upload:removed",{localId:c,serverId:f.serverId})):(w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:m.status}))}).catch(function(m){w&&(w.removeAttribute("data-ln-upload-state"),x(w,{deleting:!1})),v(a.dom,"ln-upload:error",{file:f,message:"",status:0,error:m})})},l.prototype.clear=function(){const r=this;if(!F(r.dom,"ln-upload:before-clear",{}).defaultPrevented){for(const[,c]of this.uploadedFiles)if(c.xhr&&typeof c.xhr.abort=="function"&&c.xhr.abort(),c.serverId){let f=null;r.deleteUrlPattern?f=r.deleteUrlPattern.replace("{id}",encodeURIComponent(c.serverId)):r.uploadUrl&&r.uploadUrl.includes("{id}")&&(f=r.uploadUrl.replace("{id}",encodeURIComponent(c.serverId))),f&&fetch(f,{method:"DELETE",headers:{"X-CSRF-TOKEN":d(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).catch(function(){})}r.uploadedFiles.clear(),r.list&&(r.list.innerHTML=""),r._syncHiddenInputs(),v(r.dom,"ln-upload:cleared",{})}},l.prototype.getFileIds=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return r.serverId}).filter(Boolean)},l.prototype.getFiles=function(){return Array.from(this.uploadedFiles.values()).map(function(r){return{serverId:r.serverId,name:r.name,size:r.size}})},l.prototype.destroy=function(){if(this.dom[t]){for(const[,r]of this.uploadedFiles)r.xhr&&typeof r.xhr.abort=="function"&&r.xhr.abort();this.zone.removeEventListener("click",this._onZoneClick),this.input&&this.input.removeEventListener("change",this._onInputChange),this.zone.removeEventListener("dragenter",this._onDragEnter),this.zone.removeEventListener("dragover",this._onDragOver),this.zone.removeEventListener("dragleave",this._onDragLeave),this.zone.removeEventListener("drop",this._onDrop),this.list&&this.list.removeEventListener("click",this._onListClick),this.dom.removeEventListener("ln-upload:request-upload",this._onRequestUpload),this.dom.removeEventListener("ln-upload:request-remove",this._onRequestRemove),this.dom.removeEventListener("ln-upload:request-clear",this._onRequestClear),this.uploadedFiles.clear(),this.dict={},delete this.dom[t]}},ne(e,t,l,"ln-upload",{attributes:o})})()})();
|