@livenetworks/ashlar 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/src/ln-autoresize.js +3 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/lifecycle.js +33 -12
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +22 -13
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-dropdown/src/ln-dropdown.js +18 -5
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/src/ln-editor.js +45 -12
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +1 -1
- package/components/ln-filter/src/ln-filter.js +11 -10
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/src/ln-form.js +11 -0
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +14 -5
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +22 -12
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-popover/src/ln-popover.js +22 -5
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-search/src/ln-search.js +9 -5
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/src/ln-sortable.js +52 -7
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/src/ln-tabs.js +12 -8
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/src/ln-time.js +17 -7
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/src/ln-validate.js +21 -7
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
-
"component": "ln-dropdown",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-dropdown-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-dropdown": {
|
|
13
|
-
"direction": null,
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-dropdown-dev.scss",
|
|
16
|
-
"ln-dropdown.scss",
|
|
17
|
-
"src/ln-dropdown.js"
|
|
18
|
-
],
|
|
19
|
-
"type": "marker",
|
|
20
|
-
"description": "Initializes the dropdown container"
|
|
21
|
-
},
|
|
22
|
-
"data-ln-dropdown-menu": {
|
|
23
|
-
"direction": "runtime",
|
|
24
|
-
"sources": [
|
|
25
|
-
"ln-dropdown.scss",
|
|
26
|
-
"src/ln-dropdown.js"
|
|
27
|
-
],
|
|
28
|
-
"type": "marker",
|
|
29
|
-
"description": "Dropdown menu element containing items"
|
|
30
|
-
},
|
|
31
|
-
"data-ln-dropdown-placement": {
|
|
32
|
-
"direction": "
|
|
33
|
-
"sources": [
|
|
34
|
-
"src/ln-dropdown.js"
|
|
35
|
-
],
|
|
36
|
-
"type": "enum",
|
|
37
|
-
"values": [
|
|
38
|
-
"top",
|
|
39
|
-
"top-start",
|
|
40
|
-
"top-end",
|
|
41
|
-
"bottom",
|
|
42
|
-
"bottom-start",
|
|
43
|
-
"bottom-end",
|
|
44
|
-
"left",
|
|
45
|
-
"left-start",
|
|
46
|
-
"left-end",
|
|
47
|
-
"right",
|
|
48
|
-
"right-start",
|
|
49
|
-
"right-end"
|
|
50
|
-
],
|
|
51
|
-
"description": "Active calculated placement applied at runtime"
|
|
52
|
-
},
|
|
53
|
-
"data-ln-dropdown-position": {
|
|
54
|
-
"direction": null,
|
|
55
|
-
"sources": [
|
|
56
|
-
"src/ln-dropdown.js"
|
|
57
|
-
],
|
|
58
|
-
"type": "enum",
|
|
59
|
-
"values": [
|
|
60
|
-
"top",
|
|
61
|
-
"top-start",
|
|
62
|
-
"top-end",
|
|
63
|
-
"bottom",
|
|
64
|
-
"bottom-start",
|
|
65
|
-
"bottom-end",
|
|
66
|
-
"left",
|
|
67
|
-
"left-start",
|
|
68
|
-
"left-end",
|
|
69
|
-
"right",
|
|
70
|
-
"right-start",
|
|
71
|
-
"right-end"
|
|
72
|
-
],
|
|
73
|
-
"description": "Preferred positioning anchor"
|
|
74
|
-
},
|
|
75
|
-
"data-ln-toggle": {
|
|
76
|
-
"direction": "both",
|
|
77
|
-
"sources": [
|
|
78
|
-
"ln-dropdown-dev.scss",
|
|
79
|
-
"src/ln-dropdown.js"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
"data-ln-toggle-for": {
|
|
83
|
-
"direction": "author",
|
|
84
|
-
"sources": [
|
|
85
|
-
"ln-dropdown-dev.scss",
|
|
86
|
-
"src/ln-dropdown.js"
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
+
"component": "ln-dropdown",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-dropdown-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-dropdown": {
|
|
13
|
+
"direction": null,
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-dropdown-dev.scss",
|
|
16
|
+
"ln-dropdown.scss",
|
|
17
|
+
"src/ln-dropdown.js"
|
|
18
|
+
],
|
|
19
|
+
"type": "marker",
|
|
20
|
+
"description": "Initializes the dropdown container"
|
|
21
|
+
},
|
|
22
|
+
"data-ln-dropdown-menu": {
|
|
23
|
+
"direction": "runtime",
|
|
24
|
+
"sources": [
|
|
25
|
+
"ln-dropdown.scss",
|
|
26
|
+
"src/ln-dropdown.js"
|
|
27
|
+
],
|
|
28
|
+
"type": "marker",
|
|
29
|
+
"description": "Dropdown menu element containing items"
|
|
30
|
+
},
|
|
31
|
+
"data-ln-dropdown-placement": {
|
|
32
|
+
"direction": "both",
|
|
33
|
+
"sources": [
|
|
34
|
+
"src/ln-dropdown.js"
|
|
35
|
+
],
|
|
36
|
+
"type": "enum",
|
|
37
|
+
"values": [
|
|
38
|
+
"top",
|
|
39
|
+
"top-start",
|
|
40
|
+
"top-end",
|
|
41
|
+
"bottom",
|
|
42
|
+
"bottom-start",
|
|
43
|
+
"bottom-end",
|
|
44
|
+
"left",
|
|
45
|
+
"left-start",
|
|
46
|
+
"left-end",
|
|
47
|
+
"right",
|
|
48
|
+
"right-start",
|
|
49
|
+
"right-end"
|
|
50
|
+
],
|
|
51
|
+
"description": "Active calculated placement applied at runtime"
|
|
52
|
+
},
|
|
53
|
+
"data-ln-dropdown-position": {
|
|
54
|
+
"direction": null,
|
|
55
|
+
"sources": [
|
|
56
|
+
"src/ln-dropdown.js"
|
|
57
|
+
],
|
|
58
|
+
"type": "enum",
|
|
59
|
+
"values": [
|
|
60
|
+
"top",
|
|
61
|
+
"top-start",
|
|
62
|
+
"top-end",
|
|
63
|
+
"bottom",
|
|
64
|
+
"bottom-start",
|
|
65
|
+
"bottom-end",
|
|
66
|
+
"left",
|
|
67
|
+
"left-start",
|
|
68
|
+
"left-end",
|
|
69
|
+
"right",
|
|
70
|
+
"right-start",
|
|
71
|
+
"right-end"
|
|
72
|
+
],
|
|
73
|
+
"description": "Preferred positioning anchor"
|
|
74
|
+
},
|
|
75
|
+
"data-ln-toggle": {
|
|
76
|
+
"direction": "both",
|
|
77
|
+
"sources": [
|
|
78
|
+
"ln-dropdown-dev.scss",
|
|
79
|
+
"src/ln-dropdown.js"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"data-ln-toggle-for": {
|
|
83
|
+
"direction": "author",
|
|
84
|
+
"sources": [
|
|
85
|
+
"ln-dropdown-dev.scss",
|
|
86
|
+
"src/ln-dropdown.js"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -188,15 +188,19 @@ import { dispatch, computePlacement, measureHidden, registerComponent, defineAtt
|
|
|
188
188
|
// ─── Positioning ───────────────────────────────────────────
|
|
189
189
|
|
|
190
190
|
_component.prototype._reposition = function () {
|
|
191
|
-
if (!this.triggerBtn || !this.toggleEl) return;
|
|
191
|
+
if (!this.triggerBtn || !this.toggleEl || !document.contains(this.toggleEl)) return;
|
|
192
192
|
const rect = this.triggerBtn.getBoundingClientRect();
|
|
193
193
|
const size = measureHidden(this.toggleEl);
|
|
194
194
|
const gap = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--size-xs')) * 16 || 4;
|
|
195
195
|
const position = this.position || DEFAULT_POSITION;
|
|
196
196
|
const p = computePlacement(rect, size, position, gap);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this.toggleEl.
|
|
197
|
+
const topStr = p.top + 'px';
|
|
198
|
+
const leftStr = p.left + 'px';
|
|
199
|
+
if (this.toggleEl.style.top !== topStr) this.toggleEl.style.top = topStr;
|
|
200
|
+
if (this.toggleEl.style.left !== leftStr) this.toggleEl.style.left = leftStr;
|
|
201
|
+
if (this.toggleEl.getAttribute('data-ln-dropdown-placement') !== p.placement) {
|
|
202
|
+
this.toggleEl.setAttribute('data-ln-dropdown-placement', p.placement);
|
|
203
|
+
}
|
|
200
204
|
};
|
|
201
205
|
|
|
202
206
|
// ─── Outside click ─────────────────────────────────────────
|
|
@@ -232,13 +236,22 @@ import { dispatch, computePlacement, measureHidden, registerComponent, defineAtt
|
|
|
232
236
|
|
|
233
237
|
_component.prototype._addScrollRepositionListener = function () {
|
|
234
238
|
const self = this;
|
|
239
|
+
this._scrollRepositionRaf = null;
|
|
235
240
|
this._boundScrollReposition = function () {
|
|
236
|
-
self.
|
|
241
|
+
if (self._scrollRepositionRaf) return;
|
|
242
|
+
self._scrollRepositionRaf = requestAnimationFrame(function () {
|
|
243
|
+
self._scrollRepositionRaf = null;
|
|
244
|
+
self._reposition();
|
|
245
|
+
});
|
|
237
246
|
};
|
|
238
247
|
window.addEventListener('scroll', this._boundScrollReposition, { passive: true, capture: true });
|
|
239
248
|
};
|
|
240
249
|
|
|
241
250
|
_component.prototype._removeScrollRepositionListener = function () {
|
|
251
|
+
if (this._scrollRepositionRaf) {
|
|
252
|
+
cancelAnimationFrame(this._scrollRepositionRaf);
|
|
253
|
+
this._scrollRepositionRaf = null;
|
|
254
|
+
}
|
|
242
255
|
if (this._boundScrollReposition) {
|
|
243
256
|
window.removeEventListener('scroll', this._boundScrollReposition, { capture: true });
|
|
244
257
|
this._boundScrollReposition = null;
|
|
@@ -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 N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!N(n))return}e.apply(console,t)}}function x(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function ue(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(l),l}function 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 de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let d=0;d<o.options.length;d++)o.options[d].selected&&l[o.name].push(o.options[d].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const d=Number(o.value);l[o.name]=o.value===""||isNaN(d)?null:d}else l[o.name]=o.value}return l}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const d=String(o).split(",").map(function(C){return C.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=he(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let d=0;d<i.options.length;d++)i.options[d].selected=o.indexOf(i.options[d].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const j={};function pe(e,t){j[e]=t}function be(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function ge(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ge,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=me);const q={};function U(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function _e(e,t,r){if(e){const n=e.querySelector('[data-ln-template="'+t+'"]');if(n)return n.content.cloneNode(!0)}return U(t,r)}function W(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<o.length;d++){const C=o[d].trim().split(":");if(C.length!==2)continue;const m=C[0].trim(),v=C[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let d=0;d<o.length;d++){const C=o[d].trim().split(":");if(C.length!==2)continue;const m=C[0].trim(),v=C[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function K(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const d=c[o];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ve(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const d=e.children[o],C=d.getAttribute("data-ln-render-key");C&&(i[C]=d)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const d=t[o],C=String(n(d));let m=i[C];if(m)l(m,d,o);else{const v=U(r,s);if(!v||(K(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",C),l(m,d,o)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=W,window.lnCore.lnFill=ye,window.lnCore.renderList=ve);function M(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function V(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function Q(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const I=new Map;function J(e,t){const r=(e?e.join("|"):"")+"::"+t;if(I.has(r))return I.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return I.set(r,l),l}function G(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function X(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function Y(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ae(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function xe(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=J(n.values,n.fallback);break;case"integer":l=V;break;case"float":l=G;break;case"boolean":l=Q;break;case"list":l=z;break;case"json":l=X;break;case"string":default:l=M;break}l||(l=M),t[n.prop]=[l,r,n.fallback]}return t}function ke(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function Se(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ae,window.lnCore.attrSpec=xe,window.lnCore.attrStr=M,window.lnCore.attrInt=V,window.lnCore.attrBool=Q,window.lnCore.attrList=z,window.lnCore.attrEnum=J,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Z(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&S(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)S(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ee(e){const t=ee(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=Se(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=ee(),l=n.byAttr.get(t),s=$()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&N(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let d=0;d<c.length;d++)Y(c[d].spec,o,t,c[d].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&te(c,i,t,e.oldValue),n.reactiveWildcard.length&&te(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(Z(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ne(e){const t=B();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&S(n,i);else if(n.matches&&n.matches(i.query)&&S(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)S(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&F(n,i);else if(n.matches&&n.matches(c)&&F(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let d=0;d<o.length;d++)F(o[d],i)}}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{Ne(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function qe(e){B().push(e),ne()}function re(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,d=l.onAttrChange||null,C=l.effects||null,m=l.attributes||null,v=m?ke(m):C,H=m?new Set(Object.keys(m)):null,O=l.persist||null;function k(h){const b=h||document.body;if(Z(b,e,t,r),m&&$())for(const p in m){const _=m[p],w=Array.from(b.querySelectorAll("["+p+"]"));b.matches&&b.matches("["+p+"]")&&w.push(b);for(let g=0;g<w.length;g++){const A=w[g];N(A)&&Y(_,A.getAttribute(p),p,n,A)}}o&&o(b)}const L=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let b;for(;(b=h.exec(e))!==null;)L.push(b[1])}else L.push(e);Ee({selector:e,attribute:t,componentTag:n,attributes:m,ComponentFn:r,onInit:o,observed:L.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:H,persist:O}),De();const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=l.subtreeQuery||(a?e:"["+e+"]");B().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:u}),ne(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=qe);function f(){Le()>0?Te(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),k}function oe(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,r={},n=oe(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(d)}catch{r[o]=d}}return r}function Me(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const r=R();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");oe(location.hash)!==l&&(location.hash=l)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Fe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(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 je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=Me,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=He,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=je);function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Pe),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},n={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},l={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function o(a){return!!(l[a]||s[a]||i[a]||a==="link")}function d(a){this.dom=a;const u=this;if(this._textarea=a.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",a),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const w=a.querySelector('label[for="'+h+'"]');w&&(w.id||(w.id=h+"-label"),this._surface.setAttribute("aria-labelledby",w.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const b=this._textarea.value.trim();b&&(this._surface.innerHTML=b);const p=a.querySelector('[role="toolbar"]');if(p&&p.nextSibling?a.insertBefore(this._surface,p.nextSibling):a.appendChild(this._surface),p){p.setAttribute("aria-controls",this._surface.id);const w=p.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<w.length;g++){const A=w[g].getAttribute("data-ln-editor-action");o(A)&&w[g].setAttribute("aria-pressed","false")}}this._onInput=function(){u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom})},this._onMousedownToolbar=function(w){w.target.closest("[data-ln-editor-action]")&&w.preventDefault()},this._onClickToolbar=function(w){const g=w.target.closest("[data-ln-editor-action]");if(!g)return;const A=g.getAttribute("data-ln-editor-action");u._execAction(A)},this._onPaste=function(w){v(u,w)},this._onKeydown=function(w){k(u,w)},this._onSelectionChange=function(){document.contains(u._surface)&&u._updateActiveStates()},this._onFocus=function(){x(u.dom,"ln-editor:focus",{target:u.dom})},this._onBlur=function(){u._syncToTextarea(),x(u.dom,"ln-editor:blur",{target:u.dom})},this._onTextareaInput=function(){u._surface.innerHTML!==u._textarea.value&&(u._surface.innerHTML=u._textarea.value,x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),p&&(p.addEventListener("mousedown",this._onMousedownToolbar),p.addEventListener("click",this._onClickToolbar)),document.addEventListener("selectionchange",this._onSelectionChange),this._onSetContent=function(w){const g=w.detail&&w.detail.html;g!==void 0&&(u._surface.innerHTML=g,u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},a.addEventListener("ln-editor:set-content",this._onSetContent);const _=this._textarea.form;return _&&(this._onFormReset=function(){setTimeout(function(){u._surface.innerHTML=u._textarea.value,x(a,"ln-editor:changed",{html:u._textarea.value,target:a})},0)},_.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(a){if(!(!a||ue(this.dom,"ln-editor:before-change",{action:a,target:this.dom}).defaultPrevented)){if(this._surface.focus(),l[a])document.execCommand(l[a],!1,null);else if(s[a]){const f=s[a],h=C(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[a]?document.execCommand(i[a],!1,null):a==="link"?L(this):a==="unlink"?document.execCommand("unlink",!1,null):a==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const a=this.dom.querySelector('[role="toolbar"]');if(!a)return;const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=u.anchorNode;if(!f||!this._surface.contains(f))return;const h=a.querySelectorAll("[data-ln-editor-action]");for(let b=0;b<h.length;b++){const p=h[b],_=p.getAttribute("data-ln-editor-action");let w=!1;if(l[_])try{w=document.queryCommandState(l[_])}catch{}else if(s[_]){const g=C(this._surface);w=g&&g.toLowerCase()===s[_]}else if(i[_])try{w=document.queryCommandState(i[_])}catch{}else _==="link"&&(w=!!m(u.anchorNode,"A",this._surface));o(_)&&p.setAttribute("aria-pressed",String(w)),w?p.classList.add("ln-editor-active"):p.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(a){this._surface&&(this._surface.innerHTML=a,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const a=this.dom.querySelector('[role="toolbar"]');a&&(a.removeEventListener("mousedown",this._onMousedownToolbar),a.removeEventListener("click",this._onClickToolbar)),document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const u=this._textarea?this._textarea.form:null;if(u&&this._onFormReset&&u.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function C(a){const u=window.getSelection();if(!u||u.rangeCount===0)return null;let f=u.anchorNode;if(!f)return null;for(;f&&f!==a;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(a,u,f){for(;a&&a!==f;){if(a.nodeType===1&&a.tagName===u)return a;a=a.parentNode}return null}function v(a,u){u.preventDefault();let f="";if(u.clipboardData&&(f=u.clipboardData.getData("text/html"),!f)){const b=u.clipboardData.getData("text/plain");b&&(f=b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=H(f);h&&document.execCommand("insertHTML",!1,h)}function H(a){const u=document.createElement("div");return u.innerHTML=a,O(u),u.innerHTML}function O(a){const u=Array.from(a.childNodes);for(let f=0;f<u.length;f++){const h=u[f];if(h.nodeType!==3){if(h.nodeType!==1){a.removeChild(h);continue}if(n[h.tagName]){const b=Array.from(h.attributes);for(let p=0;p<b.length;p++){const _=b[p].name;if(h.tagName==="A"&&_==="href"){const w=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(w)||h.removeAttribute("href")}else h.removeAttribute(_)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),O(h)}else{for(;h.firstChild;)a.insertBefore(h.firstChild,h);a.removeChild(h)}}}}function k(a,u){if(!(u.ctrlKey||u.metaKey))return;let f=null;switch(u.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(u.preventDefault(),a._execAction(f))}function L(a){const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=m(u.anchorNode,"A",a._surface),h=u.getRangeAt(0).cloneRange();a._closeLinkPopover&&a._closeLinkPopover();const b=_e(a.dom,"ln-editor-link-popover","ln-editor");if(!b)return;const p=b.firstElementChild;if(!p)return;const _=p.querySelector('input[type="url"]'),w=p.querySelector('[data-ln-editor-action="confirm-link"]'),g=p.querySelector('[data-ln-editor-action="cancel-link"]');f&&(_.value=f.getAttribute("href")||"");const A=a.dom.querySelector('[role="toolbar"]');A?A.after(p):a.dom.insertBefore(p,a._surface),_.focus();function ie(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function D(){document.removeEventListener("mousedown",ae),a._closeLinkPopover=null,p.remove()}function le(){const y=_.value.trim();if(D(),ie(),a._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ce=m(T.anchorNode,"A",a._surface);ce&&(ce.setAttribute("rel","noopener noreferrer"),a._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function se(){D(),ie(),a._surface.focus()}function Ue(){D()}function ae(y){const T=a.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!p.contains(y.target)&&!T&&Ue()}a._closeLinkPopover=D,w.addEventListener("click",le),g.addEventListener("click",se),_.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),le()):y.key==="Escape"&&(y.preventDefault(),se())}),document.addEventListener("mousedown",ae)}re(e,t,d,"ln-editor",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function P(){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 N(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 o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!N(l))return}e.apply(console,t)}}function x(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function de(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function O(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function fe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function he(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[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")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[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 d=0;d<n.options.length;d++)n.options[d].selected&&o[n.name].push(n.options[d].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const d=Number(n.value);o[n.name]=n.value===""||isNaN(d)?null:d}else o[n.name]=n.value}return o}function we(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function pe(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(n).split(",").map(function(b){return b.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=we(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let d=0;d<i.options.length;d++)i.options[d].selected=n.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pe,window.lnCore.serializeForm=he,window.lnCore.resolveFormMethod=fe);const U={};function be(e,t){U[e]=t}function me(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=be,window.lnCore.getDataMapper=me);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];W[r]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=_e,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=ge);const M={};function K(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=M[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ye(e,t,r){if(e){const l=e.querySelector('[data-ln-template="'+t+'"]');if(l)return l.content.cloneNode(!0)}return K(t,r)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function ve(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[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)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function Q(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let n=0;n<c.length;n++){const d=c[n];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Ae(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const d=e.children[n],b=d.getAttribute("data-ln-render-key");b&&(i[b]=d)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const d=t[n],b=String(l(d));let m=i[b];if(m)o(m,d,n);else{const v=K(r,s);if(!v||(Q(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),o(m,d,n)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=V,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function I(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function z(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function J(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const B=new Map;function X(e,t){const r=(e?e.join("|"):"")+"::"+t;if(B.has(r))return B.get(r);const l=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&l.has(c)?c:t};return B.set(r,o),o}function Y(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Z(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function ee(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function Se(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=X(l.values,l.fallback);break;case"integer":o=z;break;case"float":o=Y;break;case"boolean":o=J;break;case"list":o=G;break;case"json":o=Z;break;case"string":default:o=I;break}o||(o=I),t[l.prop]=[o,r,l.fallback]}return t}function ke(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function Le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=xe,window.lnCore.attrSpec=Se,window.lnCore.attrStr=I,window.lnCore.attrInt=z,window.lnCore.attrBool=J,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function te(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&L(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)L(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(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 ne(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=ne(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Le(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function De(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=ne(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&N(i)){const c=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let d=0;d<c.length;d++)ee(c[d].spec,n,t,c[d].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&re(c,i,t,e.oldValue),l.reactiveWildcard.length&&re(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(te(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function qe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{De(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ne(e){const t=F();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=R();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&L(s,n);else if(s.matches&&s.matches(n.query)&&L(s,n),s.querySelectorAll){const d=s.querySelectorAll(n.query);for(let b=0;b<d.length;b++)L(d[b],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],d=n.query;if(d){if(!i)s.matches&&s.matches(d)&&H(s,n);else if(s.matches&&s.matches(d)&&H(s,n),s.querySelectorAll){const b=s.querySelectorAll(d);for(let m=0;m<b.length;m++)H(b[m],n)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{Ne(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){F().push(e),e.onSubtreeChange&&e.query&&R().push(e),oe()}function ie(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,d=o.onAttrChange||null,b=o.effects||null,m=o.attributes||null,v=m?ke(m):b,j=m?new Set(Object.keys(m)):null,D=o.persist||null;function S(C){const w=C||document.body;if(te(w,e,t,r),m&&P())for(const g in m){const p=m[g],_=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&_.push(w);for(let A=0;A<_.length;A++){const k=_[A];N(k)&&ee(p,k.getAttribute(g),g,l,k)}}n&&n(w)}const E=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let w;for(;(w=C.exec(e))!==null;)E.push(w[1])}else E.push(e);Oe({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:r,onInit:n,observed:E.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:j,persist:D}),qe();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:a};F().push(f),c&&a&&R().push(f),oe(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Me);function h(){Ee()>0?Te(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),S}function le(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,r={},l=le(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(d)}catch{r[n]=d}}return r}function Ie(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Be(e,t){if(!e)return;const r=$();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");le(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const 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 He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function $e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function je(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Ie,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=He,window.lnCore.hashSortDecode=$e,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Pe);function Ue(){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=Ue),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},l={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function n(u){return!!(o[u]||s[u]||i[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const p=u.querySelector('label[for="'+h+'"]');p&&(p.id||(p.id=h+"-label"),this._surface.setAttribute("aria-labelledby",p.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const C=this._textarea.value.trim();C&&(this._surface.innerHTML=C);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const p=w.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<p.length;_++){const A=p[_].getAttribute("data-ln-editor-action");n(A)&&p[_].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const _=p.target.closest("[data-ln-editor-action]");if(!_)return;const A=_.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(p){v(a,p)},this._onKeydown=function(p){S(a,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(p){const _=p.detail&&p.detail.html;_!==void 0&&(a._surface.innerHTML=_,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},g.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||de(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[u])document.execCommand(o[u],!1,null);else if(s[u]){const f=s[u],h=b(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[u]?document.execCommand(i[u],!1,null):u==="link"?E(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<h.length;C++){const w=h[C],g=w.getAttribute("data-ln-editor-action");let p=!1;if(o[g])try{p=document.queryCommandState(o[g])}catch{}else if(s[g]){const _=b(this._surface);p=_&&_.toLowerCase()===s[g]}else if(i[g])try{p=document.queryCommandState(i[g])}catch{}else g==="link"&&(p=!!m(a.anchorNode,"A",this._surface));if(n(g)){const _=String(p);w.getAttribute("aria-pressed")!==_&&w.setAttribute("aria-pressed",_)}p?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function b(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const C=a.clipboardData.getData("text/plain");C&&(f=C.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=j(f);h&&document.execCommand("insertHTML",!1,h)}function j(u){const a=document.createElement("div");return a.innerHTML=u,D(a),a.innerHTML}function D(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(l[h.tagName]){const C=Array.from(h.attributes);for(let w=0;w<C.length;w++){const g=C[w].name;if(h.tagName==="A"&&g==="href"){const p=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(p)||h.removeAttribute("href")}else h.removeAttribute(g)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),D(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function E(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=m(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const C=ye(u.dom,"ln-editor-link-popover","ln-editor");if(!C)return;const w=C.firstElementChild;if(!w)return;const g=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),_=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(g.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),g.focus();function k(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function q(){document.removeEventListener("mousedown",ce),u._closeLinkPopover=null,w.remove()}function se(){const y=g.value.trim();if(q(),k(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ue=m(T.anchorNode,"A",u._surface);ue&&(ue.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ae(){q(),k(),u._surface.focus()}function We(){q()}function ce(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&We()}u._closeLinkPopover=q,p.addEventListener("click",se),_.addEventListener("click",ae),g.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),se()):y.key==="Escape"&&(y.preventDefault(),ae())}),document.addEventListener("mousedown",ce)}ie(e,t,d,"ln-editor",{attributes:r})})()})();
|
|
@@ -148,20 +148,44 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
148
148
|
_handleKeydown(self, e);
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
this._listeningSelection = false;
|
|
152
|
+
this._rafSelection = null;
|
|
153
|
+
|
|
151
154
|
this._onSelectionChange = function () {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
if (self._rafSelection) return;
|
|
156
|
+
self._rafSelection = requestAnimationFrame(function () {
|
|
157
|
+
self._rafSelection = null;
|
|
158
|
+
if (!document.contains(self._surface)) return;
|
|
159
|
+
self._updateActiveStates();
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
this._attachSelection = function () {
|
|
164
|
+
if (!self._listeningSelection) {
|
|
165
|
+
self._listeningSelection = true;
|
|
166
|
+
document.addEventListener('selectionchange', self._onSelectionChange);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this._detachSelection = function () {
|
|
171
|
+
if (self._listeningSelection) {
|
|
172
|
+
self._listeningSelection = false;
|
|
173
|
+
document.removeEventListener('selectionchange', self._onSelectionChange);
|
|
174
|
+
}
|
|
175
|
+
if (self._rafSelection) {
|
|
176
|
+
cancelAnimationFrame(self._rafSelection);
|
|
177
|
+
self._rafSelection = null;
|
|
178
|
+
}
|
|
158
179
|
};
|
|
159
180
|
|
|
160
181
|
this._onFocus = function () {
|
|
182
|
+
self._attachSelection();
|
|
183
|
+
self._updateActiveStates();
|
|
161
184
|
dispatch(self.dom, 'ln-editor:focus', { target: self.dom });
|
|
162
185
|
};
|
|
163
186
|
|
|
164
187
|
this._onBlur = function () {
|
|
188
|
+
self._detachSelection();
|
|
165
189
|
// Sync on blur to ensure textarea is up-to-date
|
|
166
190
|
self._syncToTextarea();
|
|
167
191
|
dispatch(self.dom, 'ln-editor:blur', { target: self.dom });
|
|
@@ -190,8 +214,6 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
190
214
|
toolbar.addEventListener('click', this._onClickToolbar);
|
|
191
215
|
}
|
|
192
216
|
|
|
193
|
-
document.addEventListener('selectionchange', this._onSelectionChange);
|
|
194
|
-
|
|
195
217
|
// Request event — set content programmatically
|
|
196
218
|
this._onSetContent = function (e) {
|
|
197
219
|
const html = e.detail && e.detail.html;
|
|
@@ -310,12 +332,19 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
310
332
|
}
|
|
311
333
|
|
|
312
334
|
if (_isToggleAction(action)) {
|
|
313
|
-
|
|
335
|
+
const pressedStr = String(isActive);
|
|
336
|
+
if (btn.getAttribute('aria-pressed') !== pressedStr) {
|
|
337
|
+
btn.setAttribute('aria-pressed', pressedStr);
|
|
338
|
+
}
|
|
314
339
|
}
|
|
315
340
|
if (isActive) {
|
|
316
|
-
btn.classList.
|
|
341
|
+
if (!btn.classList.contains('ln-editor-active')) {
|
|
342
|
+
btn.classList.add('ln-editor-active');
|
|
343
|
+
}
|
|
317
344
|
} else {
|
|
318
|
-
btn.classList.
|
|
345
|
+
if (btn.classList.contains('ln-editor-active')) {
|
|
346
|
+
btn.classList.remove('ln-editor-active');
|
|
347
|
+
}
|
|
319
348
|
}
|
|
320
349
|
}
|
|
321
350
|
};
|
|
@@ -354,7 +383,11 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
354
383
|
toolbar.removeEventListener('click', this._onClickToolbar);
|
|
355
384
|
}
|
|
356
385
|
|
|
357
|
-
|
|
386
|
+
if (this._detachSelection) {
|
|
387
|
+
this._detachSelection();
|
|
388
|
+
} else {
|
|
389
|
+
document.removeEventListener('selectionchange', this._onSelectionChange);
|
|
390
|
+
}
|
|
358
391
|
this.dom.removeEventListener('ln-editor:set-content', this._onSetContent);
|
|
359
392
|
|
|
360
393
|
const form = this._textarea ? this._textarea.form : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){r=t[s];break}if(!A(r))return}e.apply(console,t)}}function p(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,s={},c=e.elements,i={};if(o)for(let l=0;l<c.length;l++){const n=c[l];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let l=0;l<c.length;l++){const n=c[l];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&s[n.name].push(n.options[a].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const a=Number(n.value);s[n.name]=n.value===""||isNaN(a)?null:a}else s[n.name]=n.value}return s}function R(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function j(e,t){const o=e.elements,r=[],s={};for(let c=0;c<o.length;c++){const i=o[c];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let c=0;c<o.length;c++){const i=o[c];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const l=i.getAttribute("data-ln-fill-as")||i.name;if(!l||!(l in t))continue;const n=t[l];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(s[i.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=R(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=j,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function W(e,t){x[e]=t}function V(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=W,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function H(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];k[o]=t}function J(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=J,window.lnCore.ensureLocaleObserver=U);const b={};function K(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=b[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const l=o[i],n=l.getAttribute("data-ln-field");t[n]!=null&&(l.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const l=r[i],n=l.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&l.setAttribute(d,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const l=s[i],n=l.getAttribute("data-ln-show");n in t&&l.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let i=0;i<c.length;i++){const l=c[i],n=l.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&l.classList.toggle(d,!!t[f])}}return e}function z(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(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 _(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const c=o.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,l){return t[l]!==void 0?t[l]:""}))}const r=function(c,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const i=s[c],l=i.attributes;for(let n=0;n<l.length;n++){const a=l[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,o,r,s,c){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const l=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(r(a));let d=i[u];if(d)s(d,a,n);else{const f=K(o,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),s(d,a,n)}l.appendChild(d)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=z,window.lnCore.renderList=G);function g(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function S(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function L(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function O(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const m=new Map;function E(e,t){const o=(e?e.join("|"):"")+"::"+t;if(m.has(o))return m.get(o);const r=new Set(e||[]),s=function(c,i){const l=c.getAttribute(i);return l!==null&&r.has(l)?l:t};return m.set(o,s),s}function D(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function F(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function P(e,t,o,r,s){if(!e||t===null)return!0;const c=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const l=n=>{s?console.warn(n,s):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(l(`[${c}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(l(`[${c}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return l(`[${c}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(l(`[${c}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(l(`[${c}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(l(`[${c}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return l(`[${c}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,o){for(const r in o){const[s,c,i]=o[r];Object.defineProperty(e,r,{get:function(){return s(t,c,i)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=E(r.values,r.fallback);break;case"integer":s=S;break;case"float":s=D;break;case"boolean":s=L;break;case"list":s=O;break;case"json":s=F;break;case"string":default:s=g;break}s||(s=g),t[r.prop]=[s,o,r.fallback]}return t}function Y(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=X,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=O,window.lnCore.attrEnum=E,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Z(e,t,o,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(c)&&h(e,i),e.querySelectorAll){const l=e.querySelectorAll(c);for(let n=0;n<l.length;n++)h(l[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){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 ee(e){const t=$(),o=e.observed||[];for(let r=0;r<o.length;r++){const s=o[r];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).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 s=t.byDeclaredAttr.get(r);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Y(e);if(r===null)t.reactiveWildcard.push(e);else for(const s of r)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function q(e,t,o,r){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const i=c.effects&&c.effects[o];i?i(t,o,r):c.onAttrChange&&(!c.declared||c.declared.has(o))&&c.onAttrChange(t,o,r)}}function te(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=$(),s=r.byAttr.get(t),c=T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!s&&!c)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(c&&A(i)){const l=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<l.length;a++)P(l[a].spec,n,t,l[a].componentTag,i)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const l=r.byReactive.get(t);l&&q(l,i,t,e.oldValue),r.reactiveWildcard.length&&q(r.reactiveWildcard,i,t,e.oldValue)}if(s)for(let l=0;l<s.length;l++){const n=s[l];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(Z(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{te(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function re(e){const t=I();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const s=r.query,c=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;c&&r.onSubtreeChange(c,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let c=0;c<t.length;c++){const i=t[c];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)r.matches&&r.matches(i.query)&&h(r,i);else if(r.matches&&r.matches(i.query)&&h(r,i),r.querySelectorAll){const l=r.querySelectorAll(i.query);for(let n=0;n<l.length;n++)h(l[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let c=0;c<t.length;c++){const i=t[c],l=i.query;if(l){if(!s)r.matches&&r.matches(l)&&C(r,i);else if(r.matches&&r.matches(l)&&C(r,i),r.querySelectorAll){const n=r.querySelectorAll(l);for(let a=0;a<n.length;a++)C(n[a],i)}}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{re(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t){ee({observed:e,handler:t}),ne()}function le(e){I().push(e),oe()}function N(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,o={},r=N(t);if(!r)return o;const s=r.split("&");for(let c=0;c<s.length;c++){const i=s[c];if(!i)continue;const l=i.indexOf(":"),n=l>-1?i.slice(0,l):i,a=l>-1?i.slice(l+1):"";if(n)try{o[n]=decodeURIComponent(a)}catch{o[n]=a}}return o}function se(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ce(e,t){if(!e)return;const o=y();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(c){const i=o[c];return i===""?c:c+":"+encodeURIComponent(i)}).join("&");N(location.hash)!==s&&(location.hash=s)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ue(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function de(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 we(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function he(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),s=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=se,window.lnCore.hashSet=ce,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ue,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=fe,window.lnCore.hashFilterEncode=we,window.lnCore.hashFilterDecode=he);function pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=pe),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(l){return l.hostname&&l.hostname!==window.location.hostname}function o(l){if(l.getAttribute("data-ln-external-link")==="processed"||!t(l))return;l.target="_blank";const n=(l.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),l.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",l.appendChild(a),l.setAttribute("data-ln-external-link","processed"),p(l,"ln-external-links:processed",{link:l,href:l.href})}function r(l){l=l||document.body;for(const n of l.querySelectorAll("a, area"))o(n)}function s(){w(function(){document.body.addEventListener("click",function(l){const n=l.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){le({onInit:function(l){if(l.matches&&(l.matches("a")||l.matches("area"))&&o(l),l.querySelectorAll)for(const n of l.querySelectorAll("a, area"))o(n)}}),ie(["href"],function(l){l.matches&&(l.matches("a")||l.matches("area"))&&o(l)})},"ln-external-links")}function i(){s(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r()}):r()}window[e]={process:r},i()})()})();
|
|
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 p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},c=e.elements,o={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[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")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function j(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function W(e,t){const r=e.elements,i=[],l={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=j(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=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function V(e,t){x[e]=t}function U(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=U);function H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function K(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function z(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const s=c[o],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 G(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const o=l[c],s=o.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function P(e,t,r,i,l,c){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(i(a));let d=o[u];if(d)l(d,a,n);else{const f=z(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=G,window.lnCore.renderList=P);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function S(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function L(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(c,o){const s=c.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function D(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function F(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Q(e,t,r,i,l){if(!e||t===null)return!0;const c=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,r){for(const i in r){const[l,c,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,c,o)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=O(i.values,i.fallback);break;case"integer":l=S;break;case"float":l=D;break;case"boolean":l=L;break;case"list":l=E;break;case"json":l=F;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function Z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ee(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,o),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){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 te(e){const t=$(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Z(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 q(e,t,r,i){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=$(),l=i.byAttr.get(t),c=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&A(o)){const s=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<s.length;a++)Q(s[a].spec,n,t,s[a].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&q(s,o,t,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(ee(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ne(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=I();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let l=0;l<i.length;l++){const c=i[l],o=c.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)c.matches&&c.matches(n.query)&&h(c,n);else if(c.matches&&c.matches(n.query)&&h(c,n),c.querySelectorAll){const a=c.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a){if(!o)c.matches&&c.matches(a)&&C(c,n);else if(c.matches&&c.matches(a)&&C(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)C(u[d],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t){te({observed:e,handler:t}),re()}function se(e){I().push(e),e.onSubtreeChange&&e.query&&N().push(e),ie()}function T(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},i=T(t);if(!i)return r;const l=i.split("&");for(let c=0;c<l.length;c++){const o=l[c];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,a=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ce(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");T(location.hash)!==l&&(location.hash=l)}function ue(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 r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(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 he(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=ce,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=ue,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=he,window.lnCore.hashFilterDecode=pe);function be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=be),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){se({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),le(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function o(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
|