@livenetworks/ashlar 2.0.7 → 2.0.9
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/LICENSE +641 -641
- package/components/COMPONENTS.md +1116 -1116
- package/components/index.js +81 -81
- package/components/ln-accordion/ln-accordion-dev.scss +8 -8
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-accordion/ln-accordion.schema.json +30 -30
- package/components/ln-ajax/ln-ajax-dev.scss +8 -8
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/ln-ajax.schema.json +30 -30
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-connector/ln-api-connector.schema.json +9 -0
- package/components/ln-api-connector/src/ln-api-connector.js +2 -0
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -34
- package/components/ln-api-queue/src/ln-api-queue.js +3 -13
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -8
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -22
- package/components/ln-autosave/ln-autosave-dev.scss +13 -13
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-autosave/ln-autosave.schema.json +48 -48
- package/components/ln-autosave/src/autosave-model.js +34 -34
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-chart/ln-chart.schema.json +146 -146
- package/components/ln-chart/src/chart-model.js +154 -154
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -42
- package/components/ln-confirm/ln-confirm-dev.scss +24 -24
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-confirm/ln-confirm.schema.json +66 -66
- package/components/ln-confirm/src/ln-confirm.js +178 -178
- package/components/ln-core/attrs.js +13 -0
- package/components/ln-core/crypto.js +286 -265
- package/components/ln-core/dom.js +115 -115
- package/components/ln-core/form.js +146 -136
- package/components/ln-core/helpers.js +33 -33
- package/components/ln-core/http.js +48 -48
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +5 -0
- package/components/ln-core/ln-core.schema.json +3 -2
- package/components/ln-core/locale.js +55 -55
- package/components/ln-core/matching.js +78 -78
- package/components/ln-core/number.js +125 -125
- package/components/ln-core/template.js +206 -206
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -50
- package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +1 -0
- package/components/ln-data-coordinator/README.md +9 -38
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -8
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +16 -16
- package/components/ln-data-coordinator/src/data-read-policy.js +0 -7
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +432 -1308
- package/components/ln-data-store/ln-data-store-dev.scss +13 -13
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/ln-data-store.schema.json +84 -84
- package/components/ln-data-store/src/data-store-model.js +184 -184
- package/components/ln-data-store/src/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/ln-date.schema.json +92 -92
- package/components/ln-date/src/date-model.js +186 -186
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/console-sink.js +19 -19
- package/components/ln-debug/src/gate.js +95 -95
- package/components/ln-debug/src/generated-attributes.js +4 -2
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -13
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/ln-editor.schema.json +58 -58
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/ln-external-links.schema.json +18 -18
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-fill/ln-fill.schema.json +23 -23
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +153 -153
- package/components/ln-filter/src/filter-model.js +185 -185
- package/components/ln-form/ln-form-dev.scss +8 -8
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/ln-form.schema.json +6 -0
- package/components/ln-form/src/ln-form.js +21 -0
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-http/ln-http.schema.json +6 -6
- package/components/ln-icon/ln-icon.schema.json +6 -6
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-include/ln-include.schema.json +23 -23
- package/components/ln-key/ln-key-dev.scss +18 -18
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-key/ln-key.schema.json +56 -56
- package/components/ln-key/src/ln-key.js +10 -10
- package/components/ln-link/ln-link-dev.scss +8 -8
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/ln-link.schema.json +22 -22
- package/components/ln-list/README.md +152 -152
- package/components/ln-list/ln-list-dev.scss +8 -8
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/ln-list.schema.json +166 -166
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-modal/ln-modal.schema.json +65 -65
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/ln-nav.schema.json +25 -25
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/ln-number.schema.json +63 -63
- package/components/ln-number/src/ln-number.js +26 -0
- package/components/ln-number/src/number-model.js +31 -31
- package/components/ln-obfuscator/README.md +60 -60
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -49
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -159
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -250
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/ln-options.schema.json +6 -0
- package/components/ln-options/src/ln-options.js +4 -4
- package/components/ln-persist/README.md +151 -151
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-persist/ln-persist.schema.json +28 -28
- package/components/ln-persist/src/ln-persist.js +83 -83
- package/components/ln-picklist/README.md +230 -230
- package/components/ln-picklist/ln-picklist-dev.scss +22 -22
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-picklist/ln-picklist.schema.json +49 -49
- package/components/ln-picklist/src/ln-picklist.js +228 -228
- package/components/ln-popover/ln-popover-dev.scss +13 -13
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-progress/ln-progress-dev.scss +8 -8
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/ln-progress.schema.json +40 -40
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-router/ln-router.schema.json +76 -76
- package/components/ln-scroll/README.md +45 -45
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-scroll/ln-scroll.schema.json +85 -85
- package/components/ln-scroll/src/ln-scroll.js +150 -150
- package/components/ln-search/README.md +188 -188
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-slug/ln-slug.schema.json +23 -23
- package/components/ln-slug/src/ln-slug.js +25 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +104 -104
- package/components/ln-sort/src/ln-sort.js +321 -321
- package/components/ln-sort/src/sort-model.js +117 -117
- package/components/ln-sortable/ln-sortable-dev.scss +13 -13
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/ln-sortable.schema.json +36 -36
- package/components/ln-stat/ln-stat-dev.scss +8 -8
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-stat/ln-stat.schema.json +32 -32
- package/components/ln-stat/src/stat-model.js +28 -28
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +211 -211
- package/components/ln-table/src/table-model.js +98 -98
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -93
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/ln-tabs.schema.json +75 -75
- package/components/ln-tabs/src/ln-tabs.js +208 -208
- package/components/ln-tabs/src/tabs-model.js +82 -82
- package/components/ln-time/ln-time-dev.scss +13 -13
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/ln-time.schema.json +38 -38
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toast/ln-toast.schema.json +65 -65
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-toggle/ln-toggle.schema.json +52 -52
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -86
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-translations/ln-translations.schema.json +120 -120
- package/components/ln-ui-coordinator/README.md +62 -62
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +28 -28
- package/components/ln-ui-coordinator/src/ln-ui-coordinator.js +140 -140
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-upload/ln-upload.schema.json +193 -193
- package/components/ln-upload/src/upload-model.js +78 -78
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/ln-validate.schema.json +50 -50
- package/components/ln-validate/src/validate-model.js +64 -64
- package/components/ln-websocket-connector/README.md +166 -166
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -29
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +283 -279
- package/ln-ashlar.html-data.json +15 -8
- package/package.json +85 -84
- package/theme/brand.css +73 -73
- package/theme/components/_confirm.scss +6 -6
- package/theme/components/_picklist.scss +3 -3
- package/theme/config/_palette.scss +274 -274
- package/theme/config/_theme.scss +292 -292
- package/theme/config/_tokens.scss +285 -285
- package/theme/config/mixins/_index.scss +62 -62
- package/theme/config/mixins/_picklist.scss +66 -66
- package/theme/ln-ashlar-dev.scss +66 -66
- package/theme/ln-ashlar-landing.scss +56 -56
- package/theme/ln-ashlar-theme.scss +63 -63
- package/theme/presentation/_bento.scss +151 -151
- package/theme/presentation/_cta.scss +111 -111
- package/theme/presentation/_effects.scss +216 -216
- package/theme/presentation/_features.scss +108 -108
- package/theme/presentation/_footer.scss +129 -129
- package/theme/presentation/_hero.scss +158 -158
- package/theme/presentation/_layout.scss +170 -170
- package/theme/presentation/_navbar.scss +140 -140
- package/theme/presentation/_pricing.scss +262 -262
- package/theme/presentation/_stats.scss +87 -87
- package/theme/presentation/_testimonials.scss +124 -124
- package/theme/presentation/_tokens.scss +39 -39
- package/theme/presentation/_typography.scss +163 -163
- package/web-types.json +26 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){r=t[s];break}if(!E(r))return}e.apply(console,t)}}function k(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const q={};function H(e,t){q[e]=t}function V(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=H,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function K(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];B[n]=t}function Q(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=K,window.lnCore.getLocaleFallback=Q,window.lnCore.ensureLocaleObserver=U);const S={};function J(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=S[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const o=n[i],l=o.getAttribute("data-ln-field");t[l]!=null&&(o.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const o=r[i],l=o.getAttribute("data-ln-attr").split(",");for(let c=0;c<l.length;c++){const d=l[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&o.setAttribute(a,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const o=s[i],l=o.getAttribute("data-ln-show");l in t&&o.classList.toggle("hidden",!t[l])}const u=e.querySelectorAll("[data-ln-class]");for(let i=0;i<u.length;i++){const o=u[i],l=o.getAttribute("data-ln-class").split(",");for(let c=0;c<l.length;c++){const d=l[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&o.classList.toggle(a,!!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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function M(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const u=n.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,o){return t[o]!==void 0?t[o]:""}))}const r=function(u,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let u=0;u<s.length;u++){const i=s[u],o=i.attributes;for(let l=0;l<o.length;l++){const c=o[l];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function X(e,t,n,r,s,u){const i={};for(let l=0;l<e.children.length;l++){const c=e.children[l],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const o=document.createDocumentFragment();for(let l=0;l<t.length;l++){const c=t[l],d=String(r(c));let a=i[d];if(a)s(a,c,l);else{const f=J(n,u);if(!f||(M(f,c),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),s(a,c,l)}o.appendChild(a)}e.textContent="",e.appendChild(o)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=$,window.lnCore.lnFill=G,window.lnCore.renderList=X);function F(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Y(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const L=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(L.has(n))return L.get(n);const r=new Set(e||[]),s=function(u,i){const o=u.getAttribute(i);return o!==null&&r.has(o)?o:t};return L.set(n,s),s}function ne(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function oe(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function N(e,t,n,r,s){if(!e||t===null)return!0;const u=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const o=l=>{s?console.warn(l,s):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(o(`[${u}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(o(`[${u}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return o(`[${u}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(o(`[${u}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(o(`[${u}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(o(`[${u}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return o(`[${u}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const r in n){const[s,u,i]=n[r];Object.defineProperty(e,r,{get:function(){return s(t,u,i)},enumerable:!0,configurable:!0})}return e}function ie(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=te(r.values,r.fallback);break;case"integer":s=Y;break;case"float":s=ne;break;case"boolean":s=Z;break;case"list":s=ee;break;case"json":s=oe;break;case"string":default:s=F;break}s||(s=F),t[r.prop]=[s,n,r.fallback]}return t}function le(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function se(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function O(e,t,n,r){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(u));e.matches&&e.matches(u)&&i.push(e);for(const o of i)if(!o[n]){window.lnCore._persistSink&&o.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(o,t);try{o[n]=new r(o)}catch(l){console.error("["+n+"] init failed",o,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ue(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ce(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 W(){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 de(e){const t=W(),n=e.observed||[];for(let r=0;r<n.length;r++){const s=n[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(u=>u.componentTag===e.componentTag)||s.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=se(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 j(e,t,n,r){for(let s=0;s<e.length;s++){const u=e[s];if(!t[u.attribute])continue;const i=u.effects&&u.effects[n];i?i(t,n,r):u.onAttrChange&&(!u.declared||u.declared.has(n))&&u.onAttrChange(t,n,r)}}function ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=W(),s=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&E(t)){const u=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let o=0;o<u.length;o++)N(u[o].spec,i,n,u[o].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const u=r.byReactive.get(n);u&&j(u,t,n,e.oldValue),r.reactiveWildcard.length&&j(r.reactiveWildcard,t,n,e.oldValue)}if(s)for(let u=0;u<s.length;u++){const i=s[u];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(O(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function fe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ae(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function P(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=P();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const s=r.query,u=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;u&&r.onSubtreeChange(u,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s];O(r,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s],i=u.query,o=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&o.push(r);for(let l=0;l<o.length;l++){const c=o[l];if(!document.contains(c)){const d=c[u.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+u.attribute+"] destroy failed",c,a)}delete c[u.attribute]}}}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function he(e,t,n,r,s={}){const u=s.extraAttributes||[],i=s.onAttributeChange||null,o=s.onSubtreeChange||null,l=s.onInit||null,c=s.onAttrChange||null,d=s.effects||null,a=s.attributes||null,f=a?le(a):d,A=a?new Set(Object.keys(a)):null,_=s.persist||null;function C(h){const p=h||document.body;if(O(p,e,t,n),a&&R())for(const w in a){const Se=a[w],D=Array.from(p.querySelectorAll("["+w+"]"));p.matches&&p.matches("["+w+"]")&&D.push(p);for(let x=0;x<D.length;x++){const I=D[x];E(I)&&N(Se,I.getAttribute(w),w,r,I)}}l&&l(p)}const b=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let p;for(;(p=h.exec(e))!==null;)b.push(p[1])}else b.push(e);de({selector:e,attribute:t,componentTag:r,attributes:a,ComponentFn:n,onInit:l,observed:b.concat(u),onAttributeChange:i,onAttrChange:c,effects:f,declared:A,persist:_}),fe();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";P().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:o,query:m}),pe(),window[t]=C;function g(){ue()>0?ce(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),C}function z(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=z(t);if(!r)return n;const s=r.split("&");for(let u=0;u<s.length;u++){const i=s[u];if(!i)continue;const o=i.indexOf(":"),l=o>-1?i.slice(0,o):i,c=o>-1?i.slice(o+1):"";if(l)try{n[l]=decodeURIComponent(c)}catch{n[l]=c}}return n}function we(e){if(!e)return null;const t=T();return e in t?t[e]:null}function be(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const s=Object.keys(n).map(function(u){const i=n[u];return i===""?u:u+":"+encodeURIComponent(i)}).join("&");z(location.hash)!==s&&(location.hash=s)}function me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _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 Ae(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),s=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:n,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=we,window.lnCore.hashSet=be,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Ae,window.lnCore.hashFilterDecode=ve);function Ee(e,t,n,r){const s=typeof r=="number"?r:4,u=window.innerWidth,i=window.innerHeight,o=t.width,l=t.height,c=n.split("-"),d=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=f[d]||f.bottom;function _(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-o:e.left+(e.width-o)/2:a==="start"?e.top:a==="end"?e.bottom-l:e.top+(e.height-l)/2}function C(g){let h,p,w=!0;return g==="top"?(h=e.top-s-l,p=_(g),h<0&&(w=!1)):g==="bottom"?(h=e.bottom+s,p=_(g),h+l>i&&(w=!1)):g==="left"?(h=_(g),p=e.left-s-o,p<0&&(w=!1)):(h=_(g),p=e.right+s,p+o>u&&(w=!1)),{top:h,left:p,side:g,fits:w}}let b=null;for(let g=0;g<A.length;g++){const h=C(A[g]);if(h.fits){b=h;break}}b||(b=C(A[0]));let y=b.top,m=b.left;return o>=u?m=0:(m<0&&(m=0),m+o>u&&(m=u-o)),l>=i?y=0:(y<0&&(y=0),y+l>i&&(y=i-l)),{top:y,left:m,placement:b.side}}function ke(e){if(!e)return{width:0,height:0};const t=e.style,n=t.visibility,r=t.display,s=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const u=e.offsetWidth,i=e.offsetHeight;return t.visibility=n,t.display=r,t.position=s,{width:u,height:i}}(function(){const e="data-ln-dropdown",t="lnDropdown",n="bottom-end";if(window[t]!==void 0)return;const r={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"position",type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:n,description:"Preferred positioning anchor"},"data-ln-dropdown-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},s=ie(r);function u(i){this.dom=i,re(this,i,s),this.toggleEl=i.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=i.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const o=this;return this._onRequestOpen=function(){o.toggleEl&&o.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){o.toggleEl&&o.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(o.toggleEl){const l=o.toggleEl.getAttribute("data-ln-toggle");o.toggleEl.setAttribute("data-ln-toggle",l==="open"?"close":"open")}},this._onKeydown=function(l){const c=o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open";if(l.key==="Escape"){c&&(l.preventDefault(),l.stopPropagation(),o.toggleEl.setAttribute("data-ln-toggle","close"),o.triggerBtn&&o.triggerBtn.focus());return}if(l.key==="Tab"){c&&(o.triggerBtn&&o.triggerBtn.focus(),o.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=o._getMenuItems();if(d.length===0)return;if(!c&&(l.key==="ArrowDown"||l.key==="ArrowUp")){l.preventDefault(),o.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=o._getMenuItems();f.length>0&&o._focusItem(f,l.key==="ArrowDown"?0:f.length-1)},0);return}if(!c)return;const a=d.indexOf(document.activeElement);if(l.key==="ArrowDown"){l.preventDefault();const f=a<d.length-1?a+1:0;o._focusItem(d,f)}else if(l.key==="ArrowUp"){l.preventDefault();const f=a>0?a-1:d.length-1;o._focusItem(d,f)}else l.key==="Home"?(l.preventDefault(),o._focusItem(d,0)):l.key==="End"&&(l.preventDefault(),o._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(l){!l.detail||l.detail.target!==o.toggleEl||(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","true"),typeof o.toggleEl.showPopover=="function"&&o.toggleEl.showPopover(),o._initMenuAria(),o._reposition(),o._addOutsideClickListener(),o._addScrollRepositionListener(),o._addResizeCloseListener(),k(i,"ln-dropdown:open",{target:l.detail.target}))},this._onToggleClose=function(l){!l.detail||l.detail.target!==o.toggleEl||(o.triggerBtn&&o.triggerBtn.setAttribute("aria-expanded","false"),o._removeOutsideClickListener(),o._removeScrollRepositionListener(),o._removeResizeCloseListener(),o.toggleEl.style.top="",o.toggleEl.style.left="",o.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof o.toggleEl.hidePopover=="function"&&o.toggleEl.matches(":popover-open")&&o.toggleEl.hidePopover(),k(i,"ln-dropdown:close",{target:l.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}u.prototype._initMenuAria=function(){if(!this.toggleEl)return;const i=this.toggleEl.querySelectorAll("li");for(const l of i)l.setAttribute("role","none");const o=this._getMenuItems();for(let l=0;l<o.length;l++)o[l].setAttribute("role","menuitem"),o[l].setAttribute("tabindex",l===0?"0":"-1")},u.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},u.prototype._focusItem=function(i,o){for(let l=0;l<i.length;l++)i[l].setAttribute("tabindex",l===o?"0":"-1");i[o]&&i[o].focus()},u.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const i=this.triggerBtn.getBoundingClientRect(),o=ke(this.toggleEl),l=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,c=this.position||n,d=Ee(i,o,c,l);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px",this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},u.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const i=this;this._boundDocClick=function(o){i.dom.contains(o.target)||i.toggleEl&&i.toggleEl.contains(o.target)||i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},i._docClickTimeout=setTimeout(function(){i._docClickTimeout=null,document.addEventListener("click",i._boundDocClick)},0)},u.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},u.prototype._addScrollRepositionListener=function(){const i=this;this._boundScrollReposition=function(){i._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},u.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},u.prototype._addResizeCloseListener=function(){const i=this;this._boundResizeClose=function(){i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},u.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},he(e,t,u,"ln-dropdown",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){l=t[s];break}if(!E(l))return}e.apply(console,t)}}function k(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,s={},u=e.elements,i={};if(o)for(let r=0;r<u.length;r++){const n=u[r];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let r=0;r<u.length;r++){const n=u[r];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))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 c=0;c<n.options.length;c++)n.options[c].selected&&s[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);s[n.name]=n.value===""||isNaN(c)?null:c}else s[n.name]=n.value}return s}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const o=e.elements,l=[],s={};for(let u=0;u<o.length;u++){const i=o[u];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let u=0;u<o.length;u++){const i=o[u];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const r=i.getAttribute("data-ln-fill-as")||i.name;if(!r||!(r in t))continue;const n=t[r];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(s[i.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=te(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 c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].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=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const B={};function oe(e,t){B[e]=t}function ie(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function le(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];F[o]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=re);const x={};function ue(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const r=o[i],n=r.getAttribute("data-ln-field");t[n]!=null&&(r.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const r=l[i],n=r.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&r.setAttribute(a,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const r=s[i],n=r.getAttribute("data-ln-show");n in t&&r.classList.toggle("hidden",!t[n])}const u=e.querySelectorAll("[data-ln-class]");for(let i=0;i<u.length;i++){const r=u[i],n=r.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&r.classList.toggle(a,!!t[f])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let 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 u=o.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,r){return t[r]!==void 0?t[r]:""}))}const l=function(u,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let u=0;u<s.length;u++){const i=s[u],r=i.attributes;for(let n=0;n<r.length;n++){const c=r[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function de(e,t,o,l,s,u){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const r=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(l(c));let a=i[d];if(a)s(a,c,n);else{const f=ue(o,u);if(!f||($(f,c),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),s(a,c,n)}r.appendChild(a)}e.textContent="",e.appendChild(r)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function S(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function N(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function j(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const s=l.trim().toLowerCase();return!(s==="false"||s==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const L=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(L.has(o))return L.get(o);const l=new Set(e||[]),s=function(u,i){const r=u.getAttribute(i);return r!==null&&l.has(r)?r:t};return L.set(o,s),s}function P(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function U(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function H(e,t,o,l,s){if(!e||t===null)return!0;const u=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const r=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"?(r(`[${u}] 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:(r(`[${u}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return r(`[${u}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(r(`[${u}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(r(`[${u}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(r(`[${u}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return r(`[${u}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,o){for(const l in o){const[s,u,i]=o[l];Object.defineProperty(e,l,{get:function(){return s(t,u,i)},enumerable:!0,configurable:!0})}return e}function K(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let s=l.read;if(!s&&l.type)switch(l.type){case"enum":s=W(l.values,l.fallback);break;case"integer":s=N;break;case"float":s=P;break;case"boolean":s=j;break;case"list":s=z;break;case"json":s=U;break;case"string":default:s=S;break}s||(s=S),t[l.prop]=[s,o,l.fallback]}return t}function ae(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.effect)}return Object.keys(t).length?t:null}function fe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=K,window.lnCore.attrStr=S,window.lnCore.attrInt=N,window.lnCore.attrBool=j,window.lnCore.attrList=z,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);function O(e,t,o,l){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(u));e.matches&&e.matches(u)&&i.push(e);for(const r of i)if(!r[o]){window.lnCore._persistSink&&r.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(r,t);try{r[o]=new l(r)}catch(n){console.error("["+o+"] init failed",r,n)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=J(),o=e.observed||[];for(let l=0;l<o.length;l++){const s=o[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const s=t.byDeclaredAttr.get(l);s.some(u=>u.componentTag===e.componentTag)||s.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=fe(e);if(l===null)t.reactiveWildcard.push(e);else for(const s of l)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,l){for(let s=0;s<e.length;s++){const u=e[s];if(!t[u.attribute])continue;const i=u.effects&&u.effects[o];i?i(t,o,l):u.onAttrChange&&(!u.declared||u.declared.has(o))&&u.onAttrChange(t,o,l)}}function he(e){const t=e.target,o=e.attributeName;if(e.oldValue===t.getAttribute(o))return;const l=J(),s=l.byAttr.get(o);if(q()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(o)&&E(t)){const u=l.byDeclaredAttr.get(o),i=t.getAttribute(o);for(let r=0;r<u.length;r++)H(u[r].spec,i,o,u[r].componentTag,t)}if(window.lnCore._debugSink&&(o.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",o,t,{oldValue:e.oldValue,newValue:t.getAttribute(o)}),o.indexOf("data-ln-")===0){const u=l.byReactive.get(o);u&&Q(u,t,o,e.oldValue),l.reactiveWildcard.length&&Q(l.reactiveWildcard,t,o,e.oldValue)}if(s)for(let u=0;u<s.length;u++){const i=s[u];if(i.handler){i.handler(t,o,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,o):(O(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{he(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=G();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const l=t[o];if(l.onSubtreeChange){const s=l.query,u=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;u&&l.onSubtreeChange(u,e)}}for(let o=0;o<e.addedNodes.length;o++){const l=e.addedNodes[o];if(l.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s];O(l,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(l)}}for(let o=0;o<e.removedNodes.length;o++){const l=e.removedNodes[o];if(l.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s],i=u.query,r=Array.from(l.querySelectorAll(i));l.matches&&l.matches(i)&&r.push(l);for(let n=0;n<r.length;n++){const c=r[n];if(!document.contains(c)){const d=c[u.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+u.attribute+"] destroy failed",c,a)}delete c[u.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{me(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,o,l,s={}){const u=s.extraAttributes||[],i=s.onAttributeChange||null,r=s.onSubtreeChange||null,n=s.onInit||null,c=s.onAttrChange||null,d=s.effects||null,a=s.attributes||null,f=a?ae(a):d,_=a?new Set(Object.keys(a)):null,v=s.persist||null;function C(w){const p=w||document.body;if(O(p,e,t,o),a&&q())for(const h in a){const De=a[h],D=Array.from(p.querySelectorAll("["+h+"]"));p.matches&&p.matches("["+h+"]")&&D.push(p);for(let I=0;I<D.length;I++){const R=D[I];E(R)&&H(De,R.getAttribute(h),h,l,R)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let p;for(;(p=w.exec(e))!==null;)b.push(p[1])}else b.push(e);we({selector:e,attribute:t,componentTag:l,attributes:a,ComponentFn:o,onInit:n,observed:b.concat(u),onAttributeChange:i,onAttrChange:c,effects:f,declared:_,persist:v}),be();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";G().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:r,query:m}),Ce(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function g(){ge()>0?pe(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),C}function Y(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},l=Y(t);if(!l)return o;const s=l.split("&");for(let u=0;u<s.length;u++){const i=s[u];if(!i)continue;const r=i.indexOf(":"),n=r>-1?i.slice(0,r):i,c=r>-1?i.slice(r+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function ye(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ve(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(u){const i=o[u];return i===""?u:u+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==s&&(location.hash=s)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(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 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 Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),l=e.slice(t+1),s=l?l.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=ye,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=Se);function Le(e,t,o,l){const s=typeof l=="number"?l:4,u=window.innerWidth,i=window.innerHeight,r=t.width,n=t.height,c=o.split("-"),d=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},_=f[d]||f.bottom;function v(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-r:e.left+(e.width-r)/2:a==="start"?e.top:a==="end"?e.bottom-n:e.top+(e.height-n)/2}function C(g){let w,p,h=!0;return g==="top"?(w=e.top-s-n,p=v(g),w<0&&(h=!1)):g==="bottom"?(w=e.bottom+s,p=v(g),w+n>i&&(h=!1)):g==="left"?(w=v(g),p=e.left-s-r,p<0&&(h=!1)):(w=v(g),p=e.right+s,p+r>u&&(h=!1)),{top:w,left:p,side:g,fits:h}}let b=null;for(let g=0;g<_.length;g++){const w=C(_[g]);if(w.fits){b=w;break}}b||(b=C(_[0]));let y=b.top,m=b.left;return r>=u?m=0:(m<0&&(m=0),m+r>u&&(m=u-r)),n>=i?y=0:(y<0&&(y=0),y+n>i&&(y=i-n)),{top:y,left:m,placement:b.side}}function Oe(e){if(!e)return{width:0,height:0};const t=e.style,o=t.visibility,l=t.display,s=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const u=e.offsetWidth,i=e.offsetHeight;return t.visibility=o,t.display=l,t.position=s,{width:u,height:i}}function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te),(function(){const e="data-ln-dropdown",t="lnDropdown",o="bottom-end";if(window[t]!==void 0)return;const l={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"position",type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:o,description:"Preferred positioning anchor"},"data-ln-dropdown-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},s=K(l);function u(i){this.dom=i,V(this,i,s),this.toggleEl=i.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=i.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const r=this;return this._onRequestOpen=function(){r.toggleEl&&r.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){r.toggleEl&&r.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(r.toggleEl){const n=r.toggleEl.getAttribute("data-ln-toggle");r.toggleEl.setAttribute("data-ln-toggle",n==="open"?"close":"open")}},this._onKeydown=function(n){const c=r.toggleEl&&r.toggleEl.getAttribute("data-ln-toggle")==="open";if(n.key==="Escape"){c&&(n.preventDefault(),n.stopPropagation(),r.toggleEl.setAttribute("data-ln-toggle","close"),r.triggerBtn&&r.triggerBtn.focus());return}if(n.key==="Tab"){c&&(r.triggerBtn&&r.triggerBtn.focus(),r.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=r._getMenuItems();if(d.length===0)return;if(!c&&(n.key==="ArrowDown"||n.key==="ArrowUp")){n.preventDefault(),r.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=r._getMenuItems();f.length>0&&r._focusItem(f,n.key==="ArrowDown"?0:f.length-1)},0);return}if(!c)return;const a=d.indexOf(document.activeElement);if(n.key==="ArrowDown"){n.preventDefault();const f=a<d.length-1?a+1:0;r._focusItem(d,f)}else if(n.key==="ArrowUp"){n.preventDefault();const f=a>0?a-1:d.length-1;r._focusItem(d,f)}else n.key==="Home"?(n.preventDefault(),r._focusItem(d,0)):n.key==="End"&&(n.preventDefault(),r._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(n){!n.detail||n.detail.target!==r.toggleEl||(r.triggerBtn&&r.triggerBtn.setAttribute("aria-expanded","true"),typeof r.toggleEl.showPopover=="function"&&r.toggleEl.showPopover(),r._initMenuAria(),r._reposition(),r._addOutsideClickListener(),r._addScrollRepositionListener(),r._addResizeCloseListener(),k(i,"ln-dropdown:open",{target:n.detail.target}))},this._onToggleClose=function(n){!n.detail||n.detail.target!==r.toggleEl||(r.triggerBtn&&r.triggerBtn.setAttribute("aria-expanded","false"),r._removeOutsideClickListener(),r._removeScrollRepositionListener(),r._removeResizeCloseListener(),r.toggleEl.style.top="",r.toggleEl.style.left="",r.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof r.toggleEl.hidePopover=="function"&&r.toggleEl.matches(":popover-open")&&r.toggleEl.hidePopover(),k(i,"ln-dropdown:close",{target:n.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}u.prototype._initMenuAria=function(){if(!this.toggleEl)return;const i=this.toggleEl.querySelectorAll("li");for(const n of i)n.setAttribute("role","none");const r=this._getMenuItems();for(let n=0;n<r.length;n++)r[n].setAttribute("role","menuitem"),r[n].setAttribute("tabindex",n===0?"0":"-1")},u.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},u.prototype._focusItem=function(i,r){for(let n=0;n<i.length;n++)i[n].setAttribute("tabindex",n===r?"0":"-1");i[r]&&i[r].focus()},u.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const i=this.triggerBtn.getBoundingClientRect(),r=Oe(this.toggleEl),n=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,c=this.position||o,d=Le(i,r,c,n);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px",this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},u.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const i=this;this._boundDocClick=function(r){i.dom.contains(r.target)||i.toggleEl&&i.toggleEl.contains(r.target)||i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},i._docClickTimeout=setTimeout(function(){i._docClickTimeout=null,document.addEventListener("click",i._boundDocClick)},0)},u.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},u.prototype._addScrollRepositionListener=function(){const i=this;this._boundScrollReposition=function(){i._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},u.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},u.prototype._addResizeCloseListener=function(){const i=this;this._boundResizeClose=function(){i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},u.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},X(e,t,u,"ln-dropdown",{attributes:l})})()})();
|
|
@@ -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": "runtime",
|
|
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": "runtime",
|
|
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 +1 @@
|
|
|
1
|
-
(function(){"use strict";function B(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!D(r))return}e.apply(console,t)}}function k(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function Y(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const R={};function Z(e,t){R[e]=t}function ee(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Z,window.lnCore.getDataMapper=ee);function te(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const H={};function ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];H[n]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return H[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ne,window.lnCore.getLocaleFallback=re,window.lnCore.ensureLocaleObserver=te);const M={};function $(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function oe(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return $(t,n)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],c=u.getAttribute("data-ln-field");t[c]!=null&&(u.textContent=t[c])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const u=r[l],c=u.getAttribute("data-ln-attr").split(",");for(let h=0;h<c.length;h++){const m=c[h].trim().split(":");if(m.length!==2)continue;const g=m[0].trim(),v=m[1].trim();t[v]!=null&&u.setAttribute(g,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const u=o[l],c=u.getAttribute("data-ln-show");c in t&&u.classList.toggle("hidden",!t[c])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const u=i[l],c=u.getAttribute("data-ln-class").split(",");for(let h=0;h<c.length;h++){const m=c[h].trim().split(":");if(m.length!==2)continue;const g=m[0].trim(),v=m[1].trim();v in t&&u.classList.toggle(g,!!t[v])}}return e}function ie(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],u=l.attributes;for(let c=0;c<u.length;c++){const h=u[c];h.value.indexOf("{{")!==-1&&l.setAttribute(h.name,h.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function le(e,t,n,r,o,i){const l={};for(let c=0;c<e.children.length;c++){const h=e.children[c],m=h.getAttribute("data-ln-render-key");m&&(l[m]=h)}const u=document.createDocumentFragment();for(let c=0;c<t.length;c++){const h=t[c],m=String(r(h));let g=l[m];if(g)o(g,h,c);else{const v=$(n,i);if(!v||(P(v,h),g=v.firstElementChild,!g))continue;g.setAttribute("data-ln-render-key",m),o(g,h,c)}u.appendChild(g)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=F,window.lnCore.lnFill=ie,window.lnCore.renderList=le);function W(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=c=>{o?console.warn(c,o):console.warn(c)};if(l==="boolean"){const c=t.trim().toLowerCase();return c!==""&&c!=="true"&&c!=="false"&&c!=="1"&&c!=="0"?(u(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const c=e.values||[];return c.includes(t)?!0:(u(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${c.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const c=parseInt(t,10);return e.min!==void 0&&c<e.min?(u(`[${i}] Value ${c} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&c>e.max?(u(`[${i}] Value ${c} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(c){return u(`[${i}] Invalid JSON for attribute "${n}": ${c.message}. Fallback: ${e.fallback}.`),!1}return!0}function se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ae(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function q(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const u of l)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new r(u)}catch(c){console.error("["+n+"] init failed",u,c)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ue(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function j(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=j(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ae(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function K(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),o=r.byAttr.get(n);if(B()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&D(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let u=0;u<i.length;u++)W(i[u].spec,l,n,i[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&K(i,t,n,e.oldValue),r.reactiveWildcard.length&&K(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(q(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function we(e){const t=V();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];q(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,u=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&u.push(r);for(let c=0;c<u.length;c++){const h=u[c];if(!document.contains(h)){const m=h[i.attribute];if(m&&typeof m.destroy=="function")try{m.destroy()}catch(g){console.error("["+i.attribute+"] destroy failed",h,g)}delete h[i.attribute]}}}}}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{we(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ge(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,u=o.onSubtreeChange||null,c=o.onInit||null,h=o.onAttrChange||null,m=o.effects||null,g=o.attributes||null,v=g?se(g):m,N=g?new Set(Object.keys(g)):null,E=o.persist||null;function x(f){const p=f||document.body;if(q(p,e,t,n),g&&B())for(const b in g){const C=g[b],w=Array.from(p.querySelectorAll("["+b+"]"));p.matches&&p.matches("["+b+"]")&&w.push(p);for(let _=0;_<w.length;_++){const A=w[_];D(A)&&W(C,A.getAttribute(b),b,r,A)}}c&&c(p)}const L=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let p;for(;(p=f.exec(e))!==null;)L.push(p[1])}else L.push(e);de({selector:e,attribute:t,componentTag:r,attributes:g,ComponentFn:n,onInit:c,observed:L.concat(i),onAttributeChange:l,onAttrChange:h,effects:v,declared:N,persist:E}),he();const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";V().push({selector:e,attribute:t,ComponentFn:n,onInit:c,onSubtreeChange:u,query:a}),be(),window[t]=x;function d(){ce()>0?ue(function(){x(document.body)}):x(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d):d(),x}function U(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},r=U(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const u=l.indexOf(":"),c=u>-1?l.slice(0,u):l,h=u>-1?l.slice(u+1):"";if(c)try{n[c]=decodeURIComponent(h)}catch{n[c]=h}}return n}function pe(e){if(!e)return null;const t=I();return e in t?t[e]:null}function me(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");U(location.hash)!==o&&(location.hash=o)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ve(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 Ae(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=pe,window.lnCore.hashSet=me,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=ve,window.lnCore.hashFilterEncode=Ae,window.lnCore.hashFilterDecode=ke),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"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"}},r={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"},i={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let u=0;function c(s){return!!(o[s]||i[s]||l[s]||s==="link")}function h(s){this.dom=s;const a=this;if(this._textarea=s.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",s),this;const d=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"),d&&this._surface.setAttribute("data-placeholder",d);const f=this._textarea.id;if(f){const w=s.querySelector('label[for="'+f+'"]');w&&(w.id||(w.id=f+"-label"),this._surface.setAttribute("aria-labelledby",w.id))}this._surface.id=f?f+"-surface":"ln-editor-surface-"+ ++u;const p=this._textarea.value.trim();p&&(this._surface.innerHTML=p);const b=s.querySelector('[role="toolbar"]');if(b&&b.nextSibling?s.insertBefore(this._surface,b.nextSibling):s.appendChild(this._surface),b){b.setAttribute("aria-controls",this._surface.id);const w=b.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<w.length;_++){const A=w[_].getAttribute("data-ln-editor-action");c(A)&&w[_].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),k(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(w){w.target.closest("[data-ln-editor-action]")&&w.preventDefault()},this._onClickToolbar=function(w){const _=w.target.closest("[data-ln-editor-action]");if(!_)return;const A=_.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(w){v(a,w)},this._onKeydown=function(w){x(a,w)},this._onSelectionChange=function(){document.contains(a._surface)&&a._updateActiveStates()},this._onFocus=function(){k(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._syncToTextarea(),k(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,k(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),b&&(b.addEventListener("mousedown",this._onMousedownToolbar),b.addEventListener("click",this._onClickToolbar)),document.addEventListener("selectionchange",this._onSelectionChange),this._onSetContent=function(w){const _=w.detail&&w.detail.html;_!==void 0&&(a._surface.innerHTML=_,a._syncToTextarea(),k(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},s.addEventListener("ln-editor:set-content",this._onSetContent);const C=this._textarea.form;return C&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,k(s,"ln-editor:changed",{html:a._textarea.value,target:s})},0)},C.addEventListener("reset",this._onFormReset)),this}h.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},h.prototype._execAction=function(s){if(!(!s||Y(this.dom,"ln-editor:before-change",{action:s,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[s])document.execCommand(o[s],!1,null);else if(i[s]){const d=i[s],f=m(this._surface);f&&f.toLowerCase()===d?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+d+">")}else l[s]?document.execCommand(l[s],!1,null):s==="link"?L(this):s==="unlink"?document.execCommand("unlink",!1,null):s==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},h.prototype._updateActiveStates=function(){const s=this.dom.querySelector('[role="toolbar"]');if(!s)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const d=a.anchorNode;if(!d||!this._surface.contains(d))return;const f=s.querySelectorAll("[data-ln-editor-action]");for(let p=0;p<f.length;p++){const b=f[p],C=b.getAttribute("data-ln-editor-action");let w=!1;if(o[C])try{w=document.queryCommandState(o[C])}catch{}else if(i[C]){const _=m(this._surface);w=_&&_.toLowerCase()===i[C]}else if(l[C])try{w=document.queryCommandState(l[C])}catch{}else C==="link"&&(w=!!g(a.anchorNode,"A",this._surface));c(C)&&b.setAttribute("aria-pressed",String(w)),w?b.classList.add("ln-editor-active"):b.classList.remove("ln-editor-active")}},h.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},h.prototype.setHTML=function(s){this._surface&&(this._surface.innerHTML=s,this._syncToTextarea(),k(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},h.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 s=this.dom.querySelector('[role="toolbar"]');s&&(s.removeEventListener("mousedown",this._onMousedownToolbar),s.removeEventListener("click",this._onClickToolbar)),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 d=this.dom.querySelector(".ln-editor__link-popover");d&&d.remove()}delete this.dom[t]};function m(s){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let d=a.anchorNode;if(!d)return null;for(;d&&d!==s;){if(d.nodeType===1){const f=d.tagName;if(f==="H2"||f==="H3"||f==="H4"||f==="BLOCKQUOTE"||f==="PRE"||f==="P")return f}d=d.parentNode}return null}function g(s,a,d){for(;s&&s!==d;){if(s.nodeType===1&&s.tagName===a)return s;s=s.parentNode}return null}function v(s,a){a.preventDefault();let d="";if(a.clipboardData&&(d=a.clipboardData.getData("text/html"),!d)){const p=a.clipboardData.getData("text/plain");p&&(d=p.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),d="<p>"+d+"</p>")}if(!d)return;const f=N(d);f&&document.execCommand("insertHTML",!1,f)}function N(s){const a=document.createElement("div");return a.innerHTML=s,E(a),a.innerHTML}function E(s){const a=Array.from(s.childNodes);for(let d=0;d<a.length;d++){const f=a[d];if(f.nodeType!==3){if(f.nodeType!==1){s.removeChild(f);continue}if(r[f.tagName]){const p=Array.from(f.attributes);for(let b=0;b<p.length;b++){const C=p[b].name;if(f.tagName==="A"&&C==="href"){const w=f.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(w)||f.removeAttribute("href")}else f.removeAttribute(C)}f.tagName==="A"&&f.setAttribute("rel","noopener noreferrer"),E(f)}else{for(;f.firstChild;)s.insertBefore(f.firstChild,f);s.removeChild(f)}}}}function x(s,a){if(!(a.ctrlKey||a.metaKey))return;let d=null;switch(a.key.toLowerCase()){case"b":d="bold";break;case"i":d="italic";break;case"u":d="underline";break;case"k":d="link";break}d&&(a.preventDefault(),s._execAction(d))}function L(s){const a=window.getSelection();if(!a||a.rangeCount===0)return;const d=g(a.anchorNode,"A",s._surface),f=a.getRangeAt(0).cloneRange();s._closeLinkPopover&&s._closeLinkPopover();const p=oe(s.dom,"ln-editor-link-popover","ln-editor");if(!p)return;const b=p.firstElementChild;if(!b)return;const C=b.querySelector('input[type="url"]'),w=b.querySelector('[data-ln-editor-action="confirm-link"]'),_=b.querySelector('[data-ln-editor-action="cancel-link"]');d&&(C.value=d.getAttribute("href")||"");const A=s.dom.querySelector('[role="toolbar"]');A?A.after(b):s.dom.insertBefore(b,s._surface),C.focus();function Q(){const y=window.getSelection();y.removeAllRanges(),y.addRange(f)}function O(){document.removeEventListener("mousedown",J),s._closeLinkPopover=null,b.remove()}function z(){const y=C.value.trim();if(O(),Q(),s._surface.focus(),y)if(d)d.setAttribute("href",y),d.setAttribute("rel","noopener noreferrer"),s._syncToTextarea(),k(s.dom,"ln-editor:changed",{html:s._textarea.value,target:s.dom});else{document.execCommand("createLink",!1,y);const S=window.getSelection();if(S&&S.anchorNode){const X=g(S.anchorNode,"A",s._surface);X&&(X.setAttribute("rel","noopener noreferrer"),s._syncToTextarea())}}else d&&document.execCommand("unlink",!1,null)}function G(){O(),Q(),s._surface.focus()}function xe(){O()}function J(y){const S=s.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!b.contains(y.target)&&!S&&xe()}s._closeLinkPopover=O,w.addEventListener("click",z),_.addEventListener("click",G),C.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),z()):y.key==="Escape"&&(y.preventDefault(),G())}),document.addEventListener("mousedown",J)}ge(e,t,h,"ln-editor",{attributes:n})})()})();
|
|
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 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 r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!N(r))return}e.apply(console,t)}}function A(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function se(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let d=0;d<l.options.length;d++)l.options[d].selected&&o[l.name].push(l.options[d].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const d=Number(l.value);o[l.name]=l.value===""||isNaN(d)?null:d}else o[l.name]=l.value}return o}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(l).split(",").map(function(m){return m.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=ue(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let d=0;d<i.options.length;d++)i.options[d].selected=l.indexOf(i.options[d].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ae);const H={};function fe(e,t){H[e]=t}function he(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=we);const M={};function j(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function me(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return j(t,n)}function P(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();t[v]!=null&&c.setAttribute(b,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();v in t&&c.classList.toggle(b,!!t[v])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)P(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function U(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=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 l=0;l<c.length;l++){const d=c[l];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const d=e.children[l],m=d.getAttribute("data-ln-render-key");m&&(i[m]=d)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const d=t[l],m=String(r(d));let b=i[m];if(b)o(b,d,l);else{const v=j(n,s);if(!v||(U(v,d),b=v.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",m),o(b,d,l)}c.appendChild(b)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=P,window.lnCore.lnFill=ge,window.lnCore.renderList=Ce);function D(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function W(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,o),o}function z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function G(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function ye(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Q(r.values,r.fallback);break;case"integer":o=W;break;case"float":o=z;break;case"boolean":o=K;break;case"list":o=V;break;case"json":o=J;break;case"string":default:o=D;break}o||(o=D),t[r.prop]=[o,n,r.fallback]}return t}function ve(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_e,window.lnCore.attrSpec=ye,window.lnCore.attrStr=D,window.lnCore.attrInt=W,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=z,window.lnCore.attrJson=J);function B(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Se(e){const t=X(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Le(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=X(),o=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)G(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Y(s,t,n,e.oldValue),r.reactiveWildcard.length&&Y(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(B(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ee(e){const t=Z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];B(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let l=0;l<c.length;l++){const d=c[l];if(!document.contains(d)){const m=d[s.attribute];if(m&&typeof m.destroy=="function")try{m.destroy()}catch(b){console.error("["+s.attribute+"] destroy failed",d,b)}delete d[s.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ee(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ee(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,d=o.onAttrChange||null,m=o.effects||null,b=o.attributes||null,v=b?ve(b):m,F=b?new Set(Object.keys(b)):null,E=o.persist||null;function k(h){const g=h||document.body;if(B(g,e,t,n),b&&R())for(const p in b){const _=b[p],w=Array.from(g.querySelectorAll("["+p+"]"));g.matches&&g.matches("["+p+"]")&&w.push(g);for(let C=0;C<w.length;C++){const x=w[C];N(x)&&G(_,x.getAttribute(p),p,r,x)}}l&&l(g)}const S=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let g;for(;(g=h.exec(e))!==null;)S.push(g[1])}else S.push(e);Se({selector:e,attribute:t,componentTag:r,attributes:b,ComponentFn:n,onInit:l,observed:S.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:F,persist:E}),Te();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:u}),Oe(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee);function f(){Ae()>0?ke(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),k}function te(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},r=te(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(d)}catch{n[l]=d}}return n}function Ne(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Me(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");te(location.hash)!==o&&(location.hash=o)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Ne,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Re);function He(){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=He),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"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"}},r={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 l(a){return!!(o[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 g=this._textarea.value.trim();g&&(this._surface.innerHTML=g);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 C=0;C<w.length;C++){const x=w[C].getAttribute("data-ln-editor-action");l(x)&&w[C].setAttribute("aria-pressed","false")}}this._onInput=function(){u._syncToTextarea(),A(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 C=w.target.closest("[data-ln-editor-action]");if(!C)return;const x=C.getAttribute("data-ln-editor-action");u._execAction(x)},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(){A(u.dom,"ln-editor:focus",{target:u.dom})},this._onBlur=function(){u._syncToTextarea(),A(u.dom,"ln-editor:blur",{target:u.dom})},this._onTextareaInput=function(){u._surface.innerHTML!==u._textarea.value&&(u._surface.innerHTML=u._textarea.value,A(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 C=w.detail&&w.detail.html;C!==void 0&&(u._surface.innerHTML=C,u._syncToTextarea(),A(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,A(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||se(this.dom,"ln-editor:before-change",{action:a,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[a])document.execCommand(o[a],!1,null);else if(s[a]){const f=s[a],h=m(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"?S(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 g=0;g<h.length;g++){const p=h[g],_=p.getAttribute("data-ln-editor-action");let w=!1;if(o[_])try{w=document.queryCommandState(o[_])}catch{}else if(s[_]){const C=m(this._surface);w=C&&C.toLowerCase()===s[_]}else if(i[_])try{w=document.queryCommandState(i[_])}catch{}else _==="link"&&(w=!!b(u.anchorNode,"A",this._surface));l(_)&&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(),A(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 m(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 b(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 g=u.clipboardData.getData("text/plain");g&&(f=g.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=F(f);h&&document.execCommand("insertHTML",!1,h)}function F(a){const u=document.createElement("div");return u.innerHTML=a,E(u),u.innerHTML}function E(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(r[h.tagName]){const g=Array.from(h.attributes);for(let p=0;p<g.length;p++){const _=g[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"),E(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 S(a){const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=b(u.anchorNode,"A",a._surface),h=u.getRangeAt(0).cloneRange();a._closeLinkPopover&&a._closeLinkPopover();const g=me(a.dom,"ln-editor-link-popover","ln-editor");if(!g)return;const p=g.firstElementChild;if(!p)return;const _=p.querySelector('input[type="url"]'),w=p.querySelector('[data-ln-editor-action="confirm-link"]'),C=p.querySelector('[data-ln-editor-action="cancel-link"]');f&&(_.value=f.getAttribute("href")||"");const x=a.dom.querySelector('[role="toolbar"]');x?x.after(p):a.dom.insertBefore(p,a._surface),_.focus();function ne(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function O(){document.removeEventListener("mousedown",ie),a._closeLinkPopover=null,p.remove()}function re(){const y=_.value.trim();if(O(),ne(),a._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),a._syncToTextarea(),A(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom});else{document.execCommand("createLink",!1,y);const L=window.getSelection();if(L&&L.anchorNode){const le=b(L.anchorNode,"A",a._surface);le&&(le.setAttribute("rel","noopener noreferrer"),a._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function oe(){O(),ne(),a._surface.focus()}function $e(){O()}function ie(y){const L=a.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!p.contains(y.target)&&!L&&$e()}a._closeLinkPopover=O,w.addEventListener("click",re),C.addEventListener("click",oe),_.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),re()):y.key==="Escape"&&(y.preventDefault(),oe())}),document.addEventListener("mousedown",ie)}ee(e,t,d,"ln-editor",{attributes:n})})()})();
|
|
@@ -1,58 +1,58 @@
|
|
|
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-editor",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-editor-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-editor": {
|
|
13
|
-
"direction": null,
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-editor-dev.scss",
|
|
16
|
-
"src/ln-editor.js"
|
|
17
|
-
],
|
|
18
|
-
"type": "marker",
|
|
19
|
-
"description": "Mounts rich text editor instance on container"
|
|
20
|
-
},
|
|
21
|
-
"data-ln-editor-action": {
|
|
22
|
-
"direction": "author",
|
|
23
|
-
"sources": [
|
|
24
|
-
"ln-editor-dev.scss",
|
|
25
|
-
"src/ln-editor.js"
|
|
26
|
-
],
|
|
27
|
-
"type": "enum",
|
|
28
|
-
"values": [
|
|
29
|
-
"bold",
|
|
30
|
-
"italic",
|
|
31
|
-
"underline",
|
|
32
|
-
"strikethrough",
|
|
33
|
-
"heading-2",
|
|
34
|
-
"heading-3",
|
|
35
|
-
"heading-4",
|
|
36
|
-
"blockquote",
|
|
37
|
-
"code",
|
|
38
|
-
"paragraph",
|
|
39
|
-
"ordered-list",
|
|
40
|
-
"unordered-list",
|
|
41
|
-
"link",
|
|
42
|
-
"unlink",
|
|
43
|
-
"clear",
|
|
44
|
-
"confirm-link",
|
|
45
|
-
"cancel-link"
|
|
46
|
-
],
|
|
47
|
-
"description": "Rich text toolbar formatting action"
|
|
48
|
-
},
|
|
49
|
-
"data-ln-editor-source": {
|
|
50
|
-
"direction": "runtime",
|
|
51
|
-
"sources": [
|
|
52
|
-
"src/ln-editor.js"
|
|
53
|
-
],
|
|
54
|
-
"type": "string",
|
|
55
|
-
"description": "Selector or ID of backing textarea synchronized with editor content"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
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-editor",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-editor-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-editor": {
|
|
13
|
+
"direction": null,
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-editor-dev.scss",
|
|
16
|
+
"src/ln-editor.js"
|
|
17
|
+
],
|
|
18
|
+
"type": "marker",
|
|
19
|
+
"description": "Mounts rich text editor instance on container"
|
|
20
|
+
},
|
|
21
|
+
"data-ln-editor-action": {
|
|
22
|
+
"direction": "author",
|
|
23
|
+
"sources": [
|
|
24
|
+
"ln-editor-dev.scss",
|
|
25
|
+
"src/ln-editor.js"
|
|
26
|
+
],
|
|
27
|
+
"type": "enum",
|
|
28
|
+
"values": [
|
|
29
|
+
"bold",
|
|
30
|
+
"italic",
|
|
31
|
+
"underline",
|
|
32
|
+
"strikethrough",
|
|
33
|
+
"heading-2",
|
|
34
|
+
"heading-3",
|
|
35
|
+
"heading-4",
|
|
36
|
+
"blockquote",
|
|
37
|
+
"code",
|
|
38
|
+
"paragraph",
|
|
39
|
+
"ordered-list",
|
|
40
|
+
"unordered-list",
|
|
41
|
+
"link",
|
|
42
|
+
"unlink",
|
|
43
|
+
"clear",
|
|
44
|
+
"confirm-link",
|
|
45
|
+
"cancel-link"
|
|
46
|
+
],
|
|
47
|
+
"description": "Rich text toolbar formatting action"
|
|
48
|
+
},
|
|
49
|
+
"data-ln-editor-source": {
|
|
50
|
+
"direction": "runtime",
|
|
51
|
+
"sources": [
|
|
52
|
+
"src/ln-editor.js"
|
|
53
|
+
],
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Selector or ID of backing textarea synchronized with editor content"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|