domma-js 0.58.1 → 0.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/types/generated/src/components/command-palette.d.ts +7 -0
- package/package.json +1 -1
- package/public/dist/bundles/domma-complete.css +14 -14
- package/public/dist/bundles/domma-data-focused.css +14 -14
- package/public/dist/bundles/domma-essentials.css +14 -14
- package/public/dist/bundles/domma-full.css +14 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +3 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
package/public/dist/domma.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Domma v0.58.
|
|
2
|
+
* Domma v0.58.2
|
|
3
3
|
* Dynamic Object Manipulation & Modeling API
|
|
4
4
|
* (c) 2026 Darryl Waterhouse & DCBW-IT
|
|
5
|
-
* Built: 2026-10-
|
|
6
|
-
* Commit:
|
|
5
|
+
* Built: 2026-10-25T15:30:25.844Z
|
|
6
|
+
* Commit: e547926
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Domma={})}(this,function(e){"use strict";const t=["$","_"],n=e=>"undefined"!=typeof Element&&e instanceof Element||"undefined"!=typeof HTMLCollection&&e instanceof HTMLCollection;function s(e,t){if("undefined"==typeof window)return t;const n=window.DommaOptions;return n&&"object"==typeof n&&e in n?n[e]:t}const i={"&":"&","<":"<",">":">",'"':""","'":"'"};function o(e){return null==e?"":String(e).replace(/[&<>"']/g,e=>i[e])}const r=/^(https?:|mailto:|tel:)$/;function a(e){if(!e||"string"!=typeof e)return null;try{const t="undefined"!=typeof location?location.href:"http://localhost/",n=new URL(e,t);return r.test(n.protocol)?n.href:null}catch{return null}}function l(e){return null!==a(e)}function c(){return"undefined"!=typeof window&&void 0!==window.DOMPurify}const h={ALLOWED_TAGS:["b","i","em","strong","u","s","mark","small","del","ins","sub","sup","p","br","hr","div","span","blockquote","pre","code","ul","ol","li","dl","dt","dd","h1","h2","h3","h4","h5","h6","a","table","thead","tbody","tfoot","tr","th","td","caption","col","colgroup","img","figure","figcaption","article","section","nav","aside","header","footer","main","time","address"],ALLOWED_ATTR:["href","title","target","rel","class","id","alt","src","width","height","colspan","rowspan","aria-label","aria-describedby","aria-hidden","role"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,FORCE_BODY:!0},d={default:h,strict:{ALLOWED_TAGS:["b","i","em","strong","p","br","a","ul","ol","li"],ALLOWED_ATTR:["href","title","target"],ALLOW_DATA_ATTR:!1},basic:{ALLOWED_TAGS:["b","i","em","strong","br"],ALLOWED_ATTR:[],ALLOW_DATA_ATTR:!1}};function u(e,t={}){if(null==e||""===e)return"";if(e=String(e),c()){const n=t.preset||"default",s={...d[n]||h,...t.allowedTags&&{ALLOWED_TAGS:t.allowedTags},...t.allowedAttrs&&{ALLOWED_ATTR:t.allowedAttrs},...void 0!==t.allowDataAttrs&&{ALLOW_DATA_ATTR:t.allowDataAttrs}};try{return window.DOMPurify.sanitize(e,s)}catch(t){return console.error("DOMPurify sanitisation failed:",t),o(e)}}return console.warn("DOMPurify not available. Using HTML escape fallback. For better XSS protection, include DOMPurify."),o(e)}"undefined"==typeof window||c()||!1===s("purifyWarning",!0)||console.warn("%c⚠️ Security Warning: DOMPurify not loaded","color: orange; font-weight: bold; font-size: 14px;","\nFor robust XSS protection, include DOMPurify before Domma:",'\n<script src="https://cdn.jsdelivr.net/npm/dompurify@3/dist/purify.min.js"><\/script>',"\nCurrently using HTML escape fallback.");var p={sanitise:u,sanitiseBasic:function(e){return u(e,{preset:"basic"})},sanitiseUserContent:function(e){return u(e,{preset:"strict"})},escape:function(e){return o(e)},hasDOMPurify:function(){return c()},isSafeUrl:l,safeUrl:a};const m={TABLE:["<table>","</table>",""],THEAD:["<table><thead>","</thead></table>",":scope > thead"],TBODY:["<table><tbody>","</tbody></table>",":scope > tbody"],TFOOT:["<table><tfoot>","</tfoot></table>",":scope > tfoot"],TR:["<table><tbody><tr>","</tr></tbody></table>",":scope > tbody > tr"],COLGROUP:["<table><colgroup>","</colgroup></table>",":scope > colgroup"]};class f{constructor(e,t){if("string"==typeof e)if(e.trim().startsWith("<")){const t=document.createElement("div");t.innerHTML=e.trim(),this.elements=Array.from(t.children)}else{const n=t||document;this.elements=Array.from(n.querySelectorAll(e))}else e instanceof Node?this.elements=[e]:e instanceof NodeList||e instanceof HTMLCollection?this.elements=Array.from(e):Array.isArray(e)?this.elements=e.filter(e=>e instanceof HTMLElement):this.elements=e instanceof f?[...e.elements]:[];this.length=this.elements.length;for(let e=0;e<this.elements.length;e++)this[e]=this.elements[e]}find(e){const t=[];return this.elements.forEach(n=>{t.push(...n.querySelectorAll(e))}),new f(t)}children(e){const t=[];return this.elements.forEach(e=>{t.push(...e.children)}),new f(e?t.filter(t=>t.matches(e)):t)}parent(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&(e&&!n.parentElement.matches(e)||t.includes(n.parentElement)||t.push(n.parentElement))}),new f(t)}parents(e){const t=[];return this.elements.forEach(n=>{let s=n.parentElement;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.parentElement}),new f(t)}closest(e){const t=[];return this.elements.forEach(n=>{const s=n.closest(e);s&&!t.includes(s)&&t.push(s)}),new f(t)}siblings(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&Array.from(n.parentElement.children).forEach(s=>{s===n||t.includes(s)||e&&!s.matches(e)||t.push(s)})}),new f(t)}next(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new f(t)}nextAll(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.nextElementSibling}),new f(t)}prev(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new f(t)}prevAll(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.unshift(s),s=s.previousElementSibling}),new f(t)}first(){return new f(this.elements[0]?[this.elements[0]]:[])}last(){return new f(this.elements.length?[this.elements[this.elements.length-1]]:[])}eq(e){const t=e<0?this.elements.length+e:e;return new f(this.elements[t]?[this.elements[t]]:[])}get(e){if(void 0===e)return this.elements;const t=e<0?this.elements.length+e:e;return this.elements[t]}filter(e){return new f("function"==typeof e?this.elements.filter((t,n)=>e.call(t,n,t)):this.elements.filter(t=>t.matches(e)))}not(e){return new f("function"==typeof e?this.elements.filter((t,n)=>!e.call(t,n,t)):this.elements.filter(t=>!t.matches(e)))}is(e){return this.elements.some(t=>t.matches(e))}has(e){return new f(this.elements.filter(t=>t.querySelector(e)))}add(e){const t=new f(e),n=[...this.elements];return t.elements.forEach(e=>{n.includes(e)||n.push(e)}),new f(n)}contents(){const e=[];return this.elements.forEach(t=>{e.push(...t.childNodes)}),new f(e)}toArray(){return[...this.elements]}index(e){if(void 0===e){const e=this.elements[0];return e&&e.parentElement?Array.from(e.parentElement.children).indexOf(e):-1}return"string"==typeof e?new f(e).elements.indexOf(this.elements[0]):this.elements.indexOf(e)}each(e){return this.elements.forEach((t,n)=>e.call(t,n,t)),this}html(e,t={}){if(void 0===e){const e=this.elements[0];return e?e.innerHTML:""}if(!1===t.safe)return this.each((t,n)=>{n.innerHTML=e});const n=p.sanitise(e,t);return this.each((s,i)=>{i.innerHTML=m[i.tagName]?function(e,t,n){const s=()=>p.sanitise(t,n),i=m[e.tagName];if(!i||!p.hasDOMPurify()||null==t||""===t)return s();const[o,r,a]=i,l=document.createElement("template");l.innerHTML=p.sanitise(o+String(t)+r,n);const c=l.content.childNodes,h=1===c.length?c[0]:null;if(!h||"TABLE"!==h.nodeName)return s();const d=a?h.querySelector(a):h;return d?d.innerHTML:s()}(i,e,t):n})}text(e){return void 0===e?this.elements.map(e=>e.textContent).join(""):this.each((t,n)=>{n.textContent=e})}val(e){if(void 0===e){const e=this.elements[0];if(!e)return;return"checkbox"===e.type||"radio"===e.type?e.checked?e.value:void 0:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}return this.each((t,n)=>{"checkbox"===n.type||"radio"===n.type?n.checked=Array.isArray(e)?e.includes(n.value):n.value===e:"SELECT"===n.tagName&&n.multiple&&Array.isArray(e)?Array.from(n.options).forEach(t=>{t.selected=e.includes(t.value)}):n.value=e})}attr(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.setAttribute(e,t)})}):void 0===t?this.elements[0]?this.elements[0].getAttribute(e):void 0:this.each((n,s)=>{s.setAttribute(e,t)})}removeAttr(e){const t=e.split(/\s+/);return this.each((e,n)=>{t.forEach(e=>n.removeAttribute(e))})}prop(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n[e]=t})}):void 0===t?this.elements[0]?this.elements[0][e]:void 0:this.each((n,s)=>{s[e]=t})}removeProp(e){return this.each((t,n)=>{delete n[e]})}data(e,t){if(void 0===e){const e=this.elements[0];if(!e)return;const t={};return Object.keys(e.dataset).forEach(n=>{t[n]=e.dataset[n]}),t}return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.dataset[e]=t})}):void 0===t?this.elements[0]?this.elements[0].dataset[e]:void 0:this.each((n,s)=>{s.dataset[e]=t})}removeData(e){return this.each((t,n)=>{delete n.dataset[e]})}css(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.style[e]=t})}):void 0===t?this.elements[0]?getComputedStyle(this.elements[0])[e]:"":this.each((n,s)=>{s.style[e]=t})}addClass(e){if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.add(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.add(...t)})}removeClass(e){if(void 0===e)return this.each((e,t)=>{t.className=""});if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.remove(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.remove(...t)})}toggleClass(e,t){if("function"==typeof e)return this.each((n,s)=>{const i=e.call(s,n,s.className,t);i&&i.split(/\s+/).filter(Boolean).forEach(e=>{s.classList.toggle(e,t)})});const n=e.split(/\s+/).filter(Boolean);return this.each((e,s)=>{n.forEach(e=>{s.classList.toggle(e,t)})})}hasClass(e){return this.elements.some(t=>t.classList.contains(e))}append(e){const t=this.elements.length-1;return this.each((n,s)=>{this._getNodes(e,n,s,n===t).forEach(e=>s.appendChild(e))})}prepend(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.firstChild;i.forEach(e=>s.insertBefore(e,o))})}after(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode,r=s.nextSibling;i.forEach(e=>o.insertBefore(e,r))})}before(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode;i.forEach(e=>o.insertBefore(e,s))})}appendTo(e){return new f(e).append(this),this}prependTo(e){return new f(e).prepend(this),this}insertAfter(e){return new f(e).after(this),this}insertBefore(e){return new f(e).before(this),this}wrap(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);n.parentNode&&(n.parentNode.insertBefore(s,n),s.appendChild(n))})}wrapAll(e){if(0===this.elements.length)return this;const t=this._getWrapper(e,0,this.elements[0]);return this.elements[0].parentNode.insertBefore(t,this.elements[0]),this.elements.forEach(e=>t.appendChild(e)),this}wrapInner(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);for(;n.firstChild;)s.appendChild(n.firstChild);n.appendChild(s)})}unwrap(e){return this.parent(e).each((e,t)=>{const n=t.parentNode;for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}),this}remove(e){return(e?this.filter(e):this).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this}detach(){return this.remove()}empty(){return this.each((e,t)=>{t.innerHTML=""})}clone(e=!0){return new f(this.elements.map(t=>t.cloneNode(e)))}replaceWith(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode;i.forEach((e,t)=>{0===t?o.replaceChild(e,s):o.insertBefore(e,i[t-1].nextSibling)})})}replaceAll(e){return new f(e).replaceWith(this),this}_getNodes(e,t,n,s=!0){if("function"==typeof e&&(e=e.call(n,t,n.innerHTML)),"string"==typeof e){if(e.trim().startsWith("<")){const t=document.createElement("div");return t.innerHTML=e,Array.from(t.childNodes)}return[document.createTextNode(e)]}return e instanceof HTMLElement?[s?e:e.cloneNode(!0)]:e instanceof f?e.elements.map(e=>s?e:e.cloneNode(!0)):[]}_getWrapper(e,t,n){let s;if("function"==typeof e&&(e=e.call(n,t)),"string"==typeof e){const t=document.createElement("div");t.innerHTML=e.trim(),s=t.firstElementChild}else s=e instanceof HTMLElement?e.cloneNode(!0):e instanceof f?e.elements[0].cloneNode(!0):document.createElement("div");return s}on(e,t,n){"function"==typeof t&&(n=t,t=null);const s=e.split(/\s+/);return this.each((e,i)=>{s.forEach(e=>{if(t){const s=e=>{const s=e.target.closest(t);s&&i.contains(s)&&n.call(s,e)};i.addEventListener(e,s),i._dommaHandlers=i._dommaHandlers||[],i._dommaHandlers.push({event:e,selector:t,handler:n,delegated:s})}else i.addEventListener(e,n)})})}off(e,t,n){return"function"==typeof t&&(n=t,t=null),this.each((s,i)=>{if(e){e.split(/\s+/).forEach(e=>{t&&i._dommaHandlers?i._dommaHandlers=i._dommaHandlers.filter(s=>!!(s.event!==e||s.selector!==t||n&&s.handler!==n)||(i.removeEventListener(e,s.delegated),!1)):n&&i.removeEventListener(e,n)})}})}one(e,t,n){"function"==typeof t&&(n=t,t=null);const s=this,i=function(o){n.call(this,o),s.off(e,t,i)};return this.on(e,t,i)}trigger(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.each((e,t)=>{t.dispatchEvent(n)})}triggerNative(e){return this.each((t,n)=>{const s=new Event(e,{bubbles:!0,cancelable:!0});n.dispatchEvent(s)})}click(e){return e?this.on("click",e):this.triggerNative("click")}dblclick(e){return e?this.on("dblclick",e):this.trigger("dblclick")}mousedown(e){return e?this.on("mousedown",e):this.trigger("mousedown")}mouseup(e){return e?this.on("mouseup",e):this.trigger("mouseup")}mousemove(e){return e?this.on("mousemove",e):this.trigger("mousemove")}mouseover(e){return e?this.on("mouseover",e):this.trigger("mouseover")}mouseout(e){return e?this.on("mouseout",e):this.trigger("mouseout")}mouseenter(e){return e?this.on("mouseenter",e):this.trigger("mouseenter")}mouseleave(e){return e?this.on("mouseleave",e):this.trigger("mouseleave")}keydown(e){return e?this.on("keydown",e):this.trigger("keydown")}keyup(e){return e?this.on("keyup",e):this.trigger("keyup")}keypress(e){return e?this.on("keypress",e):this.trigger("keypress")}focus(e){return e?this.on("focus",e):this.each((e,t)=>t.focus())}blur(e){return e?this.on("blur",e):this.each((e,t)=>t.blur())}change(e){return e?this.on("change",e):this.trigger("change")}select(e){return e?this.on("select",e):this.trigger("select")}submit(e){return e?this.on("submit",e):this.each((e,t)=>{t.submit&&t.submit()})}scroll(e){return e?this.on("scroll",e):this.trigger("scroll")}resize(e){return e?this.on("resize",e):this.trigger("resize")}hover(e,t){return this.on("mouseenter",e),t?this.on("mouseleave",t):this.on("mouseleave",e),this}show(e,t){return this.each((n,s)=>{e?(s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",t&&setTimeout(()=>t.call(s),this._getDuration(e))})):(s.style.display="",t&&t.call(s))})}hide(e,t){return this.each((n,s)=>{e?(s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))):(s.style.display="none",t&&t.call(s))})}toggle(e,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new f(s).show(e,t):new f(s).hide(e,t)})}fadeIn(e=400,t){return this.each((n,s)=>{s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",setTimeout(()=>{s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}fadeOut(e=400,t){return this.each((n,s)=>{s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})}fadeToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display||"0"===getComputedStyle(s).opacity?new f(s).fadeIn(e,t):new f(s).fadeOut(e,t)})}fadeTo(e,t,n){return this.each((s,i)=>{i.style.display="",i.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{i.style.opacity=String(t),setTimeout(()=>{i.style.transition="",n&&n.call(i)},this._getDuration(e))})})}slideUp(e=400,t){return this.each((n,s)=>{const i=s.offsetHeight;s.style.overflow="hidden",s.style.height=i+"px",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height="0",setTimeout(()=>{s.style.display="none",s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideDown(e=400,t){return this.each((n,s)=>{s.style.display="";const i=s.scrollHeight;s.style.overflow="hidden",s.style.height="0",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height=i+"px",setTimeout(()=>{s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new f(s).slideDown(e,t):new f(s).slideUp(e,t)})}animate(e,t=400,n="ease",s){"function"==typeof t?(s=t,t=400,n="ease"):"function"==typeof n&&(s=n,n="ease");const i=Object.keys(e).join(", "),o=this._getDuration(t);return this.each((t,r)=>{r.style.transition=`${i} ${o}ms ${n}`,requestAnimationFrame(()=>{Object.entries(e).forEach(([e,t])=>{r.style[e]="number"==typeof t?t+"px":t}),setTimeout(()=>{r.style.transition="",s&&s.call(r)},o)})})}stop(){return this.each((e,t)=>{const n=getComputedStyle(t);t.style.transition="none",["opacity","height","width"].forEach(e=>{t.style[e]&&(t.style[e]=n[e])})})}delay(e){return new Promise(t=>{setTimeout(()=>t(this),e)})}_getDuration(e){return"number"==typeof e?e:"fast"===e?200:"slow"===e?600:400}width(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().width}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new f(n).width()):e;n.style.width="number"==typeof s?s+"px":s})}height(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().height}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new f(n).height()):e;n.style.height="number"==typeof s?s+"px":s})}innerWidth(){const e=this.elements[0];return e?e.clientWidth:void 0}innerHeight(){const e=this.elements[0];return e?e.clientHeight:void 0}outerWidth(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetWidth;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginLeft)+parseFloat(e.marginRight)}return n}outerHeight(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetHeight;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginTop)+parseFloat(e.marginBottom)}return n}offset(e){if(void 0===e){const e=this.elements[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}return this.each((t,n)=>{"static"===getComputedStyle(n).position&&(n.style.position="relative");const s=new f(n).offset(),i=parseFloat(getComputedStyle(n).left)||0,o=parseFloat(getComputedStyle(n).top)||0;void 0!==e.left&&(n.style.left=i+e.left-s.left+"px"),void 0!==e.top&&(n.style.top=o+e.top-s.top+"px")})}position(){const e=this.elements[0];if(e)return{top:e.offsetTop,left:e.offsetLeft}}scrollTop(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageYOffset:e.scrollTop}return this.each((t,n)=>{n===window?window.scrollTo(window.pageXOffset,e):n.scrollTop=e})}scrollLeft(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageXOffset:e.scrollLeft}return this.each((t,n)=>{n===window?window.scrollTo(e,window.pageYOffset):n.scrollLeft=e})}offsetParent(){return new f(this.elements.map(e=>e.offsetParent||document.body))}}const _=(e,t)=>"function"==typeof e?("loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(),new f([])):new f(e,t);function g(e){if(!e)return{};if("function"==typeof e.forEach&&!Array.isArray(e)&&"function"==typeof e.get){const t={};return e.forEach((e,n)=>{t[n]=e}),t}return Array.isArray(e)?Object.fromEntries(e):{...e}}async function v(e,t){if("HEAD"===t||204===e.status||205===e.status||304===e.status)return null;const n=e.headers,s=n&&"function"==typeof n.get?n.get("content-type")||"":null;if(null===s||"function"!=typeof e.text)return e.json();if("0"===n.get("content-length"))return null;const i=await e.text();if(""===i)return null;if(/[/+]json\b/i.test(s))return JSON.parse(i);if(s)return i;try{return JSON.parse(i)}catch{return i}}const b={async request(e,t,n=null,s={}){const{headers:i,silent:o,timeout:r,credentials:a,signal:l,...c}=s||{},h={...c,method:e,headers:g(i),credentials:a||"same-origin"};null!=n&&"GET"!==e&&"HEAD"!==e&&(!function(e){return"undefined"!=typeof FormData&&e instanceof FormData||"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams||"undefined"!=typeof Blob&&e instanceof Blob||!("undefined"==typeof ArrayBuffer||!(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))||"undefined"!=typeof ReadableStream&&e instanceof ReadableStream}(n)?(function(e,t){const n=t.toLowerCase();return Object.keys(e).some(e=>e.toLowerCase()===n)}(h.headers,"Content-Type")||(h.headers["Content-Type"]="application/json"),h.body=JSON.stringify(n)):h.body=n);let d=null,u=null;r>0&&"undefined"!=typeof AbortController?(u=new AbortController,d=setTimeout(()=>{const e="undefined"!=typeof DOMException?new DOMException(`Request timed out after ${r}ms`,"TimeoutError"):Object.assign(new Error(`Request timed out after ${r}ms`),{name:"TimeoutError"});u.abort(e)},r),l&&(l.aborted?u.abort(l.reason):l.addEventListener("abort",()=>u.abort(l.reason),{once:!0})),h.signal=u.signal):l&&(h.signal=l);try{const n=await fetch(t,h);if(!n.ok){let t,s=`HTTP Error: ${n.status}`;try{if(t=await v(n,e),null===t||"object"!=typeof t)throw new Error("not JSON");t.message?s=t.message:t.error&&(s=t.error)}catch(e){s=`HTTP Error: ${n.status} ${n.statusText}`}const i=new Error(s);throw i.status=n.status,i.statusText=n.statusText,i.body=t,i}return await v(n,e)}catch(e){throw o||console.error("Domma HTTP Error:",e),e}finally{d&&clearTimeout(d)}},get(e,t){return this.request("GET",e,null,t)},post(e,t,n){return this.request("POST",e,t,n)},put(e,t,n){return this.request("PUT",e,t,n)},patch(e,t,n){return this.request("PATCH",e,t,n)},delete(e,t){const{data:n=null,...s}=t||{};return this.request("DELETE",e,n,s)},head(e,t){return this.request("HEAD",e,null,t)},options(e,t){return this.request("OPTIONS",e,null,t)}},y={chunk(e,t=1){if(!e||t<1)return[];const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n},compact:e=>e?e.filter(Boolean):[],concat:(e,...t)=>e?e.concat(...t):[],difference(e,...t){if(!e)return[];const n=new Set(t.flat());return e.filter(e=>!n.has(e))},differenceBy(e,t,n){if(!e)return[];const s=new Set(t.map(n));return e.filter(e=>!s.has(n(e)))},differenceWith:(e,t,n)=>e?e.filter(e=>!t.some(t=>n(e,t))):[],drop:(e,t=1)=>e?e.slice(t):[],dropRight(e,t=1){if(!e)return[];const n=e.length-t;return n>0?e.slice(0,n):[]},dropRightWhile(e,t){if(!e)return[];let n=e.length;for(;n--&&t(e[n],n,e););return e.slice(0,n+1)},dropWhile(e,t){if(!e)return[];let n=0;for(;n<e.length&&t(e[n],n,e);)n++;return e.slice(n)},eq:(e,t)=>e===t||e!=e&&t!=t,fill:(e,t,n=0,s)=>e?e.fill(t,n,s):[],findIndex(e,t,n=0){if(!e)return-1;for(let s=n;s<e.length;s++)if(t(e[s],s,e))return s;return-1},findLastIndex(e,t,n){if(!e)return-1;for(let s=void 0!==n?n:e.length-1;s>=0;s--)if(t(e[s],s,e))return s;return-1},first:e=>e?e[0]:void 0,head(e){return this.first(e)},flatten:e=>e?e.flat(1):[],flattenDeep:e=>e?e.flat(1/0):[],flattenDepth:(e,t=1)=>e?e.flat(t):[],fromPairs:e=>e?Object.fromEntries(e):{},indexOf:(e,t,n=0)=>e?e.indexOf(t,n):-1,initial:e=>e?e.slice(0,-1):[],intersection(...e){if(!e.length)return[];return e[0].filter(t=>e.every(e=>e.includes(t)))},join:(e,t=",")=>e?e.join(t):"",last:e=>e?e[e.length-1]:void 0,lastIndexOf:(e,t,n)=>e?void 0!==n?e.lastIndexOf(t,n):e.lastIndexOf(t):-1,nth(e,t=0){if(e)return t<0?e[e.length+t]:e[t]},pull(e,...t){if(!e)return[];const n=new Set(t);for(let t=e.length-1;t>=0;t--)n.has(e[t])&&e.splice(t,1);return e},pullAt(e,...t){if(!e)return[];const n=t.flat().sort((e,t)=>t-e),s=[];return n.forEach(t=>{t>=0&&t<e.length&&s.unshift(e.splice(t,1)[0])}),s},reverse:e=>e?e.reverse():[],slice:(e,t=0,n)=>e?void 0!==n?e.slice(t,n):e.slice(t):[],tail:e=>e?e.slice(1):[],take:(e,t=1)=>e?e.slice(0,t):[],takeRight(e,t=1){if(!e)return[];const n=Math.max(0,e.length-t);return e.slice(n)},union:(...e)=>[...new Set(e.flat())],uniq:e=>e?[...new Set(e)]:[],uniqBy(e,t){if(!e)return[];const n=new Set;return e.filter(e=>{const s=t(e);return!n.has(s)&&(n.add(s),!0)})},without(e,...t){if(!e)return[];const n=new Set(t);return e.filter(e=>!n.has(e))},xor(...e){if(!e.length)return[];const t=new Map;return e.flat().forEach(e=>{t.set(e,(t.get(e)||0)+1)}),[...t.entries()].filter(([,e])=>1===e).map(([e])=>e)},zip(...e){if(!e.length)return[];const t=Math.max(...e.map(e=>e.length)),n=[];for(let s=0;s<t;s++)n.push(e.map(e=>e[s]));return n},zipObject(e,t){if(!e)return{};const n={};return e.forEach((e,s)=>{n[e]=t?t[s]:void 0}),n},times(e,t){if((e=Math.floor(e))<1)return[];const n=new Array(e);for(let s=0;s<e;s++)n[s]=t?t(s):s;return n},range(e,t,n){if(void 0===t&&(t=e,e=0),0===(n=void 0===n?e<t?1:-1:n))return[];const s=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(s);for(let t=0;t<s;t++)i[t]=e+t*n;return i},uniqueId:(()=>{let e=0;return function(t=""){const n=++e;return t?`${t}${n}`:String(n)}})(),countBy(e,t){const n={};return this.each(e,e=>{const s=t(e);n[s]=(n[s]||0)+1}),n},each:(e,t)=>(Array.isArray(e)?e.forEach((n,s)=>t(n,s,e)):e&&"object"==typeof e&&Object.keys(e).forEach(n=>t(e[n],n,e)),e),forEach(e,t){return this.each(e,t)},eachRight(e,t){if(Array.isArray(e))for(let n=e.length-1;n>=0;n--)t(e[n],n,e);else if(e&&"object"==typeof e){Object.keys(e).reverse().forEach(n=>t(e[n],n,e))}return e},forEachRight(e,t){return this.eachRight(e,t)},every:(e,t)=>Array.isArray(e)?e.every(t):!e||"object"!=typeof e||Object.values(e).every(t),filter:(e,t)=>Array.isArray(e)?e.filter(t):e&&"object"==typeof e?Object.values(e).filter(t):[],find:(e,t)=>Array.isArray(e)?e.find(t):e&&"object"==typeof e?Object.values(e).find(t):void 0,findLast(e,t){if(Array.isArray(e)){for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return e[n]}else if(e&&"object"==typeof e){return Object.values(e).reverse().find(t)}},flatMap(e,t){return this.map(e,t).flat(1)},flatMapDeep(e,t){return this.map(e,t).flat(1/0)},groupBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]||(n[s]=[]),n[s].push(e)}),n},includes:(e,t,n=0)=>"string"==typeof e||Array.isArray(e)?e.includes(t,n):!(!e||"object"!=typeof e)&&Object.values(e).includes(t),keyBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]=e}),n},map:(e,t)=>Array.isArray(e)?e.map(t):e&&"object"==typeof e?Object.entries(e).map(([n,s])=>t(s,n,e)):[],orderBy(e,t,n){const s=Array.isArray(e)?[...e]:Object.values(e),i=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n||"asc"];return s.sort((e,t)=>{for(let n=0;n<i.length;n++){const s=i[n],r=o[n]||"asc",a="function"==typeof s?s(e):e[s],l="function"==typeof s?s(t):t[s];if(a<l)return"asc"===r?-1:1;if(a>l)return"asc"===r?1:-1}return 0})},partition(e,t){const n=[],s=[];return this.each(e,(i,o)=>{t(i,o,e)?n.push(i):s.push(i)}),[n,s]},reduce(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduce(t,n):e.reduce(t);if(e&&"object"==typeof e){const s=Object.entries(e);let i=n,o=0;void 0===i&&s.length>0&&(i=s[0][1],o=1);for(let n=o;n<s.length;n++){const[o,r]=s[n];i=t(i,r,o,e)}return i}return n},reduceRight(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduceRight(t,n):e.reduceRight(t);if(e&&"object"==typeof e){const s=Object.entries(e).reverse();let i=n,o=0;void 0===i&&s.length>0&&(i=s[0][1],o=1);for(let n=o;n<s.length;n++){const[o,r]=s[n];i=t(i,r,o,e)}return i}return n},reject(e,t){return this.filter(e,(e,n,s)=>!t(e,n,s))},sample(e){const t=Array.isArray(e)?e:Object.values(e||{});return t[Math.floor(Math.random()*t.length)]},sampleSize(e,t=1){return this.shuffle(Array.isArray(e)?[...e]:Object.values(e||{})).slice(0,t)},shuffle(e){const t=Array.isArray(e)?[...e]:Object.values(e||{});for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},size:e=>null==e?0:"string"==typeof e||Array.isArray(e)?e.length:"object"==typeof e?Object.keys(e).length:0,some:(e,t)=>Array.isArray(e)?e.some(t):!(!e||"object"!=typeof e)&&Object.values(e).some(t),sortBy:(e,t)=>(Array.isArray(e)?[...e]:Object.values(e)).sort((e,n)=>{const s="function"==typeof t?t(e):e[t],i="function"==typeof t?t(n):n[t];return s<i?-1:s>i?1:0}),after(e,t){let n=0;return function(...s){if(++n>=e)return t.apply(this,s)}},ary:(e,t=e.length)=>function(...n){return e.apply(this,n.slice(0,t))},before(e,t){let n,s=0;return function(...i){return++s<e&&(n=t.apply(this,i)),n}},bind:(e,t,...n)=>function(...s){return e.apply(t,[...n,...s])},curry:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...s,...e])}},curryRight:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...e,...s])}},debounce(e,t=0,n={}){let s,i,o,r,a,l=0;const c=n.leading||!1,h=!1!==n.trailing,d=n.maxWait;function u(t){const n=i,s=o;return i=o=void 0,l=t,r=e.apply(s,n),r}function p(e){const n=e-a;return void 0===a||n>=t||n<0||void 0!==d&&e-l>=d}function m(){const e=Date.now();if(p(e))return f(e);s=setTimeout(m,function(e){const n=e-a,s=e-l,i=t-n;return void 0!==d?Math.min(i,d-s):i}(e))}function f(e){return s=void 0,h&&i?u(e):(i=o=void 0,r)}function _(...e){const n=Date.now(),h=p(n);if(i=e,o=this,a=n,h){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),c?u(e):r}(a);if(void 0!==d)return s=setTimeout(m,t),u(a)}return void 0===s&&(s=setTimeout(m,t)),r}return _.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=a=o=s=void 0},_.flush=function(){return void 0===s?r:f(Date.now())},_},defer(e,...t){return setTimeout(()=>e.apply(this,t),1)},delay(e,t,...n){return setTimeout(()=>e.apply(this,n),t)},flip:e=>function(...t){return e.apply(this,t.reverse())},flow(...e){const t=e.length;return 0===t?function(e){return e}:1===t?e[0]:function(...n){let s=e[0].apply(this,n);for(let n=1;n<t;n++)s=e[n].call(this,s);return s}},compose(...e){return this.flow(...e.reverse())},memoize(e,t){const n=new Map,s=function(...s){const i=t?t.apply(this,s):s[0];if(n.has(i))return n.get(i);const o=e.apply(this,s);return n.set(i,o),o};return s.cache=n,s},negate:e=>function(...t){return!e.apply(this,t)},once(e){return this.before(2,e)},partial:(e,...t)=>function(...n){return e.apply(this,[...t,...n])},partialRight:(e,...t)=>function(...n){return e.apply(this,[...n,...t])},throttle(e,t=0,n={}){const s=!1!==n.leading,i=!1!==n.trailing;return this.debounce(e,t,{leading:s,trailing:i,maxWait:t})},unary(e){return this.ary(e,1)},wrap:(e,t)=>function(...n){return t.apply(this,[e,...n])},assign:(e,...t)=>Object.assign(e||{},...t),assignIn(e,...t){const n=e||{};return t.forEach(e=>{if(e)for(const t in e)n[t]=e[t]}),n},extend(e,...t){return this.assignIn(e,...t)},at(e,...t){return t.flat().map(t=>this.get(e,t))},clone:e=>null===e||"object"!=typeof e?e:Array.isArray(e)?[...e]:{...e},cloneDeep(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>this.cloneDeep(e));if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=this.cloneDeep(e[n]));return t},defaults(e,...t){const n=e||{};return t.forEach(e=>{e&&Object.keys(e).forEach(t=>{void 0===n[t]&&(n[t]=e[t])})}),n},defaultsDeep(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],i=e[t];void 0===s?n[t]=this.cloneDeep(i):s&&"object"==typeof s&&i&&"object"==typeof i&&!Array.isArray(s)&&!Array.isArray(i)&&this.defaultsDeep(s,i)})}),n},entries:e=>e?Object.entries(e):[],toPairs(e){return this.entries(e)},findKey(e,t){if(e)for(const n of Object.keys(e))if(t(e[n],n,e))return n},findLastKey(e,t){if(!e)return;const n=Object.keys(e).reverse();for(const s of n)if(t(e[s],s,e))return s},forIn(e,t){if(e)for(const n in e)if(!1===t(e[n],n,e))break;return e},forOwn(e,t){if(e)for(const n of Object.keys(e))if(!1===t(e[n],n,e))break;return e},get(e,t,n){if(!e)return n;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let i=e;for(const e of s){if(null==i)return n;i=i[e]}return void 0===i?n:i},has(e,t){if(!e)return!1;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(const e of n){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;s=s[e]}return!0},invert(e){const t={};return e&&Object.entries(e).forEach(([e,n])=>{t[n]=e}),t},invertBy(e,t=e=>e){const n={};return e&&Object.entries(e).forEach(([e,s])=>{const i=t(s);n[i]||(n[i]=[]),n[i].push(e)}),n},keys:e=>e?Object.keys(e):[],keysIn(e){const t=[];for(const n in e)t.push(n);return t},mapKeys(e,t){const n={};return e&&Object.entries(e).forEach(([s,i])=>{n[t(i,s,e)]=i}),n},mapValues(e,t){const n={};return e&&Object.entries(e).forEach(([s,i])=>{n[s]=t(i,s,e)}),n},merge(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],i=e[t];s&&"object"==typeof s&&i&&"object"==typeof i&&!Array.isArray(s)&&!Array.isArray(i)?this.merge(s,i):n[t]=i})}),n},omit(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return Object.keys(e).forEach(t=>{n.has(t)||(s[t]=e[t])}),s},omitBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)||(n[e]=s)}),n},pick(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return n.forEach(t=>{t in e&&(s[t]=e[t])}),s},pickBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)&&(n[e]=s)}),n},set(e,t,n){if(!e)return e;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let i=e;for(let e=0;e<s.length-1;e++){const t=s[e],n=s[e+1];t in i&&null!==i[t]&&"object"==typeof i[t]||(i[t]=/^\d+$/.test(n)?[]:{}),i=i[t]}return i[s[s.length-1]]=n,e},unset(e,t){if(!e)return!0;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(let e=0;e<n.length-1;e++){const t=n[e];if(!(t in s))return!0;s=s[t]}return delete s[n[n.length-1]]},setIfUndefined(e,t,n){return void 0===this.get(e,t)&&this.set(e,t,n),e},values:e=>e?Object.values(e):[],valuesIn(e){const t=[];for(const n in e)t.push(e[n]);return t},isArray:e=>Array.isArray(e),isBoolean:e=>"boolean"==typeof e||e instanceof Boolean,isDate:e=>e instanceof Date,isEmpty:e=>null==e||(Array.isArray(e)||"string"==typeof e?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"!=typeof e||0===Object.keys(e).length),isEqual(e,t){if(e===t)return!0;if(null===e||null===t)return e===t;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>this.isEqual(e,t[n]));if(Array.isArray(e)||Array.isArray(t))return!1;const n=Object.keys(e),s=Object.keys(t);return n.length===s.length&&n.every(n=>this.isEqual(e[n],t[n]))},isMatch(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t);for(const s of n){const n=e[s],i=t[s];if("object"==typeof i&&null!==i){if(!this.isMatch(n,i))return!1}else if(n!==i)return!1}return!0},isFinite:e=>Number.isFinite(e),isFunction:e=>"function"==typeof e,isInteger:e=>Number.isInteger(e),isNaN:e=>Number.isNaN(e),isNil:e=>null==e,isNull:e=>null===e,isNumber:e=>"number"==typeof e||e instanceof Number,isObject:e=>null!==e&&"object"==typeof e,isPlainObject(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},isRegExp:e=>e instanceof RegExp,isString:e=>"string"==typeof e||e instanceof String,isSymbol:e=>"symbol"==typeof e,isUndefined:e=>void 0===e,parseInt:(e,t)=>(void 0===t&&(t=/^0x/i.test(e)?16:10),null==e?NaN:"number"==typeof e?Math.trunc(e):(e=String(e).trim(),parseInt(e,t))),toNumber(e){if("number"==typeof e)return e;if("symbol"==typeof e)return NaN;if(this.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=this.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.trim();const t=/^0b[01]+$/i.test(e),n=/^0o[0-7]+$/i.test(e),s=/^[-+]0x[0-9a-f]+$/i.test(e);return t||n?parseInt(e.slice(2),t?2:8):s?NaN:+e},toInteger(e){const t=this.toNumber(e);return Number.isNaN(t)?0:0!==t&&Number.isFinite(t)?Math.trunc(t):t},toFinite(e){const t=17976931348623157e292;if(!e)return 0===e?e:0;const n=this.toNumber(e);return n===1/0?t:n===-1/0?-t:n==n?n:0},toSafeInteger(e){const t=9007199254740991,n=this.toInteger(e);return n<-9007199254740991?-9007199254740991:n>t?t:n},toString(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>null==e?"":this.toString(e)).join(",");if("symbol"==typeof e)return e.toString();const t=String(e);return"0"===t&&1/e==-1/0?"-0":t},toArray(e){return e?this.isArray(e)?[...e]:"string"==typeof e?e.split(""):this.isObject(e)?"function"==typeof e[Symbol.iterator]?[...e]:Object.values(e):[]:[]},castArray(...e){if(!e.length)return[];const t=e[0];return this.isArray(t)?t:[t]},toLength(e){const t=4294967295,n=this.toInteger(e);return n<0?0:n>t?t:n},toPlainObject(e){const t={};for(const n in e)t[n]=e[n];return t},add:(e,t)=>e+t,ceil(e,t=0){const n=Math.pow(10,t);return Math.ceil(e*n)/n},divide:(e,t)=>e/t,floor(e,t=0){const n=Math.pow(10,t);return Math.floor(e*n)/n},max:e=>e&&e.length?Math.max(...e):void 0,maxBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])>("function"==typeof t?t(e):e[t])?n:e)},mean(e){return e&&e.length?this.sum(e)/e.length:NaN},meanBy(e,t){return e&&e.length?this.sumBy(e,t)/e.length:NaN},min:e=>e&&e.length?Math.min(...e):void 0,minBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])<("function"==typeof t?t(e):e[t])?n:e)},multiply:(e,t)=>e*t,round(e,t=0){const n=Math.pow(10,t);return Math.round(e*n)/n},subtract:(e,t)=>e-t,sum:e=>e?e.reduce((e,t)=>e+t,0):0,sumBy:(e,t)=>e?e.reduce((e,n)=>e+("function"==typeof t?t(n):n[t]),0):0,clamp:(e,t,n)=>(void 0===n&&(n=t,t=void 0),void 0!==t&&e<t?t:void 0!==n&&e>n?n:e),inRange:(e,t,n)=>(void 0===n&&(n=t,t=0),t>n&&([t,n]=[n,t]),e>=t&&e<n),random:(e=0,t=1,n)=>("boolean"==typeof e?(n=e,e=0,t=1):"boolean"==typeof t&&(n=t,t=e,e=0),e>t&&([e,t]=[t,e]),n||e%1!=0||t%1!=0?e+Math.random()*(t-e):e+Math.floor(Math.random()*(t-e+1))),camelCase:e=>e?e.replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()):"",capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",endsWith:(e,t,n)=>!!e&&(void 0!==n?e.slice(0,n).endsWith(t):e.endsWith(t)),escape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,e=>t[e])},kebabCase:e=>e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():"",lowerCase(e){return e?this.words(e).join(" ").toLowerCase():""},lowerFirst:e=>e?e.charAt(0).toLowerCase()+e.slice(1):"",pad(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s,o=Math.floor(i/2),r=i-o;return n.repeat(Math.ceil(o/n.length)).slice(0,o)+e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},padEnd(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s;return e+n.repeat(Math.ceil(i/n.length)).slice(0,i)},padStart(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s;return n.repeat(Math.ceil(i/n.length)).slice(0,i)+e},repeat:(e="",t=1)=>e.repeat(Math.max(0,Math.floor(t))),replace:(e="",t,n)=>e.replace(t,n),snakeCase(e){return e?this.words(e).join("_").toLowerCase():""},split:(e="",t,n)=>e.split(t,n),startCase(e){return e?this.words(e).map(e=>this.capitalize(e)).join(" "):""},startsWith:(e,t,n=0)=>!!e&&e.startsWith(t,n),toLower:e=>e?e.toLowerCase():"",toUpper:e=>e?e.toUpperCase():"",trim(e="",t){if(!t)return e.trim();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+|[${n}]+$`,"g"),"")},trimEnd(e="",t){if(!t)return e.trimEnd();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`[${n}]+$`,"g"),"")},trimStart(e="",t){if(!t)return e.trimStart();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+`,"g"),"")},truncate(e="",t={}){const n=t.length||30,s=t.omission||"...",i=t.separator;if(e.length<=n)return e;let o=n-s.length;if(o<1)return s;let r=e.slice(0,o);if(i){const e="string"==typeof i?r.lastIndexOf(i):r.search(new RegExp(i.source+"(?!.*"+i.source+")"));e>-1&&(r=r.slice(0,e))}return r+s},unescape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>t[e])},upperCase(e){return e?this.words(e).join(" ").toUpperCase():""},upperFirst:e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",words:(e="",t)=>t?e.match(t)||[]:(e=e.replace(/([a-z])([A-Z])/g,"$1 $2")).match(/[a-zA-Z0-9]+/g)||[],sprintf(e,...t){if(!e)return"";let n=0;return e.replace(/%(?:(\d+)\$)?([+-])?(\d+)?(?:\.(\d+))?([sdifojx%])/g,(e,s,i,o,r,a)=>{if("%"===a)return"%";const l=s?parseInt(s,10)-1:n++,c=t[l];if(void 0===c)return e;if(null===c)return"null";let h;switch(a){case"s":default:h=String(c);break;case"d":case"i":h=String(parseInt(c,10));break;case"f":const e=parseFloat(c);h=void 0!==r?e.toFixed(parseInt(r,10)):String(e);break;case"o":h=Object.prototype.toString.call(c);break;case"j":try{h=JSON.stringify(c)}catch(e){h="[Circular]"}break;case"x":h=parseInt(c,10).toString(16)}if(o){const e=parseInt(o,10),t="0"===i?"0":" ";h="-"===i?h.padEnd(e," "):h.padStart(e,t)}if("+"===i&&("d"===a||"i"===a||"f"===a)){parseFloat(h)>=0&&!h.startsWith("+")&&(h="+"+h)}return h})},format(e,...t){return this.sprintf(e,...t)},template(e,t={}){const{partials:n={},helpers:s={}}=t,i=e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),o=(e,t)=>"."===t?e:t.startsWith("@")?e[t]:t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:"",e),r=(e,t,a=null)=>{let l=e;return l=l.replace(/\{\{#with\s+([^}]+)\}\}([\s\S]*?)\{\{\/with\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return i&&"object"==typeof i?r(s,i,t):""}),l=l.replace(/\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return Array.isArray(i)?i.map((e,n)=>{const o="object"==typeof e?{...e,"@index":n,"@first":0===n,"@last":n===i.length-1}:{".":e,"@index":n,"@first":0===n,"@last":n===i.length-1};return r(s,o,t)}).join(""):""}),l=l.replace(/\{\{#if\s+([^}]+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g,(e,n,s,i="")=>{const l=o(t,n.trim()),c=Array.isArray(l)?l.length>0:Boolean(l);return r(c?s:i,t,a)}),l=l.replace(/\{\{#unless\s+([^}]+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return(Array.isArray(i)?0===i.length:!i)?r(s,t,a):""}),l=l.replace(/\{\{>\s*([^}]+)\}\}/g,(e,s)=>{const i=n[s.trim()];return i?r(i,t,a):""}),l=l.replace(/\{\{\{([^}]+)\}\}\}/g,(e,n)=>{const s=o(t,n.trim());return null!=s?String(s):""}),l=l.replace(/\{\{([^#/>][^}]*)\}\}/g,(e,n)=>{const r=n.trim(),a=r.match(/^(\w+)\s+(.+)$/);if(a&&s[a[1]]){const e=a[2].split(/\s+/).map(e=>/^["'].*["']$/.test(e)?e.slice(1,-1):o(t,e));return i(s[a[1]](...e))}const l=o(t,r);return i(l)}),l};return(t={})=>r(e,t)},render(e,t,n={}){return this.template(e,n)(t)},async copyToClipboard(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){}const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(e){return!1}finally{document.body.removeChild(t)}},escapeHtml:e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),chain(e){const t={_value:e,value(){return this._value}};["chunk","compact","concat","difference","drop","dropRight","fill","findIndex","findLastIndex","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","join","last","lastIndexOf","nth","pull","pullAll","pullAt","remove","reverse","slice","sortedIndex","sortedUniq","tail","take","takeRight","union","uniq","uniqBy","unzip","without","xor","zip","countBy","each","every","filter","find","findLast","flatMap","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","assign","assignIn","at","defaults","entries","extend","findKey","findLastKey","forIn","forOwn","functions","get","has","invert","invertBy","invoke","keys","mapKeys","mapValues","merge","omit","omitBy","pick","pickBy","result","set","toPairs","transform","unset","update","values","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return this._value=y[e](this._value,...t),this})});return["sum","mean","min","max","toArray","toJSON","toString"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return y[e](this._value,...t)})}),t}},k=new WeakMap;function w(e){return e?.constructor?.componentName||e?.componentName}function x(e,t){const n=function(e){return e&&k.get(e)||[]}(e);for(let e=n.length-1;e>=0;e--)if(!t||w(n[e])===t)return n[e];return null}function M(e,t){if(!e||"object"!=typeof e)return;const n=k.get(e)||[];n.includes(t)||n.push(t),k.set(e,n)}function L(e,t){if(!e)return;const n=k.get(e);if(!n)return;const s=n.filter(e=>e!==t);s.length?k.set(e,s):k.delete(e)}class C{static componentName="component";constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={...this.constructor.defaults,...t},this._eventHandlers=[],this._listeners={},this.element&&(this.element._dommaComponent=this,M(this.element,this))}on(e,t){return"function"==typeof t&&(this._listeners[e]||=[]).push(t),this}once(e,t){if("function"!=typeof t)return this;const n=(...s)=>(this.off(e,n),t.apply(this,s));return n._original=t,this.on(e,n)}off(e,t){return this._listeners[e]?(this._listeners[e]=t?this._listeners[e].filter(e=>e!==t&&e._original!==t):[],this):this}_notify(e,...t){let n=!0;for(const s of[...this._listeners?.[e]||[]])!1===s.apply(this,t)&&(n=!1);return n}_emit(e,...t){const n=this._notify(e,...t);if(!this.element||"undefined"==typeof CustomEvent||!this.element.dispatchEvent)return n;const s=this.constructor.componentName,i=this.element.dispatchEvent(new CustomEvent(`dm:${s}:${e}`,{bubbles:!0,cancelable:!0,detail:{instance:this,args:t}}));return n&&i}_fire(e,...t){const n=e.toLowerCase(),s=this._optionFor(n),i="function"==typeof s?s.apply(this.options,t):void 0,o=this._emit(n,...t);return!(!1===i||!o)&&i}_optionFor(e){for(const t of Object.keys(this.options))if(t.length>2&&t.startsWith("on")&&t.slice(2).toLowerCase()===e)return this.options[t];return this.options[`on${t=e,t.charAt(0).toUpperCase()+t.slice(1)}`];var t}_forcedClose(...e){this._forceClose=!0;try{return this.close(...e)}finally{this._forceClose=!1}}_mayClose(...e){return this._forceClose||!1!==this._fire("beforeclose",...e)}setOptions(e){return this.options={...this.options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}_addEventListener(e,t,n){e.addEventListener(t,n),this._eventHandlers.push({element:e,event:t,handler:n})}destroy(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[],this._listeners={},this.element&&(this.element._dommaComponent===this&&delete this.element._dommaComponent,L(this.element,this))}}class A extends C{static componentName="tree-view";static defaults={data:[],idKey:"id",parentKey:"parent_id",childrenKey:"children",labelKey:"name",iconKey:"icon",colorKey:"color",expandedByDefault:!0,expandedNodes:[],selectable:!0,multiSelect:!1,selectedNodes:[],renderNode:null,getBadge:null,getNodeIcon:null,getNodeClass:null,actions:[],indentSize:1.5,showIcons:!0,showToggleButtons:!0,toggleIcon:"chevron-down",onSelect:null,onDeselect:null,onExpand:null,onCollapse:null,onAction:null,onClick:null};constructor(e,t={}){super(e,t),this.element?(this._tree=[],this._flatMap={},this._expandedNodes=new Set,this._selectedNodes=new Set,this._init()):console.error("TreeView: Element not found",e)}_init(){this.element.classList.contains("dm-treeview")||this.element.classList.add("dm-treeview"),this.options.expandedNodes.length>0&&this.options.expandedNodes.forEach(e=>this._expandedNodes.add(e)),this.options.selectedNodes.length>0&&this.options.selectedNodes.forEach(e=>this._selectedNodes.add(e)),this.options.data&&this.options.data.length>0&&this.setData(this.options.data),this._setupEventListeners()}_setupEventListeners(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-node");if(!t||e.target.closest(".dm-treeview-toggle")||e.target.closest(".dm-treeview-action"))return;const n=this._parseNodeId(t.dataset.nodeId);this._handleSelect(n,e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-toggle");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId);this.toggle(n)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-action");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId),s=t.dataset.action;this._handleAction(s,n,e)}})}_buildTree(e){const t={},n=[],s=this.options.idKey,i=this.options.parentKey,o=this.options.childrenKey;return e.forEach(e=>{t[e[s]]={...e,[o]:[]}}),e.forEach(e=>{const r=t[e[s]],a=e[i];null==a?n.push(r):t[a]?t[a][o].push(r):n.push(r)}),this._sortTree(n),{tree:n,nodeMap:t}}_sortTree(e){const t=this.options.childrenKey,n=this.options.labelKey;e.sort((e,t)=>{const s=(e[n]||"").toLowerCase(),i=(t[n]||"").toLowerCase();return s.localeCompare(i)}),e.forEach(e=>{e[t]&&e[t].length>0&&this._sortTree(e[t])})}_render(){const e=this._tree.map(e=>this._renderNode(e,0)).join("");this.element.innerHTML=e}_renderNode(e,t){const n=this.options.idKey,s=this.options.childrenKey,i=e[n],o=e[s]&&e[s].length>0,r=this._expandedNodes.has(i),a=this._selectedNodes.has(i),l={isExpanded:r,isSelected:a,hasChildren:o},c=this.options.renderNode?this.options.renderNode(e,t,l):this._defaultRenderNode(e,t,l),h=this.options.getBadge?this.options.getBadge(e):null;let d=`\n <div class="dm-treeview-node ${a?"dm-treeview-node-selected":""} ${this.options.getNodeClass?this.options.getNodeClass(e):""}"\n data-node-id="${i}"\n data-depth="${t}"\n style="padding-left: ${t*this.options.indentSize}rem;">\n <div class="dm-treeview-node-content">\n ${o&&this.options.showToggleButtons?this._renderToggle(i,r):'<span class="dm-treeview-spacer"></span>'}\n ${c}\n ${null!=h?`<span class="dm-treeview-badge">${h}</span>`:""}\n </div>\n ${this.options.actions.length>0?this._renderActions(e):""}\n </div>\n `;return o&&r&&(d+=`<div class="dm-treeview-children" data-parent-id="${i}">`,e[s].forEach(e=>{d+=this._renderNode(e,t+1)}),d+="</div>"),d}_defaultRenderNode(e,t,n){const s=this.options.labelKey,i=this.options.iconKey,o=this.options.colorKey,r=e[s]||"",a=this.options.getNodeIcon?this.options.getNodeIcon(e):e[i],l=e[o];let c="";return this.options.showIcons&&a&&(c+=`<span class="dm-treeview-icon" data-icon="${this._escapeHtml(a)}" ${l?`style="color: ${this._escapeHtml(l)};"`:""}></span>`),c+=`<span class="dm-treeview-label">${this._escapeHtml(r)}</span>`,c}_renderToggle(e,t){return`\n <button type="button"\n class="dm-treeview-toggle ${t?"dm-treeview-expanded":"dm-treeview-collapsed"}"\n data-node-id="${e}"\n aria-label="${t?"Collapse":"Expand"}">\n <span data-icon="${this.options.toggleIcon}"></span>\n </button>\n `}_renderActions(e){const t=e[this.options.idKey],n=this.options.actions.filter(t=>"function"!=typeof t.visible||t.visible(e));if(0===n.length)return"";let s='<div class="dm-treeview-actions">';return n.forEach(e=>{s+=`\n <button type="button"\n class="dm-treeview-action"\n data-node-id="${t}"\n data-action="${e.name}"\n title="${e.tooltip||e.name}"\n aria-label="${e.tooltip||e.name}">\n ${e.icon?`<span data-icon="${e.icon}"></span>`:e.name}\n </button>\n `}),s+="</div>",s}_handleSelect(e,t){if(!this.options.selectable)return;const n=this._flatMap[e];if(!n)return;this._fire("click",e,n,t);const s=this._selectedNodes.has(e);this.options.multiSelect?s?this.deselect(e):this.select(e):s?this.deselect(e):(this.deselectAll(!0),this.select(e))}_handleAction(e,t,n){const s=this._flatMap[t];s&&this._fire("action",e,t,s,n)}_parseNodeId(e){const t=Number(e);return isNaN(t)||e!==t.toString()?e:t}_escapeHtml(e){return o(e)}setData(e){const{tree:t,nodeMap:n}=this._buildTree(e);return this._tree=t,this._flatMap=n,this.options.expandedByDefault&&Object.keys(n).forEach(e=>{const t=n[e],s=this.options.childrenKey;t[s]&&t[s].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this._render(),this}getData(){return this._tree}getFlatData(){return Object.values(this._flatMap)}refresh(){return this._render(),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&window.Domma.icons.scan(this.element),this}getNode(e){return this._flatMap[e]||null}updateNode(e,t){const n=this._flatMap[e];return n&&(Object.assign(n,t),this.refresh()),this}select(e,t=!1){if(!this.options.selectable)return this;const n=this._flatMap[e];return n?(this._selectedNodes.add(e),this.refresh(),t||this._fire("select",e,n,null),this):this}deselect(e,t=!1){const n=this._flatMap[e];return n?(this._selectedNodes.delete(e),this.refresh(),t||this._fire("deselect",e,n,null),this):this}toggleSelect(e){return this._selectedNodes.has(e)?this.deselect(e):this.select(e),this}selectAll(){return this.options.multiSelect?(Object.keys(this._flatMap).forEach(e=>{this._selectedNodes.add(this._parseNodeId(e))}),this.refresh(),this):this}deselectAll(e=!1){const t=Array.from(this._selectedNodes);return this._selectedNodes.clear(),this.refresh(),e||t.forEach(e=>{const t=this._flatMap[e];t&&this._fire("deselect",e,t,null)}),this}getSelected(){return Array.from(this._selectedNodes)}getSelectedNodes(){return this.getSelected().map(e=>this._flatMap[e]).filter(Boolean)}isSelected(e){return this._selectedNodes.has(e)}expand(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.add(e),this.refresh(),t||this._fire("expand",e,n,null),this):this}collapse(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.delete(e),this.refresh(),t||this._fire("collapse",e,n,null),this):this}toggle(e){return this._expandedNodes.has(e)?this.collapse(e):this.expand(e),this}expandAll(){return Object.keys(this._flatMap).forEach(e=>{const t=this._flatMap[e],n=this.options.childrenKey;t[n]&&t[n].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this.refresh(),this}collapseAll(){return this._expandedNodes.clear(),this.refresh(),this}isExpanded(e){return this._expandedNodes.has(e)}getExpanded(){return Array.from(this._expandedNodes)}getParent(e){const t=this._flatMap[e];if(!t)return null;const n=t[this.options.parentKey];return null!=n&&this._flatMap[n]||null}getChildren(e){const t=this._flatMap[e];if(!t)return[];return t[this.options.childrenKey]||[]}getAncestors(e){const t=[];let n=this.getParent(e);for(;n;)t.unshift(n),n=this.getParent(n[this.options.idKey]);return t}getDescendants(e){const t=[];return this.getChildren(e).forEach(e=>{t.push(e);const n=e[this.options.idKey];t.push(...this.getDescendants(n))}),t}getSiblings(e){if(!this._flatMap[e])return[];const t=this.getParent(e);return t?this.getChildren(t[this.options.idKey]).filter(t=>t[this.options.idKey]!==e):this._tree.filter(t=>t[this.options.idKey]!==e)}getLevel(e){return this.getAncestors(e).length}find(e){for(const t in this._flatMap){const n=this._flatMap[t];if(e(n))return n}return null}filter(e){const t=[];for(const n in this._flatMap){const s=this._flatMap[n];e(s)&&t.push(s)}return t}forEach(e){for(const t in this._flatMap)e(this._flatMap[t],t);return this}scrollToNode(e,t={}){const n=this.element.querySelector(`[data-node-id="${e}"]`);return n&&n.scrollIntoView({behavior:t.behavior||"smooth",block:t.block||"center",inline:t.inline||"nearest"}),this}destroy(){this._tree=[],this._flatMap={},this._expandedNodes.clear(),this._selectedNodes.clear(),this.element.innerHTML="",super.destroy()}}const E="domma-theme",S="domma-theme-variant",$="dm-theme-",z=["ocean-light","ocean-dark","forest-light","forest-dark","sunset-light","sunset-dark","royal-light","royal-dark","lemon-light","lemon-dark","silver-light","silver-dark","charcoal-light","charcoal-dark","christmas-light","christmas-dark","unicorn-light","unicorn-dark","dreamy-light","dreamy-dark","grayve-light","grayve-dark","mint-light","mint-dark","wedding-light","wedding-dark","core-light","corporate-light","corporate-dark","admin-smooth-steel","admin-smooth-indigo","admin-smooth-teal","admin-sharp-steel","admin-sharp-indigo","admin-sharp-teal","admin-slate-steel","admin-slate-indigo","admin-slate-teal"],T="charcoal-dark";const B=new class{constructor(){this._theme=T,this._listeners=[],this._target=null,this._initialised=!1,this._systemMediaQuery=null,this._autoDetect=!1,this._disabled=!1}init(e={}){const{theme:t=null,autoDetect:n=!1,persist:s=!0,disabled:i=!1,target:o=document.body}=e;if(i)return this._disabled=!0,this._initialised=!0,this;this._target="string"==typeof o?document.querySelector(o):o,this._target||(this._target=document.body),this._persist=s,this._autoDetect=n;let r=t;if(s){const e=this._loadFromStorage();e&&!t&&(r=e)}if(n&&!r){r="dark"===this._getSystemPreference()?"charcoal-dark":"charcoal-light",this._setupSystemListener()}return r=r||T,z.includes(r)||(console.warn(`Invalid theme: ${r}. Using default: ${T}`),r=T),this._theme=r,this._applyTheme(),this._initialised=!0,this}get(){return this._theme}getBase(){return this._theme.split("-").slice(0,-1).join("-")}getMode(){return this._theme.split("-").pop()}isDark(){return"dark"===this.getMode()}isLight(){return"light"===this.getMode()}set(e){if(!z.includes(e))return console.warn(`Invalid theme: ${e}. Available themes: ${z.join(", ")}`),this;const t=this._theme;return t===e||(this._theme=e,this._applyTheme(),this._saveToStorage(),this._notifyListeners(t,e)),this}onChange(e){return"function"!=typeof e?(console.warn("onChange requires a function callback"),()=>{}):(this._listeners.push(e),()=>{const t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)})}preview(e){if(!z.includes(e))return console.warn(`Invalid theme for preview: ${e}`),()=>{};const t=this._theme;return this._theme=e,this._applyTheme(!1),()=>{this._theme=t,this._applyTheme(!1)}}listThemes(){return[...z]}listBases(){return["ocean","forest","sunset","royal","lemon","silver","charcoal","christmas","unicorn","dreamy","grayve","mint","wedding","corporate","admin-smooth","admin-sharp","admin-slate"]}getConfig(){return{theme:this._theme,base:this.getBase(),mode:this.getMode(),autoDetect:this._autoDetect,persist:this._persist,disabled:this._disabled}}_updateMetaThemeColor(){const e={light:"#ffffff",dark:"#121212"};let t=document.querySelector('meta[name="theme-color"]');t||(t=document.createElement("meta"),t.name="theme-color",document.head.appendChild(t)),t.content=e[this.getMode()]||e.dark}isDisabled(){return this._disabled}enable(){return this._disabled=!1,this._target||(this._target=document.body),this._applyTheme(),this}disable(){if(this._disabled=!0,this._target){const e=this._target.className.split(" ").filter(e=>!e.startsWith($));this._target.className=e.join(" ").trim(),this._target.removeAttribute("data-mode")}return this}_applyTheme(e=!0){if(this._disabled)return;const t=this._target||document.body;if(!t)return void console.error("[ThemeEngine] No target element available for theme application");const n=t.className.split(" ").filter(e=>!e.startsWith($));n.push(`${$}${this._theme}`),t.className=n.join(" ").trim();const s=this.isDark()?"dark":"light";t.setAttribute("data-mode",s),e&&this._updateMetaThemeColor()}_saveToStorage(){if(this._persist&&"undefined"!=typeof localStorage)try{localStorage.setItem(E,this._theme),localStorage.removeItem(S)}catch(e){}}_loadFromStorage(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(E);if(e&&z.includes(e))return e;const t=e,n=localStorage.getItem(S);if(t&&["light","dark"].includes(t)){const e=`${n||"charcoal"}-${t}`;if(console.log(`[ThemeEngine] Migrating theme: ${t} + ${n} → ${e}`),z.includes(e))return localStorage.setItem(E,e),localStorage.removeItem(S),e}return null}catch(e){return null}}_getSystemPreference(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}_setupSystemListener(){if("undefined"==typeof window||!window.matchMedia)return;this._systemMediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{if(!this._autoDetect)return;const t=e.matches?"dark":"light",n=`${this.getBase()}-${t}`;z.includes(n)&&this.set(n)};this._systemMediaQuery.addEventListener?this._systemMediaQuery.addEventListener("change",e):this._systemMediaQuery.addListener(e)}_notifyListeners(e,t){this._listeners.forEach(n=>{try{n(e,t)}catch(e){console.error("[ThemeEngine] Error in change listener:",e)}})}destroy(){this._systemMediaQuery&&this._systemMediaQuery.removeEventListener,this._listeners=[],this._target=null,this._initialised=!1}};"undefined"!=typeof document&&!1!==s("theme",!0)&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{B._initialised||B.init({persist:!0,autoDetect:!1})}):B._initialised||B.init({persist:!0,autoDetect:!1}));const j="dm-context-cursor-rules",O={fill:"#111827",halo:"#ffffff"},D="M1,1 L1,17 L5.2,12.9 L8,19 L10.6,17.7 L7.9,11.8 L13.6,11.6 Z",N=[15.5,18.5,21.5];function I(e=("undefined"!=typeof document?document:null)){if(!e||!e.documentElement||"function"!=typeof getComputedStyle)return{...O};let t;try{t=getComputedStyle(e.documentElement)}catch{return{...O}}const n=(t.getPropertyValue("--dm-text")||"").trim(),s=(t.getPropertyValue("--dm-text-inverse")||"").trim();return{fill:n||O.fill,halo:s||O.halo}}function H(e={}){return`url('data:image/svg+xml,${t=function({size:e=26,fill:t,halo:n}={}){const s=t&&n?{fill:t,halo:n}:{...I(),...t?{fill:t}:{},...n?{halo:n}:{}},i=Math.max(12,Math.min(32,Number(e)||26)),o=(e,t,n)=>`<path d="M17.2 ${e}h5.4" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,r=(e,t,n)=>`<path d="M14.4 ${e}h.01" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,a=N.map(e=>r(e,s.halo,3.6)+o(e,s.halo,3.4)).join(""),l=N.map(e=>r(e,s.fill,1.9)+o(e,s.fill,1.7)).join("");return[`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 26 26">`,`<path d="${D}" fill="${s.halo}" stroke="${s.halo}" stroke-width="2.6" stroke-linejoin="round"/>`,`<path d="${D}" fill="${s.fill}"/>`,a,l,"</svg>"].join("")}(e),encodeURIComponent(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/!/g,"%21")}') 1 1, context-menu`;var t}const W=new Map,P=new Map;let F=null;function R(e,t){return`${e}{cursor:${t};}@media (forced-colors:active){${e}{cursor:context-menu;}}`}function V(){const e=function(){if("undefined"==typeof document)return null;let e=document.getElementById(j);return e||(e=document.createElement("style"),e.id=j,document.head.appendChild(e)),e}();if(!e)return;if(!W.size&&!P.size)return void(e.textContent="");const t=I(),n=[];P.forEach(({selector:e,value:t})=>n.push(R(e,t))),W.forEach(({selector:e,size:s})=>{n.push(R(e,H({size:s,...t})))}),e.textContent=n.join("\n")}function q(){W.size&&!F?F=B.onChange(()=>V()):!W.size&&F&&(F(),F=null)}function U(e,t,n){t&&(W.delete(e),P.delete(e),"glyph"===n.kind?W.set(e,{selector:t,size:n.size||26}):"keyword"===n.kind?P.set(e,{selector:t,value:"context-menu"}):"custom"===n.kind&&n.value&&P.set(e,{selector:t,value:n.value}),q(),V())}const K=new Set;let Y=null,G=!1,J=0,X=0;const Z=e=>"function"==typeof e,Q={primary:"var(--dm-primary)",success:"var(--dm-success)",danger:"var(--dm-danger)",warning:"var(--dm-warning)",info:"var(--dm-info)"},ee={none:"0",sm:"sm",md:"md",lg:"lg",xl:"xl"};const te=e=>Z(e)&&Z(e.subscribe);function ne(e,...t){return te(e)?e():Z(e)?e(...t):e}function se(e){const t=[];let n=e instanceof Element?e:null;for(;n;){const e=[];for(const t of K)t._enabledFlag&&t.matchesContainer(n)&&e.push(t);e.length>1&&e.sort((e,t)=>t.options.priority-e.options.priority);for(const s of e)t.push({instance:s,container:n});n=n.parentElement||(n.parentNode&&n.parentNode.host?n.parentNode.host:null)}return t}function ie(e,t){const n=se(e),s=n.findIndex(e=>e.instance.options.exclusive);let i=0,o=null;if(s>-1){const r=n[s];o=r.instance._accept(r.container,e,t),o&&(i=s)}const r=[];for(let a=i;a<n.length;a++){if(a===s&&o){r.push(o);continue}const i=n[a],l=i.instance._accept(i.container,e,t);l&&r.push(l)}return r}let oe=null,re=null,ae=null,le=null,ce=null,he=null,de=null;function ue(){G||"undefined"==typeof document||(G=!0,oe=e=>{e.shiftKey&&function(e){for(const t of se(e))if(t.instance.options.nativeOnShift)return!0;return!1}(e.target)||(Y&&Y.close(),function(e,t,n){const s=ie(e.target,e);if(!s.length)return!1;const i=s[0],o=i.instance._assembleItems(s,e);!o.length&&!i.instance.options.render||(e.preventDefault(),X=Date.now(),i.instance._openResolved(t,n,i,o,e,!1,s))}(e,e.clientX,e.clientY))},document.addEventListener("contextmenu",oe),re=e=>{const t="ContextMenu"===e.key,n="F10"===e.key&&e.shiftKey;if(!t&&!n)return;if(Y)return;const s=document.activeElement;if(!s||s===document.body)return;const i=ie(s,e);if(!i.length)return;const o=i[0];if(!o.instance.options.keyboardTrigger)return;const r=o.instance._assembleItems(i,e);if(!r.length&&!o.instance.options.render)return;e.preventDefault();const a=s.getBoundingClientRect();X=Date.now(),o.instance._openResolved(a.left+a.width/2,a.top+a.height/2,o,r,e,!0,i)},document.addEventListener("keydown",re),ae=e=>{if(Y)return;if(!e.touches||1!==e.touches.length)return;const t=e.touches[0],n=ie(e.target,e);if(!n.length)return;const s=n[0],i=s.instance.options.longPress;i&&(de={x:t.clientX,y:t.clientY,target:e.target},he=setTimeout(()=>{if(he=null,Date.now()-X<400)return;const t=s.instance._assembleItems(n,e);(t.length||s.instance.options.render)&&(X=Date.now(),s.instance._openResolved(de.x,de.y,s,t,e,!1,n))},i))},le=e=>{if(!(he&&de&&e.touches&&e.touches.length))return;const t=e.touches[0];(Math.abs(t.clientX-de.x)>10||Math.abs(t.clientY-de.y)>10)&&(clearTimeout(he),he=null)},ce=()=>{he&&(clearTimeout(he),he=null)},document.addEventListener("touchstart",ae,{passive:!0}),document.addEventListener("touchmove",le,{passive:!0}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))}class pe extends C{static componentName="context-menu";static defaults={items:[],match:null,exclude:null,enabled:!0,inherit:"append",priority:0,exclusive:!1,nativeOnShift:!0,closeOnSelect:!0,closeOnEscape:!0,closeOnClickOutside:!0,closeOnScroll:!0,longPress:500,cursor:"auto",cursorSize:26,className:"",minWidth:"200px",maxWidth:"320px",maxHeight:"60vh",offset:[2,2],flip:!0,animation:!0,animationDuration:120,transition:"scale",easing:"cubic-bezier(0.16, 1, 0.3, 1)",accent:null,surface:null,radius:null,shadow:null,opacity:null,density:"comfortable",itemTemplate:null,submenuDelay:150,render:null,keyboardTrigger:!0,typeahead:!0,ariaLabel:"Context menu",model:null,modelKey:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onSelect:null};constructor(e,t={}){super(e,t),this.selector="string"==typeof e?e:null,this._node=this.selector?null:this.element,this._menu=null,this._submenus=[],this._isOpen=!1,this._enabledFlag=!0,this._focusIndex=-1,this._renderedItems=[],this._ctx=null,this._typeaheadBuffer="",this._typeaheadTimer=null,this._submenuTimer=null,this._observableDispose=null,this._restoreFocusTo=null,this._chain=null,this._cursorId=++J,K.add(this),ue(),this._applyTouchCallout(),this._applyCursor()}_applyCursor(){const{cursor:e,cursorSize:t,match:n}=this.options;if(!1===e||null===e||"undefined"==typeof document)return;let s=this.selector;if(!s){if(!this._node)return;this._node.setAttribute("data-dm-ctx-cursor",String(this._cursorId)),s=`[data-dm-ctx-cursor="${this._cursorId}"]`}const i=n?`${s} ${n}`:s;"auto"===e?U(this._cursorId,i,{kind:"keyword"}):"glyph"===e?U(this._cursorId,i,{kind:"glyph",size:t}):"string"==typeof e&&U(this._cursorId,i,{kind:"custom",value:e})}_applyTouchCallout(){this.options.longPress&&this.selector&&"undefined"!=typeof document&&document.querySelectorAll(this.selector).forEach(e=>{e.style.webkitTouchCallout="none"})}matchesContainer(e){return this.selector?Z(e.matches)&&e.matches(this.selector):e===this._node}_accept(e,t,n){const s=this.options;if(s.exclude&&t.closest(s.exclude)&&e.contains(t.closest(s.exclude)))return null;let i=e;if(s.match){const n=t.closest(s.match);if(!n||!e.contains(n))return null;i=n}const o={target:i,container:e,x:n&&void 0!==n.clientX?n.clientX:0,y:n&&void 0!==n.clientY?n.clientY:0,event:n,menu:null,instance:this};return ne(s.enabled,i,o)?!1===this._fire("beforeopen",o)?null:{instance:this,container:e,target:i,ctx:o}:null}_ownItems(e){const t=this.options;let n;return n=t.model&&t.modelKey&&Z(t.model.get)?t.model.get(t.modelKey):ne(t.items,e.target,e.ctx),Array.isArray(n)?n:[]}_assembleItems(e,t){const n=e[0],s=this._ownItems(n),i=this.options.inherit;if(!i||e.length<2)return this._filterItems(s,n);let o=[];for(let t=1;t<e.length;t++){const n=e[t],s=n.instance._filterItems(n.instance._ownItems(n),n);s.length&&(o.length&&o.push({type:"divider"}),o=o.concat(s))}const r=this._filterItems(s,n);return o.length?r.length?"prepend"===i?o.concat([{type:"divider"}],r):r.concat([{type:"divider"}],o):o:r}_filterItems(e,t){const n=e.filter(e=>!!e&&(void 0===e.visible||!!ne(e.visible,t.target,t.ctx))),s=[];for(const e of n){const t="divider"===e.type||e.divider;(!t||s.length&&!s[s.length-1]._isDivider)&&s.push(t?{type:"divider",_isDivider:!0}:e)}for(;s.length&&s[s.length-1]._isDivider;)s.pop();return s}open(e,t,n){const s=n||(this.selector?document.querySelector(this.selector):this._node);if(!s)return this;const i=ie(s,{clientX:e,clientY:t,target:s}),o=i.find(e=>e.instance===this)||i[0];if(!o)return this;const r=[o,...i.filter(e=>e!==o)],a=o.instance._assembleItems(r,null);return a.length||o.instance.options.render?(Y&&Y.close(),o.instance._openResolved(e,t,o,a,null,!1,r),this):this}_openResolved(e,t,n,s,i,o=!1,r=null){Y&&Y!==this&&Y.close(),this._isOpen&&this._forcedClose();const a=this.options;if(this._chain=r||[n],this._ctx=n.ctx,this._ctx.x=e,this._ctx.y=t,this._renderedItems=s,this._restoreFocusTo=o?document.activeElement:null,a.render){const n=a.render(this._ctx);return n?(this._menu=n,n.parentNode||document.body.appendChild(n),n.style.position="fixed",this._applyTheme(n),n.classList.add("is-open"),this._ctx.menu=n,this._positionAt(n,e,t),this._bindOpenListeners(),this._isOpen=!0,Y=this,void this._fire("open",this._ctx)):(this._chain=null,void(this._ctx=null))}this._menu=this._createMenu(),this._renderInto(this._menu,s,n),document.body.appendChild(this._menu),this._ctx.menu=this._menu,this._positionAt(this._menu,e,t),this._bindOpenListeners(),this._isOpen=!0,Y=this,te(a.items)&&(this._observableDispose=a.items.subscribe(()=>{this._isOpen&&this.refresh()})),a.animation?requestAnimationFrame(()=>{this._menu&&this._menu.classList.add("is-open")}):this._menu.classList.add("is-open"),this._menu.focus({preventScroll:!0}),o&&this._moveFocus(1),this._fire("open",this._ctx)}close(){if(!this._isOpen)return this;if(!this._mayClose(this._ctx))return this;this._closeSubmenus(0),this._unbindOpenListeners(),this._observableDispose&&(Z(this._observableDispose)?this._observableDispose():Z(this._observableDispose.dispose)&&this._observableDispose.dispose(),this._observableDispose=null);const e=this._menu,t=this.options;return this._menu=null,this._isOpen=!1,this._focusIndex=-1,Y===this&&(Y=null),e&&(t.animation?(e.classList.remove("is-open"),setTimeout(()=>e.remove(),t.animationDuration)):e.remove()),this._restoreFocusTo&&Z(this._restoreFocusTo.focus)&&this._restoreFocusTo.focus({preventScroll:!0}),this._restoreFocusTo=null,this._fire("close",this._ctx),this._ctx=null,this}refresh(){if(!this._isOpen||!this._ctx)return this;const e=this._chain&&this._chain.length?this._chain[0]:{instance:this,container:this._ctx.container,target:this._ctx.target,ctx:this._ctx},t=this._assembleItems(this._chain&&this._chain.length?this._chain:[e],null);return this._renderedItems=t,this._closeSubmenus(0),this._renderInto(this._menu,t,e),this._positionAt(this._menu,this._ctx.x,this._ctx.y),this}isOpen(){return this._isOpen}toggle(e,t,n){return this._isOpen?this.close():this.open(e,t,n)}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setItems(e){return this.options.items=e,this._isOpen&&this.refresh(),this}enable(){return this._enabledFlag=!0,this}disable(){return this._isOpen&&this.close(),this._enabledFlag=!1,this}_createMenu(e=!1){const t=this.options,n=document.createElement("div");return n.className="dm-context-menu"+(e?" dm-context-menu-sub":"")+(t.className?" "+t.className:""),n.setAttribute("role","menu"),n.setAttribute("tabindex","-1"),e||n.setAttribute("aria-label",t.ariaLabel),n.style.minWidth=t.minWidth,n.style.maxWidth=t.maxWidth,n.style.maxHeight=t.maxHeight,this._applyTheme(n),n}_applyTheme(e){const t=this.options;e.dataset.transition=t.animation?t.transition||"scale":"none","compact"===t.density&&(e.dataset.density="compact");const n=(t,n)=>{null!=n&&""!==n&&e.style.setProperty(t,n)};var s;if(n("--dm-ctx-accent",(s=t.accent)?Q[s]||s:null),n("--dm-ctx-surface",t.surface),n("--dm-ctx-radius",function(e){return e?"none"===e?"0":ee[e]?`var(--dm-radius-${e})`:e:null}(t.radius)),n("--dm-ctx-shadow",function(e){return e?"none"===e?"none":ee[e]?`var(--dm-shadow-${e})`:e:null}(t.shadow)),n("--dm-ctx-duration",`${t.animationDuration}ms`),n("--dm-ctx-easing",t.easing),null!==t.opacity&&void 0!==t.opacity){const e=Math.min(100,Math.max(20,Number(t.opacity)||100));e<100&&n("--dm-ctx-opacity",String(e/100))}}_renderInto(e,t,n){if(!e)return;e.innerHTML="";const s=this.options;t.forEach((t,i)=>{if("divider"===t.type||t.divider){const t=document.createElement("div");return t.className="dm-context-menu-divider",t.setAttribute("role","separator"),void e.appendChild(t)}if("header"===t.type||t.header){const n=document.createElement("div");return n.className="dm-context-menu-header",n.setAttribute("role","presentation"),n.textContent=t.header||t.label||"",void e.appendChild(n)}const o=!!ne(t.disabled,n.target,n.ctx),r=document.createElement("button");r.type="button",r.className="dm-context-menu-item",r.setAttribute("role","checkbox"===t.type?"menuitemcheckbox":"radio"===t.type?"menuitemradio":"menuitem"),r.setAttribute("tabindex","-1"),r.dataset.index=String(i),t.danger&&r.classList.add("is-danger");for(const e of[].concat(t.className||[]).join(" ").split(/\s+/))e&&r.classList.add(e);if(o&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0),"checkbox"===t.type||"radio"===t.type){const e=!!ne(t.checked,n.target,n.ctx);r.setAttribute("aria-checked",String(e)),e&&r.classList.add("is-checked")}if(s.itemTemplate)r.innerHTML=s.itemTemplate(t,i);else{const e=document.createElement("span");e.className="dm-context-menu-icon",t.icon&&(e.setAttribute("data-icon",t.icon),e.setAttribute("data-size","16")),r.appendChild(e);const n=document.createElement("span");if(n.className="dm-context-menu-label",n.textContent=t.label||t.text||t.name||"",r.appendChild(n),t.shortcut){const e=document.createElement("span");e.className="dm-context-menu-shortcut",e.textContent=t.shortcut,r.appendChild(e)}}const a=t.submenu;if(a){r.classList.add("has-submenu"),r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false");const e=document.createElement("span");e.className="dm-context-menu-chevron",e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-size","14"),r.appendChild(e)}o||(r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),a?this._openSubmenu(r,t,n,this._depthOf(e)):this._activate(t,i)}),r.addEventListener("mouseenter",()=>{this._closeSubmenus(this._depthOf(e)),clearTimeout(this._submenuTimer),a&&(this._submenuTimer=setTimeout(()=>this._openSubmenu(r,t,n,this._depthOf(e)),s.submenuDelay))})),e.appendChild(r)}),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&Z(window.Domma.icons.scan)&&window.Domma.icons.scan(e)}_depthOf(e){const t=this._submenus.indexOf(e);return-1===t?0:t+1}_openSubmenu(e,t,n,s){this._closeSubmenus(s);const i=this._filterItems(ne(t.submenu,n.target,n.ctx)||[],n);if(!i.length)return;const o=this._createMenu(!0);this._renderInto(o,i,n),document.body.appendChild(o),this._submenus[s]=o;const r=e.getBoundingClientRect();this._positionAt(o,r.right,r.top,r),e.setAttribute("aria-expanded","true"),e.classList.add("is-open"),o.dataset.owner=e.dataset.index,this.options.animation?requestAnimationFrame(()=>o.classList.add("is-open")):o.classList.add("is-open")}_closeSubmenus(e){for(let t=this._submenus.length-1;t>=e;t--){const e=this._submenus[t];if(!e)continue;const n=this._menu&&void 0!==e.dataset.owner?this._menu.querySelector(`[data-index="${e.dataset.owner}"]`):null;n&&(n.setAttribute("aria-expanded","false"),n.classList.remove("is-open")),e.remove(),this._submenus.splice(t,1)}}_activate(e,t){const n=this._ctx,s=this.options;this._fire("select",e,n),Z(e.action)&&e.action(n?n.target:null,n),s.closeOnSelect&&this.close()}_positionAt(e,t,n,s=null){const i=this.options,[o,r]=i.offset,a=e.offsetWidth,l=e.offsetHeight,c=document.documentElement.clientWidth,h=document.documentElement.clientHeight;let d=t+o,u=n+r;if(i.flip){if(d+a>c-8){const e=s?s.left-a:t-a-o;e>=8&&(d=e)}if(u+l>h-8){const e=s?n-l+s.height:n-l-r;e>=8&&(u=e)}}d=a<=c-16?Math.max(8,Math.min(d,c-a-8)):8,u=l<=h-16?Math.max(8,Math.min(u,h-l-8)):8,e.style.left=d+"px",e.style.top=u+"px"}_bindOpenListeners(){const e=this.options;this._outsideHandler=e=>{this._isOpen&&(this._menu&&this._menu.contains(e.target)||this._submenus.some(t=>t&&t.contains(e.target))||this.close())},e.closeOnClickOutside&&document.addEventListener("mousedown",this._outsideHandler,!0),this._contextHandler=e=>{this._menu&&this._menu.contains(e.target)&&e.preventDefault()},document.addEventListener("contextmenu",this._contextHandler),this._keyHandler=e=>this._onKeyDown(e),document.addEventListener("keydown",this._keyHandler,!0),e.closeOnScroll&&(this._scrollHandler=()=>this.close(),window.addEventListener("scroll",this._scrollHandler,!0)),this._resizeHandler=()=>this.close(),window.addEventListener("resize",this._resizeHandler)}_unbindOpenListeners(){this._outsideHandler&&(document.removeEventListener("mousedown",this._outsideHandler,!0),this._outsideHandler=null),this._contextHandler&&(document.removeEventListener("contextmenu",this._contextHandler),this._contextHandler=null),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,!0),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),clearTimeout(this._submenuTimer),clearTimeout(this._typeaheadTimer)}_focusableItems(){const e=this._submenus.length?this._submenus[this._submenus.length-1]:this._menu;return e?Array.from(e.querySelectorAll(".dm-context-menu-item:not(.is-disabled)")):[]}_moveFocus(e){const t=this._focusableItems();if(!t.length)return;let n=t.indexOf(document.activeElement)+e;n<0&&(n=t.length-1),n>=t.length&&(n=0),t[n].focus({preventScroll:!0})}_onKeyDown(e){if(!this._isOpen)return;const t=this.options;switch(e.key){case"Escape":if(!t.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void(this._submenus.length?this._closeSubmenus(this._submenus.length-1):this.close());case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"Home":{e.preventDefault();const t=this._focusableItems()[0];return void(t&&t.focus({preventScroll:!0}))}case"End":{e.preventDefault();const t=this._focusableItems();return void(t.length&&t[t.length-1].focus({preventScroll:!0}))}case"ArrowRight":{const t=document.activeElement;return void(t&&t.classList.contains("has-submenu")&&(e.preventDefault(),t.click(),requestAnimationFrame(()=>this._moveFocus(1))))}case"ArrowLeft":if(this._submenus.length){e.preventDefault(),this._closeSubmenus(this._submenus.length-1);const t=this._focusableItems();t.length&&t[0].focus({preventScroll:!0})}return;case"Enter":case" ":{const t=document.activeElement;return void(t&&t.classList.contains("dm-context-menu-item")&&(e.preventDefault(),t.click()))}}!t.typeahead||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||this._typeahead(e.key)}_typeahead(e){clearTimeout(this._typeaheadTimer),this._typeaheadBuffer+=e.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeaheadBuffer=""},600);const t=this._focusableItems().find(e=>{const t=e.querySelector(".dm-context-menu-label");return t&&t.textContent.toLowerCase().startsWith(this._typeaheadBuffer)});t&&t.focus({preventScroll:!0})}destroy(){var e;this._forcedClose(),K.delete(this),e=this._cursorId,(W.delete(e)||P.delete(e))&&(q(),V()),this._node&&this._node.getAttribute("data-dm-ctx-cursor")===String(this._cursorId)&&this._node.removeAttribute("data-dm-ctx-cursor"),G&&!K.size&&(G=!1,document.removeEventListener("contextmenu",oe),document.removeEventListener("keydown",re),document.removeEventListener("touchstart",ae),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),oe=re=ae=le=ce=null),super.destroy()}}pe.closeAll=function(){Y&&Y.close()},pe.active=function(){return Y},pe.registry=function(e=null){return e?se(e).map(e=>e.instance):Array.from(K)};const me={_prefix:"domma:",_available:null,isAvailable(){if(null!==this._available)return this._available;try{const e=`${this._prefix}__test__`;localStorage.setItem(e,"test"),localStorage.removeItem(e),this._available=!0}catch(e){this._available=!1}return this._available},_prefixKey(e){return`${this._prefix}${e}`},_unprefixKey(e){return e.slice(this._prefix.length)},get(e,t=null){if(!this.isAvailable())return t;try{const n=this._prefixKey(e),s=localStorage.getItem(n);return null===s?t:JSON.parse(s)}catch(n){return console.warn(`Domma storage: Failed to parse key "${e}"`,n),t}},set(e,t){if(!this.isAvailable())return!1;try{const n=this._prefixKey(e),s=JSON.stringify(t);return localStorage.setItem(n,s),!0}catch(t){return console.warn(`Domma storage: Failed to set key "${e}"`,t),!1}},remove(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return localStorage.removeItem(t),!0}catch(t){return console.warn(`Domma storage: Failed to remove key "${e}"`,t),!1}},has(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return null!==localStorage.getItem(t)}catch(e){return!1}},clear(){if(!this.isAvailable())return 0;try{const e=this.keys();return e.forEach(e=>this.remove(e)),e.length}catch(e){return console.warn("Domma storage: Failed to clear storage",e),0}},keys(){if(!this.isAvailable())return[];try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith(this._prefix)&&e.push(this._unprefixKey(n))}return e}catch(e){return[]}},size(e){if(!this.isAvailable())return 0;try{const t=this._prefixKey(e),n=localStorage.getItem(t);return n?new Blob([n]).size:0}catch(e){return 0}},totalSize(){if(!this.isAvailable())return 0;try{let e=0;return this.keys().forEach(t=>{e+=this.size(t)}),e}catch(e){return 0}},getAll(){if(!this.isAvailable())return{};const e={};return this.keys().forEach(t=>{e[t]=this.get(t)}),e},setAll(e){if(!this.isAvailable()||!e)return!1;let t=!0;return Object.keys(e).forEach(n=>{this.set(n,e[n])||(t=!1)}),t}},fe="sortable:",_e='input, textarea, select, button, option, a[href], [contenteditable=""], [contenteditable="true"]',ge=e=>"function"==typeof e;class ve extends C{static componentName="sortable";static defaults={items:null,handle:null,nest:!1,live:null,axis:"y",key:"data-id",animation:200,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)",threshold:4,touchDelay:220,nestZone:.5,accepts:null,disabled:!1,keyboard:!0,persist:!1,autoScroll:!0,ghostParent:null,onStart:null,onMove:null,onSort:null,onDrop:null,onCancel:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._drag=null,this._pending=null,this._animating=new WeakSet,this._flips=new WeakMap,this._docHandlers=[],this.element.classList.add("dm-sortable"),this._markHandles(),"undefined"!=typeof MutationObserver&&(this._observer=new MutationObserver(()=>this._markHandles()),this._observer.observe(this.element,{childList:!0,subtree:!0})),this._addEventListener(this.element,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this.element,"dragstart",e=>{(this._pending||this._drag)&&e.preventDefault()}),this.options.persist&&this._isLive()&&this.restore())}toArray(){return this._items().map(e=>this._keyOf(e))}sort(e,{animate:t=!0}={}){const n=()=>{const t=this._items(),n=new Map(e.map((e,t)=>[String(e),t])),s=t.filter(e=>n.has(this._keyOf(e)));if(!s.length)return;const i=[...s].sort((e,t)=>n.get(this._keyOf(e))-n.get(this._keyOf(t)));s.map(e=>{const t=document.createComment("");return e.before(t),t}).forEach((e,t)=>{e.replaceWith(i[t])})};return t?this.animate(n):n(),this}restore(){const e=this._storageKey()?me.get(this._storageKey()):null;return Array.isArray(e)&&e.length&&this.sort(e,{animate:!1}),this}forget(){const e=this._storageKey();return e&&me.remove(e),this}animate(e){const t=this._snapshot(),n=e();return n&&ge(n.then)?n.then(e=>(this._playFlip(t),e)):(this._playFlip(t),n)}enable(){return this.options.disabled=!1,this.element?.classList.remove("dm-sortable-disabled"),this}disable(){return this._drag&&this._cancel(),this.options.disabled=!0,this.element?.classList.add("dm-sortable-disabled"),this}get dragging(){return!!this._drag}destroy(){this._drag&&this._finish(!1),this._clearPending(),this._observer?.disconnect(),this._liveRegion?.remove(),this.element&&(this.element.classList.remove("dm-sortable","dm-sortable-disabled","dm-sortable-active"),this.element.querySelectorAll(".dm-sortable-handle").forEach(e=>e.classList.remove("dm-sortable-handle"))),super.destroy()}_applyOptions(){this._markHandles(),this.element?.classList.toggle("dm-sortable-disabled",!!this.options.disabled)}_isLive(){return null==this.options.live?!this.options.nest:!!this.options.live}_items(){const e=this.element;if(!e)return[];return(this.options.items?Array.from(e.querySelectorAll(this.options.items)):Array.from(e.children)).filter(t=>!t.classList.contains("dm-sortable-ghost")&&!t.classList.contains("dm-sortable-indicator")&&!t.classList.contains("dm-sortable-live")&&this._ownerOf(t)===e)}_ownerOf(e){let t=e.parentElement;for(;t&&!t.classList.contains("dm-sortable");)t=t.parentElement;return t}_itemFrom(e){if(!(e instanceof Element))return null;const t=this._items();let n=e;for(;n&&n!==this.element;){if(t.includes(n))return n;n=n.parentElement}return null}_keyOf(e){const t=this.options.key,n=t?e.getAttribute(t):null;return null==n?null:String(n)}_byKey(e){return null==e?null:this._items().find(t=>this._keyOf(t)===e)||null}_markHandles(){this.element&&this.options.handle&&this.element.querySelectorAll(this.options.handle).forEach(e=>{e.classList.contains("dm-sortable-handle")||e.classList.add("dm-sortable-handle")})}_storageKey(){const e=this.options.persist;return e?!0===e?this.element?.id?fe+this.element.id:null:fe+e:null}_duration(){return function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animation)||0)}_onPointerDown(e){if(this.options.disabled||this._drag||this._pending||0!==e.button||e._dmSortable)return;const t=this._itemFrom(e.target);if(!t)return;e._dmSortable=!0;const{handle:n}=this.options;if(n){const s=e.target.closest(n);if(!s||!t.contains(s))return;e.preventDefault()}else if(e.target.closest(_e)&&e.target.closest(_e)!==t)return;const s="touch"===e.pointerType&&!n;this._pending={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,ready:!s,timer:null},s&&(this._pending.timer=setTimeout(()=>{this._pending&&(this._pending.ready=!0,this._guard(()=>this._begin(this._pending.startX,this._pending.startY)))},this.options.touchDelay)),this._listenDoc("pointermove",e=>this._guard(()=>this._onPointerMove(e))),this._listenDoc("pointerup",e=>this._guard(()=>this._onPointerUp(e))),this._listenDoc("pointercancel",e=>this._guard(()=>this._onPointerCancel(e))),this._listenDoc("keydown",e=>{"Escape"===e.key&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._guard(()=>this._cancel()))},!0),this._listenDoc("contextmenu",e=>{this._drag&&e.preventDefault()},!0),this._listenWin("blur",()=>this._guard(()=>{this._drag?this._cancel():this._clearPending()})),this._listenDoc("touchmove",e=>{this._drag&&e.preventDefault()},{passive:!1})}_onPointerMove(e){const t=this._pending;if(t&&e.pointerId===t.pointerId&&!this._drag){const n=Math.hypot(e.clientX-t.startX,e.clientY-t.startY);if(!t.ready)return void(n>8&&this._clearPending());if(n<this.options.threshold)return;this._begin(t.startX,t.startY)}if(this._drag&&e.pointerId===this._drag.pointerId){if("mouse"===e.pointerType&&0===e.buttons)return void this._onPointerUp(e);e.preventDefault(),this._moveTo(e.clientX,e.clientY)}}_guard(e){try{return e()}catch(e){if(this._drag){try{this._cancel()}catch{}this._drag&&this._finish(!1)}else this._clearPending();throw e}}_onPointerUp(e){if(this._drag&&e.pointerId===this._drag.pointerId)return this._moveTo(e.clientX,e.clientY),void this._drop();this._clearPending()}_onPointerCancel(e){this._drag&&e.pointerId===this._drag.pointerId?this._cancel():this._clearPending()}_listenDoc(e,t,n){document.addEventListener(e,t,n),this._docHandlers.push({target:document,event:e,handler:t,opts:n})}_listenWin(e,t,n){window.addEventListener(e,t,n),this._docHandlers.push({target:window,event:e,handler:t,opts:n})}_unlistenDoc(){for(const{target:e,event:t,handler:n,opts:s}of this._docHandlers)e.removeEventListener(t,n,s);this._docHandlers=[]}_clearPending(){this._pending?.timer&&clearTimeout(this._pending.timer),this._pending=null,this._drag||this._unlistenDoc()}_begin(e,t){const{item:n,pointerId:s}=this._pending;this._pending.timer&&clearTimeout(this._pending.timer),this._pending=null;const i=n.getBoundingClientRect(),o=this._items(),r=n.cloneNode(!0);r.removeAttribute("id"),this.options.key&&r.removeAttribute(this.options.key),r.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),r.classList.add("dm-sortable-ghost"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,{position:"fixed",left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`,margin:"0",boxSizing:"border-box",pointerEvents:"none",transform:"translate3d(0, 0, 0)"}),(this.options.ghostParent||this.element).appendChild(r),requestAnimationFrame(()=>r.classList.add("dm-sortable-ghost-lifted")),n.classList.add("dm-sortable-placeholder"),this.element.classList.add("dm-sortable-active"),document.documentElement.classList.add("dm-sortable-dragging");try{window.getSelection?.().removeAllRanges()}catch{}if(this._drag={item:n,pointerId:s,ghost:r,rect:i,offsetX:e-i.left,offsetY:t-i.top,x:e,y:t,from:o.indexOf(n),previous:o.map(e=>this._keyOf(e)),origin:{parent:n.parentNode,next:n.nextSibling},key:this._keyOf(n),target:null,zone:null,indicator:null,scrollRaf:null},!this._isLive()){const e=document.createElement("div");e.className="dm-sortable-indicator",e.setAttribute("aria-hidden","true"),this.element.appendChild(e),this._drag.indicator=e}this._signal("start",{item:n,from:this._drag.from}),this.options.autoScroll&&this._scrollLoop()}_moveTo(e,t){const n=this._drag;if(!n||n.settling)return;n.x=e,n.y=t,n.ghost.style.transform=`translate3d(${e-n.offsetX-n.rect.left}px, ${t-n.offsetY-n.rect.top}px, 0)`;const s=document.elementFromPoint(e,t),i=s?this._itemFrom(s):null;this._isLive()?i&&i!==n.item&&!this._animating.has(i)&&this._liveSwap(i,e,t):this._indicate(i,e,t),this._signal("move",{item:n.item,target:n.target||i,zone:n.zone,x:e,y:t})}_liveSwap(e,t,n){const s=this._drag,i=this._items(),o=i.indexOf(s.item),r=i.indexOf(e);if(o<0||r<0)return;const a=s.item.getBoundingClientRect(),l=e.getBoundingClientRect(),c="x"===this.options.axis,h=c?t:n,d=c?a.width:a.height,u=c?l.left:l.top,p=c?l.right:l.bottom,m=o<r;(m?h>p-d:h<u+d)&&(this.options.accepts&&!this.options.accepts(s.item,e,m?"after":"before")||this._flipItems(()=>{m?e.after(s.item):e.before(s.item)}))}_zoneFor(e,t,n){const s=e.getBoundingClientRect(),i="x"===this.options.axis,o=i?s.width:s.height,r=o?(i?t-s.left:n-s.top)/o:.5;if(this.options.nest){const e=(1-Math.min(Math.max(this.options.nestZone,0),1))/2;return r<e?"before":r>1-e?"after":"into"}return r<.5?"before":"after"}_indicate(e,t,n){const s=this._drag;let i=null;if(e&&e!==s.item&&(i=this._zoneFor(e,t,n),this.options.accepts&&!this.options.accepts(s.item,e,i)))if("into"===i){const o=e.getBoundingClientRect(),r="x"===this.options.axis?o.left+o.width/2:o.top+o.height/2;i=("x"===this.options.axis?t:n)<r?"before":"after",this.options.accepts(s.item,e,i)||(i=null)}else i=null;i||(e=null),s.target===e&&s.zone===i||(s.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),e&&e.classList.add("dm-sortable-over",`dm-sortable-over-${i}`),s.target=e,s.zone=i),this._placeIndicator()}_placeIndicator(){const e=this._drag,t=e?.indicator;if(!t)return;if(!e.target)return void t.classList.remove("is-visible");const n=e.target.getBoundingClientRect(),s="x"===this.options.axis;let i;i="into"===e.zone?{left:n.left,top:n.top,width:n.width,height:n.height}:s?{left:("before"===e.zone?n.left:n.right)-1.5,top:n.top,width:3,height:n.height}:{left:n.left,top:("before"===e.zone?n.top:n.bottom)-1.5,width:n.width,height:3};const o=!t.classList.contains("is-visible");o&&(t.style.transition="none"),Object.assign(t.style,{left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`}),t.classList.toggle("is-into","into"===e.zone),t.classList.add("is-visible"),o&&(t.offsetWidth,t.style.transition="")}_drop(){const e=this._drag;if(!e)return;if(this._suppressClick(),this._isLive()){const t=this.toArray(),n=this._items().indexOf(e.item),s=n!==e.from;return this._finish(!0),s&&(this._save(t),this._signal("sort",{item:e.item,from:e.from,to:n,order:t,previous:e.previous})),void this._signal("end",{item:e.item,changed:s})}const{target:t,zone:n}=e;if(!t||!n)return void this._cancel();const s={item:e.item,target:t,zone:n,key:e.key,targetKey:this._keyOf(t)};this._unlistenDoc(),e.scrollRaf&&cancelAnimationFrame(e.scrollRaf),e.settling=!0;let i=!0;const o=this.animate(()=>{if(ge(this.options.onDrop)){const e=this.options.onDrop(s);return!1===e&&(i=!1),e}"before"===n?t.before(e.item):"after"===n&&t.after(e.item)});this._emit("drop",s);const r=()=>{this._drag===e&&(i?(this._finish(!0),this._signal("end",{item:e.item,changed:!0})):this._cancel())};o&&ge(o.then)?o.then(r,()=>{this._drag===e&&this._cancel()}):r()}_cancel(){const e=this._drag;e&&(this._isLive()&&this._flipItems(()=>{e.origin.parent&&e.origin.parent.insertBefore(e.item,e.origin.next?.parentNode===e.origin.parent?e.origin.next:null)}),this._finish(!1),this._signal("cancel",{item:e.item}),this._signal("end",{item:e.item,changed:!1}))}_finish(e){const t=this._drag;if(!t)return;this._drag=null,this._unlistenDoc(),t.scrollRaf&&cancelAnimationFrame(t.scrollRaf),t.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),t.indicator?.remove(),this.element?.classList.remove("dm-sortable-active"),document.documentElement.classList.remove("dm-sortable-dragging");const n=(e&&null!=t.key?this._byKey(t.key):null)||(t.item.isConnected?t.item:null);t.item!==n&&t.item.classList.remove("dm-sortable-placeholder");const s=t.ghost,i=this._duration();if(!n||!i)return s.remove(),n?.classList.remove("dm-sortable-placeholder"),void(n&&this._announce(n));s.isConnected||(this.options.ghostParent||this.element).appendChild(s),n.classList.add("dm-sortable-placeholder","dm-sortable-landing");const o=n.getBoundingClientRect();s.style.transition=`transform ${i}ms ${this.options.easing}, width ${i}ms ${this.options.easing}, height ${i}ms ${this.options.easing}, scale ${i}ms ${this.options.easing}, box-shadow ${i}ms ${this.options.easing}`,s.classList.remove("dm-sortable-ghost-lifted"),s.style.transform=`translate3d(${o.left-t.rect.left}px, ${o.top-t.rect.top}px, 0)`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`;let r=!1;const a=()=>{r||(r=!0,s.remove(),n.classList.remove("dm-sortable-placeholder","dm-sortable-landing"),this._announce(n))};s.addEventListener("transitionend",e=>{"transform"===e.propertyName&&a()}),setTimeout(a,i+80)}_suppressClick(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,!0),setTimeout(()=>document.removeEventListener("click",e,!0),0)}_scrollLoop(){const e=this._drag;if(!e)return;const t="x"===this.options.axis?"x":"y",n=function(e,t){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const e=getComputedStyle(n),s="x"===t?e.overflowX:e.overflowY;if(("x"===t?n.scrollWidth>n.clientWidth:n.scrollHeight>n.clientHeight)&&/(auto|scroll|overlay)/.test(s))return n;n=n.parentElement}return null}(this.element,t),s=()=>{if(this._drag!==e||e.settling)return;const i=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},o="x"===t?e.x:e.y,r="x"===t?i.left:i.top,a="x"===t?i.right:i.bottom;let l=0;if(o<r+48?l=-Math.ceil(18*(1-Math.max(o-r,0)/48)):o>a-48&&(l=Math.ceil(18*(1-Math.max(a-o,0)/48))),l){const s=n||window;"x"===t?s.scrollBy(l,0):s.scrollBy(0,l),this._moveTo(e.x,e.y)}e.scrollRaf=requestAnimationFrame(s)};e.scrollRaf=requestAnimationFrame(s)}_onKeyDown(e){if(!this.options.keyboard||this.options.disabled||this._drag||!this._isLive()||!e.altKey)return;const t="x"===this.options.axis,n=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";if(e.key!==n&&e.key!==s)return;const i=this._itemFrom(e.target);if(!i||e.target!==i&&(!this.options.handle||!e.target.closest(this.options.handle)))return;const o=this._items(),r=o.indexOf(i),a=e.key===n?r-1:r+1;if(a<0||a>=o.length)return;const l=o[a];if(this.options.accepts&&!this.options.accepts(i,l,e.key===n?"before":"after"))return;e.preventDefault();const c=o.map(e=>this._keyOf(e));this._flipItems(()=>{e.key===n?l.before(i):l.after(i)}),e.target.focus();const h=this.toArray();this._save(h),this._signal("sort",{item:i,from:r,to:a,order:h,previous:c}),this._signal("end",{item:i,changed:!0}),this._announce(i)}_announce(e){const t=this._items(),n=t.indexOf(e);if(!(n<0)){if(!this._liveRegion){const e=document.createElement("div");e.className="dm-sortable-live",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),this._liveRegion=e}this._liveRegion.textContent=`Moved to position ${n+1} of ${t.length}`}}_snapshot({withDragged:e=!1}={}){const t=new Map,n=this._drag;for(const s of this._items()){if(n&&s===n.item&&!e)continue;const i=s.getBoundingClientRect();t.set(s,i);const o=this._keyOf(s);null!=o&&t.set(`key:${o}`,i)}return t}_playFlip(e){const t=this._duration();if(t)for(const n of this._items()){const s=this._keyOf(n),i=e.get(n)||(null!=s?e.get(`key:${s}`):null);if(!i||!ge(n.animate))continue;const o=n.getBoundingClientRect(),r=i.left-o.left,a=i.top-o.top;if(Math.abs(r)<.5&&Math.abs(a)<.5)continue;this._flips.get(n)?.cancel(),this._animating.add(n);const l=n.animate([{transform:`translate(${r}px, ${a}px)`},{transform:"translate(0, 0)"}],{duration:t,easing:this.options.easing});this._flips.set(n,l);const c=()=>{this._flips.get(n)===l&&(this._flips.delete(n),this._animating.delete(n))};l.onfinish=c,l.oncancel=c}}_flipItems(e){const t=this._snapshot({withDragged:!0});e(),this._playFlip(t)}_save(e){const t=this._storageKey();t&&this._isLive()&&me.set(t,e.filter(e=>null!=e))}_signal(e,t){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];ge(n)&&n(t),this._emit(e,t)}}const be="input-group-icon",ye=/^[a-z0-9-]+$/i,ke=/^(text|search|email|url|tel|password|number|date|datetime-local|time|month|week)$/,we=/^(text|search|email|url|tel|password)$/;let xe=0;function Me(e){return null==e||!1===e||""===e?null:"string"==typeof e||"number"==typeof e?{text:String(e)}:"object"!=typeof e?null:e.icon&&ye.test(e.icon)?{icon:e.icon}:null!=e.text&&""!==e.text?{text:String(e.text)}:null}function Le(){return"undefined"!=typeof window&&(window.Domma?.icons||window.I)||null}function Ce(e,t){e.textContent="";const n=document.createElement("span");n.setAttribute("data-icon",t),n.setAttribute("aria-hidden","true"),e.appendChild(n),Le()?.scan?.(e)}function Ae(e,t){const n=document.createElement("span");if(n.className=`input-group-addon input-group-addon-${t}`,n.setAttribute("aria-hidden","true"),e.icon){const t=document.createElement("span");t.setAttribute("data-icon",e.icon),n.appendChild(t)}else n.textContent=e.text;return n}function Ee(e,t,n,s){const i=document.createElement("button");return i.type="button",i.className=`input-group-btn input-group-btn-${t} input-group-${e}`,i.setAttribute("aria-label",n),Ce(i,s),i}function Se(e){const t=String(e),n=t.match(/e-(\d+)$/i);if(n)return Number(n[1]);const s=t.indexOf(".");return-1===s?0:t.length-s-1}function $e(e,t){const n=e.getAttribute(t);if(null==n||""===n||"any"===n)return null;const s=Number(n);return Number.isFinite(s)?s:null}class ze extends C{static componentName="input-group";static defaults={prefix:null,suffix:null,reveal:!1,clear:!1,stepper:!1,counter:!1,labels:{reveal:"Show password",clear:"Clear",decrease:"Decrease",increase:"Increase"}};constructor(e,t={}){if(super(e,t),this.options.labels={...ze.defaults.labels,...t.labels||{}},this.input=this.element,this._extraHandlers=[],this._timers={},this.extras={},!this.input)return;const n=this.input.parentElement;this._ownsWrapper=!(n&&n.classList.contains(be)),this._ownsWrapper?(this.wrapper=document.createElement("div"),this.wrapper.className=be,this.input.before(this.wrapper),this.wrapper.appendChild(this.input)):this.wrapper=n,this._manageAddons=this._ownsWrapper||"prefix"in t||"suffix"in t,this._render(),this._buildExtras()}update(e={}){const{prefix:t,suffix:n}=e;let s=!1;void 0!==t&&(this.options.prefix=t,s=!0),void 0!==n&&(this.options.suffix=n,s=!0),s&&(this._manageAddons=!0,this._render());const i=["reveal","clear","stepper","counter"].filter(t=>void 0!==e[t]);return i.length||e.labels?(i.forEach(t=>{this.options[t]=e[t]}),e.labels&&(this.options.labels={...this.options.labels,...e.labels}),this._teardownExtras(),this._buildExtras()):this._syncEdges(),this}refresh(){const e=this.extras;if(!e||!this.input)return this;const t=this.input,n=t.disabled||t.readOnly;if(e.clear&&(e.clear.hidden=n||""===t.value),e.reveal&&(e.reveal.disabled=t.disabled),e.decrease){const{min:s,max:i}=this._limits(),o=""===t.value?null:Number(t.value),r=null!=o&&Number.isFinite(o);e.decrease.disabled=n||r&&null!=s&&o<=s,e.increase.disabled=n||r&&null!=i&&o>=i,[e.decrease,e.increase].forEach(e=>{e.disabled&&document.activeElement===e&&t.focus()}),e.decrease.disabled&&e.increase.disabled&&this._stopRepeat()}if(e.counter){const n=this._counterLimit(),s=t.value.length;e.counter.textContent=n?`${s} / ${n}`:String(s),e.counter.classList.toggle("is-warning",!!n&&s>=Math.ceil(.9*n)&&s<=n),e.counter.classList.toggle("is-over",!!n&&s>n)}return this._syncEdges(),this}_applyOptions(){this.options.labels={...ze.defaults.labels,...this.options.labels||{}},this._render(),this._teardownExtras(),this._buildExtras()}_render(){const e=this.wrapper;if(e){if(this._manageAddons){e.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove());const t=Me(this.options.prefix),n=Me(this.options.suffix);t&&e.prepend(Ae(t,"left")),n&&e.append(Ae(n,"right")),(t&&t.icon||n&&n.icon)&&Le()?.scan?.(e)}this._syncEdges()}}_syncEdges(){const e=this.wrapper;if(!e||!this.input)return;const t=e=>e&&!e.hidden;let n=!1,s=!1;for(let e=this.input.previousElementSibling;e;e=e.previousElementSibling)if(t(e)){n=!0;break}for(let e=this.input.nextElementSibling;e;e=e.nextElementSibling)if(t(e)){s=!0;break}e.classList.toggle("has-addon-left",n),e.classList.toggle("has-addon-right",s)}_listen(e,t,n,s){e.addEventListener(t,n,s),this._extraHandlers.push({el:e,event:t,handler:n,opts:s})}_limits(){return{min:$e(this.input,"min"),max:$e(this.input,"max"),step:$e(this.input,"step")}}_counterLimit(){const e=this.options.counter;if("number"==typeof e&&e>0)return e;const t=this.input.maxLength;return t>0?t:null}_buildExtras(){const e=this.input,t=this.wrapper;if(!e||!t)return;const n=this.options,s=n.labels,i=e.tagName.toLowerCase(),o="textarea"===i?"textarea":(e.getAttribute("type")||"text").toLowerCase(),r="password"===o,a={},l=[];if(n.stepper&&"number"===o&&(a.decrease=Ee("decrease","left",s.decrease,"minus"),a.increase=Ee("increase","right",s.increase,"plus"),e.before(a.decrease),this._bindStep(a.decrease,-1),this._bindStep(a.increase,1)),n.clear&&("textarea"===i||ke.test(o))&&(a.clear=Ee("clear","right",s.clear,"x"),l.push(a.clear),this._listen(a.clear,"mousedown",e=>e.preventDefault()),this._listen(a.clear,"click",()=>{e.value="",this._fireInput(),e.focus(),this.refresh()})),n.reveal&&r&&(a.reveal=Ee("reveal","right",s.reveal,"eye"),a.reveal.setAttribute("aria-pressed","false"),l.push(a.reveal),this._listen(a.reveal,"mousedown",e=>e.preventDefault()),this._listen(a.reveal,"click",()=>this._setRevealed("true"!==a.reveal.getAttribute("aria-pressed")))),a.increase&&l.push(a.increase),l.length&&e.after(...l),e.id&&Object.values(a).forEach(t=>t.setAttribute("aria-controls",e.id)),n.counter&&("textarea"===i||we.test(o))){a.counter=document.createElement("div"),a.counter.className="form-counter",a.counter.id=`${e.id||"input"}-counter-${++xe}`,a.counter.setAttribute("aria-live","polite"),t.after(a.counter);const n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);this._describedBy=e.getAttribute("aria-describedby"),e.setAttribute("aria-describedby",[...n,a.counter.id].join(" "))}this.extras=a,Object.keys(a).length&&(this._listen(e,"input",()=>this.refresh()),this._listen(e,"change",()=>this.refresh()),e.form&&this._listen(e.form,"reset",()=>{a.reveal&&this._setRevealed(!1),this._timers.reset=setTimeout(()=>this.refresh(),0)})),this.refresh()}_setRevealed(e){const t=this.extras?.reveal;t&&(this.input.type=e?"text":"password",t.setAttribute("aria-pressed",e?"true":"false"),Ce(t,e?"eye-off":"eye"))}_fireInput(){this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0}))}step(e){const t=this.input;if(!t||t.disabled||t.readOnly)return this;const{min:n,max:s,step:i}=this._limits(),o=i&&i>0?i:1,r=null!=n?n:0,a=Math.max(Se(o),Se(r)),l=""!==t.value&&Number.isFinite(Number(t.value))?Number(t.value):null,c=((l??0)-r)/o;let h=r+(e>0?Math.floor(c+1e-9)+1:Math.ceil(c-1e-9)-1)*o;return null!=n&&h<n&&(h=n),null!=s&&h>s&&(h=s),h=Number(h.toFixed(a)),l!==h&&(t.value=String(h),this._fireInput()),this.refresh(),this}_bindStep(e,t){this._listen(e,"pointerdown",n=>{0!==n.button||e.disabled||(n.preventDefault(),this._pointerStepped=!0,this.step(t),this._stopRepeat(),this._timers.delay=setTimeout(()=>{this._timers.repeat=setInterval(()=>{e.disabled?this._stopRepeat():this.step(t)},70)},400))}),["pointerup","pointerleave","pointercancel","blur"].forEach(t=>{this._listen(e,t,()=>this._stopRepeat())}),this._listen(e,"click",e=>{e.detail>0&&this._pointerStepped?this._pointerStepped=!1:this.step(t)})}_stopRepeat(){clearTimeout(this._timers.delay),clearInterval(this._timers.repeat),this._timers.delay=this._timers.repeat=null}_teardownExtras(){this._stopRepeat(),clearTimeout(this._timers.reset);for(const{el:e,event:t,handler:n,opts:s}of this._extraHandlers)e.removeEventListener(t,n,s);this._extraHandlers=[];const e=this.extras||{};e.reveal&&this.input&&(this.input.type="password"),e.counter&&this.input&&(this._describedBy?this.input.setAttribute("aria-describedby",this._describedBy):this.input.removeAttribute("aria-describedby")),Object.values(e).forEach(e=>e.remove()),this.extras={},this._syncEdges()}destroy(){this._teardownExtras(),this.wrapper&&(this._manageAddons&&this.wrapper.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove()),this._syncEdges(),this._ownsWrapper&&this.wrapper.parentNode&&(this.wrapper.before(this.input),this.wrapper.remove())),this.wrapper=null,super.destroy()}}const Te=new Set(["text","card","list","table","custom"]),Be={type:"text",lines:null,count:null,rows:5,columns:4,header:!0,avatar:!0,image:!0,animate:!0,template:null,label:"Loading..."},je=new WeakMap;function Oe(e){return e?"string"==typeof e?document.querySelector(e):1===e.nodeType?e:"number"==typeof e.length&&e[0]&&1===e[0].nodeType?e[0]:null:null}function De(e,t){const n=parseInt(e,10);return Number.isFinite(n)&&n>0?Math.min(n,100):t}function Ne(e,t){let n="";for(let s=0;s<e;s++)n+=t(s);return n}function Ie(e,t=""){const n=t?` ${t}`:"";return`<div class="skeleton-lines">${Ne(e,()=>`<div class="skeleton skeleton-text${n}"></div>`)}</div>`}function He(e={}){const t={...Be,...e};switch(Te.has(t.type)?t.type:"text"){case"card":{const e=De(t.lines,3);return Ne(De(t.count,1),()=>'<div class="skeleton-card">'+(t.image?'<div class="skeleton skeleton-image"></div>':"")+'<div class="skeleton-card-body"><div class="skeleton skeleton-heading"></div>'+Ie(e)+"</div></div>")}case"list":{const e=De(t.lines,2);return'<div class="skeleton-list">'+Ne(De(t.count,3),()=>'<div class="skeleton-list-item">'+(t.avatar?'<div class="skeleton skeleton-circle"></div>':"")+'<div class="skeleton-list-item-content"><div class="skeleton skeleton-text skeleton-w-50"></div>'+Ne(e-1,()=>'<div class="skeleton skeleton-text skeleton-text-sm skeleton-w-75"></div>')+"</div></div>")+"</div>"}case"table":{const e=De(t.columns,4),n=t=>Ne(e,()=>`<div class="skeleton skeleton-text${t}"></div>`);return`<div class="skeleton-table" style="--dm-skeleton-columns: ${e}">`+(t.header?`<div class="skeleton-table-row skeleton-table-head">${n(" skeleton-w-50")}</div>`:"")+Ne(De(t.rows,5),()=>`<div class="skeleton-table-row">${n("")}</div>`)+"</div>"}case"custom":{const e="function"==typeof t.template?t.template(t):t.template;return null==e?"":String(e)}default:return Ne(De(t.count,1),()=>Ie(De(t.lines,3)))}}function We(e){const t=e.dataset||{},n={};t.skeleton&&Te.has(t.skeleton)&&(n.type=t.skeleton);for(const e of["lines","count","rows","columns"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["avatar","image","animate","header"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return t.skeletonLabel&&(n.label=t.skeletonLabel),n}function Pe(e,t={}){const n=Oe(e);if(!n)return null;const s=je.get(n);s&&s.remove();const i={...Be,...We(n),...t},o=document.createDocumentFragment();for(;n.firstChild;)o.appendChild(n.firstChild);const r=document.createElement("template");r.innerHTML=He(i);const a=Array.from(r.content.childNodes);for(const e of a)1===e.nodeType&&(e.setAttribute("aria-hidden","true"),i.animate||e.classList.add("skeleton-static"));const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),n.appendChild(r.content),n.appendChild(l),setTimeout(()=>{l.parentNode===n&&(l.textContent=i.label)},100),n.setAttribute("aria-busy","true"),n.classList.add("is-skeleton-loading");let c=!0;const h=()=>{for(const e of a)e.parentNode===n&&n.removeChild(e);l.parentNode===n&&n.removeChild(l),n.setAttribute("aria-busy","false"),n.classList.remove("is-skeleton-loading"),n.hasAttribute("data-skeleton")&&n.setAttribute("data-skeleton-done",""),je.get(n)===d&&je.delete(n),L(n,d),c=!1},d={element:n,options:i,get active(){return c},remove:()=>c?(h(),n.appendChild(o),n):n,replace(e){const t=je.get(n);return!c&&t&&t!==d?n:(c&&h(),n.textContent="",null==e||("string"==typeof e?n.innerHTML=e:e.nodeType?n.appendChild(e):"number"==typeof e.length&&Array.from(e).forEach(e=>e&&e.nodeType&&n.appendChild(e))),n)},destroy:()=>d.remove()};return Object.defineProperty(d,"componentName",{value:"skeleton"}),je.set(n,d),M(n,d),d}function Fe(e){return e?"string"==typeof e?"undefined"==typeof document?null:document.querySelector(e):1===e.nodeType?e:"function"==typeof e.get&&void 0!==e.length?e.get(0)||null:e[0]&&1===e[0].nodeType?e[0]:null:null}function Re(e){return e?"string"==typeof e?"undefined"==typeof document?[]:Array.from(document.querySelectorAll(e)):1===e.nodeType?[e]:"number"==typeof e.length?Array.from(e).filter(e=>e&&1===e.nodeType):[]:[]}function Ve(e,t=!1){return null==e?t:""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&Boolean(e)}function qe(e,t=0){if(null==e||""===e)return t;const n=Number(e);return Number.isFinite(n)?n:t}function Ue(e,t,n={}){if(e.replaceChildren(),null==t)return;if("undefined"!=typeof Node&&t instanceof Node)return void e.appendChild(t);const s=String(t);n.text?e.textContent=s:e.innerHTML=!1===n.safe?s:u(s)}function Ke(e){const t="undefined"!=typeof window?window.Domma?.icons:null;if(e&&t&&"function"==typeof t.scan)try{t.scan(e)}catch{}}Pe.while=async function(e,t,n={}){const s=Pe(e,n);try{const e=await("function"==typeof t?t():t);return s&&s.remove(),e}catch(e){throw s&&s.remove(),e}},Pe.get=function(e){const t=Oe(e);return t&&x(t,"skeleton")||null},Pe.remove=function(e){const t=Pe.get(e);return t?t.remove():null},Pe.scan=function(e=document){const t=Oe(e)||document;return Array.from(t.querySelectorAll("[data-skeleton]")).filter(e=>!je.has(e)&&!e.hasAttribute("data-skeleton-done")).map(e=>Pe(e))},Pe.markup=He;let Ye=0;function Ge(e){return Ye+=1,`${e}-${Ye}`}function Je(e,t,n={}){const s=x(e,t);return s?(n&&Object.keys(n).length&&s.setOptions(n),s):null}function Xe(){try{return"undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function Ze(e,t){if(!e||!t||"undefined"==typeof getComputedStyle)return;t.style.removeProperty("z-index");const n=parseInt(getComputedStyle(t).zIndex,10)||0;let s=0;for(let t=e;t&&1===t.nodeType;t=t.parentElement||t.getRootNode?.().host){const e=parseInt(getComputedStyle(t).zIndex,10);!Number.isNaN(e)&&e>s&&(s=e)}s>0&&s>=n&&(t.style.zIndex=String(s+1))}const Qe=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),et=[];function tt(e){return e?e.assignedSlot?e.assignedSlot:e.parentNode&&11===e.parentNode.nodeType&&e.parentNode.host?e.parentNode.host:e.parentNode:null}function nt(){if("undefined"==typeof document)return null;let e=document.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function st(e){if(!e.matches(Qe))return!1;if(e.tabIndex<0)return!1;if(e.matches(":disabled"))return!1;if("INPUT"===e.tagName&&"hidden"===e.type)return!1;if("SUMMARY"===e.tagName&&e.parentElement?.querySelector(":scope > summary")!==e)return!1;for(let t=e;t;t=tt(t))if(1===t.nodeType&&(t.hasAttribute("hidden")||t.hasAttribute("inert")))return!1;return!e.parentElement?.closest?.('[contenteditable]:not([contenteditable="false"])')&&!("function"==typeof e.checkVisibility&&!e.checkVisibility({visibilityProperty:!0}))}function it(e,t,n){const s=1===e.nodeType&&"SLOT"===e.tagName&&"function"==typeof e.assignedElements?e.assignedElements({flatten:!0}).length?e.assignedElements({flatten:!0}):Array.from(e.children):Array.from(e.children||[]);for(const e of s)t.push(e),n&&e.shadowRoot?it(e.shadowRoot,t,n):it(e,t,n)}function ot(e,t){const n=Array.isArray(e)?e:[e],s=[];for(const e of n)e&&(t&&e.shadowRoot?it(e.shadowRoot,s,t):it(e,s,t));return s}function rt(e,t,n=0){if("undefined"==typeof document||!e)return null;const s=document.body;for(let i=e;i&&i!==s&&i!==document.documentElement;i=tt(i)){if(1!==i.nodeType)continue;if(i.hasAttribute("data-focus-trap-allow"))return i;let e="";try{e=getComputedStyle(i).position}catch{}if("fixed"===e&&!(n>0&&at(i)<n&<(i,t)))return i;if(tt(i)===s&&("absolute"===e||t&&!t.has(i)))return i}return null}function at(e){let t=0;for(let n=e;n&&1===n.nodeType;n=tt(n)){let e=NaN;try{e=parseInt(getComputedStyle(n).zIndex,10)}catch{}!Number.isNaN(e)&&e>t&&(t=e)}return t}function lt(e,t){if(!t)return!0;let n=e;for(;n&&tt(n)&&tt(n)!==document.body;)n=tt(n);return!n||t.has(n)}function ct(e,t={}){const n=ot(e,!1!==t.shadow).filter(st),s=new Map,i=n.filter(e=>{if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!0;const t=e.form||e.getRootNode(),i=`${e.name}`;s.has(t)||s.set(t,new Map);const o=s.get(t);if(!o.has(i)){const s=n.filter(n=>"INPUT"===n.tagName&&"radio"===n.type&&n.name===e.name&&(n.form||n.getRootNode())===t);o.set(i,s.find(e=>e.checked)||s[0])}return o.get(i)===e});return[...i.filter(e=>e.tabIndex>0).sort((e,t)=>e.tabIndex-t.tabIndex),...i.filter(e=>e.tabIndex<=0)]}function ht(e,t){return"function"==typeof e?!!e(t):!!e}const dt=["click","keydown","input","change","submit"];class ut extends C{static componentName="focus-trap";static defaults={initialFocus:void 0,fallbackFocus:void 0,returnFocus:!0,escapeDeactivates:!1,clickOutsideDeactivates:!1,allowOutsideClick:!1,allowOutsideFocus:!1,allowScriptFocus:!1,inert:!1,shadow:!0,preventScroll:!0,register:!0,onActivate:null,onDeactivate:null,onPause:null,onUnpause:null};constructor(e,t={}){const n=ut._resolve(e),s=n[0]?._dommaComponent;super(n[0]||null,t),!1===this.options.register&&this.element&&(L(this.element,this),s?this.element._dommaComponent=s:delete this.element._dommaComponent),this._containers=n,this._bodyAtStart=null,this._floor=0,this._pendingTab=null,this._active=!1,this._paused=!1,this._returnTo=null,this._lastFocused=null,this._madeFocusable=[],this._inerted=[],this._bound=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onTab=this._onTab.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onClick=this._onClick.bind(this),this._onInsideEvent=this._onInsideEvent.bind(this)}static _resolve(e){if(Array.isArray(e))return e.map(e=>Fe(e)).filter(Boolean);if("string"==typeof e)return Re(e);const t=Fe(e);return t?[t]:[]}static top(){return et[et.length-1]||null}activate(e={}){if(this._active||this._destroyed||!this._containers.length)return this;const t=ut.top();t&&t!==this&&t.pause(),this._active=!0,this._paused=!1,et.push(this),this._returnTo=nt(),this._lastFocused=null,this._bodyAtStart="undefined"!=typeof document&&document.body?new Set(document.body.children):null,this._floor=at(this._containers[0]),this._applyInert(),this._bind();const n="initialFocus"in e?e.initialFocus:this.options.initialFocus;return!1!==n&&this._focusInitial(n),this._fire("activate",this),this}deactivate(e={}){if(!this._active)return this;this._active=!1,this._paused=!1,this._unbind(),this._clearInert();const t=ut.top()===this,n=et.indexOf(this);n>-1&&et.splice(n,1),this._clearFocusable(),this._pendingTab=null;const s="returnFocus"in e?e.returnFocus:this.options.returnFocus,i=this._returnTo;let o=!0===s?i:s&&!1!==s?Fe(s):null;if(this._returnTo=null,!t){for(const e of et.slice(Math.max(n,0)))e._returnTo&&this._contains(e._returnTo)&&(e._returnTo=o||i);o=null}const r=ut.top();if(t&&r&&r._paused&&r.unpause({focus:!o,_leaving:this}),o&&o.isConnected&&"function"==typeof o.focus)try{o.focus({preventScroll:!!this.options.preventScroll})}catch{}if(t&&o&&r&&ut.top()===r&&!r._paused){const e=nt();e===o||r._contains(e)||r._focus(r._lastFocused&&r._lastFocused.isConnected&&st(r._lastFocused)?r._lastFocused:r._firstTarget())}return this._fire("deactivate",this),this}pause(){return!this._active||this._paused||(this._paused=!0,this._unbind(),this._clearInert(),this._fire("pause",this)),this}unpause(e={}){if(!this._active||!this._paused)return this;if(ut.top()!==this)return this;this._paused=!1,this._applyInert(),this._bind();const t=nt(),n=t&&t!==document.body&&!(e._leaving&&e._leaving._contains(t))&&this._mayFocusOutside(t,null);return!1===e.focus||this._contains(t)||n||this._focus(this._lastFocused&&st(this._lastFocused)?this._lastFocused:this._firstTarget()),this._fire("unpause",this),this}updateContainers(e){const t=ut._resolve(e),n=t[0]||null;return n!==this.element&&(this.element&&!1!==this.options.register&&L(this.element,this),this.element=n,n&&!1!==this.options.register&&M(n,this)),this._containers=t,this._active&&!this._paused&&(this._clearInert(),this._applyInert()),this}containers(){return this._containers.slice()}isActive(){return this._active}isPaused(){return this._active&&this._paused}tabbables(){return ct(this._containers,{shadow:this.options.shadow})}destroy(){this._destroyed||(this.deactivate({returnFocus:!1}),this._destroyed=!0,super.destroy())}_contains(e){return!!e&&this._containers.some(t=>function(e,t){for(let n=t;n;n=tt(n))if(n===e)return!0;return!1}(t,e))}_eventInside(e){const t="function"==typeof e.composedPath?e.composedPath():[];return t.length?this._containers.some(e=>t.includes(e)):this._contains(e.target)}_bind(){if(!this._bound&&"undefined"!=typeof document){document.addEventListener("keydown",this._onKeyDown,!0),window.addEventListener("keydown",this._onTab),document.addEventListener("focusin",this._onFocusIn,!0),document.addEventListener("pointerdown",this._onPointerDown,!0),document.addEventListener("mousedown",this._onPointerDown,!0),document.addEventListener("click",this._onClick,!0);for(const e of dt)document.addEventListener(e,this._onInsideEvent,!0);this._bound=!0}}_unbind(){if(this._bound){document.removeEventListener("keydown",this._onKeyDown,!0),window.removeEventListener("keydown",this._onTab),document.removeEventListener("focusin",this._onFocusIn,!0),document.removeEventListener("pointerdown",this._onPointerDown,!0),document.removeEventListener("mousedown",this._onPointerDown,!0),document.removeEventListener("click",this._onClick,!0);for(const e of dt)document.removeEventListener(e,this._onInsideEvent,!0);this._bound=!1}}_fallback(){const e=this.options.fallbackFocus,t="function"==typeof e?e():e?Fe(e):null;if(t)return t;const n=this._containers[0];return n&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),this._madeFocusable.push(n)),n}_clearFocusable(){for(const e of this._madeFocusable)e.removeAttribute("tabindex");this._madeFocusable=[]}_firstTarget(){return this.tabbables()[0]||this._fallback()}_focusInitial(e){let t=null;if("function"==typeof e?t=Fe(e()):e&&(t="string"==typeof e&&this._containers.map(t=>t.querySelector(e)).find(Boolean)||Fe(e)),!t){const e=nt();if(this._contains(e)&&e!==document.body)return void(this._lastFocused=e);t=this._firstTarget()}this._focus(t)}_focus(e,t=!1){if(e&&"function"==typeof e.focus){try{e.focus({preventScroll:!t&&!!this.options.preventScroll})}catch{}this._lastFocused=e}}_tabTo(e,t,n=!1){if(this._focus(e,!0),!t||!e||nt()===e)return;const s=t.indexOf(e);for(let e=1;s>-1&&e<t.length;e++){const i=t[(s+(n?-e:e)+t.length*e)%t.length];if(this._focus(i,!0),nt()===i)return}}_gone(){return!this._containers.some(e=>e.isConnected)&&(this.deactivate({returnFocus:!1}),!0)}_mayFocusOutside(e,t){const n=this.options.allowOutsideFocus;return"function"==typeof n?!!n(e,t):"layers"!==n?!!n:!et.some(t=>t!==this&&t._contains(e))&&!!rt(e,this._bodyAtStart,this._floor)}_onKeyDown(e){if(this._gone())return;if("Escape"===e.key&&!e.defaultPrevented&&ht(this.options.escapeDeactivates,e))return e.preventDefault(),void this.deactivate();if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey)return;const t={shift:e.shiftKey,fromInside:this._contains(nt())};this._pendingTab=t,setTimeout(()=>{this._pendingTab===t&&(this._pendingTab=null)},0)}_onTab(e){if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey)return;if(this._pendingTab=null,e.defaultPrevented||this._gone())return;const t=nt();if(t&&t!==document.body&&!this._contains(t)){const n=this._mayFocusOutside(t,e)?rt(t,this._bodyAtStart,this._floor):null;if(n)return void this._tabInLayer(e,n,t)}const n=this.tabbables();if(e.preventDefault(),!n.length)return void this._tabTo(this._fallback());let s,i=n.indexOf(t);s=i>-1?e.shiftKey?n[(i-1+n.length)%n.length]:n[(i+1)%n.length]:t&&this._contains(t)?this._nextFrom(t,n,e.shiftKey):e.shiftKey?n[n.length-1]:n[0],this._tabTo(s,n,e.shiftKey)}_nextFrom(e,t,n){const s=ot(this._containers,!1!==this.options.shadow),i=s.indexOf(e);if(i<0)return n?t[t.length-1]:t[0];const o=e=>s.indexOf(e);if(n){const e=t.filter(e=>o(e)<i);return e[e.length-1]||t[t.length-1]}return t.find(e=>o(e)>i)||t[0]}_tabInLayer(e,t,n){const s=ct(t,{shadow:this.options.shadow}),i=s.indexOf(n);if(e.preventDefault(),i>-1){const t=s[e.shiftKey?i-1:i+1];if(t)return void t.focus({preventScroll:!1})}else if(s.length)return void s[e.shiftKey?s.length-1:0].focus({preventScroll:!1});const o=this.tabbables(),r=this._lastFocused&&this._lastFocused.isConnected&&this._contains(this._lastFocused)?this._lastFocused:null;if(!o.length)return void this._tabTo(r||this._fallback());if(!r)return void this._tabTo(e.shiftKey?o[o.length-1]:o[0]);if(e.shiftKey)return void this._tabTo(r);const a=o.indexOf(r);this._tabTo(a>-1?o[(a+1)%o.length]:this._nextFrom(r,o,!1))}_onFocusIn(e){if(this._gone())return;const t="function"==typeof e.composedPath&&e.composedPath()[0]||e.target;if(this._eventInside(e))return void(this._lastFocused=t);const n=this._pendingTab;if(this._pendingTab=null,this._mayFocusOutside(t,e))return;if(n&&n.fromInside){e.stopImmediatePropagation?.();const t=this.tabbables();return void this._tabTo(t.length?n.shift?t[t.length-1]:t[0]:this._fallback())}if(this.options.allowScriptFocus&&this._scriptTurn)return;e.stopImmediatePropagation?.();const s=this._lastFocused&&this._lastFocused.isConnected&&this._contains(this._lastFocused)?this._lastFocused:null;if(s&&/^(IFRAME|OBJECT|EMBED)$/.test(s.tagName)){const e=this.tabbables(),n=this._containers.some(e=>4&e.compareDocumentPosition(t));return void this._tabTo(e.length?n?e[0]:e[e.length-1]:this._fallback())}this._focus(s||this._firstTarget())}_onPointerDown(e){if(!this._eventInside(e)){if(ht(this.options.clickOutsideDeactivates,e)){const t=e.target?.closest?.(Qe);return void this.deactivate({returnFocus:!t&&this.options.returnFocus})}ht(this.options.allowOutsideClick,e)||e.preventDefault()}}_onInsideEvent(e){if(!this.options.allowScriptFocus||!this._eventInside(e))return;if("keydown"===e.type&&"Tab"===e.key)return;const t={};this._scriptTurn=t,setTimeout(()=>{this._scriptTurn===t&&(this._scriptTurn=null)},0)}_onClick(e){this._eventInside(e)||ht(this.options.clickOutsideDeactivates,e)||ht(this.options.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}_applyInert(){if(!this.options.inert||"undefined"==typeof document)return;const e=this._containers,t=new Set;for(const n of e)for(let s=n;s&&s!==document.body&&s.parentElement;s=s.parentElement)for(const n of s.parentElement.children)n===s||t.has(n)||e.some(e=>n.contains(e))||/^(SCRIPT|STYLE|TEMPLATE|LINK|META)$/.test(n.tagName)||(t.add(n),n.hasAttribute("inert")||(n.setAttribute("inert",""),this._inerted.push(n)))}_clearInert(){for(const e of this._inerted)e.removeAttribute("inert");this._inerted=[]}}function pt(e,t={}){return new ut(e,t)}const mt=["top","bottom","left","right"],ft={top:"bottom",bottom:"top",left:"right",right:"left"},_t={top:["right","left"],bottom:["right","left"],left:["bottom","top"],right:["bottom","top"]},gt=["bottom","top","right","left"],vt="a[href], button, input, select, textarea, summary",bt=e=>"function"==typeof e,yt=e=>"undefined"!=typeof Node&&e instanceof Node,kt=[],wt=new WeakMap;let xt=0,Mt=!1;function Lt(e){return e?"string"==typeof e?document.querySelector(e):yt(e)?e:"function"==typeof e.get&&yt(e.get(0))?e.get(0):yt(e[0])?e[0]:null:null}function Ct(e,t){return e?ct(e,t):[]}function At(e){if(e&&"object"==typeof e)return{show:Number(e.show)||0,hide:Number(e.hide)||0};const t=Number(e)||0;return{show:t,hide:t}}const Et=".dm-context-menu";function St(e){const t=e.target;if(!(t instanceof Element&&t.closest(Et)))for(const e of kt.slice().reverse())e._open&&e.options.closeOnOutside&&(e._contains(t)||e.hide({returnFocus:!1}))}function $t(e){if("Escape"!==e.key&&"Esc"!==e.key)return;const t=kt[kt.length-1];if(!t||!t.options.closeOnEscape)return;const n=e.target;if(t._panel&&n instanceof Node&&t._panel.contains(n))return;if(n instanceof Element&&n.closest(Et))return;const s=t._contains(document.activeElement);e.preventDefault(),e.stopPropagation(),t.hide({returnFocus:s})}function zt(e){const t=e.target;if(!(t instanceof Element&&t.closest(Et)))for(const e of kt.slice().reverse())e._open&&e._closesOnFocusLeave()&&(e._contains(t)||e.hide({returnFocus:!1}))}function Tt(){Mt&&!kt.length&&(Mt=!1,document.removeEventListener("pointerdown",St,!0),document.removeEventListener("keydown",$t,!0),document.removeEventListener("focusin",zt,!0))}class Bt extends C{static componentName="popover";static defaults={content:"",title:"",html:!1,trigger:"click",placement:"bottom",flip:!0,offset:10,arrow:!0,dismissible:!1,closeOnOutside:!0,closeOnEscape:!0,group:"default",width:null,maxWidth:null,className:"",id:null,role:null,ariaLabel:null,autoFocus:null,trapFocus:!1,delay:{show:80,hide:120},animation:!0,animationDuration:150,container:null,zIndex:null,onShow:null,onShown:null,onHide:null,onHidden:null};constructor(e,t={}){if(super(Lt(e),t),this._open=!1,this._panel=null,this._parent=null,this._timers={show:null,hide:null,remove:null,shown:null},this._triggerHandlers=[],this._openHandlers=[],this._savedAttrs=null,this._frame=null,this._resizeObserver=null,this._destroyed=!1,!this.element)return;const n=wt.get(this.element);n&&n!==this&&(n.destroy(),this.element._dommaComponent=this),wt.set(this.element,this),this.id=this.options.id||"dm-popover-"+ ++xt,this._saveAttrs(),this._applyTriggerAria(),this._bindTrigger()}get panel(){return this._panel}get trigger(){return this.element}isOpen(){return this._open}show(e={}){if(!this.element||this._destroyed||!this.element.isConnected)return this;if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open)return this;if(!this._phase("show",!0))return this;this._openedBy=e.via||"api";const t=this._ensurePanel();this._render(),this._parent=kt.slice().reverse().find(e=>e!==this&&e._panel&&e._panel.contains(this.element))||null;const n=this.options.group;if(null!=n&&!1!==n)for(const e of kt.slice())e!==this&&e.options.group===n&&(e._isAncestorOf(this)||e.hide({returnFocus:!1}));clearTimeout(this._timers.remove),clearTimeout(this._timers.shown);const s=Lt(this.options.container)||document.body;if(t.parentNode!==s&&s.appendChild(t),this._open=!0,kt.push(this),Mt||"undefined"==typeof document||(Mt=!0,document.addEventListener("pointerdown",St,!0),document.addEventListener("keydown",$t,!0),document.addEventListener("focusin",zt,!0)),this._bindOpen(),this._setExpanded(!0),t.classList.remove("is-open"),this.update(),!this._open)return this;t.offsetHeight,t.classList.add("is-open");(void 0!==e.focus?e.focus:null!==this.options.autoFocus?this.options.autoFocus:"click"===this._openedBy||"api"===this._openedBy&&this._triggers().includes("click"))&&this._focusInside();const i=this._duration();return i?this._timers.shown=setTimeout(()=>{this._open&&this._phase("shown")},i):this._phase("shown"),this}hide(e={}){if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),!this._open)return this;if(!this._phase("hide",!e._force)&&!e._force)return this;for(const e of kt.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});const t=this._panel,n=t&&t.contains(document.activeElement),s=void 0!==e.returnFocus?e.returnFocus:n;this._open=!1,this._parent=null;const i=kt.indexOf(this);if(i>-1&&kt.splice(i,1),this._unbindOpen(),Tt(),this._setExpanded(!1),clearTimeout(this._timers.shown),this._releaseTrap(),s&&this.element&&bt(this.element.focus)){this._returningFocus=!0;try{this.element.focus({preventScroll:!0})}finally{this._returningFocus=!1}}if(t){t.classList.remove("is-open");const e=()=>{this._open||(t.remove(),this._phase("hidden"))},n=this._duration();n?this._timers.remove=setTimeout(e,n):e()}return this}toggle(e={}){return this._open?this.hide(e):this.show(e)}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}isVisible(){return this.isOpen()}setContent(e){return this.options.content=e,this._panel&&(this._renderBody(),this._open&&this.update()),this}setTitle(e){return this.options.title=e,this._panel&&(this._renderTitle(),this._open&&this.update()),this}update(){return this._open&&this._panel&&this.element?this.element.isConnected?(this._position(),this):(this.hide({returnFocus:!1}),this):this}destroy(){if(this._destroyed)return;this._destroyed=!0;if(kt.indexOf(this)>-1){for(const e of kt.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});kt.splice(kt.indexOf(this),1)}const e=this._panel&&this._panel.contains(document.activeElement);this._open=!1,this._releaseTrap(),this._trap&&(this._trap.destroy(),this._trap=null),this._unbindOpen(),Tt(),Object.values(this._timers).forEach(e=>clearTimeout(e)),this._panel&&(this._panel.remove(),this._panel=null),this._unbindTrigger(),this._restoreAttrs(),e&&this.element&&bt(this.element.focus)&&this.element.focus({preventScroll:!0}),this.element&&wt.get(this.element)===this&&wt.delete(this.element),bt(this._onDestroy)&&this._onDestroy(this),super.destroy()}setOptions(e={}){return this._changedKeys=Object.keys(e||{}),super.setOptions(e)}_applyOptions(){if(this.element&&!this._destroyed){if(this._unbindTrigger(),this._applyTriggerAria(),this._bindTrigger(),this._panel){this._styleNode();const e=this._changedKeys||[];(e.includes("content")||e.includes("html"))&&this._renderBody(),e.includes("title")||e.includes("html")?this._renderTitle():this._label(),this._open&&this.update()}this._changedKeys=null}}_triggers(){return String(this.options.trigger||"click").split(/[\s,]+/).filter(Boolean)}_role(){if(this.options.role)return this.options.role;const e=this._triggers();return e.length&&e.every(e=>"hover"===e||"focus"===e)?"tooltip":"dialog"}_closesOnFocusLeave(){const e=this._triggers();return this.options.closeOnOutside||e.includes("focus")||e.includes("hover")}_on(e,t,n,s){e.addEventListener(t,n),s.push({el:e,event:t,handler:n})}_bindTrigger(){const e=this.element,t=this._triggerHandlers,n=this._triggers(),s=()=>At(this.options.delay);n.includes("click")&&(this._on(e,"click",t=>{if(e.matches?.("a[href]")&&t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void(!1!==this.options.autoFocus&&this._focusInside());this.toggle({via:"click"})},t),e.matches?.(vt)||this._on(e,"keydown",t=>{if(t.target===e&&!t.repeat&&("Enter"===t.key||" "===t.key)){if(t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void this._focusInside();this.toggle({focus:!0,via:"click"})}},t)),n.includes("hover")&&(this._on(e,"mouseenter",()=>this._scheduleShow(s().show),t),this._on(e,"mouseleave",()=>this._scheduleHide(s().hide,"hover"),t)),(n.includes("focus")||n.includes("hover"))&&(this._on(e,"focusin",()=>{this._returningFocus||this.show({focus:!1,via:"focus"})},t),this._on(e,"focusout",e=>{this._contains(e.relatedTarget)||this._scheduleHide(0,"focus")},t)),this._on(e,"keydown",e=>{if("Tab"!==e.key||e.shiftKey||!this._open||!this._panel)return;const t=Ct(this._panel);t.length&&(e.preventDefault(),t[0].focus())},t)}_unbindTrigger(){for(const{el:e,event:t,handler:n}of this._triggerHandlers)e.removeEventListener(t,n);this._triggerHandlers=[]}_scheduleShow(e){clearTimeout(this._timers.hide),clearTimeout(this._timers.show),this._open||(e>0?this._timers.show=setTimeout(()=>this.show({focus:!1,via:"hover"}),e):this.show({focus:!1,via:"hover"}))}_scheduleHide(e,t=null){clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open&&(t&&"click"===this._openedBy||(e>0?this._timers.hide=setTimeout(()=>this.hide(),e):this.hide()))}_saveAttrs(){const e=this.element,t=["aria-haspopup","aria-expanded","aria-controls","aria-describedby","tabindex","role"];this._savedAttrs={};for(const n of t)this._savedAttrs[n]=e.hasAttribute(n)?e.getAttribute(n):null}_restoreAttrs(){const e=this.element;if(e&&this._savedAttrs){for(const[t,n]of Object.entries(this._savedAttrs))null===n?e.removeAttribute(t):e.setAttribute(t,n);e.classList.remove("dm-popover-trigger","is-popover-open")}}_applyTriggerAria(){const e=this.element;this._restoreAttrs(),e.classList.add("dm-popover-trigger"),"dialog"===this._role()&&(e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",this._open?"true":"false"));const t=this._triggers();!(t.includes("click")||t.includes("focus")||t.includes("hover"))||e.matches?.(vt)||e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),!t.includes("click")||e.matches?.(vt)||e.hasAttribute("role")||e.setAttribute("role","button"),this._open&&this._setExpanded(!0)}_setExpanded(e){const t=this.element;if(t)if(t.classList.toggle("is-popover-open",e),"dialog"===this._role())t.setAttribute("aria-expanded",e?"true":"false"),e?t.setAttribute("aria-controls",this.id):null!=this._savedAttrs?.["aria-controls"]?t.setAttribute("aria-controls",this._savedAttrs["aria-controls"]):t.removeAttribute("aria-controls");else{const n=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==this.id);e&&n.push(this.id),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}}_ensurePanel(){if(this._panel)return this._panel;const e=document.createElement("div");e.id=this.id,e.setAttribute("tabindex","-1");const t=document.createElement("div");t.className="dm-popover-arrow",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="dm-popover-header";const s=document.createElement("div");s.className="dm-popover-title",s.id=`${this.id}-title`,n.appendChild(s);const i=document.createElement("div");i.className="dm-popover-body";const o=document.createElement("button");o.type="button",o.className="dm-popover-close",o.setAttribute("aria-label","Close");const r=document.createElement("span");return r.setAttribute("data-icon","x"),r.setAttribute("data-icon-size","16"),r.setAttribute("aria-hidden","true"),o.appendChild(r),e.append(t,n,i,o),this._panel=e,this._parts={arrow:t,header:n,title:s,body:i,close:o},o.addEventListener("click",()=>this.hide({returnFocus:!0})),e.addEventListener("keydown",e=>this._onPanelKeyDown(e)),e.addEventListener("mouseenter",()=>{this._triggers().includes("hover")&&clearTimeout(this._timers.hide)}),e.addEventListener("mouseleave",()=>{this._triggers().includes("hover")&&this._scheduleHide(At(this.options.delay).hide,"hover")}),e.addEventListener("focusin",()=>this._holdTrap()),e.addEventListener("focusout",e=>{this._trap?.isActive()&&!this._panel.contains(e.relatedTarget)&&setTimeout(()=>{this._panel&&!this._panel.contains(document.activeElement)&&this._releaseTrap()},0);const t=this._triggers();(t.includes("focus")||t.includes("hover"))&&(this._contains(e.relatedTarget)||this._scheduleHide(0,"focus"))}),this._styleNode(),e}_styleNode(){const e=this._panel,t=this.options,n=this._role(),s=["dm-popover"];t.dismissible&&s.push("is-dismissible"),t.arrow||s.push("no-arrow"),this._open&&s.push("is-open"),e.classList.contains("has-title")&&s.push("has-title"),e.classList.contains("is-detached")&&s.push("is-detached"),t.className&&s.push(...String(t.className).split(/\s+/).filter(Boolean)),e.className=s.join(" "),e.setAttribute("role",n),e.dataset.animation=t.animation?"on":"off",e.style.setProperty("--dm-popover-duration",`${this._duration()}ms`);const i=(t,n)=>{null==n||""===n?e.style.removeProperty(t):e.style.setProperty(t,"number"==typeof n?`${n}px`:String(n))};i("--dm-popover-width",t.width),i("--dm-popover-max-width",t.maxWidth),null!==t.zIndex&&void 0!==t.zIndex?e.style.zIndex=String(t.zIndex):e.style.removeProperty("z-index"),this._parts.arrow.hidden=!t.arrow,this._parts.close.hidden=!t.dismissible}_render(){this._renderTitle(),this._renderBody()}_renderTitle(){const{title:e,header:t}=this._parts,n=this._fill(e,this.options.title);t.hidden=!n,this._panel.classList.toggle("has-title",n),this._label()}_renderBody(){this._fill(this._parts.body,this.options.content),"undefined"!=typeof window&&window.Domma?.icons&&bt(window.Domma.icons.scan)&&window.Domma.icons.scan(this._panel)}_label(){const e=this._panel;!this._parts.header.hidden?(e.setAttribute("aria-labelledby",this._parts.title.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.options.ariaLabel?e.setAttribute("aria-label",this.options.ariaLabel):e.removeAttribute("aria-label"))}_fill(e,t){e.textContent="";let n=t;if(bt(n)&&(n=n.call(this,this)),null==n||!1===n||""===n)return!1;if(yt(n))return e.appendChild(n),!0;if("object"==typeof n&&"number"==typeof n.length&&yt(n[0]))return Array.from(n).forEach(t=>yt(t)&&e.appendChild(t)),!0;const s=String(n);return this.options.html?e.innerHTML=p.sanitise(s):e.textContent=s,!0}_duration(){return!this.options.animation||function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animationDuration)||0)}_holdTrap(){this.options.trapFocus&&this._open&&this._panel&&(this._trap||(this._trap=new ut(this._panel,{initialFocus:!1,returnFocus:!1,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:!0,register:!1})),this._trap.isActive()||this._trap.activate())}_releaseTrap(){this._trap?.isActive()&&this._trap.deactivate({returnFocus:!1})}_focusInside(){const e=this._panel;if(!e)return;(Ct(e).filter(e=>!e.closest(".dm-popover-close"))[0]||e).focus({preventScroll:!0})}_onPanelKeyDown(e){if(!this._open)return;if("Escape"===e.key||"Esc"===e.key){if(e.defaultPrevented||!this.options.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void this.hide({returnFocus:!0})}if("Tab"!==e.key)return;const t=Ct(this._panel),n=t[0],s=t[t.length-1],i=document.activeElement;if(this.options.trapFocus){if(this._trap?.isActive())return;return t.length?void(!e.shiftKey||i!==n&&i!==this._panel?e.shiftKey||i!==s||(e.preventDefault(),n.focus()):(e.preventDefault(),s.focus())):void e.preventDefault()}if(e.shiftKey&&(!t.length||i===n||i===this._panel))return e.preventDefault(),void this.element.focus();if(!(e.shiftKey||t.length&&i!==s)){const t=this._nextTabbableAfterTrigger();e.preventDefault(),this.hide({returnFocus:!t}),t&&(t.focus(),document.activeElement!==t&&this.element.focus({preventScroll:!0}))}}_nextTabbableAfterTrigger(){const e=this.element,t=e.closest(".dm-popover"),n=ut.top();if(!t&&n&&n!==this._trap&&n.containers().some(t=>t.contains(e))){const t=n.tabbables(),s=t.indexOf(e);if(s>-1)return t.slice(s+1).concat(t.slice(0,s)).find(t=>!e.contains(t))||null;const i=t.filter(t=>!e.contains(t));return i.find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||i[0]||null}return Ct(t||document.body,{shadow:!1}).filter(n=>n.closest(".dm-popover")===t&&!e.contains(n)).find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||null}_bindOpen(){const e=this._openHandlers,t=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame;this._frameIsTimeout=!e;const t=e?requestAnimationFrame:e=>setTimeout(e,16);this._frame=t(()=>{this._frame=null,this.update()})},n=()=>t();window.addEventListener("scroll",n,{capture:!0,passive:!0}),e.push({el:window,event:"scroll",handler:n,capture:!0}),window.addEventListener("resize",t),e.push({el:window,event:"resize",handler:t}),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(t),this._resizeObserver.observe(this._panel),this._resizeObserver.observe(this.element))}_unbindOpen(){for(const{el:e,event:t,handler:n,capture:s}of this._openHandlers)e.removeEventListener(t,n,s?{capture:!0}:void 0);this._openHandlers=[],this._resizeObserver?.disconnect(),this._resizeObserver=null,this._frame&&(this._frameIsTimeout?clearTimeout(this._frame):"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this._frame),this._frame=null)}_contains(e){return!(!e||!yt(e))&&(!(!this.element||!this.element.contains(e))||(!(!this._panel||!this._panel.contains(e))||kt.some(t=>t!==this&&t._parent===this&&t._contains(e))))}_isAncestorOf(e){let t=e._parent;for(;t;){if(t===this)return!0;t=t._parent}return!1}_position(){const e=this._panel,t=this.options,n=this.element.getBoundingClientRect(),{width:s,height:i}=function(){const e=document.documentElement;return{width:e.clientWidth||window.innerWidth||0,height:e.clientHeight||window.innerHeight||0}}(),o=n.bottom<0||n.top>i||n.right<0||n.left>s;e.classList.toggle("is-detached",o),e.style.left="0px",e.style.top="0px";const r=e.offsetWidth,a=e.offsetHeight,[l,c]=function(e){if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0];const t=Number(e);return[0,Number.isFinite(t)?t:10]}(t.offset);let[h,d]=function(e){const[t,n]=String(e||"bottom").split("-");return["auto"===t||mt.includes(t)?t:"bottom","start"===n||"end"===n?n:"center"]}(t.placement);const u={top:n.top-8,bottom:i-n.bottom-8,left:n.left-8,right:s-n.right-8},p=e=>u[e]>=(e=>("top"===e||"bottom"===e?a:r)+c)(e);if("auto"===h)h=gt.find(p)||gt.reduce((e,t)=>u[t]>u[e]?t:e);else if(t.flip&&!p(h)){const e=[ft[h],..._t[h]].find(p);e?h=e:u[ft[h]]>u[h]&&(h=ft[h])}let m,f;const _="top"===h||"bottom"===h;_?(f="top"===h?n.top-c-a:n.bottom+c,m="start"===d?n.left+l:"end"===d?n.right-r-l:n.left+n.width/2-r/2+l):(m="left"===h?n.left-c-r:n.right+c,f="start"===d?n.top+l:"end"===d?n.bottom-a-l:n.top+n.height/2-a/2+l);const g=(e,t,n)=>t+16>n?8:Math.min(Math.max(e,8),n-t-8);m=g(m,r,s),f=g(f,a,i),e.style.left=`${Math.round(m)}px`,e.style.top=`${Math.round(f)}px`,e.dataset.side=h,e.dataset.placement="center"===d?h:`${h}-${d}`;const v=this._parts.arrow;if(t.arrow)if(_){const t=n.left+n.width/2-m-(e.clientLeft||0);v.style.left=`${Math.round(Math.min(Math.max(t,12),r-12))}px`,v.style.top=""}else{const t=n.top+n.height/2-f-(e.clientTop||0);v.style.top=`${Math.round(Math.min(Math.max(t,12),a-12))}px`,v.style.left=""}}_phase(e,t=!1){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];let s=!0;return bt(n)&&!1===n.call(this,this)&&t&&(s=!1),!this._emit(e,this)&&t&&(s=!1),s}static scan(e=document,t=null){const n="string"==typeof e?document.querySelector(e):Lt(e)||e;if(!n||!bt(n.querySelectorAll))return[];const s=[],i="[data-popover], [data-popover-content]",o=Array.from(n.querySelectorAll(i));bt(n.matches)&&n.matches(i)&&o.unshift(n);for(const e of o){if(wt.has(e))continue;const n=Bt.optionsFromAttributes(e);s.push(t?t(e,n):new Bt(e,n))}return s}static optionsFromAttributes(e){const t=e.dataset||{},n={},s=e=>void 0!==e&&"false"!==e&&"0"!==e;if(t.popover&&(n.content=t.popover),t.popoverContent){const e=document.querySelector(t.popoverContent);e&&(n.content=()=>{if("TEMPLATE"===e.tagName)return e.content.cloneNode(!0);const t=e.cloneNode(!0);return t.removeAttribute("id"),t.removeAttribute("hidden"),t})}return t.popoverTitle&&(n.title=t.popoverTitle),t.popoverTrigger&&(n.trigger=t.popoverTrigger),t.popoverPlacement&&(n.placement=t.popoverPlacement),void 0!==t.popoverGroup&&(n.group=""===t.popoverGroup||"none"===t.popoverGroup?null:t.popoverGroup),void 0!==t.popoverDismissible&&(n.dismissible=s(t.popoverDismissible)),void 0!==t.popoverArrow&&(n.arrow=s(t.popoverArrow)),t.popoverWidth&&(n.width=t.popoverWidth),t.popoverMaxWidth&&(n.maxWidth=t.popoverMaxWidth),t.popoverClass&&(n.className=t.popoverClass),n}static closeAll(e){for(const t of kt.slice().reverse())void 0!==e&&t.options.group!==e||t.hide({returnFocus:!1})}static getInstance(e){const t=Lt(e);return t&&x(t,"popover")||null}static openPopovers(){return kt.slice()}}const jt=["xs","sm","md","lg","xl"],Ot=["circle","rounded","square"],Dt=["online","away","busy","offline"],Nt={none:0,sm:.15,md:.25,lg:.4},It=/^[a-z0-9-]+$/i,Ht={name:null,src:null,alt:null,size:"md",shape:"circle",status:null,statusLabels:null,icon:null,title:null,ring:!1,tone:null,decorative:!1},Wt={online:"online",away:"away",busy:"busy",offline:"offline"},Pt=new WeakMap,Ft=new WeakMap;function Rt(e){return!!e&&"object"==typeof e&&1===e.nodeType}function Vt(e){return e?"string"==typeof e?document.querySelector(e):Rt(e)?e:"function"==typeof e.get&&Rt(e.get(0))?e.get(0):"number"==typeof e.length&&Rt(e[0])?e[0]:null:null}function qt(e){const t=e.match(/^\P{M}\p{M}*/u);return t?t[0]:""}function Ut(e){if(null==e)return"";let t=String(e).trim();if(!t)return"";const n=t.indexOf("@");n>0&&!/\s/.test(t)&&(t=t.slice(0,n)),t=t.replace(/\([^)]*\)|\[[^\]]*\]/g," ");const s=t.split(/[\s._+\-]+/u).map(e=>e.replace(/^[^\p{L}\p{N}]+/u,"")).filter(Boolean);if(!s.length)return"";return(qt(s[0])+(s.length>1?qt(s[s.length-1]):"")).toUpperCase()}function Kt(e){const t=String(e??"").trim().toLowerCase().replace(/\s+/g," ");let n=2166136261;for(const e of t)n^=e.codePointAt(0),n=Math.imul(n,16777619);return(n>>>0)%8}function Yt(e,t,n){return e.includes(t)?t:n}function Gt(e,t){if(t&&!e.icon){const e=document.createElement("span");return e.className="avatar-initials",e.setAttribute("aria-hidden","true"),e.textContent=t,e}const n=document.createElement("span");return n.className="avatar-icon",n.setAttribute("aria-hidden","true"),n.setAttribute("data-icon",e.icon&&It.test(e.icon)?e.icon:"user"),n}function Jt(e){e.querySelector(".avatar-icon[data-icon]")&&("undefined"!=typeof window&&(window.Domma?.icons||window.I)||null)?.scan?.(e)}function Xt(e,t,n=null){const s=Yt(jt,t.size,"md"),i=Yt(Ot,t.shape,"circle"),o=Ut(t.name||(t.alt&&!t.src?t.alt:"")),r=function(e){const t=parseInt(e.tone,10);if(Number.isFinite(t))return(t%8+8)%8;const n=e.name||e.alt||e.src;return n?Kt(n):null}(t);if(e.classList.remove(...function(e){return Array.from(e.classList).filter(e=>"avatar"===e||/^avatar-(xs|sm|md|lg|xl|rounded|square|ring|tone-\d+)$/.test(e))}(e)),e.classList.add("avatar",`avatar-${s}`),"circle"!==i&&e.classList.add(`avatar-${i}`),null!=r&&e.classList.add(`avatar-tone-${r}`),t.ring&&e.classList.add("avatar-ring"),e.textContent="",t.src){const n=document.createElement("img");n.className="avatar-img",n.alt="",n.decoding="async",n.addEventListener("error",()=>{n.parentNode===e&&(e.replaceChild(Gt(t,o),n),e.classList.add("avatar-img-failed"),Jt(e))},{once:!0}),n.src=String(t.src),e.appendChild(n)}else e.appendChild(Gt(t,o));e.classList.remove("avatar-img-failed");const a=Yt(Dt,t.status,null);if(a){const t=document.createElement("span");t.className=`avatar-status avatar-status-${a}`,t.setAttribute("aria-hidden","true"),e.appendChild(t)}const l=function(e){const t=String(e.alt??e.name??"").trim(),n=Yt(Dt,e.status,null);if(!n)return t;const s=e.statusLabels&&e.statusLabels[n]||Wt[n];return t?`${t} (${s})`:s}(t),c=/^(A|BUTTON)$/.test(e.tagName);e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-hidden"),t.decorative&&!c?e.setAttribute("aria-hidden","true"):l?(c||e.setAttribute("role","img"),e.setAttribute("aria-label",l)):c||e.setAttribute("aria-hidden","true");const h=!0===t.title?l:t.title;return h?e.setAttribute("title",String(h)):null!=n?e.setAttribute("title",n):e.removeAttribute("title"),Jt(e),{initials:o,tone:r,label:l,size:s,shape:i}}function Zt(e){const t=e.dataset||{},n={},s=e.classList,i=jt.find(e=>s.contains(`avatar-${e}`));i&&(n.size=i),s.contains("avatar-rounded")&&(n.shape="rounded"),s.contains("avatar-square")&&(n.shape="square"),s.contains("avatar-ring")&&(n.ring=!0);const o=Array.from(s).find(e=>/^avatar-tone-\d+$/.test(e));o&&(n.tone=Number(o.slice(12))),t.avatar&&(n.name=t.avatar);const r=["src","alt","size","shape","status","icon","title","tone"];for(const e of r){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["ring","decorative"]){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return n}const Qt=["role","aria-label","aria-hidden","title"];function en(e,t={}){let n;if(e&&"object"==typeof e&&!Rt(e)&&"number"!=typeof e.length&&"function"!=typeof e.get&&(t=e,e=null),null==e)n=document.createElement("span");else if(n=Vt(e),!n)return null;const s=Pt.get(n);s&&s.destroy();const i={children:document.createDocumentFragment(),classes:new Set(n.classList),attrs:Object.fromEntries(Qt.map(e=>[e,n.getAttribute(e)]))};for(;n.firstChild;)i.children.appendChild(n.firstChild);let o={...Ht,...Zt(n),...t},r=Xt(n,o,i.attrs.title);const a={element:n,get options(){return o},get initials(){return r.initials},get tone(){return r.tone},get label(){return r.label},update:(e={})=>(o={...o,...e},r=Xt(n,o,i.attrs.title),a),destroy(){if(Pt.get(n)!==a)return n;Pt.delete(n),L(n,a),n.textContent="",n.appendChild(i.children),n.className=[...i.classes].join(" "),n.className||n.removeAttribute("class");for(const[e,t]of Object.entries(i.attrs))null==t?n.removeAttribute(e):n.setAttribute(e,t);return n.hasAttribute("data-avatar")&&n.setAttribute("data-avatar-done",""),n}};return Object.defineProperty(a,"componentName",{value:"avatar"}),Pt.set(n,a),M(n,a),a}en.initials=Ut,en.tone=Kt,en.get=function(e){const t=Vt(e);return t&&x(t,"avatar")||null},en.scan=function(e=document){const t=Vt(e)||document;if("function"!=typeof t.querySelectorAll)return[];const n=Array.from(t.querySelectorAll("[data-avatar]"));return"function"==typeof t.matches&&t.matches("[data-avatar]")&&n.unshift(t),n.filter(e=>!Pt.has(e)&&!e.hasAttribute("data-avatar-done")).map(e=>en(e))};const tn={people:[],max:null,size:"md",shape:"circle",overlap:null,label:null,statusLabels:null,onMore:null,popover:!0,moreLabel:null};function nn(e){return null==e?null:"string"==typeof e?{name:e}:"object"==typeof e?e:null}function sn(e,t,n={}){const s=e.href&&(e.name||e.alt)?e.href:null,i=document.createElement(s?"a":"span");s&&i.setAttribute("href",String(s));return en(i,{name:e.name,src:e.src,alt:e.alt,status:e.status,icon:e.icon,tone:e.tone,title:e.title??!0,size:t.size,shape:t.shape,statusLabels:t.statusLabels,...n}).element}function on(e,t={}){const n=Vt(e);if(!n)return null;const s=Ft.get(n);s&&s.destroy();const i=/^(UL|OL)$/.test(n.tagName),o=document.createDocumentFragment(),r=new Set(n.classList),a=n.getAttribute("aria-label"),l=n.style.getPropertyValue("--dm-avatar-overlap");for(;n.firstChild;)o.appendChild(n.firstChild);const c=i?n:document.createElement("ul");i||n.appendChild(c);let h={...tn,...t};const d={people:[],shown:[],hidden:[],more:null,popover:null},u=()=>{d.popover&&d.popover.destroy(),d.popover=null,d.more=null},p=()=>{const e=document.activeElement,t=!!e&&(d.more&&d.more===e||d.popover&&d.popover.panel&&d.popover.panel.contains(e));u();const n=(Array.isArray(h.people)?h.people:[]).map(nn).filter(Boolean),s=Yt(jt,h.size,"md"),o=parseInt(h.max,10),r=Number.isFinite(o)&&o>=0&&o<n.length?o:n.length;d.people=n,d.shown=n.slice(0,r),d.hidden=n.slice(r),c.textContent="";for(const e of Array.from(c.classList))/^avatar-group-(xs|sm|md|lg|xl)$/.test(e)&&c.classList.remove(e);c.classList.add("avatar-group",`avatar-group-${s}`),h.label?c.setAttribute("aria-label",String(h.label)):i&&null!=a?c.setAttribute("aria-label",a):c.removeAttribute("aria-label");const l=null==(p=h.overlap)||""===p?null:"number"==typeof p&&Number.isFinite(p)?`${p}px`:Object.prototype.hasOwnProperty.call(Nt,p)?`calc(var(--dm-avatar-size, 2.5rem) * ${Nt[p]})`:String(p);var p;null!=l?c.style.setProperty("--dm-avatar-overlap",l):c.style.removeProperty("--dm-avatar-overlap");let m=d.shown.length+1;for(const e of d.shown){const t=document.createElement("li");t.className="avatar-group-item",t.style.setProperty("--dm-avatar-z",String(m--)),t.appendChild(sn(e,{...h,size:s})),c.appendChild(t)}if(d.hidden.length){const e=d.hidden.length,t=d.hidden.map(e=>e.name||e.alt||"").filter(Boolean),n=document.createElement("li");n.className="avatar-group-item",n.style.setProperty("--dm-avatar-z",String(m));const i=document.createElement("button");i.type="button",i.className=`avatar avatar-more avatar-${s}`,"rounded"!==h.shape&&"square"!==h.shape||i.classList.add(`avatar-${h.shape}`),i.textContent=`+${e}`;const o="function"==typeof h.moreLabel?h.moreLabel(e,t):`${e} more${t.length?`: ${function(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}(t)}`:""}`;i.setAttribute("aria-label",String(o)),n.appendChild(i),c.appendChild(n),d.more=i;const r=d.hidden;"function"==typeof h.onMore?i.addEventListener("click",e=>h.onMore(r.slice(),e)):!1!==h.popover?d.popover=new Bt(i,{title:`${e} more`,content:()=>function(e,t){const n=document.createElement("ul");n.className="avatar-more-list";for(const s of e){const e=document.createElement("li"),i=document.createElement(s.href?"a":"span");i.className="avatar-more-person",s.href&&i.setAttribute("href",String(s.href));const o=document.createElement("span");en(o,{name:s.name,alt:s.alt,src:s.src,icon:s.icon,tone:s.tone,size:"xs",shape:t.shape,decorative:!0});const r=document.createElement("span");r.className="avatar-more-name",r.textContent=s.name||s.alt||"",i.append(o,r),e.appendChild(i),n.appendChild(e)}return n}(r,h),placement:"bottom",className:"avatar-more-popover",maxWidth:"18rem"}):t.length&&(i.title=t.join(", "))}t&&(d.more?d.more.focus():(c.hasAttribute("tabindex")||c.setAttribute("tabindex","-1"),c.focus()))};p();const m={element:c,get options(){return h},get people(){return d.people},get shown(){return d.shown},get hidden(){return d.hidden},get more(){return d.more},get popover(){return d.popover},update:(e={})=>(h={...h,...e},p(),m),setPeople:e=>m.update({people:e}),destroy:()=>(Ft.get(n)!==m||(Ft.delete(n),L(n,m),c!==n&&L(c,m),u(),i?(c.textContent="",c.className=[...r].join(" "),c.className||c.removeAttribute("class"),null==a?c.removeAttribute("aria-label"):c.setAttribute("aria-label",a),l?c.style.setProperty("--dm-avatar-overlap",l):c.style.removeProperty("--dm-avatar-overlap")):n.textContent="",n.appendChild(o)),n)};return Object.defineProperty(m,"componentName",{value:"avatar-group"}),Ft.set(n,m),M(n,m),c!==n&&M(c,m),m}on.get=function(e){const t=Vt(e);return t&&x(t,"avatar-group")||null};class rn extends C{static componentName="card";static defaults={hoverable:!0,shadow:"medium",rounded:!0,animation:!0,animationDuration:200,collapsible:!1,collapsed:!1,persistKey:null,title:"",icon:"",content:"",safe:!0,clickable:!1,color:null,onCollapse:null,onExpand:null,onClick:null};constructor(e,t={}){super(Fe(e),t),this.element&&(void 0!==t.hover&&void 0===t.hoverable&&(this.options.hoverable=t.hover),this._added=[],this._made=[],this._apply(),this._bind(),Ve(this.options.collapsible)&&this._restoreState())}_addClass(...e){for(const t of e)this.element.classList.contains(t)||(this.element.classList.add(t),this._added.push(t))}_apply(){const e=this.element,t=this.options;this._addClass("card"),e.classList.toggle("card-hover",Ve(t.hoverable,!0)),e.classList.toggle("card-clickable",Ve(t.clickable)||"function"==typeof t.onClick);for(const t of["none","sm","lg"])e.classList.remove(`card-shadow-${t}`);const n={none:"none",small:"sm",sm:"sm",large:"lg",lg:"lg"}[t.shadow];if(n&&e.classList.add(`card-shadow-${n}`),e.classList.toggle("card-square",!1===t.rounded||"false"===t.rounded),this._colorClass&&e.classList.remove(this._colorClass),this._colorClass=t.color?`card-${t.color}`:null,this._colorClass&&!e.classList.contains(this._colorClass)?e.classList.add(this._colorClass):this._colorClass&&(this._colorClass=null),e.classList.toggle("card-no-animation",!1===t.animation||"false"===t.animation),e.style.setProperty("--dm-card-duration",`${qe(t.animationDuration,200)}ms`),t.title&&!this._header()){const n=document.createElement("div");n.className="card-header";const s=document.createElement("h4");if(s.className="card-title",t.icon){const e=document.createElement("span");e.setAttribute("data-icon",t.icon),e.className="card-title-icon",s.appendChild(e)}s.appendChild(document.createTextNode(String(t.title))),n.appendChild(s),e.insertBefore(n,e.firstChild),this._made.push(n),Ke(n)}t.content&&this.setContent(t.content,{safe:t.safe});const s=Ve(t.collapsible);e.classList.toggle("card-collapsible",s);const i=this._header();if(s&&i){if(!i.querySelector(":scope > .card-collapse-icon")){const e=document.createElement("span");e.className="card-collapse-icon",e.appendChild(function(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(const[e,n]of Object.entries({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))t.setAttribute(e,n);const n=document.createElementNS(e,"path");return n.setAttribute("d","M6 9l6 6 6-6"),t.appendChild(n),t}()),i.appendChild(e),this._made.push(e)}i.hasAttribute("tabindex")||(i.setAttribute("tabindex","0"),this._headerTabindex=!0),i.setAttribute("role","button"),i.setAttribute("aria-expanded",String(!this.isCollapsed()))}}_header(){return this.element.querySelector(":scope > .card-header")}_body(){return this.element.querySelector(":scope > .card-body")}_bind(){this._addEventListener(this.element,"click",e=>{const t=this._header();Ve(this.options.collapsible)&&t&&t.contains(e.target)&&!e.target.closest("a, button, input, select, textarea, [data-no-collapse]")?this.toggle():this._fire("click",this,e)}),this._addEventListener(this.element,"keydown",e=>{const t=this._header();Ve(this.options.collapsible)&&e.target===t&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle()))})}_storageKey(){return this.options.persistKey||(this.element.id?`domma-card-${this.element.id}`:null)}_restoreState(){const e=this._storageKey(),t=e?me.get(e):null;(t?.collapsed||!t?.collapsed&&Ve(this.options.collapsed))&&this._setCollapsed(!0,!1,!1)}_saveState(){const e=this._storageKey();e&&me.set(e,{collapsed:this.isCollapsed()})}_setCollapsed(e,t=!0,n=!0){const s=this.element,i=this._body(),o=s.classList.contains("card-no-animation")||!n?0:qe(this.options.animationDuration,200);clearTimeout(this._heightTimer),e?(i&&o&&(i.style.height=`${i.scrollHeight}px`,i.offsetHeight),s.classList.add("card-collapsed"),i&&(i.style.height=""),this._fire("collapse",this)):(s.classList.remove("card-collapsed"),i&&o&&(i.style.height="0px",i.offsetHeight,i.style.height=`${i.scrollHeight}px`,this._heightTimer=setTimeout(()=>{s.classList.contains("card-collapsed")||(i.style.height="")},o)),this._fire("expand",this)),this._header()?.setAttribute("aria-expanded",String(!e)),t&&this._saveState()}collapse(){return this.isCollapsed()||this._setCollapsed(!0),this}expand(){return this.isCollapsed()&&this._setCollapsed(!1),this}toggle(){return this._setCollapsed(!this.isCollapsed()),this}isCollapsed(){return this.element.classList.contains("card-collapsed")}setShadow(e){return this.options.shadow=e,this._apply(),this}setHoverable(e){return this.options.hoverable=e,this.element.classList.toggle("card-hover",Ve(e,!0)),this}setContent(e,t={}){const n=this.getBody();return Ue(n,e,{safe:t.safe??this.options.safe}),Ke(n),this}getBody(){let e=this._body();if(!e){e=document.createElement("div"),e.className="card-body";const t=this.element.querySelector(":scope > .card-footer");this.element.insertBefore(e,t),this._made.push(e)}return e}updateHeight(){const e=this._body();return e&&!this.isCollapsed()&&(e.style.height=""),this}_applyOptions(){this._apply(),Ve(this.options.collapsible)||this.element.classList.remove("card-collapsed")}destroy(){clearTimeout(this._heightTimer);const e=this.element;if(e){e.classList.remove(...this._added,"card-hover","card-clickable","card-collapsible","card-collapsed","card-square","card-no-animation","card-shadow-none","card-shadow-sm","card-shadow-lg"),e.style.removeProperty("--dm-card-duration"),this._colorClass&&e.classList.remove(this._colorClass);for(const e of this._made)(e.classList?.contains("card-collapse-icon")||e.classList?.contains("card-header"))&&e.remove();const t=this._header();t&&(this._headerTabindex&&t.removeAttribute("tabindex"),t.removeAttribute("role"),t.removeAttribute("aria-expanded"))}super.destroy()}}const an={small:"400px",sm:"400px",medium:"600px",md:"600px",large:"800px",lg:"800px",xl:"1140px",xlarge:"1140px",full:"96vw"},ln=[];let cn=!1;function hn(e){if("Escape"!==e.key||e.defaultPrevented)return;const t=ln[ln.length-1];t&&!1!==t.options.keyboard&&!1!==t.options.closeOnEscape&&t.close()}function dn(){cn&&!ln.length&&(document.removeEventListener("keydown",hn),cn=!1)}const un='[data-close], [data-dismiss="modal"], [data-dm-close], .modal-close, .btn-close';class pn extends C{static componentName="modal";static defaults={backdrop:!0,backdropClose:!0,keyboard:!0,closeOnEscape:!0,animation:"fade",animationDuration:300,closeButton:!0,size:"medium",centered:!0,scrollable:!1,title:"",content:"",footer:"",buttons:[],safe:!0,className:"",headerClass:"",bodyClass:"",footerClass:"",focus:!0,trapFocus:!0,returnFocus:!0,visible:!1,onOpen:null,onOpened:null,onClose:null,onClosed:null,onBeforeOpen:null,onBeforeClose:null,onButtonClick:null};constructor(e,t={}){const n=Fe(e),s=!n;let i=n;s&&(i=document.createElement("div"),i.className="dm-modal"),super(i,t),this._factoryMade=s,this._isOpen=!1,this._timers=[],this._restoreFocus=null,this._given=t||{},this._init()}_init(){const e=this.element,t=this.options;if(this._factoryMade||"size"in this._givenOptions()||(e.classList.contains("modal-sm")?t.size="small":e.classList.contains("modal-lg")?t.size="large":e.classList.contains("modal-xl")&&(t.size="xl"),e.dataset.size&&(t.size=e.dataset.size)),this._authored=!this._factoryMade&&!!e.querySelector(":scope > .modal-header, :scope > .modal-body, :scope > .modal-footer, :scope > .modal-content, :scope > .modal-dialog"),e.shadowRoot&&e.shadowRoot.querySelector(".modal-dialog"))this._host=e;else if(!e.shadowRoot&&function(e){return["ARTICLE","ASIDE","BLOCKQUOTE","BODY","DIV","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","MAIN","NAV","P","SECTION","SPAN"].includes(e.tagName)||e.tagName.includes("-")}(e))e.attachShadow({mode:"open"}),this._host=e;else if(e.shadowRoot)this._host=e;else{const t=document.createElement("div");for(t.className="dm-modal-inner";e.firstChild;)t.appendChild(e.firstChild);t.attachShadow({mode:"open"}),e.appendChild(t),this._host=t}this._addedClasses=["dm-modal-host"],this._host.classList.add("dm-modal-host"),this._host!==e&&e.classList.add("dm-modal-host"),this._authored&&(this._host.classList.add("dm-modal-authored"),this._addedClasses.push("dm-modal-authored")),this._addedAttrs=[];const n=(t,n)=>{e.hasAttribute(t)||(e.setAttribute(t,n),this._addedAttrs.push(t))};n("role","dialog"),n("aria-modal","true");const s=e.querySelector(".modal-title");s&&(s.id||(s.id=Ge("dm-modal-title")),n("aria-labelledby",s.id));for(const t of e.querySelectorAll(un))t.hasAttribute("aria-label")||t.setAttribute("aria-label","Close");this._factoryMade&&t.content&&Ue(e,t.content,{safe:t.safe}),this._render(),this._bind(),Ve(t.visible)&&this.open()}_wantsTrap(){const e=this.options;return!!Ve(e.trapFocus,!0)&&(Ve(e.backdrop,!0)||"trapFocus"in this._givenOptions())}_startTrap(){this._wantsTrap()&&"undefined"!=typeof document&&(this._trap||(this._trap=new ut(this.element,{initialFocus:!1,fallbackFocus:()=>this._dialog,returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1})),this._trap.activate())}_givenOptions(){return this._given||{}}_render(){const e=this.options,t=this._host.shadowRoot;t.replaceChildren();const n=document.createElement("style");n.textContent='\n:host {\n display: none;\n position: fixed;\n inset: 0;\n z-index: 1050;\n align-items: center;\n justify-content: center;\n pointer-events: auto;\n --dm-modal-duration: 300ms;\n}\n:host(.dm-modal-visible) { display: flex; }\n:host(.dm-modal-no-backdrop) { pointer-events: none; }\n:host(.dm-modal-top) { align-items: flex-start; padding-top: 5vh; }\n* { box-sizing: border-box; }\n.modal-backdrop {\n position: fixed;\n inset: 0;\n background: var(--dm-modal-backdrop, rgba(0, 0, 0, 0.5));\n opacity: 0;\n transition: opacity var(--dm-modal-duration) ease;\n}\n:host(.dm-modal-shown) .modal-backdrop { opacity: 1; }\n.modal-dialog {\n position: relative;\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n max-width: min(var(--dm-modal-width, 600px), 90%);\n max-height: 90vh;\n background: var(--dm-surface, #fff);\n color: var(--dm-text, #212529);\n border: 1px solid var(--dm-border, transparent);\n border-radius: var(--dm-radius-lg, 8px);\n box-shadow: var(--dm-shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.3));\n overflow: hidden;\n outline: none;\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n transition: opacity var(--dm-modal-duration) ease, transform var(--dm-modal-duration) ease;\n}\n:host([data-animation="zoom"]) .modal-dialog { transform: scale(0.7); }\n:host([data-animation="slide"]) .modal-dialog { transform: translateY(-50px); }\n:host(.dm-modal-shown) .modal-dialog { opacity: 1; transform: none; }\n:host([data-animation="none"]) .modal-dialog,\n:host([data-animation="none"]) .modal-backdrop { transition: none; }\n.modal-content { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }\n.modal-header {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--dm-border, #e5e7eb);\n}\n.modal-header[hidden], .modal-footer[hidden] { display: none; }\n.modal-title { margin: 0; flex: 1; font-size: 1.25rem; font-weight: 600; color: inherit; }\n.modal-close {\n margin-left: auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: none;\n background: none;\n font-size: 1.5rem;\n line-height: 1;\n cursor: pointer;\n color: var(--dm-text-muted, #6b7280);\n border-radius: var(--dm-radius-sm, 4px);\n}\n.modal-close:hover { color: var(--dm-text, #212529); }\n.modal-close:focus-visible, .modal-footer button:focus-visible {\n outline: 2px solid var(--dm-border-focus, var(--dm-primary, #6495ED));\n outline-offset: 2px;\n}\n.modal-body { padding: 1.5rem; overflow: auto; min-height: 0; flex: 1 1 auto; }\n:host(.dm-modal-authored) .modal-body { padding: 0; }\n.modal-body-scrollable { max-height: 60vh; overflow-y: auto; }\n.modal-footer {\n display: flex;\n justify-content: flex-end;\n flex-wrap: wrap;\n gap: 0.5rem;\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n /* --dm-background-alt: every theme sets it (--dm-surface-secondary is light outside .dm-theme-dark) */\n background: var(--dm-background-alt, var(--dm-surface, #f9fafb));\n}\n.modal-footer button {\n padding: 0.5rem 1rem;\n border: 1px solid transparent;\n border-radius: var(--dm-radius-md, 4px);\n font: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n background: var(--dm-secondary, #6c757d);\n color: var(--dm-secondary-text, #fff);\n transition: filter 0.15s ease;\n}\n.modal-footer button:hover { filter: brightness(0.92); }\n.modal-footer .btn-primary { background: var(--dm-primary, #6495ED); color: var(--dm-primary-text, #fff); }\n.modal-footer .btn-success { background: var(--dm-success, #28a745); color: var(--dm-success-text, #fff); }\n.modal-footer .btn-danger { background: var(--dm-danger, #dc3545); color: var(--dm-danger-text, #fff); }\n.modal-footer .btn-warning { background: var(--dm-warning, #ffc107); color: var(--dm-warning-text, #212529); }\n.modal-footer .btn-info { background: var(--dm-info, #17a2b8); color: var(--dm-info-text, #fff); }\n.modal-footer .btn-outline, .modal-footer .btn-ghost, .modal-footer .btn-link {\n background: transparent;\n color: var(--dm-text, #212529);\n border-color: var(--dm-border, #dee2e6);\n}\n',t.appendChild(n);const s=!1===e.animation||"none"===e.animation||"false"===e.animation?"none":String(e.animation||"fade");this._host.dataset.animation=s,this._host.style.setProperty("--dm-modal-duration",`${"none"===s?0:qe(e.animationDuration,300)}ms`);const i=an[e.size]||(e.size?String(e.size):an.medium);this._host.style.setProperty("--dm-modal-width",i),this._host.classList.toggle("dm-modal-no-backdrop",!Ve(e.backdrop,!0)),this._host.classList.toggle("dm-modal-top",!1===e.centered||"false"===e.centered),this._backdrop=null,Ve(e.backdrop,!0)&&(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",this._backdrop.setAttribute("part","backdrop"),t.appendChild(this._backdrop));const o=document.createElement("div");o.className="modal-dialog"+(e.className?" "+e.className:""),o.setAttribute("part","dialog"),o.tabIndex=-1,this._dialog=o;const r=document.createElement("div");r.className="modal-content",r.setAttribute("part","content");const a=document.createElement("div");if(a.className="modal-header"+(e.headerClass?" "+e.headerClass:""),a.setAttribute("part","header"),this._titleEl=document.createElement("h3"),this._titleEl.className="modal-title",this._titleEl.setAttribute("part","title"),this._titleEl.id=Ge("dm-modal-shadow-title"),e.title?this._titleEl.textContent=String(e.title):this._titleEl.hidden=!0,a.appendChild(this._titleEl),Ve(e.closeButton,!0)&&!this._authored){const e=document.createElement("button");e.type="button",e.className="modal-close",e.setAttribute("part","close"),e.setAttribute("aria-label","Close"),e.innerHTML="×",e.addEventListener("click",()=>this.close()),a.appendChild(e)}a.hidden=!e.title&&(this._authored||!Ve(e.closeButton,!0)),this._header=a,r.appendChild(a),!e.title||this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("aria-label")||(this.element.setAttribute("aria-label",String(e.title)),this._addedAttrs.push("aria-label"));const l=document.createElement("div");l.className=`modal-body${e.bodyClass?" "+e.bodyClass:""}${Ve(e.scrollable)?" modal-body-scrollable":""}`,l.setAttribute("part","body"),l.appendChild(document.createElement("slot")),this._body=l,r.appendChild(l);const c=document.createElement("div");c.className="modal-footer"+(e.footerClass?" "+e.footerClass:""),c.setAttribute("part","footer");const h=document.createElement("slot");h.name="footer",c.appendChild(h),this._footer=c,this._footerText=null,e.footer&&(this._footerText=document.createElement("span"),this._footerText.textContent=String(e.footer),c.appendChild(this._footerText)),r.appendChild(c),this._renderButtons(),o.appendChild(r),t.appendChild(o)}_renderButtons(){const e=this._footer;for(const t of e.querySelectorAll("button[data-button-id]"))t.remove();const t=Array.isArray(this.options.buttons)?this.options.buttons:[];t.forEach((t,n)=>{const s=t.id||`btn-${n}`,i=document.createElement("button");i.type="button",i.className=`btn btn-${t.variant||"secondary"}${t.className?" "+t.className:""}`,i.textContent=t.text||"Button",i.dataset.buttonId=s,i.addEventListener("click",e=>{this._fire("buttonClick",s,this),"function"==typeof t.onClick&&t.onClick(this,e),!1!==t.close&&this.close()}),e.appendChild(i)});const n=this.element.querySelector(':scope > [slot="footer"]');e.hidden=!t.length&&!this._footerText&&!n}_bind(){const e=this._host;this._addEventListener(e.shadowRoot,"pointerdown",e=>{this._downOnBackdrop=e.composedPath()[0]===this._backdrop}),this._addEventListener(e.shadowRoot,"click",e=>{const t=e.composedPath()[0]===this._backdrop,n=!1!==this._downOnBackdrop;this._downOnBackdrop=void 0,t&&n&&this._isOpen&&Ve(this.options.backdropClose,!0)&&this.close()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest?.(un);t&&this.element.contains(t)&&this._ownsNode(t)&&(e.preventDefault(),this.close())})}_ownsNode(e){const t=e.closest(".dm-modal-host");return!t||t===this.element||t===this._host}_later(e,t){const n=setTimeout(()=>{this._timers=this._timers.filter(e=>e!==n),e()},t);this._timers.push(n)}_clearTimers(){this._timers.forEach(clearTimeout),this._timers=[]}_duration(){return"none"===this._host.dataset.animation?0:qe(this.options.animationDuration,300)}open(){if(this._isOpen)return this;if(!1===this._fire("beforeOpen",this))return this;this._clearTimers(),this._isOpen=!0;const e=this._host;this._factoryMade&&!this.element.isConnected&&_n().appendChild(this.element),"none"===this.element.style.display&&this.element.style.removeProperty("display"),this.element.hidden=!1,e.classList.add("dm-modal-visible"),e!==this.element&&this.element.classList.add("dm-modal-visible"),ln.push(this),cn||"undefined"==typeof document||(document.addEventListener("keydown",hn),cn=!0),Ve(this.options.focus,!0)&&"undefined"!=typeof document&&(this._restoreFocus=document.activeElement),this._startTrap();const t=()=>{if(this._isOpen&&(e.classList.add("dm-modal-shown"),Ve(this.options.focus,!0)&&!this.element.contains(document.activeElement)))try{this._dialog.focus({preventScroll:!0})}catch{}};return this._duration()&&"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(t)):t(),this._fire("open",this),this._later(()=>this._fire("opened",this),this._duration()),this}close(){if(!this._isOpen)return this;if(!this._mayClose(this))return this;this._clearTimers(),this._isOpen=!1;const e=this._host;e.classList.remove("dm-modal-shown");const t=ln.indexOf(this);if(t>-1&&ln.splice(t,1),dn(),this._trap&&this._trap.isActive()){const e=Ve(this.options.focus,!0)&&Ve(this.options.returnFocus,!0);this._trap.deactivate({returnFocus:e}),this._restoreFocus=null}this._fire("close",this);const n=()=>{e.classList.remove("dm-modal-visible"),this.element.classList.remove("dm-modal-visible");const t=Ve(this.options.returnFocus,!0)?this._restoreFocus:null;if(this._restoreFocus=null,t&&"function"==typeof t.focus&&t.isConnected)try{t.focus({preventScroll:!0})}catch{}this._fire("closed",this)},s=this._duration();return s?this._later(n,s):n(),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}setTitle(e){return this.options.title=e,this._titleEl.textContent=null==e?"":String(e),this._titleEl.hidden=!e,this._header.hidden=!e&&(this._authored||!Ve(this.options.closeButton,!0)),this}setContent(e,t={}){const n=Array.from(this.element.querySelectorAll(":scope > [slot]")),s=this._host===this.element?this.element:this._host;return Ue(s,e,{safe:t.safe??this.options.safe}),n.forEach(e=>s.appendChild(e)),this}setButtons(e){return this.options.buttons=e||[],this._renderButtons(),this}_applyOptions(){const e=this._isOpen;this._render(),e&&this._host.classList.add("dm-modal-visible","dm-modal-shown")}destroy(){if(this._destroyed)return;this._destroyed=!0;const e=this._isOpen;e&&this._forcedClose();const t=ln.indexOf(this);t>-1&&ln.splice(t,1),dn(),this._trap&&(this._trap.destroy(),this._trap=null),super.destroy();const n=this.element;if(this._factoryMade){const t=()=>n.remove();return void(e&&this._duration()?setTimeout(t,this._duration()):t())}this._clearTimers();this._host.shadowRoot.replaceChildren(document.createElement("slot")),this._host.classList.remove(...this._addedClasses,"dm-modal-visible","dm-modal-shown","dm-modal-no-backdrop","dm-modal-top"),n.classList.remove("dm-modal-host","dm-modal-visible"),delete this._host.dataset.animation,this._host.style.removeProperty("--dm-modal-duration"),this._host.style.removeProperty("--dm-modal-width");for(const e of this._addedAttrs)n.removeAttribute(e)}remove(...e){return this.destroy(...e)}}const mn={size:"large",buttons:[{id:"close",text:"Close",variant:"secondary"}]};let fn=null;function _n(){return fn&&fn.isConnected||(fn=document.createElement("div"),fn.className="dm-dialog-container",fn.style.cssText="position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1040;",document.body.appendChild(fn)),fn}function gn(e={}){const t=_n(),n=new vn(null,{...mn,...e});return n.element.style.zIndex=String(1050+10*ln.length),t.appendChild(n.element),n}class vn extends pn{get _factoryCreated(){return!0}}const bn={top:"bottom",bottom:"top",left:"right",right:"left"},yn=new Set;let kn=null;function wn(e){yn.delete(e),!yn.size&&kn&&(kn.disconnect(),kn=null)}class xn extends C{static componentName="tooltip";static defaults={content:"",position:"top",trigger:"hover",delay:0,hideDelay:0,animation:!0,offset:8,html:!1,safe:!0,visible:!1,className:"",maxWidth:null,onShow:null,onHide:null};constructor(e,t={}){super(e,xn.normalise(t)),this.element&&(this._visible=!1,this._bubble=null,this._timers={},this._takeTitle(),this._bindTrigger(),Ve(this.options.visible)&&this.show())}static normalise(e={}){const t={...e};return t.placement&&!t.position&&(t.position=t.placement),t.delay&&"object"==typeof t.delay&&(void 0!==t.delay.hide&&void 0===t.hideDelay&&(t.hideDelay=t.delay.hide),t.delay=t.delay.show??0),t}_takeTitle(){const e=this.element,t=this.options.content;null!=t&&""!==t||e.dataset.tooltip||!e.hasAttribute("title")||(this._title=e.getAttribute("title"),e.removeAttribute("title"))}_content(){const e=this.options.content;return null!=e&&""!==e?"function"==typeof e?e(this.element):e:this.element.dataset.tooltip||this._title||""}_bindTrigger(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[];const e=this.element,t=String(this.options.trigger||"hover").split(/\s+/);if(t.includes("hover")&&(this._addEventListener(e,"mouseenter",()=>this.show()),this._addEventListener(e,"mouseleave",()=>this.hide())),t.includes("focus")||t.includes("hover")){const n=!t.includes("focus");this._addEventListener(e,"focusin",e=>{let t=!0;try{t=e.target.matches(":focus-visible")}catch{}n&&!t||this.show()}),this._addEventListener(e,"focusout",()=>this.hide())}t.includes("click")&&this._addEventListener(e,"click",()=>this.toggle()),this._addEventListener(e,"keydown",e=>{"Escape"===e.key&&this._visible&&this.hide({immediate:!0})})}_clear(e){clearTimeout(this._timers[e]),this._timers[e]=null}_make(){const e=this.options,t=document.createElement("div");t.className="domma-tooltip"+(e.className?" "+e.className:""),t.id=Ge("dm-tooltip"),t.setAttribute("role","tooltip"),e.maxWidth&&(t.style.maxWidth="number"==typeof e.maxWidth?`${e.maxWidth}px`:String(e.maxWidth)),Ve(e.animation,!0)||(t.style.transition="none"),this._bubble=t,this._write(),document.body.appendChild(t);const n=(this.element.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);n.includes(t.id)||this.element.setAttribute("aria-describedby",[...n,t.id].join(" "))}_write(){if(!this._bubble)return;const e=this._content();Ue(this._bubble,e,{text:!Ve(this.options.html),safe:this.options.safe})}_unmake(){const e=this._bubble;if(!e)return;this._bubble=null,e.remove();const t=(this.element.getAttribute("aria-describedby")||"").split(/\s+/).filter(t=>t&&t!==e.id);t.length?this.element.setAttribute("aria-describedby",t.join(" ")):this.element.removeAttribute("aria-describedby")}_place(){const e=this._bubble;if(!e)return;const t=this.element.getBoundingClientRect(),n=e.getBoundingClientRect(),s=qe(this.options.offset,8),i=window.innerWidth,o=window.innerHeight,r=e=>{switch(e){case"bottom":return{top:t.bottom+s,left:t.left+(t.width-n.width)/2};case"left":return{top:t.top+(t.height-n.height)/2,left:t.left-n.width-s};case"right":return{top:t.top+(t.height-n.height)/2,left:t.right+s};default:return{top:t.top-n.height-s,left:t.left+(t.width-n.width)/2}}},a=e=>e.top>=0&&e.left>=0&&e.top+n.height<=o&&e.left+n.width<=i;let l=bn[this.options.position]?this.options.position:"top",c=r(l);!a(c)&&a(r(bn[l]))&&(l=bn[l],c=r(l)),c.left=Math.min(Math.max(8,c.left),Math.max(8,i-n.width-8)),c.top=Math.min(Math.max(8,c.top),Math.max(8,o-n.height-8)),e.style.top=`${Math.round(c.top)}px`,e.style.left=`${Math.round(c.left)}px`,e.dataset.position=l}_onScroll=()=>{this._visible&&(this.element.isConnected?this._place():this.close({immediate:!0}))};open(){if(this._clear("hide"),this._visible||this._timers.show)return this;const e=()=>{var e;(this._timers.show=null,this.element.isConnected)&&(this._bubble||this._make(),this._visible=!0,this._place(),this._bubble.offsetHeight,this._bubble.classList.add("show"),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),window.addEventListener("resize",this._onScroll,{passive:!0}),e=this,yn.add(e),!kn&&"undefined"!=typeof MutationObserver&&document.body&&(kn=new MutationObserver(()=>{for(const e of[...yn])e.element&&e.element.isConnected||e.close({immediate:!0})}),kn.observe(document.body,{childList:!0,subtree:!0})),this._fire("show",this))},t=qe(this.options.delay,0);return t>0?this._timers.show=setTimeout(e,t):e(),this}close(e={}){if(this._clear("show"),!this._visible||this._timers.hide)return this;const t=()=>{this._timers.hide=null,this._visible=!1,wn(this),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.removeEventListener("resize",this._onScroll);const t=this._bubble;t&&t.classList.remove("show");const n=Ve(this.options.animation,!0)&&!e.immediate?150:0;n?this._timers.fade=setTimeout(()=>{this._visible||this._unmake()},n):this._unmake(),this._fire("hide",this)},n=e.immediate?0:qe(this.options.hideDelay,0);return n>0?this._timers.hide=setTimeout(t,n):t(),this}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}toggle(){return this._visible?this.close():this.open()}isVisible(){return this._visible}isOpen(){return this._visible}setContent(e){return this.options.content=e,this._write(),this._visible&&this._place(),this}setPosition(e){return this.options.position=e,this._visible&&this._place(),this}setOptions(e={}){return super.setOptions(xn.normalise(e))}_applyOptions(){this._bindTrigger(),this._write(),this._visible&&this._place()}destroy(){Object.values(this._timers||{}).forEach(clearTimeout),this._bubble&&(window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.removeEventListener("resize",this._onScroll)),this._unmake(),this._visible=!1,wn(this),void 0!==this._title&&this.element&&!this.element.hasAttribute("title")&&this.element.setAttribute("title",this._title),super.destroy()}}const Mn=["primary","secondary","success","danger","warning","info","light","dark"],Ln={small:"badge-sm",sm:"badge-sm",large:"badge-lg",lg:"badge-lg"};class Cn extends C{static componentName="badge";static defaults={variant:"primary",size:"medium",pill:!1,outline:!1,removable:!1,pulse:!1,onClick:null,onRemove:null};constructor(e,t={}){super(Fe(e),t),this.element&&(this._had=new Set(this.element.classList),this._apply(),this._addEventListener(this.element,"click",e=>{this._removeBtn&&this._removeBtn.contains(e.target)||this._fire("click",e,this)}))}_apply(){const e=this.element,t=this.options,n=e=>this._had.has(e);for(const t of Mn)n(`badge-${t}`)||e.classList.remove(`badge-${t}`);for(const t of["badge-sm","badge-lg","badge-pill","badge-rounded","badge-outline","badge-pulse"])n(t)||e.classList.remove(t);const s=Mn.includes(t.variant)?t.variant:"primary";for(const t of Mn)e.classList.remove(`badge-outline-${t}`);if(Ve(t.outline)?e.classList.add("badge","badge-outline",`badge-outline-${s}`):e.classList.add("badge",`badge-${s}`),Ln[t.size]&&e.classList.add(Ln[t.size]),e.classList.add(Ve(t.pill)?"badge-pill":"badge-rounded"),Ve(t.pulse)&&e.classList.add("badge-pulse"),Ve(t.removable)&&!this._removeBtn){const t=document.createElement("button");t.type="button",t.className="domma-badge-remove",t.setAttribute("aria-label","Remove"),t.textContent="×",t.addEventListener("click",e=>{e.stopPropagation(),!1!==this._fire("remove",this,e)&&(this.element.remove(),this.destroy())}),e.appendChild(t),this._removeBtn=t}else!Ve(t.removable)&&this._removeBtn&&(this._removeBtn.remove(),this._removeBtn=null)}_applyOptions(){this._apply()}setVariant(e){return this.options.variant=e,this._apply(),this}setSize(e){return this.options.size=e,this._apply(),this}setText(e){for(const e of Array.from(this.element.childNodes))e!==this._removeBtn&&e.remove();return this.element.insertBefore(document.createTextNode(null==e?"":String(e)),this._removeBtn||null),this}destroy(){const e=this.element;if(e){for(const t of["badge",...Mn.map(e=>`badge-${e}`),...Mn.map(e=>`badge-outline-${e}`),"badge-sm","badge-lg","badge-pill","badge-rounded","badge-outline","badge-pulse"])this._had?.has(t)||e.classList.remove(t);this._removeBtn?.remove(),this._removeBtn=null}super.destroy()}remove(...e){return this.destroy(...e)}}const An=new Set(["IMG","INPUT","BR","HR","AREA","BASE","COL","EMBED","LINK","META","SOURCE","TRACK","WBR","TEXTAREA","SELECT"]);class En extends C{static componentName="number-badge";static defaults={count:0,max:null,variant:"danger",dot:!1,pulse:!1,borderColor:null,label:null,onChange:null};constructor(e,t={}){if(super(Fe(e),t),!this.element)return;const n=this.element;this._holder=An.has(n.tagName)&&n.parentElement?n.parentElement:n,this._hostClassAdded=!this._holder.classList.contains("badge-counter-host"),this._holder.classList.add("badge-counter-host"),this.counter=document.createElement("span"),this.counter.className="badge-counter",this.counter.setAttribute("role","status"),this.counter.setAttribute("aria-live","polite"),this._holder.appendChild(this.counter),this._paint()}_paint(){const e=this.options,t=this.counter,n=Math.max(0,Math.trunc(qe(e.count,0)));e.count=n,t.className=`badge-counter badge-counter-${Mn.includes(e.variant)?e.variant:"danger"}`,Ve(e.dot)&&t.classList.add("badge-dot"),Ve(e.pulse)&&t.classList.add("badge-pulse"),Ve(e.dot)||0!==n||t.classList.add("badge-counter-hidden"),t.style.borderColor=e.borderColor||"";const s=null==e.max?null:qe(e.max,null);t.textContent=Ve(e.dot)?"":null!==s&&n>s?`${s}+`:String(n),t.setAttribute("aria-label",e.label||(Ve(e.dot)?"New":String(n)))}_applyOptions(){this._paint()}setCount(e){const t=this.options.count;return this.options.count=e,this._paint(),this.options.count!==t&&this._fire("change",this.options.count,t,this),this}increment(e=1){return this.setCount(this.getCount()+qe(e,1))}decrement(e=1){return this.setCount(Math.max(0,this.getCount()-qe(e,1)))}getCount(){return qe(this.options.count,0)}setDot(e){return this.options.dot=e,this._paint(),this}setVariant(e){return this.options.variant=e,this._paint(),this}setPulse(e){return this.options.pulse=e,this._paint(),this}destroy(){this.counter?.remove(),this._holder&&this._hostClassAdded&&this._holder.classList.remove("badge-counter-host"),super.destroy()}remove(...e){return this.destroy(...e)}}const Sn={small:24,sm:24,medium:40,md:40,large:64,lg:64},$n=["primary","secondary","success","danger","warning","info"],zn={spinner:0,dots:3,pulse:0,bars:4};class Tn extends C{static componentName="loader";static defaults={type:"spinner",size:"medium",color:"primary",overlay:!1,text:"",centered:!0,visible:!0,fullscreen:!1,label:"Loading",onShow:null,onHide:null};constructor(e,t={}){super(Fe(e),t),this.element&&(this.indicator=document.createElement("div"),this.indicator.setAttribute("role","status"),this.indicator.setAttribute("aria-live","polite"),this._visible=!1,this._render(),this.element.appendChild(this.indicator),Ve(this.options.visible,!0)?this.show():this._setShown(!1))}_render(){const e=this.options,t=this.indicator,n=void 0!==zn[e.type]?e.type:"spinner",s=Ve(e.overlay);var i,o;t.className=`dm-loader dm-loader-js${s?" dm-loader-overlay":""}${Ve(e.centered,!0)&&!s?" dm-loader-centered":""}`,t.style.setProperty("--dm-loader-size",`${i=e.size,"number"==typeof i?i:null==i||""===i||isNaN(i)?Sn[i]||Sn.medium:parseInt(i,10)}px`),t.style.setProperty("--dm-loader-color",(o=e.color)?$n.includes(o)?`var(--dm-${o})`:"white"===o?"#fff":"dark"===o?"var(--dm-text)":String(o):"var(--dm-primary)"),t.setAttribute("aria-label",e.text?String(e.text):String(e.label||"Loading")),this.element.classList.toggle("dm-loader-host",s);const r=document.createElement("div");r.className=`dm-loader-anim dm-loader-anim-${n}`,r.setAttribute("aria-hidden","true");for(let e=0;e<zn[n];e++)r.appendChild(document.createElement("span"));t.replaceChildren(r),this._textEl=null,e.text&&(this._textEl=document.createElement("span"),this._textEl.className="dm-loader-text",this._textEl.textContent=String(e.text),t.appendChild(this._textEl))}_setShown(e){this.indicator.hidden=!e,Ve(this.options.fullscreen)&&(this.element.style.display=e?"flex":"none")}show(){const e=this._visible;return this._visible=!0,this._setShown(!0),!this.indicator.isConnected&&this.element&&this.element.appendChild(this.indicator),e||this._fire("show",this),this}hide(){const e=this._visible;return this._visible=!1,this._setShown(!1),e&&this._fire("hide",this),this}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}isOpen(){return this._visible}setText(e){return this.options.text=e,this._render(),this}setType(e){return this.options.type=e,this._render(),this}setSize(e){return this.options.size=e,this._render(),this}setColor(e){return this.options.color=e,this._render(),this}_applyOptions(){this._render(),this._setShown(this._visible)}destroy(){this.indicator?.remove(),this.element?.classList.remove("dm-loader-host"),Ve(this.options.fullscreen)&&this.element&&(this.element.style.display="none"),super.destroy()}}class Bn extends C{static componentName="back-to-top";static defaults={showAfter:null,duration:300,position:"bottom-right",offset:null,target:null,zIndex:null,label:"Scroll back to top",onShow:null,onHide:null,onScroll:null};constructor(e,t={}){let n=Fe(e);let s=!1;n&&("BUTTON"===n.tagName||"A"===n.tagName||n.tagName.includes("-")||n.classList.contains("dm-back-to-top"))||(n=document.createElement("button"),n.type="button",s=!0),super(n,t),this._made=s,this._visible=!1,this._scrolling=!1,n.tagName.includes("-")?(this.button=n.querySelector(":scope > button.dm-back-to-top")||document.createElement("button"),this.button.type="button",this.button.isConnected||n.appendChild(this.button)):this.button=n,this.button.classList.add("dm-back-to-top"),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",String(this.options.label)),this.button.hasAttribute("title")||this.button.setAttribute("title","Back to top"),this.button.querySelector("svg")||this.button.textContent.trim()||this.button.appendChild(function(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(const[e,n]of Object.entries({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))t.setAttribute(e,n);const n=document.createElementNS(e,"path");return n.setAttribute("d","M18 15l-6-6-6 6"),t.appendChild(n),t}()),s&&document.body.appendChild(n),this._place(),this._addEventListener(this.button,"click",e=>{e.preventDefault(),this.scroll()}),this._watch()}_place(){const e=this.options,t=this.button,n=t.style,s=this._container(),i=!(!s||!s.contains(t));t.classList.toggle("dm-back-to-top-contained",i);const o="bottom-left"===e.position||e.offset&&"object"==typeof e.offset&&void 0!==e.offset.left;t.classList.toggle("dm-back-to-top-left",o);const r=e.offset,a=e=>null==e||""===e?"":`${qe(e,16)}px`;let l="",c="";r&&"object"==typeof r?(l=a(r.bottom),c=a(o?r.left:r.right)):(l=a(r),c=a(r)),n.bottom=l,i?(n.left="",n.right="",n.marginLeft=o?c:"",n.marginRight=o?"":c):(n.left=o?c||"1.5rem":"auto",n.right=o?"auto":c,o||c||(n.right=""),o||(n.left="")),n.zIndex=null===e.zIndex||void 0===e.zIndex?"":String(e.zIndex)}_container(){const e=this.options.target;return e?"string"==typeof e?document.querySelector(e):e:null}_watch(){this._scrollTarget&&this._scrollTarget.removeEventListener("scroll",this._onScroll),this._box=this._container(),this._scrollTarget=this._box||window,this._onScroll=()=>this._check(),this._scrollTarget.addEventListener("scroll",this._onScroll,{passive:!0}),this._check()}_check(){const e=this._box,t=this.options.showAfter??(e?e.clientHeight:window.innerHeight);(e?e.scrollTop:window.scrollY)>qe(t,0)?this.show():this.hide()}scroll(e){if(this._scrolling)return this;const t=this._box,n=t?t.scrollTop:window.scrollY,s=Xe()?0:qe(e??this.options.duration,300),i=e=>{t?t.scrollTop=e:window.scrollTo(0,e)};if(this._fire("scroll",this),!s||"function"!=typeof requestAnimationFrame)return i(0),this;this._scrolling=!0;const o=performance.now(),r=e=>{const t=Math.min((e-o)/s,1);i(n*(1-t*(2-t))),t<1?requestAnimationFrame(r):this._scrolling=!1};return requestAnimationFrame(r),this}show(){return this._visible||(this._visible=!0,this.button.classList.add("show"),this._fire("show",this)),this}hide(){return this._visible?(this._visible=!1,this.button.classList.remove("show"),this._fire("hide",this),this):this}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}isOpen(){return this._visible}getButton(){return this.button}setShowAfter(e){return this.options.showAfter=null===e||""===e?null:qe(e,null),this._check(),this}setPosition(e){return this.options.position=e,this._place(),this}setOffset(e){return this.options.offset=e,this._place(),this}_applyOptions(){this._place(),this._watch()}destroy(){this._scrollTarget&&this._scrollTarget.removeEventListener("scroll",this._onScroll),this._made?this.element.remove():this.button.classList.remove("dm-back-to-top","show","dm-back-to-top-contained","dm-back-to-top-left"),super.destroy()}}const jn={success:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",error:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",warning:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",info:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"};function On(e){const t=jn[e];if(!t||"undefined"==typeof document)return null;const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg");s.setAttribute("width","20"),s.setAttribute("height","20"),s.setAttribute("viewBox","0 0 20 20"),s.setAttribute("fill","currentColor"),s.setAttribute("aria-hidden","true");const i=document.createElementNS(n,"path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d",t),s.appendChild(i),s}const Dn={};let Nn=[];class In extends C{static componentName="toast";static defaults={message:"",title:"",type:"default",position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,html:!1,safe:!0,icon:"",actions:[],maxToasts:5,className:"",onShow:null,onClose:null,onPause:null,onResume:null,onAction:null};constructor(e,t={}){super(document.createElement("div"),t),void 0!==e&&(this.options.message=e),this.options.action&&!(this.options.actions||[]).length&&(this.options.actions=[this.options.action]),this._visible=!1,this._timer=null,this._remaining=0,this._started=0,this._paused=!1,this._render(),this._bind()}_render(){const e=this.options,t=this.element,n=e.type||"default";t.className=`domma-toast domma-toast-${n}${e.className?" "+e.className:""}`;const s="error"===n;t.setAttribute("role",s?"alert":"status"),t.setAttribute("aria-live",s?"assertive":"polite"),t.setAttribute("aria-atomic","true"),t.replaceChildren();const i=e.icon;if(i){const n=document.createElement("div");if(n.className="domma-toast-icon","undefined"!=typeof Node&&i instanceof Node)n.appendChild(i);else if("string"!=typeof i||i.includes("<"))Ue(n,i,{safe:e.safe});else{const e=document.createElement("span");e.setAttribute("data-icon",i),n.appendChild(e)}t.appendChild(n),Ke(n)}const o=document.createElement("div");if(o.className="domma-toast-content",this._titleEl=document.createElement("div"),this._titleEl.className="domma-toast-title",this._titleEl.textContent=e.title?String(e.title):"",this._titleEl.hidden=!e.title,o.appendChild(this._titleEl),this._messageEl=document.createElement("div"),this._messageEl.className="domma-toast-message",this._writeMessage(),o.appendChild(this._messageEl),this._actionsEl=document.createElement("div"),this._actionsEl.className="domma-toast-actions",o.appendChild(this._actionsEl),this._renderActions(),t.appendChild(o),Ve(e.closable,!0)){const e=document.createElement("button");e.type="button",e.className="domma-toast-close",e.setAttribute("aria-label","Close"),e.innerHTML="×",e.addEventListener("click",()=>this.close()),t.appendChild(e)}if(this._bar=null,Ve(e.showProgress,!0)&&qe(e.duration,3e3)>0){const e=document.createElement("div");e.className="domma-toast-progress",this._bar=document.createElement("div"),this._bar.className="domma-toast-progress-bar",e.appendChild(this._bar),t.appendChild(e)}t.style.setProperty("--dm-toast-duration",`${qe(e.animationDuration,300)}ms`)}_writeMessage(){const e=this.options,t=e.message;"undefined"!=typeof Node&&t instanceof Node?Ue(this._messageEl,t):Ue(this._messageEl,null==t?"":String(t),{text:!Ve(e.html),safe:e.safe})}_renderActions(){const e=Array.isArray(this.options.actions)?this.options.actions:[];this._actionsEl.replaceChildren(),this._actionsEl.hidden=!e.length,e.forEach((e,t)=>{const n=document.createElement("button");n.type="button",n.className="domma-toast-action"+(e.primary?" is-primary":""),n.textContent=e.label??e.text??"OK",n.addEventListener("click",n=>{"function"==typeof e.onClick&&e.onClick(n,this),this._fire("action",{action:e,index:t},this),!1!==e.closeOnClick&&this.close()}),this._actionsEl.appendChild(n)})}_bind(){this._addEventListener(this.element,"mouseenter",()=>{Ve(this.options.pauseOnHover,!0)&&this._pause()}),this._addEventListener(this.element,"mouseleave",()=>{Ve(this.options.pauseOnHover,!0)&&this._resume()})}_startTimer(){if(clearTimeout(this._timer),this._timer=null,!(this._remaining<=0)&&(this._started=Date.now(),this._timer=setTimeout(()=>this.close(),this._remaining),this._bar)){const e=this._bar;e.style.transition="none",e.style.width=this._remaining/qe(this.options.duration,3e3)*100+"%";const t=()=>{e.style.transition=`width ${this._remaining}ms linear`,e.style.width="0%"};"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(t)):t()}}_pause(){if(!this._paused&&this._timer){if(this._paused=!0,clearTimeout(this._timer),this._timer=null,this._remaining=Math.max(0,this._remaining-(Date.now()-this._started)),this._bar){const e=this._bar.getBoundingClientRect().width,t=this._bar.parentElement?.getBoundingClientRect().width||0;this._bar.style.transition="none",this._bar.style.width=t?e/t*100+"%":this._bar.style.width}this._fire("pause",this)}}_resume(){this._paused&&(this._paused=!1,this._startTimer(),this._fire("resume",this))}open(){if(this._visible)return this;const e=this.options;for(;Nn.length>=qe(e.maxToasts,5);){const e=Nn.shift();e?.close()}this._visible=!0,Nn.push(this);(function(e){let t=Dn[e];return t&&t.isConnected||(t=document.createElement("div"),t.className=`domma-toast-container domma-toast-${e}`,t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.setAttribute("data-focus-trap-allow",""),document.body.appendChild(t),Dn[e]=t),t})(e.position||"top-right").appendChild(this.element);const t=()=>{this.element.classList.remove("hiding"),this.element.classList.add("show")};return"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t(),this._remaining=qe(e.duration,3e3),this._startTimer(),this._fire("show",this),this}close(){return this._visible?(this._visible=!1,clearTimeout(this._timer),this._timer=null,Nn=Nn.filter(e=>e!==this),this.element.classList.remove("show"),this.element.classList.add("hiding"),setTimeout(()=>{this._fire("close",this),this.element.remove(),super.destroy()},qe(this.options.animationDuration,300)),this):this}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}toggle(){return this._visible?this.close():this.open()}isVisible(){return this._visible}isOpen(){return this._visible}setMessage(e){return this.options.message=e,this._writeMessage(),this}setTitle(e){return this.options.title=e,this._titleEl.textContent=e?String(e):"",this._titleEl.hidden=!e,this}setType(e){const t=this.options.type||"default";this.options.type=e||"default",this.element.classList.remove(`domma-toast-${t}`),this.element.classList.add(`domma-toast-${this.options.type}`);const n="error"===this.options.type;return this.element.setAttribute("role",n?"alert":"status"),this.element.setAttribute("aria-live",n?"assertive":"polite"),this}setActions(e){return this.options.actions=e||[],this._renderActions(),this}_applyOptions(){const e=this._visible;this._render(),e&&this.element.classList.add("show")}destroy(){clearTimeout(this._timer),this._visible=!1,Nn=Nn.filter(e=>e!==this),this.element.remove(),super.destroy()}}function Hn(e,t={}){return!e||"object"!=typeof e||"undefined"!=typeof Node&&e instanceof Node||(e=(t={...e,...t}).message),new In(e,t).open()}const Wn=e=>(t,n={})=>Hn(t,{...n,type:e,icon:n.icon??On(e)}),Pn=Object.assign((e,t={})=>Hn(e,t),{show:Hn,success:Wn("success"),error:Wn("error"),warning:Wn("warning"),info:Wn("info"),closeAll(){for(const e of[...Nn])e.close();Nn=[]}}),Fn="dm-command-palette";function Rn(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgentData?.platform||navigator.platform||navigator.userAgent||"";return/mac|iphone|ipad|ipod/i.test(e)}const Vn={space:" ",esc:"escape",return:"enter",plus:"+",del:"delete"};function qn(e){if(!e||"string"!=typeof e)return null;const t=e.toLowerCase().split("+").map(e=>e.trim());let n=t.pop();if(""===n&&""===t[t.length-1]&&(t.pop(),n="+"),!n)return null;const s=(...e)=>t.some(t=>e.includes(t));return{key:Vn[n]||n,mod:s("mod"),ctrl:s("ctrl","control"),meta:s("meta","cmd","command","super"),alt:s("alt","option","opt"),shift:s("shift")}}function Un(e,t,n=Rn()){if(!t||!e||!e.key)return!1;const s=t.meta||t.mod&&n,i=t.ctrl||t.mod&&!n;if(!!e.metaKey!=!!s||!!e.ctrlKey!=!!i||!!e.altKey!=!!t.alt)return!1;const o=e.key.toLowerCase();return(!(o.length>1||/[a-z]/.test(o))||!!e.shiftKey==!!t.shift)&&(o===t.key||/^[a-z0-9]$/.test(t.key)&&(e.code===`Key${t.key.toUpperCase()}`||e.code===`Digit${t.key}`))}const Kn={enter:"↵",escape:"Esc",backspace:"⌫",delete:"Del",tab:"Tab"," ":"Space",arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→"};function Yn(e,t=Rn()){const n=qn(e);if(!n)return[];const s=[];return(n.ctrl||n.mod&&!t)&&s.push(t?"⌃":"Ctrl"),n.alt&&s.push(t?"⌥":"Alt"),n.shift&&s.push(t?"⇧":"Shift"),(n.meta||n.mod&&t)&&s.push(t?"⌘":"Meta"),s.push(Kn[n.key]||(1===n.key.length?n.key.toUpperCase():n.key.charAt(0).toUpperCase()+n.key.slice(1))),s}function Gn(e,t){if(0===t)return!0;const n=e[t-1],s=e[t];return!/[\p{L}\p{N}]/u.test(n)||n===n.toLowerCase()&&s!==s.toLowerCase()}function Jn(e,t){const n=String(e??"").trim().toLowerCase(),s=String(t??"");if(!n)return{score:0,indices:[]};const i=s.toLowerCase();if(i.length!==s.length)return null;const o=i.indexOf(n);if(o>-1){const e=Array.from({length:n.length},(e,t)=>o+t);let t=1e3-2*o-.5*(s.length-n.length);return 0===o?t+=300:Gn(s,o)&&(t+=150),{score:t,indices:e}}const r=n.replace(/\s+/g,""),a=[];let l=0,c=0,h=-2;for(const e of r){let t=-1;if(i[c]===e&&h===c-1)t=c;else for(let n=c;n<i.length;n++)if(i[n]===e&&(t<0&&(t=n),Gn(s,n))){t=n;break}if(t<0)return null;l+=10,t===h+1&&(l+=15),Gn(s,t)&&(l+=20),l-=.75*Math.min(t-h-1,20),a.push(t),h=t,c=t+1}return{score:l-.1*s.length,indices:a}}function Xn(e,t){const n=Jn(t,e.title),s=e.subtitle?Jn(t,e.subtitle):null;let i=n?n.score+50:-1/0;for(const n of Array.isArray(e.keywords)?e.keywords:[]){const e=Jn(t,n);e&&(i=Math.max(i,.8*e.score))}return s&&(i=Math.max(i,.6*s.score)),i===-1/0?null:{score:i,title:n?n.indices:[],subtitle:s?s.indices:[]}}function Zn(e,t,n){const s=String(t??"");if(!n||!n.length)return void(e.textContent=s);const i=new Set(n);let o="",r=!1;const a=()=>{if(o){if(r){const t=document.createElement("span");t.className=`${Fn}-match`,t.textContent=o,e.appendChild(t)}else e.appendChild(document.createTextNode(o));o=""}};for(let e=0;e<s.length;e++){const t=i.has(e);t!==r&&(a(),r=t),o+=s[e]}a()}const Qn=e=>String(e.id??e.title??""),es=new Set;const ts=a;class ns extends C{static componentName="command-palette";static defaults={commands:[],source:null,debounce:150,hotkey:"mod+k",placeholder:"Type a command or search…",label:"Command palette",maxResults:50,recentKey:null,recentLimit:5,recentLabel:"Recent",sourceGroup:null,emptyText:"No results",loadingText:"Searching…",pageLoadingText:"Loading…",errorText:"Something went wrong. Try again.",backLabel:"Back",footer:!0,resultsText:e=>1===e?"1 result":`${e} results`,navigate:null,animationDuration:150,className:"",mac:void 0,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onQuery:null,onBeforeSelect:null,onSelect:null,onRun:null};constructor(e={}){super(ns._makeRoot(),e),this._isOpen=!1,this._commands=Array.isArray(this.options.commands)?this.options.commands.slice():[],this._pages=[],this._query="",this._results=[],this._active=-1,this._sourceResults=[],this._loading=!1,this._error=null,this._timers=new Set,this._known=new Map,this._abort=null,this._sourceToken=0,this._build(),this._bind(),this._trap=new ut(this.element,{initialFocus:()=>this._input,returnFocus:!0,allowOutsideClick:!0,register:!1})}static _makeRoot(){const e=document.createElement("div");return e.className=Fn,e.hidden=!0,e}get _mac(){return void 0===this.options.mac?Rn():!!this.options.mac}_build(){const e=this.options,t=this.element;e.className&&t.classList.add(...String(e.className).split(/\s+/).filter(Boolean));const n=Ge(`${Fn}-list`);this._idBase=Ge(`${Fn}-opt`);const s=document.createElement("div");s.className=`${Fn}-backdrop`,this._backdrop=s;const i=document.createElement("div");i.className=`${Fn}-panel`,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label",String(e.label)),this._panel=i;const o=document.createElement("div");o.className=`${Fn}-crumbs`,o.hidden=!0;const r=document.createElement("button");r.type="button",r.className=`${Fn}-back`,r.setAttribute("aria-label",String(e.backLabel));const a=document.createElement("span");a.setAttribute("data-icon","arrow-left"),a.setAttribute("data-icon-size","16"),a.setAttribute("aria-hidden","true"),r.appendChild(a);const l=document.createElement("ol");l.className=`${Fn}-trail`,l.setAttribute("aria-label","Location"),o.append(r,l),this._crumbs=o,this._back=r,this._trail=l;const c=document.createElement("div");c.className=`${Fn}-search`;const h=document.createElement("span");h.className=`${Fn}-search-icon`,h.setAttribute("data-icon","search"),h.setAttribute("data-icon-size","18"),h.setAttribute("aria-hidden","true");const d=document.createElement("input");d.type="text",d.className=`${Fn}-input`,d.setAttribute("role","combobox"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",n),d.setAttribute("aria-autocomplete","list"),d.setAttribute("aria-label",String(e.label)),d.setAttribute("autocomplete","off"),d.setAttribute("autocapitalize","off"),d.setAttribute("spellcheck","false"),d.placeholder=String(e.placeholder??"");const u=document.createElement("span");u.className=`${Fn}-spinner`,u.setAttribute("aria-hidden","true"),u.hidden=!0,c.append(h,d,u),this._input=d,this._spinner=u;const p=document.createElement("div");p.className=`${Fn}-list`,p.id=n,p.setAttribute("role","listbox"),p.setAttribute("aria-label",String(e.label)),this._list=p;const m=document.createElement("div");m.className=`${Fn}-status`,m.hidden=!0,this._status=m;const f=document.createElement("div");if(f.className="sr-only",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true"),this._live=f,i.append(o,c,p,m,f),!1!==e.footer){const e=document.createElement("div");e.className=`${Fn}-footer`,e.setAttribute("aria-hidden","true");const t=(t,n)=>{const s=document.createElement("span");s.className=`${Fn}-hint`;for(const e of t){const t=document.createElement("kbd");t.textContent=e,s.appendChild(t)}s.appendChild(document.createTextNode(` ${n}`)),e.appendChild(s)};t(["↑","↓"],"to move"),t(["↵"],"to run"),t(["⌫"],"to go back"),t(["Esc"],"to close"),i.appendChild(e)}t.append(s,i),document.body.appendChild(t),Ke(t)}_bind(){this._addEventListener(this._input,"input",()=>this._setQuery(this._input.value)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this._back,"click",()=>this.back()),this._addEventListener(this._backdrop,"pointerdown",()=>{this._downOnBackdrop=!0}),this._addEventListener(this.element,"click",e=>{const t=!1!==this._downOnBackdrop;this._downOnBackdrop=!1,e.target===this._backdrop&&t&&this._isOpen&&this.close()}),this._addEventListener(this._panel,"pointerdown",()=>{this._downOnBackdrop=!1}),this._addEventListener(this._list,"pointermove",e=>{const t=e.target.closest?.(`.${Fn}-item`);if(!t||"true"===t.getAttribute("aria-disabled"))return;const n=Number(t.dataset.index);n!==this._active&&this._setActive(n,{scroll:!1})}),this._addEventListener(this._list,"mousedown",e=>e.preventDefault()),this._addEventListener(this._list,"click",e=>{const t=e.target.closest?.(`.${Fn}-item`);if(!t)return;const n=this._results[Number(t.dataset.index)];n&&this._choose(n.command,e)});const e=this._hotkeys();e.length&&(this._hotkeyList=e,es.add(this),this._addEventListener(document,"keydown",t=>{if(t.defaultPrevented||t.repeat||t.isComposing)return;const n=e.find(e=>Un(t,e,this._mac));if(!n)return;const s="function"==typeof t.composedPath?t.composedPath()[0]:t.target;!(n.mod||n.ctrl||n.meta||n.alt)&&function(e){return!(!e||1!==e.nodeType)&&(!!e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))}(s)||(t.preventDefault(),this.toggle())}))}_hotkeys(){const e=this.options.hotkey;return e?(Array.isArray(e)?e:[e]).map(qn).filter(Boolean):[]}_later(e,t){const n=setTimeout(()=>{this._timers.delete(n),e()},t);return this._timers.add(n),n}_clearTimer(e){e&&(clearTimeout(e),this._timers.delete(e))}_duration(){return Xe()?0:qe(this.options.animationDuration,150)}open(e){if(this._destroyed)return this;if(this._isOpen)return"string"==typeof e&&this._setQuery(e,{write:!0}),this;if(!1===this._fire("beforeOpen",this))return this;this._isOpen=!0,this._clearTimer(this._hideTimer),this.element.isConnected||document.body.appendChild(this.element),this._pages=[],this._sourceResults=[],this._error=null,this._input.value="string"==typeof e?e:"",this._query=this._input.value,this.element.hidden=!1,this._input.setAttribute("aria-expanded","true");const t=this._duration();return this.element.style.setProperty("--dm-command-palette-duration",`${t}ms`),t&&"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(()=>{this._isOpen&&this.element.classList.add("is-open")})):this.element.classList.add("is-open"),this._renderCrumbs(),this._update({resetActive:!0}),this._usesSource()&&this._runSource(this._query),this._trap.activate(),this._fire("open",this),this}close(){if(!this._isOpen)return this;if(!this._mayClose(this))return this;this._isOpen=!1,this._cancelSource(),this.element.classList.remove("is-open"),this._input.setAttribute("aria-expanded","false"),this._input.removeAttribute("aria-activedescendant"),this._trap.deactivate();const e=()=>{this._hideTimer=null,this._isOpen||(this.element.hidden=!0)},t=this._duration();return t?this._hideTimer=this._later(e,t):e(),this._fire("close",this),this}toggle(...e){return this._isOpen?this.close():this.open(...e)}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setCommands(e){return this._commands=Array.isArray(e)?e.slice():[],this.options.commands=this._commands,this._refresh(),this}addCommands(e){for(const t of Array.isArray(e)?e:[e]){if(!t)continue;const e=this._commands.findIndex(e=>Qn(e)===Qn(t));e>-1?this._commands[e]=t:this._commands.push(t)}return this._refresh(),this}removeCommand(e){return this._commands=this._commands.filter(t=>Qn(t)!==String(e)),this.options.commands=this._commands,this._refresh(),this}getCommands(){return this._commands.slice()}back(){if(!this._pages.length)return!1;const e=this._pages.pop();return e.abort?.abort(),this._input.value=e.query||"",this._query=this._input.value,this._renderCrumbs(),this._update({resetActive:!0}),!this._pages.length&&this._usesSource()&&this._runSource(this._query),this._input.focus({preventScroll:!0}),!0}query(){return this._query}recent(){if(!this.options.recentKey)return[];const e=me.get(this.options.recentKey,[]);return Array.isArray(e)?e.map(String):[]}clearRecent(){return this.options.recentKey&&me.remove(this.options.recentKey),this._refresh(),this}destroy(){if(this._destroyed)return;this._isOpen&&this._forcedClose(),this._destroyed=!0,es.delete(this),this._cancelSource();for(const e of this._timers)clearTimeout(e);this._timers.clear(),clearTimeout(this._liveTimer),this._trap.destroy();const e=this.element;super.destroy(),e.remove()}_applyOptions(){Array.isArray(this.options.commands)&&this.options.commands!==this._commands&&(this._commands=this.options.commands.slice()),this._input.placeholder=String(this._currentPage()?.command.placeholder??this.options.placeholder??""),this._refresh()}_refresh(){this._isOpen&&this._update()}_currentPage(){return this._pages[this._pages.length-1]||null}_usesSource(){return!this._pages.length&&"function"==typeof this.options.source}_setQuery(e,t={}){t.write&&(this._input.value=e),(e!==this._query||t.write)&&(this._query=e,this._fire("query",e,this),this._update({resetActive:!0}),this._usesSource()&&(this._cancelSource(),this._loading=!0,this._renderStatus(),this._debounceTimer=this._later(()=>this._runSource(e),qe(this.options.debounce,150))))}_cancelSource(){this._clearTimer(this._debounceTimer),this._debounceTimer=null,this._abort&&this._abort.abort(),this._abort=null,this._loading=!1,this._sourceToken+=1}_runSource(e){this._cancelSource();const t=this._sourceToken,n="function"==typeof AbortController?new AbortController:null;let s;this._abort=n,this._loading=!0,this._error=null,this._renderStatus();try{s=Promise.resolve(this.options.source(e,{signal:n?.signal,palette:this}))}catch(e){s=Promise.reject(e)}s.then(e=>{t===this._sourceToken&&this._isOpen&&(this._loading=!1,this._abort=null,this._sourceResults=Array.isArray(e)?e:[],this._update())},e=>{t===this._sourceToken&&this._isOpen&&(this._loading=!1,this._abort=null,e&&"AbortError"===e.name||(this._error=e||new Error("source failed"),this._sourceResults=[],this._update()))})}_findById(e,t=this._commands,n=0){for(const s of t){if(Qn(s)===e)return s;if(n<8&&Array.isArray(s.children)){const t=this._findById(e,s.children,n+1);if(t)return t}}return null}_remember(e){this._known.set(Qn(e),e);const t=this.options.recentKey;if(!t)return;const n=Qn(e),s=[n,...this.recent().filter(e=>e!==n)].slice(0,Math.max(1,qe(this.options.recentLimit,5)));me.set(t,s)}_compute(){const e=this.options,t=this._currentPage(),n=this._query.trim(),s=Math.max(1,qe(e.maxResults,50)),i=new Map,o=(e,t,n)=>{const s=null==e?"":String(e);i.has(s)||i.set(s,{name:s,items:[],best:-1/0});const o=i.get(s);o.items.push({command:t,match:n}),o.best=Math.max(o.best,n?n.score:0)},r=t?t.commands||[]:this._commands,a=new Set;if(!n&&!t&&e.recentKey)for(const t of this.recent()){const n=this._findById(t)||this._known.get(t);n&&!n.hidden&&(o(e.recentLabel,n,null),a.add(n))}const l=[];for(const e of r){if(!e||e.hidden||a.has(e))continue;if(!n){l.push({command:e,match:null});continue}const t=Xn(e,n);t&&l.push({command:e,match:t})}n&&l.sort((e,t)=>t.match.score-e.match.score);for(const{command:e,match:t}of l)o(e.group,e,t);let c=[...i.values()];if(n&&c.sort((e,t)=>t.best-e.best),!t&&this._sourceResults.length){const t=new Map;for(const s of this._sourceResults){if(!s)continue;const i=s.group??e.sourceGroup,o=null==i?"":String(i);t.has(o)||t.set(o,{name:o,items:[],best:0});const r=n?Jn(n,s.title):null,a=n&&s.subtitle?Jn(n,s.subtitle):null;t.get(o).items.push({command:s,match:{score:0,title:r?r.indices:[],subtitle:a?a.indices:[]}})}c=c.concat([...t.values()])}let h=s;const d=[];for(const e of c){if(h<=0)break;const t=e.items.slice(0,h);h-=t.length,t.length&&d.push({name:e.name,items:t})}return d}_update(e={}){const t=this._results[this._active]?.command,n=this._compute();this._renderList(n);let s=-1;!e.resetActive&&t&&(s=this._results.findIndex(e=>e.command===t)),(s<0||this._results[s]?.command.disabled)&&(s=this._nextEnabled(-1,1,!1)),this._setActive(s,{scroll:!0}),this._renderStatus()}_nextEnabled(e,t,n=!0){const s=this._results.length;if(!s)return-1;let i=e;for(let e=0;e<s;e++){if(i+=t,i>=s){if(!n)return-1;i=0}if(i<0){if(!n)return-1;i=s-1}if(!this._results[i].command.disabled)return i}return-1}_setActive(e,t={}){const n=this._list.querySelector(`.${Fn}-item.is-active`);n&&(n.classList.remove("is-active"),n.setAttribute("aria-selected","false")),this._active=e;const s=e>-1?this._results[e]?.row:null;s?(s.classList.add("is-active"),s.setAttribute("aria-selected","true"),this._input.setAttribute("aria-activedescendant",s.id),!1!==t.scroll&&"function"==typeof s.scrollIntoView&&s.scrollIntoView({block:"nearest"})):this._input.removeAttribute("aria-activedescendant")}_renderList(e){const t=this._list;t.replaceChildren(),this._results=[];const n=this._mac;let s=0;for(const i of e){let e=t;if(i.name){const n=document.createElement("div");n.className=`${Fn}-group`,n.setAttribute("role","group");const o=document.createElement("div");o.className=`${Fn}-group-heading`,o.id=`${this._idBase}-g${s}`,o.setAttribute("aria-hidden","true"),o.textContent=i.name,n.setAttribute("aria-labelledby",o.id),n.appendChild(o),t.appendChild(n),e=n}for(const{command:t,match:o}of i.items){const i=this._results.length,r=this._renderItem(t,o,i,n);e.appendChild(r),this._results.push({command:t,match:o,row:r}),s+=1}}Ke(t);const i=this._results.length;t.hidden=!i,this._input.setAttribute("aria-expanded",String(this._isOpen&&i>0))}_renderItem(e,t,n,s){const i=document.createElement("div");i.className=`${Fn}-item`,i.id=`${this._idBase}-${n}`,i.dataset.index=String(n),i.setAttribute("role","option"),i.setAttribute("aria-selected","false"),e.disabled&&i.setAttribute("aria-disabled","true");const o=document.createElement("span");o.className=`${Fn}-icon`,o.setAttribute("aria-hidden","true"),e.icon&&(o.setAttribute("data-icon",String(e.icon)),o.setAttribute("data-icon-size","16")),i.appendChild(o);const r=document.createElement("span");r.className=`${Fn}-text`;const a=document.createElement("span");if(a.className=`${Fn}-title`,Zn(a,e.title,t?.title),r.appendChild(a),e.subtitle){const n=document.createElement("span");n.className=`${Fn}-subtitle`,Zn(n,e.subtitle,t?.subtitle),r.appendChild(n)}if(i.appendChild(r),e.shortcut){const t=document.createElement("span");t.className=`${Fn}-shortcut`,t.setAttribute("aria-hidden","true");for(const n of Yn(e.shortcut,s)){const e=document.createElement("kbd");e.textContent=n,t.appendChild(e)}i.appendChild(t);const n=function(e,t){const n=qn(e);if(!n)return"";const s=[];(n.ctrl||n.mod&&!t)&&s.push("Control"),n.alt&&s.push("Alt"),n.shift&&s.push("Shift"),(n.meta||n.mod&&t)&&s.push("Meta");const i=" "===n.key?"Space":n.key;return s.push(1===i.length?i.toUpperCase():i.charAt(0).toUpperCase()+i.slice(1)),s.join("+")}(e.shortcut,s);n&&i.setAttribute("aria-keyshortcuts",n)}if(e.children){const e=document.createElement("span");e.className=`${Fn}-more`,e.setAttribute("aria-hidden","true"),e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-icon-size","16"),i.appendChild(e)}return i}_renderCrumbs(){const e=this._currentPage();this._crumbs.hidden=!e,this._trail.replaceChildren();for(const e of this._pages){const t=document.createElement("li");t.textContent=String(e.command.title??""),this._trail.appendChild(t)}const t=this._trail.lastElementChild;t&&t.setAttribute("aria-current","page"),this._input.placeholder=String(e?.command.placeholder??this.options.placeholder??"")}_renderStatus(){const e=this.options,t=this._currentPage(),n=t?t.loading:this._loading&&this._usesSource(),s=t?t.error:this._error,i=this._results.length;this._spinner.hidden=!n,this._list.setAttribute("aria-busy",String(!!n));let o="",r="";s?(o=String(e.errorText),r="error"):!i&&n?(o=String(t?e.pageLoadingText:e.loadingText),r="loading"):i||(o=String(e.emptyText),r="empty"),this._status.textContent=o,this._status.hidden=!o,this._status.dataset.state=r,this.element.dataset.state=r||"results",clearTimeout(this._liveTimer);const a=s||n&&!i?o:i?"function"==typeof e.resultsText?e.resultsText(i):`${i}`:o;this._liveTimer=setTimeout(()=>{this._isOpen&&(this._live.textContent=a)},250)}_onKeyDown(e){if(e.isComposing)return;const t=e.target===this._input;switch(e.key){case"Escape":return e.preventDefault(),e.stopPropagation(),void(this.back()||this.close());case"ArrowDown":case"ArrowUp":if(!t)return;return e.preventDefault(),void this._setActive(this._nextEnabled(this._active,"ArrowDown"===e.key?1:-1));case"Home":case"End":if(!t||e.shiftKey||!this._results.length)return;return e.preventDefault(),void this._setActive("Home"===e.key?this._nextEnabled(-1,1):this._nextEnabled(this._results.length,-1));case"Enter":{if(!t)return;e.preventDefault();const n=this._results[this._active];return void(n&&this._choose(n.command,e))}case"Backspace":return void(t&&""===this._input.value&&this._pages.length&&(e.preventDefault(),this.back()))}}_choose(e,t){e&&!e.disabled&&!1!==this._fire("beforeSelect",e,this)&&(this._fire("select",e,this),e.children?this._enter(e):this._run(e,t))}_enter(e){this._cancelSource(),this._sourceResults=[],this._error=null;const t={command:e,query:this._query,commands:[],loading:!1,error:null,abort:null};if(this._pages.push(t),this._input.value="",this._query="",this._renderCrumbs(),Array.isArray(e.children))t.commands=e.children;else if("function"==typeof e.children){let n;t.loading=!0,t.abort="function"==typeof AbortController?new AbortController:null;try{n=Promise.resolve(e.children(e,{signal:t.abort?.signal,palette:this}))}catch(e){n=Promise.reject(e)}n.then(e=>{t.loading=!1,t.commands=Array.isArray(e)?e:[],this._currentPage()===t&&this._update({resetActive:!0})},e=>{t.loading=!1,e&&"AbortError"===e.name||(t.error=e||new Error("children failed"),this._currentPage()===t&&this._update({resetActive:!0}))})}this._update({resetActive:!0}),this._input.focus({preventScroll:!0})}_run(e,t){if(this._remember(e),!0!==e.keepOpen&&this.close(),this._fire("run",e,this),"function"==typeof e.action)e.action(e,this,t);else if(e.href){const n=ts(e.href),s="_blank"===e.target||!(!t||!t.metaKey&&!t.ctrlKey);n&&("function"==typeof this.options.navigate?this.options.navigate(n,{newTab:s,command:e}):s?window.open(n,"_blank","noopener"):window.location.assign(n))}this._isOpen&&this._update()}}const ss="split-pane:";function is(e,t,n){const s=Array.isArray(e)?e[t]:e;return null==s?n:s}const os=e=>Math.round(1e3*e)/1e3;class rs extends C{static componentName="split-pane";static defaults={direction:"horizontal",sizes:null,minSize:0,maxSize:null,gutterSize:8,snapOffset:0,collapsible:!1,collapsedSize:0,collapseButton:!1,persistKey:null,cursor:null,disabled:!1,step:1,largeStep:10,gutterLabel:"Resize panes",onBeforeDrag:null,onDragStart:null,onDrag:null,onDragEnd:null,onResize:null,onCollapse:null,onExpand:null};constructor(e,t={}){super(e,t),this.element&&(this._gutters=[],this._drag=null,this._collapsed=[],this._restoreTo=[],this._addedIds=[],this._frame=0,this._containerStyle=this.element.getAttribute("style"),this.panes=Array.from(this.element.children),this._paneStyles=this.panes.map(e=>e.getAttribute("style")),this._build())}get horizontal(){return"vertical"!==this.options.direction}_build(){const e=this.element;e.classList.add("dm-split",this.horizontal?"dm-split-horizontal":"dm-split-vertical"),this.panes.forEach((e,t)=>{e.classList.add("dm-split-pane"),e.id||(e.id=Ge("dm-split-pane"),this._addedIds.push(e)),t>0&&this._gutters.push(this._makeGutter(t-1))}),this._gutters.forEach((t,n)=>e.insertBefore(t,this.panes[n+1]));let t=this._normalise(this.options.sizes);const n=this._load();n&&(t=n.sizes,this._collapsed=n.collapsed,this._restoreTo=n.restoreTo),this._sizes=t,this._apply(this._clampAll(t)),this._applyOptions(),"undefined"!=typeof ResizeObserver&&(this._observer=new ResizeObserver(()=>{this._frame||this._drag||(this._frame=requestAnimationFrame(()=>{this._frame=0,this.element&&this._apply(this._clampAll(this._sizes))}))}),this._observer.observe(e))}_makeGutter(e){const t=document.createElement("div");return t.className="dm-split-gutter",t.setAttribute("role","separator"),t.setAttribute("aria-orientation",this.horizontal?"vertical":"horizontal"),t.setAttribute("aria-controls",this.panes[e].id),t.dataset.index=String(e),this._addEventListener(t,"pointerdown",t=>this._onPointerDown(t,e)),this._addEventListener(t,"keydown",t=>this._onKey(t,e)),this._addEventListener(t,"dblclick",t=>{this.options.disabled||t.target.closest(".dm-split-toggle")||this._toggleFromGutter(e)}),t}_applyOptions(){if(!this._gutters)return;const e=this.options,t=Ve(e.disabled),n=`${Math.max(0,qe(e.gutterSize,8))}px`;this.element.classList.toggle("dm-split-disabled",t),this._gutters.forEach((s,i)=>{s.style.flex=`0 0 ${n}`,s.style.cursor=t?"":e.cursor||(this.horizontal?"col-resize":"row-resize"),s.setAttribute("aria-label",e.gutterLabel||"Resize panes"),s.tabIndex=t?-1:0,t?s.setAttribute("aria-disabled","true"):s.removeAttribute("aria-disabled"),this._syncButton(s,i)}),this._apply(this._clampAll(this._sizes))}_syncButton(e,t){const n=Ve(this.options.collapseButton)&&null!==this._collapseTarget(t);let s=e.querySelector(".dm-split-toggle");n?(s||(s=document.createElement("button"),s.type="button",s.className="dm-split-toggle",s.tabIndex=-1,s.setAttribute("aria-hidden","true"),this._addEventListener(s,"pointerdown",e=>e.stopPropagation()),this._addEventListener(s,"click",e=>{e.stopPropagation(),this.options.disabled||this._toggleFromGutter(t)}),e.appendChild(s)),s.disabled=Ve(this.options.disabled)):s&&s.remove()}_normalise(e){const t=this.panes.length;if(!t)return[];const n=Array.isArray(e)&&e.length===t?e.map(e=>Math.max(0,parseFloat(e)||0)):null,s=n?n.reduce((e,t)=>e+t,0):0;return!n||s<=0?Array(t).fill(100/t):n.map(e=>e/s*100)}_available(){const e=this.element;let t=this.horizontal?e.clientWidth:e.clientHeight;if(t>0){const n=getComputedStyle(e);t-=this.horizontal?(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0):(parseFloat(n.paddingTop)||0)+(parseFloat(n.paddingBottom)||0)}else{const n=e.getBoundingClientRect();t=this.horizontal?n.width:n.height}return Math.max(0,t-this._gutters.length*Math.max(0,qe(this.options.gutterSize,8)))}_toPercent(e,t,n){if(null==e||""===e)return n;const s=String(e).trim();if(s.endsWith("%"))return Math.min(100,Math.max(0,parseFloat(s)||0));const i=parseFloat(s);return Number.isFinite(i)?t<=0?i>0?n:0:Math.min(100,Math.max(0,i/t*100)):n}_limits(e,t=this._available()){const n=this.options,s=!!this._collapsed[e],i=s?this._toPercent(is(n.collapsedSize,e,0),t,0):this._toPercent(is(n.minSize,e,0),t,0),o=s?i:this._toPercent(is(n.maxSize,e,null),t,100);return{min:i,max:Math.max(i,o)}}_clampAll(e){const t=this._available(),n=e.slice();for(let e=0;e<2;e++)for(let e=0;e<n.length;e++){const{min:s,max:i}=this._limits(e,t),o=Math.min(i,Math.max(s,n[e])),r=o-n[e];if(!r)continue;let a=r;for(const s of this._neighbours(e)){if(!a)break;const e=this._limits(s,t),i=Math.min(e.max,Math.max(e.min,n[s]-a));a-=n[s]-i,n[s]=i}n[e]=o-a}return n}_neighbours(e){const t=[];for(let n=1;n<this.panes.length;n++)e+n<this.panes.length&&t.push(e+n),e-n>=0&&t.push(e-n);return t}_apply(e){this._sizes=e.map(os);const t=this._gutters.length*Math.max(0,qe(this.options.gutterSize,8));this.panes.forEach((e,n)=>{const s=this._sizes[n];e.style.flex=`0 0 calc(${s}% - ${os(t*s/100)}px)`,e.classList.toggle("dm-split-collapsed",!!this._collapsed[n])}),this._syncAria()}_syncAria(){const e=this._available();this._gutters.forEach((t,n)=>{const s=this._limits(n,e),i=this._limits(n+1,e),o=this._sizes[n]+this._sizes[n+1];t.setAttribute("aria-valuenow",String(Math.round(this._sizes[n]))),t.setAttribute("aria-valuemin",String(Math.round(Math.max(s.min,o-i.max)))),t.setAttribute("aria-valuemax",String(Math.round(Math.min(s.max,o-i.min))))})}_moveBoundary(e,t,{snap:n=!1}={}){const s=this._available(),i=this._limits(e,s),o=this._limits(e+1,s),r=this._sizes[e]+this._sizes[e+1],a=Math.max(i.min,r-o.max),l=Math.min(i.max,r-o.min);let c=Math.min(l,Math.max(a,t));if(n&&s>0){const e=Math.max(0,qe(this.options.snapOffset,0))/s*100;c-i.min<=e?c=Math.max(a,i.min):r-c-o.min<=e&&(c=Math.min(l,r-o.min))}const h=this._sizes.slice();h[e]=c,h[e+1]=r-c;const d=Math.abs(h[e]-this._sizes[e])>1e-6;return d&&(this._apply(h),this._fire("resize",this.getSizes())),d}_onPointerDown(e,t){if(this.options.disabled||this._drag)return;if(void 0!==e.button&&0!==e.button)return;if(!1===this._fire("beforedrag",t,e))return;e.preventDefault();const n=this._gutters[t],s=this.horizontal&&"rtl"===getComputedStyle(this.element).direction;this._drag={index:t,pointerId:e.pointerId,start:this.horizontal?e.clientX:e.clientY,startSize:this._sizes[t],available:this._available(),sign:s?-1:1,gutter:n};try{n.setPointerCapture?.(e.pointerId)}catch{}this.element.classList.add("dm-split-dragging"),n.classList.add("is-dragging"),n.addEventListener("pointermove",this._onPointerMove),n.addEventListener("pointerup",this._onPointerUp),n.addEventListener("pointercancel",this._onPointerUp),n.addEventListener("lostpointercapture",this._onPointerUp),this._fire("dragstart",this.getSizes(),t)}_onPointerMove=e=>{const t=this._drag;if(!t||void 0!==t.pointerId&&void 0!==e.pointerId&&e.pointerId!==t.pointerId)return;if(t.available<=0)return;const n=((this.horizontal?e.clientX:e.clientY)-t.start)*t.sign;this._uncollapseForDrag(t.index);const s=t.startSize+n/t.available*100;this._moveBoundary(t.index,s,{snap:!0})&&this._fire("drag",this.getSizes(),t.index)};_onPointerUp=e=>{const t=this._drag;if(!t)return;this._drag=null;const n=t.gutter;n.removeEventListener("pointermove",this._onPointerMove),n.removeEventListener("pointerup",this._onPointerUp),n.removeEventListener("pointercancel",this._onPointerUp),n.removeEventListener("lostpointercapture",this._onPointerUp);try{void 0!==e?.pointerId&&n.releasePointerCapture?.(e.pointerId)}catch{}this.element.classList.remove("dm-split-dragging"),n.classList.remove("is-dragging"),this._save(),this._fire("dragend",this.getSizes(),t.index)};_uncollapseForDrag(e){for(const t of[e,e+1])this._collapsed[t]&&(this._collapsed[t]=!1,this._restoreTo[t]=void 0,this._fire("expand",t))}_onKey(e,t){if(this.options.disabled)return;const n=this.horizontal&&"rtl"===getComputedStyle(this.element).direction,s=this.horizontal?n?"ArrowRight":"ArrowLeft":"ArrowUp",i=this.horizontal?n?"ArrowLeft":"ArrowRight":"ArrowDown",o=e.shiftKey?qe(this.options.largeStep,10):qe(this.options.step,1);let r=null;if(e.key===s)r=this._sizes[t]-o;else if(e.key===i)r=this._sizes[t]+o;else if("Home"===e.key)r=-1/0;else{if("End"!==e.key){if("Enter"===e.key){if(null===this._collapseTarget(t))return;return e.preventDefault(),void this._toggleFromGutter(t)}return}r=1/0}e.preventDefault(),this._uncollapseForDrag(t),this._moveBoundary(t,r)&&this._save()}_isCollapsible(e){const t=this.options.collapsible;return Array.isArray(t)?Ve(t[e]):Ve(t)}_collapseTarget(e){return this._collapsed[e]&&this._isCollapsible(e)?e:this._collapsed[e+1]&&this._isCollapsible(e+1)?e+1:this._isCollapsible(e)?e:this._isCollapsible(e+1)?e+1:null}_toggleFromGutter(e){const t=this._collapseTarget(e);null!==t&&(this._collapsed[t]?this.expand(t):this.collapse(t))}collapse(e){if(!this.panes?.[e]||this._collapsed[e])return this;const t=e+1<this.panes.length?e+1:e-1;if(t<0)return this;this._restoreTo[e]=this._sizes[e],this._collapsed[e]=!0;const n=this._limits(e).min,s=this._sizes.slice();return s[t]+=s[e]-n,s[e]=n,this._apply(this._clampAll(s)),this._save(),this._fire("resize",this.getSizes()),this._fire("collapse",e),this}expand(e){if(!this.panes?.[e]||!this._collapsed[e])return this;this._collapsed[e]=!1;const t=e+1<this.panes.length?e+1:e-1,n=this._restoreTo[e]??100/this.panes.length;this._restoreTo[e]=void 0;const s=this._sizes.slice(),i=this._limits(t),o=Math.max(0,Math.min(n-s[e],s[t]-i.min));return s[e]+=o,s[t]-=o,this._apply(this._clampAll(s)),this._save(),this._fire("resize",this.getSizes()),this._fire("expand",e),this}isCollapsed(e){return!!this._collapsed?.[e]}getSizes(){return(this._sizes||[]).map(e=>Math.round(100*e)/100)}setSizes(e){return this.panes?.length?(this._collapsed=[],this._restoreTo=[],this._apply(this._clampAll(this._normalise(e))),this._save(),this._fire("resize",this.getSizes()),this):this}_load(){const e=this.options.persistKey;if(!e)return null;let t=null;try{t=me.get(ss+e)}catch{return null}const n=Array.isArray(t)?t:t?.sizes;return Array.isArray(n)&&n.length===this.panes.length&&n.every(Number.isFinite)?{sizes:this._normalise(n),collapsed:Array.isArray(t?.collapsed)?t.collapsed.map(Boolean):[],restoreTo:Array.isArray(t?.restoreTo)?t.restoreTo.map(e=>Number.isFinite(e)?e:void 0):[]}:null}_save(){const e=this.options.persistKey;if(e)try{me.set(ss+e,{sizes:this.getSizes(),collapsed:this.panes.map((e,t)=>!!this._collapsed[t]),restoreTo:this.panes.map((e,t)=>this._restoreTo[t]??null)})}catch{}}destroy(){this._drag&&this._onPointerUp({}),this._frame&&cancelAnimationFrame(this._frame),this._observer?.disconnect(),this._observer=null;for(const e of this._gutters||[])e.remove();this._gutters=[],(this.panes||[]).forEach((e,t)=>{e.classList.remove("dm-split-pane","dm-split-collapsed");const n=this._paneStyles[t];null===n?e.removeAttribute("style"):e.setAttribute("style",n)});for(const e of this._addedIds||[])e.removeAttribute("id");this.element&&(this.element.classList.remove("dm-split","dm-split-horizontal","dm-split-vertical","dm-split-dragging","dm-split-disabled"),null===this._containerStyle||void 0===this._containerStyle?this.element.removeAttribute("style"):this.element.setAttribute("style",this._containerStyle)),super.destroy(),this._onDestroy?.()}}class as extends C{static componentName="virtual-list";static defaults={items:null,count:0,getItem:null,itemHeight:40,estimatedItemHeight:40,overscan:4,render:null,safe:!0,keyField:null,label:null,loadMore:null,threshold:200,loadingTemplate:null,endTemplate:null,errorTemplate:null,rowClass:"",onRender:null,onScroll:null,onLoadMore:null,onLoaded:null,onEnd:null,onError:null,onItemClick:null};constructor(e,t={}){super(e,t),this.element&&(this._id=Ge("dm-vlist"),this._rows=new Map,this._rowByEl=new WeakMap,this._heights=new Map,this._offsets=null,this._dirtyFrom=0,this._active=-1,this._focusWithin=!1,this._frame=0,this._range={start:0,end:-1},this._load={busy:!1,done:!1,error:null,page:0,gen:0},this._statusHeight=0,this._setData(this.options.items,this.options.count,this.options.getItem),this._build(),this._render())}_setData(e,t,n){Array.isArray(e)||e&&"number"!=typeof e&&"number"==typeof e.length?(this._items=Array.from(e),this._count=null,this._getItem=null):"function"==typeof n?(this._items=null,this._count=Math.max(0,Math.floor(qe(t,0))),this._getItem=n):(this._items=[],this._count=null,this._getItem=null),this._dirtyFrom=0}get count(){return this._items?this._items.length:this._count}_itemAt(e){return this._items?this._items[e]:this._getItem(e)}_keyOf(e,t){const n=this.options.keyField;return"function"==typeof n?n(e,t):n&&null!==e&&"object"==typeof e&&void 0!==e[n]?e[n]:t}get _fixed(){const e=this.options.itemHeight;return"auto"!==e&&qe(e,0)>0}get _rowHeight(){return qe(this.options.itemHeight,40)}get _estimate(){return Math.max(1,qe(this.options.estimatedItemHeight,40))}_syncOffsets(){const e=this.count;if(!this._offsets||this._offsets.length!==e+1){const t=new Float64Array(e+1);this._offsets=t,this._dirtyFrom=0}if(this._dirtyFrom>e)return;const t=this._offsets,n=this._estimate;for(let s=this._dirtyFrom;s<e;s++){const e=this._heights.get(this._keyOf(this._itemAt(s),s));t[s+1]=t[s]+(void 0===e?n:e)}this._dirtyFrom=e+1}_dirty(e){this._dirtyFrom=Math.min(this._dirtyFrom,Math.max(0,e))}_offset(e){return this._fixed?e*this._rowHeight:(this._syncOffsets(),this._offsets[Math.min(Math.max(0,e),this.count)])}_heightOf(e){return this._fixed?this._rowHeight:this._offset(e+1)-this._offset(e)}_total(){return this._offset(this.count)}_indexAt(e){const t=this.count;if(!t)return 0;if(this._fixed)return Math.min(t-1,Math.max(0,Math.floor(e/this._rowHeight)));this._syncOffsets();const n=this._offsets;let s=0,i=t-1;for(;s<i;){const t=s+i+1>>1;n[t]<=e?s=t:i=t-1}return s}_viewport(){return Math.max(0,this.element.clientHeight||0)}getVisibleRange(){if(!this.count||!this.element)return{start:0,end:-1};const e=this.element.scrollTop;return{start:this._indexAt(e),end:this._indexAt(e+Math.max(1,this._viewport())-1)}}_build(){const e=this.element;for(this._original=document.createDocumentFragment();e.firstChild;)this._original.appendChild(e.firstChild);e.classList.add("dm-vlist"),e.classList.toggle("dm-vlist-fixed",this._fixed),this._spacer=document.createElement("div"),this._spacer.className="dm-vlist-spacer",this._spacer.setAttribute("aria-hidden","true"),this._list=document.createElement("div"),this._list.className="dm-vlist-items",this._list.id=this._id,this._list.setAttribute("role","list"),this._list.tabIndex=-1,this.options.label&&this._list.setAttribute("aria-label",this.options.label),this._status=document.createElement("div"),this._status.className="dm-vlist-status",this._status.setAttribute("role","status"),this._status.setAttribute("aria-live","polite"),this._status.hidden=!0,e.append(this._spacer,this._list,this._status),this._addEventListener(e,"scroll",this._onScroll),this._addEventListener(this._list,"click",this._onClick),this._addEventListener(this._list,"keydown",this._onKey),this._addEventListener(this._list,"focusin",this._onFocusIn),this._addEventListener(this._list,"focusout",this._onFocusOut),this._addEventListener(this._status,"click",e=>{e.target.closest?.("[data-vlist-retry]")&&this.retry()}),"undefined"!=typeof ResizeObserver&&(this._hostObserver=new ResizeObserver(()=>this._schedule()),this._hostObserver.observe(e),this._rowObserver=new ResizeObserver(e=>this._onRowResize(e)))}_schedule(){if(this._frame||!this.element)return;const e="function"==typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,16);this._frame=e(()=>{this._frame=0,this.element&&this._render()})}_onScroll=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,16);this._frame=e(()=>{this._frame=0,this.element&&(this._render(),this._fire("scroll",this.getVisibleRange()))})};_makeRow(){const e=document.createElement("div");return e.className="dm-vlist-row"+(this.options.rowClass?` ${this.options.rowClass}`:""),e.setAttribute("role","listitem"),e.tabIndex=-1,e}_fillRow(e,t,n){const s=this.options.render;"function"==typeof s?Ue(e,s(t,n),{safe:!1!==this.options.safe&&"false"!==this.options.safe}):e.textContent=null==t?"":String("object"==typeof t?t.label??t.title??t.name??"":t)}_render(e=!1){if(!this.element||!this._list)return;const t=this._focusWithin&&this._list.contains(document.activeElement);let n=!1;for(let t=0;t<3;t++){const s=this._renderPass(e&&0===t);if(s.range&&(n=!0),!s.resized)break}const s=this.count;if(this._active>=s&&(this._active=s-1),this._syncTabStop(),t&&!this._list.contains(document.activeElement)){(this._rowFor(this._active)||this._list).focus({preventScroll:!0})}n&&this._fire("render",{...this._range}),this._maybeLoad()}_renderPass(e){const t=this.count,n=this._fixed,s=this.element.scrollTop,i=this._viewport(),o=Math.max(0,Math.floor(qe(this.options.overscan,4)));let r=0,a=-1;if(t){const e=this._indexAt(s),n=this._indexAt(s+Math.max(1,i)-1);r=Math.max(0,e-o),a=Math.min(t-1,n+o)}const l=new Map;for(let e=r;e<=a;e++)l.set(this._keyOf(this._itemAt(e),e),e);this._focusWithin&&this._active>=0&&this._active<t&&(this._active<r||this._active>a)&&l.set(this._keyOf(this._itemAt(this._active),this._active),this._active);for(const[e,t]of this._rows)l.has(e)||(this._rowObserver?.unobserve(t.el),t.el.remove(),this._rows.delete(e));const c=this.options.loadMore&&!this._load.done?-1:t,h=[],d=document.createDocumentFragment();for(const[t,s]of l){const i=this._itemAt(s);let o=this._rows.get(t);if(o?(e||o.item!==i||o.index!==s)&&(this._fillRow(o.el,i,s),o.item=i,n||h.push(o)):(o={el:this._makeRow(),index:-1,item:void 0,key:t},this._rows.set(t,o),this._rowByEl.set(o.el,o),this._fillRow(o.el,i,s),o.item=i,d.appendChild(o.el),h.push(o)),o.index!==s&&(o.index=s,o.el.dataset.index=String(s),o.el.setAttribute("aria-posinset",String(s+1))),o.el.getAttribute("aria-setsize")!==String(c)&&o.el.setAttribute("aria-setsize",String(c)),n){const e=`${this._rowHeight}px`;o.el.style.height!==e&&(o.el.style.height=e)}}d.firstChild&&this._list.appendChild(d);let u=!1;if(!n&&h.length){let e=0;const n=t?this._indexAt(s):0,i=h.map(e=>e.el.offsetHeight);h.forEach((t,s)=>{const o=i[s];if(!o)return;const r=this._heightOf(t.index);Math.abs(o-r)<.5?this._heights.set(t.key,o):(t.index<n&&(e+=o-r),this._heights.set(t.key,o),this._dirty(t.index),u=!0)});for(const e of h)this._rowObserver?.observe(e.el);e&&(this.element.scrollTop=s+e)}for(const e of this._rows.values()){const t=`translateY(${this._offset(e.index)}px)`;e.el.style.transform!==t&&(e.el.style.transform=t)}this._placeStatus();const p=r!==this._range.start||a!==this._range.end;return this._range={start:r,end:a},{range:p,resized:u}}_placeStatus(){const e=this._total(),t=`translateY(${e}px)`;this._status.style.transform!==t&&(this._status.style.transform=t);const n=`${e+(this._status.hidden?0:this._statusHeight)}px`;this._spacer.style.height!==n&&(this._spacer.style.height=n)}_onRowResize(e){if(this._fixed||!this.element)return;let t=!1,n=0;const s=this.element.scrollTop,i=this.count?this._indexAt(s):0;for(const s of e){const e=this._rowByEl.get(s.target);if(!e||this._rows.get(e.key)!==e)continue;const o=s.borderBoxSize?.[0],r=o?o.blockSize:e.el.offsetHeight;if(!r)continue;const a=this._heights.get(e.key);if(void 0!==a&&Math.abs(a-r)<.5)continue;const l=this._heightOf(e.index);e.index<i&&(n+=r-l),this._heights.set(e.key,r),this._dirty(e.index),t=!0}t&&(n&&(this.element.scrollTop=s+n),this._schedule())}_rowFor(e){for(const t of this._rows.values())if(t.index===e)return t.el;return null}_syncTabStop(){let e=this._rowFor(this._active);if(!e&&this.count){const{start:t}=this.getVisibleRange();e=this._rowFor(t)||this._list.querySelector(".dm-vlist-row")}for(const t of this._rows.values()){const n=t.el===e?0:-1;t.el.tabIndex!==n&&(t.el.tabIndex=n)}}_rowOf(e){const t=e?.closest?.(".dm-vlist-row");return t&&t.parentNode===this._list?t:null}_onClick=e=>{const t=this._rowOf(e.target);if(!t)return;const n=Number(t.dataset.index);this._active=n,this._syncTabStop(),this._fire("itemclick",this._itemAt(n),n,e)};_onFocusIn=e=>{this._focusWithin=!0;const t=this._rowOf(e.target);t&&(this._active=Number(t.dataset.index),this._syncTabStop())};_onFocusOut=e=>{e.relatedTarget&&this._list.contains(e.relatedTarget)||(this._focusWithin=!1)};_onKey=e=>{const t=this._rowOf(e.target);if(!t||e.target!==t)return;const n=Number(t.dataset.index),s=this.count,i=this.getVisibleRange(),o=Math.max(1,i.end-i.start);let r=null;switch(e.key){case"ArrowDown":r=n+1;break;case"ArrowUp":r=n-1;break;case"Home":r=0;break;case"End":r=s-1;break;case"PageDown":r=n+o;break;case"PageUp":r=n-o;break;case"Enter":return e.preventDefault(),void this._fire("itemclick",this._itemAt(n),n,e);default:return}e.preventDefault(),this.focusIndex(Math.min(s-1,Math.max(0,r)))};focusIndex(e){const t=this.count;if(!t)return this;const n=Math.min(t-1,Math.max(0,Math.floor(qe(e,0))));this._active=n,this._focusWithin=!0,this.scrollToIndex(n,{align:"auto"});const s=this._rowFor(n);return s&&s.focus({preventScroll:!0}),this._syncTabStop(),this}_maybeLoad(){const e=this._load;if("function"!=typeof this.options.loadMore||e.busy||e.done||e.error)return;const t=this.element;this._total()-(t.scrollTop+this._viewport())<=Math.max(0,qe(this.options.threshold,200))&&this._loadNext()}_loadNext(){const e=this._load;e.busy=!0;const t=e.gen;let n;this._list.setAttribute("aria-busy","true"),this._showStatus("loading"),this._placeStatus(),this._fire("loadmore",{count:this.count,page:e.page});try{n=Promise.resolve(this.options.loadMore({count:this.count,page:e.page}))}catch(e){n=Promise.reject(e)}n.then(n=>{if(t!==this._load.gen||!this.element)return;const s=Array.isArray(n)?n:Array.isArray(n?.items)?n.items:[],i=!Array.isArray(n)&&!!n?.done||0===s.length;e.busy=!1,e.page+=1,this._list.removeAttribute("aria-busy"),i&&(e.done=!0),this._showStatus(i?"end":null),s.length?this._appendItems(s):this._render(),this._fire("loaded",s),i&&this._fire("end")},n=>{t===this._load.gen&&this.element&&(e.busy=!1,e.error=n||new Error("loadMore failed"),this._list.removeAttribute("aria-busy"),this._showStatus("error"),this._placeStatus(),this._fire("error",e.error))})}retry(){return this._load?.error?(this._load.error=null,this._loadNext(),this):this}isDone(){return!!this._load?.done}_template(e){const t=this.options,n={loading:t.loadingTemplate,end:t.endTemplate,error:t.errorTemplate}[e],s="function"==typeof n?n(this._load.error):n;if(null!=s&&""!==s)return s;if("loading"===e){const e=document.createElement("div");e.className="dm-vlist-loading";const t=document.createElement("span");return t.className="dm-vlist-spinner",t.setAttribute("aria-hidden","true"),e.append(t,document.createTextNode("Loading more…")),e}if("error"===e){const e=document.createElement("div");e.className="dm-vlist-error";const t=document.createElement("button");return t.type="button",t.className="btn btn-sm btn-outline",t.dataset.vlistRetry="",t.textContent="Retry",e.append(document.createTextNode("Could not load more. "),t),e}return null}_showStatus(e){const t=this._status,n=e?this._template(e):null;if(t.dataset.state=e||"",null==n)return t.replaceChildren(),t.hidden=!0,void(this._statusHeight=0);Ue(t,n,{safe:!1!==this.options.safe&&"false"!==this.options.safe}),t.hidden=!1,this._statusHeight=t.offsetHeight||0}setItems(e){return this._setData(e||[],0,null),this.options.keyField||this._heights.clear(),this._resetLoading(),this._render(),this}setCount(e){return this._items||(this._count=Math.max(0,Math.floor(qe(e,0))),this._dirty(0),this._render()),this}_resetLoading(){const e=this._load;e.gen+=1,e.busy=!1,e.done=!1,e.error=null,e.page=0,this._list?.removeAttribute("aria-busy"),this._status&&this._showStatus(null)}_materialise(){if(this._items)return;const e=[];for(let t=0;t<this._count;t++)e.push(this._getItem(t));this._items=e,this._count=null,this._getItem=null}_appendItems(e){this._materialise();const t=this._items.length;for(const t of e)this._items.push(t);this._dirty(t),this._render()}append(e){return e?.length?(this._appendItems(Array.from(e)),this):this}prepend(e){if(!e?.length)return this;this._materialise();const t=Array.from(e);this.options.keyField||this._heights.clear();let n=0;this._fixed?n=t.length*this._rowHeight:t.forEach((e,t)=>{const s=this._heights.get(this._keyOf(e,t));n+=void 0===s?this._estimate:s});const s=this.element.scrollTop;return this._items.unshift(...t),this._active>=0&&(this._active+=t.length),this._dirty(0),this._spacer.style.height=`${this._total()+this._statusHeight}px`,this.element.scrollTop=s+n,this._render(),this}indexOfKey(e){const t=this.count;for(let n=0;n<t;n++)if(this._keyOf(this._itemAt(n),n)===e)return n;return-1}update(e,t){const n=this.count,s="number"==typeof e?Math.floor(e):this.indexOfKey(e);if(!(s>=0&&s<n))return this;this._items&&(this._items[s]=t);const i=this._keyOf(t,s),o=this._rows.get(i);return o&&(o.item=void 0),this._render(),this}scrollToIndex(e,t={}){const n=this.count;if(!n||!this.element)return this;const s=Math.min(n-1,Math.max(0,Math.floor(qe(e,0)))),i=t.align||"auto",o=!!t.smooth&&!Xe()&&"function"==typeof this.element.scrollTo,r=()=>{const e=this._offset(s),t=this._heightOf(s),n=this._viewport(),o=this.element.scrollTop;return"start"===i?e:"end"===i?e+t-n:"center"===i?e+t/2-n/2:e<o?e:e+t>o+n?e+t-n:null},a=r();if(null===a)return this._render(),this;const l=Math.max(0,this._total()+this._statusHeight-this._viewport()),c=Math.min(l,Math.max(0,a));if(o)return this.element.scrollTo({top:c,behavior:"smooth"}),this;if(this.element.scrollTop=c,this._render(),!this._fixed)for(let e=0;e<2;e++){const e=r();if(null===e||Math.abs(e-this.element.scrollTop)<1)break;this.element.scrollTop=Math.max(0,e),this._render()}return this}refresh(){return this._dirty(0),this._render(!0),this}getRenderedRange(){return{...this._range}}_applyOptions(){this._list&&(this.element.classList.toggle("dm-vlist-fixed",this._fixed),this.options.label?this._list.setAttribute("aria-label",this.options.label):this._list.removeAttribute("aria-label"),this._dirty(0),this._render(!0))}setOptions(e={}){const t="items"in e||"count"in e||"getItem"in e;return this.options={...this.options,...e},t&&(this._setData(this.options.items,this.options.count,this.options.getItem),this.options.keyField||this._heights.clear()),this._applyOptions(),this}destroy(){this._load&&(this._load.gen+=1),this._frame&&(("function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout)(this._frame),this._frame=0),this._hostObserver?.disconnect(),this._rowObserver?.disconnect(),this._hostObserver=this._rowObserver=null,this._spacer?.remove(),this._list?.remove(),this._status?.remove(),this._rows?.clear(),this.element&&(this.element.classList.remove("dm-vlist","dm-vlist-fixed"),this._original&&this.element.appendChild(this._original)),this._original=null,super.destroy(),this._onDestroy?.(),this._list=null}}const ls={prompt:"Drop files here or click to browse",hint:null,remove:"Remove {name}",retry:"Retry",cancel:"Cancel upload of {name}",added:"{name} added",removed:"{name} removed",type:"{name} was not added: that type of file is not accepted",size:"{name} was not added: it is larger than {max}",small:"{name} was not added: it is smaller than {min}",count:"{name} was not added: no more than {max} files",uploading:"Uploading {percent}%",done:"Uploaded",failed:"Upload failed",cancelled:"Cancelled",required:"Please add a file"};function cs(e){const t=Number(e)||0;if(t<1024)return`${t} B`;const n=["KB","MB","GB","TB"];let s=t,i=-1;do{s/=1024,i++}while(s>=1024&&i<n.length-1);return`${s>=10?Math.round(s):Math.round(10*s)/10} ${n[i]}`}function hs(e){if(!e)return[];return(Array.isArray(e)?e:String(e).split(",")).map(e=>String(e).trim().toLowerCase()).filter(Boolean)}function ds(e,t){return String(e??"").replace(/\{(\w+)\}/g,(e,n)=>void 0!==t[n]?String(t[n]):e)}function us(e){const t=e?.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}const ps={zones:0,armed:!1,timer:null};function ms(e){us(e)&&(clearTimeout(ps.timer),ps.timer=setTimeout(vs,1500),e.defaultPrevented||e.target?.closest?.('input[type="file"]')||(e.preventDefault(),e.dataTransfer.dropEffect="none"))}function fs(e){e.defaultPrevented||e.target?.closest?.('input[type="file"]')||e.preventDefault(),vs()}function _s(e){e.relatedTarget||vs()}function gs(e){!ps.armed&&us(e)&&(ps.armed=!0,document.addEventListener("dragover",ms),document.addEventListener("drop",fs),document.addEventListener("dragleave",_s),ps.timer=setTimeout(vs,1500))}function vs(){clearTimeout(ps.timer),ps.timer=null,ps.armed&&(ps.armed=!1,document.removeEventListener("dragover",ms),document.removeEventListener("drop",fs),document.removeEventListener("dragleave",_s))}class bs extends C{static componentName="dropzone";static defaults={accept:null,multiple:null,maxFiles:null,maxSize:null,minSize:null,previews:!0,name:null,input:null,list:!0,upload:null,autoUpload:!0,retry:0,labels:{},disabled:!1,className:"",onBeforeAdd:null,onAdd:null,onReject:null,onRemove:null,onChange:null,onUploadStart:null,onProgress:null,onSuccess:null,onError:null,onComplete:null};constructor(e,t={}){super(e,t),this.element&&(this._entries=[],this._queue=[],this._active=0,this._batch=!1,this._added=[],this._canSync=function(){try{return"undefined"!=typeof DataTransfer&&!!(new DataTransfer).items}catch{return!1}}(),this._labels={...ls,...this.options.labels||{}},this._setupZone(),this._setupInput(),this._setupList(),this._bind(),this._applyDisabled(),0===ps.zones++&&document.addEventListener("dragenter",gs),this._guarded=!0)}_setupZone(){const e=this.element;if("INPUT"===e.tagName&&"file"===e.type){const t=document.createElement("div");e.after(t),this._added.push(t),this.zone=t,this._givenInput=e}else this.zone=e;const t=this.zone;this._restoreZone=["role","tabindex","aria-disabled","aria-describedby"].reduce((e,n)=>(e[n]=t.getAttribute(n),e),{}),this._zoneClasses=["dm-dropzone",...String(this.options.className||"").split(/\s+/).filter(Boolean)].filter(e=>!t.classList.contains(e)),t.classList.add(...this._zoneClasses),this._isLabel="LABEL"===t.tagName,this._isLabel||t.setAttribute("role","button"),t.setAttribute("tabindex","0")}_findInput(){const e=this.options;if(this._givenInput)return this._givenInput;if(e.input){const t="string"==typeof e.input?document.querySelector(e.input):e.input;if(t&&"INPUT"===t.tagName)return t}const t=this.zone.querySelector('input[type="file"]');if(t)return t;for(const e of[this.zone.nextElementSibling,this.zone.previousElementSibling])if(e&&e.matches?.('input[type="file"]'))return e;return null}_setupInput(){let e=this._findInput();e?this._restoreInput={hidden:e.hidden,name:e.getAttribute("name"),multiple:e.multiple,disabled:e.disabled,tabindex:e.getAttribute("tabindex"),accept:e.getAttribute("accept")}:(e=document.createElement("input"),e.type="file",this.zone.appendChild(e),this._added.push(e)),this.input=e;const t=this.options;null!==t.accept&&void 0!==t.accept||(t.accept=e.getAttribute("accept")||null),null!==t.multiple&&void 0!==t.multiple||(t.multiple=!this._restoreInput||e.multiple),!t.name&&e.name&&(t.name=e.name),t.name&&(e.name=t.name),e.multiple=Ve(t.multiple,!0);const n=hs(t.accept).join(",");n&&e.setAttribute("accept",n),e.hidden=!0,e.tabIndex=-1}_setupList(){const e=this.zone,t=this.options;if(!Array.from(e.childNodes).some(e=>1===e.nodeType&&e!==this.input||3===e.nodeType&&e.textContent.trim())){const t=document.createElement("span");t.className="dm-dropzone-prompt";const n=document.createElement("span");n.className="dm-dropzone-icon",n.setAttribute("aria-hidden","true"),n.dataset.icon="upload";const s=document.createElement("span");s.className="dm-dropzone-text",s.textContent=this._labels.prompt,t.append(n,s);const i=this._hint();if(i){const e=document.createElement("span");e.className="dm-dropzone-hint",e.id=Ge("dm-dropzone-hint"),e.textContent=i,t.appendChild(e),this._hintId=e.id}e.insertBefore(t,e.firstChild),this._added.push(t),Ke(t)}if(this._hintId){const t=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);e.setAttribute("aria-describedby",[...t,this._hintId].join(" "))}const n=document.createElement("div");if(n.className="sr-only dm-dropzone-live",n.setAttribute("aria-live","polite"),n.setAttribute("role","status"),this._live=n,!1!==t.list){const n=document.createElement("ul");n.className="dm-dropzone-files",n.setAttribute("aria-label","Selected files"),n.hidden=!0,this._list=n;const s=!0===t.list||void 0===t.list||null===t.list?null:"string"==typeof t.list?document.querySelector(t.list):t.list;s&&1===s.nodeType?s.appendChild(n):e.after(n),this._added.push(n)}(this._list||e).after(n),this._added.push(n)}_hint(){if(null!==this._labels.hint&&void 0!==this._labels.hint)return String(this._labels.hint);const e=this.options,t=[],n=hs(e.accept);return n.length&&t.push(n.join(", ")),e.maxSize&&t.push(`up to ${cs(e.maxSize)}`),e.maxFiles&&Ve(e.multiple,!0)&&t.push(`at most ${qe(e.maxFiles)} files`),t.join(" · ")}_bind(){const e=this.zone,t=this.input;this._addEventListener(e,"click",e=>{e.target===t||this._isLabel||this.browse()}),this._addEventListener(e,"keydown",t=>{t.target===e&&("Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this.browse()))}),this._addEventListener(t,"change",()=>{if(this._settingFiles)return;const e=Array.from(t.files||[]);e.length?this.addFiles(e):this._syncInput()}),this._addEventListener(e,"paste",e=>{const t=Array.from(e.clipboardData?.files||[]);t.length&&!this.isDisabled()&&(e.preventDefault(),this.addFiles(t))}),this._addEventListener(e,"dragenter",t=>{us(t)&&!this.isDisabled()&&(t.preventDefault(),gs(t),e.classList.add("is-dragover"))}),this._addEventListener(e,"dragover",t=>{us(t)&&!this.isDisabled()&&(t.preventDefault(),t.dataTransfer.dropEffect="copy",e.classList.add("is-dragover"))}),this._addEventListener(e,"dragleave",t=>{t.relatedTarget&&e.contains(t.relatedTarget)||e.classList.remove("is-dragover")}),this._addEventListener(e,"drop",t=>{e.classList.remove("is-dragover"),us(t)&&(t.preventDefault(),vs(),this.isDisabled()||this.addFiles(t.dataTransfer.files))}),this._addEventListener(t,"invalid",()=>{e.classList.add("is-invalid"),this._announce(this._labels.required),e.focus()});const n=t.form;n&&!this._canSync&&this._addEventListener(n,"formdata",e=>{if(!this.options.upload&&!this.isDisabled()&&t.name){e.formData.delete(t.name);for(const n of this._entries)e.formData.append(t.name,n.file,n.name)}}),n&&this._addEventListener(n,"reset",()=>{this._timers=this._timers||[],this._timers.push(setTimeout(()=>{this._entries&&this.clear()},0))})}_applyDisabled(){const e=this.isDisabled();this.zone.classList.toggle("is-disabled",e),this.zone.setAttribute("tabindex",e?"-1":"0"),e?this.zone.setAttribute("aria-disabled","true"):this.zone.removeAttribute("aria-disabled"),this.input.disabled=e,this._list?.querySelectorAll("button").forEach(t=>{t.disabled=e})}_entryFor(e){return e&&this._entries.find(t=>t===e||t.id===e||t.file===e)||null}_makeEntry(e){return{id:Ge("dm-file"),file:e,name:String(e?.name??"file"),size:Number(e?.size)||0,type:String(e?.type||""),status:"queued",progress:0,response:null,error:null,attempts:0,preview:null}}_rejectReason(e,t){const n=this.options;if(!function(e,t){const n=hs(t);if(!n.length)return!0;const s=String(e?.name||"").toLowerCase(),i=String(e?.type||"").toLowerCase();return n.some(e=>e.startsWith(".")?s.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,-1)):i===e)}(e.file,n.accept))return"type";if(n.maxSize&&e.size>qe(n.maxSize))return"size";if(n.minSize&&e.size<qe(n.minSize))return"size";const s=Ve(n.multiple,!0)?qe(n.maxFiles,0):1;return s&&t>=s?"count":null}_rejectMessage(e,t){const n=this.options;if("size"===t&&n.minSize&&e.size<qe(n.minSize))return ds(this._labels.small,{name:e.name,min:cs(n.minSize)});const s="size"===t?cs(n.maxSize):Ve(n.multiple,!0)?qe(n.maxFiles):1;return ds(this._labels[t],{name:e.name,max:s})}addFiles(e){if(!this._entries||this.isDisabled()||!e)return[];let t="number"==typeof e.length?Array.from(e):[e];if(t=t.filter(Boolean),!t.length)return[];const n=!Ve(this.options.multiple,!0),s=[],i=[];for(const e of t){const t=this._makeEntry(e),o=n?s.length:this._entries.length+s.length,r=this._rejectReason(t,o);r?(i.push(this._rejectMessage(t,r)),this._fire("reject",t,r)):!1!==this._fire("beforeadd",t)&&s.push(t)}if(s.length&&n)for(const e of this._entries.slice())this._drop(e);for(const e of s)this._entries.push(e),this._preview(e),this._renderEntry(e),i.push(ds(this._labels.added,{name:e.name})),this._fire("add",e);return this.zone.classList.remove("is-invalid"),i.length&&this._announce(i.join(". ")),s.length?(this._syncInput(),this._fire("change",this.getFiles()),this.options.upload&&Ve(this.options.autoUpload,!0)&&this.upload()):this._canSync&&!this.options.upload||this._syncInput(),s}removeFile(e){const t=this._entryFor(e);return!!t&&(this._drop(t),this._announce(ds(this._labels.removed,{name:t.name})),this._syncInput(),this._fire("change",this.getFiles()),this._pump(),!0)}_drop(e){this._abort(e),this._queue=this._queue.filter(t=>t!==e),this._entries=this._entries.filter(t=>t!==e),e.preview&&(URL.revokeObjectURL(e.preview),e.preview=null),e._row?.remove(),e._row=null,this._list&&(this._list.hidden=!this._entries.length),this._fire("remove",e)}clear(){if(!this._entries?.length)return this;for(const e of this._entries.slice())this._drop(e);return this._syncInput(),this._fire("change",this.getFiles()),this}getFiles(){return(this._entries||[]).map(e=>e.file)}getEntries(){return(this._entries||[]).slice()}browse(){return this.isDisabled()||this.input.click(),this}_syncInput(){const e=this.input;if(e){this._settingFiles=!0;try{if(this.options.upload||!this._canSync){try{e.value=""}catch{}return}const t=new DataTransfer;for(const e of this._entries)t.items.add(e.file);e.files=t.files}catch{this._canSync=!1}finally{this._settingFiles=!1}}}_announce(e){this._live&&e&&(this._live.textContent="",this._live.textContent=e)}_preview(e){if(Ve(this.options.previews,!0)&&/^image\//.test(e.type)&&"undefined"!=typeof URL&&"function"==typeof URL.createObjectURL)try{e.preview=URL.createObjectURL(e.file)}catch{e.preview=null}}_renderEntry(e){if(!this._list)return;const t=document.createElement("li");t.className="dm-dropzone-file",t.dataset.id=e.id;const n=document.createElement("span");if(n.className="dm-dropzone-thumb",n.setAttribute("aria-hidden","true"),e.preview){const t=document.createElement("img");t.alt="",t.src=e.preview,n.appendChild(t)}else{const t=e.name.lastIndexOf(".");n.textContent=t>0?e.name.slice(t+1,t+5).toUpperCase():"FILE"}const s=document.createElement("span");s.className="dm-dropzone-meta";const i=document.createElement("span");i.className="dm-dropzone-name",i.textContent=e.name,i.title=e.name;const o=document.createElement("span");o.className="dm-dropzone-size",o.textContent=cs(e.size);const r=document.createElement("span");r.className="dm-dropzone-status",s.append(i,o,r);const a=document.createElement("span");a.className="dm-dropzone-progress",a.setAttribute("role","progressbar"),a.setAttribute("aria-valuemin","0"),a.setAttribute("aria-valuemax","100"),a.setAttribute("aria-label",e.name),a.hidden=!0;const l=document.createElement("span");l.className="dm-dropzone-progress-bar",a.appendChild(l);const c=document.createElement("button");c.type="button",c.className="btn btn-sm btn-ghost dm-dropzone-retry",c.textContent=this._labels.retry,c.hidden=!0,c.addEventListener("click",()=>this.retry(e.id));const h=document.createElement("button");h.type="button",h.className="dm-dropzone-remove",h.setAttribute("aria-label",ds(this._labels.remove,{name:e.name}));const d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.dataset.icon="x",d.dataset.iconSize="16",d.textContent="×",h.appendChild(d),h.addEventListener("click",()=>{const n=t.nextElementSibling||t.previousElementSibling;this.removeFile(e.id),(n?.querySelector(".dm-dropzone-remove")||this.zone).focus()}),t.append(n,s,a,c,h),e._row=t,e._ui={status:r,bar:a,barFill:l,retry:c,remove:h},this._list.appendChild(t),this._list.hidden=!1,d.isConnected&&"undefined"!=typeof window&&window.Domma?.icons&&(d.textContent="",Ke(h)),this._paintEntry(e)}_paintEntry(e){const t=e._ui;if(!t)return;e._row.dataset.status=e.status;const n=this._labels,s={queued:"",uploading:ds(n.uploading,{percent:e.progress}),done:n.done,error:e.error?.message?`${n.failed}: ${e.error.message}`:n.failed,cancelled:n.cancelled}[e.status]||"";t.status.textContent=s,t.bar.hidden="uploading"!==e.status&&"done"!==e.status,t.bar.setAttribute("aria-valuenow",String(e.progress)),t.barFill.style.width=`${e.progress}%`,t.retry.hidden=!this.options.upload||!["error","cancelled"].includes(e.status),t.remove.setAttribute("aria-label",ds("uploading"===e.status?n.cancel:n.remove,{name:e.name}))}upload(){if(!this.options.upload||!this._entries)return this;for(const e of this._entries)["queued","error","cancelled"].includes(e.status)&&!this._queue.includes(e)&&(e.status="queued",e.error=null,e.attempts=0,this._queue.push(e),this._paintEntry(e));return this._queue.length&&(this._batch=!0),this._pump(),this}retry(e){if(void 0===e)return this.upload();const t=this._entryFor(e);return t&&this.options.upload&&["error","cancelled"].includes(t.status)?(t.status="queued",t.error=null,t.attempts=0,this._queue.push(t),this._batch=!0,this._paintEntry(t),this._pump(),this):this}cancel(e){const t=void 0===e?this._entries.slice():[this._entryFor(e)].filter(Boolean);for(const e of t)"uploading"===e.status?this._abort(e):this._queue.includes(e)&&(this._queue=this._queue.filter(t=>t!==e),e.status="cancelled",this._paintEntry(e));return this._pump(),this}_abort(e){const t=e._xhr;if(t){e._xhr=null,e._aborted=!0;try{t.abort()}catch{}e.status="cancelled",this._active=Math.max(0,this._active-1),this._paintEntry(e)}}_pump(){const e=this.options.upload||{},t=Math.max(1,qe(e.concurrency,2));for(;this._active<t&&this._queue.length;)this._send(this._queue.shift());this._maybeComplete()}_maybeComplete(){!this._batch||this._active||this._queue.length||(this._batch=!1,this._fire("complete",this.getEntries()))}_send(e){const t=this.options.upload,n=t=>"function"==typeof t?t(e):t,s=n(t.url),i="function"==typeof t.xhr?t.xhr(e):new XMLHttpRequest;e._xhr=i,e._aborted=!1,e.status="uploading",e.progress=0,e.attempts+=1,this._active++,this._paintEntry(e),this._fire("uploadstart",e);const o=()=>e._xhr===i&&(e._xhr=null,this._active=Math.max(0,this._active-1),!0),r=t=>{e.attempts<=qe(this.options.retry,0)?(e.status="queued",this._queue.push(e)):(e.status="error",e.error=t,this._fire("error",e,t)),this._paintEntry(e),this._pump()};i.upload?.addEventListener?.("progress",t=>{if(e._xhr!==i||!t.lengthComputable||!t.total)return;const n=Math.min(100,Math.round(t.loaded/t.total*100));n!==e.progress&&(e.progress=n,this._paintEntry(e),this._fire("progress",e,n))}),i.addEventListener("load",()=>{if(!o())return;let t=i.responseText;try{t=JSON.parse(i.responseText)}catch{}i.status>=200&&i.status<300?(e.status="done",e.progress=100,e.response=t,this._paintEntry(e),this._fire("success",e,t),this._pump()):r({status:i.status,message:i.statusText||`HTTP ${i.status}`,response:t})}),i.addEventListener("error",()=>{o()&&r({status:0,message:"Network error",response:null})}),i.addEventListener("abort",()=>{!e._aborted&&o()&&(e.status="cancelled",this._paintEntry(e),this._pump())});try{i.open(String(t.method||"POST").toUpperCase(),s,!0),t.withCredentials&&(i.withCredentials=!0);const o=n(t.headers)||{};for(const[e,t]of Object.entries(o))null!=t&&i.setRequestHeader(e,String(t));const r=new FormData,a=n(t.data)||{};for(const[e,t]of Object.entries(a))null!=t&&r.append(e,t);r.append(t.field||"file",e.file,e.name),i.send(r)}catch(e){o()&&r({status:0,message:e?.message||"Upload failed",response:null})}}isDisabled(){return Ve(this.options.disabled)}enable(){return this.setOptions({disabled:!1})}disable(){return this.setOptions({disabled:!0})}_applyOptions(){if(!this._entries)return;this._labels={...ls,...this.options.labels||{}};const e=this.options;this.input.multiple=Ve(e.multiple,!0);const t=hs(e.accept).join(",");t?this.input.setAttribute("accept",t):this.input.removeAttribute("accept"),e.name&&(this.input.name=e.name),this._applyDisabled(),this._entries.forEach(e=>this._paintEntry(e))}destroy(){if(!this.element||!this._entries)return super.destroy();(this._timers||[]).forEach(clearTimeout);for(const e of this._entries)this._abort(e),e.preview&&URL.revokeObjectURL(e.preview);this._entries=null,this._queue=[],this._guarded&&(ps.zones<=0||0===--ps.zones&&(document.removeEventListener("dragenter",gs),vs()),this._guarded=!1);const e=this.zone;e.classList.remove(...this._zoneClasses,"is-dragover","is-disabled","is-invalid");for(const[t,n]of Object.entries(this._restoreZone))null===n?e.removeAttribute(t):e.setAttribute(t,n);if(this._restoreInput){const e=this.input;e.hidden=this._restoreInput.hidden,e.multiple=this._restoreInput.multiple,e.disabled=this._restoreInput.disabled,null===this._restoreInput.tabindex?e.removeAttribute("tabindex"):e.setAttribute("tabindex",this._restoreInput.tabindex),null===this._restoreInput.name?e.removeAttribute("name"):e.setAttribute("name",this._restoreInput.name),null===this._restoreInput.accept?e.removeAttribute("accept"):e.setAttribute("accept",this._restoreInput.accept)}for(const e of this._added)e.remove();this._added=[],super.destroy(),this._onDestroy?.()}}const ys=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"];function ks(e){const t=String(e);if(t.includes("e-"))return Number(t.split("e-")[1])||0;const n=t.indexOf(".");return-1===n?0:t.length-n-1}const ws=(()=>{let e=null;return t=>(null===e&&(e="undefined"!=typeof HTMLInputElement&&Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")||void 0),e?e.get.call(t):t.value)})();class xs extends C{static componentName="range-slider";static defaults={min:0,max:100,step:1,value:null,range:!1,orientation:"horizontal",ticks:!1,tickLabels:!1,labels:null,tooltip:"hover",marks:null,disabled:!1,name:null,names:null,minDistance:0,rtl:null,ariaLabel:null,ariaLabels:null,className:"",onInput:null,onChange:null,onBeforeChange:null};constructor(e,t={}){super(e,xs.fromInput(e,t)),this.element&&(this._isInput="INPUT"===this.element.tagName,this._made=[],this._hooked=[],this._dispatching=!1,this._drag=null,this._timers=[],this._setupInputs(),this._values=this._initialValues(),this._render(),this._writeInputs(),this._setDefaults(),this._bindInputs())}static fromInput(e,t={}){const n={...t};if(!e||"INPUT"!==e.tagName)return n;const s=t=>e.getAttribute(t);return void 0===n.min&&null!==s("min")&&(n.min=qe(s("min"),0)),void 0===n.max&&null!==s("max")&&(n.max=qe(s("max"),100)),void 0===n.step&&null!==s("step")&&(n.step="any"===s("step")?"any":qe(s("step"),1)),void 0!==n.value||null===s("value")||n.range||(n.value=qe(s("value"),null)),void 0===n.name&&e.name&&(n.name=e.name),void 0===n.disabled&&e.disabled&&(n.disabled=!0),n}get _min(){return qe(this.options.min,0)}get _max(){const e=qe(this.options.max,100);return e>this._min?e:this._min+1}get _step(){if("any"===this.options.step)return null;const e=qe(this.options.step,1);return e>0?e:1}get _keyStep(){return this._step??(this._max-this._min)/100}_snap(e){const t=this._min,n=this._max;let s=qe(e,t);const i=this._step;if(i){s=t+Math.round((s-t)/i)*i;const e=t+Math.floor((n-t)/i+1e-9)*i;s=Math.min(s,e),s=Number(s.toFixed(Math.max(ks(i),ks(t))))}return Math.min(Math.max(s,t),n)}get _minDistance(){return this.options.range?Math.max(0,qe(this.options.minDistance,0)):0}_normalise(e){if(!this.options.range){const t=Array.isArray(e)?e[0]:e;return[this._snap(t)]}let t=e;"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t,this._values?this._values[1]:this._max]);let n=this._snap(t[0]??this._min),s=this._snap(t[1]??this._max);n>s&&([n,s]=[s,n]);const i=this._minDistance;return s-n<i&&(s=this._snap(n+i),s-n<i&&(n=this._snap(s-i))),[n,s]}_initialValues(){const e=this.options;if(null!==e.value&&void 0!==e.value&&""!==e.value)return this._normalise(e.value);if(e.range){const e=this._inputs[0].getAttribute("value"),t=this._inputs[1].getAttribute("value");return this._normalise([null!==e?e:this._min,null!==t?t:this._max])}return this._normalise(this._min+(this._max-this._min)/2)}_format(e,t){const n=this.options.labels||this.options.format;if("function"==typeof n)try{const s=n(e,t);if(null!=s)return String(s)}catch{}return String(e)}_pct(e){return(e-this._min)/(this._max-this._min)*100}get _vertical(){return"vertical"===this.options.orientation}get _rtl(){if(null!==this.options.rtl&&void 0!==this.options.rtl)return Ve(this.options.rtl);try{return"function"==typeof getComputedStyle&&"rtl"===getComputedStyle(this.element).direction}catch{return!1}}_setupInputs(){const e=this.options,t=e=>{const t=document.createElement("input");return t.type="range",e?e.after(t):this.element.appendChild(t),this._made.push(t),t},n=this._isInput?this.element:t(null);if(this._inputs=[n],e.range&&this._inputs.push(t(n)),this._isInput){const e=this.element;this._restore={name:e.getAttribute("name"),hidden:e.hidden,tabindex:e.getAttribute("tabindex"),ariaHidden:e.getAttribute("aria-hidden"),min:e.getAttribute("min"),max:e.getAttribute("max"),step:e.getAttribute("step"),disabled:e.getAttribute("disabled"),value:e.getAttribute("value")}}const s=Array.isArray(e.names)?e.names:[];this._inputs.forEach((t,n)=>{const i=s[n]||(t.name?null:e.name);i&&(t.name=i),t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true")}),this._syncInputAttrs(),this._hookValues()}_syncInputAttrs(){for(const e of this._inputs)e.min=String(this._min),e.max=String(this._max),e.step=this._step?String(this._step):"any",e.disabled=Ve(this.options.disabled)}_hookValues(){const e="undefined"!=typeof HTMLInputElement?HTMLInputElement.prototype:null,t=e&&Object.getOwnPropertyDescriptor(e,"value");if(!t||!t.set)return;const n=this;this._inputs.forEach((e,s)=>{try{Object.defineProperty(e,"value",{configurable:!0,enumerable:!0,get(){return t.get.call(this)},set(e){t.set.call(this,e),n._writing||n._fromInputs(s)}}),this._hooked.push(e)}catch{}})}_writeInputs(){this._writing=!0;try{this._inputs.forEach((e,t)=>{e.value=String(this._values[t])})}finally{this._writing=!1}}_setDefaults(){this._inputs.forEach((e,t)=>{e.hasAttribute("value")||e.setAttribute("value",String(this._values[t]))})}_fromInputs(){if(!this._inputs)return;const e=this._inputs.map(e=>Number(ws(e))),t=this._normalise(this.options.range?e:e[0]);this._values=t,this._writeInputs(),this._paint()}_bindInputs(){for(const e of this._inputs){const t=()=>{this._dispatching||this._fromInputs()};this._addEventListener(e,"input",t),this._addEventListener(e,"change",t)}const e=this._inputs[0].form;e&&this._addEventListener(e,"reset",()=>{this._timers.push(setTimeout(()=>{this._inputs&&this._fromInputs()},0))});const t=this._inputs[0].labels?Array.from(this._inputs[0].labels):[];for(const e of t)this._addEventListener(e,"click",e=>{this._thumbs?.[0]?.contains(e.target)||(e.preventDefault(),Ve(this.options.disabled)||this._thumbs[0].focus())});this._labels=t}_labelText(){if(this.options.ariaLabel)return String(this.options.ariaLabel);const e=this._labels?.[0]||this._inputs[0].labels&&this._inputs[0].labels[0];return e?e.textContent.replace(/\s+/g," ").trim():this.element.getAttribute("aria-label")||""}_render(){this._root&&(this._unbindRoot(),this._root.remove());const e=this.options,t=document.createElement("div");t.className="dm-range-slider"+(e.className?" "+e.className:""),t.dataset.orientation=this._vertical?"vertical":"horizontal",t.dataset.tooltipMode=["always","never"].includes(e.tooltip)?e.tooltip:"hover",e.range&&t.classList.add("is-range"),this._rtl&&t.setAttribute("dir","rtl");const n=document.createElement("div");n.className="dm-range-track";const s=document.createElement("div");s.className="dm-range-fill",n.appendChild(s),t.appendChild(n),this._ticksEl=this._renderTicks(t),this._marksEl=this._renderMarks(t);const i=this._labelText(),o=Array.isArray(e.ariaLabels)?e.ariaLabels:[];this._thumbs=this._values.map((n,s)=>{const r=document.createElement("div");r.className="dm-range-thumb",r.id=Ge("dm-range-thumb"),r.setAttribute("role","slider"),r.dataset.index=String(s),this._vertical&&r.setAttribute("aria-orientation","vertical");let a=o[s];if(!a&&e.range&&(a=[i,0===s?"minimum":"maximum"].filter(Boolean).join(" ")),a||(a=i),a&&r.setAttribute("aria-label",a),"never"!==t.dataset.tooltipMode){const e=document.createElement("span");e.className="dm-range-tooltip",e.setAttribute("aria-hidden","true"),r.appendChild(e)}return t.appendChild(r),r}),this._fillEl=s,this._track=n,this._root=t;const r=this._inputs[this._inputs.length-1];this._isInput?r.after(t):this.element.appendChild(t),this._bindRoot(),this._applyDisabled(),this._paint()}_tickValues(){const e=this.options.ticks;if(!e)return[];const t=this._min,n=this._max;if(Array.isArray(e))return e.map(Number).filter(e=>Number.isFinite(e)&&e>=t&&e<=n);let s=!0===e||"true"===e?this._keyStep:qe(e,0);if(!(s>0))return[];const i=Math.floor((n-t)/s+1e-9);i>100&&(s*=Math.ceil(i/100));const o=[],r=Math.max(ks(s),ks(t));for(let e=t;e<=n+1e-9;e+=s)o.push(Number(e.toFixed(r)));return o[o.length-1]!==n&&o.push(n),o}_place(e,t){this._vertical?e.style.bottom=`${t}%`:e.style[this._rtl?"right":"left"]=`${t}%`}_renderTicks(e){const t=this._tickValues();if(!t.length)return null;const n=Array.isArray(this.options.ticks)||Ve(this.options.tickLabels),s=document.createElement("div");s.className="dm-range-ticks",s.setAttribute("aria-hidden","true");for(const e of t){const t=document.createElement("span");if(t.className="dm-range-tick",t.dataset.value=String(e),this._place(t,this._pct(e)),n){const n=document.createElement("span");n.className="dm-range-tick-label",n.textContent=this._format(e,"tick"),t.appendChild(n)}s.appendChild(t)}return n&&e.classList.add("has-tick-labels"),e.appendChild(s),s}_renderMarks(e){const t=(Array.isArray(this.options.marks)?this.options.marks:[]).map(e=>e&&"object"==typeof e?e:{value:e}).filter(e=>Number.isFinite(Number(e.value))&&Number(e.value)>=this._min&&Number(e.value)<=this._max);if(!t.length)return null;const n=document.createElement("div");n.className="dm-range-marks",n.setAttribute("aria-hidden","true");for(const e of t){const t=this._snap(e.value),s=document.createElement("span");s.className="dm-range-mark",s.dataset.value=String(t),this._place(s,this._pct(t));const i=document.createElement("span");i.className="dm-range-mark-label",i.textContent=void 0!==e.label&&null!==e.label?String(e.label):this._format(t,"mark"),s.appendChild(i),n.appendChild(s)}return e.classList.add("has-marks"),e.appendChild(n),n}_paint(){if(!this._root)return;const e=this._values,t=e.map(e=>this._pct(e)),n=this._vertical?"bottom":this._rtl?"right":"left",s=this._vertical?"height":"width",i=this._fillEl;i.style.left=i.style.right=i.style.bottom="";const[o,r]=this.options.range?t:[0,t[0]];i.style[n]=`${o}%`,i.style[s]=r-o+"%";const a=this._minDistance;this._thumbs.forEach((s,i)=>{s.style.left=s.style.right=s.style.bottom="",s.style[n]=`${t[i]}%`;const o=e[i];let r=this._min,l=this._max;this.options.range&&(0===i?l=this._snap(e[1]-a):r=this._snap(e[0]+a)),s.setAttribute("aria-valuemin",String(r)),s.setAttribute("aria-valuemax",String(l)),s.setAttribute("aria-valuenow",String(o)),this.options.labels||this.options.format?s.setAttribute("aria-valuetext",this._format(o,"aria")):s.removeAttribute("aria-valuetext");const c=s.querySelector(".dm-range-tooltip");c&&(c.textContent=this._format(o,"tooltip"))});for(const t of this._ticksEl?this._ticksEl.children:[]){const n=Number(t.dataset.value);t.classList.toggle("is-in-range",this.options.range?n>=e[0]&&n<=e[1]:n<=e[0])}}_applyDisabled(){const e=Ve(this.options.disabled);this._root.classList.toggle("is-disabled",e);for(const t of this._thumbs)t.tabIndex=e?-1:0,e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled");for(const t of this._inputs)t.disabled=e}_bindRoot(){const e=this._root;this._rootHandlers=[[e,"pointerdown",e=>this._onPointerDown(e)],[e,"pointermove",e=>this._onPointerMove(e)],[e,"pointerup",e=>this._onPointerUp(e)],[e,"pointercancel",e=>this._onPointerUp(e,!0)],[e,"lostpointercapture",e=>this._onPointerUp(e)],[e,"keydown",e=>this._onKeyDown(e)]];for(const[e,t,n]of this._rootHandlers)e.addEventListener(t,n)}_unbindRoot(){for(const[e,t,n]of this._rootHandlers||[])e.removeEventListener(t,n);this._rootHandlers=[]}_valueAt(e){const t=this._track.getBoundingClientRect();let n;return this._vertical?n=t.height?(t.bottom-e.clientY)/t.height:0:(n=t.width?(e.clientX-t.left)/t.width:0,this._rtl&&(n=1-n)),n=Math.min(Math.max(n,0),1),this._snap(this._min+n*(this._max-this._min))}_pickThumb(e,t){const n=e.target?.closest?.(".dm-range-thumb");if(n&&this._root.contains(n))return Number(n.dataset.index);if(!this.options.range)return 0;const[s,i]=this._values,o=Math.abs(t-s),r=Math.abs(t-i);return o===r?t<s?0:1:o<r?0:1}_onPointerDown(e){if(Ve(this.options.disabled))return;if(void 0!==e.button&&0!==e.button)return;const t=e.target?.closest?.(".dm-range-mark"),n=t?Number(t.dataset.value):this._valueAt(e),s=this._pickThumb(e,n),i=this._thumbs[s];e.preventDefault(),i.focus({preventScroll:!0});try{this._root.setPointerCapture(e.pointerId)}catch{}this._drag={index:s,pointerId:e.pointerId,start:this._values.slice()},this._root.classList.add("is-dragging"),i.classList.add("is-active"),e.target?.closest?.(".dm-range-thumb")||this._propose(s,n)}_onPointerMove(e){!this._drag||void 0!==e.pointerId&&e.pointerId!==this._drag.pointerId||this._propose(this._drag.index,this._valueAt(e))}_onPointerUp(e,t=!1){const n=this._drag;if(n&&(void 0===e.pointerId||void 0===n.pointerId||e.pointerId===n.pointerId)){this._drag=null,this._root.classList.remove("is-dragging"),this._thumbs[n.index]?.classList.remove("is-active");try{this._root.releasePointerCapture?.(n.pointerId)}catch{}t?this._same(n.start)||this._apply(n.start,n.index,"input"):this._same(n.start)||this._commit(n.index)}}_onKeyDown(e){const t=e.target?.closest?.(".dm-range-thumb");if(!t||!ys.includes(e.key)||Ve(this.options.disabled))return;e.preventDefault();const n=Number(t.dataset.index),s=this._values[n],i=this._keyStep,o=this._rtl&&!this._vertical?-1:1;let r=s;switch(e.key){case"ArrowRight":r=s+i*o;break;case"ArrowLeft":r=s-i*o;break;case"ArrowUp":r=s+i;break;case"ArrowDown":r=s-i;break;case"PageUp":r=s+10*i;break;case"PageDown":r=s-10*i;break;case"Home":r=this._min;break;case"End":r=this._max}this._propose(n,r)&&this._commit(n)}_same(e){return e.length===this._values.length&&e.every((e,t)=>e===this._values[t])}_shape(e){return this.options.range?e.slice():e[0]}_propose(e,t){let n=this._snap(t);if(this.options.range){const t=this._minDistance;n=0===e?Math.min(n,this._snap(this._values[1]-t)):Math.max(n,this._snap(this._values[0]+t)),0===e&&n>this._values[1]&&(n=this._values[1]),1===e&&n<this._values[0]&&(n=this._values[0])}if(n===this._values[e])return!1;const s=this._values.slice();return s[e]=n,!1!==this._fire("beforechange",this._shape(s),this._shape(this._values))&&(this._apply(s,e,"input"),!0)}_apply(e,t,n){this._values=e,this._writeInputs(),this._paint(),this._dispatch(this._inputs[t]||this._inputs[0],"input"),"input"===n&&this._fire("input",this.getValue())}_commit(e){this._dispatch(this._inputs[e]||this._inputs[0],"change"),this._fire("change",this.getValue())}_dispatch(e,t){this._dispatching=!0;try{e.dispatchEvent(new Event(t,{bubbles:!0}))}finally{this._dispatching=!1}}getValue(){return this._shape(this._values||[])}setValue(e,t={}){if(!this._values)return this;const n=this._normalise(e);if(this._same(n))return this;if(!t.silent&&!1===this._fire("beforechange",this._shape(n),this.getValue()))return this;const s=n.findIndex((e,t)=>e!==this._values[t]);return t.silent?(this._values=n,this._writeInputs(),this._paint(),this):(this._apply(n,s,"input"),this._commit(s),this)}setRange(e,t){if(!this._values)return this;this.options.min=qe(e,this._min),this.options.max=qe(t,this._max),this._syncInputAttrs();const n=this._values.slice();return this._values=this._normalise(this.options.range?n:n[0]),this._writeInputs(),this._render(),this._same(n)||(this._apply(this._values,0,"input"),this._commit(0)),this}enable(){return this.setOptions({disabled:!1})}disable(){return this.setOptions({disabled:!0})}isDisabled(){return Ve(this.options.disabled)}_applyOptions(){this._values&&(this.options.range=2===this._inputs.length,this._syncInputAttrs(),this._values=this._normalise(this.options.range?this._values:this._values[0]),this._writeInputs(),this._render())}destroy(){if(!this.element)return super.destroy();this._timers.forEach(clearTimeout),this._timers=[],this._unbindRoot(),this._root?.remove(),this._root=null;for(const e of this._hooked)delete e.value;this._hooked=[];for(const e of this._made)e.remove();if(this._made=[],this._isInput&&this._restore){const e=this.element;e.hidden=this._restore.hidden,null===this._restore.name?e.removeAttribute("name"):e.setAttribute("name",this._restore.name),null===this._restore.tabindex?e.removeAttribute("tabindex"):e.setAttribute("tabindex",this._restore.tabindex);for(const t of["aria-hidden","min","max","step","disabled","value"]){const n=this._restore["aria-hidden"===t?"ariaHidden":t];null===n?e.removeAttribute(t):e.setAttribute(t,n)}}this._inputs=null,this._values=null,this._thumbs=[],super.destroy(),this._onDestroy?.()}}const Ms="undefined"==typeof HTMLElement?class{}:HTMLElement;class Ls extends Ms{static defaults={};static get observedAttributes(){return[]}constructor(){super(),this._eventHandlers=[],this._options={},this._initialised=!1,this.attachShadow({mode:"open"})}connectedCallback(){this._initialised||(this._options={...this._mergeOptions(),...this._options},this._onBeforeMount?.(),this._injectStyles(),this._render(),this._bindEvents(),this._initialised=!0),this._onConnect?.()}disconnectedCallback(){this._onBeforeUnmount?.(),this._cleanup(),this._onDisconnect?.()}attributeChangedCallback(e,t,n){t!==n&&this._initialised&&(this._options[this._attrToOption(e)]=this._parseAttrValue(n),this._onAttributeChange?.(e,t,n))}_onBeforeMount(){}_onUpdated(){}_onBeforeUnmount(){}_mergeOptions(){const e={...this.constructor.defaults};for(const t of this.attributes){e[this._attrToOption(t.name)]=this._parseAttrValue(t.value)}return e}_attrToOption(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_parseAttrValue(e){if(""===e||"true"===e)return!0;if("false"===e)return!1;if(!isNaN(e)&&""!==e)return Number(e);try{return JSON.parse(e)}catch{return e}}_injectStyles(){const e=document.createElement("style");e.textContent=this._getStyles(),this.shadowRoot.appendChild(e)}_getStyles(){return this.constructor.styles||""}_render(){}_bindEvents(){}_addEventListener(e,t,n,s){e.addEventListener(t,n,s),this._eventHandlers.push({element:e,event:t,handler:n,options:s})}_cleanup(){for(const{element:e,event:t,handler:n,options:s}of this._eventHandlers)e.removeEventListener(t,n,s);this._eventHandlers=[]}_emit(e,t={}){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}setOptions(e){return this._options={...this._options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}destroy(){this._cleanup(),this.remove()}}const Cs=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),As={"domma-badge":{make:(e,t)=>new Cn(e,t),attrs:["variant","size","pill","outline","removable","pulse"],methods:["setVariant","setSize","setText"]},"domma-number-badge":{make:(e,t)=>new En(e,t),attrs:["count","max","variant","dot","pulse","border-color","label"],numbers:["count","max"],methods:["setCount","increment","decrement","getCount","setDot","setVariant","setPulse"]},"domma-tooltip":{make:(e,t)=>new xn(e,t),attrs:["content","position","placement","trigger","delay","hide-delay","animation","offset","html","visible","max-width"],numbers:["delay","hideDelay","offset"],methods:["show","hide","toggle","isVisible","setContent","setPosition"]},"domma-loader":{make:(e,t)=>new Tn(e,t),attrs:["type","size","color","overlay","text","centered","visible"],methods:["show","hide","toggle","isVisible","setText","setType","setSize","setColor"],visible:!0},"domma-back-to-top":{make:(e,t)=>new Bn(e,t),attrs:["show-after","duration","position","offset","target","z-index","label"],numbers:["showAfter","duration","offset","zIndex"],methods:["scroll","show","hide","toggle","isVisible","getButton","setShowAfter","setPosition","setOffset"]},"domma-card":{make:(e,t)=>new rn(e,t),attrs:["hoverable","shadow","rounded","animation","animation-duration","collapsible","collapsed","persist-key","title","icon"],numbers:["animationDuration"],methods:["collapse","expand","toggle","isCollapsed","setShadow","setHoverable","setContent","getBody","updateHeight"]},"domma-modal":{make:(e,t)=>new pn(e,t),attrs:["backdrop","backdrop-close","keyboard","animation","animation-duration","close-button","size","centered","scrollable","title","footer","visible"],numbers:["animationDuration"],methods:["open","close","toggle","isOpen","setTitle","setContent","setButtons"]}},Es=Object.keys(As),Ss=Es.join(",");function $s(e,t,n){if(null!==n)return""===n||"true"===n||"false"!==n&&((e.numbers||[]).includes(t)&&""!==n.trim()&&!isNaN(n)?Number(n):n)}function zs(e){const t="undefined"==typeof HTMLElement?class{}:HTMLElement;class n extends t{static get observedAttributes(){return e.attrs}connectedCallback(){this.dommaInstance||(this.dommaInstance=e.make(this,function(e,t){const n={};for(const s of t.attrs)e.hasAttribute(s)&&(n[Cs(s)]=$s(t,Cs(s),e.getAttribute(s)));return n}(this,e)))}attributeChangedCallback(t,n,s){if(!this.dommaInstance||n===s)return;const i=Cs(t);this.dommaInstance.setOptions({[i]:$s(e,i,s)})}get instance(){return this.dommaInstance}setOptions(e){return this.dommaInstance?.setOptions(e),this}destroy(){this.dommaInstance?.destroy(),this.dommaInstance=null}}for(const t of e.methods)n.prototype[t]=function(...e){const n=this.dommaInstance;if(!n)return;const s=n[t](...e);return s===n?this:s};return n}let Ts=!1,Bs=null;function js(){if(!Ts&&"undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement){Ts=!0,Bs?.disconnect(),Bs=null;for(const[e,t]of Object.entries(As))customElements.get(e)||customElements.define(e,zs(t))}}if("undefined"!=typeof document&&"undefined"!=typeof customElements){const e=()=>{!function(e=("undefined"!=typeof document?document:null)){!Ts&&e&&"function"==typeof e.querySelector&&e.querySelector(Ss)&&js()}(),!Ts&&"undefined"!=typeof MutationObserver&&document.documentElement&&(Bs=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)if(1===e.nodeType&&(Es.includes(e.localName)||e.querySelector?.(Ss)))return void js()}),Bs.observe(document.documentElement,{childList:!0,subtree:!0}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}function Os(e){if(!e.length)return null;const t=e[0],n=e.slice();return Object.defineProperty(t,"all",{value:()=>n.slice(),configurable:!0,writable:!0}),t}class Ds extends C{static componentName="tabs";static defaults={active:0,animation:"fade",animationDuration:200,tabSelector:".tab-item, [data-tab]",panelSelector:".tab-panel, [data-panel]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._activeIndex=this.options.active,this._init()}_init(){if(!this.element)return;const e=this.options;this._tabs=this.element.querySelectorAll(e.tabSelector),this._panels=this.element.querySelectorAll(e.panelSelector);const t=this.element.querySelector(".tabs-list, .tab-list, .nav-tabs, [data-tab-list]")||this.element;t.hasAttribute("role")||t.setAttribute("role","tablist"),this._tabs.forEach((e,t)=>{e.hasAttribute("role")||e.setAttribute("role","tab");const n=this._panels[t];n&&(n.hasAttribute("role")||n.setAttribute("role","tabpanel"),e.id||(e.id="dm-tab-"+Math.random().toString(36).substring(2,9)),n.id||(n.id="dm-panel-"+Math.random().toString(36).substring(2,9)),e.hasAttribute("aria-controls")||e.setAttribute("aria-controls",n.id),n.hasAttribute("aria-labelledby")||n.setAttribute("aria-labelledby",e.id)),this._addEventListener(e,"click",e=>{e.preventDefault(),this.activate(t)})}),this._updateState()}activate(e){if("string"==typeof e){const t=Array.from(this._tabs).findIndex(t=>t.dataset?.tab===e||t.getAttribute("data-tab")===e||t.getAttribute("href")===e||t.getAttribute("href")===`#${e}`);e=-1!==t?t:Number(e)}if(e===this._activeIndex)return this;if(e<0||e>=this._tabs.length)return this;this.options;const t=this._activeIndex;return this._activeIndex=e,this._updateState(),this._fire("change",{index:e,oldIndex:t,tab:this._tabs[e],panel:this._panels[e]}),this}_updateState(){const e=this.options;this._tabs.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-selected",s?"true":"false"),t.setAttribute("tabindex",s?"0":"-1"),s?t.classList.add(e.activeClass):t.classList.remove(e.activeClass)}),this._panels.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-hidden",s?"false":"true"),s?(t.style.display="block","fade"===e.animation&&(t.style.opacity="0",t.style.transition=`opacity ${e.animationDuration}ms ease`,t.offsetHeight,t.style.opacity="1")):t.style.display="none"})}getActive(){return this._activeIndex}show(e){return this.activate(e)}next(){const e=(this._activeIndex+1)%this._tabs.length;return this.activate(e)}prev(){const e=(this._activeIndex-1+this._tabs.length)%this._tabs.length;return this.activate(e)}}class Ns extends C{static componentName="accordion";static defaults={allowMultiple:!1,multiExpand:null,activeIndex:null,animation:!0,animationDuration:300,headerSelector:".accordion-header, [data-accordion-header]",contentSelector:".accordion-body, .accordion-content, [data-accordion-content]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),null!==this.options.multiExpand&&(this.options.allowMultiple=this.options.multiExpand),this._init()}_init(){if(!this.element)return;const e=this.options;this._headers=this.element.querySelectorAll(e.headerSelector);const t=[...this.element.querySelectorAll(e.contentSelector)];this._contents=t.filter(e=>!t.some(t=>t!==e&&t.contains(e))),this._contents.forEach((t,n)=>{const s=this._headers[n];s&&(s.hasAttribute("role")||"BUTTON"===s.tagName||s.setAttribute("role","button"),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.id||(s.id="dm-accordion-hdr-"+Math.random().toString(36).substring(2,9)),t.id||(t.id="dm-accordion-body-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-controls")||s.setAttribute("aria-controls",t.id),t.hasAttribute("aria-labelledby")||t.setAttribute("aria-labelledby",s.id),t.hasAttribute("role")||t.setAttribute("role","region")),t.style.overflow="hidden",t.style.transition=e.animation?`height ${e.animationDuration}ms ease`:"none";const i=s?.parentElement;let o=i?.classList.contains(e.activeClass);null!==e.activeIndex&&(o=Array.isArray(e.activeIndex)?e.activeIndex.includes(n):e.activeIndex===n,o?i?.classList.add(e.activeClass):i?.classList.remove(e.activeClass)),s&&s.setAttribute("aria-expanded",o?"true":"false"),t.setAttribute("aria-hidden",o?"false":"true"),t.style.height=o?"auto":"0"}),this._headers.forEach((e,t)=>{this._addEventListener(e,"click",()=>{this.toggle(t)}),this._addEventListener(e,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle(t))})})}toggle(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement,o=i?.classList.contains(t.activeClass);return t.allowMultiple||this._headers.forEach((t,n)=>{n!==e&&this._close(n)}),o?this._close(e):this._open(e),this._fire("change",{index:e,isOpen:!o,header:n,content:s}),this}_open(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement;n&&n.setAttribute("aria-expanded","true"),s&&s.setAttribute("aria-hidden","false"),i?.classList.add(t.activeClass),s.style.height=s.scrollHeight+"px",setTimeout(()=>{s.style.height="auto"},t.animationDuration)}_close(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement;n&&n.setAttribute("aria-expanded","false"),s&&s.setAttribute("aria-hidden","true"),i?.classList.remove(t.activeClass),s.style.height=s.scrollHeight+"px",s.offsetHeight,s.style.height="0"}open(e){return e>=0&&e<this._headers.length&&this._open(e),this}close(e){return e>=0&&e<this._headers.length&&this._close(e),this}openAll(){return this._headers.forEach((e,t)=>this._open(t)),this}closeAll(){return this._headers.forEach((e,t)=>this._close(t)),this}}class Is extends C{static componentName="list-group";static defaults={selectable:!1,multiSelect:!1,activeClass:"active",disabledClass:"disabled",itemSelector:".list-group-item",keyboard:!0,loop:!0,focusOnInit:!1,onChange:null,onSelect:null,onDeselect:null};constructor(e,t={}){super(e,t),this._items=[],this._focusedIndex=-1,this._init()}_init(){if(this.element&&(this.refresh(),this.options.selectable&&(this.element.setAttribute("role","listbox"),this.options.multiSelect&&this.element.setAttribute("aria-multiselectable","true")),this._addEventListener(this.element,"click",e=>{if(!this.options.selectable)return;const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;if(t.classList.contains(this.options.disabledClass))return;const n=this._items.indexOf(t);-1!==n&&this._handleItemClick(n,e)}),this._addEventListener(this.element,"focusin",e=>{const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;const n=this._items.indexOf(t);-1!==n&&(this._focusedIndex=n)}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)&&e.setAttribute("aria-disabled","true")}),this.options.keyboard&&this._setupKeyboard(),this._initTabindex(),this.options.focusOnInit&&this._items.length>0)){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));-1!==e&&this._moveFocus(e)}}_initTabindex(){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));this._items.forEach((t,n)=>{t.setAttribute("tabindex",n===e?"0":"-1")}),-1!==e&&(this._focusedIndex=e)}_setupKeyboard(){this._addEventListener(this.element,"keydown",e=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,1));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,-1));break;case"Home":e.preventDefault(),this._moveFocus(this._firstEnabledIndex());break;case"End":e.preventDefault(),this._moveFocus(this._lastEnabledIndex());break;case"Enter":case" ":if(e.preventDefault(),this.options.selectable&&-1!==this._focusedIndex){const t=this._items[this._focusedIndex];t&&!t.classList.contains(this.options.disabledClass)&&this._handleItemClick(this._focusedIndex,e)}}})}_nextEnabledIndex(e,t){const n=this._items.length;if(0===n)return-1;let s=e,i=0;do{if(s+=t,this.options.loop)s=(s%n+n)%n;else{if(s<0)return this._firstEnabledIndex();if(s>=n)return this._lastEnabledIndex()}if(i++,i>n)return-1}while(this._items[s].classList.contains(this.options.disabledClass));return s}_firstEnabledIndex(){return this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass))}_lastEnabledIndex(){for(let e=this._items.length-1;e>=0;e--)if(!this._items[e].classList.contains(this.options.disabledClass))return e;return-1}_moveFocus(e){-1===e||e>=this._items.length||(-1!==this._focusedIndex&&this._items[this._focusedIndex]&&this._items[this._focusedIndex].setAttribute("tabindex","-1"),this._items[e].setAttribute("tabindex","0"),this._items[e].focus({preventScroll:!0}),this._focusedIndex=e)}_handleItemClick(e,t){const n=this._items[e],s=n.classList.contains(this.options.activeClass);if(this.options.multiSelect)s?(n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this._fire("deselect",n,e,t)):(n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this._fire("select",n,e,t));else{if(this._items.filter((t,n)=>n!==e&&t.classList.contains(this.options.activeClass)).forEach(e=>{e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false");const n=this._items.indexOf(e);this._fire("deselect",e,n,t)}),s)return n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this._fire("deselect",n,e,t),void this._fire("change",this.getSelected(),t);n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this._fire("select",n,e,t)}this._fire("change",this.getSelected(),t)}_updateAriaSelected(){this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",String(e.classList.contains(this.options.activeClass)))})}select(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.contains(this.options.disabledClass)||(this.options.multiSelect||this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this._fire("deselect",e,t,null))}),t.classList.add(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","true"),this._fire("select",t,e,null),this._fire("change",this.getSelected(),null)),this}deselect(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","false"),this._fire("deselect",t,e,null),this._fire("change",this.getSelected(),null),this}toggle(e){if(e<0||e>=this._items.length)return this;return this._items[e].classList.contains(this.options.activeClass)?this.deselect(e):this.select(e)}selectAll(){return this.options.multiSelect?(this._items.forEach((e,t)=>{e.classList.contains(this.options.disabledClass)||(e.classList.add(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","true"),this._fire("select",e,t,null))}),this._fire("change",this.getSelected(),null),this):this}deselectAll(){return this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this._fire("deselect",e,t,null))}),this._fire("change",this.getSelected(),null),this}getSelected(){return this._items.filter(e=>e.classList.contains(this.options.activeClass))}isSelected(e){return!(e<0||e>=this._items.length)&&this._items[e].classList.contains(this.options.activeClass)}enable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.disabledClass),t.removeAttribute("aria-disabled"),this}disable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.add(this.options.disabledClass),t.setAttribute("aria-disabled","true"),this}getItems(){return[...this._items]}getItem(e){return this._items[e]||null}refresh(){return this.element?(this._items=Array.from(this.element.querySelectorAll(this.options.itemSelector)),this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",e.classList.contains(this.options.activeClass)?"true":"false")}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}),this._initTabindex(),this):this}destroy(){this._items.forEach(e=>{e.removeAttribute("tabindex"),e.removeAttribute("aria-disabled")}),this.options.selectable&&(this.element.removeAttribute("role"),this.element.removeAttribute("aria-multiselectable"),this._items.forEach(e=>{e.removeAttribute("aria-selected")})),super.destroy()}}class Hs extends C{static componentName="dropdown";static defaults={trigger:"click",position:"bottom-start",offset:[0,4],animation:!0,animationDuration:150,hoverOpenDelay:0,hoverCloseDelay:300,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOthers:!0,flip:!0,items:[],model:null,modelKey:null,itemTemplate:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onSelect:null};static _open=new Set;constructor(e,t={}){super(e,t),this._menu=null,this._isOpen=!1,this._items=[...this.options.items],this._selectedValue=null,this._modelUnsubscribe=null,this._hoverOpenTimer=null,this._hoverCloseTimer=null,this._removeTimer=null,this._init()}_init(){if(!this.element)return;const e=this.options;this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._addEventListener(this.element,"click",()=>{"hover"===e.trigger?this.open():this.toggle()}),"hover"===e.trigger&&(this._addEventListener(this.element,"mouseenter",()=>this._hoverIn()),this._addEventListener(this.element,"mouseleave",()=>this._hoverOut())),e.closeOnClickOutside&&(this._outsideClickHandler=e=>{this._isOpen&&(this.element.contains(e.target)||this._menu&&this._menu.contains(e.target)||this.close())},document.addEventListener("click",this._outsideClickHandler)),e.closeOnEscape&&(this._keydownHandler=e=>{"Escape"===e.key&&this._isOpen&&(this.close(),"function"==typeof this.element.focus&&this.element.focus())},document.addEventListener("keydown",this._keydownHandler)),e.model&&e.modelKey&&this._bindToModel(e.model,e.modelKey)}_bindToModel(e,t){if(e&&"function"==typeof e.get){const n=e.get(t);Array.isArray(n)&&(this._items=[...n]);const s=e=>{Array.isArray(e)&&(this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()))};"function"==typeof e.onFieldChange?this._modelUnsubscribe=e.onFieldChange(t,s):"function"==typeof e.onChange&&(this._modelUnsubscribe=e.onChange(({field:e,newValue:n})=>{e===t&&s(n)}))}}open(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen&&!1===this._fire("beforeopen",this))return this;if(this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),this._isOpen)return this;return this.options.closeOthers&&Hs._open.forEach(e=>{e!==this&&e.close()}),this._fire("open",this),this._menu?(this._renderMenu(),this._menu.style.pointerEvents="",this._menu.classList.add("show")):this._createMenu(),this._isOpen=!0,Hs._open.add(this),this.element.setAttribute("aria-expanded","true"),this._positionMenu(),this._bindOpenListeners(),this}close(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen)return this;if(!this._mayClose(this))return this;const e=this.options,t=e.animation?e.animationDuration:0;this._isOpen=!1,Hs._open.delete(this),this.element.setAttribute("aria-expanded","false"),this._unbindOpenListeners();const n=this._menu;return n&&(n.classList.remove("show"),n.style.pointerEvents="none",this._removeTimer=setTimeout(()=>{this._removeTimer=null,this._menu=null,n.remove()},t)),this._fire("close",this),this}toggle(){return this._isOpen?this.close():this.open()}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}_hoverIn(){if(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null,this._isOpen)return;const e=this.options.hoverOpenDelay;e?(clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=setTimeout(()=>this.open(),e)):this.open()}_hoverOut(){clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=null,this._scheduleHoverClose()}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{this._hoverCloseTimer=null,this.close()},this.options.hoverCloseDelay)}_pointerInSafeZone(e,t){if(!this.element)return!1;const n=this.element.getBoundingClientRect(),s=this._menu?this._menu.getBoundingClientRect():null,i=n=>!!n&&e>=n.left-2&&e<=n.right+2&&t>=n.top-2&&t<=n.bottom+2;if(i(n))return!0;if(!s)return!1;if(i(s))return!0;if(e<Math.min(n.left,s.left)-2)return!1;if(e>Math.max(n.right,s.right)+2)return!1;if(t<Math.min(n.top,s.top)-2)return!1;if(t>Math.max(n.bottom,s.bottom)+2)return!1;if(s.top>=n.bottom){if(t>=n.bottom-2&&t<=s.top+2)return!0}else if(n.top>=s.bottom&&t>=s.bottom-2&&t<=n.top+2)return!0;if(s.left>=n.right){if(e>=n.right-2&&e<=s.left+2)return!0}else if(n.left>=s.right&&e>=s.right-2&&e<=n.left+2)return!0;return!1}_bindOpenListeners(){this._openListenersBound||(this._openListenersBound=!0,this._repositionHandler=()=>this._positionMenu(),window.addEventListener("resize",this._repositionHandler),window.addEventListener("scroll",this._repositionHandler,!0),"hover"===this.options.trigger&&(this._pointerMoveHandler=e=>{this._isOpen&&(this._pointerInSafeZone(e.clientX,e.clientY)?(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null):this._hoverCloseTimer||this._scheduleHoverClose())},document.addEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerLeaveHandler=()=>this._scheduleHoverClose(),document.documentElement.addEventListener("mouseleave",this._pointerLeaveHandler)))}_unbindOpenListeners(){this._openListenersBound&&(this._openListenersBound=!1,this._repositionHandler&&(window.removeEventListener("resize",this._repositionHandler),window.removeEventListener("scroll",this._repositionHandler,!0),this._repositionHandler=null),this._pointerMoveHandler&&(document.removeEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerMoveHandler=null),this._pointerLeaveHandler&&(document.documentElement.removeEventListener("mouseleave",this._pointerLeaveHandler),this._pointerLeaveHandler=null))}_createMenu(){const e=this.options;this._menu=document.createElement("div"),this._menu.className="domma-dropdown-menu",this._menu.setAttribute("role","menu"),this._renderMenu(),document.body.appendChild(this._menu),this._addEventListener(this._menu,"click",e=>{const t=e.target.closest(".domma-dropdown-item");if(!t||!this._menu||!this._menu.contains(t))return;if(t.classList.contains("disabled"))return;const n=Number(t.dataset.index);this._selectItem(this._items[n],n,t.dataset.value)}),"hover"===e.trigger&&(this._addEventListener(this._menu,"mouseenter",()=>{clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null}),this._addEventListener(this._menu,"mouseleave",()=>this._scheduleHoverClose())),this._menu.offsetHeight,this._menu.classList.add("show")}_renderMenu(){if(!this._menu)return;const e=this.options;this._menu.innerHTML="",this._items.forEach((t,n)=>{const s=document.createElement("div");if(s.className="domma-dropdown-item",s.setAttribute("role","menuitem"),s.dataset.index=n,"string"==typeof t)s.textContent=t,s.dataset.value=t;else{if(t.divider)return s.className="domma-dropdown-divider",s.setAttribute("role","separator"),void this._menu.appendChild(s);if(t.header)return s.className="domma-dropdown-header",s.setAttribute("role","presentation"),s.textContent=t.header,void this._menu.appendChild(s);if(e.itemTemplate?s.innerHTML=e.itemTemplate(t,n):s.textContent=t.label||t.text||t.name||"",s.dataset.value=void 0!==t.value?t.value:n,t.disabled&&(s.classList.add("disabled"),s.setAttribute("aria-disabled","true")),t.icon){const e=document.createElement("span");e.className="domma-dropdown-icon",e.innerHTML=t.icon,s.insertBefore(e,s.firstChild)}}this._menu.appendChild(s)})}_selectItem(e,t,n){const s=this.options;if(this._selectedValue=n,this._fire("select",{item:e,index:t,value:n},this),s.model&&s.modelKey&&"function"==typeof s.model.set){const e=s.selectedKey||s.modelKey+"_selected";s.model.set(e,n)}s.closeOnSelect&&this.close()}_positionMenu(){if(!this._menu||!this.element)return;Ze(this.element,this._menu);const e=this.options,t=this.element.getBoundingClientRect(),[n,s]=e.offset,i=this._menu.offsetWidth,o=this._menu.offsetHeight,r=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=e=>{switch(e){case"bottom-end":return[t.bottom+s,t.right-i+n];case"top-start":return[t.top-o-s,t.left+n];case"top-end":return[t.top-o-s,t.right-i+n];case"left-start":return[t.top+s,t.left-i-n];case"left-end":return[t.bottom-o+s,t.left-i-n];case"right-start":return[t.top+s,t.right+n];case"right-end":return[t.bottom-o+s,t.right+n];default:return[t.bottom+s,t.left+n]}},c=String(e.position||"bottom-start").split("-"),h=["bottom","top","left","right"].includes(c[0])?c[0]:"bottom",d="end"===c[1]?"end":"start";let[u,p]=l(`${h}-${d}`);if(e.flip){const e={bottom:"top",top:"bottom",left:"right",right:"left"},c=a-8-(t.bottom+s),m=t.top-s-8,f=r-8-(t.right+n),_=t.left-n-8;("bottom"===h&&o>c&&m>=o||"top"===h&&o>m&&c>=o||"right"===h&&i>f&&_>=i||"left"===h&&i>_&&f>=i)&&([u,p]=l(`${e[h]}-${d}`)),i<=r-16&&(p=Math.max(8,Math.min(p,r-i-8))),o<=a-16&&(u=Math.max(8,Math.min(u,a-o-8)))}u+=window.scrollY,p+=window.scrollX,this._menu.style.top=u+"px",this._menu.style.left=p+"px"}setItems(e){return this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()),this}addItem(e){return this._items.push(e),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}removeItem(e){return this._items.splice(e,1),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}getSelected(){return this._selectedValue}isOpen(){return this._isOpen}destroy(){super.destroy(),clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),clearTimeout(this._removeTimer),this._unbindOpenListeners(),Hs._open.delete(this),this._outsideClickHandler&&(document.removeEventListener("click",this._outsideClickHandler),this._outsideClickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this._modelUnsubscribe&&"function"==typeof this._modelUnsubscribe&&this._modelUnsubscribe(),this._menu&&(this._menu.remove(),this._menu=null),this._isOpen=!1}}class Ws{static permission="undefined"!=typeof Notification?Notification.permission:"denied";static isSupported="undefined"!=typeof Notification;static _instances=[];static defaults={title:"Notification",body:"",icon:null,badge:null,tag:null,requireInteraction:!1,silent:!1,data:null,onClick:null,onClose:null,onError:null,onShow:null};static async requestPermission(){if(!Ws.isSupported)return console.warn("Notifications are not supported in this browser"),"denied";try{const e=await Notification.requestPermission();return Ws.permission=e,e}catch(e){return console.error("Error requesting notification permission:",e),"denied"}}static notify(e,t={}){const n=new Ws({title:e,...t});return n.show(),n}static closeAll(){Ws._instances.forEach(e=>{e.isShown()&&e.close()}),Ws._instances=[]}constructor(e={}){this.options={...Ws.defaults,...e},this.notification=null,this._shown=!1}async show(){if(!Ws.isSupported)return console.warn("Notifications are not supported in this browser"),this.options.onError&&this.options.onError(new Error("Notifications not supported")),this;if("granted"!==Ws.permission){if("default"!==Ws.permission)return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this;if("granted"!==await Ws.requestPermission())return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this}try{const e={};this.options.body&&(e.body=this.options.body),this.options.icon&&(e.icon=this.options.icon),this.options.badge&&(e.badge=this.options.badge),this.options.tag&&(e.tag=this.options.tag),void 0!==this.options.requireInteraction&&(e.requireInteraction=this.options.requireInteraction),void 0!==this.options.silent&&(e.silent=this.options.silent),this.options.data&&(e.data=this.options.data),this.notification=new Notification(this.options.title,e),this._shown=!0,Ws._instances.push(this),this.options.onClick&&(this.notification.onclick=e=>{this.options.onClick(e,this)}),this.options.onClose?this.notification.onclose=e=>{this._shown=!1;const t=Ws._instances.indexOf(this);t>-1&&Ws._instances.splice(t,1),this.options.onClose(e,this)}:this.notification.onclose=()=>{this._shown=!1;const e=Ws._instances.indexOf(this);e>-1&&Ws._instances.splice(e,1)},this.options.onError&&(this.notification.onerror=e=>{this._shown=!1,this.options.onError(e,this)}),this.options.onShow&&(this.notification.onshow=e=>{this.options.onShow(e,this)})}catch(e){console.error("Error showing notification:",e),this.options.onError&&this.options.onError(e)}return this}close(){return this.notification&&this._shown&&(this.notification.close(),this._shown=!1),this}isShown(){return this._shown}}class Ps extends C{static componentName="timer";static defaults={duration:6e4,autoStart:!1,format:"mm:ss",showControls:!1,updateInterval:100,notification:!1,notificationOptions:{},sound:!1,soundUrl:null,onTick:null,onComplete:null,onStart:null,onPause:null,onReset:null};constructor(e,t={}){super(e,t),e||(this.element=null,this.options={...Ps.defaults,...t}),this._running=!1,this._remaining=this.options.duration,this._intervalId=null,this._startTime=null,this._pausedTime=null,this._display=null,this._controls=null,this._audio=null,this._init()}_init(){this.element&&(this._createDisplay(),this.options.showControls&&this._createControls()),this.options.sound&&this.options.soundUrl&&(this._audio=new Audio(this.options.soundUrl)),this.options.autoStart&&this.start()}_createDisplay(){if(!this.element)return;const e=document.createElement("div");e.className="dm-timer",this._display=document.createElement("div"),this._display.className="dm-timer-display";const t=document.createElement("span");t.className="dm-timer-time",t.textContent=this._formatTime(this._remaining),this._display.appendChild(t),e.appendChild(this._display),this.element.innerHTML="",this.element.appendChild(e),this._container=e}_createControls(){if(!this.element||!this._container)return;const e=document.createElement("div");e.className="dm-timer-controls",this._startBtn=document.createElement("button"),this._startBtn.className="dm-timer-button dm-timer-start",this._startBtn.textContent="Start",this._startBtn.addEventListener("click",()=>this.start()),this._pauseBtn=document.createElement("button"),this._pauseBtn.className="dm-timer-button dm-timer-pause",this._pauseBtn.textContent="Pause",this._pauseBtn.style.display="none",this._pauseBtn.addEventListener("click",()=>this.pause()),this._resetBtn=document.createElement("button"),this._resetBtn.className="dm-timer-button dm-timer-reset",this._resetBtn.textContent="Reset",this._resetBtn.addEventListener("click",()=>this.reset()),e.appendChild(this._startBtn),e.appendChild(this._pauseBtn),e.appendChild(this._resetBtn),this._container.appendChild(e),this._controls=e}_updateDisplay(){if(!this._display)return;const e=this._display.querySelector(".dm-timer-time");e&&(e.textContent=this._formatTime(this._remaining))}_formatTime(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60,o=this.options.format.toLowerCase();if("hh:mm:ss"===o)return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`;if("mm:ss"===o){const e=Math.floor(t/60);return`${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`}return"ss"===o?String(t).padStart(2,"0"):`${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`}_tick(){if(!this._running)return;const e=Date.now()-this._startTime;this._remaining=Math.max(0,this.options.duration-e),this._updateDisplay(),this._fire("tick",this._remaining),0===this._remaining&&this._complete()}_complete(){if(this.stop(),this.options.sound&&this._audio&&this._audio.play().catch(e=>{console.warn("Failed to play timer sound:",e)}),this.options.notification&&Ws.isSupported){const e={title:"Timer Complete",body:"Your countdown has finished",...this.options.notificationOptions};Ws.notify(e.title,e)}this._fire("complete")}start(){return this._running||(this._running=!0,this._startTime=Date.now()-(this.options.duration-this._remaining),this._intervalId=setInterval(()=>this._tick(),this.options.updateInterval),this._startBtn&&(this._startBtn.style.display="none"),this._pauseBtn&&(this._pauseBtn.style.display="inline-block"),this._fire("start")),this}pause(){return this._running?(this._running=!1,this._pausedTime=Date.now(),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this._fire("pause"),this):this}reset(){return this.stop(),this._remaining=this.options.duration,this._updateDisplay(),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this._fire("reset"),this}stop(){return this._running=!1,this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this}add(e){return this._remaining=Math.min(this._remaining+e,864e5),this._updateDisplay(),this}subtract(e){return this._remaining=Math.max(0,this._remaining-e),this._updateDisplay(),0===this._remaining&&this._running&&this._complete(),this}setDuration(e){return this.options.duration=e,this._running||(this._remaining=e,this._updateDisplay()),this}isRunning(){return this._running}getRemaining(){return this._remaining}getElapsed(){return this.options.duration-this._remaining}destroy(){this.stop(),this._startBtn&&this._startBtn.removeEventListener("click",this.start),this._pauseBtn&&this._pauseBtn.removeEventListener("click",this.pause),this._resetBtn&&this._resetBtn.removeEventListener("click",this.reset),this.element&&this._container&&this.element.removeChild(this._container),this._display=null,this._controls=null,this._audio=null,this._container=null,super.destroy&&super.destroy()}}class Fs{static defaults={alarms:[],timezone:"local",checkInterval:3e4,storageKey:"domma-alarms",onTrigger:null,onSnooze:null,onDismiss:null,onAlarmAdd:null,onAlarmRemove:null};static _instance=null;static _checkInterval=null;static _nextAlarmId=1;constructor(e={}){if(Fs._instance)return Fs._instance;this.options={...Fs.defaults,...e},this._alarms=[],this._init(),Fs._instance=this}_init(){this._loadAlarms(),this._startChecking()}_loadAlarms(){try{const e=localStorage.getItem(this.options.storageKey);if(e){const t=JSON.parse(e);if(this._alarms=Array.isArray(t)?t:[],this._alarms.length>0){const e=Math.max(...this._alarms.map(e=>{const t=String(e.id).match(/\d+$/);return t?parseInt(t[0]):0}));Fs._nextAlarmId=e+1}}else this.options.alarms&&this.options.alarms.length>0&&(this._alarms=this.options.alarms.map(e=>({id:"alarm-"+Fs._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e})),this._saveAlarms())}catch(e){console.error("Failed to load alarms from localStorage:",e),this._alarms=[]}}_saveAlarms(){try{localStorage.setItem(this.options.storageKey,JSON.stringify(this._alarms))}catch(e){console.error("Failed to save alarms to localStorage:",e)}}_startChecking(){Fs._checkInterval||(Fs._checkInterval=setInterval(()=>{this._checkAlarms()},this.options.checkInterval),this._checkAlarms())}_stopChecking(){Fs._checkInterval&&(clearInterval(Fs._checkInterval),Fs._checkInterval=null)}_checkAlarms(){const e=new Date;this._alarms.forEach(t=>{t.enabled&&(t.snoozedUntil&&e<new Date(t.snoozedUntil)||(t.snoozedUntil&&e>=new Date(t.snoozedUntil)&&(t.snoozedUntil=null,this._saveAlarms()),this._shouldTrigger(t,e)&&this._triggerAlarm(t)))})}_shouldTrigger(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),i=t.getHours(),o=t.getMinutes();if(i!==n||o!==s)return!1;if(e.lastTriggered){if(t-new Date(e.lastTriggered)<5e4)return!1}return!!this._matchesRepeatPattern(e,t)}_parseTime(e){const[t,n]=e.split(":").map(e=>parseInt(e,10));return{hours:t,minutes:n}}_matchesRepeatPattern(e,t){if(!e.repeat)return!0;const n=t.getDay();if("daily"===e.repeat)return!0;if("weekdays"===e.repeat)return n>=1&&n<=5;if("weekends"===e.repeat)return 0===n||6===n;if(Array.isArray(e.repeat)){const t=["sun","mon","tue","wed","thu","fri","sat"][n];return e.repeat.includes(t)}return!1}_triggerAlarm(e){if(e.lastTriggered=Date.now(),this._saveAlarms(),e.sound&&e.soundUrl){new Audio(e.soundUrl).play().catch(e=>{console.warn("Failed to play alarm sound:",e)})}if(e.notification&&Ws.isSupported){const t={title:"Alarm",body:e.label||`Alarm at ${e.time}`,requireInteraction:!0,...e.notificationOptions};Ws.notify(t.title,t)}this.options.onTrigger&&this.options.onTrigger(e),e.repeat||(e.enabled=!1,this._saveAlarms())}add(e){const t={id:"alarm-"+Fs._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e};return this._alarms.push(t),this._saveAlarms(),this.options.onAlarmAdd&&this.options.onAlarmAdd(t),t}removeAlarm(e){const t=this._alarms.findIndex(t=>t.id===e);if(-1===t)return!1;const n=this._alarms.splice(t,1)[0];return this._saveAlarms(),this.options.onAlarmRemove&&this.options.onAlarmRemove(n),!0}remove(e){return this.removeAlarm(e)}update(e,t){const n=this._alarms.find(t=>t.id===e);return n?(Object.assign(n,t),this._saveAlarms(),n):null}enable(e){return null!==this.update(e,{enabled:!0})}disable(e){return null!==this.update(e,{enabled:!1})}toggle(e){const t=this._alarms.find(t=>t.id===e);return t?(t.enabled=!t.enabled,this._saveAlarms(),t.enabled):null}snooze(e,t=3e5){const n=this._alarms.find(t=>t.id===e);return!!n&&(n.snoozedUntil=Date.now()+t,this._saveAlarms(),this.options.onSnooze&&this.options.onSnooze(n,t),!0)}getAlarms(){return[...this._alarms]}getAlarm(e){return this._alarms.find(t=>t.id===e)||null}getNextAlarm(){const e=new Date;let t=null,n=null;return this._alarms.forEach(s=>{if(!s.enabled)return;const i=this._getNextOccurrence(s,e);i&&(!n||i<n)&&(n=i,t={...s,nextTrigger:i})}),t}_getNextOccurrence(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),i=new Date(t),o=new Date(i);o.setHours(n,s,0,0),o<=i&&o.setDate(o.getDate()+1);for(let t=0;t<7;t++){if(this._matchesRepeatPattern(e,o))return o;o.setDate(o.getDate()+1)}return null}clearAll(){return this._alarms=[],this._saveAlarms(),this}destroy(){this._stopChecking(),this._alarms=[],Fs._instance=null}}class Rs extends C{static componentName="carousel";static defaults={autoplay:!1,interval:5e3,pauseOnHover:!0,loop:!0,animation:"slide",animationDuration:500,animationEasing:"ease",heightMode:"crop",height:null,showArrows:!0,showIndicators:!0,slideSelector:".carousel-slide, [data-slide]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._currentIndex=0,this._autoplayTimer=null,this._isAnimating=!1,this._init()}_init(){if(!this.element)return;const e=this.options;if(this._slides=this.element.querySelectorAll(e.slideSelector),this._track=this.element.querySelector(".carousel-track"),0===this._slides.length)return;this.element.style.position="relative",this.element.style.overflow="hidden";const t="fade"===e.animation||"crossfade"===e.animation;this._slides.forEach((n,s)=>{t?(n.style.position=0===s?"relative":"absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.opacity=0===s?"1":"0",n.style.zIndex=0===s?"1":"0",n.style.transition=`opacity ${e.animationDuration}ms ${e.animationEasing}`):(n.style.position="relative",n.style.width="100%",n.style.flexShrink="0")}),"slide"===e.animation&&this._track&&(this._track.style.display="flex",this._track.style.transition=`transform ${e.animationDuration}ms ${e.animationEasing}`),this._initHeight(),e.showArrows&&this._createArrows(),e.showIndicators&&this._createIndicators(),e.autoplay&&(this._startAutoplay(),e.pauseOnHover&&(this._addEventListener(this.element,"mouseenter",()=>this._stopAutoplay()),this._addEventListener(this.element,"mouseleave",()=>this._startAutoplay()))),this._addEventListener(this.element,"keydown",e=>{"ArrowLeft"===e.key&&this.prev(),"ArrowRight"===e.key&&this.next()}),this.element.tabIndex=0,this._updateState()}_initHeight(){this._images=Array.from(this._slides,e=>e.querySelector(":scope > img")).filter(Boolean),this._originalHeight=this.element.style.getPropertyValue("--dm-carousel-height"),this._originalHeightPriority=this.element.style.getPropertyPriority("--dm-carousel-height"),this._wasSized=this.element.classList.contains("carousel-sized");const e=()=>this._sizeSlides();for(const t of this._images)this._addEventListener(t,"load",e),this._addEventListener(t,"error",e);"undefined"!=typeof ResizeObserver?(this._heightObserver=new ResizeObserver(e),this._heightObserver.observe(this.element)):this._addEventListener(window,"resize",e),e()}_sizeSlides(){const e=this.element.clientWidth,t=Number(this.options.height);let n=t>0&&Number.isFinite(t)?t:0;if(!n){const t=this._images.filter(e=>e.naturalWidth>0&&e.naturalHeight>0).map(t=>e*t.naturalHeight/t.naturalWidth);if(!t.length||!e)return;const s=Math.min(...t);n="average"===this.options.heightMode?(s+Math.max(...t))/2:s;for(const e of this._slides)if(!e.querySelector(":scope > img")){const t=e.style.height;e.style.height="auto",n=Math.max(n,e.scrollHeight),e.style.height=t}}const s=`${n}px`;this.element.style.getPropertyValue("--dm-carousel-height")!==s&&this.element.style.setProperty("--dm-carousel-height",s),this.element.classList.add("carousel-sized")}_applyOptions(){this._images&&this._sizeSlides()}_createArrows(){const e=document.createElement("button");e.className="carousel-arrow carousel-prev",e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>',e.style.cssText="\n position: absolute;\n top: 50%;\n left: 1rem;\n transform: translateY(-50%);\n z-index: 10;\n background: rgba(255,255,255,0.9);\n border: none;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n ",this._addEventListener(e,"click",()=>this.prev()),this._addEventListener(e,"mouseenter",()=>e.style.background="#fff"),this._addEventListener(e,"mouseleave",()=>e.style.background="rgba(255,255,255,0.9)");const t=document.createElement("button");t.className="carousel-arrow carousel-next",t.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>',t.style.cssText=e.style.cssText.replace("left: 1rem","right: 1rem"),this._addEventListener(t,"click",()=>this.next()),this._addEventListener(t,"mouseenter",()=>t.style.background="#fff"),this._addEventListener(t,"mouseleave",()=>t.style.background="rgba(255,255,255,0.9)"),this.element.appendChild(e),this.element.appendChild(t),this._prevBtn=e,this._nextBtn=t}_createIndicators(){const e=document.createElement("div");e.className="carousel-indicators",e.style.cssText="\n position: absolute;\n bottom: 1rem;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 0.5rem;\n z-index: 10;\n ",this._slides.forEach((t,n)=>{const s=document.createElement("button");s.className="carousel-indicator",s.style.cssText="\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.5);\n cursor: pointer;\n padding: 0;\n transition: all 0.2s ease;\n ",this._addEventListener(s,"click",()=>this.goTo(n)),e.appendChild(s)}),this.element.appendChild(e),this._indicators=e}_updateState(e=null){const t=this.options;if("fade"===t.animation?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):"crossfade"===t.animation?null===e||e===this._currentIndex?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):this._applyCrossfade(e,this._currentIndex):this._track&&(this._track.style.transform=`translateX(-${100*this._currentIndex}%)`),this._indicators){this._indicators.querySelectorAll(".carousel-indicator").forEach((e,t)=>{e.style.background=t===this._currentIndex?"rgba(255,255,255,1)":"rgba(255,255,255,0.5)",e.style.transform=t===this._currentIndex?"scale(1.2)":"scale(1)"})}!t.loop&&this._prevBtn&&this._nextBtn&&(this._prevBtn.style.opacity=0===this._currentIndex?"0.3":"1",this._prevBtn.style.pointerEvents=0===this._currentIndex?"none":"auto",this._nextBtn.style.opacity=this._currentIndex===this._slides.length-1?"0.3":"1",this._nextBtn.style.pointerEvents=this._currentIndex===this._slides.length-1?"none":"auto")}_applyCrossfade(e,t){const n=this._slides[e],s=this._slides[t];s.style.position="absolute",s.style.opacity="0",s.style.zIndex="2",n.style.position="relative",n.style.opacity="1",n.style.zIndex="1",this._slides.forEach((n,s)=>{s!==e&&s!==t&&(n.style.position="absolute",n.style.opacity="0",n.style.zIndex="0")}),s.offsetWidth,requestAnimationFrame(()=>{s.style.opacity="1",n.style.opacity="0"}),this._crossfadeSwapTimer&&clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=setTimeout(()=>{s.style.position="relative",s.style.zIndex="1",n.style.position="absolute",n.style.zIndex="0",this._crossfadeSwapTimer=null},this.options.animationDuration)}_startAutoplay(){this._autoplayTimer||(this._autoplayTimer=setInterval(()=>{this.next()},this.options.interval))}_stopAutoplay(){this._autoplayTimer&&(clearInterval(this._autoplayTimer),this._autoplayTimer=null)}goTo(e){if(this._isAnimating)return this;const t=this.options,n=this._currentIndex,s=this._slides.length-1;if(t.loop)e<0&&(e=s),e>s&&(e=0);else if(e<0||e>s)return this;return e===this._currentIndex||(this._isAnimating=!0,this._currentIndex=e,this._updateState(n),setTimeout(()=>{this._isAnimating=!1},t.animationDuration),this._fire("change",{index:e,oldIndex:n,slide:this._slides[e]})),this}next(){return this.goTo(this._currentIndex+1)}prev(){return this.goTo(this._currentIndex-1)}play(){return this._startAutoplay(),this}pause(){return this._stopAutoplay(),this}getIndex(){return this._currentIndex}getSlide(e=this._currentIndex){return this._slides[e]}destroy(){super.destroy(),this._stopAutoplay(),this._heightObserver?.disconnect(),this.element&&this._images&&(this._wasSized||this.element.classList.remove("carousel-sized"),this._originalHeight?this.element.style.setProperty("--dm-carousel-height",this._originalHeight,this._originalHeightPriority):this.element.style.removeProperty("--dm-carousel-height")),this._crossfadeSwapTimer&&(clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=null)}}class Vs extends C{static componentName="cookie-consent";static defaults={message:'We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.',acceptAllText:"Accept All",rejectAllText:"Reject All",customizeText:"Customize",savePreferencesText:"Save Preferences",privacyPolicyText:"Privacy Policy",privacyPolicyUrl:"/privacy-policy",cookiePolicyText:"Cookie Policy",cookiePolicyUrl:null,categories:{necessary:{label:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",required:!0},functional:{label:"Functional Cookies",description:"These cookies enable personalized features and functionality.",required:!1},analytics:{label:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",required:!1},marketing:{label:"Marketing Cookies",description:"These cookies are used to deliver relevant ads and marketing campaigns.",required:!1}},position:"bottom",theme:"light",layout:"bar",animation:!0,backdrop:!1,autoShow:!0,hideAfterAction:!0,reopenSelector:"[data-cookie-consent-open]",storageKey:"domma-cookie-consent",storageDuration:365,defaultState:"undecided",requireExplicitConsent:!0,consentVersion:"1.0",onVersionMismatch:null,onAccept:null,onReject:null,onCustomize:null,onChange:null,onShow:null,onHide:null};constructor(e={}){super(null,e),this._state=null,this._preferences={},this._customizeModal=null,this._isVisible=!1,this._init()}_init(){this._loadPreferences(),this._createUI(),this._setupEventHandlers(),this.options.autoShow&&!this._hasConsented()&&this.open(),this._setupReopenTriggers()}_loadPreferences(){const e=Domma.storage.get(this.options.storageKey);if(e&&e.timestamp){if((Date.now()-e.timestamp)/864e5<=this.options.storageDuration)return e.version&&e.version!==this.options.consentVersion?(this._state="undecided",this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),void this._fire("versionmismatch",e.version,this.options.consentVersion)):(this._state=e.state,void(this._preferences=e.preferences||{}))}this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent})}_savePreferences(){Domma.storage.set(this.options.storageKey,{state:this._state,preferences:this._preferences,timestamp:Date.now(),version:this.options.consentVersion})}_hasConsented(){return"accepted"===this._state||"rejected"===this._state||"customized"===this._state}_createUI(){this.element=document.createElement("div"),this.element._dommaComponent=this,M(this.element,this),this.element.className=`dm-cookie-consent dm-cookie-consent-${this.options.position} dm-cookie-consent-${this.options.layout} dm-cookie-consent-${this.options.theme}`,this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Cookie consent"),this.element.style.display="none",this.options.animation&&this.element.classList.add("dm-cookie-consent-animated");let e='<div class="dm-cookie-consent-content">';e+=`<div class="dm-cookie-consent-message">${this.options.message}`;const t=[];this.options.privacyPolicyUrl&&t.push(`<a href="${this.options.privacyPolicyUrl}" target="_blank" rel="noopener">${this.options.privacyPolicyText}</a>`),this.options.cookiePolicyUrl&&t.push(`<a href="${this.options.cookiePolicyUrl}" target="_blank" rel="noopener">${this.options.cookiePolicyText}</a>`),t.length>0&&(e+=` ${t.join(" | ")}`),e+="</div>",e+='<div class="dm-cookie-consent-buttons">',Object.keys(this.options.categories).length>1&&(e+=`<button type="button" class="btn btn-outline dm-cookie-consent-customize">${this.options.customizeText}</button>`),e+=`<button type="button" class="btn btn-outline dm-cookie-consent-reject">${this.options.rejectAllText}</button>`,e+=`<button type="button" class="btn btn-primary dm-cookie-consent-accept">${this.options.acceptAllText}</button>`,e+="</div></div>",this.options.backdrop&&"modal"===this.options.layout&&(e=`<div class="dm-cookie-consent-backdrop"></div>${e}`),this.element.innerHTML=e,document.body.appendChild(this.element)}_createCustomizeModal(){if(this._customizeModal)return;this._customizeModal=document.createElement("div"),this._customizeModal.className="dm-cookie-consent-modal",this._customizeModal.setAttribute("role","dialog"),this._customizeModal.setAttribute("aria-label","Customize cookie preferences");let e='<div class="dm-cookie-consent-modal-content">';e+='<div class="dm-cookie-consent-modal-header">',e+="<h3>Cookie Preferences</h3>",e+='<button type="button" class="dm-cookie-consent-modal-close" aria-label="Close">×</button>',e+="</div>",e+='<div class="dm-cookie-consent-modal-body">',Object.entries(this.options.categories).forEach(([t,n])=>{const s=this._preferences[t]?"checked":"",i=n.required?"disabled":"";e+='<div class="dm-cookie-consent-category">',e+='<label class="dm-cookie-consent-category-label">',e+=`<input type="checkbox" class="dm-cookie-consent-category-toggle" data-category="${t}" ${s} ${i}>`,e+='<div class="dm-cookie-consent-category-info">',e+=`<div class="dm-cookie-consent-category-name">${n.label}`,n.required&&(e+=' <span class="dm-cookie-consent-required">(Required)</span>'),e+="</div>",e+=`<div class="dm-cookie-consent-category-description">${n.description}</div>`,e+="</div></label></div>"}),e+="</div>",e+='<div class="dm-cookie-consent-modal-footer">',e+='<button type="button" class="btn btn-outline dm-cookie-consent-modal-cancel">Cancel</button>',e+=`<button type="button" class="btn btn-primary dm-cookie-consent-modal-save">${this.options.savePreferencesText}</button>`,e+="</div></div>",e=`<div class="dm-cookie-consent-modal-backdrop"></div>${e}`,this._customizeModal.innerHTML=e,document.body.appendChild(this._customizeModal),this._setupModalHandlers()}_setupEventHandlers(){const e=this.element.querySelector(".dm-cookie-consent-accept");e&&e.addEventListener("click",()=>this.accept());const t=this.element.querySelector(".dm-cookie-consent-reject");t&&t.addEventListener("click",()=>this.reject());const n=this.element.querySelector(".dm-cookie-consent-customize");if(n&&n.addEventListener("click",()=>this.showCustomize()),this.options.backdrop&&"modal"===this.options.layout){const e=this.element.querySelector(".dm-cookie-consent-backdrop");e&&e.addEventListener("click",()=>{this.options.requireExplicitConsent||this.close()})}}_setupModalHandlers(){if(!this._customizeModal)return;const e=this._customizeModal.querySelector(".dm-cookie-consent-modal-close");e&&e.addEventListener("click",()=>this.hideCustomize());const t=this._customizeModal.querySelector(".dm-cookie-consent-modal-cancel");t&&t.addEventListener("click",()=>this.hideCustomize());const n=this._customizeModal.querySelector(".dm-cookie-consent-modal-save");n&&n.addEventListener("click",()=>this.saveCustomPreferences());const s=this._customizeModal.querySelector(".dm-cookie-consent-modal-backdrop");s&&s.addEventListener("click",()=>this.hideCustomize())}_setupReopenTriggers(){this.options.reopenSelector&&document.addEventListener("click",e=>{e.target.closest(this.options.reopenSelector)&&(e.preventDefault(),this.open())})}open(){return this._isVisible||(this.element.style.display="",this.options.animation?requestAnimationFrame(()=>{this.element.classList.add("dm-cookie-consent-visible")}):this.element.classList.add("dm-cookie-consent-visible"),this._isVisible=!0,this.options.onShow&&this.options.onShow.call(this),this._emit("show")),this}close(){if(!this._isVisible)return this;const e=()=>{this.element.style.display="none",this._isVisible=!1,this.options.onHide&&this.options.onHide.call(this),this._emit("hide")};return this.options.animation?(this.element.classList.remove("dm-cookie-consent-visible"),setTimeout(e,300)):(this.element.classList.remove("dm-cookie-consent-visible"),e()),this}toggle(){return this.isOpen()?this.close():this.open()}isOpen(){return this._isVisible}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}accept(){Object.keys(this.options.categories).forEach(e=>{this._preferences[e]=!0}),this._state="accepted",this._savePreferences(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this._emit("accept",this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}reject(){Object.entries(this.options.categories).forEach(([e,t])=>{this._preferences[e]=t.required}),this._state="rejected",this._savePreferences(),this.options.onReject&&this.options.onReject.call(this),this._emit("reject"),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}showCustomize(){this._createCustomizeModal(),this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;e.checked=this._preferences[t]||!1}),this._customizeModal.style.display="flex",this.options.animation?requestAnimationFrame(()=>{this._customizeModal.classList.add("dm-cookie-consent-modal-visible")}):this._customizeModal.classList.add("dm-cookie-consent-modal-visible"),this.options.onCustomize&&this.options.onCustomize.call(this,this._preferences),this._emit("customize",this._preferences)}hideCustomize(){if(!this._customizeModal)return;const e=()=>{this._customizeModal.style.display="none"};this.options.animation?(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),setTimeout(e,300)):(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),e())}saveCustomPreferences(){this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;this._preferences[t]=e.checked}),this._state="customized",this._savePreferences(),this.hideCustomize(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this._emit("accept",this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}getState(){return this._state}getPreferences(){return{...this._preferences}}isAccepted(e=null){return e?!0===this._preferences[e]:"accepted"===this._state||"customized"===this._state}reset(){this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),Domma.storage.remove(this.options.storageKey),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences)}destroy(){this.close(),this.hideCustomize(),super.destroy(),ci._instances.get("cookieConsent")===this&&ci._instances.delete("cookieConsent"),this.element&&(this.element.remove(),this.element=null),this._customizeModal&&(this._customizeModal.remove(),this._customizeModal=null)}}const qs={_container:null,_stack:[],_topHandler(){for(let e=this._stack.length-1;e>=0;e--)if(this._stack[e].overlay.isConnected)return this._stack[e].handler;return null},_defaults:{title:"",message:"",confirmText:"OK",cancelText:"Cancel",inputPlaceholder:"",inputValue:"",inputType:"text",animation:!0,backdrop:!0,backdropClose:!1,keyboard:!0,danger:!1,trapFocus:!0,returnFocus:!0,className:""},_ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",document.body.appendChild(this._container)),this._container},_createDialog(e,t){const n={...this._defaults,...t},s=this._ensureContainer();return new Promise(t=>{const i=document.createElement("div");i.className="dm-dialog-overlay"+(n.animation?" dm-dialog-animate":"");const r=document.createElement("div");r.className=`dm-dialog dm-dialog-${e}${n.className?" "+n.className:""}`,r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let a='<div class="dm-dialog-content">';if(n.title){a+=`<div class="dm-dialog-header"><h3 class="dm-dialog-title">${p.sanitise(String(n.title),{preset:"basic"})}</h3></div>`}if(a+='<div class="dm-dialog-body">',n.message){a+=`<p class="dm-dialog-message">${p.sanitise(String(n.message),{preset:"basic"})}</p>`}if("prompt"===e){const e=o(n.inputPlaceholder||""),t=o(n.inputValue||"");a+=`<input type="${n.inputType}" class="dm-dialog-input form-input" placeholder="${e}" value="${t}">`}a+="</div>",a+='<div class="dm-dialog-footer">',"confirm"!==e&&"prompt"!==e||(a+=`<button type="button" class="btn btn-outline dm-dialog-cancel">${n.cancelText}</button>`);a+=`<button type="button" class="btn ${n.danger?"btn-danger":"btn-primary"} dm-dialog-confirm">${n.confirmText}</button>`,a+="</div></div>",r.innerHTML=a,i.appendChild(r),s.appendChild(i);const l=r.querySelector(".dm-dialog-confirm"),c=r.querySelector(".dm-dialog-cancel"),h=r.querySelector(".dm-dialog-input"),d=!1!==n.trapFocus&&"false"!==n.trapFocus?pt(r,{initialFocus:!1,returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1}):null;d?.activate();const u=h||n.danger&&c||l;setTimeout(()=>{m||u?.focus()},50),h&&h.select();let m=!1,f=()=>{};const _=e=>{m||(m=!0,f(),d&&(d.deactivate({returnFocus:!1!==n.returnFocus&&"false"!==n.returnFocus}),d.destroy()),n.animation?(i.classList.add("dm-dialog-closing"),setTimeout(()=>{i.remove(),t(e)},200)):(i.remove(),t(e)))},g=()=>{_("prompt"===e?h.value:"confirm"===e||void 0)},v=()=>{_("prompt"===e&&null)};l.addEventListener("click",g),c?.addEventListener("click",v),n.backdropClose&&i.addEventListener("click",e=>{e.target===i&&v()});const b=new Set;r.addEventListener("keydown",e=>{e.repeat||b.add(e.key),"Enter"!==e.key&&" "!==e.key||!e.repeat||b.has(e.key)||e.preventDefault()});const y=e=>{e.preventDefault(),e.stopImmediatePropagation()},k=t=>{if(qs._topHandler()===k)if(t.repeat||b.add(t.key),"Escape"===t.key)y(t),n.keyboard&&v();else if("Enter"===t.key&&n.keyboard){if(t.repeat&&!b.has("Enter"))return;if("function"==typeof t.target?.closest&&t.target.closest("button")&&r.contains(t.target))return;if(n.danger&&"confirm"===e)return void y(t);"prompt"===e&&t.target!==h||(y(t),g())}};qs._stack.push({overlay:i,handler:k});let w=!1;const x=setTimeout(()=>{m||(w=!0,window.addEventListener("keydown",k,!0))},0);f=()=>{clearTimeout(x);const e=qs._stack.findIndex(e=>e.handler===k);-1!==e&&qs._stack.splice(e,1),w&&window.removeEventListener("keydown",k,!0)}})},alert(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("alert",{...t,message:e})},confirm(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("confirm",{...t,message:e})},prompt(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("prompt",{...t,message:e})}};class Us extends C{static componentName="button-group";static defaults={mode:"single",activeClass:"active",allowEmpty:!1,onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.buttons=Array.from(this.element.querySelectorAll(".btn")),this.buttons.forEach((e,t)=>{e.dataset.index=t,this._addEventListener(e,"click",n=>{n.preventDefault(),this._handleClick(e,t)})}))}_handleClick(e,t){const n=e.classList.contains(this.options.activeClass);"single"===this.options.mode?n&&this.options.allowEmpty?this.options.allowEmpty&&e.classList.remove(this.options.activeClass):(this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),e.classList.add(this.options.activeClass)):e.classList.toggle(this.options.activeClass),this._fire("change",this.getValue(),t,e)}getValue(){const e=this.buttons.map((e,t)=>e.classList.contains(this.options.activeClass)?t:-1).filter(e=>-1!==e);return"single"===this.options.mode?e.length>0?e[0]:null:e}getActive(){const e=this.buttons.filter(e=>e.classList.contains(this.options.activeClass));return"single"===this.options.mode?e.length>0?e[0]:null:e}setValue(e){const t=Array.isArray(e)?e:[e];return this.buttons.forEach((e,n)=>{t.includes(n)?e.classList.add(this.options.activeClass):e.classList.remove(this.options.activeClass)}),this}toggle(e){return e>=0&&e<this.buttons.length&&this._handleClick(this.buttons[e],e),this}selectAll(){return"multiple"===this.options.mode&&(this.buttons.forEach(e=>e.classList.add(this.options.activeClass)),this._fire("change",this.getValue(),-1,null)),this}deselectAll(){return this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),this._fire("change",this.getValue(),-1,null),this}}class Ks extends C{static componentName="breadcrumbs";static defaults={items:[],separator:"/",homeIcon:!1,responsive:!0,onChange:null};static separators={"/":"/",">":"›","→":"→",chevron:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>'};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_getSeparatorHTML(){const{separator:e}=this.options;return Ks.separators[e]||e}_render(){const{items:e,homeIcon:t,responsive:n}=this.options,s=this._getSeparatorHTML();this.element.className="dm-breadcrumbs",n&&this.element.classList.add("dm-breadcrumbs-responsive"),this.element.setAttribute("aria-label","Breadcrumb");let i="";e.forEach((n,o)=>{const r=o===e.length-1,a=0===o;o>0&&(i+=`<span class="dm-breadcrumbs-separator" aria-hidden="true">${s}</span>`);let l=n.text||n;a&&t&&(l=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align: middle; margin-right: 4px;"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>${l}`),r||n.active?i+=`<span class="dm-breadcrumbs-item active" aria-current="page">${l}</span>`:i+=`<a href="${n.url||"#"}" class="dm-breadcrumbs-item dm-breadcrumbs-link" data-index="${o}">${l}</a>`}),this.element.innerHTML=i,this._injectStyles()}_injectStyles(){}_bindEvents(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-breadcrumbs-link");if(t){const n=parseInt(t.dataset.index,10);this.options.onChange&&e.preventDefault(),this._fire("change",this.options.items[n],n,e)}})}setItems(e){return this.options.items=e,this._render(),this}addItem(e){if(this.options.items.length>0){const e=this.options.items[this.options.items.length-1];"object"==typeof e&&(e.active=!1)}return this.options.items.push(e),this._render(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render()),this}getItems(){return[...this.options.items]}}class Ys extends C{static componentName="navbar";static defaults={brand:null,items:[],position:"static",variant:"light",collapsible:!0,collapseAt:993,appearOnHover:!1,hoverCloseDelay:250,actions:[],onItemClick:null};constructor(e,t={}){super(e,t),this._isCollapsed=!0,this._pinned=null,this._hoverSuppressed=null,this._navCloseTimer=null,this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_render(){const{brand:e,items:t,position:n,variant:s,collapsible:i,actions:o}=this.options;this.element.className="navbar",this.element.classList.add(`navbar-${s}`),"static"!==n&&this.element.classList.add(`navbar-${n}`),this.element.setAttribute("role","navigation");let r='<div class="navbar-container">';e&&(r+='<div class="navbar-brand">',e.url&&(r+=`<a href="${e.url}" class="navbar-brand-link">`),e.html?r+=e.html:(e.logo&&(r+=`<img src="${e.logo}" alt="${e.text||""}" class="navbar-logo">`),e.text&&(r+=`<span class="navbar-brand-text">${e.text}</span>`)),e.url&&(r+="</a>"),r+="</div>"),i&&(r+='\n <button class="navbar-toggle" aria-label="Toggle navigation" aria-expanded="false">\n <span class="navbar-toggle-icon"></span>\n </button>\n '),r+='<div class="navbar-collapse">',r+='<ul class="navbar-nav">',r+=this._renderItems(t,0,""),r+="</ul>",o&&o.length>0&&(r+='<div class="navbar-actions">',o.forEach((e,t)=>{const n=e.variant||"primary",s=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";r+=`<a href="${e.url||"#"}" class="navbar-action dm-btn dm-btn-${n}" data-action="${t}">${s}${e.text}</a>`}),r+="</div>"),r+="</div>",r+="</div>",this.element.innerHTML=r,this._toggle=this.element.querySelector(".navbar-toggle"),this._collapse=this.element.querySelector(".navbar-collapse"),this._scanIcons()}_renderItems(e,t,n){let s="";return(e||[]).forEach((e,i)=>{const o=""===n?`${i}`:`${n}.${i}`;if(e.divider)return void(s+='<li class="navbar-dropdown-divider"></li>');const r=e.items&&e.items.length>0,a=0===t?18:16,l=e.icon?`<span data-icon="${e.icon}" data-size="${a}" style="margin-right: 6px; vertical-align: middle;"></span>`:"",c='<svg class="navbar-caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>';if(r)0===t?(s+='<li class="navbar-item navbar-dropdown">',s+=`<button class="navbar-link navbar-dropdown-toggle" data-index="${i}" data-path="${o}">${l}${e.text}${c}</button>`,s+='<ul class="navbar-dropdown-menu">'):(s+='<li class="navbar-item navbar-dropdown navbar-dropdown-sub">',s+=`<button class="navbar-dropdown-toggle navbar-submenu-toggle" data-path="${o}">${l}${e.text}${c}</button>`,s+='<ul class="navbar-dropdown-menu navbar-dropdown-submenu">'),s+=this._renderItems(e.items,t+1,o),s+="</ul></li>";else{const r=e.url||"#",a=e.external||r.startsWith("http://")||r.startsWith("https://")?' target="_blank" rel="noopener noreferrer"':"";if(0===t)s+=`<li class="navbar-item"><a href="${r}" class="navbar-link${e.active?" active":""}" data-index="${i}" data-path="${o}"${a}>${l}${e.text}</a></li>`;else{s+=`<li><a href="${r}" class="navbar-dropdown-item" data-path="${o}"${1===t?` data-index="${n}" data-subindex="${i}"`:""}${a}>${l}${e.text}</a></li>`}}}),s}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",()=>{this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-link:not(.navbar-dropdown-toggle)");if(t){const n=parseInt(t.dataset.index,10);this.options.onItemClick&&e.preventDefault(),this._fire("itemclick",this.options.items[n],n,e),window.innerWidth<this.options.collapseAt&&this.collapse()}const n=e.target.closest(".navbar-dropdown-item");if(n){this.options.onItemClick&&e.preventDefault();const t=n.dataset.path,s=t?t.split(".").map(e=>parseInt(e,10)):[parseInt(n.dataset.index,10),parseInt(n.dataset.subindex,10)];let i={items:this.options.items};for(let e=0;e<s.length-1;e++)i=i.items[s[e]];const o=s[s.length-1],r=i.items[o],a=i.items===this.options.items?null:i;this._fire("itemclick",r,o,e,a)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-dropdown-toggle");if(!t)return;const n=t.closest(".navbar-dropdown");if(this._pinned===n)return this._pinned=null,this._hoverSuppressed=n,void this._reconcileDropdowns(null,!0);this._pinned=n,this._hoverSuppressed=null,this._reconcileDropdowns(n)}),this._addEventListener(document,"click",e=>{e.target.closest(".navbar-dropdown")||(this._pinned=null,this._hoverSuppressed=null,this._reconcileDropdowns(null,!0))}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&(this._collapse?.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false"))}),this.options.appearOnHover&&(this._addEventListener(this.element,"mouseover",e=>{window.innerWidth<this.options.collapseAt||e.target.closest(".navbar-dropdown")&&(this._hoverSuppressed&&this._hoverSuppressed.contains(e.target)||(this._hoverSuppressed=null,clearTimeout(this._navCloseTimer),this._reconcileDropdowns(e.target)))}),this._addEventListener(this.element,"mouseout",e=>{window.innerWidth<this.options.collapseAt||e.relatedTarget&&this.element.contains(e.relatedTarget)||(clearTimeout(this._navCloseTimer),this._navCloseTimer=setTimeout(()=>{this._reconcileDropdowns(null)},this.options.hoverCloseDelay))}))}_reconcileDropdowns(e,t=!1){const n=new Set,s=e=>{for(let t=e;t&&t!==this.element;t=t.parentElement)t.classList&&t.classList.contains("navbar-dropdown")&&n.add(t)};s(e),!t&&this._pinned&&s(this._pinned),this.element.querySelectorAll(".navbar-dropdown").forEach(e=>{n.has(e)?e.classList.contains("open")||(e.classList.add("open"),this._positionMenu(e)):e.classList.remove("open")})}_positionMenu(e){if(window.innerWidth<this.options.collapseAt)return;const t=e.querySelector(":scope > .navbar-dropdown-menu");if(!t)return;const n=t.classList.contains("navbar-dropdown-submenu");t.classList.remove("navbar-dropdown-flip-x","navbar-dropdown-flip-end"),t.style.top="",t.style.maxHeight="",t.style.overflowY="",requestAnimationFrame(()=>{let e=t.getBoundingClientRect();if(!e.width&&!e.height)return;e.right>window.innerWidth-8&&(t.classList.add(n?"navbar-dropdown-flip-x":"navbar-dropdown-flip-end"),e=t.getBoundingClientRect());const s=e.bottom-(window.innerHeight-8);s>0&&(n?t.style.top=-Math.min(Math.ceil(s),Math.floor(e.top-8))+"px":t.querySelector(".navbar-dropdown-sub")||(t.style.maxHeight=Math.max(120,Math.floor(window.innerHeight-e.top-8))+"px",t.style.overflowY="auto"))})}setActive(e){return this.options.items.forEach((t,n)=>{t.active=n===e}),this._render(),this}setItems(e){return this.options.items=e,this._render(),this}expand(){return this._collapse&&(this._collapse.classList.add("show"),this._isCollapsed=!1,this._toggle&&this._toggle.setAttribute("aria-expanded","true")),this}collapse(){return this._collapse&&(this._collapse.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false")),this}toggle(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}destroy(){clearTimeout(this._navCloseTimer),this._pinned=null,this._hoverSuppressed=null,super.destroy()}}class Gs extends C{static componentName="sidebar";static defaults={position:"left",fixed:!0,width:"250px",top:"0",header:null,items:[],footer:null,variant:"dark",collapsible:!0,collapseAt:768,activeSection:null,expandedSections:[],persistExpanded:!1,persistKey:null,animationDuration:200,push:!0,contentSelector:".main-content",scrollSpy:!1,scrollSpyOffset:"-100px 0px -50% 0px",scrollSpyThreshold:.5,floating:!1,customContent:null,collapsibleDesktop:!1,collapsedWidth:"60px",persistCollapsed:!1,persistCollapseKey:null,onItemClick:null,onBeforeOpen:null,onBeforeClose:null,onToggle:null,onExpand:null,onCollapse:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._isCollapsed=!1,this._expandedItems=new Set(this.options.expandedSections||[]),this._init()}_init(){this.element&&(this._loadExpandedState(),this._loadCollapsedState(),this._findContentElement(),this._render(),this._bindEvents(),this._scanIcons(),this._handleInitialPushState(),this.options.scrollSpy&&this._initScrollSpy(),this._isCollapsed&&this.options.collapsibleDesktop&&setTimeout(()=>{this._createFloatingToggle()},0))}_findContentElement(){this.options.push&&this.options.contentSelector&&(this._contentElement=document.querySelector(this.options.contentSelector),this._contentElement||console.warn(`[Sidebar] Push mode enabled but content element "${this.options.contentSelector}" not found`))}_handleInitialPushState(){if(this.options.push&&this._contentElement){const e=window.innerWidth>=this.options.collapseAt;(!this.options.collapsible||e)&&this._applyPush()}}_render(){const{position:e,fixed:t,width:n,top:s,header:i,items:o,footer:r,variant:a,collapsible:l,collapsibleDesktop:c,collapsedWidth:h}=this.options;this.element.className="sidebar",this.element.classList.add(`sidebar-${a}`),this.element.classList.add(`sidebar-${e}`),t&&this.element.classList.add("sidebar-fixed"),c&&this.element.classList.add("sidebar-desktop-collapsible"),this._isCollapsed&&c&&this.element.classList.add("sidebar-collapsed"),n&&(this.element.style.setProperty("--sidebar-width",n),this.element.style.width=n),h&&this.element.style.setProperty("--sidebar-collapsed-width",h),s&&t&&(this.element.style.top=s,this.element.style.height=`calc(100vh - ${s})`),this.element.setAttribute("role","navigation"),this.element.setAttribute("aria-label","Sidebar navigation");let d="";if(i){if(d+='<div class="sidebar-header">',i.icon&&(d+=`<span class="sidebar-header-icon" data-icon="${i.icon}" data-size="24"></span>`),i.title&&(d+=`<h3 class="sidebar-header-title">${i.title}</h3>`),l&&!1!==i.toggle){const e="right"===this.options.position?"chevron-right":"chevron-left",t=this._isCollapsed&&c?"chevron-right":e;d+=`\n <button class="sidebar-toggle-btn" aria-label="Toggle sidebar" aria-expanded="${this._isOpen}">\n <span class="sidebar-toggle-icon" data-icon="${t}" data-size="20"></span>\n </button>\n `}d+="</div>"}d+='<nav class="sidebar-nav">',d+=this._renderItems(o),d+="</nav>",r&&(d+='<div class="sidebar-footer">',r.html?d+=r.html:r.text&&(d+=`<p class="sidebar-footer-text">${r.text}</p>`),d+="</div>"),this.element.innerHTML=d,this._toggle=this.element.querySelector(".sidebar-toggle-btn"),this._nav=this.element.querySelector(".sidebar-nav"),this._overlay=null,this._floatingToggle=null}_renderItems(e,t=0,n=""){if(!e||0===e.length)return"";let s=`<ul class="sidebar-menu" data-depth="${t}">`;return e.forEach((e,i)=>{const o=n?`${n}.${i}`:`${i}`;if(e.divider)return void(s+='<li class="sidebar-divider"></li>');if(e.heading)return void(s+=`<li class="sidebar-heading">${e.heading}</li>`);const r=e.items&&e.items.length>0,a=this._expandedItems.has(o),l=e.section===this.options.activeSection;s+=`<li class="sidebar-item ${r?"has-children":""} ${a?"open":""}" data-path="${o}" data-depth="${t}">`,s+=r?`\n <button class="sidebar-link sidebar-link-toggle ${l?"active":""}" data-path="${o}">\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n <svg class="sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M9 18l6-6-6-6"/>\n </svg>\n </button>\n `:`\n <a href="${e.url||"#"}" class="sidebar-link ${l?"active":""}" data-path="${o}" ${e.section?`data-section="${e.section}"`:""}>\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n </a>\n `,r&&(s+=`<div class="sidebar-submenu" ${a?'style="display: block;"':""}>`,s+=this._renderItems(e.items,t+1,o),s+="</div>"),s+="</li>"}),s+="</ul>",s}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",e=>{e.stopPropagation();window.innerWidth>=this.options.collapseAt&&this.options.collapsibleDesktop?this.toggleCollapse():this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link:not(.sidebar-link-toggle)");if(t){const n=t.dataset.path,s=this._getItemByPath(n);s&&s.section&&this.setActive(s.section),this._fire("itemclick",s,n,e),window.innerWidth<this.options.collapseAt&&this.close()}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link-toggle");if(t){e.preventDefault();const n=t.dataset.path,s=t.closest(".sidebar-item");this._toggleSubmenu(s,n)}}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&this.close()}),this._addEventListener(document,"click",e=>{this._isOpen&&!this.element.contains(e.target)&&window.innerWidth<this.options.collapseAt&&this.close()})}_toggleSubmenu(e,t){const n=e.querySelector(":scope > .sidebar-submenu");if(!n)return;const s=e.classList.contains("open"),i=this._getItemByPath(t),o=parseInt(e.dataset.depth,10);s?(this._collapseSubmenu(e,n),this._expandedItems.delete(t),this._fire("collapse",i,o)):(this._expandSubmenu(e,n),this._expandedItems.add(t),this._fire("expand",i,o)),this._saveExpandedState()}_expandSubmenu(e,t){e.classList.add("open"),t.style.display="block";const n=t.scrollHeight;t.style.height="0",t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height=`${n}px`,setTimeout(()=>{t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_collapseSubmenu(e,t){const n=t.scrollHeight;t.style.height=`${n}px`,t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height="0",setTimeout(()=>{e.classList.remove("open"),t.style.display="",t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_getItemByPath(e){if(!e)return null;const t=e.split(".").map(e=>parseInt(e,10));let n=this.options.items;for(const e of t){if(!n||!n[e])return null;n=n[e],n.items&&t.indexOf(e)<t.length-1&&(n=n.items)}return n}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_loadExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=localStorage.getItem(e);if(t){const e=JSON.parse(t);this._expandedItems=new Set(e)}}catch(e){console.warn("Failed to load sidebar expanded state:",e)}}_saveExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=Array.from(this._expandedItems);localStorage.setItem(e,JSON.stringify(t))}catch(e){console.warn("Failed to save sidebar expanded state:",e)}}_loadCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`,t=localStorage.getItem(e);null!==t&&(this._isCollapsed="true"===t)}catch(e){console.warn("Failed to load sidebar collapsed state:",e)}}_saveCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`;localStorage.setItem(e,this._isCollapsed.toString())}catch(e){console.warn("Failed to save sidebar collapsed state:",e)}}_initScrollSpy(){const e=[];this.element.querySelectorAll(".sidebar-link[data-section]").forEach(t=>{const n=t.dataset.section,s=document.getElementById(n);s&&e.push({element:s,id:n,link:t})}),0!==e.length&&(this._scrollSpyObserver=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=e.find(e=>e.element===t.target);n&&this.setActive(n.id)}})},{threshold:this.options.scrollSpyThreshold,rootMargin:this.options.scrollSpyOffset}),e.forEach(({element:e})=>{this._scrollSpyObserver.observe(e)}))}_createOverlay(){this._overlay||(this._overlay=document.createElement("div"),this._overlay.className="sidebar-overlay",document.body.appendChild(this._overlay),this._addEventListener(this._overlay,"click",()=>{this.close()}))}_removeOverlay(){this._overlay&&(this._overlay.remove(),this._overlay=null)}_applyPush(){if(!this.options.push||!this._contentElement)return;const e="right"===this.options.position?"sidebar-push-active-right":"sidebar-push-active";this._contentElement.classList.add(e),this._contentElement.style.setProperty("--sidebar-push-width",this.options.width)}_removePush(){this.options.push&&this._contentElement&&this._contentElement.classList.remove("sidebar-push-active","sidebar-push-active-right")}open(){return this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this.element.classList.add("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","true"),window.innerWidth<this.options.collapseAt&&this._createOverlay(),this._applyPush(),this._fire("toggle",!0)),this}close(){return this._isOpen&&this._mayClose()?(this._isOpen=!1,this.element.classList.remove("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","false"),this._removeOverlay(),this._removePush(),this._fire("toggle",!1),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}collapse(){return!this.options.collapsibleDesktop||this._isCollapsed||(this._isCollapsed=!0,this.element.classList.add("sidebar-collapsed"),this._saveCollapsedState(),this._createFloatingToggle(),this._removePush(),this._fire("collapse")),this}expand(){if(!this.options.collapsibleDesktop||!this._isCollapsed)return this;this._isCollapsed=!1,this.element.classList.remove("sidebar-collapsed"),this._saveCollapsedState(),this._removeFloatingToggle(),this._applyPush();const e="right"===this.options.position?"chevron-right":"chevron-left";return this._updateToggleIcon(e),this._fire("expand"),this}_createFloatingToggle(){if(this._floatingToggle)return;this._floatingToggle=document.createElement("button"),this._floatingToggle.className="sidebar-floating-toggle show","right"===this.options.position&&this._floatingToggle.classList.add("right");const e="right"===this.options.position?"chevron-left":"chevron-right";this._floatingToggle.innerHTML=`<span data-icon="${e}" data-size="20"></span>`,this._floatingToggle.addEventListener("click",()=>{this.expand()}),document.body.appendChild(this._floatingToggle),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._floatingToggle)}_removeFloatingToggle(){this._floatingToggle&&(this._floatingToggle.remove(),this._floatingToggle=null)}_updateToggleIcon(e){if(!this._toggle)return;const t=this._toggle.querySelector(".sidebar-toggle-icon");t&&(t.setAttribute("data-icon",e),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._toggle))}toggleCollapse(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}setActive(e){return this.options.activeSection=e,this.element.querySelectorAll(".sidebar-link").forEach(t=>{t.dataset.section===e?t.classList.add("active"):t.classList.remove("active")}),this}setItems(e){return this.options.items=e,this._expandedItems.clear(),this._render(),this._bindEvents(),this._scanIcons(),this}addItem(e,t=null){return null===t||t>=this.options.items.length?this.options.items.push(e):this.options.items.splice(t,0,e),this._render(),this._bindEvents(),this._scanIcons(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render(),this._bindEvents(),this._scanIcons()),this}expandAll(){return this.element.querySelectorAll(".sidebar-item.has-children").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&!e.classList.contains("open")&&(this._expandSubmenu(e,n),this._expandedItems.add(t))}),this._saveExpandedState(),this}collapseAll(){return this.element.querySelectorAll(".sidebar-item.has-children.open").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&(this._collapseSubmenu(e,n),this._expandedItems.delete(t))}),this._saveExpandedState(),this}destroy(){this._scrollSpyObserver&&(this._scrollSpyObserver.disconnect(),this._scrollSpyObserver=null),this._removeOverlay(),this._removeFloatingToggle(),super.destroy()}}class Js extends C{static componentName="footer";static defaults={variant:"light",layout:"simple",brand:null,columns:[],links:[],social:[],copyright:null,className:"",position:"static"};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._scanIcons())}_render(){const{variant:e,layout:t,brand:n,columns:s,links:i,social:o,copyright:r,className:a,position:l}=this.options;this.element.className="footer",this.element.classList.add(`footer-${e}`),this.element.classList.add(`footer-${t}`),"static"!==l&&this.element.classList.add(`footer-${l}`),a&&this.element.classList.add(a),this.element.setAttribute("role","contentinfo");let c='<div class="footer-container">';"columns"===t&&s&&s.length>0?c+=this._renderColumnsLayout(n,s,o,r):c+="minimal"===t?this._renderMinimalLayout(r,o):this._renderSimpleLayout(n,i,o,r),c+="</div>",this.element.innerHTML=c}_renderSimpleLayout(e,t,n,s){let i='<div class="footer-simple-content">';return e&&(i+='<div class="footer-brand">',e.url&&(i+=`<a href="${e.url}" class="footer-brand-link">`),e.logo&&(i+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(i+=`<span class="footer-brand-text">${e.text}</span>`),e.url&&(i+="</a>"),i+="</div>"),t&&t.length>0&&(i+='<nav class="footer-nav">',t.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";i+=`<a href="${e.url||"#"}" class="footer-link">${t}${e.text}</a>`}),i+="</nav>"),n&&n.length>0&&(i+=this._renderSocial(n)),i+="</div>",s&&(i+=this._renderCopyright(s)),i}_renderColumnsLayout(e,t,n,s){let i="";return i+='<div class="footer-columns-content">',e&&(i+='<div class="footer-column footer-column-brand">',e.logo&&(i+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(i+=`<p class="footer-brand-text">${e.text}</p>`),e.description&&(i+=`<p class="footer-brand-description">${e.description}</p>`),i+="</div>"),t.forEach(e=>{i+='<div class="footer-column">',e.title&&(i+=`<h4 class="footer-column-title">${e.title}</h4>`),e.links&&e.links.length>0&&(i+='<ul class="footer-column-links">',e.links.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";i+=`<li><a href="${e.url||"#"}" class="footer-column-link">${t}${e.text}</a></li>`}),i+="</ul>"),i+="</div>"}),i+="</div>",i+='<div class="footer-bottom">',n&&n.length>0&&(i+=this._renderSocial(n)),s&&(i+=this._renderCopyright(s)),i+="</div>",i}_renderMinimalLayout(e,t){let n='<div class="footer-minimal-content">';return e&&(n+=this._renderCopyright(e)),t&&t.length>0&&(n+=this._renderSocial(t)),n+="</div>",n}_renderSocial(e){let t='<div class="footer-social">';return e.forEach(e=>{t+=`\n <a href="${e.url||"#"}" class="footer-social-link" aria-label="${e.label||e.icon}" target="_blank" rel="noopener noreferrer">\n <span data-icon="${e.icon}" data-size="20"></span>\n </a>\n `}),t+="</div>",t}_renderCopyright(e){return`<div class="footer-copyright">${"string"==typeof e?e:e.text||`© ${e.year||(new Date).getFullYear()} All rights reserved`}</div>`}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}setBrand(e){return this.options.brand=e,this._render(),this._scanIcons(),this}setLinks(e){return this.options.links=e,this._render(),this._scanIcons(),this}setColumns(e){return this.options.columns=e,this._render(),this._scanIcons(),this}setSocial(e){return this.options.social=e,this._render(),this._scanIcons(),this}setCopyright(e){return this.options.copyright=e,this._render(),this}}class Xs extends C{static componentName="autocomplete";static defaults={data:[],dataSource:null,minChars:1,maxResults:10,debounce:300,filterFn:null,renderItem:null,highlightMatches:!0,position:"auto",placeholder:"",emptyMessage:"No results found",loadingMessage:"Loading...",caseSensitive:!1,selectOnEnter:!0,clearOnSelect:!1,onSelect:null,onChange:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onFilter:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._isOpen=!1,this._activeIndex=-1,this._filteredData=[],this._loading=!1,this._debounceTimer=null,this._dropdown=null,this._list=null,this._loadingEl=null,this._emptyEl=null,this._init();const n=e=>{e!==this.getValue()&&this.setValue(e)};this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)}))}_init(){this.element&&("INPUT"===this.element.tagName?(this.options.placeholder&&this.element.setAttribute("placeholder",this.options.placeholder),this._createDropdown(),this._bindEvents(),this.element.setAttribute("role","combobox"),this.element.setAttribute("aria-autocomplete","list"),this.element.setAttribute("aria-expanded","false"),this.element.setAttribute("aria-controls",this._dropdown.id)):console.error("Autocomplete requires an input element"))}_createDropdown(){let e=this.element.parentElement;e&&e.classList.contains("dm-autocomplete")||(e=document.createElement("div"),e.className="dm-autocomplete",this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element)),this._dropdown=document.createElement("div"),this._dropdown.className="dm-autocomplete-dropdown",this._dropdown.id=`autocomplete-${Math.random().toString(36).substr(2,9)}`,this._dropdown.setAttribute("role","listbox"),this._dropdown.style.display="none",this._loadingEl=document.createElement("div"),this._loadingEl.className="dm-autocomplete-loading",this._loadingEl.textContent=this.options.loadingMessage,this._loadingEl.style.display="none",this._dropdown.appendChild(this._loadingEl),this._emptyEl=document.createElement("div"),this._emptyEl.className="dm-autocomplete-empty",this._emptyEl.textContent=this.options.emptyMessage,this._emptyEl.style.display="none",this._dropdown.appendChild(this._emptyEl),this._list=document.createElement("ul"),this._list.className="dm-autocomplete-list",this._dropdown.appendChild(this._list),e.appendChild(this._dropdown)}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this.element,"input",e),this._addEventListener(this.element,"keydown",t),this._addEventListener(this.element,"focus",()=>{this.element.value.length>=this.options.minChars&&this._filterData(this.element.value)}),this._addEventListener(this.element,"blur",e=>{setTimeout(()=>{this._dropdown.contains(document.activeElement)||this.close()},200)})}_handleInput(e){const t=e.target.value;this._debounceTimer&&clearTimeout(this._debounceTimer),this.model&&this.modelKey&&this.model.set(this.modelKey,t),this._fire("change",t,e),t.length<this.options.minChars?this.close():this._debounceTimer=setTimeout(()=>{this._filterData(t)},this.options.debounce)}_handleKeydown(e){if(!this._isOpen)return void("ArrowDown"===e.key&&this.element.value.length>=this.options.minChars&&(e.preventDefault(),this._filterData(this.element.value)));const t=this._list.querySelectorAll(".dm-autocomplete-item");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Enter":e.preventDefault(),this._activeIndex>=0&&this.options.selectOnEnter&&this._selectItem(this._activeIndex);break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this._activeIndex>=0&&(e.preventDefault(),this._selectItem(this._activeIndex)),this.close()}}async _filterData(e){let t=[];if(this.options.dataSource){this._setLoading(!0);try{t=await this.options.dataSource(e)}catch(e){console.error("Autocomplete dataSource error:",e),t=[]}this._setLoading(!1)}else{const n=this.options.filterFn||this._defaultFilter.bind(this);t=this.options.data.filter(t=>n(t,e))}this.options.maxResults&&(t=t.slice(0,this.options.maxResults)),t=this._fire("filter",t,e)||t,this._filteredData=t,this._renderResults(e)}_defaultFilter(e,t){const n="string"==typeof e?e:e.label||e.value||String(e),s=this.options.caseSensitive?t:t.toLowerCase();return(this.options.caseSensitive?n:n.toLowerCase()).includes(s)}_renderResults(e){if(this._list.innerHTML="",this._activeIndex=-1,0===this._filteredData.length)return this._emptyEl.style.display="block",this._list.style.display="none",void this.open();this._emptyEl.style.display="none",this._list.style.display="block",this._filteredData.forEach((t,n)=>{const s=document.createElement("li");if(s.className="dm-autocomplete-item",s.setAttribute("role","option"),s.setAttribute("data-index",n),this.options.renderItem){const n=this.options.renderItem(t,e);s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const n="string"==typeof t?t:t.label||t.value||String(t);this.options.highlightMatches?s.innerHTML=this._highlightMatch(n,e):s.textContent=n}s.addEventListener("click",()=>{this._selectItem(n)}),s.addEventListener("mouseenter",()=>{this._activeIndex=n,this._updateActive()}),this._list.appendChild(s)}),this.open()}_highlightMatch(e,t){if(!t)return e;const n=new RegExp(`(${this._escapeRegex(t)})`,this.options.caseSensitive?"g":"gi");return e.replace(n,'<span class="dm-autocomplete-match">$1</span>')}_escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_updateActive(){const e=this._list.querySelectorAll(".dm-autocomplete-item");if(e.forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.setAttribute("aria-selected","true"),e.scrollIntoView({block:"nearest"})):(e.classList.remove("active"),e.setAttribute("aria-selected","false"))}),this._activeIndex>=0){const t=e[this._activeIndex];if(t){const e=t.id||`autocomplete-item-${this._activeIndex}`;t.id=e,this.element.setAttribute("aria-activedescendant",e)}}else this.element.removeAttribute("aria-activedescendant")}_selectItem(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value||t.label||String(t);this.element.value=n,this._fire("select",t,{target:this.element}),this.options.clearOnSelect&&setTimeout(()=>{this.element.value=""},100),this.close(),this.element.focus()}_setLoading(e){this._loading=e,e?(this._loadingEl.style.display="block",this._list.style.display="none",this._emptyEl.style.display="none",this.open()):this._loadingEl.style.display="none"}_updatePosition(){if(!this._isOpen||!this._dropdown)return;const e=this.element.getBoundingClientRect(),t=this._dropdown.offsetHeight,n=window.innerHeight;let s=this.options.position;if("auto"===s){const i=n-e.bottom,o=e.top;s=i>=t||i>=o?"below":"above"}"above"===s?(this._dropdown.style.top="auto",this._dropdown.style.bottom="100%",this._dropdown.style.marginBottom="4px",this._dropdown.style.marginTop="0"):(this._dropdown.style.top="100%",this._dropdown.style.bottom="auto",this._dropdown.style.marginTop="4px",this._dropdown.style.marginBottom="0")}open(){return this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this._dropdown.style.display="block",this.element.setAttribute("aria-expanded","true"),this._updatePosition(),this._fire("open")),this}close(){return this._isOpen&&this._mayClose()?(this._isOpen=!1,this._dropdown.style.display="none",this.element.setAttribute("aria-expanded","false"),this._activeIndex=-1,this._fire("close"),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setValue(e){return this.element.value=e,this}getValue(){return this.element.value}setData(e){return this.options.data=e,this}refresh(){const e=this.element.value;return e.length>=this.options.minChars&&this._filterData(e),this}focus(){return this.element.focus(),this}clearValue(){return this.element.value="",this.close(),this}destroy(){this._forcedClose(),this._dropdown&&this._dropdown.parentNode&&this._dropdown.parentNode.removeChild(this._dropdown),this._debounceTimer&&clearTimeout(this._debounceTimer),this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Zs extends C{static componentName="pillbox";static defaults={data:[],value:[],placeholder:"Add items...",searchable:!0,creatable:!1,maxItems:null,duplicates:!1,clearable:!0,size:"medium",renderPill:null,renderOption:null,pillTemplate:"<span>{label}</span>",validatePill:null,maxItemsMessage:"Maximum {max} items allowed",duplicateMessage:"Item already exists",noResultsMessage:"No results found",onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onAdd:null,onRemove:null,onChange:null,onCreate:null,onMaxReached:null,onValidationError:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._pills=[],this._isOpen=!1,this._activeIndex=-1,this._container=null,this._input=null,this._clearBtn=null,this._dropdown=null,this._optionsList=null,this._filteredData=[],this._init();const n=e=>{if(!Array.isArray(e))return;const t=this.getValue();JSON.stringify(t)!==JSON.stringify(e)&&this.setValue(e)};this._container&&(this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)})))}_init(){this.element&&("INPUT"===this.element.tagName?(this.element.style.display="none",this._createStructure(),this.options.value&&this.options.value.length>0&&this.options.value.forEach(e=>{const t=this._findItemByValue(e);t?this._addPill(t.value,t.label):"string"==typeof e&&this._addPill(e,e)}),this._bindEvents(),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false")):console.error("Pillbox requires an input element"))}_createStructure(){const e=document.createElement("div");if(e.className=`dm-pillbox dm-pillbox-${this.options.size}`,this._container=document.createElement("div"),this._container.className="dm-pillbox-container",this._input=document.createElement("input"),this._input.type="text",this._input.className="dm-pillbox-input",this._input.placeholder=this.options.placeholder,this._container.appendChild(this._input),e.appendChild(this._container),this.options.clearable&&(this._clearBtn=document.createElement("button"),this._clearBtn.type="button",this._clearBtn.className="dm-pillbox-clear",this._clearBtn.innerHTML="×",this._clearBtn.title="Clear all",this._clearBtn.style.display="none",e.appendChild(this._clearBtn)),this.options.searchable){this._dropdown=document.createElement("div"),this._dropdown.className="dm-pillbox-dropdown",this._dropdown.style.display="none",this._optionsList=document.createElement("ul"),this._optionsList.className="dm-pillbox-options",this._dropdown.appendChild(this._optionsList);const t=document.createElement("div");t.className="dm-pillbox-empty",t.textContent=this.options.noResultsMessage,t.style.display="none",this._dropdown.appendChild(t),e.appendChild(this._dropdown)}this.element.parentNode.insertBefore(e,this.element.nextSibling),this._wrapper=e}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this._input,"input",e),this._addEventListener(this._input,"keydown",t),this._addEventListener(this._input,"focus",()=>{this.options.searchable&&this._input.value&&this._filterOptions(this._input.value)}),this._addEventListener(this._input,"blur",()=>{setTimeout(()=>{this._dropdown?.contains(document.activeElement)||this.close()},200)}),this._clearBtn&&this._addEventListener(this._clearBtn,"click",()=>{this.clear(),this._input.focus()}),this._addEventListener(this._container,"click",e=>{e.target===this._container&&this._input.focus()})}_handleInput(e){const t=e.target.value;this.options.searchable&&t?this._filterOptions(t):this.close()}_handleKeydown(e){const t=this._input.value;if("Backspace"===e.key&&!t&&this._pills.length>0){e.preventDefault();const t=this._container.querySelectorAll(".dm-pill")[this._pills.length-1];return void this._removePill(t)}if("Enter"===e.key&&t)return e.preventDefault(),void(this._isOpen&&this._activeIndex>=0?this._selectOption(this._activeIndex):this.options.creatable&&this._createPill(t));if(this._isOpen){const t=this._optionsList.querySelectorAll(".dm-pillbox-option");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this.close()}}}_filterOptions(e){const t=e.toLowerCase(),n=this._pills.map(e=>e.value);this._filteredData=this.options.data.filter(e=>{const s="string"==typeof e?e:e.value,i="string"==typeof e?e:e.label||e.value;return!n.includes(s)&&(!e.disabled&&i.toLowerCase().includes(t))}),this._renderOptions()}_renderOptions(){this._optionsList.innerHTML="",this._activeIndex=-1;const e=this._dropdown.querySelector(".dm-pillbox-empty");if(0===this._filteredData.length)return e.style.display="block",this._optionsList.style.display="none",void this.open();e.style.display="none",this._optionsList.style.display="block",this._filteredData.forEach((e,t)=>{const n=document.createElement("li");if(n.className="dm-pillbox-option",n.setAttribute("data-index",t),this.options.renderOption){const t=this.options.renderOption(e);n.innerHTML="string"==typeof t?t:"","string"!=typeof t&&n.appendChild(t)}else{const t="string"==typeof e?e:e.label||e.value;n.textContent=t}n.addEventListener("click",()=>{this._selectOption(t)}),n.addEventListener("mouseenter",()=>{this._activeIndex=t,this._updateActive()}),this._optionsList.appendChild(n)}),this.open()}_updateActive(){this._optionsList.querySelectorAll(".dm-pillbox-option").forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.scrollIntoView({block:"nearest"})):e.classList.remove("active")})}_selectOption(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value,s="string"==typeof t?t:t.label||t.value;this._addPill(n,s),this._input.value="",this.close(),this._input.focus()}_createPill(e){if(!e.trim())return;const t=this._validate(e);t?this._fire("validationerror",t,e):(this._addPill(e,e),this._input.value="",this._fire("create",e))}_addPill(e,t){const n=this._validate(e);if(n)return void this._fire("validationerror",n,e);const s=document.createElement("div");if(s.className="dm-pill",s.setAttribute("data-value",e),this.options.renderPill){const n=this.options.renderPill({value:e,label:t});s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const e=this.options.pillTemplate.replace("{label}",t);s.innerHTML=e}const i=document.createElement("button");i.type="button",i.className="dm-pill-remove",i.innerHTML="×",i.title=`Remove ${t}`,i.addEventListener("click",e=>{e.stopPropagation(),this._removePill(s)}),s.appendChild(i),this._container.insertBefore(s,this._input),this._pills.push({value:e,label:t,element:s}),this._updateHiddenInput(),this._clearBtn&&(this._clearBtn.style.display="block"),this._fire("add",e,s),this._triggerChange()}_removePill(e){const t=e.getAttribute("data-value"),n=this._pills.findIndex(e=>e.value===t);-1!==n&&(this._pills[n],e.remove(),this._pills.splice(n,1),this._updateHiddenInput(),0===this._pills.length&&this._clearBtn&&(this._clearBtn.style.display="none"),this._fire("remove",t,e),this._triggerChange())}_validate(e){if(this.options.maxItems&&this._pills.length>=this.options.maxItems)return this._fire("maxreached"),this.options.maxItemsMessage.replace("{max}",this.options.maxItems);if(!this.options.duplicates&&this._pills.some(t=>t.value===e))return this.options.duplicateMessage;if(this.options.validatePill){const t=this.options.validatePill(e);if(!0!==t&&void 0!==t)return"string"==typeof t?t:"Invalid value"}return null}_findItemByValue(e){return this.options.data.find(t=>("string"==typeof t?t:t.value)===e)}_updateHiddenInput(){const e=this._pills.map(e=>e.value);this.element.value=JSON.stringify(e)}_triggerChange(){const e=this.getValue();this.model&&this.modelKey&&this.model.set(this.modelKey,e),this._fire("change",e)}open(){return!this._dropdown||this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this._dropdown.style.display="block",this._input.setAttribute("aria-expanded","true"),this._fire("open")),this}close(){return this._dropdown&&this._isOpen&&this._mayClose()?(this._isOpen=!1,this._dropdown.style.display="none",this._input.setAttribute("aria-expanded","false"),this._activeIndex=-1,this._fire("close"),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}getValue(){return this._pills.map(e=>e.value)}setValue(e){return this.clear(),Array.isArray(e)&&e.forEach(e=>{const t=this._findItemByValue(e);if(t){const n="string"==typeof t?t:t.label||t.value;this._addPill(e,n)}else"string"==typeof e&&this._addPill(e,e)}),this}addPill(e,t){return t=t||e,this._addPill(e,t),this}removePill(e){const t=this._container.querySelector(`.dm-pill[data-value="${e}"]`);return t&&this._removePill(t),this}removePillAt(e){return e>=0&&e<this._pills.length&&this._removePill(this._pills[e].element),this}clear(){return[...this._pills].forEach(e=>{this._removePill(e.element)}),this}getCount(){return this._pills.length}setData(e){return this.options.data=e,this}focus(){return this._input.focus(),this}enable(){return this._input.disabled=!1,this._wrapper.classList.remove("disabled"),this}disable(){return this._input.disabled=!0,this._wrapper.classList.add("disabled"),this.close(),this}destroy(){this._forcedClose(),this._wrapper&&this._wrapper.parentNode&&this._wrapper.parentNode.removeChild(this._wrapper),this.element.style.display="",this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Qs extends C{static componentName="slideover";static _stack=[];static _top(){return Qs._prune(),Qs._stack[Qs._stack.length-1]||null}static _prune(){Qs._stack=Qs._stack.filter(e=>e._isOpen&&e.element&&e.element.isConnected)}static _removeFromStack(e){Qs._prune();const t=Qs._stack.lastIndexOf(e);-1!==t&&Qs._stack.splice(t,1)}static defaults={position:"right",size:"lg",backdrop:!0,backdropClose:!0,keyboard:!0,animation:!0,animationDuration:300,closeOnEscape:!0,title:"",content:"",closable:!0,closeIcon:"x",headerClass:"",bodyClass:"",footerClass:"",customSizes:{},trapFocus:!0,returnFocus:!0,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onClosed:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._backdrop=null,this._trap=null,this._trapAsked=!!t&&Object.prototype.hasOwnProperty.call(t,"trapFocus")&&!1!==t.trapFocus&&"false"!==t.trapFocus,this._originalBodyOverflow=null,this._keydownHandler=null,this._init()}_init(){this.element&&(this._setupElement(),this._bindEvents())}_setupElement(){const e=this.element;this.options,e.classList.add("dm-slideover"),e.style.position="fixed",e.style.top="0",e.style.height="100vh",e.style.backgroundColor="var(--dm-surface, #fff)",e.style.boxShadow=this._getBoxShadow(),e.style.zIndex="9999",e.style.display="none",e.style.flexDirection="column",e.style.overflow="hidden",this._applyPosition(),this._applySize(),this._applyAnimation()}_applyPosition(){const e=this.element,t=this.options.position;switch(e.classList.remove("dm-slideover-left","dm-slideover-right","dm-slideover-top","dm-slideover-bottom"),e.classList.add(`dm-slideover-${t}`),t){case"left":e.style.left="-100%",e.style.right="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"right":e.style.right="-100%",e.style.left="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"top":e.style.top="-100%",e.style.bottom="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue();break;case"bottom":e.style.bottom="-100%",e.style.top="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue()}}_applySize(){const e=this._getSizeValue(),t=this.options.position;["left","right"].includes(t)?this.element.style.width=e:this.element.style.height=e}_getSizeValue(){const{size:e,customSizes:t}=this.options;if(t&&t[e])return t[e];const n={sm:"25%",md:"50%",lg:"75%",xl:"90%",full:"100%"};return"string"==typeof e&&(e.includes("px")||e.includes("%")||e.includes("rem")||e.includes("em"))?e:n[e]||n.lg}_applyAnimation(){this.options.animation?this.element.style.transition=`all ${this.options.animationDuration}ms ease`:this.element.style.transition="none"}_getBoxShadow(){switch(this.options.position){case"left":return"2px 0 8px rgba(0,0,0,0.15)";case"right":default:return"-2px 0 8px rgba(0,0,0,0.15)";case"top":return"0 2px 8px rgba(0,0,0,0.15)";case"bottom":return"0 -2px 8px rgba(0,0,0,0.15)"}}_bindEvents(){if(this.options.closable){const e=this.element.querySelector('[data-dismiss="slideover"], .dm-slideover-close');e&&this._addEventListener(e,"click",()=>this.close())}this._keydownHandler=e=>{if(this._isOpen&&this.options.keyboard&&"Escape"===e.key){if(Qs._top()!==this)return;this.options.closeOnEscape&&this.close()}}}_createBackdrop(){this.options.backdrop&&(this._backdrop=document.createElement("div"),this._backdrop.className="dm-slideover-backdrop",this._backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9998;\n display: none;\n transition: opacity ${this.options.animationDuration}ms ease;\n opacity: 0;\n `,this.options.backdropClose&&this._backdrop.addEventListener("click",()=>this.close()),document.body.appendChild(this._backdrop))}_showBackdrop(){this._backdrop&&(this._backdrop.style.display="block",requestAnimationFrame(()=>{this._backdrop&&(this._backdrop.style.opacity="1")}))}_hideBackdrop(){this._backdrop&&(this._backdrop.style.opacity="0",setTimeout(()=>{this._backdrop&&(this._backdrop.style.display="none")},this.options.animationDuration))}_getOpenPosition(){switch(this.options.position){case"left":return{left:"0",right:"auto"};case"right":return{right:"0",left:"auto"};case"top":return{top:"0",bottom:"auto"};case"bottom":return{bottom:"0",top:"auto"}}}open(){if(this._isOpen)return this;const e=this.element;if(!e)return this;if(!1===this._fire("beforeopen",this))return this;this.options.backdrop&&!this._backdrop&&this._createBackdrop(),this._originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._showBackdrop(),e.style.display="flex";const t=this._getOpenPosition();return requestAnimationFrame(()=>{Object.assign(e.style,t)}),this.options.keyboard&&document.addEventListener("keydown",this._keydownHandler),this._isOpen=!0,Qs._removeFromStack(this),Qs._stack.push(this),this._startTrap(),setTimeout(()=>{this._fire("open",this),this._createForm()},this.options.animationDuration),this}_wantsTrap(){const e=this.options;return!1!==e.trapFocus&&"false"!==e.trapFocus&&(!!e.backdrop||!0===this._trapAsked)}_startTrap(){if(!this._wantsTrap()||"undefined"==typeof document)return;const e=this.element;e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),this._addedTabindex=!0),this._trap||(this._trap=pt(e,{initialFocus:()=>{const t=document.activeElement;return t&&t!==document.body&&e.contains(t)?t:e},returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1})),this._trap.activate()}_stopTrap(){this._trap&&this._trap.isActive()&&this._trap.deactivate({returnFocus:!1!==this.options.returnFocus&&"false"!==this.options.returnFocus})}_createForm(){if(this._schema&&!this._formaForm&&window.Domma&&window.Domma.forms&&window.Domma.forms.create)try{console.log("📝 Creating Forma form with schema:",this._schema);let e=this._schema;if(this._schema.fields&&Array.isArray(this._schema.fields)){e={};for(const t of this._schema.fields)t.name&&(e[t.name]={type:t.type||"string",label:t.label,required:t.required||!1,default:t.defaultValue,min:t.validation?.minLength,max:t.validation?.maxLength,pattern:t.validation?.pattern?new RegExp(t.validation.pattern):void 0,options:t.options,formConfig:{placeholder:t.placeholder,hint:t.help,rows:t.rows,accept:t.accept,multiple:t.multiple}});console.log("📝 Converted schema:",e)}const t={onSubmit:(e,t)=>(console.log("📝 Schema form submitted:",e),this._onSave&&this._onSave(e,t,this),!1),onCancel:()=>{console.log("📝 Schema form cancelled"),this.close()},layout:"stacked",showLabels:!0,showHelperText:!0,showHints:!0,cssFramework:"domma",className:"domma-form",fieldClassName:"col-6 mb-3",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint"};this._formaForm=window.Domma.forms.create(e,this._data||{},t),this._formaForm.renderTo("#schema-form-container"),console.log("📝 Forma form created and rendered successfully")}catch(e){console.error("📝 Failed to create Forma form:",e);const t=this.element.querySelector(".dm-slideover-body");t&&(t.innerHTML="<p>Form creation failed. Please try again.</p>")}}close(){if(!this._isOpen)return this;const e=this.element;if(!e)return this;if(!this._mayClose(this))return this;if(this._stopTrap(),this._fire("close",this),this._applyPosition(),this._hideBackdrop(),null!==this._originalBodyOverflow&&(document.body.style.overflow=this._originalBodyOverflow),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Qs._removeFromStack(this),this._formaForm)try{this._formaForm.destroy&&this._formaForm.destroy(),this._formaForm=null;const t=e.querySelector("#schema-form-container");t&&(t.innerHTML="")}catch(e){console.warn("Error cleaning up form:",e)}return setTimeout(()=>{e.style.display="none",this._isOpen=!1,this._fire("closed",this)},this.options.animationDuration),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setTitle(e){const t=this.element.querySelector(".dm-slideover-header .dm-slideover-title");return t&&(t.textContent=e),this}setContent(e){const t=this.element.querySelector(".dm-slideover-body");return t&&("string"==typeof e?t.innerHTML=p.sanitise(String(e)):e instanceof Element&&(t.innerHTML="",t.appendChild(e))),this}setSize(e){return this.options.size=e,this._applySize(),this}setPosition(e){return this.options.position=e,this.element.style.boxShadow=this._getBoxShadow(),this._applyPosition(),this}destroy(){this._forcedClose(),this._backdrop&&(this._backdrop.remove(),this._backdrop=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Qs._removeFromStack(this),this._trap&&(this._trap.destroy(),this._trap=null),this._addedTabindex&&this.element&&(this.element.removeAttribute("tabindex"),this._addedTabindex=!1),super.destroy()}static create(e={}){const t=document.createElement("div");t.className="dm-slideover";const{title:n,content:s,schema:i,data:o={},closable:r=!0,closeIcon:a="x",onSave:l}=e;let c="";if((n||r)&&(c+='<div class="dm-slideover-header">',n&&(c+=`<h5 class="dm-slideover-title">${n}</h5>`),r&&(c+='<button type="button" class="btn btn-ghost-secondary dm-slideover-close" data-dismiss="slideover" aria-label="Close">',window.Domma&&window.Domma.icons?c+=Domma.icons.render(a,{size:20}).outerHTML:c+="×",c+="</button>"),c+="</div>"),c+='<div class="dm-slideover-body">',i?(c+='<div class="container-fluid p-4">',c+='<div class="card">',c+='<div class="card-body p-4">',c+='<div class="row g-3" id="schema-form-container"></div>',c+="</div>",c+="</div>",c+="</div>"):s&&(c+="string"==typeof s?s:""),c+="</div>",t.innerHTML=c,document.body.appendChild(t),s instanceof Element&&!i){const e=t.querySelector(".dm-slideover-body");e.innerHTML="",e.appendChild(s)}const h=new Qs(t,e);return h._schema=i,h._data=o,h._onSave=l,h}}class ei extends C{static componentName="progression";static defaults={mode:"timeline",items:[],layout:"vertical",animation:!0,animationDelay:100,responsive:!0,theme:"default",clickable:!1,onItemClick:null,allowHtml:!1,yearWidth:"80px",contentMaxWidth:"600px",dateFormat:"YYYY",showConnector:!0,showProgress:!0,progressPosition:"top",statusIcons:!0,allowStatusChange:!1,onStatusChange:null,currentItem:null,completedAnimation:!0,icons:{planned:"circle","in-progress":"clock",completed:"check-circle",blocked:"alert-circle",cancelled:"x-circle"},colors:{planned:"var(--dm-gray-400)","in-progress":"var(--dm-primary)",completed:"var(--dm-success)",blocked:"var(--dm-danger)",cancelled:"var(--dm-gray-500)"}};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.element.classList.add("dm-progression",`dm-progression-${this.options.mode}`,`dm-progression-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this._attachEvents(),this.options.animation&&this._animateItems())}_renderItems(){const e=this.options.items;Array.isArray(e)&&0!==e.length&&(this.element.innerHTML="","roadmap"===this.options.mode&&this.options.showProgress&&"top"===this.options.progressPosition&&this._renderProgressBar(),e.forEach((e,t)=>{const n="roadmap"===this.options.mode?this._renderRoadmapItem(e,t):this._renderTimelineItem(e,t);this.element.appendChild(n)}),"roadmap"===this.options.mode&&this.options.showProgress&&"bottom"===this.options.progressPosition&&this._renderProgressBar())}_renderTimelineItem(e,t){const n=document.createElement("div");return n.className="dm-progression-item dm-timeline-item",n.setAttribute("data-index",t),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease"),n.innerHTML=`\n <div class="dm-progression-marker dm-timeline-year">${this._escapeHtml(e.year||e.date||"")}</div>\n <div class="dm-progression-content dm-timeline-content">\n <h4 class="dm-progression-title dm-timeline-title">${this._escapeHtml(e.title||"")}</h4>\n <p class="dm-progression-description dm-timeline-description">${this._renderContent(e.description||"")}</p>\n </div>\n `,n}_renderRoadmapItem(e,t){const n=document.createElement("div"),s=e.status||"planned",i=this.options.currentItem===e.id||this.options.currentItem===t;n.className=`dm-progression-item dm-progression-status-${s}${i?" dm-progression-current":""}`,n.setAttribute("data-index",t),n.setAttribute("data-id",e.id||t),n.setAttribute("data-status",s),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease");let o='<div class="dm-progression-marker dm-progression-status-marker">';this.options.statusIcons&&this.options.icons[s]?o+=`<span class="dm-progression-status-icon" data-icon="${this.options.icons[s]}"></span>`:o+='<span class="dm-progression-status-dot"></span>',o+="</div>";let r='<div class="dm-progression-content">';return e.date&&(r+=`<div class="dm-progression-date">${this._escapeHtml(e.date)}</div>`),r+=`<h4 class="dm-progression-title">${this._escapeHtml(e.title||"")}</h4>`,e.description&&(r+=`<p class="dm-progression-description">${this._renderContent(e.description)}</p>`),"in-progress"===s&&"number"==typeof e.progress&&(r+=`\n <div class="dm-progression-item-progress">\n <div class="dm-progression-item-progress-bar" style="width: ${Math.min(100,Math.max(0,e.progress))}%"></div>\n </div>\n <div class="dm-progression-item-progress-text">${e.progress}%</div>\n `),e.priority&&(r+=`<span class="dm-progression-priority dm-progression-priority-${this._escapeHtml(e.priority)}">${this._escapeHtml(e.priority)}</span>`),e.tags&&Array.isArray(e.tags)&&e.tags.length>0&&(r+='<div class="dm-progression-tags">',e.tags.forEach(e=>{r+=`<span class="dm-progression-tag">${this._escapeHtml(e)}</span>`}),r+="</div>"),e.assignee&&(r+=`<div class="dm-progression-assignee">${this._escapeHtml(e.assignee)}</div>`),r+="</div>",n.innerHTML=o+r,n}_renderProgressBar(){const e=this.getProgress(),t=document.createElement("div");t.className="dm-progression-progress",t.innerHTML=`\n <div class="dm-progression-progress-bar" style="width: ${e}%"></div>\n <div class="dm-progression-progress-text">${Math.round(e)}% Complete</div>\n `,this.element.appendChild(t)}_attachEvents(){this.options.clickable&&(this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-item");if(t){const e=parseInt(t.getAttribute("data-index"),10),n=this.options.items[e];n&&this._fire("itemclick",n,e,t)}}),"roadmap"===this.options.mode&&this.options.allowStatusChange&&this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-marker");if(t){const e=t.closest(".dm-progression-item"),n=parseInt(e.getAttribute("data-index"),10),s=this.options.items[n];s&&"completed"!==s.status&&this._cycleStatus(s,n)}}))}_cycleStatus(e,t){const n=["planned","in-progress","completed"],s=n.indexOf(e.status||"planned"),i=n[(s+1)%n.length];this.setStatus(t,i)}_animateItems(){this.element.querySelectorAll(".dm-progression-item").forEach((e,t)=>{setTimeout(()=>{e.style.opacity="1",e.style.transform="translateY(0)"},t*this.options.animationDelay)})}_escapeHtml(e){return o(e)}_sanitizeHtml(e){return"undefined"!=typeof DOMPurify?DOMPurify.sanitize(e,{ALLOWED_TAGS:["p","strong","em","u","br","ul","ol","li","code","pre","a","h1","h2","h3","h4","h5","h6","blockquote","span","div"],ALLOWED_ATTR:["href","target","class","id"]}):(console.warn("DOMPurify not available, falling back to HTML escaping"),this._escapeHtml(e))}_renderContent(e){return this.options.allowHtml?this._sanitizeHtml(e):this._escapeHtml(e)}_findItemIndex(e){return"number"==typeof e?e:this.options.items.findIndex(t=>t.id===e)}setItems(e){return this.options.items=e,this._renderItems(),this.options.animation&&this._animateItems(),this}addItem(e){return this.options.items.push(e),this._renderItems(),this.options.animation&&this._animateItems(),this}getItems(){return[...this.options.items]}getItem(e){const t=this._findItemIndex(e);return t>=0?{...this.options.items[t]}:null}updateItem(e,t){const n=this._findItemIndex(e);return n>=0&&(this.options.items[n]={...this.options.items[n],...t},this._renderItems(),this.options.animation&&this._animateItems()),this}removeItem(e){const t=this._findItemIndex(e);return t>=0&&(this.options.items.splice(t,1),this._renderItems(),this.options.animation&&this._animateItems()),this}setLayout(e){return this.element.classList.remove(`dm-progression-${this.options.layout}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.layout}`),this.options.layout=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`),this}setTheme(e){return"default"!==this.options.theme&&(this.element.classList.remove(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.theme=e,"default"!==e&&(this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`)),this}setMode(e){return this.element.classList.remove(`dm-progression-${this.options.mode}`),"timeline"===this.options.mode&&(this.element.classList.remove("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.mode=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===e&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this.options.animation&&this._animateItems(),this}getMode(){return this.options.mode}refresh(){return this._renderItems(),this.options.animation&&this._animateItems(),this}setStatus(e,t){const n=this._findItemIndex(e);if(n>=0){const e=this.options.items[n].status;this.options.items[n].status=t,this._fire("statuschange",this.options.items[n],e,t),this._renderItems(),this.options.animation&&this._animateItems()}return this}getStatus(e){const t=this.getItem(e);return t?t.status:null}getItemsByStatus(e){return this.options.items.filter(t=>t.status===e)}setCurrent(e){const t=this._findItemIndex(e);return t>=0&&(this.options.currentItem=this.options.items[t].id||t,this._renderItems(),this.options.animation&&this._animateItems()),this}getCurrent(){return null===this.options.currentItem?null:this.getItem(this.options.currentItem)}getProgress(){if("roadmap"!==this.options.mode||0===this.options.items.length)return 0;const e=this.options.items.filter(e=>"completed"===e.status).length;return Math.round(e/this.options.items.length*100)}markComplete(e){return this.setStatus(e,"completed")}markInProgress(e){return this.setStatus(e,"in-progress")}markBlocked(e){return this.setStatus(e,"blocked")}}class ti extends C{static componentName="signature";static defaults={width:null,height:180,penColour:"#000000",penWidth:2,format:"png",label:"Signature",guideLine:!0,placeholder:"Sign here",colours:["#000000","#1e40af","#15803d","#b91c1c"],widths:[1,2,4],toolbar:!0,name:"signature",disabled:!1,typeFallback:!1,minStrokeLength:3,respectMotionPreference:!0,onChange:null,onClear:null,onBegin:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._strokes=[],this._undoneStrokes=[],this._currentStroke=null,this._mode="draw",this._isDrawing=!1,this._currentColour=this.options.penColour,this._currentWidth=this.options.penWidth,this._resizeObserver=null,this._canvas=null,this._ctx=null,this._canvasW=0,this._canvasH=0,this._dpr=1,this._render(),this._initCanvas(),this._initEvents(),this.options.disabled&&this.disable())}_esc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_render(){const e=this.options,t=this._esc.bind(this),n=e.colours.map(e=>{const n=t(e),s=e===this._currentColour;return`<button class="signature-colour-swatch${s?" active":""}" data-colour="${n}" style="background:${n}" aria-label="Pen colour ${n}" aria-pressed="${s}" title="${n}"></button>`}).join(""),s=e.widths.map(e=>{const t=parseFloat(e)||2,n=t===this._currentWidth,s=Math.max(2,Math.min(2.5*t,12));return`<button class="signature-width-btn${n?" active":""}" data-width="${t}" aria-label="Pen width ${t}px" aria-pressed="${n}">\n <span class="signature-width-dot" style="width:${s}px;height:${s}px;"></span>\n </button>`}).join(""),i=e.typeFallback?'\n <div class="signature-mode-toggle" role="group" aria-label="Input mode">\n <button class="signature-mode-btn active" data-mode="draw" aria-pressed="true">Draw</button>\n <button class="signature-mode-btn" data-mode="type" aria-pressed="false">Type</button>\n </div>':"",o=e.toolbar?`\n <div class="signature-toolbar">\n <span class="signature-label">${t(e.label)}</span>\n <div class="signature-colours" role="group" aria-label="Pen colour">${n}</div>\n <div class="signature-widths" role="group" aria-label="Pen width">${s}</div>\n <div class="signature-actions">\n <button class="signature-btn" data-action="undo" aria-label="Undo" disabled>\n <span data-icon="undo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn" data-action="redo" aria-label="Redo" disabled>\n <span data-icon="redo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn signature-btn-clear" data-action="clear" aria-label="Clear signature">Clear</button>\n </div>\n ${i}\n </div>`:"",r=parseInt(e.height,10)||180,a=t(e.format.toUpperCase()),l=t(e.name),c=t(e.placeholder),h=`\n ${o}\n <div class="signature-canvas-wrapper" style="height:${r}px;">\n <canvas class="signature-canvas" tabindex="0" aria-label="Draw your signature here"></canvas>\n ${e.guideLine?'<div class="signature-guide-line" aria-hidden="true"></div>':""}\n <div class="signature-placeholder" aria-hidden="true">${c}</div>\n <input class="signature-type-input" type="text" placeholder="${c}" style="display:none;" aria-label="Type your signature">\n </div>\n <div class="signature-footer">\n <span class="signature-status" aria-live="polite">Draw your signature above</span>\n <span class="signature-format-badge">${a}</span>\n </div>\n <input type="hidden" name="${l}" value="">\n `;this.element.classList.add("signature"),this.element.setAttribute("role","application"),this.element.setAttribute("aria-label",t(e.label)),this.element.textContent="",this.element.insertAdjacentHTML("afterbegin",h),this._canvas=this.element.querySelector(".signature-canvas"),this._wrapper=this.element.querySelector(".signature-canvas-wrapper"),this._placeholder=this.element.querySelector(".signature-placeholder"),this._statusEl=this.element.querySelector(".signature-status"),this._hiddenInput=this.element.querySelector('input[type="hidden"]'),this._typeInput=this.element.querySelector(".signature-type-input"),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(this.element)}_initCanvas(){this._canvas&&(this._ctx=this._canvas.getContext("2d"),this._scaleCanvas(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._scaleCanvas(),this._redraw()}),this._resizeObserver.observe(this._wrapper)))}_scaleCanvas(){const e=window.devicePixelRatio||1,t=this._wrapper.clientWidth,n=this._wrapper.clientHeight;this._canvas.width=t*e,this._canvas.height=n*e,this._ctx.setTransform(e,0,0,e,0,0),this._dpr=e,this._canvasW=t,this._canvasH=n}_initEvents(){const e=this._canvas;e&&(this._addEventListener(e,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(e,"pointermove",e=>this._onPointerMove(e)),this._addEventListener(e,"pointerup",e=>this._onPointerUp(e)),this._addEventListener(e,"pointercancel",e=>this._onPointerUp(e)),this._addEventListener(e,"pointerleave",e=>{this._isDrawing&&this._onPointerUp(e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest("[data-action]");if(t){const e=t.dataset.action;return void("undo"===e?this.undo():"redo"===e?this.redo():"clear"===e&&this.clear())}const n=e.target.closest(".signature-colour-swatch");if(n)return void this._setColour(n.dataset.colour);const s=e.target.closest(".signature-width-btn");if(s)return void this._setPenWidth(parseFloat(s.dataset.width));const i=e.target.closest(".signature-mode-btn");i&&this._setMode(i.dataset.mode)}),this._typeInput&&this._addEventListener(this._typeInput,"input",()=>this._renderTypeToCanvas()))}_onPointerDown(e){if(this.options.disabled||"draw"!==this._mode)return;e.preventDefault(),this._canvas.setPointerCapture(e.pointerId),this._isDrawing=!0,this.element.classList.add("signature-signing");const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke={points:[{x:t,y:n,pressure:s}],colour:this._currentColour,width:this._currentWidth},this._undoneStrokes=[],this._updateState(),this._fire("begin",this._currentStroke)}_onPointerMove(e){if(!this._isDrawing||!this._currentStroke)return;e.preventDefault();const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke.points.push({x:t,y:n,pressure:s}),this._redrawCurrentStroke()}_onPointerUp(e){if(!this._isDrawing)return;this._isDrawing=!1,this.element.classList.remove("signature-signing"),this._currentStroke&&this._currentStroke.points.length>=this.options.minStrokeLength&&this._strokes.push(this._currentStroke);const t=this._currentStroke;this._currentStroke=null,this._redraw(),this._updateState(),this._updateHiddenInput(),t&&this._fire("end",t),this._fire("change",this._hiddenInput.value)}_getPoint(e){const t=this._canvas.getBoundingClientRect();return{x:(e.clientX-t.left)/this._canvasW,y:(e.clientY-t.top)/this._canvasH}}_redraw(){if(!this._ctx)return;const e=this._canvasW,t=this._canvasH;this._ctx.clearRect(0,0,e,t);for(const n of this._strokes)this._drawStroke(this._ctx,n,e,t);this._placeholder&&(this._placeholder.style.display=this._strokes.length>0?"none":"")}_redrawCurrentStroke(){this._redraw(),this._currentStroke&&this._drawStroke(this._ctx,this._currentStroke,this._canvasW,this._canvasH)}_drawStroke(e,t,n,s){const i=t.points;if(0!==i.length){if(e.save(),e.strokeStyle=t.colour,e.fillStyle=t.colour,e.lineCap="round",e.lineJoin="round",1===i.length){const o=t.width*(.4+.6*i[0].pressure);e.beginPath(),e.arc(i[0].x*n,i[0].y*s,o/2,0,2*Math.PI),e.fill()}else{e.beginPath(),e.moveTo(i[0].x*n,i[0].y*s);for(let o=1;o<i.length-1;o++){const r=(i[o].x+i[o+1].x)/2*n,a=(i[o].y+i[o+1].y)/2*s;e.lineWidth=t.width*(.4+.6*i[o].pressure),e.quadraticCurveTo(i[o].x*n,i[o].y*s,r,a),e.stroke(),e.beginPath(),e.moveTo(r,a)}const o=i[i.length-1];e.lineWidth=t.width*(.4+.6*o.pressure),e.lineTo(o.x*n,o.y*s),e.stroke()}e.restore()}}_updateState(){const e=this.element.querySelector('[data-action="undo"]'),t=this.element.querySelector('[data-action="redo"]');e&&(e.disabled=0===this._strokes.length),t&&(t.disabled=0===this._undoneStrokes.length),this._statusEl&&(this._isDrawing?this._statusEl.textContent="Signing…":this._strokes.length>0?this._statusEl.textContent="Signature captured":this._statusEl.textContent="Draw your signature above")}_setColour(e){this._currentColour=e,this.element.querySelectorAll(".signature-colour-swatch").forEach(t=>{const n=t.dataset.colour===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setPenWidth(e){this._currentWidth=e,this.element.querySelectorAll(".signature-width-btn").forEach(t=>{const n=parseFloat(t.dataset.width)===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setMode(e){if(this._mode===e)return;this._mode=e,this.element.querySelectorAll(".signature-mode-btn").forEach(t=>{const n=t.dataset.mode===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")});this.element.querySelectorAll('.signature-colours, .signature-widths, [data-action="undo"], [data-action="redo"]').forEach(t=>{t.style.display="type"===e?"none":""}),"type"===e?(this._canvas.style.display="none",this._typeInput&&(this._typeInput.style.display="",this._typeInput.focus())):(this._canvas.style.display="",this._typeInput&&(this._typeInput.style.display="none")),this.clear(!0)}_renderTypeToCanvas(){const e=this._typeInput?this._typeInput.value.trim():"";this._strokes=[],this._undoneStrokes=[];const t=this._ctx,n=this._canvasW,s=this._canvasH;t.clearRect(0,0,n,s),e&&(t.save(),t.fillStyle=this._currentColour,t.font=`${Math.min(.55*s,72)}px 'Brush Script MT', 'Segoe Script', cursive`,t.textAlign="center",t.textBaseline="middle",t.fillText(e,n/2,s/2),t.restore()),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value)}_updateHiddenInput(){if(!this._hiddenInput)return;const e=this.isEmpty()&&"type"!==this._mode;this._hiddenInput.value=e?"":this.toBase64()}toBase64(e){return"svg"===(e||this.options.format)?this._toSVGBase64():this._canvas.toDataURL("image/png")}_toSVGBase64(){const e=this._canvasW,t=this._canvasH;let n="";for(const s of this._strokes){const i=s.points;if(0===i.length)continue;let o=`M ${(i[0].x*e).toFixed(2)} ${(i[0].y*t).toFixed(2)}`;for(let n=1;n<i.length-1;n++){const s=((i[n].x+i[n+1].x)/2*e).toFixed(2),r=((i[n].y+i[n+1].y)/2*t).toFixed(2);o+=` Q ${(i[n].x*e).toFixed(2)} ${(i[n].y*t).toFixed(2)} ${s} ${r}`}if(i.length>1){const n=i[i.length-1];o+=` L ${(n.x*e).toFixed(2)} ${(n.y*t).toFixed(2)}`}const r=i.reduce((e,t)=>e+t.pressure,0)/i.length,a=(s.width*(.4+.6*r)).toFixed(2);n+=`<path d="${o}" stroke="${s.colour}" stroke-width="${a}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>\n`}return"data:image/svg+xml;base64,"+btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">\n${n}</svg>`)}isEmpty(){return"type"===this._mode?!this._typeInput||""===this._typeInput.value.trim():0===this._strokes.length}clear(e=!1){!e&&this._strokes.length>0&&(this._undoneStrokes=[...this._strokes,...this._undoneStrokes]),this._strokes=[],this._currentStroke=null,this._redraw(),this._updateState(),this._hiddenInput&&(this._hiddenInput.value=""),e||(this._statusEl&&(this._statusEl.textContent="Signature cleared"),this._fire("clear"),this._fire("change",""))}undo(){0!==this._strokes.length&&(this._undoneStrokes.unshift(this._strokes.pop()),this._redraw(),this._updateState(),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value))}redo(){0!==this._undoneStrokes.length&&(this._strokes.push(this._undoneStrokes.shift()),this._redraw(),this._updateState(),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value))}disable(){this.options.disabled=!0,this.element.classList.add("signature-disabled"),this._canvas&&this._canvas.setAttribute("aria-disabled","true"),this._typeInput&&(this._typeInput.disabled=!0),this.element.querySelectorAll("[data-action]").forEach(e=>{e.disabled=!0})}enable(){this.options.disabled=!1,this.element.classList.remove("signature-disabled"),this._canvas&&this._canvas.removeAttribute("aria-disabled"),this._typeInput&&(this._typeInput.disabled=!1),this._updateState();const e=this.element.querySelector('[data-action="clear"]');e&&(e.disabled=!1)}destroy(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),super.destroy()}}const ni=["January","February","March","April","May","June","July","August","September","October","November","December"],si=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ii(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return"";const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function oi(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getFullYear(),e.getMonth(),e.getDate());if("number"==typeof e)return oi(new Date(e));const t=String(e??"").trim();if(!t)return null;const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(t);if(n){const e=new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));return e.getMonth()===Number(n[2])-1?e:null}const s=new Date(t);return Number.isNaN(s.getTime())?null:new Date(s.getFullYear(),s.getMonth(),s.getDate())}function ri(e,t){if(!e)return"";const n=e=>String(e).padStart(2,"0"),s={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:ni[e.getMonth()],MMM:ni[e.getMonth()].slice(0,3),MM:n(e.getMonth()+1),M:String(e.getMonth()+1),DDDD:si[e.getDay()],DDD:si[e.getDay()].slice(0,3),DD:n(e.getDate()),D:String(e.getDate())};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|D/g,e=>s[e])}function ai(e,t){return Boolean(e)&&Boolean(t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}class li extends C{static componentName="date-picker";static defaults={value:null,format:"YYYY-MM-DD",min:null,max:null,firstDay:1,disabledDates:null,openOnFocus:!0,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,clearable:!0,todayButton:!0,readonlyInput:!1,inline:!1,position:"bottom-start",offset:[0,4],weekNumbers:!1,placeholder:null,onChange:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null};static _open=null;constructor(e,t={}){super(e,t),this.element&&(this._panel=null,this._isOpen=!1,this._value=null,this._view=null,this._focused=null,this._init())}_init(){const e=this.element,t=this.options;"INPUT"===e.tagName&&"date"===e.type&&(e.type="text"),e.setAttribute("autocomplete","off"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","false"),t.readonlyInput&&(e.readOnly=!0),null!==t.placeholder?e.placeholder=t.placeholder:e.placeholder||(e.placeholder=t.format);const n=null!==t.value&&void 0!==t.value&&""!==t.value?t.value:e.value;if(this._value=this._clamp(oi(n)),this._view=this._value?new Date(this._value):this._clamp(new Date)||new Date,this._renderInput(),t.inline)return this._buildPanel(),e.insertAdjacentElement("afterend",this._panel),this._panel.classList.add("dm-datepicker--inline"),this._paint(),void(this._isOpen=!0);this._addEventListener(e,"click",()=>this.open()),t.openOnFocus&&this._addEventListener(e,"focus",()=>this.open()),this._addEventListener(e,"keydown",e=>this._onInputKey(e)),this._addEventListener(e,"change",()=>{if(this._suppress)return;const t=oi(e.value);this.setValue(t?ii(t):"",{silent:!1,fromInput:!0})})}getValue(){return this._value?ii(this._value):""}getDate(){return this._value?new Date(this._value):null}setValue(e,{silent:t=!1,fromInput:n=!1}={}){const s=this._clamp(oi(e)),i=!ai(s,this._value)||!s!=!this._value;return this._value=s,s&&(this._view=new Date(s)),this._renderInput(),this._panel&&this._paint(),i&&!t&&(n||(this._suppress=!0,this.element.dispatchEvent(new Event("input",{bubbles:!0})),this.element.dispatchEvent(new Event("change",{bubbles:!0})),this._suppress=!1),this._fire("change",this.getValue(),this.getDate(),this)),this}clear(){return this.setValue("")}_renderInput(){const e=this.getValue();this._suppress=!0,this.element.value=this._value?ri(this._value,this.options.format):"",this._suppress=!1,"YYYY-MM-DD"===this.options.format?delete this.element.dataset.date:this.element.dataset.date=e}_min(){return oi(this.options.min)}_max(){return oi(this.options.max)}_clamp(e){if(!e)return null;const t=this._min(),n=this._max();return t&&e<t?new Date(t):n&&e>n?new Date(n):e}_disabled(e){const t=this._min(),n=this._max();if(t&&e<t)return!0;if(n&&e>n)return!0;if("function"==typeof this.options.disabledDates)try{return Boolean(this.options.disabledDates(new Date(e)))}catch{return!1}return!1}_buildPanel(){const e=document.createElement("div");e.className="dm-datepicker",this.options.weekNumbers&&e.setAttribute("data-week-numbers",""),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","false"),e.setAttribute("aria-label","Choose a date");const t=document.createElement("div");t.className="dm-datepicker-head";const n=document.createElement("button");n.type="button",n.className="dm-datepicker-nav",n.setAttribute("aria-label","Previous month"),n.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>',this._addEventListener(n,"click",()=>this._shiftMonth(-1));const s=document.createElement("button");s.type="button",s.className="dm-datepicker-nav",s.setAttribute("aria-label","Next month"),s.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>',this._addEventListener(s,"click",()=>this._shiftMonth(1));const i=document.createElement("select");i.className="dm-datepicker-select",i.setAttribute("aria-label","Month"),ni.forEach((e,t)=>{const n=document.createElement("option");n.value=String(t),n.textContent=e,i.appendChild(n)}),this._addEventListener(i,"change",()=>{this._view=new Date(this._view.getFullYear(),Number(i.value),1),this._paint()});const o=document.createElement("select");o.className="dm-datepicker-select",o.setAttribute("aria-label","Year"),this._addEventListener(o,"change",()=>{this._view=new Date(Number(o.value),this._view.getMonth(),1),this._paint()}),t.appendChild(n);const r=document.createElement("div");r.className="dm-datepicker-pickers",r.appendChild(i),r.appendChild(o),t.appendChild(r),t.appendChild(s),e.appendChild(t);const a=document.createElement("div");a.className="dm-datepicker-grid",a.setAttribute("role","grid"),e.appendChild(a);const l=document.createElement("div");l.className="dm-datepicker-foot",e.appendChild(l),this._addEventListener(a,"click",e=>{const t=e.target.closest("[data-dm-date]");t&&!t.hasAttribute("aria-disabled")&&(this.setValue(t.dataset.dmDate),this.options.closeOnSelect&&!this.options.inline&&this.close({focus:!0}))}),this._addEventListener(e,"keydown",e=>this._onPanelKey(e)),this._panel=e,this._grid=a,this._foot=l,this._monthSelect=i,this._yearSelect=o}_shiftMonth(e){this._view=new Date(this._view.getFullYear(),this._view.getMonth()+e,1),this._paint()}_paint(){const e=this.options,t=this._view,n=new Date,s=this._min(),i=this._max(),o=s?s.getFullYear():n.getFullYear()-100,r=i?i.getFullYear():n.getFullYear()+10;if(this._yearSelect.dataset.from!==String(o)||this._yearSelect.dataset.to!==String(r)){this._yearSelect.textContent="";for(let e=r;e>=o;e--){const t=document.createElement("option");t.value=String(e),t.textContent=String(e),this._yearSelect.appendChild(t)}this._yearSelect.dataset.from=String(o),this._yearSelect.dataset.to=String(r)}this._monthSelect.value=String(t.getMonth()),this._yearSelect.value=String(t.getFullYear());const a=this._grid;a.textContent="";const l=document.createElement("div");if(l.className="dm-datepicker-row dm-datepicker-weekdays",l.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week",l.appendChild(e)}for(let t=0;t<7;t++){const n=si[(e.firstDay+t)%7],s=document.createElement("span");s.className="dm-datepicker-weekday",s.setAttribute("role","columnheader"),s.setAttribute("aria-label",n),s.textContent=n.slice(0,2),l.appendChild(s)}a.appendChild(l);const c=new Date(t.getFullYear(),t.getMonth(),1),h=(c.getDay()-e.firstDay+7)%7,d=new Date(c.getFullYear(),c.getMonth(),1-h);for(let s=0;s<6;s++){const i=document.createElement("div");if(i.className="dm-datepicker-row",i.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week";const t=new Date(d);t.setDate(d.getDate()+7*s),e.textContent=String(this._weekNumber(t)),i.appendChild(e)}for(let e=0;e<7;e++){const o=new Date(d.getFullYear(),d.getMonth(),d.getDate()+7*s+e),r=document.createElement("button");r.type="button",r.className="dm-datepicker-day",r.dataset.dmDate=ii(o),r.setAttribute("role","gridcell"),r.textContent=String(o.getDate()),r.setAttribute("aria-label",ri(o,"DDDD D MMMM YYYY")),o.getMonth()!==t.getMonth()&&r.classList.add("is-outside"),ai(o,n)&&r.classList.add("is-today"),ai(o,this._value)&&(r.classList.add("is-selected"),r.setAttribute("aria-selected","true")),this._disabled(o)&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0);const a=this._focused||this._value||n;r.tabIndex=ai(o,a)?0:-1,i.appendChild(r)}a.appendChild(i)}this._paintFoot()}_paintFoot(){const e=this._foot;e.textContent="";const t=this.options;if(t.todayButton){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Today",n.addEventListener("click",()=>{const e=new Date;if(this._disabled(e))return this._view=new Date(e.getFullYear(),e.getMonth(),1),void this._paint();this.setValue(ii(e)),t.closeOnSelect&&!t.inline&&this.close({focus:!0})}),e.appendChild(n)}if(t.clearable){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Clear",n.disabled=!this._value,n.addEventListener("click",()=>{this.clear(),t.inline||this.close({focus:!0})}),e.appendChild(n)}e.childNodes.length?e.parentNode||this._panel.appendChild(e):e.remove()}_weekNumber(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()+3-(t.getDay()+6)%7);const n=new Date(t.getFullYear(),0,4);return n.setDate(n.getDate()+3-(n.getDay()+6)%7),1+Math.round((t-n)/6048e5)}open(){return this._isOpen||this.options.inline||this.element.disabled||!1===this._fire("beforeopen",this)||(li._open&&li._open!==this&&li._open.close(),this._panel||this._buildPanel(),document.body.appendChild(this._panel),this._focused=this._value?new Date(this._value):null,this._paint(),this._position(),this._isOpen=!0,li._open=this,this.element.setAttribute("aria-expanded","true"),this._onOutside=e=>{this._panel.contains(e.target)||e.target===this.element||this.close()},this._onReposition=()=>this._position(),this.options.closeOnClickOutside&&setTimeout(()=>document.addEventListener("mousedown",this._onOutside,!0),0),window.addEventListener("resize",this._onReposition),window.addEventListener("scroll",this._onReposition,!0),this._fire("open",this)),this}close({focus:e=!1}={}){return!this._isOpen||this.options.inline?this:this._mayClose(this)?(document.removeEventListener("mousedown",this._onOutside,!0),window.removeEventListener("resize",this._onReposition),window.removeEventListener("scroll",this._onReposition,!0),this._panel?.remove(),this._isOpen=!1,li._open===this&&(li._open=null),this.element.setAttribute("aria-expanded","false"),e&&this.element.focus(),this._fire("close",this),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}_position(){const e=this._panel;if(!e)return;Ze(this.element,e);const t=this.element.getBoundingClientRect(),[n,s]=this.options.offset;e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0";const i=e.getBoundingClientRect();let o=t.bottom+s,r=t.left+n;o+i.height>window.innerHeight&&t.top-i.height-s>0&&(o=t.top-i.height-s),this.options.position.endsWith("-end")&&(r=t.right-i.width),r=Math.max(8,Math.min(r,window.innerWidth-i.width-8)),e.style.top=`${o+window.scrollY}px`,e.style.left=`${r+window.scrollX}px`,e.style.visibility=""}_onInputKey(e){"ArrowDown"!==e.key&&"Enter"!==e.key?"Escape"===e.key&&this._isOpen&&(e.preventDefault(),this.close()):this._isOpen||(e.preventDefault(),this.open(),this._panel?.querySelector('[tabindex="0"]')?.focus())}_onPanelKey(e){const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key],n=this._focused||this._value||new Date;if(void 0!==t)return e.preventDefault(),void this._moveFocus(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t));if("PageUp"===e.key||"PageDown"===e.key){e.preventDefault();const t="PageUp"===e.key?-1:1;return void this._moveFocus(new Date(n.getFullYear(),n.getMonth()+t,n.getDate()))}if("Home"===e.key||"End"===e.key){e.preventDefault();const t="Home"===e.key?new Date(n.getFullYear(),n.getMonth(),1):new Date(n.getFullYear(),n.getMonth()+1,0);return void this._moveFocus(t)}"Escape"===e.key&&this.options.closeOnEscape&&(e.preventDefault(),this.close({focus:!0}))}_moveFocus(e){this._focused=e,e.getMonth()===this._view.getMonth()&&e.getFullYear()===this._view.getFullYear()||(this._view=new Date(e.getFullYear(),e.getMonth(),1)),this._paint(),this._panel?.querySelector(`[data-dm-date="${ii(e)}"]`)?.focus()}destroy(){this._forcedClose(),this._panel?.remove(),this._panel=null,super.destroy()}}const ci={_instances:new Map,card(e,t={}){js();const n=Fe(e);if(!n)return null;const s=Je(n,"card",t)||new rn(n,t);return this._instances.set(n,s),s},modal(e,t={}){if(js(),e&&"object"==typeof e&&!e.nodeType&&"number"!=typeof e.length)return gn(e);const n=Fe(e);if(!n)return null;const s=Je(n,"modal",t)||new pn(n,t);return this._instances.set(n,s),s},tabs(e,t={}){const n=new Ds(e,t);return n.element&&this._instances.set(n.element,n),n},accordion(e,t={}){const n=new Ns(e,t);return n.element&&this._instances.set(n.element,n),n},tooltip(e,t={}){js();const n=function(e,t={}){return e.map(e=>{const n=x(e,"tooltip");return n?n.setOptions(t):new xn(e,t)})}(Re(e),t);for(const e of n)this._instances.set(e.element,e);return Os(n)},badge(e,t={}){js();const n=Fe(e);if(!n)return null;const s=Je(n,"badge",t)||new Cn(n,t);return this._instances.set(n,s),s},numberBadge(e,t={}){js();const n=Fe(e);if(!n)return null;const s=Je(n,"number-badge",t)||new En(n,t);return this._instances.set(n,s),s},dropdown(e,t={}){const n=new Hs(e,t);return n.element&&this._instances.set(n.element,n),n},carousel(e,t={}){const n=new Rs(e,t);return n.element&&this._instances.set(n.element,n),n},cookieConsent(e={}){if(this._instances.has("cookieConsent"))return this._instances.get("cookieConsent");const t=new Vs(e);return this._instances.set("cookieConsent",t),t},backToTop(e,t={}){js();const n=new Bn(e,t);return this._instances.set(n.element,n),this._instances.set("backToTop",n),n},buttonGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Us(e,t);this._instances.set(e,n),s.push(n)}return Os(s)},loader(e,t={}){js();const n=Fe(e);if(!n)return null;const s=new Tn(n,t);return this._instances.set(n,s),s},showLoader(e,t={}){const n=Fe(e);if(!n)return null;const s=x(n,"loader");return s?(Object.keys(t).length&&s.setOptions(t),s.show()):this.loader(n,{...t,visible:!0})},hideLoader(e){const t=Fe(e),n=t&&x(t,"loader");return n&&n.hide(),n||void 0},fullscreenLoader(e="Loading...",t={}){let n=document.getElementById("dm-loader-fullscreen");n||(n=document.createElement("div"),n.id="dm-loader-fullscreen",n.className="dm-loader-fullscreen",document.body.appendChild(n));const s={type:t.type||"spinner",size:t.size||"large",color:t.color||"white",text:e,overlay:!1,centered:!1,fullscreen:!0,visible:!0},i=x(n,"loader");if(i)return i.setOptions(s),i.show();const o=new Tn(n,s);return this._instances.set(n,o),o},breadcrumbs(e,t={}){const n=new Ks(e,t);return n.element&&this._instances.set(n.element,n),n},navbar(e,t={}){const n=new Ys(e,t);return n.element&&this._instances.set(n.element,n),n},sidebar(e,t={}){const n=new Gs(e,t);return n.element&&this._instances.set(n.element,n),n},footer(e,t={}){const n=new Js(e,t);return n.element&&this._instances.set(n.element,n),n},notification:(e={})=>new Ws(e),notify:(e,t={})=>e&&"object"==typeof e?Ws.notify(e.title,{...e,...t}):Ws.notify(e,t),timer(e,t={}){const n=new Ps(e,t);return n.element&&this._instances.set(n.element,n),n},alarm:(e={})=>new Fs(e),autocomplete(e,t={}){const n=new Xs(e,t);return n.element&&this._instances.set(n.element,n),n},pillbox(e,t={}){const n=new Zs(e,t);return n.element&&this._instances.set(n.element,n),n},datePicker(e,t={}){const n=new li(e,t);return n.element&&this._instances.set(n.element,n),n},chooser(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n){console.warn("[Domma.elements.chooser] host not found:",e);const n=t.multiple?[]:null;return{_root:null,element:null,getValue:()=>n,setValue(){},disable(){},enable(){},destroy(){}}}const s={variant:"card",multiple:!1,density:"comfortable",columns:3,glow:!1,glowColour:null,shadow:"none",shadowColour:null,accent:"primary",accentStyle:"border",options:[],...t};let i=void 0!==s.value?s.value:s.multiple?[]:null;const o=document.createElement("div");o.className="domma-chooser",o.setAttribute("data-variant",s.variant),o.setAttribute("data-density",s.density),o.style.setProperty("--picker-cols",String(s.columns)),o.style.setProperty("--picker-cols-md",String(Math.min(s.columns,2))),o.style.setProperty("--picker-cols-sm","1");const r={primary:1,success:1,info:1,warning:1,danger:1},a=e=>"string"==typeof e&&r[e];if(s.glow&&o.setAttribute("data-glow","true"),s.glowColour&&(a(s.glowColour)?o.setAttribute("data-glow-colour",s.glowColour):o.style.setProperty("--picker-glow-colour",s.glowColour)),s.shadow&&"none"!==s.shadow&&o.setAttribute("data-shadow",s.shadow),s.shadowColour&&o.style.setProperty("--picker-shadow-colour",s.shadowColour),s.accent&&(a(s.accent)?o.setAttribute("data-accent",s.accent):o.style.setProperty("--picker-accent",s.accent)),s.accentStyle&&"border"!==s.accentStyle&&o.setAttribute("data-accent-style",s.accentStyle),s.label){const e=document.createElement("label");if(e.className="picker-label",e.textContent=s.label,s.required){const t=document.createElement("span");t.className="picker-required",t.textContent="*",e.appendChild(t)}o.appendChild(e)}const l=document.createElement("div");l.className="picker-options",l.setAttribute("role",s.multiple?"group":"radiogroup"),o.appendChild(l);const c=e=>{const t=String(e);return s.multiple?Array.isArray(i)&&i.map(String).includes(t):null!=i&&String(i)===t},h=()=>{l.replaceChildren(),s.options.forEach((e,t)=>l.appendChild(((e,t)=>{const n=document.createElement("div");if(n.className="picker-option",n.setAttribute("role",s.multiple?"checkbox":"radio"),n.setAttribute("tabindex",s.multiple||0===t?"0":"-1"),n.setAttribute("data-value",String(e.value)),n.setAttribute("aria-checked",c(e.value)?"true":"false"),c(e.value)&&n.classList.add("is-selected"),e.disabled&&(n.classList.add("is-disabled"),n.setAttribute("aria-disabled","true")),e.recommended&&n.classList.add("is-recommended"),e.icon){const t=document.createElement("span");t.className="picker-option-icon",t.setAttribute("data-icon",e.icon),n.appendChild(t)}const i=document.createElement("span");if(i.className="picker-option-label",i.textContent=e.label,n.appendChild(i),e.description&&"compact"!==s.density&&"card"===s.variant){const t=document.createElement("span");t.className="picker-option-desc",t.textContent=e.description,n.appendChild(t)}if("card"===s.variant){const e=document.createElement("span");e.className="picker-option-tick",e.setAttribute("aria-hidden","true");const t=document.createElement("span");t.setAttribute("data-icon","check"),t.setAttribute("data-icon-size","12"),e.appendChild(t),n.appendChild(e)}if(e.badge&&e.badge.text){const t=document.createElement("span");t.className="picker-option-badge";const s=document.createElement("span");s.className="badge badge-"+(e.badge.type||"primary"),s.textContent=e.badge.text,t.appendChild(s),n.appendChild(t)}if(e.tooltip&&n.setAttribute("data-tooltip",e.tooltip),s.name){const t=document.createElement("input");t.className="picker-native-input",t.type=s.multiple?"checkbox":"radio",t.name=s.multiple?s.name+"[]":s.name,t.value=String(e.value),t.checked=c(e.value),t.disabled=!!e.disabled,t.tabIndex=-1,n.appendChild(t)}return n})(e,t))),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(l)},d=(e,t=!0)=>{i=e,h(),t&&"function"==typeof s.onChange&&s.onChange(i)};l.addEventListener("click",e=>{const t=e.target.closest(".picker-option");if(!t||t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value");if(s.multiple){const e=Array.isArray(i)?i.slice():[],t=e.indexOf(n);t>=0?e.splice(t,1):e.push(n),d(e)}else d(n)}),l.addEventListener("keydown",e=>{const t=e.target.closest(".picker-option");if(!t)return;const n=Array.from(l.querySelectorAll(".picker-option")).filter(e=>!e.classList.contains("is-disabled")),o=n.indexOf(t);if(s.multiple){if(" "===e.key||"Spacebar"===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value"),s=Array.isArray(i)?i.slice():[],o=s.indexOf(n);o>=0?s.splice(o,1):s.push(n),d(s)}return}if("Enter"===e.key||" "===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;return void d(t.getAttribute("data-value"))}let r=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)r=o+1;else{if("ArrowLeft"!==e.key&&"ArrowUp"!==e.key)return;r=o-1}e.preventDefault(),r<0&&(r=n.length-1),r>=n.length&&(r=0);const a=n[r];if(a){const e=a.getAttribute("data-value");d(e);const t=l.querySelector('.picker-option[data-value="'+e.replace(/"/g,'\\"')+'"]');t&&"function"==typeof t.focus&&t.focus()}}),n.appendChild(o),h();const u={_root:o,get element(){return o},getValue:()=>i,setValue(e){d(e,!1)},disable(){o.querySelectorAll(".picker-option").forEach(e=>e.classList.add("is-disabled"))},enable(){o.querySelectorAll(".picker-option").forEach(e=>e.classList.remove("is-disabled"))},destroy(){o.remove(),L(n,u),L(o,u)}};return Object.defineProperty(u,"componentName",{value:"chooser"}),M(n,u),M(o,u),u},contextMenu(e,t={}){const n=new pe(e,t);return n.element&&this._instances.set(n.element,n),n},sortable(e,t={}){const n=new ve(e,t);return n.element&&this._instances.set(n.element,n),n},skeleton:(e,t={})=>Pe(e,t),avatar:(e,t={})=>en(e,t),avatarGroup:(e,t={})=>on(e,t),inputGroup(e,t={}){const n=new ze(e,t);return n.element&&this._instances.set(n.element,n),n},popover(e,t={}){const n=new Bt(e,t);if(n.element){const e=n.element;this._instances.set(e,n),n._onDestroy=()=>{this._instances.get(e)===n&&this._instances.delete(e)}}return n},treeView(e,t={}){const n=new A(e,t);return n.element&&this._instances.set(n.element,n),n},slideover(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return e.schema,Qs.create(e);const n=new Qs(e,t);return n.element&&this._instances.set(n.element,n),n},progression(e,t={}){const n=new ei(e,t);return n.element&&this._instances.set(n.element,n),n},listGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Is(e,t);n.element&&this._instances.set(e,n),s.push(n)}return Os(s)},toast:Pn,dialog:qs,alert:qs.alert.bind(qs),confirm:qs.confirm.bind(qs),prompt:qs.prompt.bind(qs),createModal:(e={})=>(js(),gn(e)),showModal:(e={})=>(js(),function(e={}){return new Promise(t=>{let n=!1;const s=gn({...e,onButtonClick(s,i,...o){"function"==typeof e.onButtonClick&&e.onButtonClick(s,i,...o),n=!0,t(s)}});s.on("closed",()=>{n||(n=!0,t(null))}),s.open()})}(e)),signature(e,t={}){const n=new ti(e,t);return n.element&&this._instances.set(n.element,n),n},focusTrap(e,t={}){const n=new ut(e,t);return n.element?n:null},commandPalette:(e={})=>new ns(e),splitPane(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"split-pane");return n?n.setOptions(t):new rs(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},virtualList(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"virtual-list");return n?n.setOptions(t):new as(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},dropzone(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"dropzone");return n?Object.keys(t).length?n.setOptions(t):n:new bs(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},rangeSlider(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"range-slider");return n?Object.keys(t).length?n.setOptions(t):n:new xs(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},slider(e,t={}){return this.rangeSlider(e,t)},get(e,t){const n="string"==typeof e?document.querySelector(e):e;if(!n)return;const s=this._instances.get(n);return!s||t&&s.constructor?.componentName!==t?x(n,t)||(t?void 0:s):s},destroy(e,t){const n="string"==typeof e?document.querySelector(e):e,s=this.get(n,t);s&&(s.destroy(),this._instances.get(n)===s&&this._instances.delete(n))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()},_registry:new Map,register(e,t){this._registry.set(e,t)},create(e,t,n={}){const s=this._registry.get(e);if(s)return new s(t,n);throw new Error(`Unknown component: ${e}`)}};function hi(e,{fallback:t,onWrite:n}={}){const s=t&&"object"==typeof t?Object.keys(t):[];return 0===s.length&&"function"!=typeof n?e:new Proxy({},{get:(n,s)=>"string"==typeof s&&!(s in e)&&s in t?t[s]:e[s],has:(n,i)=>i in e||"string"==typeof i&&s.length>0&&i in t,ownKeys:()=>[...new Set([...s,...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),set:(t,s,i)=>(e[s]=i,"string"==typeof s&&"function"==typeof n&&n(s,i),!0)})}
|
|
9
|
-
/*! domma-reactive v1.3.1 | MIT | https://github.com/pinpointzero73/domma-reactive */function di(e,t){return pi(e,t,null)}function ui(e){return e===Object.prototype||null===e}function pi(e,t,n){if(Object.is(e,t))return!0;if(0===e&&0===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&Object.is(e.getTime(),t.getTime());const s=Array.isArray(e);if(s!==Array.isArray(t))return!1;if(!(s||ui(Object.getPrototypeOf(e))&&ui(Object.getPrototypeOf(t))))return!1;const i=n||new WeakMap,o=i.get(e);if(o){if(o.has(t))return!0;o.add(t)}else i.set(e,new Set([t]));if(s){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!pi(e[n],t[n],i))return!1;return!0}const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!pi(e[n],t[n],i))return!1}return!0}ci.contextMenu.closeAll=pe.closeAll,ci.contextMenu.active=pe.active,ci.contextMenu.registry=pe.registry,ci.skeleton.while=Pe.while,ci.skeleton.get=Pe.get,ci.skeleton.remove=Pe.remove,ci.skeleton.scan=Pe.scan,ci.skeleton.markup=Pe.markup,ci.avatar.scan=en.scan,ci.avatar.get=en.get,ci.avatar.initials=en.initials,ci.avatar.tone=en.tone,ci.avatarGroup.get=on.get,ci.popover.scan=e=>Bt.scan(e,(e,t)=>ci.popover(e,t)),ci.popover.closeAll=Bt.closeAll,ci.popover.getInstance=Bt.getInstance,ci.popover.open=Bt.openPopovers,ci.focusTrap.tabbables=ct,ci.focusTrap.top=()=>ut.top(),ci.commandPalette.formatShortcut=Yn,ci.commandPalette.fuzzyMatch=Jn,ci.commandPalette.claims=function(e){for(const t of es)if(t._hotkeyList.some(n=>Un(e,n,t._mac)))return!0;return!1},ci.buttonGroup.all=(e,t={})=>{const n=ci.buttonGroup(e,t);return n?n.all():[]},ci.tooltip.all=(e,t={})=>{const n=ci.tooltip(e,t);return n?n.all():[]},ci.listGroup.all=(e,t={})=>{const n=ci.listGroup(e,t);return n?n.all():[]};const mi=Symbol.for("domma-reactive.reactive");function fi(e){return Object.defineProperty(e,mi,{value:!0,enumerable:!1}),e}function _i(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&!0===e[mi]}function gi(e,{expr:t,where:n,handler:s}={}){if("function"!=typeof e||!1===s?.tracks||!0===s?.acceptsReactive)return e;let i=!1;return s=>{const o=e(s);if(!_i(o))return o;if(!i){i=!0;const e=n?` in ${n}`:"";console.warn(`[Domma Reactive] "${t}"${e} is an observable, not its value - use "${t}.value". The binding reads it as empty (hidden, off, no rows) until then.`)}}}let vi=null;const bi=[],yi=new Set;let ki=!1,wi=!1;class xi{constructor(e=null){this.subs=new Set,this.owner=e}track(){vi&&vi!==this.owner&&(this.subs.add(vi),vi.deps.add(this))}trigger(){if(0!==this.subs.size){for(const e of this.subs)e.invalidate(),yi.add(e);Li()}}}class Mi{constructor(e,t={}){this.fn=e,this.label=t.label||(t.effect?"effect":"computed"),this.isEffect=!0===t.effect,this.onNotify=t.onNotify||null,this._write="function"==typeof t.write?t.write:null,this.deps=new Set,this.dep=new xi(this),this._value=void 0,this.dirty=!0,this.disposed=!1}_run(){const e=new Set(this.deps);for(const e of this.deps)e.subs.delete(this);this.deps.clear(),bi.push(vi),vi=this;try{return this.fn()}catch(t){console.warn(`[Domma Reactive] "${this.label}" threw during evaluation:`,t);for(const t of e)this.deps.add(t),t.subs.add(this);return}finally{vi=bi.pop()}}get(){if(this.dirty&&!this.disposed){const e=this._value;this._value=this._run(),this.dirty=!1,this._evaluated&&!di(e,this._value)&&(this._pulledChange=!0),this._evaluated=!0}return this.dep.track(),this._value}get value(){return this.get()}set value(e){this.write(e)}write(e){this._write?Si(()=>this._write(e)):console.warn(`[Domma Reactive] "${this.label}" is a read-only computed - the assignment was ignored. Pass computed({read, write}) to say where a write should land.`)}set(e){this.write(e)}recompute(){if(this.disposed)return{changed:!1,value:this._value};const e=this._value;this._value=this._run(),this.dirty=!1;const t=this._pulledChange||!di(e,this._value);return this._pulledChange=!1,this._evaluated=!0,{changed:t,value:this._value}}invalidate(){this.dirty=!0}dependents(){return this.dep.subs}notify(){!this.disposed&&this.onNotify&&this.onNotify(this._value,this)}dispose(){if(!this.disposed){for(const e of this.deps)e.subs.delete(this);this.deps.clear(),this.dep.subs.clear(),yi.delete(this),this.disposed=!0}}}function Li(){ki||wi||(ki=!0,Promise.resolve().then(Ci))}function Ci(){if(ki=!1,!wi&&0!==yi.size){wi=!0;try{const e=new Set(yi);yi.clear(),function(e){const t=20,n=new Map,s=new Set,i=[...e];for(;i.length>0;){const e=i.shift();if(e.disposed)continue;const o=(n.get(e)||0)+1;if(n.set(e,o),o>t){console.warn(`[Domma Reactive] "${e.label}" re-entered the flush ${t} times - likely a dependency cycle. Skipping.`);continue}if(e.isEffect){s.add(e);continue}if(0===e.dependents().size&&!e.onNotify)continue;const{changed:r}=e.recompute();if(r)for(const t of e.dependents())t.invalidate(),i.push(t)}for(const e of s)e.disposed||e.recompute()}(e)}finally{wi=!1,yi.size>0&&Li()}}}function Ai(e,t={}){if(null!==e&&"object"==typeof e){const{read:n,...s}=e;if("function"!=typeof n)throw new TypeError("[Domma Reactive] computed({read, write}): `read` must be a function");return new Mi(n,{...s,...t,effect:!1})}return new Mi(e,{...t,effect:!1})}function Ei(e,t={}){const n=new Mi(e,{...t,effect:!0,onNotify:null});return n.recompute(),n}function Si(e){bi.push(vi),vi=null;try{return e()}finally{vi=bi.pop()}}Object.defineProperty(Mi.prototype,mi,{value:!0,enumerable:!1});const $i="[Domma Reactive]",zi=new Map,Ti=new Set(["notify","rateLimit","throttle"]);function Bi(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${$i} registerExtender: the name must be a non-empty string`);if("function"!=typeof t)throw new TypeError(`${$i} registerExtender: "${e}" was not given a function`);return zi.has(e)&&!Ti.has(e)&&console.warn(`${$i} registerExtender: "${e}" replaces an existing extender`),zi.set(e,t),t}Bi("notify",(e,t)=>{"always"===t?e.setEquals(()=>!1):console.warn(`${$i} extend: notify accepts only 'always' - got ${JSON.stringify(t)}`)});const ji=new WeakMap;Bi("rateLimit",(e,t)=>{const n=function(e){const t=e&&"object"==typeof e?e:{timeout:e},n=t.timeout;if("number"!=typeof n||!Number.isFinite(n)||n<0)return console.warn(`${$i} extend: rateLimit needs a timeout in milliseconds - got ${JSON.stringify(n)}`),null;const s=t.method||"notifyWhenChangesStop";return"notifyWhenChangesStop"!==s&&"notifyAtFixedRate"!==s?(console.warn(`${$i} extend: rateLimit method must be 'notifyWhenChangesStop' or 'notifyAtFixedRate' - got ${JSON.stringify(s)}`),null):{timeout:n,fixed:"notifyAtFixedRate"===s}}(t);if(!n)return;let s=ji.get(e.observable);s||(s={timeout:n.timeout,fixed:n.fixed,timer:null,latest:void 0,armed:!1},ji.set(e.observable,s),e.intercept(e=>t=>function(e,t,n){e.timeout<=0?t(n):(e.latest=n,e.fixed&&e.armed||(e.armed=!0,e.timer&&clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,e.armed=!1,t(e.latest)},e.timeout)))}(s,e,t))),s.timeout=n.timeout,s.fixed=n.fixed,0===n.timeout&&s.timer&&(clearTimeout(s.timer),s.timer=null,s.armed=!1)}),Bi("throttle",(e,t)=>{zi.get("rateLimit")(e,t)});const Oi="[Domma Reactive]";function Di(){const e=new Set;return{add(t){if("function"!=typeof t)throw new TypeError(`${Oi} subscribe: expected a function`);e.add(t);const n=()=>{e.delete(t)};return n.dispose=n,n},notify(t){if(0!==e.size)for(const n of[...e])try{n(t)}catch(e){console.warn(`${Oi} a subscriber threw:`,e)}},size:()=>e.size}}function Ni(e,t){let n=e.equals||di,s=t;const i={observable:null,setEquals(e){if("function"!=typeof e)throw new TypeError(`${Oi} extend: setEquals expects a function`);n=e},intercept(e){if("function"!=typeof e)throw new TypeError(`${Oi} extend: intercept expects a function`);s=e(s)}};return{changed:(e,t)=>!n(e,t),announce:e=>s(e),attach:e=>{i.observable=e},extend:e=>function(e,t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){const t=zi.get(n);t?t(e,s):console.warn(`${$i} extend: no extender named "${n}". Registered: ${[...zi.keys()].join(", ")}.`)}else console.warn(`${$i} extend: expected an object of extenders`)}(i,e)}}function Ii(e,t={}){const n=new xi,s=Di();let i=e;const o=Ni(t,e=>{n.trigger(),s.notify(e)}),r=e=>{const t=o.changed(i,e);i=e,t&&o.announce(i)},a={get value(){return n.track(),i},set value(e){r(e)},peek:()=>i,set:e=>r(e),subscribe:e=>s.add(e),extend:e=>(o.extend(e),a)};return o.attach(a),fi(a)}const Hi=["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"];const Wi=new Set(["$data","$root","$parent","$index","$length","$parents","$parentContext","$component"]),Pi=Object.freeze([]);function Fi(e){let t=null;return Object.defineProperty(e,"$parents",{enumerable:!0,get:()=>t??=function(e){const t=[];for(let n=e.$parentContext;null!==n;n=n.$parentContext)t.push(n.$data);return Object.freeze(t)}(e)}),Object.freeze(e)}function Ri(e,t,n=null,s=null){const i=qi(e);return Fi({$data:t,$root:i.$root,$parent:i.$data,$index:void 0===n?null:n,$length:void 0===s?null:s,$parentContext:i,$component:i.$component??null})}function Vi(e,t){const n=qi(e);return Fi({$data:t,$root:n.$root,$parent:n.$data,$index:null,$length:null,$parentContext:n,$component:t})}function qi(e){return function(e){return null!==e&&"object"==typeof e&&"$data"in e}(e)?e:(t=e,Object.freeze({$data:t,$root:t,$parent:null,$index:null,$length:null,$parents:Pi,$parentContext:null,$component:null}));var t}const Ui="[Domma Reactive]",Ki=64,Yi=new Set(["__proto__","constructor","prototype"]),Gi=new Map([["new","the `new` operator is not supported"],["delete","`delete` is not supported"],["typeof","`typeof` is not supported"],["void","`void` is not supported"],["instanceof","`instanceof` is not supported"],["in","the `in` operator is not supported"],["function","function expressions are not supported"],["class","class expressions are not supported"],["this","`this` is not supported - use $data"],["await","`await` is not supported"],["yield","`yield` is not supported"]]);class Ji extends Error{}const Xi=new Map,Zi=function(e){const t=e=>_i(e)?e.value:e;function n(e){const n=t(e);return Array.isArray(n)?n:n instanceof Set?[...n]:[]}function s(n,s){if(null==s)return t(n);let i=t(n);for(const n of String(s).split("."))if(i=t(e(i,n)),null==i)return i;return i}function i(e){const[t,n]=e;return e.length>=2?e=>s(e,t)===n:e=>Boolean(s(e,t))}return new Map(Object.entries({len(e){const n=t(e);return"string"==typeof n||Array.isArray(n)?n.length:n instanceof Set||n instanceof Map?n.size:0},includes(e,s){const i=t(e);return"string"==typeof i?i.includes(String(s)):n(i).includes(s)},some:(e,...t)=>n(e).some(i(t)),every:(e,...t)=>n(e).every(i(t)),count(e,...t){const s=n(e);if(0===t.length)return s.length;const o=i(t);let r=0;for(const e of s)o(e)&&r++;return r},where:(e,...t)=>n(e).filter(i(t)),sum(e,t){let i=0;for(const o of n(e)){const e=Number(s(o,t));Number.isFinite(e)&&(i+=e)}return i},pluck:(e,t)=>n(e).map(e=>s(e,t)),sortBy(e,t,i="asc"){const o="desc"===i?-1:1;return n(e).map(e=>({item:e,by:s(e,t)})).sort((e,t)=>{const n=void 0===e.by||null===e.by,s=void 0===t.by||null===t.by;return n||s?n-s:"string"==typeof e.by&&"string"==typeof t.by?o*e.by.localeCompare(t.by):e.by<t.by?-o:e.by>t.by?o:0}).map(e=>e.item)},first:e=>n(e)[0],last(e){const t=n(e);return t[t.length-1]},join:(e,s=", ")=>n(e).map(e=>{const n=t(e);return null==n?"":String(n)}).join(String(s))}))}(go),Qi=new Map,eo=new Map,to=new WeakMap,no=new Set,so=/[0-9]/,io=/[\p{ID_Start}$_]/u,oo=/[\p{ID_Continue}$\u200C\u200D]/u,ro=["===","!==","&&","||","<=",">=","??","==","!=","<",">","+","-","*","/","%","!","?",":",".",",","(",")","[","]","{","}","="],ao=new Map([["==","loose equality is not supported - use ==="],["!=","loose inequality is not supported - use !=="],["=","assignment is not supported"],["??","the ?? operator is not supported"]]),lo={n:"\n",t:"\t",r:"\r",b:"\b",f:"\f",v:"\v",0:"\0"};function co(e,t){const n=e[t];let s="",i=t+1;for(;i<e.length;){const t=e[i];if("\\"===t){const t=e[i+1];if(void 0===t)break;if("u"===t){const t=e.slice(i+2,i+6);if(!/^[0-9a-fA-F]{4}$/.test(t))throw new Ji(`bad \\u escape at position ${i}`);s+=String.fromCharCode(parseInt(t,16)),i+=6;continue}s+=Object.prototype.hasOwnProperty.call(lo,t)?lo[t]:t,i+=2;continue}if(t===n)return{value:s,end:i+1};s+=t,i++}throw new Ji(`unterminated string starting at position ${t}`)}const ho={"||":{bp:3,logical:!0},"&&":{bp:4,logical:!0},"===":{bp:5},"!==":{bp:5},"<":{bp:6},"<=":{bp:6},">":{bp:6},">=":{bp:6},"+":{bp:7},"-":{bp:7},"*":{bp:8},"/":{bp:8},"%":{bp:8}},uo=new Set(["-","+","!"]),po=e=>Object.freeze(e);function mo(e,t=!1){const n=function(e){const t=[];let n=0;for(;n<e.length;){const s=e[n];if(/\s/.test(s)){n++;continue}if(so.test(s)){const s=n;for(;n<e.length&&so.test(e[n]);)n++;if("."===e[n])for(n++;n<e.length&&so.test(e[n]);)n++;if("e"===e[n]||"E"===e[n]){const t=n;if(n++,"+"!==e[n]&&"-"!==e[n]||n++,so.test(e[n]??""))for(;n<e.length&&so.test(e[n]);)n++;else n=t}t.push({type:"num",value:Number(e.slice(s,n)),pos:s});continue}if('"'===s||"'"===s){const s=co(e,n);t.push({type:"str",value:s.value,pos:n}),n=s.end;continue}if("`"===s)throw new Ji(`template literals are not supported at position ${n}`);if(io.test(s)){const s=n;for(n++;n<e.length&&oo.test(e[n]);)n++;const i=e.slice(s,n);"true"===i?t.push({type:"num",value:!0,pos:s}):"false"===i?t.push({type:"num",value:!1,pos:s}):"null"===i?t.push({type:"num",value:null,pos:s}):t.push({type:"ident",value:i,pos:s});continue}const i=ro.find(t=>e.startsWith(t,n));if(i){const e=ao.get(i);if(e)throw new Ji(`${e} (at position ${n})`);t.push({type:"punct",value:i,pos:n}),n+=i.length;continue}throw new Ji(`unexpected character "${s}" at position ${n}`)}return t.push({type:"eof",value:null,pos:e.length}),t}(e);let s=0,i=0;const o=()=>n[s],r=e=>"punct"===n[s].type&&n[s].value===e,a=(e,t=n[s])=>{throw new Ji(`${e} at position ${t.pos}`)},l=e=>!!r(e)&&(s++,!0),c=e=>{l(e)||a(`expected "${e}" but found ${fo(o())}`)};function h(e){if(++i>Ki)throw new Ji("expression nests deeper than 64 levels");try{let t=function(){const e=o();if("num"===e.type||"str"===e.type)return s++,po({type:"Literal",value:e.value});if("ident"===e.type){const t=Gi.get(e.value);return t&&a(t),s++,po({type:"Identifier",name:e.value})}if("punct"===e.type){if(uo.has(e.value))return s++,po({type:"Unary",operator:e.value,argument:h(9)});if("("===e.value){s++;const e=h(0);return c(")"),e}if("["===e.value)return s++,po({type:"ArrayLiteral",elements:Object.freeze(d("]"))});if("{"===e.value)return s++,function(){const e=[];if(!r("}"))do{r("}")&&a('a trailing comma before "}" is not supported');const t=o();let n;"ident"===t.type||"str"===t.type?n=String(t.value):"punct"===t.type&&"["===t.value?a("computed keys are not supported in an object literal"):"punct"===t.type&&"."===t.value?a("spread is not supported in an object literal"):a(`expected a property name but found ${fo(t)}`),Yi.has(n)&&a(`the key "${n}" is not allowed`),s++,(r(",")||r("}"))&&a(`shorthand properties are not supported - write ${n}: ${n}`),r("(")&&a("methods are not supported in an object literal"),c(":"),e.push(Object.freeze({key:n,value:h(0)}))}while(l(","));return c("}"),po({type:"ObjectLiteral",entries:Object.freeze(e)})}()}return a(`unexpected ${fo(e)}`)}();for(;;){const n=o();if("punct"!==n.type)break;if(10>e&&("."===n.value||"["===n.value||"("===n.value)){t=u(t);continue}if("?"===n.value&&2>e){s++;const e=h(0);c(":");const n=h(1);t=po({type:"Conditional",test:t,consequent:e,alternate:n});continue}const i=Object.prototype.hasOwnProperty.call(ho,n.value)?ho[n.value]:void 0;if(!i||i.bp<=e)break;s++;const r=h(i.bp);t=po({type:i.logical?"Logical":"Binary",operator:n.value,left:t,right:r})}return t}finally{i--}}function d(e){const t=[];if(!r(e))do{r(e)&&a(`a trailing comma before "${e}" is not supported`),t.push(h(0))}while(l(","));return c(e),t}function u(e){if(l(".")){const t=o();return"ident"!==t.type&&a(`expected a property name after "." but found ${fo(t)}`),s++,po({type:"Member",object:e,property:t.value,computed:!1})}if(l("[")){const t=h(0);return c("]"),po({type:"Member",object:e,property:t,computed:!0})}c("(");const n=t&&"Member"===e.type;"Identifier"===e.type||n||a("only registered helpers can be called - `x.foo()` is not supported");const i=[];if(!r(")"))do{i.push(h(0))}while(l(","));return c(")"),po(n?{type:"MethodCall",object:e.object,property:e.property,computed:e.computed,args:Object.freeze(i)}:{type:"Call",callee:e.name,args:Object.freeze(i)})}if(1===n.length)throw new Ji("the expression is empty");const p=h(0);"eof"!==o().type&&a(`unexpected ${fo(o())}`);const m=function(e){let t=0;const n=[[e,1]];for(;n.length>0;){const[e,s]=n.pop();if(s>t&&(t=s),t>Ki)return t;for(const t of _o(e))n.push([t,s+1])}return t}(p);if(m>Ki)throw new Ji(`expression nests deeper than 64 levels (${m})`);return p}function fo(e){return"eof"===e.type?"end of expression":"str"===e.type?`string ${JSON.stringify(e.value)}`:"num"===e.type?`literal ${String(e.value)}`:`"${e.value}"`}function _o(e){switch(e?.type){case"Member":return e.computed?[e.object,e.property]:[e.object];case"Unary":return[e.argument];case"Binary":case"Logical":return[e.left,e.right];case"Conditional":return[e.test,e.consequent,e.alternate];case"Call":return e.args;case"ArrayLiteral":return e.elements;case"ObjectLiteral":return e.entries.map(e=>e.value);case"MethodCall":return e.computed?[e.object,e.property,...e.args]:[e.object,...e.args];default:return[]}}function go(e,t){if(null==e)return;const n=String(t);if(!Yi.has(n))return e[n];console.warn(`${Ui} blocked an expression from reading "${n}" - __proto__, constructor and prototype are not readable from an expression`)}const vo=new WeakSet;class bo extends Error{}function yo(e,t){if(!_i(e))return e;if(!vo.has(t)){vo.add(t);const e="Identifier"===t.type?t.name:"Member"!==t.type||t.computed?"an operand":`…${t.property}`;console.warn(`${Ui} "${e}" is an observable used in an expression, not its value - use "${e}.value". The expression reads as undefined until then.`)}throw new bo(name)}function ko(e,t,n){if(n>Ki)throw new Ji("evaluation nests deeper than 64 levels");switch(e.type){case"Literal":return e.value;case"Identifier":return function(e,t){return Wi.has(e)?t[e]:go(t.$data,e)}(e.name,t);case"Member":return go(ko(e.object,t,n+1),e.computed?ko(e.property,t,n+1):e.property);case"Unary":{const s=yo(ko(e.argument,t,n+1),e.argument);switch(e.operator){case"!":return!s;case"-":return-s;default:return+s}}case"Logical":{const s=yo(ko(e.left,t,n+1),e.left);return"&&"===e.operator?s?ko(e.right,t,n+1):s:s||ko(e.right,t,n+1)}case"Binary":{const s=yo(ko(e.left,t,n+1),e.left),i=yo(ko(e.right,t,n+1),e.right);switch(e.operator){case"+":return s+i;case"-":return s-i;case"*":return s*i;case"/":return s/i;case"%":return s%i;case"===":return s===i;case"!==":return s!==i;case"<":return s<i;case"<=":return s<=i;case">":return s>i;default:return s>=i}}case"Conditional":return yo(ko(e.test,t,n+1),e.test)?ko(e.consequent,t,n+1):ko(e.alternate,t,n+1);case"Call":return function(e,t){const n=Xi.get(e)??Zi.get(e);if("function"==typeof n)return n(...t);no.has(e)||(no.add(e),console.warn(`${Ui} no helper named "${e}" is registered - expressions can only call helpers registered with registerHelper()`))}(e.callee,e.args.map(e=>ko(e,t,n+1)));case"ArrayLiteral":return e.elements.map(e=>ko(e,t,n+1));case"ObjectLiteral":{const s={};for(const{key:i,value:o}of e.entries)Object.defineProperty(s,i,{value:ko(o,t,n+1),enumerable:!0,writable:!0,configurable:!0});return s}case"MethodCall":throw new Ji("an expression cannot call a method - `x.foo()` is available to data-on-* handlers only, because a call during a render is a side effect");default:throw new Ji(`unknown node type "${e.type}"`)}}function wo(e,t={}){const n="string"==typeof e?e:String(e??""),s=!0===t.methodCalls,i=s?eo:Qi;if(i.has(n))return i.get(n);let o=null;try{o=mo(n,s),to.set(o,n)}catch(e){const s=t.template?` in template "${t.template}"`:"";console.warn(`${Ui} could not parse expression "${n}"${s}: ${e.message}. The binding is skipped.`),o=null}return i.size>=1e3&&i.clear(),i.set(n,o),o}function xo(e,t){if(null!==e&&"object"==typeof e&&"string"==typeof e.type)try{return ko(e,qi(t),0)}catch(t){if(t instanceof bo)return;const n=to.get(e);return void console.warn(`${Ui} expression ${void 0===n?"(not from parseExpression) ":`"${n}" `}threw during evaluation:`,t)}}function Mo(e,t={}){const n=wo(e,t);return null===n?null:e=>xo(n,e)}function Lo(e,t={}){const n="string"==typeof e?wo(e,t):e,s=new Set;if(null===n||"object"!=typeof n)return s;const i=[n];for(;i.length>0;){const e=i.pop();if(null!==e&&"object"==typeof e)if("Identifier"!==e.type)if("Member"!==e.type||e.computed||"Identifier"!==e.object?.type||"$data"!==e.object.name&&"$root"!==e.object.name)for(const t of _o(e))i.push(t);else s.add(e.property);else Wi.has(e.name)||s.add(e.name)}return s}function Co(e,t){if("string"!=typeof e||!function(e){if(0===e.length||!io.test(e[0]))return!1;for(const t of e.slice(1))if(!oo.test(t))return!1;return!Gi.has(e)}(e))throw new TypeError(`${Ui} registerHelper: "${String(e)}" is not a valid helper name (it must be a plain identifier, so that an expression can spell it)`);if("function"!=typeof t)throw new TypeError(`${Ui} registerHelper: "${e}" was given a ${typeof t}, not a function`);return Xi.set(e,t),no.delete(e),t}const Ao=/&(?:lt|gt|quot|apos|nbsp|amp|#39|#x27|#47|#x2[Ff]|#96|#x60);/g,Eo={"<":"<",">":">",""":'"',"'":"'","'":"'","'":"'"," ":" ","&":"&","/":"/","/":"/","/":"/","`":"`","`":"`"};function So(e){return e.includes("&")?e.replace(Ao,e=>Eo[e]):e}const $o=/\{\{#(if|unless|each|with)\s+([^}]+?)\s*\}\}/,zo=/\{\{([#/])(if|unless|each|with)(?:\s+[^}]*?)?\s*\}\}|\{\{else\}\}/g,To=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,Bo=/\{\{>\s*([^{}]+?)\s*\}\}/g,jo=/\{\{!\s*[^{}]*?\s*\}\}/g,Oo=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,Do=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,No=/[?:()[\]'"!<>=*/%]|&&|\|\||\s[-+]\s/,Io={"&":"&","<":"<",">":">",'"':""","'":"'"},Ho=e=>null==e?"":String(e);function Wo(e){return Array.isArray(e)?e.length>0:Boolean(e)}function Po(e){if(!Array.isArray(e))return[];for(let t=0;t<e.length;t++){const n=e[t];if(null!==n&&"object"==typeof n&&!0===n._destroy)return e.filter(e=>!(null!==e&&"object"==typeof e&&!0===e._destroy))}return e}function Fo(e,t,n){const s=function(e,t,n){const s=e.trim();if("."===s)return null!==t&&"object"==typeof t&&"."in t?t["."]:t;return s.startsWith("@")?t?.[s]:Do.test(s)||!No.test(s)?function(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}(t,s):function(e,t,n={}){return xo(wo(e,n),t)}(s,t,n)}(e,t,n);if(!_i(s))return s;const i=e.trim();Ro.has(i)||(Ro.add(i),console.warn(`[Domma Reactive] "${i}" is an observable, not its value - use "${i}.value". It renders as empty until then.`))}const Ro=new Set;function Vo(e,t,n){return e.replace(jo,"").replace(Bo,(e,s)=>{const i=n.partials?.[s.trim()];return void 0===i?"":qo(i,t,n)}).replace(To,(e,s)=>Ho(Fo(s,t,n))).replace(Oo,(e,s)=>Ho(Fo(s,t,n)).replace(/[&<>"']/g,e=>Io[e]))}function qo(e,t={},n={}){if("string"!=typeof e||0===e.length)return"";const s=e.match($o);if(!s)return Vo(e,t,n);const[i,o,r]=s,a=s.index+i.length,{close:l,alternate:c}=function(e,t,n){let s=0,i=-1;for(const o of e.slice(n).matchAll(zo)){const e=n+o.index;if(void 0!==o[1])if("#"!==o[1]){if(0!==s)s--;else if(o[2]===t)return{close:e,alternate:i}}else s++;else 0===s&&-1===i&&(i=e)}return{close:-1,alternate:-1}}(e,o,a);if(-1===l)return Vo(e,t,n);const h="if"===o&&-1!==c&&c<l,d=e.slice(a,h?c:l),u=h?e.slice(c+8,l):"",p=Vo(e.slice(0,s.index),t,n),m=qo(e.slice(l+`{{/${o}}}`.length),t,n),f=Fo(r,t,n);let _="";if("if"===o)_=Wo(f)?qo(d,t,n):qo(u,t,n);else if("unless"===o)_=Wo(f)?"":qo(d,t,n);else if("each"===o){const e=Po(f);_=e.map((t,s)=>qo(d,function(e,t,n){const s={"@index":t,"@first":0===t,"@last":t===n-1};return null!==e&&"object"==typeof e?{...e,...s}:{".":e,...s}}(t,s,e.length),n)).join("")}else _=null!==f&&"object"==typeof f?qo(d,f,n):"";return p+_+m}const Uo="[Domma Reactive]",Ko=new Map,Yo=new Set;function Go(e,t){Yo.has(e)||(Yo.add(e),console.warn(`${Uo} ${t}`))}function Jo(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Uo} registerBinding: the name must be a non-empty string`);if(null===t||"object"!=typeof t)throw new TypeError(`${Uo} registerBinding: "${e}" was not given a handler object`);if("function"!=typeof t.update)throw new TypeError(`${Uo} registerBinding: "${e}" has no update() function`);for(const n of["attach","detach"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`${Uo} registerBinding: "${e}".${n} is not a function`);return Ko.has(e)&&console.warn(`${Uo} registerBinding: "${e}" replaces an existing binding handler`),Ko.set(e,Object.freeze({...t})),t}function Xo(e){return Ko.get(e)}function Zo(e){let t=null;for(const[n,s]of Ko){if(s.attribute===e)return{kind:n,handler:s,arg:null};"string"==typeof s.attributePrefix&&e.startsWith(s.attributePrefix)&&e.length>s.attributePrefix.length&&(null===t||s.attributePrefix.length>t.handler.attributePrefix.length)&&(t={kind:n,handler:s,arg:e.slice(s.attributePrefix.length)})}return t}const Qo=e=>null==e?"":String(e);function er(e,t){if(null===e||"object"!=typeof e)return null;if("Identifier"===e.type){if(Wi.has(e.name))return null;const n=t.$data;return null===n||"object"!=typeof n||(Object.isFrozen(n)||Yi.has(e.name))?null:{object:n,key:e.name}}if("Member"===e.type){const n=xo(e.object,t);if(null===n||"object"!=typeof n)return null;if(Object.isFrozen(n))return null;const s=Qo(e.computed?xo(e.property,t):e.property);return Yi.has(s)?null:{object:n,key:s}}return null}const tr={tracks:!0,update({binding:e,nodes:t,context:n}){const s=Qo(e.evaluate(n));for(const e of t)e.textContent=s;return!0}},nr={tracks:!0,update({binding:e,nodes:t,context:n,render:s}){for(const i of t)for(const t of e.parts){const e=So(s(t.tmpl,n.$data));i.setAttribute(t.name,e),"value"===t.name&&"value"in i&&(i.value=e)}return!0}},sr={tracks:!0,capturesBody:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:i,reindex:o}){const r=s(e.body,n.$data);for(const e of t)i(e.open,e.close,r);return o(),!0}},ir={tracks:!0,region:!0,capturesBody:!0,primes:!0,attribute:"data-if",expression:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:i,reindex:o}){const r=Wo(e.evaluate(n))?s(e.body,n.$data):"";for(const e of t)i(e.open,e.close,r);return o(),!0}},or=new WeakMap,rr={attributePrefix:"data-on-",expression:!0,methodCalls:!0,tracks:!1,update:()=>!1,attach({binding:e,node:t,controller:n}){if(!e.arg)return;const s=t=>function(e,t,n){const s=e.ast;if(null===s)return;let i,o,r=n.$data;if("MethodCall"===s.type){r=xo(s.object,n);i=go(r,s.computed?xo(s.property,n):s.property),o=s.args.map(e=>xo(e,n))}else"Call"===s.type?(i=xo({type:"Identifier",name:s.callee},n),o=s.args.map(e=>xo(e,n))):(i=xo(s,n),o=[]);if("function"!=typeof i)return void Go(`event:${e.id}:${e.expr}`,`data-on-${e.arg}="${e.expr}" did not resolve to a function - an event binding names a handler on your data, or calls one`);!1===i.call(r,...o,t)&&t.preventDefault()}(e,t,n.context());t.addEventListener(e.arg,s);let i=or.get(t);i||or.set(t,i=new Map),i.set(e.id,{type:e.arg,listener:s})},detach({binding:e,node:t}){const n=or.get(t)?.get(e.id);n&&(t.removeEventListener(n.type,n.listener),or.get(t).delete(e.id))}};const ar=new Set(["value","checked","selected","disabled","readonly","required","multiple","indeterminate","open","hidden"]),lr=new WeakMap,cr=new WeakMap,hr={attributePrefix:"data-bind-",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.arg;if("html"===s)return Go("bind:html","data-bind-html is not supported - assigning innerHTML from data is an XSS hole. Use {{{triple-stache}}}, which says so where an author can see it."),!1;const i=e.evaluate(n);for(const n of t)"text"===s?n.textContent=Qo(i):"class"===s?dr(e,n,i):"style"===s?mr(e,n,i):s.startsWith("style-")?ur(n,s.slice(6),i):ar.has(s)&&s in n?n[s]="value"===s?Qo(i):Boolean(i):null==i||!1===i?n.removeAttribute(s):n.setAttribute(s,!0===i?"":Qo(i));return!0}};function dr(e,t,n){let s=lr.get(e);s||lr.set(e,s=new WeakMap);for(const e of s.get(t)||[])t.classList.remove(e);const i=n?Qo(n).split(/\s+/).filter(Boolean):[];for(const e of i)t.classList.add(e);s.set(t,i)}function ur(e,t,n){null!=n&&!1!==n&&""!==n?e.style.setProperty(t,Qo(n)):e.style.removeProperty(t)}function pr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function mr(e,t,n){if(null!=n&&"object"!=typeof n)return void Go(`bind:style:${e.id}`,`data-bind-style="${e.expr}" needs an object of CSS properties - got `+typeof n+". For a single property use data-bind-style-<property>.");let s=cr.get(e);s||cr.set(e,s=new WeakMap);const i=s.get(t)||[],o=[];for(const[e,s]of Object.entries(n||{})){const n=pr(e);ur(t,n,s),o.push(n)}for(const e of i)o.includes(e)||t.style.removeProperty(e);s.set(t,o)}const fr=Symbol("dm:option-value"),_r=Symbol("dm:pending-value"),gr={attribute:"data-options",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Po(e.evaluate(n));for(const i of t)br(e,i,s,n);return!0}};function vr(e,t){const n=e.getAttribute(t);return null===n||""===n.trim()?null:Mo(n)}function br(e,t,n,s){if("SELECT"!==t.tagName)return void Go(`options:${e.id}`,`data-options="${e.expr}" is on <${t.tagName.toLowerCase()}>, which has no options. Put it on a <select>.`);const i=vr(t,"data-options-text"),o=vr(t,"data-options-value"),r=vr(t,"data-options-caption"),a=_r in t?[].concat(t[_r]):function(e){return[...e.options].filter(e=>e.selected).map(e=>fr in e?e[fr]:e.value)}(t);if(t.textContent="",r){const e=document.createElement("option");e.value="",e.textContent=Qo(r(s)),t.appendChild(e)}n.forEach((e,r)=>{const a=Ri(s,e,r,n.length),l=document.createElement("option");l.textContent=Qo(i?i(a):e);const c=o?o(a):e;null==c||"object"==typeof c?(l.value=`\0opt:${r}`,l[fr]=c):"string"!=typeof c?(l.value=Qo(c),l[fr]=c):l.value=c,t.appendChild(l)}),function(e,t){if(0===t.length)return;let n=!1;for(const s of e.options){const i=fr in s?s[fr]:s.value,o=t.some(e=>e===i);e.multiple?(s.selected=o,n=n||o):o&&!n&&(s.selected=!0,n=!0)}e.multiple||n||(e.selectedIndex=e.options.length>0?0:-1);n&&delete e[_r]}(t,a)}const yr={attribute:"data-model",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.evaluate(n);for(const e of t)Mr(e,s);return!0},attach({binding:e,node:t,controller:n}){const s=()=>{const s=n.context(),i=er(e.ast,s);if(null===i)return void Go(`model:${e.id}:${e.expr}`,`data-model="${e.expr}" is not a settable path, so nothing was written`);const o=function(e){switch(wr(e)){case"checkbox":return e.checked;case"radio":return e.checked?e.value:kr;case"select-multiple":return Array.from(e.options).filter(e=>e.selected).map(xr);case"select":return-1===e.selectedIndex?"":xr(e.options[e.selectedIndex]);case"number":return""===e.value?null:Number(e.value);default:return e.value}}(t);o!==kr&&(i.object[i.key]=o)},i=function(e){const t=wr(e);return"text"===t||"number"===t?["input","change"]:["change"]}(t);for(const e of i)t.addEventListener(e,s);let o=or.get(t);o||or.set(t,o=new Map),o.set(e.id,{type:i,listener:s})},detach({binding:e,node:t}){const n=or.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);or.get(t).delete(e.id)}}},kr=Symbol("no-write");function wr(e){const t=e.tagName;if("SELECT"===t)return e.multiple?"select-multiple":"select";if("INPUT"!==t)return"text";const n=String(e.type||"").toLowerCase();return"checkbox"===n||"radio"===n?n:"number"===n||"range"===n?"number":"text"}function xr(e){return fr in e?e[fr]:e.value}function Mr(e,t){switch(wr(e)){case"checkbox":{const n=Boolean(t);return void(e.checked!==n&&(e.checked=n))}case"radio":{const n=Qo(t)===e.value;return void(e.checked!==n&&(e.checked=n))}case"select-multiple":{const n=Array.isArray(t)?t:[];if(0===e.options.length)return void(n.length>0&&(e[_r]=n));const s=new Set(n.map(Qo));for(const t of e.options){const e=xr(t),i=n.some(t=>t===e)||s.has(t.value);t.selected!==i&&(t.selected=i)}return}case"select":{const n=function(e,t){return[...e.options].find(e=>xr(e)===t)||null}(e,t);if(n)return n.selected||(n.selected=!0),void delete e[_r];const s=Qo(t);return e.value!==s&&(e.value=s),void(e.value!==s?e[_r]=t:delete e[_r])}default:{const n=Qo(t);e.value!==n&&(e.value=n)}}}const Lr=new WeakSet,Cr={attribute:"data-focus",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Wo(e.evaluate(n));for(const e of t){if("function"!=typeof e.focus)continue;if(s!==(e.ownerDocument.activeElement===e)){Lr.add(e);try{s?e.focus():e.blur()}finally{Lr.delete(e)}}}return!0},attach({binding:e,node:t,controller:n}){const s=s=>{if(Lr.has(t))return;const i=n.context(),o=er(e.ast,i);null!==o?o.object[o.key]="focus"===s.type:Go(`focus:${e.id}:${e.expr}`,`data-focus="${e.expr}" is not a settable path, so focus was not written back. Focus still follows the value.`)},i=["focus","blur"];for(const e of i)t.addEventListener(e,s);let o=or.get(t);o||or.set(t,o=new Map),o.set(e.id,{type:i,listener:s})},detach({binding:e,node:t}){const n=or.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);or.get(t).delete(e.id)}}};Jo("text",tr),Jo("attr",nr),Jo("block",sr),Jo("raw",sr),Jo("if",ir),Jo("event",rr),Jo("bind",hr),Jo("model",yr),Jo("options",gr),Jo("focus",Cr);const Ar=new WeakMap;let Er=0;function Sr(e,t){if(null==e||"function"!=typeof t)return;let n=Ar.get(e);n||Ar.set(e,n=new Set),n.add(t),Er++}function $r(e){const t=Ar.get(e);if(t){Ar.delete(e),Er-=t.size;for(const e of t)try{e()}catch(e){console.warn("[Domma Reactive] a disposer threw:",e)}}}function zr(e){if(0===Er||null==e)return;if($r(e),1!==e.nodeType&&11!==e.nodeType)return;const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null),n=[];let s;for(;s=t.nextNode();)Ar.has(s)&&n.push(s);for(const e of n)$r(e)}const Tr=["data-dm-t","data-dm-a","data-dm-b"];Tr.map(e=>`[${e}]`).join(",");const Br=e=>`\x3c!--dm:${e}--\x3e`,jr=e=>`\x3c!--/dm:${e}--\x3e`;function Or(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function Dr(e,t){const n=[];for(let s=e.nextSibling;s&&s!==t;s=s.nextSibling)n.push(s);return n}function Nr(e,t,n){const s=e.parentNode;if(!s)return;let i=e.nextSibling;for(;i&&i!==t;){const e=i.nextSibling;zr(i),s.removeChild(i),i=e}n&&s.insertBefore(Or(n),t)}const Ir="[Domma Reactive]";function Hr(e){const{bindings:t,getRoots:n,render:s,reactive:i=!1,label:o="",repaint:r=null}=e,a=new Map(t.map(e=>[e.id,e]));for(const e of t)e.seen=new WeakSet;const l=new Map;let c=[],h=!1,d=!1,u=qi(e.context);function p(){d||(function(e,t,n){for(const e of n)e.nodes=null;const s=(e,n)=>{const s=t.get(e);s&&(s.nodes||=[]).push(n)},i=e=>{for(const t of Tr){const n=e.getAttribute(t);if(null!==n)for(const t of n.split(/\s+/))s(t,e)}},o=new Map,r=e=>{const t=e.data;if(t.startsWith("/dm:")){const n=t.slice(4),i=o.get(n);if(!i)return;s(n,{open:i,close:e}),o.delete(n)}else t.startsWith("dm:")&&o.set(t.slice(3),e)};for(const t of e){if(8===t.nodeType){r(t);continue}if(1!==t.nodeType&&11!==t.nodeType)continue;1===t.nodeType&&i(t);const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null);let n;for(;n=e.nextNode();)8===n.nodeType?r(n):i(n)}}(n(),a,t),function(){for(const e of t){if(null===e.nodes){f(e.id);continue}const t=Xo(e.kind);let n=!1;for(const s of e.nodes){const i=void 0===s.nodeType?s.open:s;e.seen.has(i)||(e.seen.add(i),n=!0,void 0!==s.nodeType&&t?.attach?.({binding:e,node:s,controller:_}))}n&&(i||!0===e.prime)&&c.push(e)}}(),function(){if(h)return;h=!0;try{let e=0;for(;c.length>0;){if(++e>20){console.warn(`${Ir} a binding kept revealing new nodes after 20 rounds; giving up so the page still renders. Kinds still pending: ${[...new Set(c.map(e=>e.kind))].join(", ")}`);break}const t=c;c=[];for(const e of[!0,!1])for(const n of t)!0===Xo(n.kind)?.region===e&&m(n)}}finally{h=!1,c=[]}}())}function m(e){if(!i)return void _.update(e.id);const t=l.get(e.id);!t||t.disposed?l.set(e.id,Ei(()=>_.update(e.id),{label:`${o||"binding"}:${e.id}`})):t.recompute()}function f(e){const t=l.get(e);t&&(l.delete(e),t.dispose())}const _={bindings:t,deps:e=>a.get(e)?.deps||new Set,context:()=>u,setContext(e){u=qi(e)},refresh(e=null){for(const n of t)null!==n.nodes&&0!==n.nodes.length&&(null!==e&&!0!==e(n)||m(n))},index:p,update(e,t){if(void 0!==t&&(u=qi(t)),d)return!1;const n=a.get(e);if(!n||!n.nodes||0===n.nodes.length)return!1;const i=Xo(n.kind);return void 0!==i&&!0===i.update({binding:n,nodes:n.nodes,context:u,render:s,replaceRegion:Nr,reindex:p,controller:_})},updateAll(e){void 0!==e&&(u=qi(e));for(const e of t)_.update(e.id)},rerenderAll(e){void 0!==e&&(u=qi(e)),r?.(u),p()},rerender(e){_.rerenderAll(e)},destroy(){d=!0;for(const e of t){const t=Xo(e.kind);if(void 0!==t?.detach&&null!==e.nodes)for(const n of e.nodes)void 0!==n.nodeType&&t.detach({binding:e,node:n,controller:_})}for(const e of l.values())e.dispose();l.clear();for(const e of n())zr(e)},effectCount:()=>l.size};return _}const Wr=new WeakMap,Pr=new Set;function Fr(e,t){Pr.has(e)||(Pr.add(e),console.warn(`[Domma Reactive] ${t}`))}function Rr(e,t,n,s,i,o={}){const r=document.createComment("dm:item"),a=document.createComment("/dm:item"),l=e.content.cloneNode(!0);l.insertBefore(r,l.firstChild),l.appendChild(a);const c=Hr({bindings:e.bindings.map(e=>({...e})),render:e.render,context:o.context??Ri(t,n,s,i),getRoots:()=>Dr(r,a),reactive:!0,label:e.label}),h={key:null,item:n,index:s,length:i,parentContext:t,open:r,close:a,runtime:c,disposed:!1,allNodes:()=>[r,...Dr(r,a),a],refresh(t,n,s,i){const o=t.$data!==h.parentContext.$data||t.$root!==h.parentContext.$root||!0===e.usesAncestors&&t!==h.parentContext||n!==h.item,r=s!==h.index||!0===e.usesLength&&i!==h.length;return h.item=n,h.index=s,h.length=i,h.parentContext=t,!(!o&&!r)&&(c.setContext(Ri(t,n,s,i)),c.refresh(o?null:e=>!0===e.positional),!0)},dispose(e=!0){if(h.disposed)return;h.disposed=!0,function(e,t){const n=Ar.get(e);!n||!n.delete(t)||(Er--,0===n.size&&Ar.delete(e))}(r,d),c.destroy();for(const e of Dr(r,a))zr(e);if(!e)return;const t=r.parentNode;if(t)for(const e of h.allNodes())t.removeChild(e)}},d=()=>h.dispose(!1);return Sr(r,d),c.index(),h}function Vr(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}function qr(e,t,n,s,i,o){let r=Wr.get(e.open);void 0===r&&(r={byKey:new Map},Wr.set(e.open,r),Sr(e.open,()=>{for(const e of r.byKey.values())e.dispose(!1);r.byKey=new Map}));const a=r.byKey,l=new Map,c=[],h=Po(t);for(let e=0;e<h.length;e++){const t=h[e];let r=Vr(t,s);null==r?(Fr(`key:missing:${o}:${s}`,`key=${s} is missing on an item of ${o} - falling back to position for that item, which reconciles no better than an unkeyed block. Give every item a stable identifier.`),r=`\0position:${e}`):l.has(r)&&(Fr(`key:duplicate:${o}:${s}`,`two items of ${o} share key=${s} value "${String(r)}" - a key must identify exactly one item. The duplicate is being kept apart by position, so it will not reconcile across changes.`),r=`\0duplicate:${e}:${String(r)}`);let d=a.get(r);void 0===d?(d=Rr(n,i,t,e,h.length),d.key=r):(a.delete(r),d.refresh(i,t,e,h.length)),l.set(r,d),c.push(d)}for(const e of a.values())e.dispose();!function(e,t){const n=e.parentNode;if(!n)return;let s=e;for(const e of t)if(s.nextSibling!==e.open)for(const t of e.allNodes())n.insertBefore(t,s.nextSibling),s=t;else s=e.close}(e.open,c),r.byKey=l}function Ur(e){return{tracks:!0,region:!0,primes:!0,acceptsReactive:!0,update({binding:t,nodes:n,context:s,render:i}){const o=e(t,i),r=(a=t.evaluate(s),Array.isArray(a)?a:null!==a&&"object"==typeof a&&Array.isArray(a.value)?a.value:[]);var a;for(const e of n)qr(e,r,o,t.keyPath,s,o.label);return!0}}}const Kr="[Domma Reactive]",Yr=new Map,Gr=new Set;function Jr(e,t){Gr.has(e)||(Gr.add(e),console.warn(`${Kr} ${t}`))}function Xr(e){return Yr.get(e)}const Zr="data-param-";function Qr(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function ea(e,t,n){const s={},i=e.getAttribute("data-params");if(null!==i&&""!==i.trim()){const e=Mo(i),o=null===e?null:e(n);null===e?Jr(`component:params:${t.id}`,`data-params="${i}" did not parse, in ${t.expr}`):null===o||"object"!=typeof o?Jr(`component:params:${t.id}`,`data-params="${i}" needs an object of params - got ${null===o?"null":typeof o}, in ${t.expr}`):Object.assign(s,o)}for(const i of[...e.attributes]){if(!i.name.startsWith(Zr))continue;const e=Qr(i.name.slice(11));if(""===e)continue;const o=Mo(i.value);null!==o?(e in s&&Jr(`component:collide:${t.id}:${e}`,`"${e}" is given by both data-params and ${i.name}, in ${t.expr}. The attribute wins, but one of the two is redundant.`),s[e]=o(n)):Jr(`component:param:${t.id}:${e}`,`${i.name}="${i.value}" did not parse, in ${t.expr}`)}return Object.freeze(s)}function ta(e){const t=new Map;for(const n of[...e.childNodes]){const e=1===n.nodeType?n.getAttribute("data-slot")??"":"";t.has(e)||t.set(e,[]),t.get(e).push(n),n.remove()}return t}function na(e,t){const n=`dm:${t}`,s=`/dm:${t}`;let i=null,o=null;const r=e=>{if(8!==e.nodeType)for(const t of e.childNodes)r(t);else e.data===n?i=e:e.data===s&&(o=e)};for(const t of e)if(r(t),null!==i&&null!==o)return{open:i,close:o};return null}function sa(e,t){const n=[];for(let s=e.nextSibling;null!==s&&s!==t;s=s.nextSibling)n.push(s);return n}function ia(e,t,n,s,i){const o=[],r=e.allNodes(),a=new Set;for(const e of t.slots??[]){if(a.has(e.name)){Jr(`component:slot:duplicate:${s.id}:${i}:${e.name}`,`the component "${i}" declares more than one `+(""===e.name?"default slot":`slot named "${e.name}"`)+". The first is filled and the rest keep their fallback content.");continue}a.add(e.name);const t=n.get(e.name);if(void 0===t||0===t.length)continue;const l=na(r,e.id);if(null!==l){for(const e of sa(l.open,l.close))e.remove();for(const e of t)l.close.parentNode.insertBefore(e,l.close);o.push({name:e.name,nodes:t})}}for(const[e,t]of n)a.has(e)||0===t.length||t.every(e=>3===e.nodeType&&""===e.data.trim())||Jr(`component:slot:unmatched:${s.id}:${i}:${e}`,""===e?`the component "${i}" was given content but declares no {{#slot}}, so that content is not rendered. Add a slot to its template, or remove the content.`:`the component "${i}" has no slot named "${e}", so that content is not rendered. Check data-slot against the template's {{#slot}} blocks.`);return o}const oa=new WeakMap;function ra(e,t,n,s,i){if(void 0===e.create)return t;try{return e.create(t,{element:n})}catch(e){return Jr(`component:create:${s.id}:${i}`,`the component "${i}" threw while being created, in ${s.expr}: ${e&&e.message}`),null}}function aa(e){if(null===e.instance)return;for(const{nodes:t}of e.placed)for(const e of t)e.remove();e.placed=[];const t=e.viewModel;if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose)try{t.dispose()}catch(e){console.warn(`${Kr} a component's dispose() threw:`,e)}e.instance.dispose(),e.instance=null,e.viewModel=null,e.name=null}const la="[Domma Reactive]",ca=/\{\{([#/])(if|unless|each|with|slot)(?:\s+([^}]+?))?\s*\}\}/g,ha=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,da=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,ua=/\{\{>\s*[^{}]+?\s*\}\}/,pa=/\sdata-each\s*=\s*(?:"([^"]*)"|'([^']*)')/,ma=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>/g,fa=/([\w:@.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,_a=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,ga=/^[@.]/,va={".":e=>e.$data,"@index":e=>e.$index,"@first":e=>0===e.$index,"@last":e=>null!==e.$length&&e.$index===e.$length-1},ba=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ya={text:"txt",attr:"attr",raw:"raw",block:"blk"};function ka(e,t){if(0===t.length)return e;const n=[...t].sort((e,t)=>e.index-t.index||(e.order??0)-(t.order??0));let s="",i=0;for(const t of n)t.index<i||(s+=e.slice(i,t.index)+t.text,i=t.index+(t.skip??0));return s+e.slice(i)}function wa(e,t){let n=null;for(const s of t)e>=s[0]&&e<s[1]&&(!n||s[0]>n[0])&&(n=s);return n}function xa(e,t){for(const[n,s]of t)if(e>=n&&e<s)return!0;return!1}function Ma(e){return String(e).trim().split(".")[0]}function La(e,t){const n=String(t).trim().split(".");let s=e;for(const e of n){if(null==s)return;s=s[e]}return s}function Ca(e){const t=new Set;for(const n of e.matchAll(da)){const e=n[1].trim();_a.test(e)&&t.add(Ma(e))}for(const n of e.matchAll(ha)){const e=n[1].trim();_a.test(e)&&t.add(Ma(e))}return t}function Aa(e){const t=[],n=[];for(const s of e.matchAll(ca)){if("#"===s[1]){t.push({start:s.index,kind:s[2],expr:(s[3]||"").trim()});continue}let e=null;for(;t.length>0;){const n=t.pop();if(n.kind===s[2]){e=n;break}}e&&n.push({start:e.start,end:s.index+s[0].length,kind:e.kind,expr:e.expr})}return n}function Ea(e,t){const n=e.lastIndexOf("<",t);return-1!==n&&n>e.lastIndexOf(">",t)}function Sa(e,t){const n=t[1],s=t.index,i=s+t[0].length;if("/"===t[3]||ba.has(n.toLowerCase()))return[s,i];const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<(/?)${o}(?=[\\s/>])`,"gi");let a=1;for(const t of e.slice(i).matchAll(r)){const n=i+t.index;if("/"===t[1]){if(a--,a>0)continue;const t=e.indexOf(">",n);return-1===t?null:[s,t+1]}const o=e.indexOf(">",n);-1!==o&&"/"===e[o-1]||a++}return null}function $a(e,t){const n=[];for(const s of t){if("each"!==s.kind&&"with"!==s.kind)continue;const t=e.indexOf(Br(s.id)),i=e.indexOf(jr(s.id));-1!==t&&-1!==i&&n.push([t,i,s])}return n}const za=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,Ta=/\s+key\s*=\s*[A-Za-z_$][\w$]*(?:\.[\w$]+)*/,Ba=new Set;function ja(e){const t=za.exec(String(e));return null===t||""===t[1].trim()?null:{collection:t[1].trim(),key:t[2]}}function Oa(e,t){const n=/^\{\{#(?:if|unless|each|with|slot)(?:\s+[^}]*?)?\s*\}\}/.exec(e.slice(t.start,t.end)),s=/\{\{\/(?:if|unless|each|with|slot)\s*\}\}$/.exec(e.slice(t.start,t.end));return null===n||null===s?[t.start,t.end]:[t.start+n[0].length,t.start+s.index]}function Da(e,t){const n=[];for(const s of t){if(!0!==Xo(s.kind)?.capturesBody)continue;const t=Br(s.id),i=e.indexOf(t),o=e.indexOf(jr(s.id));-1!==i&&-1!==o&&n.push([i+t.length,o])}n.sort((e,t)=>e[0]-t[0]);let s="",i=0;for(const[t,o]of n)t<i||(s+=e.slice(i,t),i=o);return s+=e.slice(i),s.replace(/\{\{\{[^{}]*\}\}\}/g,"").replace(/\{\{[^{}]*\}\}/g,"")}const Na=/\$index|\$length|@index|@first|@last/;function Ia(e){const t=(e.parts??[]).map(e=>e.tmpl).join(" ");return`${e.expr??""} ${e.body??""} ${t}`}let Ha=0;function Wa(e,t,n,s,i){const{annotated:o,bindings:r,slots:a}=qa(e,{...s,itemForms:!0,template:t,idPrefix:i});for(const e of r)e.positional=Na.test(Ia(e));return{content:Or(Da(o,r)),bindings:r,slots:a,render:n,label:t,options:s,usesLength:/@last|\$length/.test(e),usesAncestors:/\$parentContext|\$parents/.test(e)}}function Pa(e,t,n=[]){if(!1===t.warnUnkeyed&&0===n.length)return;const s=`${t.template??""}|${e}`;if(Ba.has(s))return;Ba.add(s);const i=t.template?` in template "${t.template}"`:"",o=n.map(e=>`"${e}"`).join(", "),r=n.length?`, and its ${o} ${1===n.length?"binding is":"bindings are"} not attached`:"",a=n.length?` - ${1===n.length?"it binds":"they bind"} normally once the block has a key`:"";console.warn(`${la} {{#each ${e}}}${i} has no key=, so it re-renders the whole block on every change - losing DOM node identity, focus and uncommitted input${r}. Write {{#each ${e} key=id}}, naming whichever property identifies an item, to reconcile instead${a}.`)}function Fa(e,t){const n=`demoted|${t.template??""}|${e}`;if(Ba.has(n))return;Ba.add(n);const s=t.template?` in template "${t.template}"`:"";console.warn(`${la} {{#each ${e}}}${s} sits inside an unkeyed {{#each}} or a {{#with}}, so it cannot reconcile: its collection would be resolved against the top-level data. It has been demoted to a plain re-rendered block. Add key= to the ENCLOSING block and both will reconcile.`)}function Ra(e,t){return null===e.factoryBox.value&&(e.factoryBox.value=function(e,t,n){const s=`${n.template?`${n.template} `:""}{{#each ${e.expr}}}`;return ua.test(e.body)&&console.warn(`${la} {{> partial}} inside a keyed {{#each}} is not expanded - the block body is compiled once into a <template>, before any render pass exists to resolve a partial against. Inline it, in ${s}`),Wa(e.body,s,t,n,`i${++Ha}:`)}(e,t,e.factoryBox.options)),e.factoryBox.value}function Va(e,t,n){const s={...n,methodCalls:!0===t.methodCalls},i=wo(e,s);return null===i?null:{ast:i,evaluate:gi(Mo(e,s),{expr:e,where:n?.template?`template "${n.template}"`:"",handler:t}),deps:!1===t.tracks?new Set:Lo(i)}}function qa(e,t={}){const n=[],s=[],i=new Set,o=t.idPrefix??"",r=(e,n)=>{if(i.has(e))return;i.add(e);const s=t.template?` in template "${t.template}"`:"";console.warn(`${la} ${n}${s}`)},a=pa.exec(e);if(null!==a){const e=a[1]??a[2]??"";r("inert-each",`data-each="${e}" does nothing here. It is an applyBindings spelling, and this is compiled markup - write {{#each ${e}}} … {{/each}} instead. A data-each nested inside another list is compiled markup too, which is the usual way to meet this`)}for(const t of e.matchAll(ma)){const e=t[2]||"";if(!e.includes("data-param-"))continue;if(/\sdata-component\s*=/.test(e))continue;const n=/\s(data-param-[\w-]+)/.exec(e);r("orphan-param",`${null===n?"data-param-*":n[1]} does nothing on an element with no data-component. Check the component attribute is present and spelled correctly - and remember its value is an expression, so a literal name takes quotes: data-component="'my-thing'"`)}const l=Aa(e),c=function(e){const t=[];for(const n of e.matchAll(ma)){const s=n[2]||"";if(s.includes("data-"))for(const i of s.matchAll(fa)){const s=Zo(i[1]);if(null===s||!s.handler.region)continue;const o=Sa(e,n);if(null===o)break;t.push({start:o[0],end:o[1],kind:s.kind,arg:s.arg,expr:So(void 0!==i[2]?i[2]:i[3]||"").trim()});break}}return t}(e),h=[],d=new Set,u=l.filter(e=>"with"===e.kind||"each"===e.kind&&null===ja(e.expr)).map(e=>[e.start,e.end]);for(const e of l)"each"===e.kind&&null!==ja(e.expr)&&(u.some(([t,n])=>e.start>t&&e.end<=n)?(d.add(e.start),Fa(e.expr,t)):h.push([e.start,e.end]));const p=(e,t)=>h.some(([n,s])=>e>n&&t<=s),m=[...l.map((e,t)=>({...e,id:`${o}${t}_blk`,mustache:!0})).filter(e=>!p(e.start,e.end)),...c.map((e,t)=>({...e,id:`${o}${l.length+t}_${e.kind}`})).filter(e=>!p(e.start,e.end))],f=[];for(const t of m){if(t.mustache&&d.has(t.start)){const n=e.slice(t.start,t.end),s=Ta.exec(n);null!==s&&f.push({index:t.start+s.index,text:"",order:1,skip:s[0].length}),t.expr=ja(t.expr)?.collection??t.expr}if(t.mustache&&"slot"===t.kind){const[n,i]=Oa(e,t);f.push({index:t.start,text:Br(t.id),order:1,skip:n-t.start}),f.push({index:i,text:jr(t.id),order:0,skip:t.end-i}),s.push({id:t.id,name:t.expr});continue}const n=t.mustache&&"each"===t.kind&&!d.has(t.start)&&ja(t.expr);if(n){f.push({index:t.start,text:Br(t.id)+jr(t.id),order:1,skip:t.end-t.start}),t.keyed=n;const[s,i]=Oa(e,t);t.rawBody=e.slice(s,i);continue}t.mustache&&"each"===t.kind&&(t.unkeyed=!0),f.push({index:t.start,text:Br(t.id),order:1}),f.push({index:t.end,text:jr(t.id),order:0})}let _=ka(e,f),g=m.length;const v=e=>`${o}${g++}_${ya[e]??e}`;for(const e of m){if("slot"===e.kind)continue;if(-1===_.indexOf(Br(e.id)))continue;if(e.keyed){const s=Xo("each"),i=Va(e.keyed.collection,s,t);if(null===i)continue;n.push({id:e.id,kind:"each",blockKind:"each",expr:e.keyed.collection,keyPath:e.keyed.key,body:e.rawBody,ast:i.ast,evaluate:i.evaluate,deps:i.deps,prime:!0===s.primes,factoryBox:{value:null,options:t},nodes:null});continue}if(e.mustache){n.push({id:e.id,kind:"block",blockKind:e.kind,expr:e.expr,body:"",deps:_a.test(e.expr)?new Set([Ma(e.expr)]):Ca(e.expr),nodes:null});continue}const s=Xo(e.kind),i=Va(e.expr,s,t);null!==i&&n.push({id:e.id,kind:e.kind,arg:e.arg,expr:e.expr,body:"",ast:i.ast,evaluate:i.evaluate,deps:i.deps,prime:!0===s.primes,nodes:null})}const b=[];for(const e of[..._.matchAll(ha)]){if(xa(e.index,$a(_,m)))continue;const t=e[1].trim();if(!_a.test(t))continue;const s=v("raw");b.push({index:e.index,text:Br(s),order:1}),b.push({index:e.index+e[0].length,text:jr(s),order:0}),n.push({id:s,kind:"raw",expr:t,body:e[0],deps:new Set([Ma(t)]),nodes:null})}_=ka(_,b);const y=n.filter(e=>"raw"===e.kind).map(e=>{const t=_.indexOf(Br(e.id)),n=_.indexOf(jr(e.id));return-1!==t&&-1!==n?[t,n+jr(e.id).length]:null}).filter(Boolean),k=$a(_,m),w=[];for(const e of[..._.matchAll(da)]){if(xa(e.index,k))continue;if(xa(e.index,y))continue;if(Ea(_,e.index))continue;const s=Ua(e[1].trim(),t,r);if(null===s)continue;const i=v("text");w.push({index:e.index,text:`<span data-dm-t="${i}">`,order:1}),w.push({index:e.index+e[0].length,text:"</span>",order:0}),n.push({id:i,...s,nodes:null})}_=ka(_,w);const x=$a(_,m),M=[],L=new Map;for(const e of[..._.matchAll(ma)]){const s=e[2]||"",i=xa(e.index,x),o=[],a=[];for(const l of s.matchAll(fa)){const s=l[1];if(s.startsWith("data-dm-"))continue;const c=void 0!==l[2]?l[2]:l[3]||"",h=Zo(s);if(null!==h){if(h.handler.region)continue;if(i){const t=wa(e.index,x)?.[2];if(t?.unkeyed){const e=L.get(t)??[];e.includes(s)||e.push(s),L.set(t,e)}else r(`shifted:${s}`,`"${s}" inside a {{#with}} block is not bound: {{#with}} re-renders its body as a whole, so there is nothing to attach it to. Write the full path instead (data-model="obj.field" rather than data-model="field" inside {{#with obj}}) and it binds normally.`);continue}const o=h.handler,l=So(c).trim(),d=!1===o.expression?{ast:null,evaluate:null,deps:new Set}:Va(l,o,t);if(null===d)continue;const u=v(h.kind);a.push(u),n.push({id:u,kind:h.kind,arg:h.arg,expr:l,ast:d.ast,evaluate:d.evaluate,deps:d.deps,prime:!0===o.primes,nodes:null});continue}if(i)continue;if(!c.includes("{{"))continue;const d=Ca(c);0!==d.size&&o.push({name:s,tmpl:c,deps:[...d]})}const l=e.index+e[0].length-(e[3]?2:1);if(o.length>0){const e=v("attr"),t=new Set;for(const e of o)for(const n of e.deps)t.add(n);M.push({index:l,text:` data-dm-a="${e}"`,order:1}),n.push({id:e,kind:"attr",parts:o,deps:t,nodes:null})}a.length>0&&M.push({index:l,text:` data-dm-b="${a.join(" ")}"`,order:1})}_=ka(_,M);for(const e of n){if(!0!==Xo(e.kind)?.capturesBody)continue;const t=Br(e.id),n=_.indexOf(t),s=_.indexOf(jr(e.id));-1!==n&&-1!==s&&(e.body=_.slice(n+t.length,s))}for(const e of m)e.unkeyed&&Pa(e.expr,t,L.get(e)??[]);return{annotated:_,bindings:n,slots:s}}function Ua(e,t,n){if(!0===t.itemForms&&void 0!==va[e])return{kind:"text",expr:e,evaluate:va[e],deps:new Set,prime:!0};if(_a.test(e)){if(e.startsWith("$")){const n=Va(e,Xo("text"),t);return null===n?null:{kind:"text",expr:e,ast:n.ast,evaluate:n.evaluate,deps:n.deps,prime:!0}}return{kind:"text",expr:e,evaluate:t=>La(t.$data,e),deps:new Set([Ma(e)]),prime:!1}}if(ga.test(e)||!No.test(e))return null;const s=Va(e,Xo("text"),t);return null===s?(n(`expr:${e}`,`"{{${e}}}" is not bound`),null):{kind:"text",expr:e,ast:s.ast,evaluate:s.evaluate,deps:s.deps,prime:!0}}Jo("each",Ur(Ra));const Ka=new WeakMap;!function(e){Jo("component",function(e){return{tracks:!0,primes:!0,attribute:"data-component",expression:!0,update({binding:t,nodes:n,context:s,render:i}){const o=t.evaluate(s);for(const r of n){let n=oa.get(r);if(void 0===n&&(n={name:null,instance:null,viewModel:null,slots:null,placed:[]},oa.set(r,n),Sr(r,()=>aa(n))),n.name===o&&null!==n.instance)continue;if(aa(n),null===n.slots&&(n.slots=ta(r)),r.replaceChildren(),"string"!=typeof o||""===o){Jr(`component:name:${t.id}`,`data-component="${t.expr}" needs a component name - got `+(null===o?"null":typeof o)+". Remember that a literal name takes quotes, because every binding value is an expression: data-component=\"'my-thing'\"");continue}const a=Xr(o);if(void 0===a){Jr(`component:missing:${t.id}:${o}`,`no component is registered as "${o}", in ${t.expr}`);continue}const l=ra(a,ea(r,t,s),r,t,o);if(null===l)continue;const c=e(a,o,i,t.options??{});n.name=o,n.viewModel=l,n.instance=Rr(c,s,l,null,null,{context:Vi(s,l)}),n.placed=ia(n.instance,c,n.slots,t,o),n.placed.length>0&&n.instance.runtime.index(),r.append(...n.instance.allNodes())}return!0},detach({node:e}){const t=oa.get(e);void 0!==t&&aa(t)}}}(e))}(function(e,t,n,s){let i=Ka.get(e);return void 0===i&&(i=function(e,t,n,s){return Wa(e,t,n,s,`c${++Ha}:`)}(e.template,`component ${t}`,n,s),Ka.set(e,i)),i});const Ya={annotate:qa,compile:function(e,t,n,s,i={}){const o="function"==typeof s?s:qo,{annotated:r,bindings:a}=qa(e,i),l=e=>{n.replaceChildren(Or(o(r,e.$data)))},c=Hr({bindings:a,render:o,context:qi(t),getRoots:()=>[...n.childNodes],reactive:!0===i.reactive,label:i.template,repaint:l});return l(c.context()),c.index(),c},scanBlocks:Aa,resolvePath:La},Ga="[Domma Reactive]",Ja="data-each",Xa=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,Za=/^\s*dm\s+([a-zA-Z][\w-]*)\s*:\s*([\s\S]+?)\s*$/,Qa=/^\s*\/dm\s*$/,el=/\{\{\s*[\w$][\w$.]*\s*\}\}/,tl="data-dm-bound",nl=new WeakSet,sl=new Set;function il(e,t){sl.has(e)||(sl.add(e),console.warn(`${Ga} ${t}`))}function ol(e){if(!e||1!==e.nodeType)return String(e);const t=e.id?`#${e.id}`:"",n=e.classList?.length?`.${[...e.classList].join(".")}`:"";return`<${e.tagName.toLowerCase()}${t}${n}>`}function rl(e,t){if(null!=e&&1===e.nodeType&&!1!==t(e))for(const n of[...e.children])rl(n,t)}function al(e,t,n={}){if(null==t||1!==t.nodeType)throw new TypeError(`${Ga} applyBindings: expected an element to activate, got ${String(t)}`);const s="function"==typeof n.render?n.render:qo,i=n.template||ol(t);let o=qi(e);const r=[],a=[],l=[];let c=!1,h=0;const d={context:()=>o,update:()=>!1,bindings:[]},u=function(e,t){const n=[];let s=0;const i=e=>{const o=[];for(const t of[...e.childNodes]){if(8===t.nodeType){if(Qa.test(t.data)){const e=o.pop();void 0!==e&&n.push({...e,close:t});continue}const i=t.data.match(Za);null!==i&&o.push({kind:i[1],expr:i[2],open:t,parent:e,seq:s++});continue}1===t.nodeType&&i(t)}for(const e of o)t(e)};return i(e),n.sort((e,t)=>e.seq-t.seq)}(t,e=>{il(`virtual:unclosed:${i}:${e.kind}`,`\x3c!-- dm ${e.kind}: ${e.expr} --\x3e in ${i} has no matching \x3c!-- /dm --\x3e, so the block was skipped. Every virtual binding needs a closer.`)});for(const e of u)"each"===e.kind&&v(e,u);const p=[];rl(t,e=>{if(nl.has(e))return h++,!1;const t=e.getAttribute(Ja),n=function(e){const t=[];for(const n of[...e.attributes]){if(n.name===tl||n.name===Ja)continue;const e=Zo(n.name);null!==e&&t.push({name:n.name,value:n.value.trim(),kind:e.kind,arg:e.arg,handler:e.handler})}return t}(e);return null===t&&0===n.length||(p.push({el:e,each:t,claims:n}),null===t)}),h>0&&il(`double:${i}`,`applyBindings ran again over ${i}, where ${h} element(s) were already bound. Those were skipped rather than bound twice; the handle returned owns only what this call created. Dispose the first handle before re-applying.`);for(const{el:e}of p)nl.add(e),e.setAttribute(tl,""),l.push(e);!function(e,t){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let s;for(;s=n.nextNode();)if(el.test(s.data)&&!ll(s,e))return void il(`interp:${t}`,`${t} contains "${s.data.trim().slice(0,40)}" - applyBindings does not interpolate {{ }} in already-rendered DOM, and leaves it as it found it. Use data-bind-text="expr", which the server can render alongside the text, or compile() if the markup should come from a template.`)}(t,i);let m=0;for(const e of p){null!==e.each&&g(e.el,e.each);for(const t of e.claims)_(e.el,t)}for(const e of u)b(e);function f(e,t,n){if(!1===t.expression)return{ast:null,evaluate:null,deps:new Set};const s={template:`${i} ${n}`,methodCalls:!0===t.methodCalls},o=wo(e,s);return null===o?null:{ast:o,evaluate:gi(Mo(e,s),{expr:e,where:s.template,handler:t}),deps:!1===t.tracks?new Set:Lo(o)}}function _(e,t){const{handler:n,kind:i,arg:r,value:l,name:c}=t,h=f(l,n,c);if(null===h)return;const u={id:`apply${m++}_${i}`,kind:i,arg:r,expr:l,ast:h.ast,evaluate:h.evaluate,deps:h.deps,nodes:[e]};d.bindings.push(u),"function"==typeof n.attach&&n.attach({binding:u,node:e,controller:d}),"function"==typeof n.detach&&a.push(()=>n.detach({binding:u,node:e,controller:d})),!0!==n.region?!1!==n.tracks&&y(()=>n.update({binding:u,nodes:[e],context:o,render:s,controller:d})):"if"===i?function(e,t){const n=document.createComment(`dm:if ${t.expr}`);e.parentNode?.insertBefore(n,e),y(()=>{const s=Wo(t.evaluate(o));return s&&null===e.parentNode?n.parentNode?.insertBefore(e,n.nextSibling):s||null===e.parentNode||e.parentNode.removeChild(e),!0}),a.push(()=>{null===e.parentNode&&n.parentNode?.insertBefore(e,n.nextSibling),n.parentNode?.removeChild(n)})}(e,u):il(`region:${i}`,`"${c}" is a region binding, which needs a compiled template body. applyBindings has none - the markup is the page. Use compile() for ${i}, or data-if / data-each, which are implemented here directly.`)}function g(e,t){const n=Xa.exec(t);if(null===n||""===n[1].trim())return void il(`each:unkeyed:${i}`,`${Ja}="${t}" on ${ol(e)} needs a key: write ${Ja}="${t.trim()} key=id", naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const r=n[1].trim(),l=n[2],c=f(r,{expression:!0,tracks:!0,acceptsReactive:!0},Ja);if(null===c)return;const h=e.innerHTML;e.replaceChildren();const u=document.createComment("dm:each"),p=document.createComment("/dm:each");e.append(u,p);const _={id:`apply${m++}_each`,kind:"each",expr:r,keyPath:l,body:h,ast:c.ast,evaluate:c.evaluate,deps:c.deps,factoryBox:{value:null,options:{template:i}},nodes:[{open:u,close:p}]};d.bindings.push(_);const g=Xo("each");y(()=>g.update({binding:_,nodes:_.nodes,context:o,render:s,controller:d})),a.push(()=>{qr({open:u},[],Ra(_,s),l,o,i),e.replaceChildren()})}function v(e,t){const n=document.createElement("div");for(const t of Dr(e.open,e.close))n.appendChild(t);for(const s of t){if(s===e||!n.contains(s.open))continue;s.consumed=!0;const t=[s.open,...Dr(s.open,s.close),s.close];for(const e of t)e.parentNode?.removeChild(e);il(`virtual:nested:${i}:${s.kind}`,`\x3c!-- dm ${s.kind}: ${s.expr} --\x3e is inside a virtual list's body, which is compiled as a template - virtual bindings are not read there, so its content is left out. Use {{#${s.kind}}} inside the body, or data-if on an element.`)}e.body=n.innerHTML}function b(e){!0!==e.consumed&&("if"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm if --\x3e");if(null===t)return;const n={id:`apply${m++}_if`,kind:"if",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[{open:e.open,close:e.close}]};d.bindings.push(n);let s=null;const i=()=>{null!==s&&(e.close.parentNode?.insertBefore(s,e.close),s=null)};y(()=>{if(Wo(n.evaluate(o)))i();else if(null===s){s=document.createDocumentFragment();for(const t of Dr(e.open,e.close))s.appendChild(t)}return!0}),a.push(i)}(e):"each"===e.kind?function(e){const t=e.expr.match(Xa);if(null===t||""===t[1].trim())return void il(`virtual:each:unkeyed:${i}`,`\x3c!-- dm each: ${e.expr} --\x3e needs a key: write \x3c!-- dm each: ${e.expr.trim()} key=id --\x3e, naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const n=t[1].trim(),r=t[2],l=f(n,{expression:!0,tracks:!0,acceptsReactive:!0},"\x3c!-- dm each --\x3e");if(null===l)return;const c={id:`apply${m++}_each`,kind:"each",expr:n,keyPath:r,body:e.body,ast:l.ast,evaluate:l.evaluate,deps:l.deps,factoryBox:{value:null,options:{template:i}},nodes:[{open:e.open,close:e.close}]};d.bindings.push(c);const h=Xo("each");y(()=>h.update({binding:c,nodes:c.nodes,context:o,render:s,controller:d})),a.push(()=>{qr({open:e.open,close:e.close},[],Ra(c,s),r,o,i)})}(e):"text"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm text --\x3e");if(null===t)return;for(const t of Dr(e.open,e.close))t.parentNode?.removeChild(t);const n=document.createTextNode("");e.close.parentNode?.insertBefore(n,e.close);const s={id:`apply${m++}_text`,kind:"text",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[n]};d.bindings.push(s),y(()=>{const e=s.evaluate(o);return n.data=null==e?"":String(e),!0}),a.push(()=>n.parentNode?.removeChild(n))}(e):il(`virtual:kind:${e.kind}`,`\x3c!-- dm ${e.kind}: … --\x3e is not a virtual binding. Supported: if, each, text. Anything else needs an element to bind to.`))}function y(e){r.push(Ei(e,{label:`${i}:${r.length}`}))}return{get bindings(){return d.bindings.length},context:()=>o,update(e){if(!c){void 0!==e&&(o=qi(e));for(const e of r)e.recompute()}},dispose(){if(!c){c=!0;for(const e of r)e.dispose();r.length=0;for(const e of a)try{e()}catch(e){console.warn(`${Ga} applyBindings teardown threw:`,e)}a.length=0;for(const e of l)nl.delete(e),e.removeAttribute(tl);l.length=0}}}}function ll(e,t){for(let n=e.parentNode;n;n=n.parentNode){if(1===n.nodeType&&n.hasAttribute(Ja))return!0;if(n===t)return!1}return!1}const cl=(e,t)=>y.isEqual(e,t);class hl{constructor(e,t={},n={}){this._schema=e,this._initialData={},this._bindings=new Map,this._changeCallbacks=new Set,this._fieldCallbacks=new Map,this._fields=new Map,this._trackedView=null,this._persistKey=n.persist||null,this._autoSave=!1!==n.autoSave;for(const n in e){const s=e[n],i=void 0!==s.default?s.default:null,o=void 0!==t[n]?t[n]:i;this._fields.set(n,Ii(o,{equals:cl})),this._initialData[n]=o}this._persistKey&&this._loadFromStorage()}get(e){if(e){const t=this._fields.get(e);return t?t.value:void 0}const t={};for(const[e,n]of this._fields)t[e]=n.value;return t}_field(e){let t=this._fields.get(e);return t||(t=Ii(null,{equals:cl}),this._fields.set(e,t)),t}_snapshot(){const e={};for(const[t,n]of this._fields)e[t]=n.peek();return e}tracked(){if(!this._trackedView){const e=this;this._trackedView=new Proxy({},{get(t,n){if("string"!=typeof n)return;const s=e._fields.get(n);return s?s.value:void 0},set:(t,n,s)=>("string"==typeof n&&e._setField(n,s),!0),has(t,n){if("string"!=typeof n)return!1;const s=e._fields.get(n);return!!s&&(s.value,!0)},ownKeys:()=>[...e._fields.keys()],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}return this._trackedView}set(e,t){if("object"==typeof e)for(const t in e)this._setField(t,e[t]);else this._setField(e,t);return this}_setField(e,t){const n=this._field(e),s=n.peek();if(this._schema[e]){const n=this._validateField(e,t);if(!n.valid)throw new Error(`Validation failed for ${e}: ${n.error}`)}const i=!cl(s,t);n.value=t,i&&(this._notifyChange(e,t,s),this._updateBindings(e,t),this._persistKey&&this._autoSave&&this._saveToStorage())}_validateField(e,t){const n=this._schema[e],s=null==t||""===t;if(n.required&&s)return{valid:!1,error:"Required field is empty"};if(!s&&n.type){const e=pl.types[n.type];if(e&&!e(t))return{valid:!1,error:`Expected type ${n.type}`}}if(void 0!==n.min&&"number"==typeof t&&t<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&"number"==typeof t&&t>n.max)return{valid:!1,error:`Value must be at most ${n.max}`};if(void 0!==n.minLength&&"string"==typeof t&&t.length<n.minLength)return{valid:!1,error:`Length must be at least ${n.minLength}`};if(void 0!==n.maxLength&&"string"==typeof t&&t.length>n.maxLength)return{valid:!1,error:`Length must be at most ${n.maxLength}`};if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:"Value does not match pattern"};if(n.validate&&"function"==typeof n.validate){const e=n.validate(t);if(!1===e)return{valid:!1,error:"Custom validation failed"};if("string"==typeof e)return{valid:!1,error:e}}return{valid:!0}}validate(){const e=[],t=this._snapshot();for(const n in this._schema){const s=this._validateField(n,t[n]);s.valid||e.push({field:n,error:s.error})}return{valid:0===e.length,errors:e}}toJSON(){return Si(()=>this._snapshot())}onChange(e,t){if("string"==typeof e){if("function"!=typeof t)throw new TypeError(`Model.onChange('${e}', callback) requires a callback function`);const n=e,s=e=>{e.field===n&&t(e)};return this._changeCallbacks.add(s),()=>this._changeCallbacks.delete(s)}if("function"!=typeof e)throw new TypeError("Model.onChange expects a callback, or (field, callback)");return this._changeCallbacks.add(e),()=>this._changeCallbacks.delete(e)}onFieldChange(e,t){return this._fieldCallbacks.has(e)||this._fieldCallbacks.set(e,new Set),this._fieldCallbacks.get(e).add(t),()=>this._fieldCallbacks.get(e)?.delete(t)}_notifyChange(e,t,n){for(const s of this._changeCallbacks)s({field:e,newValue:t,oldValue:n,model:this});if(this._fieldCallbacks.has(e))for(const s of this._fieldCallbacks.get(e))s(t,n,this)}_updateBindings(e,t){if(this._bindings.has(e))for(const n of this._bindings.get(e))n.update(t)}_addBinding(e,t){this._bindings.has(e)||this._bindings.set(e,new Set),this._bindings.get(e).add(t)}_removeBinding(e,t){this._bindings.has(e)&&this._bindings.get(e).delete(t)}reset(e=!1){for(const e in this._initialData)this.set(e,y.cloneDeep(this._initialData[e]));return e&&this._persistKey&&this.clearStorage(),this}destroy(e=!1){e&&this._persistKey&&this.clearStorage(),this._changeCallbacks.clear(),this._fieldCallbacks.clear(),this._bindings.clear(),this._fields.clear(),this._trackedView=null}save(){return this._saveToStorage()}load(){return this._loadFromStorage()}clearStorage(){return!!this._persistKey&&me.remove(`model:${this._persistKey}`)}getPersistKey(){return this._persistKey}isPersisted(){return null!==this._persistKey}_saveToStorage(){if(!this._persistKey)return!1;try{return me.set(`model:${this._persistKey}`,this._snapshot())}catch(e){return console.warn("Domma Model: Failed to save to storage",e),!1}}_loadFromStorage(){if(!this._persistKey)return!1;try{const e=me.get(`model:${this._persistKey}`);if(e&&"object"==typeof e){for(const t in e)void 0!==this._schema[t]&&(this._field(t).value=e[t]);return!0}return!1}catch(e){return console.warn("Domma Model: Failed to load from storage",e),!1}}}class dl{constructor(e,t,n,s={}){this.model=e,this.field=t,this.element=n,this.options=s,this.format=s.format||(e=>e),this.parse=s.parse||(e=>e),this.twoWay=s.twoWay||!1,this._eventHandler=null,this.update(e.get(t)),this.twoWay&&this._setupTwoWay()}update(e){const t=this.format(e),n=this.element;"INPUT"===n.tagName||"TEXTAREA"===n.tagName?"checkbox"===n.type?n.checked=Boolean(t):"radio"===n.type?n.checked=n.value===String(t):n.value=null!=t?t:"":"SELECT"===n.tagName?n.value=t:n.textContent=null!=t?t:""}_setupTwoWay(){const e=this.element,t=this._getEventType();this._eventHandler=t=>{let n;n="checkbox"===e.type?e.checked:"number"===e.type||"range"===e.type?""===e.value?null:Number(e.value):e.value;try{this.model.set(this.field,this.parse(n))}catch(e){console.warn("Binding validation error:",e.message)}},e.addEventListener(t,this._eventHandler)}_getEventType(){const e=this.element;return"SELECT"===e.tagName||"checkbox"===e.type||"radio"===e.type?"change":"input"}destroy(){if(this._eventHandler){const e=this._getEventType();this.element.removeEventListener(e,this._eventHandler)}this.model._removeBinding(this.field,this)}}const ul=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;const pl={_events:new Map,subscribe(e,t){return this._events.has(e)||this._events.set(e,new Set),this._events.get(e).add(t),()=>this.unsubscribe(e,t)},on(e,t){return this.subscribe(e,t)},unsubscribe(e,t){this._events.has(e)&&this._events.get(e).delete(t)},off(e,t){this.unsubscribe(e,t)},publish(e,t){if(this._events.has(e))for(const n of this._events.get(e))n(t)},emit(e,t){this.publish(e,t)},once(e,t){const n=s=>{this.unsubscribe(e,n),t(s)};return this.subscribe(e,n)},clear(e){e?this._events.delete(e):this._events.clear()},create:(e,t={},n={})=>new hl(e,t,n),extend(...e){const t={};for(const n of e)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]&&y.isPlainObject(t[e])?t[e]=y.merge(y.cloneDeep(t[e]),y.cloneDeep(n[e])):t[e]=y.cloneDeep(n[e]));return t},pick(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=y.cloneDeep(e[s]));return n},omit(e,t){const n=y.cloneDeep(e);for(const e of t)delete n[e];return n},observable:Ii,observableArray:function(e=[],t={}){const n=new xi,s=Di();let i=Array.isArray(e)?e.slice():[];const o=Ni(t,e=>{n.trigger(),s.notify(e)}),r=()=>o.announce(i),a=e=>{const t=Array.isArray(e)?e.slice():[],n=o.changed(i,t);i=t,n&&r()},l={get value(){return n.track(),i},set value(e){a(e)},get length(){return n.track(),i.length},peek:()=>i,set:e=>a(e),remove:e=>{const t="function"==typeof e?e:t=>t===e;for(let e=i.length-1;e>=0;e--)t(i[e],e)&&i.splice(e,1);return r(),l},removeAll:()=>(i.length=0,r(),l),indexOf:e=>(n.track(),i.indexOf(e)),replace:(e,t)=>{const n=i.indexOf(e);return-1!==n&&(i[n]=t),r(),l},destroy:e=>{const t="function"==typeof e?e:t=>t===e;let n=0,s=0;for(let e=0;e<i.length;e++)t(i[e],e)&&(null!==i[e]&&"object"==typeof i[e]?(i[e]._destroy=!0,n++):s++);return s>0&&console.warn(`${Oi} destroy: ${s} matching item(s) are not objects and cannot carry a _destroy mark. Use remove() for an array of primitives.`),(n>0||0===s)&&r(),l},destroyAll:()=>l.destroy(()=>!0),subscribe:e=>s.add(e),extend:e=>(o.extend(e),l)};o.attach(l);for(const e of Hi)l[e]=(...t)=>{const n=Array.prototype[e].apply(i,t);return r(),n};return fi(l)},computed(e,t={}){const n=Ai(e,{label:t.label,onNotify:t.onChange||null});return{get value(){return n.get()},set value(e){n.write(e)},get:()=>n.get(),set:e=>n.write(e),peek:()=>Si(()=>n.get()),dispose:()=>n.dispose(),_computation:n}},effect(e,t={}){const n=Ei(e,{label:t.label});return()=>n.dispose()},untracked:e=>Si(e),flush(){ki=!1,Ci()},types:{string:e=>"string"==typeof e,number:e=>"number"==typeof e&&!Number.isNaN(e),boolean:e=>"boolean"==typeof e,array:e=>Array.isArray(e),object:e=>null!==e&&"object"==typeof e&&!Array.isArray(e),date:function(e){if(e instanceof Date)return!Number.isNaN(e.getTime());if("string"!=typeof e||!ul.test(e))return!1;const t=Date.parse(e);if(Number.isNaN(t))return!1;if(10===e.length){const n=new Date(t),[s,i,o]=e.split("-").map(Number);return n.getUTCFullYear()===s&&n.getUTCMonth()+1===i&&n.getUTCDate()===o}return!0},any:()=>!0},bind(e,t,n,s={}){const i="string"==typeof n?document.querySelectorAll(n):[n],o=[];for(const n of i){const i=new dl(e,t,n,s);e._addBinding(t,i),o.push(i)}return()=>{for(const e of o)e.destroy()}},applyBindings(e,t,n={}){const s=function(e){if("string"==typeof e)return document.querySelector(e);if(e&&1===e.nodeType)return e;if(e&&"object"==typeof e){const t=e[0]||(Array.isArray(e.elements)?e.elements[0]:null);if(t&&1===t.nodeType)return t}return null}(t);if(!s)throw new TypeError(`M.applyBindings: no element found for ${"string"==typeof t?`selector "${t}"`:String(t)}`);const{methods:i,...o}=n;return al(function(e,t){return hi(e instanceof hl?e.tracked():e,{fallback:t})}(e,i),s,{render:(e,t)=>y.render(e,t),...o})},registerBinding:(e,t)=>Jo(e,t),unregisterBinding:e=>function(e){return Ko.delete(e)}(e),registerExtender:(e,t)=>Bi(e,t),unregisterExtender:e=>function(e){return!Ti.has(e)&&zi.delete(e)}(e),registerHelper:(e,t)=>Co(e,t),unregisterHelper:e=>function(e){return Xi.delete(e)}(e),_stores:new Map,store(e,t={}){if(!this._stores.has(e)){const n={state:{...t},listeners:new Set,getState(){return{...this.state}},setState(e){const t={...this.state};this.state={...this.state,...e};for(const e of this.listeners)e(this.state,t)},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},reset(e){this.state=e?{...e}:{...t};for(const e of this.listeners)e(this.state,{})}};this._stores.set(e,n)}return this._stores.get(e)},getStore(e){return this._stores.get(e)},removeStore(e){this._stores.delete(e)}};class ml{static defaults={layout:"stacked",columns:2,labelPosition:"top",showLabels:!0,showHelperText:!0,showHints:!0,validationMode:"blur",cssFramework:"domma",className:"domma-form",fieldClassName:"domma-form-field",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint",cardWrapper:!1};static inputTypes={string:"text",email:"email",password:"password",number:"number",integer:"number",float:"number",boolean:"checkbox",date:"date",datetime:"datetime-local",time:"time",url:"url",tel:"tel",color:"color",range:"range",file:"file",hidden:"hidden",signature:"signature"};constructor(e,t={},n={}){this.schema=e,this.data={...t},this._startData={...t},this.options={...ml.defaults,...n},this.model=null,this.errors={},this.touched=new Set,this.utils=window.Domma?.utils||y,this.models=window.Domma?.models||pl,e&&"object"==typeof e&&(this.model=this.models.create(e,t,{persist:n.persist,autoSave:n.autoSave}))}render(){if(!this.schema)throw new Error("Schema is required to render form");return this._buildForm()}renderTo(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`Form container not found: ${e}`);return t.innerHTML=this.render(),this.formElement=t.querySelector("form"),this._bindEvents(t),this._initTooltips(t),t}_buildForm(){const{className:e,layout:t,columns:n,cardWrapper:s}=this.options;let i=e;if("grid"===t){i+=` grid ${3===n?"grid-cols-3":"grid-cols-2"} gap-4`}else"inline"===t&&(i+=" domma-form-inline");let o="";if(s&&(o+='<div class="card"><div class="card-body">'),o+=`<form class="${i}" novalidate>`,this.options.sections&&Array.isArray(this.options.sections))for(const e of this.options.sections)o+=this._buildSection(e);else for(const e in this.schema)o+=this._buildField(e,this.schema[e]);if(!1!==this.options.showSubmitButton){const e=this.options.submitText||"Submit",t=this.options.resetText,n=this.options.buttonAlignment||"right";o+=`<div class="form-group form-buttons mt-4 ${"left"===n?"text-left":"center"===n?"text-center":"text-right"}">`,t&&(o+=`<button type="button" class="btn btn-secondary mr-2" data-action="reset">${this.utils.escapeHtml(t)}</button>`),o+=`<button type="submit" class="btn btn-primary">${this.utils.escapeHtml(e)}</button>`,o+="</div>"}return o+="</form>",s&&(o+="</div></div>"),o}_buildSection(e){let t="";e.title&&(t+='<fieldset class="domma-form-section">',t+=`<legend class="domma-form-section-title">${this.utils.escapeHtml(e.title)}</legend>`);t+=`<div class="${"grid"===e.layout?`grid grid-cols-${e.columns||2}`:"domma-form-section-content"}">`;for(const n of e.fields||[])this.schema[n]&&(t+=this._buildField(n,this.schema[n]));return t+="</div>",e.title&&(t+="</fieldset>"),t}_buildField(e,t){const{fieldClassName:n,showLabels:s,showHelperText:i,showHints:o,labelPosition:r}=this.options,a=t.formConfig||{},l=t.type||"string",c=t.label||this.utils.capitalize(e),h=this.data[e]||t.default||"",d=t.required||!1,u=a.disabled||t.readonly||!1,p=a.placeholder||"",m=a.hint||"",f=a.helperText||"",_=a.tooltip||"",g=a.span||1;let v="";if("grid"===this.options.layout&&g>1){const e=this.options.columns||2;2===g?v=" col-span-2":3===g&&3===e?v=" col-span-3":g>=e&&(v=3===e?" col-span-3":" col-span-2")}let b=`<div class="${n}${v}" data-field="${e}">`;if(s&&c&&"hidden"!==l&&"boolean"!==l&&"checkbox"!==l){const t=this.options.labelClassName,n=d?' <span class="text-danger">*</span>':"",s=_?` data-tooltip="${this.utils.escapeHtml(_)}"`:"",i=_?" has-tooltip":"";b+=`<label for="field-${this.utils.escapeHtml(e)}" class="${t}${i}"${s}>`,b+=`${this.utils.escapeHtml(c)}${n}`,_&&(b+=' <span class="tooltip-icon" data-icon="help-circle" style="display: inline-block; vertical-align: middle; opacity: 0.6; cursor: help;"></span>'),o&&m&&(b+=` <small class="${this.options.hintClassName}">${this.utils.escapeHtml(m)}</small>`),b+="</label>"}return b+=this._buildInput(e,t,{type:l,value:h,required:d,disabled:u,placeholder:p}),i&&f&&(b+=`<small class="${this.options.helperClassName}">${f}</small>`),b+=`<div class="${this.options.errorClassName}" data-error-for="${e}" style="display: none;"></div>`,b+="</div>",b}_buildInput(e,t,n){const{type:s,value:i,required:o,disabled:r,placeholder:a}=n,l=t.formConfig||{},c=`field-${e}`,h={id:c,name:e,class:this.options.inputClassName,...o&&{required:!0},...r&&{disabled:!0},...a&&{placeholder:a},...void 0!==t.min&&{min:t.min},...void 0!==t.max&&{max:t.max},...void 0!==(t.step??l.step)&&{step:t.step??l.step},...t.pattern&&{pattern:t.pattern},...l.autocomplete&&{autocomplete:l.autocomplete}},d=this._inputExtras(s,t);d&&(h["data-input-extras"]=this.utils.escapeHtml(JSON.stringify(d)));const u=Object.entries(h).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ");if("slider"===s||"range"===s&&l.slider){return`<input type="range" ${u} value="${Array.isArray(i)?"":this.utils.escapeHtml(i)}" data-slider-field="${this.utils.escapeHtml(e)}">`}if("dropzone"===s){const t=l.accept?` accept="${this.utils.escapeHtml([].concat(l.accept).join(","))}"`:"",n=!1===l.multiple?"":" multiple";return`<div class="domma-dropzone-field" data-dropzone-field="${this.utils.escapeHtml(e)}"><input type="file" id="${c}" name="${this.utils.escapeHtml(e)}"${t}${n}${r?" disabled":""}></div>`}switch(s){case"select":return this._wrapAddons(this._buildSelect(e,t,h,i),l);case"multiselect":return h.multiple=!0,this._buildSelect(e,t,h,i);case"textarea":const n=l.rows||3;return this._wrapAddons(`<textarea ${u} rows="${n}">${this.utils.escapeHtml(i)}</textarea>`,l);case"radio":return this._buildRadioGroup(e,t,h,i);case"checkbox-group":return this._buildCheckboxGroup(e,t,h,i);case"chooser":return this._buildChooser(e,t,h,i);case"checkbox":case"boolean":const o=i?"checked":"",r=t.label||this.utils.capitalize(e),a=t.required?' <span class="text-danger">*</span>':"",d=l.hint?` <small class="form-text text-muted">${l.hint}</small>`:"";return`<div class="form-check">\n <input type="checkbox" class="form-check-input" ${u} ${o}>\n <label class="form-check-label" for="${h.id}">${r}${a}</label>\n ${d}\n </div>`;case"file":return`<input type="file" ${u} accept="${l.accept||""}" ${l.multiple?"multiple":""}>`;case"signature":return`<div class="domma-signature-field" id="${c}" data-signature-field="${e}"></div>`;default:const p=`<input type="${ml.inputTypes[s]||"text"}" ${u} value="${this.utils.escapeHtml(i)}">`;return this._wrapAddons(p,l)}}_inputExtras(e,t){const n=t.formConfig||{};if(/^(select|multiselect|radio|checkbox-group|chooser|checkbox|boolean|file|signature|hidden|slider|range|dropzone)$/.test(e))return null;const s="textarea"===e?"textarea":ml.inputTypes[e]||"text",i={};if(n.reveal&&"password"===s&&(i.reveal=!0),n.clear&&/^(text|email|url|tel|password|number|date|datetime-local|time|textarea)$/.test(s)&&(i.clear=!0),n.stepper&&"number"===s&&(i.stepper=!0),n.counter&&/^(text|email|url|tel|password|textarea)$/.test(s)){const e="number"==typeof n.counter?n.counter:t.maxLength;i.counter=!("number"==typeof e&&e>0)||e}n.labels&&"object"==typeof n.labels&&(i.labels=n.labels);return Object.keys(i).filter(e=>"labels"!==e).length?i:null}_wrapAddons(e,t={}){const n=this._buildAddon(t.prefix,"left"),s=this._buildAddon(t.suffix,"right");if(!n&&!s)return e;return`<div class="${["input-group-icon",n&&"has-addon-left",s&&"has-addon-right"].filter(Boolean).join(" ")}">${n}${e}${s}</div>`}_buildAddon(e,t){if("string"==typeof e&&e&&(e={text:e}),!e||"object"!=typeof e)return"";const n=`input-group-addon input-group-addon-${t}`;let s="";return e.icon&&/^[a-z0-9-]+$/i.test(e.icon)?s=`<span data-icon="${e.icon}"></span>`:void 0!==e.text&&null!==e.text?s=this.utils.escapeHtml(String(e.text)):"string"==typeof e.html&&(s=e.html),s?`<span class="${n}">${s}</span>`:""}_buildSelect(e,t,n,s){let i=`<select ${Object.entries(n).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ")}>`;t.required?n.multiple||null!=s&&""!==s||(i+='<option value="" disabled selected>-- Select --</option>'):i+='<option value="">-- Select --</option>';const o=t.options||[],r=Array.isArray(s)?s:[s];for(const e of o)if("string"==typeof e){i+=`<option value="${e}" ${r.includes(e)?"selected":""}>${this.utils.capitalize(e)}</option>`}else if("object"==typeof e){const t=r.includes(e.value)?"selected":"";i+=`<option value="${e.value}" ${t}>${e.label}</option>`}return i+="</select>",i}_buildRadioGroup(e,t,n,s){const i=t.options||[];let o='<div class="domma-radio-group" role="radiogroup">';for(const t of i){const i="string"==typeof t?t:t.value,r="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${i}`;o+=`\n <label class="domma-radio-option" for="${a}">\n <input type="radio" class="form-check-input" id="${a}" name="${e}" value="${i}" ${i===s?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${r}</span>\n </label>\n `}return o+="</div>",o}_buildCheckboxGroup(e,t,n,s){const i=t.options||[],o=Array.isArray(s)?s:[];let r='<div class="domma-checkbox-group">';for(const t of i){const s="string"==typeof t?t:t.value,i="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${s}`;r+=`\n <label class="domma-checkbox-option" for="${a}">\n <input type="checkbox" class="form-check-input" id="${a}" name="${e}[]" value="${s}" ${o.includes(s)?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${i}</span>\n </label>\n `}return r+="</div>",r}_buildChooser(e,t,n,s){const i={variant:t.variant||"card",multiple:!!t.multiple,density:t.density||"comfortable",columns:t.columns||3,accent:t.accent||"primary",accentStyle:t.accentStyle||"border",glow:!!t.glow,glowColour:t.glowColour||null,shadow:t.shadow||"none",shadowColour:t.shadowColour||null,options:t.options||[],value:void 0!==s?s:t.multiple?[]:null,name:e,required:!!t.required},o=JSON.stringify(i).replace(/"/g,""");return`<div class="domma-chooser-field" id="${n.id}" data-chooser-field="${e}" data-chooser-config="${o}"></div>`}_bindEvents(e){e.addEventListener("submit",e=>{e.preventDefault(),this.handleSubmit()}),e.addEventListener("blur",e=>{e.target.matches("input, select, textarea")&&(this.validateField(e.target.name),this.touched.add(e.target.name))},!0),e.addEventListener("change",e=>{if(e.target.matches("input, select, textarea")){const t=e.target.name;if(this._sliders?.[t]||this._dropzones?.[t])return;if(this.model){const t=this._getFieldValue(e.target);try{this.model.set(e.target.name,t)}catch(t){this.setFieldError(e.target.name,t.message)}}}}),e.addEventListener("click",e=>{e.target.matches('[data-action="reset"]')&&(e.preventDefault(),this.reset())}),this._initSignatureFields(e),this._initChooserFields(e),this._initInputExtras(e),this._initSliderFields(e),this._initDropzoneFields(e)}_initialValue(e){const t=this.model?this.model.get(e):this.data[e];return null!=t&&""!==t?t:this.schema?.[e]?.default}_storeFieldValue(e,t){if(this.model)try{this.model.set(e,t)}catch(t){this.setFieldError(e,t.message)}else this.data[e]=t}_initSliderFields(e){this._destroyFieldControls("_sliders"),e.querySelectorAll("[data-slider-field]").forEach(e=>{const t=e.getAttribute("data-slider-field"),n=this.schema?.[t]||{},s=n.formConfig||{},i=["range","ticks","tickLabels","labels","format","tooltip","marks","minDistance","orientation","rtl","names","ariaLabels","className"],o={};for(const e of i)void 0!==s[e]&&(o[e]=s[e]);void 0!==n.min&&(o.min=n.min),void 0!==n.max&&(o.max=n.max);const r=n.step??s.step;void 0!==r&&(o.step=r);const a=this._initialValue(t);null!=a&&""!==a&&(o.value=a),n.label&&(o.ariaLabel=n.label),o.onChange=e=>this._storeFieldValue(t,e);const l=ci.rangeSlider(e,o);l&&(this._sliders[t]=l,void 0!==a&&JSON.stringify(a)===JSON.stringify(l.getValue())||this._storeFieldValue(t,l.getValue()))})}_initDropzoneFields(e){this._destroyFieldControls("_dropzones"),e.querySelectorAll("[data-dropzone-field]").forEach(e=>{const t=e.getAttribute("data-dropzone-field"),n=this.schema?.[t]||{},s=n.formConfig||{},i=["accept","multiple","maxFiles","maxSize","minSize","previews","upload","autoUpload","retry","labels","list","className"],o={name:t};for(const e of i)void 0!==s[e]&&(o[e]=s[e]);(s.disabled||n.readonly)&&(o.disabled=!0),o.onChange=e=>{this._storeFieldValue(t,e),e.length&&this.clearFieldError(t)};const r=ci.dropzone(e,o);r&&(this._dropzones[t]=r)})}_destroyFieldControls(e){Object.values(this[e]||{}).forEach(e=>e.destroy()),this[e]={}}_initInputExtras(e){this._destroyInputExtras(),e.querySelectorAll("[data-input-extras]").forEach(e=>{let t;try{t=JSON.parse(e.getAttribute("data-input-extras"))}catch(e){return}const n=new ze(e,t);n.input&&(this._inputGroups[e.name||e.id]=n)})}_destroyInputExtras(){Object.values(this._inputGroups||{}).forEach(e=>e.destroy()),this._inputGroups={}}reset(){this.formElement&&"function"==typeof this.formElement.reset&&this.formElement.reset(),this.model?this.model.reset():this.data={...this._startData};for(const[e,t]of Object.entries(this._sliders||{})){const n=this._initialValue(e);null!=n&&""!==n&&t.setValue(n,{silent:!0})}Object.values(this._dropzones||{}).forEach(e=>e.clear());for(const[e,t]of Object.entries(this._choosers||{}))"function"==typeof t.setValue&&t.setValue(this._initialValue(e));return Object.keys(this.errors).forEach(e=>this.clearFieldError(e)),this.touched.clear(),this}destroy(){this._destroyInputExtras(),this._destroyFieldControls("_sliders"),this._destroyFieldControls("_dropzones")}_initChooserFields(e){this._choosers||(this._choosers={});const t=e.querySelectorAll("[data-chooser-field]");if(!t.length)return;const n="function"==typeof ci?.chooser?ci.chooser.bind(ci):window.Domma?.elements?.chooser?.bind(window.Domma.elements);n&&t.forEach(e=>{const t=JSON.parse((e.getAttribute("data-chooser-config")||"{}").replace(/"/g,'"')),s=e.getAttribute("data-chooser-field"),i=n(e,{...t,onChange:e=>{if(this.model)try{this.model.set(s,e)}catch(e){this.setFieldError(s,e.message)}else this.data[s]=e}});i&&(this._choosers[s]=i)})}_initSignatureFields(e){const t=e.querySelectorAll("[data-signature-field]");t.length&&window.Domma&&"function"==typeof window.Domma.elements?.signature&&t.forEach(e=>{const t=e.dataset.signatureField;window.Domma.elements.signature(e,{name:t,onChange:e=>{this.model&&this.model.set({[t]:e})}})})}_initTooltips(e){if(window.Domma&&window.Domma.icons&&"function"==typeof window.Domma.icons.scan&&window.Domma.icons.scan(e),window.Domma&&window.Domma.elements&&"function"==typeof window.Domma.elements.tooltip){e.querySelectorAll("label[data-tooltip]").forEach(e=>{window.Domma.elements.tooltip(e,{position:"top",trigger:"hover",delay:{show:200,hide:0}})})}}getData(){return this.model?this.model.get():this.data}setData(e){this.data={...this.data,...e},this.model&&this.model.set(e)}validate(){this.errors={};let e=!0;for(const t in this.schema){this.validateField(t)||(e=!1)}return e}validateField(e){const t=this.schema[e];if(!t)return!0;const n=this._getFieldValueByName(e);try{const s=this._validateFieldValue(e,n,t);if(!s.valid)return this.setFieldError(e,s.error),!1;if(this.model&&this.model._validateField){const t=this.model._validateField(e,n);if(!t.valid)return this.setFieldError(e,t.error),!1}return this.clearFieldError(e),!0}catch(t){return this.setFieldError(e,t.message),!1}}setFieldError(e,t){this.errors[e]=t;const n=document.querySelector(`[data-error-for="${e}"]`);n&&(n.textContent=t,n.style.display="block",n.parentElement.classList.add("has-error"))}clearFieldError(e){delete this.errors[e];const t=document.querySelector(`[data-error-for="${e}"]`);t&&(t.textContent="",t.style.display="none",t.parentElement.classList.remove("has-error"))}handleSubmit(){const e=this.validate(),t=this.getData();return e&&this.options.onSubmit?this.options.onSubmit(t,this):!e&&this.options.onValidationError&&this.options.onValidationError(this.errors,this),{isValid:e,data:t,errors:this.errors}}_getFieldValue(e){const{type:t,name:n}=e;if("checkbox"===t){if(n.endsWith("[]")){const e=document.querySelectorAll(`input[name="${n}"]:checked`);return Array.from(e).map(e=>e.value)}return e.checked}if("radio"===t){const e=document.querySelector(`input[name="${n}"]:checked`);return e?e.value:null}return"number"===t||"range"===t?""===e.value?null:Number(e.value):e.value}_getFieldValueByName(e){if(this._choosers&&this._choosers[e])return this._choosers[e].getValue();if(this._sliders&&this._sliders[e])return this._sliders[e].getValue();if(this._dropzones&&this._dropzones[e])return this._dropzones[e].getFiles();if(this.formElement){const t=this.formElement.querySelector(`[name="${e}"]`);if(t)return this._getFieldValue(t)}return this.model?this.model.get(e):this.data[e]}_validateFieldValue(e,t,n){const s="chooser"===n.type||"dropzone"===n.type?null==t||Array.isArray(t)&&0===t.length||""===t:null==t||""===t;if(n.required&&s)return{valid:!1,error:`${n.label||e} is required`};if(s)return{valid:!0};if("email"===n.type&&t){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return{valid:!1,error:"Please enter a valid email address"}}if("number"===n.type&&null!==t){const e=Number(t);if(isNaN(e))return{valid:!1,error:"Please enter a valid number"};if(void 0!==n.min&&e<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&e>n.max)return{valid:!1,error:`Value must be no more than ${n.max}`}}if("string"==typeof t){if(n.minLength&&t.length<n.minLength)return{valid:!1,error:`Must be at least ${n.minLength} characters`};if(n.maxLength&&t.length>n.maxLength)return{valid:!1,error:`Must be no more than ${n.maxLength} characters`}}if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:n.formConfig?.hint||"Invalid format"};if(n.validate&&"function"==typeof n.validate)try{const e=this.formElement?function(e){const t=new FormData(e),n={};for(const[e,s]of t.entries())n[e]?Array.isArray(n[e])?n[e].push(s):n[e]=[n[e],s]:n[e]=s;return e.querySelectorAll("input").forEach(e=>{"checkbox"!==e.type||e.checked?"checkbox"===e.type&&e.checked&&(n[e.name]="on"===e.value||e.value):n.hasOwnProperty(e.name)||(n[e.name]=!1)}),n}(this.formElement):this.data,s=n.validate(t,e);if(!0!==s)return{valid:!1,error:s||"Validation failed"}}catch(e){return{valid:!1,error:e.message||"Validation error"}}return{valid:!0}}}const fl={create:(e,t={},n={})=>new ml(e,t,n),render:(e,t,n={},s={})=>new ml(t,n,s).renderTo(e),wizard(e,t={}){if(!t.schema)throw new Error("Wizard options must include a schema with steps array");const{schema:{steps:n=[]},data:s={},...i}=t,o=`wizard-${Date.now()}`;let r=0,a={...s},l=null;const c="string"==typeof e?document.querySelector(e):e;if(!c)throw new Error(`Wizard target element not found: ${e}`);if(!Array.isArray(n)||0===n.length)throw new Error("Wizard schema must contain a non-empty steps array");n.forEach((e,t)=>{if(e.title||(e.title=`Step ${t+1}`),!e.fields)throw new Error(`Step ${t} is missing fields array`)});let h=null;function d(){h&&h.destroy(),h=null}function u(e){const t=e?function(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const{name:n,type:s,value:i,checked:o}=e;if(n)if("checkbox"===s)if(n.endsWith("[]")){const e=n.slice(0,-2);t[e]||(t[e]=[]),o&&t[e].push(i)}else t[n]=o;else"radio"===s?o&&(t[n]=i):"number"===s||"range"===s?t[n]=""===i?null:Number(i):"SELECT"===e.tagName&&e.hasAttribute("multiple")?t[n]=Array.from(e.selectedOptions).map(e=>e.value).filter(e=>e):t[n]=i}),t}(e):{};if(h)for(const e of["_sliders","_dropzones","_choosers"])for(const n of Object.keys(h[e]||{}))t[n]=h._getFieldValueByName(n);return t}function p(){const e=l?.querySelector("form");e&&Object.assign(a,u(e))}function m(e){return!h||(h.formElement=e,h.setData(a),h.validate())}function f(){if(d(),c.innerHTML=function(e){const t=n[e],s=new ml(t.fields,a,{...i,layout:t.layout||i.layout||"stacked",showSubmitButton:!1}),r=0===e,l=e===n.length-1;return`\n <div id="${o}" class="wizard">\n <div class="wizard-step active card" data-step="${e}">\n <div class="card-header wizard-header">\n <div class="wizard-progress mb-3">\n <div class="wizard-progress-bar" style="width: ${(e+1)/n.length*100}%"></div>\n </div>\n <div class="wizard-step-info">\n <h5 class="wizard-step-title card-title mb-2">${t.title}</h5>\n ${t.description?`<p class="wizard-step-description card-subtitle text-muted mb-2">${t.description}</p>`:""}\n <small class="text-muted">Step ${e+1} of ${n.length}</small>\n </div>\n </div>\n <div class="card-body wizard-content">\n ${s.render()}\n </div>\n <div class="card-footer wizard-nav d-flex justify-content-between">\n <button type="button" class="btn btn-secondary wizard-prev" ${r?'style="visibility: hidden;"':""}>\n ${i.prevText||"Previous"}\n </button>\n <button type="button" class="btn btn-primary wizard-${l?"submit":"next"}">\n ${l?i.finishText||"Finish":i.nextText||"Next"}\n </button>\n </div>\n </div>\n </div>\n `}(r),l=c.querySelector(`#${o}`),!l)return;const e=l.querySelector("form");e&&(h=new ml(n[r].fields,a,{...i,showSubmitButton:!1}),h.formElement=e,h._bindEvents(e));const t=l.querySelector(".wizard-prev"),s=l.querySelector(".wizard-next"),_=l.querySelector(".wizard-submit");t&&t.addEventListener("click",e=>{e.preventDefault(),r>0&&(p(),i.onStepChange&&i.onStepChange(r-1,a),r--,f())}),s&&s.addEventListener("click",t=>{t.preventDefault(),Object.assign(a,u(e));const s=h,o=m(e);i.onValidation&&i.onValidation(o,s?.errors||[],r),o&&r<n.length-1&&(i.onStepChange&&i.onStepChange(r+1,a),r++,f())}),_&&_.addEventListener("click",async t=>{t.preventDefault(),Object.assign(a,u(e));const n=h,s=m(e);if(i.onValidation&&i.onValidation(s,n?.errors||[],r),s&&i.onSubmit)try{await i.onSubmit(a,n)}catch(e){i.onError&&i.onError(e,a,n)}})}return f(),{nextStep:()=>{r<n.length-1&&(p(),i.onStepChange&&i.onStepChange(r+1,a),r++,f())},prevStep:()=>{r>0&&(p(),i.onStepChange&&i.onStepChange(r-1,a),r--,f())},goToStep:e=>{e>=0&&e<n.length&&(p(),i.onStepChange&&i.onStepChange(e,a),r=e,f())},getCurrentStep:()=>r,getStepData:()=>({...a}),setStepData:e=>{Object.assign(a,e),f()},validate:()=>{const e=l?.querySelector("form");return!e||m(e)},getElement:()=>l,destroy:()=>{d(),l?.remove(),l=null}}},modal(e,t={},n={}){const s=`form-${Date.now()}`;let i=null;const o=new ml(e,t,{...n,showSubmitButton:!1,onSubmit:async(e,t)=>{if(n.onSave)try{await n.onSave(e,t),!1!==n.closeOnSave&&i&&i.close()}catch(s){n.onError&&n.onError(s,e,t)}}}),r=`\n <div class="modal" id="modal-${s}" style="display: none;">\n <div class="modal-header">\n <h3 class="modal-title">${n.title||"Form"}</h3>\n <button type="button" class="modal-close" data-action="close">×</button>\n </div>\n <div class="modal-body">\n ${o.render()}\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-action="close">Cancel</button>\n <button type="button" class="btn btn-primary" data-action="save">${n.saveText||"Save"}</button>\n </div>\n </div>\n `,a=document.createElement("div");a.className="modal-backdrop",a.style.display="none";const l=document.createElement("div");l.innerHTML=r;const c=l.firstElementChild;return document.body.appendChild(a),document.body.appendChild(c),i={open(){a.style.display="block",c.style.display="block",setTimeout(()=>{a.classList.add("active"),c.classList.add("active")},10);const e=c.querySelector("form");e&&o._bindEvents(e),c.querySelectorAll('[data-action="close"]').forEach(e=>{e.addEventListener("click",()=>this.close())}),c.querySelector('[data-action="save"]').addEventListener("click",()=>{const e=c.querySelector("form");if(e){const t=new Event("submit",{cancelable:!0});e.dispatchEvent(t)}}),a.addEventListener("click",e=>{e.target===a&&this.close()})},close(){a.classList.remove("active"),c.classList.remove("active"),setTimeout(()=>{a.style.display="none",c.style.display="none",document.body.removeChild(a),document.body.removeChild(c)},300)},isOpen:()=>"none"!==c.style.display},i},crud(e){if(!e.schema)throw new Error("CRUD config must include a schema");if(!e.endpoint)throw new Error("CRUD config must include an API endpoint");const{schema:t,endpoint:n,tableSelector:s,title:i="Manage Items",primaryKey:o="id",displayField:r="name",headers:a={},onError:l=e=>console.error("CRUD Error:",e),onSuccess:c=e=>console.log("CRUD Success:",e)}=e;let h=null,d=[];return{async init(){await this.loadData(),this.createTable(),this.bindEvents()},async loadData(){try{window.Domma?.auth?.getApiUrl?.();const e=window.Domma?.auth?.token,t=e?{Authorization:`Bearer ${e}`}:{},s=await window.Domma.http.get(n,{headers:{...a,...t}});if(!s.success)throw new Error(s.message||"Failed to load data");d=s.data||[]}catch(e){throw l(e),e}},createTable(){if(!s)return;const e=Object.entries(t).map(([e,t])=>({key:e,title:t.label||(window.Domma?.utils||y).capitalize(e),sortable:!0,render:t.tableRender}));e.push({key:"actions",title:"Actions",sortable:!1,render:(e,t)=>{const n=window.Domma.icons.html("edit",{size:16,class:"inline-icon",colour:"var(--dm-info-light, #a5d8ff)",attrs:{style:"margin-right: 4px;"}}),s=window.Domma.icons.html("trash",{size:16,class:"inline-icon",colour:"var(--dm-danger-light, #ffacac)",attrs:{style:"margin-right: 4px;"}});return`\n <div class="btn-group btn-group-sm">\n <button class="btn btn-primary crud-edit-btn" data-id="${t[o]}">\n ${n}\n Edit\n </button>\n <button class="btn btn-danger crud-delete-btn" data-id="${t[o]}">\n ${s}\n Delete\n </button>\n </div>\n `}}),h=window.Domma.tables.create(s,{data:d,columns:e,pagination:!0,pageSize:25,striped:!0,selectable:!0,selectionMode:"multiple",exportPanel:!0,exportOptions:["text","csv","excel","json"],columnToggle:!0,regexSearch:!0,persistSettings:!0,storageKey:`domma-crud-${i.toLowerCase().replace(/\s+/g,"-")}`}),this.initializeTableIcons()},initializeTableIcons(){setTimeout(()=>{document.querySelectorAll("[data-icon]").forEach(e=>{const t=e.getAttribute("data-icon");if(window.Domma&&window.Domma.icons&&window.Domma.icons.render){const n=window.Domma.icons.render(t,{size:16,class:"inline-icon"});n&&(e.innerHTML="",e.appendChild(n))}})},100)},bindEvents(){const e=document.querySelector(".crud-add-btn");e&&e.addEventListener("click",()=>this.create()),document.addEventListener("click",e=>{if(e.target.matches(".crud-edit-btn")){const t=e.target.getAttribute("data-id");this.edit(t)}}),document.addEventListener("click",e=>{if(e.target.matches(".crud-delete-btn")){const t=e.target.getAttribute("data-id");this.delete(t)}});const t=document.querySelector(".crud-refresh-btn");t&&t.addEventListener("click",()=>this.refresh())},async create(){fl.modal(t,{},{title:`Create New ${i.slice(7)}`,size:"xl",saveText:"Create",showSubmitButton:!1,onSave:async e=>{try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},i=await window.Domma.http.post(n,e,{headers:{...a,...s}});if(!i.success)throw new Error(i.message||"Failed to create item");c("Item created successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async edit(e){const s=d.find(t=>t[o]==e);if(!s)return void l(new Error("Item not found"));fl.modal(t,s,{title:`Edit ${s[r]||"Item"}`,size:"xl",saveText:"Update",showSubmitButton:!1,onSave:async t=>{try{window.Domma?.auth?.getApiUrl?.();const s=window.Domma?.auth?.token,i=s?{Authorization:`Bearer ${s}`}:{},o=await window.Domma.http.put(`${n}/${e}`,t,{headers:{...a,...i}});if(!o.success)throw new Error(o.message||"Failed to update item");c("Item updated successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async delete(e){const t=d.find(t=>t[o]==e);if(!t)return void l(new Error("Item not found"));if(await window.Domma.elements.confirm(`Are you sure you want to delete "${t[r]||"this item"}"?\n\nThis action cannot be undone.`,{title:"Confirm Delete",confirmText:"Delete",cancelText:"Cancel",type:"warning"}))try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},i=await window.Domma.http.delete(`${n}/${e}`,{headers:{...a,...s}});if(!i.success)throw new Error(i.message||"Failed to delete item");c("Item deleted successfully"),await this.refresh()}catch(e){l(e)}},async refresh(){try{await this.loadData(),h&&(h.setData(d),this.initializeTableIcons())}catch(e){}},getData:()=>[...d],getTable:()=>h,addItem:e=>{d.push(e),h&&h.setData(d)},updateItem:(e,t)=>{const n=d.findIndex(t=>t[o]==e);-1!==n&&(d[n]={...d[n],...t},h&&h.setData(d))},removeItem:e=>{const t=d.findIndex(t=>t[o]==e);-1!==t&&(d.splice(t,1),h&&h.setData(d))}}}};function _l(e,t){if(![t.x,t.y,t.width,t.height].every(Number.isFinite)||t.width<=0||t.height<=0||t.alpha<=0)return;const n=Math.cos(t.flipPhase||0),s=t.width*(.12+.88*Math.abs(n)),i=Math.sin(t.curlPhase||0)*t.width*.32,o=-t.height/2,r=t.height/2;e.save(),e.globalAlpha*=t.alpha??1,e.translate(t.x,t.y),e.rotate(t.rotation||0),e.beginPath(),e.moveTo(-s/2,o),e.bezierCurveTo(-s/2+i,o+.3*t.height,-s/2-i,r-.3*t.height,-s/2,r),e.lineTo(s/2,r),e.bezierCurveTo(s/2-i,r-.3*t.height,s/2+i,o+.3*t.height,s/2,o),e.closePath(),e.fillStyle=t.colour,e.fill();const a=e.createLinearGradient(-s/2,o,s/2,r);a.addColorStop(0,n<0?"rgba(20,25,40,0.28)":"rgba(255,255,255,0.48)"),a.addColorStop(.42,"rgba(255,255,255,0.05)"),a.addColorStop(.7,"rgba(20,25,40,0.2)"),a.addColorStop(1,"rgba(255,255,255,0.3)"),e.fillStyle=a,e.fill(),e.beginPath(),e.moveTo(s/2,o),e.bezierCurveTo(s/2+i,o+.3*t.height,s/2-i,r-.3*t.height,s/2,r),e.strokeStyle="rgba(255,255,255,0.42)",e.lineWidth=.55,e.stroke(),e.restore()}function gl(e,t,n,s){const i=Math.cos(e.swayPhase);e.swayPhase+=e.swayFreq*s,e.x+=e.vx*s+(i-Math.cos(e.swayPhase))*n.sway,e.y+=e.vy*s,e.rotation+=e.rotationSpeed*s,e.flipPhase+=e.flipSpeed*s,e.curlPhase+=.025*s;const o=e.y/Math.max(1,t);e.alpha=o<n.fadeStart?1:Math.max(0,1-(o-n.fadeStart)/Math.max(.001,1-n.fadeStart)),(e.y-e.height>t||e.alpha<=.01)&&(e.alive=!1)}function vl(e,t){if(![t.x,t.y,t.size].every(Number.isFinite)||t.size<=0)return;const n=.12+.88*Math.abs(Math.sin(t.flapPhase||0));e.save(),e.translate(t.x,t.y),e.rotate((t.heading??-Math.PI/2)+Math.PI/2),e.scale(t.size/2.2,t.size/2.2),e.globalAlpha*=t.alpha??1,e.lineCap="round",e.lineJoin="round";const s=(t,n,s,i=.025)=>{e.beginPath();for(const[n,...s]of t)e[n](...s);n&&(e.fillStyle=n,e.fill()),s&&(e.strokeStyle=s,e.lineWidth=i,e.stroke())},i=(t,n,s,i,o)=>{e.beginPath(),e.ellipse(t,n,s,i,0,0,2*Math.PI),e.fillStyle=o,e.fill()};for(const o of[-1,1]){e.save(),e.scale(o*n,1);const r=e.createLinearGradient(0,0,1.1,-.8);r.addColorStop(0,"#504354"),r.addColorStop(.26,t.colourUpper||"#d891b4"),r.addColorStop(1,"#f5dabc");const a=e.createLinearGradient(0,0,.9,.7);a.addColorStop(0,"#63505d"),a.addColorStop(.35,t.colourLower||t.colourUpper||"#bd8fb3"),a.addColorStop(1,"#e8cbb6"),s([["moveTo",.045,-.04],["bezierCurveTo",.3,-.52,.73,-1.02,1.04,-.83],["bezierCurveTo",1.18,-.67,.91,-.13,.63,.03],["quadraticCurveTo",.32,.17,.045,-.04],["closePath"]],r,"#5b4a59",.035),s([["moveTo",.05,0],["bezierCurveTo",.52,-.05,.98,.2,.84,.54],["quadraticCurveTo",.74,.73,.52,.68],["quadraticCurveTo",.31,.87,.15,.54],["quadraticCurveTo",.03,.28,.05,0],["closePath"]],a,"#5b4a59",.035);for(const[e,t]of[[1.03,-.73],[.93,-.38],[.73,-.08],[.8,.37],[.61,.64],[.28,.67]])s([["moveTo",.08,0],["quadraticCurveTo",.53*e,.8*t,e,t]],null,"rgba(78,54,67,0.45)",.018);for(const[e,t,n]of[[.89,-.66,.04],[.87,-.47,.034],[.77,-.29,.03],[.69,.38,.035],[.55,.54,.03],[.35,.55,.028]])i(e,t,n,1.2*n,"#fff0d5");i(.48,-.33,.11,.14,"#69506c"),i(.48,-.33,.058,.075,"#e8c68f"),i(.45,.34,.085,.105,"rgba(90,65,86,0.65)"),e.restore()}i(0,.16,.052,.37,"#493f49"),i(0,-.12,.073,.15,"#5c4d56"),i(0,-.31,.072,.075,"#443a45");for(const e of[-1,1])s([["moveTo",.025*e,-.35],["quadraticCurveTo",.1*e,-.61,.2*e,-.56]],null,"#665362",.018),i(.2*e,-.56,.02,.025,"#d6b391");e.restore()}function bl(e){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e)return 0;const t=parseFloat(e);return Number.isFinite(t)?e.endsWith("ms")?t:e.endsWith("s")?1e3*t:0:0}function yl(e,t){let n;if("string"==typeof e)n=Array.from(document.querySelectorAll(e));else if(e instanceof Element)n=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error(`[Domma.effects.${t}] Invalid selector`),null;n=Array.from(e)}return 0===n.length?(console.warn(`[Domma.effects.${t}] No elements found`),null):n}function kl(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const wl={club:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7},concert:{origins:["tl","tr"],motion:"sweep",sweepArc:120,speed:.8,beamWidth:18,flicker:!0,hz:6,colours:["#f43f5e","#fb923c","#facc15","#22c55e","#3b82f6"],intensity:.75},police:{origins:["tl","tr"],motion:"sweep",sweepArc:70,speed:2.2,beamWidth:22,flicker:!0,hz:8,colours:["#ef4444","#3b82f6"],intensity:.85},searchlight:{origins:["bl","br"],motion:"rotate",sweepArc:90,speed:.5,beamWidth:12,flicker:!1,hz:0,colours:["#fffbe6","#fde68a"],intensity:.6},scanner:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:60,speed:1.6,beamWidth:8,flicker:!1,hz:0,colours:["#22d3ee"],intensity:.7},mood:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:140,speed:.35,beamWidth:28,flicker:!1,hz:0,colours:["#a855f7","#6366f1","#ec4899","#38bdf8"],intensity:.45}};function xl(e,t){let n=String(e).replace("#","");3===n.length&&(n=n.split("").map(e=>e+e).join(""));return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}const Ml={rainbow:["#ef4444","#f97316","#facc15","#22c55e","#0ea5e9","#6366f1","#a855f7","#ec4899"],festive:["#dc2626","#16a34a","#fbbf24","#3b82f6","#a855f7","#ec4899"],gold:["#fbbf24","#f59e0b","#fde68a","#fffbeb","#d97706","#fcd34d"],silver:["#e5e7eb","#cbd5e1","#94a3b8","#f8fafc","#9ca3af","#d1d5db"],pastel:["#fbcfe8","#bae6fd","#bbf7d0","#fef3c7","#ddd6fe","#fed7aa"],mono:["#1f2937","#4b5563","#9ca3af","#d1d5db","#f3f4f6"],sunset:["#f43f5e","#fb923c","#facc15","#f59e0b","#ec4899"],ocean:["#0ea5e9","#22d3ee","#06b6d4","#3b82f6","#6366f1"],forest:["#16a34a","#65a30d","#84cc16","#22c55e","#15803d"],bridal:["#ffffff","#fef3c7","#fce7f3","#fbcfe8","#f9a8d4"],meadow:["#84cc16","#a3e635","#bbf7d0","#bae6fd","#fef08a","#ddd6fe"],firefly:["#fde68a","#facc15","#f59e0b","#a3e635","#fef9c3"],aqua:["#a5f3fc","#67e8f9","#22d3ee","#bae6fd","#e0f2fe"],autumn:["#b45309","#d97706","#f59e0b","#ca8a04","#92400e","#dc2626"]};function Ll(e){if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e&&Ml[e])return Ml[e];if("theme"===e||!e){const e=document.documentElement,t=getComputedStyle(e),n=["--dm-primary","--dm-secondary","--dm-success","--dm-warning","--dm-danger","--dm-info"].map(e=>t.getPropertyValue(e).trim()).filter(e=>e&&"transparent"!==e);return n.length>0?n:Ml.rainbow}return console.warn(`[Domma.effects] Unknown palette '${e}', using rainbow.`),Ml.rainbow}const Cl=Ll;var Al={breathe:function(e,t={}){const n={amplitude:6,duration:3e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,onStart:null,onComplete:null,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.breathe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.breathe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.breathe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-breathe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=`\n @keyframes ${i} {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-${n.amplitude}px);\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",i),r.textContent=o,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>{e.style.animationPlayState="paused"},n=()=>{e.style.animationPlayState="running"};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}if(n.onComplete&&"infinite"!==n.iterations){const t=()=>{n.onComplete(),e.removeEventListener("animationend",t)};e.addEventListener("animationend",t)}}),n.onStart&&n.onStart(),{pause(){s.forEach(e=>{e.style.animationPlayState="paused"})},resume(){s.forEach(e=>{e.style.animationPlayState="running"})},stop(){s.forEach(e=>{e.style.animation="none"})},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning(){if(0===s.length)return!1;const e=s[0];return"paused"!==e.style.animationPlayState&&"none"!==e.style.animation},isPaused:()=>0!==s.length&&"paused"===s[0].style.animationPlayState}},pulse:function(e,t={}){const n={scale:1.05,duration:2e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,respectMotionPreference:!0,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.pulse] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.pulse] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-pulse-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=`\n @keyframes ${i} {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(${n.scale});\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",i),r.textContent=o,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>e.style.animationPlayState="paused",n=()=>e.style.animationPlayState="running";e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>e.style.animation="none")},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning:()=>s.length>0&&"paused"!==s[0].style.animationPlayState&&"none"!==s[0].style.animation,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},scribe:function(e,t={}){const n={mode:"typewriter",speed:50,deleteSpeed:30,cursor:!0,cursorChar:"|",cursorBlink:!0,cursorType:"caret",loop:!1,loopDelay:1e3,pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,actions:[],onStart:null,onComplete:null,onCharacter:null,onRender:null,onUndoRender:null,onLoop:null,...t};let s;if("string"==typeof e)s=Array.from(document.querySelectorAll(e));else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.scribe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.scribe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){const e=n.actions.find(e=>void 0!==e.render);return e&&s.forEach(t=>{t.textContent=String(e.render)}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1}}const i="function"==typeof Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null,o=s.map(e=>({element:e,spans:[],cursor:null,action:0,task:null,exiting:[],frame:null,lastTime:null,elapsed:0,loops:0,lastRenderStart:0,started:!1,paused:!1,stopped:!1,destroyed:!1,hoverPaused:!1,hoverHandlers:null}));function r(e,t){e.cursor?.classList.toggle("dm-scribe-cursor-active",t)}function a(e){const t=e.parentElement;e.remove(),t?.classList.contains("dm-scribe-word-group")&&!t.childNodes.length&&t.remove()}const l={fade:220,bounce:380,glow:500};function c(e,t){t.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow");const s=Math.max(220,n.deleteSpeed);return t.style.animationDuration=`${s}ms`,t.classList.add("dm-scribe-out"),e.exiting.push({span:t,left:s}),s}function h(e){e.spans.forEach(a),e.spans=[],e.exiting.forEach(e=>a(e.span)),e.exiting=[],e.lastRenderStart=0}function d(e){null!==e.frame||!e.started||e.paused||e.stopped||e.destroyed||(e.frame=requestAnimationFrame(t=>function(e,t){if(e.frame=null,e.paused||e.stopped||e.destroyed)return;const n=null!==e.lastTime?Math.min(t-e.lastTime,64):0;e.elapsed+=n,e.lastTime=t,e.exiting=e.exiting.filter(e=>(e.left-=n,e.left>0||(a(e.span),!1)));let s=0;for(;s++<100&&!e.paused&&!e.stopped&&!e.destroyed&&(e.task||u(e),!(e.stopped||e.paused||e.destroyed));){const t=e.task;if("render"===t.type&&t.index>=t.units.length||"undo"===t.type&&t.deleted.length>=t.count&&!t.hold){p(e);continue}const n=t.hold||t.duration;if(e.elapsed<n)break;if(e.elapsed-=n,t.hold)t.hold=0;else if("render"===t.type)m(e,t);else if("undo"===t.type){const n=e.spans.pop();if(t.deleted.push(n.textContent),n.dmScribeEffect){const s=c(e,n);t.deleted.length>=t.count&&(t.hold=s)}else a(n)}else p(e)}d(e)}(e,t)))}function u(e){if(e.action>=n.actions.length)return r(e,!1),void(!0===n.loop||"number"==typeof n.loop&&e.loops<n.loop-1?e.task={type:"loop",duration:Math.max(0,n.loopDelay)}:(e.stopped=!0,r(e,!1),n.onComplete?.()));const t=n.actions[e.action];if(void 0!==t.render)e.lastRenderStart=e.spans.length,e.task={type:"render",text:String(t.render),units:(s=String(t.render),"word"===n.mode?s.match(/\s*\S+\s*|\s+/g)||[]:"sentence"===n.mode?s.match(/[^.!?]*[.!?]+\s*|[^.!?]+$/g)||[]:i?Array.from(i.segment(s),e=>e.segment):Array.from(s)),index:0,effect:t.effect||"none",duration:Math.max(0,n.speed)};else if(void 0!==t.undoRender){let s=0;!0===t.undoRender?s=e.spans.length-e.lastRenderStart:"all"===t.undoRender?s=e.spans.length:Number.isFinite(t.undoRender)&&(s=Math.floor(t.undoRender)),e.task={type:"undo",count:Math.max(0,Math.min(s,e.spans.length)),deleted:[],duration:Math.max(0,n.deleteSpeed)}}else e.task={type:"wait",duration:Math.max(0,bl(t.wait))};var s;r(e,"render"===e.task.type||"undo"===e.task.type)}function p(e){const t=e.task;e.task=null,"loop"===t.type?(h(e),e.action=0,e.loops++,n.onLoop?.(e.loops)):(e.action++,"render"===t.type&&n.onRender?.(t.text),"undo"===t.type&&n.onUndoRender?.(t.deleted.reverse().join("")))}function m(e,t){const s=t.units[t.index++],i=document.createElement("span");if(i.className="word"===n.mode?"dm-scribe-word":"sentence"===n.mode?"dm-scribe-sentence":"dm-scribe-char",i.textContent=s,/^\s+$/.test(s)&&i.classList.add("dm-scribe-space"),["fade","bounce","glow"].includes(t.effect)){const e=`dm-scribe-${t.effect}`;i.classList.add(e),i.dmScribeEffect=t.effect,n.speed>l[t.effect]&&(i.style.animationDuration=`${n.speed}ms`),"sentence"===n.mode&&"bounce"===t.effect&&i.classList.add("dm-scribe-transform-unit"),i.addEventListener("animationend",()=>i.classList.remove(e),{once:!0})}if("typewriter"!==n.mode||/^\s+$/.test(s))e.element.insertBefore(i,e.cursor);else{const t=e.spans.at(-1);let n=t?.parentElement;n?.classList.contains("dm-scribe-word-group")||(n=document.createElement("span"),n.className="dm-scribe-word-group",e.element.insertBefore(n,e.cursor)),n.appendChild(i)}e.spans.push(i),n.onCharacter?.(s,e.spans.length-1)}function f(e){e.destroyed||e.stopped||(e.paused=!0,null!==e.frame&&cancelAnimationFrame(e.frame),e.frame=null,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState="paused"}),e.exiting.forEach(e=>{e.span.style.animationPlayState="paused"}),r(e,!1))}function _(e){if(e.destroyed||e.stopped||e.started&&!e.paused)return;const t=!e.started;e.started=!0,e.paused=!1,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState=""}),e.exiting.forEach(e=>{e.span.style.animationPlayState=""}),r(e,"render"===e.task?.type||"undo"===e.task?.type),t&&n.onStart?.(),d(e)}return o.forEach(e=>{if(n.cursor){const t=document.createElement("span"),s=["block","underline"].includes(n.cursorType)?n.cursorType:"caret";t.className=`dm-scribe-cursor dm-scribe-cursor-${s}`,n.cursorBlink||t.classList.add("dm-scribe-cursor-no-blink"),t.textContent="underline"===s?" ":n.cursorChar,t.setAttribute("aria-hidden","true"),e.cursor=t,e.element.appendChild(t)}n.pauseOnHover&&(e.hoverHandlers={enter:()=>{!e.started||e.paused||e.stopped||(e.hoverPaused=!0,f(e))},leave:()=>{e.hoverPaused&&(e.hoverPaused=!1,_(e))}},e.element.addEventListener("mouseenter",e.hoverHandlers.enter),e.element.addEventListener("mouseleave",e.hoverHandlers.leave)),n.autoStart&&_(e)}),{pause(){o.forEach(e=>{e.hoverPaused=!1,f(e)})},resume(){o.forEach(_)},stop(){o.forEach(e=>{f(e),e.paused=!1,e.stopped=!0,e.spans.forEach(e=>{e.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow"),e.style.animationPlayState=""}),e.exiting.forEach(e=>a(e.span)),e.exiting=[],r(e,!1)})},restart(){o.forEach(e=>{e.destroyed||(f(e),h(e),Object.assign(e,{action:0,task:null,elapsed:0,lastTime:null,loops:0,stopped:!1,started:!1}),_(e))})},destroy(){o.forEach(e=>{f(e),e.destroyed=!0,h(e),e.cursor?.remove(),e.hoverHandlers&&(e.element.removeEventListener("mouseenter",e.hoverHandlers.enter),e.element.removeEventListener("mouseleave",e.hoverHandlers.leave))})},isRunning:()=>o.some(e=>e.started&&!e.paused&&!e.stopped&&!e.destroyed),isPaused:()=>o.some(e=>e.paused&&!e.destroyed)}},reveal:function(e,t={}){const n={animation:"fade",duration:600,easing:"ease-out",delay:0,stagger:0,threshold:.1,rootMargin:"0px",once:!0,respectMotionPreference:!0,onReveal:null,...t},s=yl(e,"reveal");if(!s)return null;if(n.respectMotionPreference&&kl())return s.forEach(e=>{e.classList.add("dm-reveal-visible")}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};s.forEach((e,t)=>{e.classList.add("dm-reveal",`dm-reveal-${n.animation}`),e.style.transitionDuration=`${n.duration}ms`,e.style.transitionTimingFunction=n.easing;const s=n.delay+t*n.stagger;s>0&&(e.style.transitionDelay=`${s}ms`),n.respectMotionPreference||e.setAttribute("data-force-animation","true")});const i=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(e.target.classList.add("dm-reveal-visible"),n.onReveal&&n.onReveal(e.target),n.once&&i.unobserve(e.target)):n.once||e.target.classList.remove("dm-reveal-visible")})},{threshold:n.threshold,rootMargin:n.rootMargin});return s.forEach(e=>i.observe(e)),{pause(){},resume(){},stop(){i.disconnect()},restart(){s.forEach(e=>{e.classList.remove("dm-reveal-visible"),i.observe(e)})},destroy(){i.disconnect(),s.forEach(e=>{e.classList.remove("dm-reveal","dm-reveal-visible",`dm-reveal-${n.animation}`),e.style.transitionDuration="",e.style.transitionTimingFunction="",e.style.transitionDelay=""})},isRunning:()=>!0,isPaused:()=>!1}},scramble:function(e,t={}){const n={speed:50,scrambleSpeed:30,characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*",revealOrder:"left-to-right",scrambleDuration:800,stagger:0,loop:!1,loopDelay:2e3,respectMotionPreference:!0,onComplete:null,onCharacter:null,...t},s=yl(e,"scramble");if(!s)return null;if(n.respectMotionPreference&&kl())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=s.map((e,t)=>({element:e,originalText:e.textContent,rafId:null,timeoutId:null,paused:!1,loopCount:0}));function o(){return n.characters[Math.floor(Math.random()*n.characters.length)]}function r(e){if(e.paused)return;const t=e.originalText,s=t.length;if(0===s)return void(n.onComplete&&n.onComplete());const i=function(e,t){const n=Array.from({length:e},(e,t)=>t);switch(t){case"right-to-left":return n.reverse();case"random":for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n;case"center-out":{const t=Math.floor(e/2),n=[t];for(let s=1;s<=t;s++)t-s>=0&&n.push(t-s),t+s<e&&n.push(t+s);return n}default:return n}}(s,n.revealOrder),a=new Array(s).fill(!1),l=t.split("").map(e=>" "===e?" ":o()),c=performance.now(),h=n.speed;e.rafId=requestAnimationFrame(function d(u){if(e.paused)return;const p=u-c;i.forEach((e,s)=>{if(a[e])return;const i=n.scrambleDuration+s*h;p>=i&&(a[e]=!0,l[e]=t[e],n.onCharacter&&n.onCharacter(t[e],e))});for(let e=0;e<s;e++)a[e]||" "===t[e]||(l[e]=o());if(e.element.innerHTML=l.map((e,t)=>`<span class="dm-scramble-char${a[t]?" dm-scramble-resolved":""}">${e}</span>`).join(""),a.every(Boolean))return n.onComplete&&n.onComplete(),void function(e){if(!1===n.loop)return;if("number"==typeof n.loop&&e.loopCount>=n.loop-1)return;e.loopCount++,e.timeoutId=setTimeout(()=>{e.paused||r(e)},n.loopDelay)}(e);e.rafId=requestAnimationFrame(d)})}return i.forEach((e,t)=>{const s=t*n.stagger;s>0?e.timeoutId=setTimeout(()=>r(e),s):r(e)}),{pause(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){i.forEach(e=>{e.paused=!1,r(e)})},stop(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},restart(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.loopCount=0,r(e)})},destroy(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},isRunning:()=>i.length>0&&!i[0].paused,isPaused:()=>i.length>0&&i[0].paused}},counter:function(e,t={}){const n={from:0,to:null,duration:2e3,easing:"ease-out",decimals:0,separator:",",prefix:"",suffix:"",stagger:0,trigger:"immediate",threshold:.5,respectMotionPreference:!0,onUpdate:null,onComplete:null,...t},s=yl(e,"counter");if(!s)return null;if(n.respectMotionPreference&&kl())return s.forEach(e=>{const t=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;e.textContent=n.prefix+i(t,n.decimals,n.separator)+n.suffix}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};function i(e,t,n){const s=e.toFixed(t);if(!n)return s;const i=s.split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,n),i.join(".")}const o=s.map((e,t)=>{const s=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;return{element:e,from:n.from,to:s,rafId:null,timeoutId:null,startTime:null,paused:!1,complete:!1}});function r(e){e.paused||(e.startTime=performance.now(),e.complete=!1,e.rafId=requestAnimationFrame(function t(s){if(e.paused)return;const o=s-e.startTime,r=Math.min(o/n.duration,1),a=function(e){switch(n.easing){case"linear":return e;case"ease-in-out":return e<.5?2*e*e:(4-2*e)*e-1;default:return 1-Math.pow(1-e,3)}}(r),l=e.from+(e.to-e.from)*a;e.element.textContent=n.prefix+i(l,n.decimals,n.separator)+n.suffix,n.onUpdate&&n.onUpdate(l),r<1?e.rafId=requestAnimationFrame(t):(e.complete=!0,e.element.textContent=n.prefix+i(e.to,n.decimals,n.separator)+n.suffix,n.onComplete&&n.onComplete())}))}let a=null;function l(e,t){t>0?e.timeoutId=setTimeout(()=>r(e),t):r(e)}return"scroll"===n.trigger?(a=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const t=o.find(t=>t.element===e.target);if(t&&!t.complete){l(t,o.indexOf(t)*n.stagger)}a.unobserve(e.target)}})},{threshold:n.threshold}),s.forEach(e=>a.observe(e))):o.forEach((e,t)=>{l(e,t*n.stagger)}),{pause(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){o.forEach(e=>{e.paused&&!e.complete&&(e.paused=!1,r(e))})},stop(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},restart(){o.forEach((e,t)=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.complete=!1,l(e,t*n.stagger)})},destroy(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},isRunning:()=>o.length>0&&!o[0].paused&&!o[0].complete,isPaused:()=>o.length>0&&o[0].paused}},ripple:function(e,t={}){const n={colour:"rgba(255, 255, 255, 0.35)",duration:600,opacity:.35,unbounded:!1,centered:!1,trigger:"pointerdown",respectMotionPreference:!0,...t},s=yl(e,"ripple");if(!s)return null;if(n.respectMotionPreference&&kl())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i="domma-ripple-keyframes";if(!document.getElementById(i)){const e=document.createElement("style");e.id=i,e.textContent="\n @keyframes dm-ripple-expand {\n 0% {\n transform: scale(0);\n opacity: var(--dm-ripple-opacity, 0.35);\n }\n 100% {\n transform: scale(4);\n opacity: 0;\n }\n }\n ",document.head.appendChild(e)}const o=new Map;return s.forEach(e=>{e.classList.add("dm-ripple-container");"static"===getComputedStyle(e).position&&(e.style.position="relative"),n.unbounded||(e.style.overflow="hidden"),n.respectMotionPreference||e.setAttribute("data-force-animation","true");const t=t=>{const s=e.getBoundingClientRect(),i=2*Math.max(s.width,s.height);let o,r;n.centered?(o=s.width/2,r=s.height/2):(o=(t.clientX||t.touches?.[0]?.clientX||s.width/2)-s.left,r=(t.clientY||t.touches?.[0]?.clientY||s.height/2)-s.top);const a=document.createElement("span");a.className="dm-ripple",n.respectMotionPreference||a.setAttribute("data-force-animation","true"),a.style.cssText=`\n position: absolute;\n border-radius: 50%;\n pointer-events: none;\n width: ${i}px;\n height: ${i}px;\n left: ${o-i/2}px;\n top: ${r-i/2}px;\n background: ${n.colour};\n --dm-ripple-opacity: ${n.opacity};\n animation: dm-ripple-expand ${n.duration}ms ease-out forwards;\n `,e.appendChild(a),setTimeout(()=>{a.remove()},n.duration)};e.addEventListener(n.trigger,t),o.set(e,t)}),{pause(){},resume(){},stop(){},restart(){},destroy(){s.forEach(e=>{o.has(e)&&(e.removeEventListener(n.trigger,o.get(e)),o.delete(e)),e.classList.remove("dm-ripple-container"),e.querySelectorAll(".dm-ripple").forEach(e=>e.remove())})},isRunning:()=>!0,isPaused:()=>!1}},shake:function(e,t={}){const n={intensity:6,duration:500,direction:"horizontal",easing:"ease-in-out",iterations:1,stagger:0,respectMotionPreference:!0,onComplete:null,...t},s=yl(e,"shake");if(!s)return null;if(n.respectMotionPreference&&kl())return n.onComplete&&n.onComplete(),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-shake-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=n.intensity;let r;switch(n.direction){case"vertical":r=`\n 0%, 100% { transform: translateY(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateY(-${o}px); }\n 20%, 40%, 60%, 80% { transform: translateY(${o}px); }\n `;break;case"both":r=`\n 0%, 100% { transform: translate(0, 0); }\n 10% { transform: translate(-${o}px, -${o}px); }\n 20% { transform: translate(${o}px, ${o}px); }\n 30% { transform: translate(-${o}px, ${o}px); }\n 40% { transform: translate(${o}px, -${o}px); }\n 50% { transform: translate(-${o}px, 0); }\n 60% { transform: translate(${o}px, 0); }\n 70% { transform: translate(0, -${o}px); }\n 80% { transform: translate(0, ${o}px); }\n 90% { transform: translate(-${o}px, -${o}px); }\n `;break;default:r=`\n 0%, 100% { transform: translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateX(-${o}px); }\n 20%, 40%, 60%, 80% { transform: translateX(${o}px); }\n `}const a=document.createElement("style");a.setAttribute("data-domma-effect",i),a.textContent=`@keyframes ${i} { ${r} }`,document.head.appendChild(a);const l=new Map;return s.forEach((e,t)=>{const o=t*n.stagger,r=()=>{e.style.animation=`${i} ${n.duration}ms ${n.easing} ${n.iterations}`;const o=()=>{e.style.animation="",e.removeEventListener("animationend",o),l.delete(e),n.onComplete&&t===s.length-1&&n.onComplete()};e.addEventListener("animationend",o),l.set(e,o)};o>0?setTimeout(r,o):r()}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))})},restart(){s.forEach((e,t)=>{e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${n.iterations}`})},destroy(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))}),a.remove()},isRunning:()=>s.length>0&&""!==s[0].style.animation&&"paused"!==s[0].style.animationPlayState,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},twinkle:function(e,t={}){const n={count:100,minSize:1,maxSize:3,twinkleSpeed:.003,colour:"rgba(255, 240, 200, 1)",zIndex:1,shape:"star",respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.twinkle] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.twinkle] No elements found for selector:",e),null;let o=!1,r=!1,a=null;const l=`domma-twinkle-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];function h(e,t){const s=[];for(let i=0;i<n.count;i++)s.push({x:Math.random()*e,y:Math.random()*t,size:n.minSize+Math.random()*(n.maxSize-n.minSize),opacity:.3+.7*Math.random(),twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:n.twinkleSpeed+Math.random()*n.twinkleSpeed});return s}function d(e,t){const s=document.createElement("canvas");if(s.id=l+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","twinkle"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const i=s.getContext("2d");return{canvas:s,ctx:i,stars:h(s.width,s.height),container:e}}function u(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}e.stars=h(e.canvas.width,e.canvas.height)}if(s){const e=d(document.body,!0);e.isFixed=!0,c.push(e)}else i.forEach(e=>{const t=d(e,!1);t.isFixed=!1,c.push(t)});let p=null;if(s){const e=()=>c.forEach(e=>u(e));window.addEventListener("resize",e),c[0]._resizeHandler=e}else"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(()=>{c.forEach(e=>u(e))}),i.forEach(e=>p.observe(e)));function m(){o&&!r&&(c.forEach(({canvas:e,ctx:t,stars:s})=>{t.clearRect(0,0,e.width,e.height),s.forEach(e=>function(e,t){t.twinklePhase+=t.twinkleSpeed;const s=.3+.7*Math.sin(t.twinklePhase);if(e.save(),e.globalAlpha=t.opacity*s,e.fillStyle=n.colour,e.shadowColor=n.colour,"circle"===n.shape)e.shadowBlur=2*t.size,e.beginPath(),e.arc(t.x,t.y,.6*t.size,0,2*Math.PI),e.fill();else{e.shadowBlur=2*t.size,e.beginPath();for(let n=0;n<4;n++){const s=n*Math.PI/2,i=t.x+Math.cos(s)*t.size,o=t.y+Math.sin(s)*t.size,r=s+Math.PI/4,a=t.x+Math.cos(r)*(.3*t.size),l=t.y+Math.sin(r)*(.3*t.size);0===n?e.moveTo(i,o):e.lineTo(i,o),e.lineTo(a,l)}e.closePath(),e.fill(),e.shadowBlur=t.size,e.beginPath(),e.arc(t.x,t.y,.25*t.size,0,2*Math.PI),e.fill()}e.restore()}(t,e))}),a=requestAnimationFrame(m))}function f(){o||(o=!0,r=!1,m())}return f(),console.log(`[Domma.effects.twinkle] Initialised with ${n.count} stars (${s?"full-page":"container"} mode)`),{pause(){o&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){o&&r&&(r=!1,m())},stop(){o=!1,r=!1,a&&(cancelAnimationFrame(a),a=null)},restart(){this.stop(),c.forEach(e=>{e.stars=h(e.canvas.width,e.canvas.height)}),f()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),p&&(p.disconnect(),p=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>o&&!r,isPaused:()=>o&&r}},tickerTape:function(e,t={}){const n={palette:"theme",density:50,speed:1,sway:60,rotationSpeed:6,minWidth:5,maxWidth:9,minHeight:12,maxHeight:22,fadeStart:.55,burst:!1,burstCount:150,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.tickerTape] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.tickerTape] No elements found for selector:",e),null;const o=Cl(n.palette);let r=!1,a=!1,l=null;const c=`domma-ticker-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null,u=null;function p(e,t,s){const i=n.minWidth+Math.random()*(n.maxWidth-n.minWidth),r=n.minHeight+Math.random()*(n.maxHeight-n.minHeight);return{x:Math.random()*e,y:s?-r-40*Math.random():Math.random()*-t,vy:(1+2.2*Math.random())*n.speed,vx:.4*(Math.random()-.5)*n.speed,swayPhase:Math.random()*Math.PI*2,swayFreq:.005+.01*Math.random(),width:i,height:r,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*n.rotationSpeed*Math.PI/180,flipPhase:Math.random()*Math.PI*2,flipSpeed:.018+.035*Math.random(),curlPhase:Math.random()*Math.PI*2,alpha:1,colour:o[Math.floor(Math.random()*o.length)],alive:!0}}function m(e,t){const s=document.createElement("canvas");if(s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","ticker-tape"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const i=s.getContext("2d"),o={canvas:s,ctx:i,particles:[],container:e,isFixed:t,burstFired:!1};return _(o),o}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++){const t=p(e.width,e.height,!1);t.y=-Math.random()*e.height*1.5,e.particles.push(t)}e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(p(e.width,e.height,!1))}}function _(e){const t=e.isFixed?{width:window.innerWidth,height:window.innerHeight}:e.container.getBoundingClientRect();e.width=t.width||e.container.offsetWidth||1,e.height=t.height||e.container.offsetHeight||1;const n=Math.min(window.devicePixelRatio||1,3);e.canvas.width=Math.round(e.width*n),e.canvas.height=Math.round(e.height*n),e.ctx.setTransform(n,0,0,n,0,0)}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),h.push(e);const t=()=>h.forEach(e=>_(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>{h.forEach(e=>_(e))}),i.forEach(e=>d.observe(e)));function g(e=performance.now()){if(!r||a)return;const t=null===u?1:Math.min(3,Math.max(0,(e-u)/(1e3/60)));u=e,h.forEach(e=>{const{canvas:s,ctx:i,particles:o}=e;i.clearRect(0,0,e.width,e.height);for(let s=o.length-1;s>=0;s--){const r=o[s];gl(r,e.height,n,t),r.alive?_l(i,r):o.splice(s,1)}if(!n.burst){const t=n.density;for(;o.length<t&&Math.random()<.6;)o.push(p(e.width,e.height,!0))}}),l=requestAnimationFrame(g)}function v(){r||(r=!0,a=!1,u=null,g())}return v(),console.log(`[Domma.effects.tickerTape] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,u=null,g())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),h.forEach(e=>f(e)),v()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},butterflies:function(e,t={}){const n={palette:"meadow",density:18,speed:1,wander:1,riseSpeed:.4,flapSpeed:1,minSize:14,maxSize:26,twoTone:!0,burst:!1,burstCount:40,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.butterflies] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.butterflies] No elements found for selector:",e),null;const o=Ll(n.palette);let r=!1,a=!1,l=null;const c=`domma-butterflies-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null;function u(e,t){const s=n.minSize+Math.random()*(n.maxSize-n.minSize),i=Math.random();let r,a;i<.6?(r=Math.random()*e,a=t+s):i<.8?(r=-s,a=t*(.4+.6*Math.random())):(r=e+s,a=t*(.4+.6*Math.random()));const l=-Math.PI/2+1.2*(Math.random()-.5),c=o[Math.floor(Math.random()*o.length)],h=n.twoTone?o[Math.floor(Math.random()*o.length)]:c;return{x:r,y:a,heading:l,targetHeading:l,speed:.6+.8*Math.random(),wanderTimer:60*Math.random(),flapPhase:Math.random()*Math.PI*2,flapSpeed:(.18+.12*Math.random())*n.flapSpeed,size:s,colourUpper:c,colourLower:h,alpha:1,alive:!0}}function p(e,t,s){e.wanderTimer-=1,e.wanderTimer<=0&&(e.targetHeading=-Math.PI/2+(Math.random()-.5)*(1.4*n.wander),e.wanderTimer=30+Math.random()*(60/Math.max(.2,n.wander)));let i=e.targetHeading-e.heading;for(;i>Math.PI;)i-=2*Math.PI;for(;i<-Math.PI;)i+=2*Math.PI;e.heading+=.05*i*n.wander;const o=e.speed*n.speed;e.x+=Math.cos(e.heading)*o+.3*Math.sin(e.flapPhase),e.y+=Math.sin(e.heading)*o-n.riseSpeed*n.speed,e.flapPhase+=e.flapSpeed,(e.y+e.size<0||e.y-e.size>2*s||e.x<3*-e.size||e.x>t+3*e.size)&&(e.alive=!1)}function m(e,t){const s=document.createElement("canvas");s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","butterflies"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const i=s.getContext("2d");return{canvas:s,ctx:i,particles:[],container:e,burstFired:!1}}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++)e.particles.push(u(e.canvas.width,e.canvas.height));e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(u(e.canvas.width,e.canvas.height))}}function _(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),h.push(e);const t=()=>h.forEach(e=>_(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>h.forEach(e=>_(e))),i.forEach(e=>d.observe(e)));function g(){r&&!a&&(h.forEach(e=>{const{canvas:t,ctx:s,particles:i}=e;s.clearRect(0,0,t.width,t.height);for(let e=i.length-1;e>=0;e--){const n=i[e];p(n,t.width,t.height),n.alive?vl(s,n):i.splice(e,1)}if(!n.burst)for(;i.length<n.density&&Math.random()<.3;)i.push(u(t.width,t.height))}),l=requestAnimationFrame(g))}function v(){r||(r=!0,a=!1,g())}return v(),console.log(`[Domma.effects.butterflies] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,g())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),h.forEach(e=>f(e)),v()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},strobe:function(e,t={}){const n={preset:"club",origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7,duration:null,zIndex:9999,respectMotionPreference:!0,...function(e){return wl[e]?wl[e]:(console.warn(`[Domma.effects.strobe] Unknown preset '${e}', using 'club'.`),wl.club)}(t.preset||"club"),...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.strobe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};n.flicker&&n.hz>5&&console.warn(`[Domma.effects.strobe] flicker hz=${n.hz} exceeds 5Hz - rapid flashing can trigger photosensitive seizures.`);const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.strobe] No elements found for selector:",e),null;let o=!1,r=!1,a=null,l=null;const c=`domma-strobe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null;function u(){return n.origins.map((e,t)=>({corner:e,colour:n.colours[t%n.colours.length],phase:t/Math.max(1,n.origins.length)*Math.PI*2}))}const p=[{widthMul:1.9,alphaMul:.16},{widthMul:1,alphaMul:.5},{widthMul:.45,alphaMul:1}];function m(e,t){const s=document.createElement("canvas");s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","strobe"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const i=s.getContext("2d");return{canvas:s,ctx:i,container:e,beams:u()}}function f(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,h.push(e);const t=()=>h.forEach(e=>f(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>h.forEach(e=>f(e))),i.forEach(e=>d.observe(e)));function _(){if(!o||r)return;let e=1;if(n.flicker){const t=.5+.5*Math.sin(("undefined"!=typeof performance&&performance.now?performance.now():Date.now())/1e3*n.hz*Math.PI*2);e=.4+.6*t}h.forEach(t=>{const{canvas:s,ctx:i,beams:o}=t,r=s.width,a=s.height;i.globalCompositeOperation="destination-out",i.fillStyle="rgba(0, 0, 0, 0.14)",i.fillRect(0,0,r,a),i.globalCompositeOperation="lighter";const l=r/2,c=a/2;o.forEach(t=>{const{x:s,y:o}=function(e,t,n){switch(e){case"tr":return{x:t,y:0};case"bl":return{x:0,y:n};case"br":return{x:t,y:n};default:return{x:0,y:0}}}(t.corner,r,a);let h;if("rotate"===n.motion)h=t.phase,t.phase+=.01*n.speed;else{h=Math.atan2(c-o,l-s)+Math.sin(t.phase)*(n.sweepArc*Math.PI/180)/2,t.phase+=.02*n.speed}!function(e,t,s,i,o,r,a,l){const c=1.5*Math.hypot(r,a),h=n.beamWidth*Math.PI/180/2;for(let r=0;r<p.length;r++){const a=p[r],d=h*a.widthMul,u=n.intensity*a.alphaMul*l;if(u<=.003)continue;const m=t+Math.cos(i-d)*c,f=s+Math.sin(i-d)*c,_=t+Math.cos(i+d)*c,g=s+Math.sin(i+d)*c,v=e.createRadialGradient(t,s,0,t,s,c);v.addColorStop(0,xl(o,u)),v.addColorStop(.4,xl(o,.4*u)),v.addColorStop(1,xl(o,0)),e.fillStyle=v,e.beginPath(),e.moveTo(t,s),e.lineTo(m,f),e.lineTo(_,g),e.closePath(),e.fill()}}(i,s,o,h,t.colour,r,a,e)}),i.globalCompositeOperation="source-over"}),a=requestAnimationFrame(_)}function g(){o||(o=!0,r=!1,_(),n.duration&&(l=setTimeout(()=>v.stop(),n.duration)))}const v={pause(){o&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){o&&r&&(r=!1,_())},stop(){o=!1,r=!1,a&&(cancelAnimationFrame(a),a=null),l&&(clearTimeout(l),l=null),h.forEach(({canvas:e,ctx:t})=>t&&t.clearRect(0,0,e.width,e.height))},restart(){this.stop(),h.forEach(e=>{e.beams=u()}),g()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>o&&!r,isPaused:()=>o&&r};return g(),console.log(`[Domma.effects.strobe] Initialised (${s?"full-page":"container"} mode, preset: ${n.preset})`),v}};const El={_configs:new Map,_components:new Map,_eventHandlers:new Map,_initCallbacks:[],_domReady:!1,_autoWrap:!0,process(e,t={}){if(!e||"object"!=typeof e)return;(void 0!==t.autoWrap?t.autoWrap:this._autoWrap)&&!this._domReady&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,this._processConfig(e)},{once:!0}):this._processConfig(e)},_processConfig(e){e.$init&&"function"==typeof e.$init&&(this._initCallbacks.push(e.$init),e.$init(),delete e.$init),Object.keys(e).forEach(t=>{const n=e[t];if(this._configs.set(t,y.cloneDeep(n)),n.init&&"function"==typeof n.init){const e=_(t);n.init.call(e,e)}const s=_(t);if(n.component){const e=this.initComponent(t,n.component,n.options||{});e&&this._components.set(t,e)}n.initial&&this.applyProperties(s,n.initial),n.events&&this.bindEvents(t,n.events,!0)})},update(e,t){const n=this._configs.get(e);if(!n)return this.process({[e]:t}),this._configs.get(e);const s=y.merge({},n,t);this._configs.set(e,s);const i=_(e);if(t.options&&this._components.has(e)){const n=this._components.get(e);n&&"function"==typeof n.setOptions&&n.setOptions(t.options)}return t.initial&&this.applyProperties(i,t.initial),t.events&&this.updateEvents(e,t.events),s},config(e){if(!e){const e={};return this._configs.forEach((t,n)=>{e[n]=t}),e}return this._configs.get(e)||null},getComponent(e){return e?this._components.get(e)||null:new Map(this._components)},reset(e){if(!e){return void Array.from(this._configs.keys()).forEach(e=>this.reset(e))}const t=this._components.get(e);t&&"function"==typeof t.destroy&&t.destroy(),this._components.delete(e),this.unbindEvents(e),this._configs.delete(e)},initComponent(e,t,n){const s={card:ci.card,modal:ci.modal,tabs:ci.tabs,accordion:ci.accordion,tooltip:ci.tooltip,carousel:ci.carousel,dropdown:ci.dropdown,contextMenu:ci.contextMenu,sortable:ci.sortable,skeleton:ci.skeleton,avatar:ci.avatar,avatarGroup:ci.avatarGroup,inputGroup:ci.inputGroup,popover:ci.popover,badge:ci.badge,numberBadge:ci.numberBadge,listGroup:ci.listGroup,cookieConsent:ci.cookieConsent,backToTop:ci.backToTop,buttonGroup:ci.buttonGroup,loader:ci.loader,breadcrumbs:ci.breadcrumbs,navbar:ci.navbar,sidebar:ci.sidebar,footer:ci.footer,notification:ci.notification,timer:ci.timer,alarm:ci.alarm,autocomplete:ci.autocomplete,pillbox:ci.pillbox,signature:ci.signature,form:fl.create,breathe:Al.breathe,pulse:Al.pulse,scribe:Al.scribe}[t];if(s){if("form"===t){if(!n.schema)return console.error("Forms component requires a schema option"),null;const t=s(n.schema,n.data||{},n);return t.renderTo(e),t}return s.call(ci,e,n)}console.warn(`Unknown component type: ${t}`)},applyProperties(e,t){Object.keys(t).forEach(n=>{"css"===n?e.css(t[n]):"text"===n?e.text(t[n]):"html"===n?e.html(t[n]):"addClass"===n?e.addClass(t[n]):"removeClass"===n?e.removeClass(t[n]):"toggleClass"===n?e.toggleClass(t[n]):"attr"===n&&Object.keys(t[n]).forEach(s=>{e.attr(s,t[n][s])})})},bindEvents(e,t,n=!1){const s=_(e);n&&!this._eventHandlers.has(e)&&this._eventHandlers.set(e,new Map),Object.keys(t).forEach(i=>{const o=t[i],r=e=>this.executeActions(e,o);s.on(i,r),n&&this._eventHandlers.get(e).set(i,r)})},unbindEvents(e){const t=this._eventHandlers.get(e);if(!t)return;const n=_(e);t.forEach((e,t)=>{n.off(t,e)}),this._eventHandlers.delete(e)},updateEvents(e,t){const n=this._eventHandlers.get(e),s=_(e);n&&Object.keys(t).forEach(e=>{n.has(e)&&(s.off(e,n.get(e)),n.delete(e))}),this.bindEvents(e,t,!0)},executeActions(e,t){if("function"==typeof t)return void t.call(e.target,e,_(e.target));const n=Array.isArray(t)?t:[t],s=_(e.target);n.forEach(t=>{if("function"==typeof t)return void t.call(e.target,e,s);const n=t.target?_(t.target):s;t.css&&n.css(t.css),t.text&&n.text(t.text),t.html&&n.html(t.html),t.addClass&&n.addClass(t.addClass),t.removeClass&&n.removeClass(t.removeClass),t.toggleClass&&n.toggleClass(t.toggleClass),t.log&&console.log(t.log)})},ready(e){"function"==typeof e?this._domReady||"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,e()},{once:!0}):console.warn("ready() requires a function")}},Sl=1e3,$l=6e4,zl=36e5,Tl=864e5,Bl=6048e5,jl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ol=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Dl=["January","February","March","April","May","June","July","August","September","October","November","December"],Nl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];class Il{constructor(e){e instanceof Il?this._date=new Date(e._date):e instanceof Date?this._date=new Date(e):this._date="string"==typeof e||"number"==typeof e?new Date(e):null==e?new Date:new Date(e)}add(e,t){const n=this._normalizeUnit(t),s=this._date;return"years"===n?s.setFullYear(s.getFullYear()+e):"months"===n?s.setMonth(s.getMonth()+e):"weeks"===n?s.setDate(s.getDate()+7*e):"days"===n?s.setDate(s.getDate()+e):"hours"===n?s.setHours(s.getHours()+e):"minutes"===n?s.setMinutes(s.getMinutes()+e):"seconds"===n?s.setSeconds(s.getSeconds()+e):"milliseconds"===n&&s.setMilliseconds(s.getMilliseconds()+e),this}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(0,1),n.setHours(0,0,0,0)):"months"===t||"month"===t?(n.setDate(1),n.setHours(0,0,0,0)):"weeks"===t||"week"===t?(n.setDate(n.getDate()-n.getDay()),n.setHours(0,0,0,0)):"days"===t||"day"===t?n.setHours(0,0,0,0):"hours"===t||"hour"===t?n.setMinutes(0,0,0):"minutes"===t||"minute"===t?n.setSeconds(0,0):"seconds"!==t&&"second"!==t||n.setMilliseconds(0),this}endOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(11,31),n.setHours(23,59,59,999)):"months"===t||"month"===t?(n.setMonth(n.getMonth()+1,0),n.setHours(23,59,59,999)):"weeks"===t||"week"===t?(n.setDate(n.getDate()+(6-n.getDay())),n.setHours(23,59,59,999)):"days"===t||"day"===t?n.setHours(23,59,59,999):"hours"===t||"hour"===t?n.setMinutes(59,59,999):"minutes"===t||"minute"===t?n.setSeconds(59,999):"seconds"!==t&&"second"!==t||n.setMilliseconds(999),this}set(e,t){const n=this._normalizeUnit(e),s=this._date;return"years"===n||"year"===n?s.setFullYear(t):"months"===n||"month"===n?s.setMonth(t):"days"===n||"day"===n||"date"===n?s.setDate(t):"hours"===n||"hour"===n?s.setHours(t):"minutes"===n||"minute"===n?s.setMinutes(t):"seconds"===n||"second"===n?s.setSeconds(t):"milliseconds"!==n&&"millisecond"!==n||s.setMilliseconds(t),this}get(e){if(!e)return this._date;const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?n.getFullYear():"months"===t||"month"===t?n.getMonth():"days"===t||"day"===t?n.getDay():"date"===t?n.getDate():"hours"===t||"hour"===t?n.getHours():"minutes"===t||"minute"===t?n.getMinutes():"seconds"===t||"second"===t?n.getSeconds():"milliseconds"===t||"millisecond"===t?n.getMilliseconds():this._date}year(){return this._date.getFullYear()}month(){return this._date.getMonth()}date(){return this._date.getDate()}day(){return this._date.getDay()}hour(){return this._date.getHours()}minute(){return this._date.getMinutes()}second(){return this._date.getSeconds()}millisecond(){return this._date.getMilliseconds()}dayOfYear(){const e=new Date(this._date.getFullYear(),0,0),t=this._date-e;return Math.floor(t/864e5)}week(){const e=new Date(this._date.getFullYear(),0,1),t=this._date-e;return Math.ceil(t/6048e5+e.getDay()/7)}quarter(){return Math.floor(this._date.getMonth()/3)+1}unix(){return Math.floor(this._date.getTime()/1e3)}valueOf(){return this._date.getTime()}format(e="YYYY-MM-DD HH:mm:ss"){const t=this._date,n=t.getFullYear(),s=t.getMonth(),i=t.getDate(),o=t.getDay(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),c=t.getMilliseconds(),h=r%12||12,d=(e,t=2)=>String(e).padStart(t,"0"),u={YYYY:n,YY:String(n).slice(-2),MMMM:Dl[s],MMM:Nl[s],MM:d(s+1),M:s+1,dddd:jl[o],ddd:Ol[o],DD:d(i),D:i,HH:d(r),H:r,hh:d(h),h:h,mm:d(a),m:a,ss:d(l),s:l,SSS:d(c,3),A:r<12?"AM":"PM",a:r<12?"am":"pm"},p=Object.keys(u).sort((e,t)=>t.length-e.length),m=new RegExp(p.join("|"),"g");return e.replace(m,e=>u[e])}toISOString(){return this._date.toISOString()}toDate(){return new Date(this._date)}toString(){return this._date.toString()}fromNow(e){const t=e?new Il(e)._date:new Date,n=this._date.getTime()-t.getTime(),s=Math.abs(n),i=n<0;let o,r;return s<$l?"just now":(s<zl?(o=Math.floor(s/$l),r=1===o?"minute":"minutes"):s<Tl?(o=Math.floor(s/zl),r=1===o?"hour":"hours"):s<Bl?(o=Math.floor(s/Tl),r=1===o?"day":"days"):s<30*Tl?(o=Math.floor(s/Bl),r=1===o?"week":"weeks"):s<365*Tl?(o=Math.floor(s/(30*Tl)),r=1===o?"month":"months"):(o=Math.floor(s/(365*Tl)),r=1===o?"year":"years"),i?`${o} ${r} ago`:`in ${o} ${r}`)}to(e){const t=new Il(e)._date.getTime()-this._date.getTime(),n=Math.abs(t),s=t>0;let i,o;return n<$l?"just now":(n<zl?(i=Math.floor(n/$l),o=1===i?"minute":"minutes"):n<Tl?(i=Math.floor(n/zl),o=1===i?"hour":"hours"):n<Bl?(i=Math.floor(n/Tl),o=1===i?"day":"days"):n<30*Tl?(i=Math.floor(n/Bl),o=1===i?"week":"weeks"):n<365*Tl?(i=Math.floor(n/(30*Tl)),o=1===i?"month":"months"):(i=Math.floor(n/(365*Tl)),o=1===i?"year":"years"),s?`in ${i} ${o}`:`${i} ${o} ago`)}isBefore(e,t){const n=new Il(e);return t?this.clone().endOf(t).valueOf()<n.clone().startOf(t).valueOf():this._date.getTime()<n._date.getTime()}isAfter(e,t){const n=new Il(e);return t?this.clone().startOf(t).valueOf()>n.clone().endOf(t).valueOf():this._date.getTime()>n._date.getTime()}isSame(e,t){const n=new Il(e);if(!t)return this._date.getTime()===n._date.getTime();const s=this.clone().startOf(t).valueOf(),i=this.clone().endOf(t).valueOf(),o=n.valueOf();return o>=s&&o<=i}isBetween(e,t,n,s="()"){const i=new Il(e),o=new Il(t);let r,a,l;n?(r=i.clone().startOf(n).valueOf(),a=o.clone().endOf(n).valueOf(),l=this.clone().startOf(n).valueOf()):(r=i.valueOf(),a=o.valueOf(),l=this.valueOf());const c="["===s[0],h="]"===s[1];return(c?l>=r:l>r)&&(h?l<=a:l<a)}diff(e,t="milliseconds",n=!1){const s=new Il(e),i=this._date.getTime()-s._date.getTime(),o=this._normalizeUnit(t);let r;return r="milliseconds"===o?i:"seconds"===o?i/Sl:"minutes"===o?i/$l:"hours"===o?i/zl:"days"===o?i/Tl:"weeks"===o?i/Bl:"months"===o?this._monthDiff(s):"years"===o?this._monthDiff(s)/12:i,n?r:Math.floor(r)}_monthDiff(e){const t=this._date,n=e._date;return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())}isValid(){return!isNaN(this._date.getTime())}isLeapYear(){const e=this._date.getFullYear();return e%4==0&&e%100!=0||e%400==0}daysInMonth(){return new Date(this._date.getFullYear(),this._date.getMonth()+1,0).getDate()}clone(){return new Il(this._date)}_normalizeUnit(e){if(!e)return e;const t=String(e).toLowerCase().trim();return"year"===t?"years":"month"===t?"months":"week"===t?"weeks":"day"===t?"days":"hour"===t?"hours":"minute"===t?"minutes":"second"===t?"seconds":"millisecond"===t?"milliseconds":t}}const Hl=function(e){return new Il(e)};Object.assign(Hl,{now:()=>Date.now(),parse(e,t){if(!t)return new Il(e);const n={YYYY:{regex:"(\\d{4})",setter:"year"},YY:{regex:"(\\d{2})",setter:"year",transform:e=>2e3+parseInt(e)},MM:{regex:"(\\d{2})",setter:"month",transform:e=>parseInt(e)-1},M:{regex:"(\\d{1,2})",setter:"month",transform:e=>parseInt(e)-1},DD:{regex:"(\\d{2})",setter:"date"},D:{regex:"(\\d{1,2})",setter:"date"},HH:{regex:"(\\d{2})",setter:"hour"},H:{regex:"(\\d{1,2})",setter:"hour"},mm:{regex:"(\\d{2})",setter:"minute"},m:{regex:"(\\d{1,2})",setter:"minute"},ss:{regex:"(\\d{2})",setter:"second"},s:{regex:"(\\d{1,2})",setter:"second"}};let s=t;const i=[],o=Object.keys(n).sort((e,t)=>t.length-e.length);for(const e of o)if(t.includes(e)){-1!==s.indexOf(e)&&(s=s.replace(e,n[e].regex),i.push({token:e,...n[e]}))}s=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,e=>"("===e||")"===e?e:"\\"+e);try{const t=new RegExp("^"+s+"$"),n=e.match(t);if(!n)return new Il(NaN);const o=new Il;o.set("hour",0).set("minute",0).set("second",0).set("millisecond",0);for(let e=0;e<i.length;e++){let t=parseInt(n[e+1]);i[e].transform&&(t=i[e].transform(n[e+1])),o.set(i[e].setter,t)}return o}catch(e){return new Il(NaN)}},isValid:e=>new Il(e).isValid(),min(...e){const t=e.flat().map(e=>new Il(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()<n.valueOf()&&(n=t[e]);return n},max(...e){const t=e.flat().map(e=>new Il(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()>n.valueOf()&&(n=t[e]);return n},tokens:{YYYY:"Full year (2025)",YY:"Short year (25)",MM:"Month 01-12",M:"Month 1-12",DD:"Day 01-31",D:"Day 1-31",HH:"Hour 00-23",H:"Hour 0-23",hh:"Hour 01-12",h:"Hour 1-12",mm:"Minute 00-59",m:"Minute 0-59",ss:"Second 00-59",s:"Second 0-59",SSS:"Milliseconds",A:"AM/PM",a:"am/pm",ddd:"Day name short (Mon)",dddd:"Day name full (Monday)",MMM:"Month name short (Jan)",MMMM:"Month name full (January)"}});const Wl={"arrow-up":{viewBox:"0 0 24 24",path:"M12 19V5M5 12l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down":{viewBox:"0 0 24 24",path:"M12 5v14M19 12l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-left":{viewBox:"0 0 24 24",path:"M19 12H5M12 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-right":{viewBox:"0 0 24 24",path:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-left":{viewBox:"0 0 24 24",path:"M17 17L7 7M7 17V7h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-right":{viewBox:"0 0 24 24",path:"M7 17L17 7M7 7h10v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-left":{viewBox:"0 0 24 24",path:"M17 7L7 17M17 17H7V7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-right":{viewBox:"0 0 24 24",path:"M7 7l10 10M17 7v10H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},menu:{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h18","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"menu-alt":{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h12","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"dots-horizontal":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},"dots-vertical":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},grid:{viewBox:"0 0 24 24",path:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},list:{viewBox:"0 0 24 24",paths:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},columns:{viewBox:"0 0 24 24",path:"M12 3v18M3 3h18v18H3V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zM9 21V9m12-6H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},close:{viewBox:"0 0 24 24",path:"M18 6L6 18M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plus:{viewBox:"0 0 24 24",path:"M12 5v14M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minus:{viewBox:"0 0 24 24",path:"M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},search:{viewBox:"0 0 24 24",path:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},refresh:{viewBox:"0 0 24 24",path:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},edit:{viewBox:"0 0 24 24",path:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-2":{viewBox:"0 0 24 24",path:"M17 3a2.85 2.85 0 114 4L7.5 20.5 2 22l1.5-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-3":{viewBox:"0 0 24 24",path:"M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trash:{viewBox:"0 0 24 24",path:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filter:{viewBox:"0 0 24 24",path:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sort:{viewBox:"0 0 24 24",paths:["M3 6h7","M3 12h5","M3 18h3","M16 6l4 4-4 4","M20 10H10"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},user:{viewBox:"0 0 24 24",path:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},users:{viewBox:"0 0 24 24",path:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},settings:{viewBox:"0 0 24 24",path:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM15 12a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cog:{viewBox:"0 0 24 24",path:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tool:{viewBox:"0 0 24 24",path:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eye:{viewBox:"0 0 24 24",path:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-off":{viewBox:"0 0 24 24",path:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lock:{viewBox:"0 0 24 24",path:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlock:{viewBox:"0 0 24 24",path:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clock:{viewBox:"0 0 24 24",path:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calendar:{viewBox:"0 0 24 24",path:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},star:{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-filled":{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",fill:"currentColor"},sun:{viewBox:"0 0 24 24",path:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},globe:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},map:{viewBox:"0 0 24 24",path:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pin:{viewBox:"0 0 24 24",path:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},feather:{viewBox:"0 0 24 24",path:"M20.24 12.24a6 6 0 00-8.49-8.49L5 10.5V19h8.5zM16 8L2 22M17.5 15H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},palette:{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c.93 0 1.68-.75 1.68-1.68 0-.43-.16-.84-.44-1.13-.27-.29-.43-.7-.43-1.13 0-.93.76-1.69 1.69-1.69h1.98c3.03 0 5.52-2.49 5.52-5.52C22 6.48 17.52 2 12 2zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z",fill:"currentColor"},type:{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},square:{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mouse-pointer":{viewBox:"0 0 24 24",path:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z M13 13l6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"refresh-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sync:{viewBox:"0 0 24 24",path:"M1 4v6h6m16 10v-6h-6M2 20l6-6M22 4l-6 6M9 12l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gauge:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 0110 10c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z M8 12l4 4 4-4M12 16V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"map-pin":{viewBox:"0 0 24 24",path:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"help-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sliders:{viewBox:"0 0 24 24",path:"M4 21v-7m0-4V3m8 18v-9m0-4V3m8 18v-5m0-4V3M1 14h6m2-6h6m2 8h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-check":{viewBox:"0 0 24 24",path:"M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2m16-13l2 2 4-4M13 7a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},component:{viewBox:"0 0 24 24",path:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16zM3.27 6.96L12 12.01l8.73-5.05M12 22.08V12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 9.8a19.79 19.79 0 01-3.07-8.64A2 2 0 012 .18h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 14v2.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mail:{viewBox:"0 0 24 24",path:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z M22 6l-10 7L2 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2z M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},building:{viewBox:"0 0 24 24",path:"M3 21h18 M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16 M9 9h2 M9 13h2 M9 17h2 M13 9h2 M13 13h2 M13 17h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-2":{viewBox:"0 0 24 24",path:"M15 7h3a5 5 0 015 5 5 5 0 01-5 5h-3m-6 0H6a5 5 0 01-5-5 5 5 0 015-5h3 M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 11-8 0 4 4 0 018 0z M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cake:{viewBox:"0 0 24 24",path:"M20 21H4a2 2 0 01-2-2v-4a2 2 0 012-2h16a2 2 0 012 2v4a2 2 0 01-2 2z M8 13V9 M12 13V9 M16 13V9 M8 9a1 1 0 010-2 1 1 0 010 2z M12 9a1 1 0 010-2 1 1 0 010 2z M16 9a1 1 0 010-2 1 1 0 010 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sidebar:{viewBox:"0 0 24 24",path:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z M9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},window:{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2z M2 9h20 M5.5 6.5h.01 M8 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Pl={mail:{viewBox:"0 0 24 24",path:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mail-open":{viewBox:"0 0 24 24",path:"M3 19V9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2z M3 9l9 6 9-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},inbox:{viewBox:"0 0 24 24",path:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},send:{viewBox:"0 0 24 24",path:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-incoming":{viewBox:"0 0 24 24",path:"M14.5 2v6m0 0h6m-6 0l7-7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-outgoing":{viewBox:"0 0 24 24",path:"M21.5 2h-6m6 0v6m0-6l-7 7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M16.5 10.5l5.5-5.5M22 5l-5.5 5.5M10.68 13.31a16 16 0 003.41 2.6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7 2 2 0 011.72 2v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},chat:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chat-alt":{viewBox:"0 0 24 24",path:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-circle":{viewBox:"0 0 24 24",path:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-square":{viewBox:"0 0 24 24",path:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bell:{viewBox:"0 0 24 24",path:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bell-off":{viewBox:"0 0 24 24",path:"M13.73 21a2 2 0 01-3.46 0M18.63 13A17.89 17.89 0 0118 8M6.26 6.26A5.86 5.86 0 006 8c0 7-3 9-3 9h14M18 8a6 6 0 00-9.33-5M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},notification:{viewBox:"0 0 24 24",path:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z",fill:"currentColor"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},paperclip:{viewBox:"0 0 24 24",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rss:{viewBox:"0 0 24 24",path:"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0116 16M5 20a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wifi:{viewBox:"0 0 24 24",path:"M12 20h.01M2 8.82a15 15 0 0120 0M5 12.859a10 10 0 0114 0M8.5 16.429a5 5 0 017 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"wifi-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0119 12.55M5 12.55a10.94 10.94 0 015.17-2.39m3.64.46a10.88 10.88 0 012.69 1.92M8.5 16.429a5 5 0 013.5-1.43M12 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Fl={play:{viewBox:"0 0 24 24",path:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-filled":{viewBox:"0 0 24 24",path:"M5 3l14 9-14 9V3z",fill:"currentColor"},pause:{viewBox:"0 0 24 24",path:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pause-filled":{viewBox:"0 0 24 24",paths:["M6 4h4v16H6z","M14 4h4v16h-4z"],fill:"currentColor"},stop:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"stop-filled":{viewBox:"0 0 24 24",path:"M6 6h12v12H6z",fill:"currentColor"},"skip-back":{viewBox:"0 0 24 24",path:"M19 20L9 12l10-8v16zM5 19V5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"skip-forward":{viewBox:"0 0 24 24",path:"M5 4l10 8-10 8V4zM19 5v14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rewind:{viewBox:"0 0 24 24",path:"M11 19l-7-7 7-7m8 14l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"fast-forward":{viewBox:"0 0 24 24",path:"M13 5l7 7-7 7M5 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volume:{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-up":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-down":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-mute":{viewBox:"0 0 24 24",path:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-off":{viewBox:"0 0 24 24",path:"M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"camera-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M21 21H3a2 2 0 01-2-2V8a2 2 0 012-2h3m3-3h6l2 3h4a2 2 0 012 2v9.34m-7.72-2.06a4 4 0 11-5.56-5.56",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},video:{viewBox:"0 0 24 24",path:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"video-off":{viewBox:"0 0 24 24",path:"M16 16v1a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h2m5.66 0H14a2 2 0 012 2v3.34l1 1L23 7v10M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},image:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},images:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z M9 3h12a2 2 0 012 2v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},music:{viewBox:"0 0 24 24",path:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mic:{viewBox:"0 0 24 24",path:"M19 10v2a7 7 0 01-14 0v-2m7 9v4m-4 0h8m-4-13a3 3 0 00-3 3v4a3 3 0 006 0v-4a3 3 0 00-3-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mic-off":{viewBox:"0 0 24 24",path:"M1 1l22 22m-2-2a10 10 0 01-11 2.955M12 19v4m-4 0h8M9 9v3a3 3 0 005.12 2.12M15 9.34V4a3 3 0 00-5.94-.6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0118 0v6M21 19a2 2 0 01-2 2h-1a2 2 0 01-2-2v-3a2 2 0 012-2h3zM3 19a2 2 0 002 2h1a2 2 0 002-2v-3a2 2 0 00-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},radio:{viewBox:"0 0 24 24",path:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0 M16.24 7.76a6 6 0 010 8.49m-8.48-.01a6 6 0 010-8.49m11.31-2.82a10 10 0 010 14.14m-14.14 0a10 10 0 010-14.14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},film:{viewBox:"0 0 24 24",path:"M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM17 3l-5 4-5-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cast:{viewBox:"0 0 24 24",path:"M2 16.1A5 5 0 015.9 20M2 12.05A9 9 0 019.95 20M2 8V6a2 2 0 012-2h16a2 2 0 012 2v12a2 2 0 01-2 2h-6M2 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximise:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimise:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximize:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimize:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximise-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimise-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximize-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimize-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scissors:{viewBox:"0 0 24 24",path:"M6 9a3 3 0 100-6 3 3 0 000 6zM6 21a3 3 0 100-6 3 3 0 000 6zM20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M10 8l6 4-6 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Rl={document:{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-text":{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z M14 2v6h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-remove":{viewBox:"0 0 24 24",path:"M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m2 11H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},folder:{viewBox:"0 0 24 24",path:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-open":{viewBox:"0 0 24 24",path:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h6a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-remove":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},download:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},upload:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-download":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-upload":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M8 19c-3.314 0-6-2.462-6-5.5S4.686 8 8 8c.642-2.87 3.251-5 6.375-5C18.086 3 21 5.91 21 9.5a6.458 6.458 0 01-.705 2.945A4.5 4.5 0 0119 21H8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},attachment:{viewBox:"0 0 24 24",path:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},copy:{viewBox:"0 0 24 24",path:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clipboard:{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-check":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-list":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},save:{viewBox:"0 0 24 24",path:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},archive:{viewBox:"0 0 24 24",path:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-code":{viewBox:"0 0 24 24",path:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-zip":{viewBox:"0 0 24 24",path:"M17 21H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2zM10 3v4h1V3h-1zm1 4h-1v2h1V7zm-1 2v2h1V9h-1zm1 2h-1v2h1v-2zm-1 2v2h1v-2h-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},server:{viewBox:"0 0 24 24",path:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-text":{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zM14 2v6h6M16 13H8M16 17H8M10 9H8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},book:{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-open":{viewBox:"0 0 24 24",path:"M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2V3zM22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-closed":{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-plus":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-minus":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Vl={share:{viewBox:"0 0 24 24",path:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"share-alt":{viewBox:"0 0 24 24",path:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",fill:"currentColor"},bookmark:{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bookmark-filled":{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",fill:"currentColor"},"thumb-up":{viewBox:"0 0 24 24",path:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thumb-down":{viewBox:"0 0 24 24",path:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},comment:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-add":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-plus":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-remove":{viewBox:"0 0 24 24",path:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-group":{viewBox:"0 0 24 24",path:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-happy":{viewBox:"0 0 24 24",path:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-sad":{viewBox:"0 0 24 24",path:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},flag:{viewBox:"0 0 24 24",path:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M12 15V17M8 21H16M8 3H16V9C16 11.2091 14.2091 13 12 13C9.79086 13 8 11.2091 8 9V3ZM16 5H18C19.1046 5 20 5.89543 20 7V8C20 9.10457 19.1046 10 18 10H16M8 5H6C4.89543 5 4 5.89543 4 7V8C4 9.10457 4.89543 10 6 10H8M12 17V21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",path:"M12 8V21M12 8H8.464C7.103 8 6 6.897 6 5.536C6 4.175 7.103 3 8.464 3C10.059 3 11.162 4.162 12 5.536M12 8H15.536C16.897 8 18 6.897 18 5.536C18 4.175 16.897 3 15.536 3C13.941 3 12.838 4.162 12 5.536M20 12V21H4V12M3 8H21V12H3V8Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sparkles:{viewBox:"0 0 24 24",path:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fire:{viewBox:"0 0 24 24",path:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z M9.879 16.121A3 3 0 1012.015 11L11 14H9c0 .768.293 1.536.879 2.121z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},github:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"},twitter:{viewBox:"0 0 24 24",path:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",fill:"currentColor"},linkedin:{viewBox:"0 0 24 24",path:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",fill:"currentColor"},youtube:{viewBox:"0 0 24 24",path:"M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",fill:"currentColor"},"share-2":{viewBox:"0 0 24 24",path:"M18 8a3 3 0 100-6 3 3 0 000 6zM6 15a3 3 0 100-6 3 3 0 000 6zM18 22a3 3 0 100-6 3 3 0 000 6zM8.59 13.51l6.83 3.98M15.41 6.51l-6.82 3.98",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},facebook:{viewBox:"0 0 24 24",path:"M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},instagram:{viewBox:"0 0 24 24",path:"M2 7a5 5 0 015-5h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5zM16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zM17.5 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ql={cart:{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cart-add":{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0zm6-8v-2m0 0V7m0 2h2m-2 0H11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-bag":{viewBox:"0 0 24 24",path:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M3 3h18v4H3V3zM3 7v12a2 2 0 002 2h14a2 2 0 002-2V7M3 11h18M12 7v14M8 11v10M16 11v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2m-5-3h9m0 0l-3-3m3 3l-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cash:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-dollar":{viewBox:"0 0 24 24",path:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-pound":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h6a3 3 0 003-3M9 12h6M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-euro":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h3a3 3 0 003-3M7 10h5m-5 4h5M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tag:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tags:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z M17 17l4.414-4.414a2 2 0 000-2.828L14 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M9 14l6 0M9 10l6 0M9 18l3 0M5 21l1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2V3l-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2v18z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barcode:{viewBox:"0 0 24 24",path:"M5 7v10M8 7v10M11 7v10M14 7v10M19 7v10M17 7v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},qrcode:{viewBox:"0 0 24 24",path:"M3 3h6v6H3V3zM15 3h6v6h-6V3zM3 15h6v6H3v-6zM15 15h2v2h-2v-2zM19 15h2v2h-2v-2zM15 19h2v2h-2v-2zM19 19h2v2h-2v-2zM5 5h2v2H5V5zM17 5h2v2h-2V5zM5 17h2v2H5v-2zM12 3h1v4h-1V3zM12 9h1v3h-1V9zM3 12h4v1H3v-1zM9 12h3v1H9v-1zM12 14h1v3h-1v-3zM12 19h1v2h-1v-2z",fill:"currentColor"},percent:{viewBox:"0 0 24 24",path:"M9 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM15 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM19 5L5 19",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},package:{viewBox:"0 0 24 24",path:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4M9 4l3 1.5L15 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},box:{viewBox:"0 0 24 24",path:"M12 3L2 8.5V15.5L12 21L22 15.5V8.5L12 3ZM12 12V21M12 12L2 7M12 12L22 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shipping:{viewBox:"0 0 24 24",path:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2M4 7V4h16v3M4 7h16M8 4v3M16 4v3M12 11v4m-2-2h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zM8 6h8v4H8V6zM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gem:{viewBox:"0 0 24 24",path:"M6 3h12l4 6-10 12L2 9l4-6z M11 3L8 9l4 12 4-12-3-6 M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-cart":{viewBox:"0 0 24 24",path:"M9 22a1 1 0 100-2 1 1 0 000 2z M20 22a1 1 0 100-2 1 1 0 000 2z M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ul={check:{viewBox:"0 0 24 24",path:"M5 13l4 4L19 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"},"check-square":{viewBox:"0 0 24 24",path:"M9 11l3 3L22 4M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},x:{viewBox:"0 0 24 24",path:"M6 18L18 6M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",fill:"currentColor"},warning:{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"warning-filled":{viewBox:"0 0 24 24",path:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z",fill:"currentColor"},"alert-warning":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},info:{viewBox:"0 0 24 24",path:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"info-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z",fill:"currentColor"},question:{viewBox:"0 0 24 24",path:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},exclamation:{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-circle":{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ban:{viewBox:"0 0 24 24",path:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shield:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-x":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m5.618-6.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},spinner:{viewBox:"0 0 24 24",path:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-5.364l-2.828 2.828M9.464 14.536l-2.828 2.828m11.728 0l-2.828-2.828M9.464 9.464L6.636 6.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},loading:{viewBox:"0 0 24 24",path:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},loader:{viewBox:"0 0 24 24",path:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},circle:{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"circle-filled":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",fill:"currentColor"},dot:{viewBox:"0 0 24 24",path:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",fill:"currentColor"},badge:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zap:{viewBox:"0 0 24 24",path:"M13 10V3L4 14h7v7l9-11h-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18M17 6h6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6M17 18h6v-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},key:{viewBox:"0 0 24 24",path:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-alert":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-triangle":{viewBox:"0 0 24 24",path:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z M12 9v4 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Kl={"chevron-up":{viewBox:"0 0 24 24",path:"M5 15l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-down":{viewBox:"0 0 24 24",path:"M19 9l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-left":{viewBox:"0 0 24 24",path:"M15 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-right":{viewBox:"0 0 24 24",path:"M9 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-up":{viewBox:"0 0 24 24",path:"M17 11l-5-5-5 5M17 18l-5-5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-down":{viewBox:"0 0 24 24",path:"M7 13l5 5 5-5M7 6l5 5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-left":{viewBox:"0 0 24 24",path:"M11 17l-5-5 5-5M18 17l-5-5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-right":{viewBox:"0 0 24 24",path:"M13 7l5 5-5 5M6 7l5 5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"external-link":{viewBox:"0 0 24 24",path:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},link:{viewBox:"0 0 24 24",path:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlink:{viewBox:"0 0 24 24",path:"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 00-.12-7.07 5.006 5.006 0 00-6.95 0l-1.72 1.71M5.17 11.75l-1.71 1.71a5.004 5.004 0 00.12 7.07 5.006 5.006 0 006.95 0l1.71-1.71M8 2v3M2 8h3M16 22v-3M22 16h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-left":{viewBox:"0 0 24 24",path:"M9 14L4 9l5-5M20 20v-7a4 4 0 00-4-4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-right":{viewBox:"0 0 24 24",path:"M15 14l5-5-5-5M4 20v-7a4 4 0 014-4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-left":{viewBox:"0 0 24 24",path:"M9 10L4 15l5 5M20 4v7a4 4 0 01-4 4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-right":{viewBox:"0 0 24 24",path:"M15 10l5 5-5 5M4 4v7a4 4 0 004 4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-ccw":{viewBox:"0 0 24 24",path:"M1 4v6h6M23 20v-6h-6M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M3 13l4.64-4.36A9 9 0 0121 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M21 13l-4.64-4.36A9 9 0 003 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},move:{viewBox:"0 0 24 24",path:"M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"grip-vertical":{viewBox:"0 0 24 24",paths:["M9 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},"grip-horizontal":{viewBox:"0 0 24 24",paths:["M5 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M5 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},expand:{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shrink:{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-in":{viewBox:"0 0 24 24",path:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-out":{viewBox:"0 0 24 24",path:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-left":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM9 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-right":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM15 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-left":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-right":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM15 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-top":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 9h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-bottom":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 15h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layers:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM2 9h20M9 20V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hash:{viewBox:"0 0 24 24",path:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"more-horizontal":{viewBox:"0 0 24 24",path:"M12 12h.01M8 12h.01M16 12h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"},"more-vertical":{viewBox:"0 0 24 24",path:"M12 12h.01M12 8h.01M12 16h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}},Yl={tree:{viewBox:"0 0 24 24",path:"M12 2l2 4h-1l2 4h-1.5l2.5 5h-2l3 6H7l3-6H8l2.5-5H9l2-4h-1l2-4zm-1 19h2v3h-2v-3z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"star-decoration":{viewBox:"0 0 24 24",path:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",paths:["M12 2v20M2 12h20","M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07","M12 6l-2 2 2 2 2-2-2-2zM12 14l-2 2 2 2 2-2-2-2z","M6 12l2-2-2-2-2 2 2 2zM14 12l2 2 2-2-2-2-2 2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",paths:["M20 12v10H4V12","M22 7H2v5h20V7z","M12 22V7","M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z","M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"candy-cane":{viewBox:"0 0 24 24",path:"M14.5 3a4.5 4.5 0 0 0-4.5 4.5v13a.5.5 0 0 0 1 0V7.5a3.5 3.5 0 1 1 7 0v1a2.5 2.5 0 0 1-5 0v-.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bauble:{viewBox:"0 0 24 24",paths:["M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M12 6V3","M9 3h6","M12 6a1 1 0 0 0 1-1V4a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},bells:{viewBox:"0 0 24 24",paths:["M9 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M15 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M7 8L5 4M17 8l2-4M9 8V5M15 8V5","M11 5h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},holly:{viewBox:"0 0 24 24",paths:["M8 4c-2 2-3 5-1 8 1 2 3 3 5 3s4-1 5-3c2-3 1-6-1-8","M16 4c2 2 3 5 1 8-1 2-3 3-5 3s-4-1-5-3c-2-3-1-6 1-8","M10 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M14 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M12 19a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowman:{viewBox:"0 0 24 24",paths:["M12 22a5 5 0 1 0 0-10 5 5 0 0 0 0 10z","M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M9 9h.01M15 9h.01","M10 10.5s.5 1 2 1 2-1 2-1","M7 2l3 3M17 2l-3 3M12 2v3","M5 15h2M17 15h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},reindeer:{viewBox:"0 0 24 24",paths:["M12 22c-3 0-5-2-5-5 0-2 1-4 3-5l2-1 2 1c2 1 3 3 3 5 0 3-2 5-5 5z","M7 12c-2-1-3-3-3-5 0-1 .5-2 1-2s1 .5 1.5 1c.5.5 1 1.5 1.5 2","M17 12c2-1 3-3 3-5 0-1-.5-2-1-2s-1 .5-1.5 1c-.5.5-1 1.5-1.5 2","M4 5l1 2M3 7l2 1M20 5l-1 2M21 7l-2 1","M10 17h.01M14 17h.01","M12 19a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},sleigh:{viewBox:"0 0 24 24",paths:["M4 15h14c1 0 2 1 2 2v1H4v-3z","M6 15V8c0-1 1-2 2-2h8c1 0 2 1 2 2v7","M2 20c0-1 2-2 4-2h12c2 0 4 1 4 2","M3 18h1M20 18h1"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},wreath:{viewBox:"0 0 24 24",paths:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 2v2M12 20v2M2 12h2M20 12h2","M10 3l1 2M13 3l-1 2","M10 3h4"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"party-popper":{viewBox:"0 0 24 24",paths:["M5.8 11.3 2 22l10.7-3.79","M4 3h.01","M22 8h.01","M15 2h.01","M22 20h.01","M22 2 19.79 7.3 16 8l3.79.79L22 14","M9.6 14.4 14 10","M22 13c-1.93 1.93-5.07 1.93-7 0","M11 8c1.93-1.93 1.93-5.07 0-7","M2 13c1.93 1.93 5.07 1.93 7 0"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}},Gl={sun:{viewBox:"0 0 24 24",path:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunrise:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 2v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M8 6l4-4 4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunset:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 9v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M16 5l-4 4-4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-sun":{viewBox:"0 0 24 24",path:"M12 2v2M4.93 4.93l1.41 1.41M2 12h2M19 12a4 4 0 0 0-4-4h-.35A5.5 5.5 0 0 0 4 11a5 5 0 0 0 0 10h11a4 4 0 0 0 4-5v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-off":{viewBox:"0 0 24 24",path:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rain:{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-rain":{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-drizzle":{viewBox:"0 0 24 24",path:"M8 19v2M8 13v2M16 19v2M16 13v2M12 21v2M12 15v2M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snow:{viewBox:"0 0 24 24",path:"M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25M8 16h.01M8 20h.01M12 18h.01M12 22h.01M16 16h.01M16 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",path:"M12 2v20M17.66 7l-11.32 10M20.54 12H3.46M17.66 17L6.34 7M12 2l3 3M12 2l-3 3M12 22l3-3M12 22l-3-3M2 12l3 3M2 12l3-3M22 12l-3 3M22 12l-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wind:{viewBox:"0 0 24 24",path:"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-lightning":{viewBox:"0 0 24 24",path:"M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9M13 11l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lightning:{viewBox:"0 0 24 24",path:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fog:{viewBox:"0 0 24 24",path:"M20 15h2M2 15h8M6 19h14M4 11h16M8 7h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},haze:{viewBox:"0 0 24 24",path:"M12 3v1M12 20v1M3 12h1M20 12h1M5.6 5.6l.7.7M17.7 17.7l.7.7M5.6 18.4l.7-.7M17.7 6.3l.7-.7M8 12a4 4 0 1 0 8 0 4 4 0 0 0-8 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thermometer:{viewBox:"0 0 24 24",path:"M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-sun":{viewBox:"0 0 24 24",path:"M12 9a4 4 0 0 0-2 7.5M12 3v2M5.6 5.6l1.4 1.4M3 12h2M5.6 18.4l1.4-1.4M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 10V3M16 14.76V8a2 2 0 0 0-4 0v6.76",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"moon-star":{viewBox:"0 0 24 24",path:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9zM19 3v4M17 5h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},umbrella:{viewBox:"0 0 24 24",path:"M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplet:{viewBox:"0 0 24 24",path:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplets:{viewBox:"0 0 24 24",path:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05zM12.56 14.94c1.47 0 2.67-1.25 2.67-2.77 0-.8-.38-1.55-1.14-2.18-.76-.64-1.17-1.32-1.38-2.29-.21.97-.62 1.65-1.38 2.29-.76.63-1.14 1.38-1.14 2.18 0 1.52 1.19 2.77 2.67 2.77zM19.5 17.35c1.1 0 2-.93 2-2.08 0-.6-.29-1.17-.86-1.64-.57-.48-.88-1-.57-1.73-.31.73-.62 1.25-1.19 1.73-.57.47-.86 1.04-.86 1.64 0 1.15.9 2.08 2 2.08z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rainbow:{viewBox:"0 0 24 24",path:"M22 17a10 10 0 0 0-20 0M18 17a6 6 0 0 0-12 0M14 17a2 2 0 0 0-4 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Jl={smartphone:{viewBox:"0 0 24 24",path:"M17 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-call":{viewBox:"0 0 24 24",path:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91M23 1L1 23",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tablet:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tablet-smartphone":{viewBox:"0 0 24 24",path:"M18 2H10a2 2 0 0 0-2 2v4M14 22h4a2 2 0 0 0 2-2V8M8 14H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM7 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laptop:{viewBox:"0 0 24 24",path:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0l1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monitor:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},desktop:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4M2 12h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM17 2l-5 5-5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tv-minimal":{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},watch:{viewBox:"0 0 24 24",path:"M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM12 9v3l1.5 1.5M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},smartwatch:{viewBox:"0 0 24 24",path:"M18 8a6 6 0 0 0-12 0v8a6 6 0 0 0 12 0V8zM12 11v3M18 6l1-3H5l1 3M18 18l1 3H5l1-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},speaker:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM12 6h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0 1 18 0v6M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airpods:{viewBox:"0 0 24 24",path:"M5.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 5.5 4zM18.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 18.5 4zM5.5 14v6M18.5 14v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},webcam:{viewBox:"0 0 24 24",path:"M12 14a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 14v8M8 22h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},keyboard:{viewBox:"0 0 24 24",path:"M20 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zM6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M8 17h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mouse:{viewBox:"0 0 24 24",path:"M6 3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3zM12 3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gamepad:{viewBox:"0 0 24 24",path:"M6 12h4M8 10v4M15 13h.01M18 11h.01M17.32 5H6.68a4 4 0 0 0-3.978 3.59l-.891 9a4 4 0 0 0 6.9 3.31l1.29-1.29 1.29 1.29a4 4 0 0 0 6.9-3.31l-.891-9A4 4 0 0 0 17.32 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joystick:{viewBox:"0 0 24 24",path:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2zM6 15v-2M12 15V5m0 0l4 4m-4-4L8 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 3.582 2 5.5v3C2 10.418 6.477 12 12 12s10-1.582 10-3.5v-3C22 3.582 17.523 2 12 2zM2 8.5v4C2 14.418 6.477 16 12 16s10-1.582 10-3.5v-4M2 12.5v4C2 18.418 6.477 20 12 20s10-1.582 10-3.5v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},usb:{viewBox:"0 0 24 24",path:"M16 4h2a2 2 0 0 1 2 2v1M6 4h2a2 2 0 0 1 2 2v1M10 16v-5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM20 16v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM12 12v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},router:{viewBox:"0 0 24 24",path:"M20 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM6 18h.01M12 7a5 5 0 0 0-5 5M19 7a5 5 0 0 0-5-5M12 7V2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},printer:{viewBox:"0 0 24 24",path:"M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 14h12v8H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cpu:{viewBox:"0 0 24 24",path:"M18 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},battery:{viewBox:"0 0 24 24",path:"M17 6H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM23 13v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"battery-charging":{viewBox:"0 0 24 24",path:"M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19M23 13v-2M11 6l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plug:{viewBox:"0 0 24 24",path:"M12 22v-5M9 8V2M15 8V2M18 8H6a2 2 0 0 0-2 2v1a8 8 0 0 0 16 0v-1a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Xl={"chart-line":{viewBox:"0 0 24 24",path:"M3 3v18h18M18 9l-5 5-4-4-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bar-chart":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar-horizontal":{viewBox:"0 0 24 24",path:"M4 12h10M4 6h4M4 18h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-pie":{viewBox:"0 0 24 24",path:"M21.21 15.89A10 10 0 1 1 8 2.83M22 12A10 10 0 0 0 12 2v10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-area":{viewBox:"0 0 24 24",path:"M3 3v18h18M7 12l5-5 4 4 5-5v12H7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-candlestick":{viewBox:"0 0 24 24",path:"M9 5v4M9 11v8M15 5v8M15 17v2M7 9h4v2H7zM13 13h4v4h-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-neutral":{viewBox:"0 0 24 24",path:"M22 12H2M18 8l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1M21 12H17a2 2 0 0 1 0-4h4M17 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M21 4H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM1 10h22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},banknote:{viewBox:"0 0 24 24",path:"M2 8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM6 10h.01M18 14h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},coins:{viewBox:"0 0 24 24",path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 12c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zM16 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM16 8c2.2 0 4 1.8 4 4s-1.8 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"dollar-sign":{viewBox:"0 0 24 24",path:"M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pound-sign":{viewBox:"0 0 24 24",path:"M18 5H9a4 4 0 0 0-4 4v3a4 4 0 0 0 4 4h3M5 12h10M18 19H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"euro-sign":{viewBox:"0 0 24 24",path:"M4 10h12M4 14h12M17 5a8 8 0 0 0-14 5.5 8 8 0 0 0 14 5.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bitcoin:{viewBox:"0 0 24 24",path:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bank:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V10M8 21V10M12 21V10M16 21V10M20 21V10M12 3L2 8h20z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vault:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zM12 12m-3 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0M7 12h2M15 12h2M12 9V7M12 17v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"piggy-bank":{viewBox:"0 0 24 24",path:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2zM2 9v1c0 1.1.9 2 2 2h1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},safe:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM12 12m-2 0a2 2 0 1 0 4 0 2 2 0 1 0-4 0M16 8h.01M16 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M4 2v20l3-2 3 2 3-2 3 2 3-2 3 2V2l-3 2-3-2-3 2-3-2-3 2-3-2zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},invoice:{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M8 13h8M8 17h8M8 9h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},percent:{viewBox:"0 0 24 24",path:"M19 5L5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},growth:{viewBox:"0 0 24 24",path:"M12 20V12M12 12l-4 4M12 12l4 4M8 20h8M3 8l4-4 4 4 5-5 5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},investment:{viewBox:"0 0 24 24",path:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6M2 12h4M18 12h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scale:{viewBox:"0 0 24 24",path:"M12 3v18M3 6l3 10a6 6 0 0 0 6 0L15 6M9 6l6 0M21 6l-3 10a6 6 0 0 1-6 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Zl={"heart-pulse":{viewBox:"0 0 24 24",path:"M19.5 12.572l-7.5 7.428-7.5-7.428A5 5 0 1 1 12 5.006a5 5 0 1 1 7.5 7.566zM3 12h4l2-4 4 8 2-4h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M3 12h4l2-7 4 14 2-7h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pill:{viewBox:"0 0 24 24",path:"M10.5 20.5l9-9a4.95 4.95 0 0 0-7-7l-9 9a4.95 4.95 0 0 0 7 7zM8.5 8.5l7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pill-bottle":{viewBox:"0 0 24 24",path:"M6 3h12v5H6zM5 8h14a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1zM10 14h4M12 12v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},capsule:{viewBox:"0 0 24 24",path:"M8 8a4 4 0 0 1 8 0v8a4 4 0 0 1-8 0V8zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},syringe:{viewBox:"0 0 24 24",path:"M18 2l4 4M15 5l6 6M8 6l10 10-4 4L4 10zM2 22l6-6M7 11l2 2M11 7l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vaccine:{viewBox:"0 0 24 24",path:"M14 2l4 4M8 8l8 8M3 17l4 4M6.5 6.5L20 20M12 12l2.5-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stethoscope:{viewBox:"0 0 24 24",path:"M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4M22 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-medical":{viewBox:"0 0 24 24",path:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0zM12 14v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bandage:{viewBox:"0 0 24 24",path:"M18 2l4 4-14 14-4-4zM10.5 7.5l6 6M8.5 9.5l1 1M14.5 15.5l1 1M12.5 11.5l1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hospital:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M10 9h4M12 7v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ambulance:{viewBox:"0 0 24 24",path:"M10 10H6M8 8v4M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM7 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM21 15V8a2 2 0 0 0-2-2h-3l-2-3H6a2 2 0 0 0-2 2v10M21 9h-4a2 2 0 0 0-2 2v4h6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"first-aid":{viewBox:"0 0 24 24",path:"M20 6H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM9 12h6M12 9v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"medical-cross":{viewBox:"0 0 24 24",path:"M8 3h8v6h5v6h-5v6H8v-6H3V9h5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dna:{viewBox:"0 0 24 24",path:"M2 15c6.667-6 13.333 0 20-6M9 22c1.798-1.998 2.518-3.995 2.807-5.993M15 2c-1.798 1.998-2.518 3.995-2.807 5.993M2 9c6.667 6 13.333 0 20 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},microscope:{viewBox:"0 0 24 24",path:"M6 18h8M3 22h18M14 22a7 7 0 1 0 0-14M9 14h.01M9 6v8M6 6h6l-3-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"test-tube":{viewBox:"0 0 24 24",path:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5s-2.5-1.1-2.5-2.5V2M7 2h10M8.5 14h7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},brain:{viewBox:"0 0 24 24",path:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18ZM12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18ZM12 5v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lungs:{viewBox:"0 0 24 24",path:"M6.081 20C2.477 20 2 15.5 2 12.5S4 6 4 6s2-1 2-3M17.92 20c3.603 0 4.08-4.5 4.08-7.5S20 6 20 6s-2-1-2-3M12 3v17M12 12c-4 0-7-2-7-2M12 12c4 0 7-2 7-2M12 16c-4 0-7-2-7-2M12 16c4 0 7-2 7-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bone:{viewBox:"0 0 24 24",path:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tooth:{viewBox:"0 0 24 24",path:"M12 2C7 2 4 5 4 8c0 5 1 8 2 10 .5 1 1 4 2.5 4s1.5-2 3.5-2 2 2 3.5 2 2-3 2.5-4c1-2 2-5 2-10 0-3-3-6-8-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-medical":{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 9v6M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wheelchair:{viewBox:"0 0 24 24",path:"M12 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM15 21a4 4 0 1 0-5-6M12 10v4h4l2 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crutch:{viewBox:"0 0 24 24",path:"M5 5l7 7M7 3l7 7M19 19l-7-7M21 17l-7-7M11 11l-6 6M13 13l-6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"scale-weight":{viewBox:"0 0 24 24",path:"M12 3a9 9 0 0 0-9 9 9 9 0 0 0 9 9 9 9 0 0 0 9-9 9 9 0 0 0-9-9zM12 7v5l3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"blood-drop":{viewBox:"0 0 24 24",path:"M12 2c-4 4-7 7-7 11a7 7 0 0 0 14 0c0-4-3-7-7-11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heartbeat:{viewBox:"0 0 24 24",path:"M3 12h4l3-9 4 18 3-9h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ql={football:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6l4 4-4 4-4-4zM6 12l4-4v8zM18 12l-4 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},soccer:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 8l2.5 2-1 3h-3l-1-3zM12 2v3M22 12h-3M12 22v-3M2 12h3M4.93 4.93l2.12 2.12M19.07 4.93l-2.12 2.12M4.93 19.07l2.12-2.12M19.07 19.07l-2.12-2.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},basketball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2.05 11h19.9M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tennis:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM3.5 8.5c4-1 8 0 12 4M3.5 15.5c4 1 8 0 12-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},baseball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 5c1.5 2 2.5 4 2.5 7s-1 5-2.5 7M19 5c-1.5 2-2.5 4-2.5 7s1 5 2.5 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volleyball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 2v10M12 12l8.66 5M12 12l-8.66 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},golf:{viewBox:"0 0 24 24",path:"M12 18v4M8 22h8M12 2v16M12 6l6-2-6 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bowling:{viewBox:"0 0 24 24",path:"M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 6V2M10 9h.01M14 9h.01M12 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rugby:{viewBox:"0 0 24 24",path:"M5 5c8-2 16 6 14 14C11 21 3 13 5 5zM9 9l6 6M11 9l-1 1M13 11l-1 1M15 13l-1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cricket:{viewBox:"0 0 24 24",path:"M14 2l8 8-9 9-3-3 9-9M13 3l-9 9M7 17a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hockey:{viewBox:"0 0 24 24",path:"M7 2v11c0 3 2 5 5 5h3a3 3 0 0 0 0-6M19 18.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"table-tennis":{viewBox:"0 0 24 24",path:"M14.5 3.5a7 7 0 0 0-9.9 9.9l-2.3 4.3a1 1 0 0 0 1.3 1.3l4.3-2.3a7 7 0 0 0 6.6-13.2zM17 15.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"world-cup":{viewBox:"0 0 24 24",path:"M12 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM7 7h10M12 2v10M9 3.2c-1.4 2-1.4 5.6 0 7.6M15 3.2c1.4 2 1.4 5.6 0 7.6M10 12l-1 4h6l-1-4M8 16h8M11 16v4M13 16v4M8 20h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},jersey:{viewBox:"0 0 24 24",path:"M9 3L4 6l2.5 3.5L9 8M15 3l5 3-2.5 3.5L15 8M9 3a3 3 0 0 0 6 0M9 8v13h6V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"football-boot":{viewBox:"0 0 24 24",path:"M3 7v5a3 3 0 0 0 3 3h11a4 4 0 0 0 1-7.9L9 7c-1-1-2.2-2-4-2H3zM5 18h2M9 18h2M13 18h2M17 18h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},goal:{viewBox:"0 0 24 24",path:"M2 5h20v11H2zM2 5l3 3v8M22 5l-3 3v8M5 8h14v8M2 11h20M9 8v8M15 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-flag":{viewBox:"0 0 24 24",path:"M6 2v20M6 3h12l-3.5 4L18 11H6M3 22h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"referee-card":{viewBox:"0 0 24 24",path:"M8.5 2.5l9 3a2 2 0 0 1 1.3 2.5l-4.6 13a2 2 0 0 1-2.5 1.3l-9-3a2 2 0 0 1-1.3-2.5l4.6-13a2 2 0 0 1 2.5-1.3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 8c0-2.2 4.5-4 10-4s10 1.8 10 4-4.5 4-10 4-10-1.8-10-4zM2 8v6c0 2.2 4.5 4 10 4s10-1.8 10-4V8M8 12.5V18M16 12.5V18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scoreboard:{viewBox:"0 0 24 24",path:"M3 4h18v12H3zM3 16l3 4M21 16l-3 4M12 6v8M6 8h3v6H6zM15 8h3v6h-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dumbbell:{viewBox:"0 0 24 24",path:"M6.5 6.5h11M17.5 4v5M6.5 4v5M17.5 15v5M6.5 15v5M4 6v3a1 1 0 0 0 1 1h1.5M4 18v-3a1 1 0 0 1 1-1h1.5M20 6v3a1 1 0 0 1-1 1h-1.5M20 18v-3a1 1 0 0 0-1-1h-1.5M6.5 17.5h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barbell:{viewBox:"0 0 24 24",path:"M4 12h16M6 8v8M10 6v12M14 6v12M18 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},kettlebell:{viewBox:"0 0 24 24",path:"M12 6a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 22H7a5 5 0 0 1-1-9.9V10a6 6 0 0 1 12 0v2.1a5 5 0 0 1-1 9.9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},running:{viewBox:"0 0 24 24",path:"M13 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM5 22l3-9 3 3v6M10 6l5 3 4-1M4 13l5 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},swimming:{viewBox:"0 0 24 24",path:"M2 20c.9 0 1.6-.4 2.2-.9.8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 .6.5 1.3.9 2.2.9M8 16l-2-4 4-2 6 4 4-3M15 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cycling:{viewBox:"0 0 24 24",path:"M5 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM19 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 14l4-4 3 3 4-4M12 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},yoga:{viewBox:"0 0 24 24",path:"M12 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM4 17l4-4-2-4 6-3 6 3-2 4 4 4M8 22l4-5 4 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M6 9H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2M18 9h2a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M6 3v6a6 6 0 0 0 12 0V3M12 15v4M8 22h8M8 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},medal:{viewBox:"0 0 24 24",path:"M12 15a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM8 3l4 6 4-6M8 3h8M12 9v6M9 19.5l3 1.5 3-1.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M12 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM8.21 13.89L7 23l5-3 5 3-1.21-9.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crown:{viewBox:"0 0 24 24",path:"M2 17l3-10 5 6 2-8 2 8 5-6 3 10H2zM4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},podium:{viewBox:"0 0 24 24",path:"M5 10h4v12H5zM10 6h4v16h-4zM15 14h4v8h-4zM12 2v4M10 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stopwatch:{viewBox:"0 0 24 24",path:"M12 5a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 9v5l3 3M10 2h4M21 6l-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},whistle:{viewBox:"0 0 24 24",path:"M5 16a4 4 0 1 0 8 0 4 4 0 0 0-8 0zM2 12l7-4h8l3 4-3 4M18 8l4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},target:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"boxing-glove":{viewBox:"0 0 24 24",path:"M5 8c0-3 2-5 5-5h4c3 0 5 2 5 5v5c0 4-3 7-7 7s-7-3-7-7V8zM9 5v4M12 20v2M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},racket:{viewBox:"0 0 24 24",path:"M12 2a6 6 0 0 0-6 6v4a6 6 0 0 0 12 0V8a6 6 0 0 0-6-6zM12 18v4M8 8h8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skate:{viewBox:"0 0 24 24",path:"M4 16V6a2 2 0 0 1 2-2h8l4 4v8M2 16h18v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2zM6 20v2M16 20v2M10 10h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ski:{viewBox:"0 0 24 24",path:"M5 16l14-6M3 21l18-8M12 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 8l-4 8M14 10l2 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surfboard:{viewBox:"0 0 24 24",path:"M21 3L3 21M17 3c3 3 4 8 1 15L3 21c7-3 12-2 15 1M12 12l-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mountain:{viewBox:"0 0 24 24",path:"M8 21l4-10 3 6 2-4 4 8H3l5-10 4 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tent:{viewBox:"0 0 24 24",path:"M12 2L2 20h20L12 2zM12 2v18M7 14l5-6 5 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},compass:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM16.24 7.76l-2.12 6.36-6.36 2.12 2.12-6.36z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fishing:{viewBox:"0 0 24 24",path:"M18 2l-3 3v3l-4 4-5-2-4 4v5h5l4-4-2-5 4-4h3l3-3M12 22c-2 0-3-1-3-3M9 19c-2 0-3-1-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ec={building:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-4h6v4M9 9h.01M15 9h.01M9 13h.01M15 13h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},house:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9zM9 22V12h6v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cabin:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10l8-8 8 8v10M10 20v-6h4v6M12 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},apartment:{viewBox:"0 0 24 24",path:"M4 21V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v17M8 6h2M14 6h2M8 10h2M14 10h2M8 14h2M14 14h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},office:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 21v-4h6v4M9 7h.01M15 7h.01M9 11h.01M15 11h.01M9 15h.01M15 15h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M4 3h16l1 6H3l1-6zM3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9M10 21v-6h4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},warehouse:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V8l8-5 8 5v13M9 17h6v4H9zM9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},factory:{viewBox:"0 0 24 24",path:"M2 21h20M5 21V11l6 4V9l6 4V5a2 2 0 0 1 2-2h0a2 2 0 0 1 2 2v16M8 21v-3M12 21v-3M16 21v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hotel:{viewBox:"0 0 24 24",path:"M4 21V3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v18M8 5h2M14 5h2M8 9h2M14 9h2M8 13h2M14 13h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},school:{viewBox:"0 0 24 24",path:"M2 22h20M12 2l10 6v14M2 8l10-6M12 8v14M4 10v12M20 10v12M8 14h.01M16 14h.01M10 22v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},university:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},library:{viewBox:"0 0 24 24",path:"M4 21h16M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 7h6M9 11h6M9 15h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},museum:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10M20 20V10M12 2L2 8h20L12 2zM8 20v-6h3v6M13 20v-6h3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},court:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8l8-6 8 6v12M10 20v-6h4v6M6 10h12M12 4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},church:{viewBox:"0 0 24 24",path:"M18 22H6a2 2 0 0 1-2-2V9l8-7 8 7v11a2 2 0 0 1-2 2zM12 2v4M10 4h4M10 22v-5a2 2 0 0 1 4 0v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mosque:{viewBox:"0 0 24 24",path:"M3 21h18M5 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M15 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M12 3a4 4 0 0 1 4 4v14M12 3a4 4 0 0 0-4 4v14M12 1v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},temple:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V12h4v10M16 22V12h4v10M8 22V8h8v14M12 2l6 6H6l6-6M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},castle:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V10h4V6H6V2h3v2h2V2h2v2h2V2h3v4h-2v4h4v12M10 22v-5h4v5M4 6h4M16 6h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fortress:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8h16v12M8 8V4h2v4M14 8V4h2v4M4 4h4M16 4h4M8 20v-4h3v4M13 20v-4h3v4M7 12h2M15 12h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tower:{viewBox:"0 0 24 24",path:"M8 22V4a4 4 0 0 1 8 0v18M8 8h8M8 14h8M10 22v-4h4v4M12 1v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lighthouse:{viewBox:"0 0 24 24",path:"M7 22l2-16h6l2 16M9 6V3a3 3 0 0 1 6 0v3M2 11h5M17 11h5M9 12h6M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bridge:{viewBox:"0 0 24 24",path:"M2 18h20M4 14c0-2 2-4 4-4s4 2 4 4c0-2 2-4 4-4s4 2 4 4M4 18v-4M20 18v-4M12 18v-4M8 10V6M16 10V6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 16c0-3 4.5-5 10-5s10 2 10 5v2c0 3-4.5 5-10 5s-10-2-10-5v-2zM2 12c0-3 4.5-5 10-5s10 2 10 5M12 3v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airport:{viewBox:"0 0 24 24",path:"M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"train-station":{viewBox:"0 0 24 24",path:"M4 21h16M6 17V7a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10M8 21v-4h3v4M13 21v-4h3v4M12 2v3M9 9h6M9 13h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monument:{viewBox:"0 0 24 24",path:"M8 22h8M10 22V10L12 2l2 8v12M6 18h12M8 14h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},obelisk:{viewBox:"0 0 24 24",path:"M7 22l2-18h6l2 18M12 2l-1 2h2l-1-2M9 8h6M9 14h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},arch:{viewBox:"0 0 24 24",path:"M4 22V10a8 8 0 0 1 16 0v12M4 8h16M4 14h16M8 22v-8M16 22v-8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},windmill:{viewBox:"0 0 24 24",path:"M7 22l3-10h4l3 10M12 12V3M12 6l6-3M12 6L6 3M12 6l6 3M12 6L6 9M10 16h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skyscraper:{viewBox:"0 0 24 24",path:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18M2 22h20M10 6h4M10 10h4M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pyramid:{viewBox:"0 0 24 24",path:"M12 2L2 22h20L12 2zM12 2v20M7 12h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dome:{viewBox:"0 0 24 24",path:"M2 22h20M4 22v-6a8 8 0 0 1 16 0v6M12 2v6M12 2a3 3 0 0 1 0 6M10 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barn:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V11l7-8 7 8v10M10 21v-5h4v5M9 11h6M12 3v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},tc={smile:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},grin:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M6 13a6 6 0 0 0 12 0H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laugh:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9c0-.6.4-1 1-1s1 .4 1 1M15 9c0-.6.4-1 1-1s1 .4 1 1M7 13h10a5 5 0 0 1-10 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9l2 1M15 9l2 1M6 13h12a6 6 0 0 1-12 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wink:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M14 9h4M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},blush:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2M5 13h2M17 13h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M6.5 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1zM15 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M8 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1zM16 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sad:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2M8 11v2M16 11v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sob:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9l3 1M18 9l-3 1M16 17s-1.5-2-4-2-4 2-4 2M7 12l1 6M17 12l-1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},disappointed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},angry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rage:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 7l5 3M19 7l-5 3M9 16h6M9 16l1-2M15 16l-1-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},annoyed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M8 9h.01M16 9h.01M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surprised:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v1M16 8v1M12 13a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shocked:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 8l2 1M17 8l-2 1M12 13v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},astonished:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M12 12a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thinking:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M10 15h4c0 1-1 2-2 2s-2-1-2-2zM19 9c1 0 2-1 2-2s-1-2-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},confused:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M9 15c2-2 4 0 6-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},neutral:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},expressionless:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h3M14 9h3M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cool:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 10h5l1-2h2l1 2h5M5 10c0 1 1 2 2.5 2s2.5-1 2.5-2M14 10c0 1 1 2 2.5 2s2.5-1 2.5-2M8 16s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},nerd:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM14 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM10 9h4M8 15s1.5 1 4 1 4-1 4-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tongue:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 13h8M10 13v3c0 1 1 2 2 2s2-1 2-2v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},silly:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h2M17 9l-2-1M7 13c2 0 3 3 5 3s3-3 5-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zany:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v2M15 8l2 2M8 14h8c0 2-2 4-4 4s-4-2-4-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sick:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15c2 1 6-1 8 0M18 5c1.5 1.5 1.5 3.5 0 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sleepy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10c.5-.5 1.5-.5 2 0M15 10c.5-.5 1.5-.5 2 0M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM18 4l2 2M20 4h-2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dead:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 4M10 8l-4 4M14 8l4 4M18 8l-4 4M8 16h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mask:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M4 13h16M5 14c1 2 3 4 7 4s6-2 7-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},nc={car:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M7.5 6.5l.5 1h8l.5-1a1 1 0 00-1-1H8.5a1 1 0 00-1 1z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M1 3h15v13H1zM16 8h4l3 3v5h-7V8z M5.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z M18.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},van:{viewBox:"0 0 24 24",path:"M3 6h13v11H3z M16 6h2l3 4v7h-5V6z M7 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M17 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M3 10h13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},motorcycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 4l-3 7h5.5L18 8m-4 3l3 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bicycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 11l2-5h3M12 19v-8m0 0L9 8M12 11l3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bus:{viewBox:"0 0 24 24",path:"M4 6a2 2 0 012-2h12a2 2 0 012 2v11a3 3 0 01-3 3H7a3 3 0 01-3-3V6z M4 10h16M8 20v-2M16 20v-2M8 14h.01M16 14h.01M4 6h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},taxi:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M9 4h6v2H9V4z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},parking:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z M9 8v8M9 8h3.5a2.5 2.5 0 010 5H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fuel:{viewBox:"0 0 24 24",path:"M3 4h10v12H3z M13 7h2a2 2 0 012 2v7a2 2 0 002 2M14 7V4M3 10h10M5 20v-4M11 20v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},garage:{viewBox:"0 0 24 24",path:"M2 9l10-7 10 7v11a2 2 0 01-2 2H4a2 2 0 01-2-2V9z M7 21V13h10v8M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},road:{viewBox:"0 0 24 24",path:"M6 4h2v16H6zM16 4h2v16h-2zM12 4v4M12 12v4M12 20v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rocket:{viewBox:"0 0 24 24",path:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11A22.35 22.35 0 0 1 15 15z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};var sc={code:{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"git-branch":{viewBox:"0 0 24 24",path:"M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 9c-3 0-6 3-6 6v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},terminal:{viewBox:"0 0 24 24",path:"M4 17l6-6-6-6M12 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bold:{viewBox:"0 0 24 24",path:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6V4zm0 8h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6v-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},italic:{viewBox:"0 0 24 24",path:"M19 4h-9M14 20H5M15 4L9 20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},underline:{viewBox:"0 0 24 24",path:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3M4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},strikethrough:{viewBox:"0 0 24 24",path:"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7.1-5.3 1.1-6.6 3.1-.5.8-.7 1.7-.7 2.6 0 1.7.8 3.1 2 4M3 12h18M13 20c2 0 3.5-.5 4.5-1.5 1-.9 1.5-2.2 1.5-3.5 0-1.3-.5-2.5-1.4-3.4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-1":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 6h3m0 0V6m0 6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-2":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 10.5c0-2.5 4-2.5 4 0s-4 2.5-4 5m4 0h-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-3":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 4.5h3a1.5 1.5 0 0 1 0 3 1.5 1.5 0 0 1 0 3h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-bullet":{viewBox:"0 0 24 24",path:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-numbered":{viewBox:"0 0 24 24",path:"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},quote:{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-inline":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-block":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6M14 4l-4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-add":{viewBox:"0 0 24 24",path:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"image-add":{viewBox:"0 0 24 24",path:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M3 17a9 9 0 0 1 9-9 9 9 0 0 1 9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-left":{viewBox:"0 0 24 24",path:"M3 6h18M3 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-center":{viewBox:"0 0 24 24",path:"M3 6h18M6 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-right":{viewBox:"0 0 24 24",path:"M3 6h18M9 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},indent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M3 9l4 3-4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},outdent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M7 9l-4 3 4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},embed:{viewBox:"0 0 24 24",path:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clear-format":{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};const ic=e=>({viewBox:"0 0 24 24",path:e,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),oc={email:ic("M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9h4"),name:ic("M5 5h14a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z M9 9a2 2 0 110 4 2 2 0 010-4z M6 16.5c.6-1.4 1.7-2 3-2s2.4.6 3 2 M15 10h3 M15 14h3"),username:ic("M12 2a10 10 0 110 20 10 10 0 010-20z M12 7a3 3 0 110 6 3 3 0 010-6z M6.2 18.3c1.3-1.9 3.4-3 5.8-3s4.5 1.1 5.8 3"),password:ic("M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2z M7.5 12h.01 M12 12h.01 M16.5 12h.01"),signature:ic("M3 16c2.5-2.5 4.5-7 6.5-7 1.6 0-.6 6 1.2 6 1.4 0 2.6-3.5 4.3-3.5 1.4 0 .8 2.5 2.5 2.5 M3 20h18"),birthday:ic("M4 21h16 M5 21v-6a2 2 0 012-2h10a2 2 0 012 2v6 M5 17c1.2.9 2.3.9 3.5 0s2.3-.9 3.5 0 2.3.9 3.5 0 2.3-.9 3.5 0 M12 13V9 M12 7c-.9-.9-.9-2 0-3.5.9 1.5.9 2.6 0 3.5z"),company:ic("M4 21V5a2 2 0 012-2h8a2 2 0 012 2v16 M16 9h2a2 2 0 012 2v10 M3 21h18 M8 7h4 M8 11h4 M8 15h4"),telephone:ic("M22 16.9v3a2 2 0 01-2.2 2 19.8 19.8 0 01-8.6-3.1 19.5 19.5 0 01-6-6 19.8 19.8 0 01-3.1-8.7A2 2 0 014.1 2h3a2 2 0 012 1.7c.1.9.4 1.9.7 2.8a2 2 0 01-.5 2.1L8 9.9a16 16 0 006 6l1.3-1.3a2 2 0 012.1-.4c.9.3 1.8.6 2.8.7a2 2 0 011.7 2z"),mobile:ic("M8 2h8a2 2 0 012 2v16a2 2 0 01-2 2H8a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2"),address:ic("M3 10.5L12 3l9 7.5 M5 9v12h14V9 M10 21v-6h4v6"),postcode:ic("M4 5h16a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1z M10 9l-1 6 M14 9l-1 6 M7.5 11h8 M7 13h8"),website:ic("M5 4h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z M3 9h18 M6.5 6.5h.01 M9.5 6.5h.01"),pound:ic("M17 7.5a4 4 0 00-7.5-1.5c-.8 1.5-.4 3.3 0 5 .5 2.2.4 4.5-1.5 7H18 M6.5 12.5h8"),dollar:ic("M12 2v20 M17 6.5C16.1 5 14.3 4.3 12 4.3 9 4.3 7 5.8 7 8c0 5 10 2.5 10 8 0 2.2-2 3.7-5 3.7-2.4 0-4.3-.8-5.2-2.3"),euro:ic("M18.5 6.5a7 7 0 100 11 M4 10h9 M4 14h9"),weight:ic("M9 7a3 3 0 116 0 M6.5 9h11l2 12h-15l2-12z M10.5 14.5h3"),ruler:ic("M3 17L17 3l4 4L7 21l-4-4z M7 13l2 2 M10 10l2 2 M13 7l2 2"),quantity:ic("M4 6h16 M4 12h16 M4 18h10 M18 16v4 M16 18h4")},rc={...Wl,...Pl,...Fl,...Rl,...Vl,...ql,...Ul,...Kl,...Yl,...Gl,...Jl,...Xl,...Zl,...Ql,...ec,...tc,...nc,...sc,...oc},ac={ui:{name:"UI",description:"Core user interface icons",icons:Object.keys(Wl)},communication:{name:"Communication",description:"Messaging and notifications",icons:Object.keys(Pl)},media:{name:"Media",description:"Audio, video, and images",icons:Object.keys(Fl)},files:{name:"Files",description:"Documents and file operations",icons:Object.keys(Rl)},social:{name:"Social",description:"Social interactions and sharing",icons:Object.keys(Vl)},commerce:{name:"Commerce",description:"Shopping and payments",icons:Object.keys(ql)},status:{name:"Status",description:"Indicators and alerts",icons:Object.keys(Ul)},navigation:{name:"Navigation",description:"Directional and navigation",icons:Object.keys(Kl)},seasonal:{name:"Seasonal",description:"Festive and holiday icons",icons:Object.keys(Yl)},weather:{name:"Weather",description:"Weather conditions and meteorology",icons:Object.keys(Gl)},devices:{name:"Devices",description:"Electronic devices and hardware",icons:Object.keys(Jl)},finance:{name:"Finance",description:"Financial and charts",icons:Object.keys(Xl)},health:{name:"Health",description:"Medical and wellness",icons:Object.keys(Zl)},sport:{name:"Sport",description:"Sports and fitness",icons:Object.keys(Ql)},buildings:{name:"Buildings",description:"Architecture and structures",icons:Object.keys(ec)},emojis:{name:"Emojis",description:"Emoji expressions and faces",icons:Object.keys(tc)},transport:{name:"Transport",description:"Vehicles and transportation",icons:Object.keys(nc)},code:{name:"Code & Editor",description:"Text editing, formatting, and code icons",icons:Object.keys(sc)},forms:{name:"Forms",description:"Beside a form field - email, name, phone, address, money, measurements",icons:[...Object.keys(oc),"at-sign","mail","user","users","phone","smartphone","map-pin","home","calendar","clock","lock","key","globe","link","credit-card","hash","percent","briefcase","building","message-square","tag","search","cake","gift","scale"]}},lc="http://www.w3.org/2000/svg";const cc=new class{constructor(){this._icons={...rc},this._categories={...ac}}render(e,t={}){const n=this._icons[e];if(!n)return console.warn(`Icon "${e}" not found`),null;const{size:s=24,class:i="",colour:o=null,color:r=null,attrs:a={}}=t,l=document.createElementNS(lc,"svg");l.setAttribute("viewBox",n.viewBox||"0 0 24 24"),l.setAttribute("width",s),l.setAttribute("height",s),l.setAttribute("fill",n.fill||"none"),l.setAttribute("aria-hidden","true");const c=["dm-icon"];if(i&&c.push(i),l.setAttribute("class",c.join(" ")),n.stroke&&l.setAttribute("stroke",o||r||n.stroke),n.strokeWidth&&l.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&l.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&l.setAttribute("stroke-linejoin",n.strokeLinejoin),(o||r)&&"currentColor"===n.fill&&l.setAttribute("fill",o||r),Object.entries(a).forEach(([e,t])=>{l.setAttribute(e,t)}),n.path){const e=document.createElementNS(lc,"path");e.setAttribute("d",n.path),"currentColor"===n.fill&&e.setAttribute("fill",o||r||"currentColor"),l.appendChild(e)}return n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(lc,"path");t.setAttribute("d",e),"currentColor"===n.fill&&t.setAttribute("fill",o||r||"currentColor"),l.appendChild(t)}),l}html(e,t={}){const n=this.render(e,t);if(!n)return"";const s=document.createElement("div");return s.appendChild(n),s.innerHTML}inject(e,t,n={}){const{position:s="prepend",...i}=n,o="string"==typeof e?document.querySelector(e):e;if(!o)return console.warn(`Target element not found: ${e}`),null;const r=this.render(t,i);if(!r)return null;switch(s){case"append":o.appendChild(r);break;case"replace":o.innerHTML="",o.appendChild(r);break;default:o.insertBefore(r,o.firstChild)}return r}scan(e=document){const t="string"==typeof e?document.querySelector(e):e;if(!t)return 0;const n=t.querySelectorAll("[data-icon]:not([data-icon-processed]):not([data-icon-processing])");let s=0;return n.forEach(e=>{if("svg"===e.tagName.toLowerCase()||e.hasAttribute("data-icon-processed")||e.querySelector("svg"))return;const t=e.dataset.icon,n=parseInt(e.dataset.iconSize,10)||24,i=e.dataset.iconColour||e.dataset.iconColor||null,o=e.dataset.iconClass||"",r=this.render(t,{size:n,colour:i,class:o});if(r){const n=e.className;n&&r.classList.add(...n.split(" ").filter(e=>e)),r.setAttribute("data-icon",t),r.setAttribute("data-icon-processed","true"),r.setAttribute("data-original-icon",t),r.setAttribute("data-icon-converted",Date.now().toString()),e.replaceWith(r),s++}else e.setAttribute("data-icon-processed","true")}),s}register(e,t){return e&&t?(t.viewBox||(t.viewBox="0 0 24 24"),t.path||t.paths?(this._icons[e]=t,this._categories.custom||(this._categories.custom={name:"Custom",description:"Custom registered icons",icons:[]}),this._categories.custom.icons.push(e),this):(console.warn(`Icon "${e}" must have a path or paths property`),this)):(console.warn("Invalid icon registration: name and definition required"),this)}unregister(e){if(this._icons[e]){if(delete this._icons[e],this._categories.custom){const t=this._categories.custom.icons.indexOf(e);t>-1&&this._categories.custom.icons.splice(t,1)}return!0}return!1}has(e){return!!this._icons[e]}get(e){return this._icons[e]||null}list(e=null){return e&&this._categories[e]?[...this._categories[e].icons]:Object.keys(this._icons)}listCategories(){return{...this._categories}}count(){return Object.keys(this._icons).length}search(e){const t=e.toLowerCase();return Object.keys(this._icons).filter(e=>e.toLowerCase().includes(t))}createSprite(){const e=document.createElementNS(lc,"svg");return e.setAttribute("xmlns",lc),e.style.display="none",Object.entries(this._icons).forEach(([t,n])=>{const s=document.createElementNS(lc,"symbol");if(s.setAttribute("id",`dm-icon-${t}`),s.setAttribute("viewBox",n.viewBox||"0 0 24 24"),n.path){const e=document.createElementNS(lc,"path");e.setAttribute("d",n.path),n.fill&&e.setAttribute("fill",n.fill),n.stroke&&(e.setAttribute("stroke",n.stroke),n.strokeWidth&&e.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&e.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&e.setAttribute("stroke-linejoin",n.strokeLinejoin)),s.appendChild(e)}n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(lc,"path");t.setAttribute("d",e),n.fill&&t.setAttribute("fill",n.fill),n.stroke&&t.setAttribute("stroke",n.stroke),s.appendChild(t)}),e.appendChild(s)}),e}use(e,t={}){if(!this._icons[e])return console.warn(`Icon "${e}" not found`),null;const{size:n=24,class:s=""}=t,i=document.createElementNS(lc,"svg");i.setAttribute("width",n),i.setAttribute("height",n),i.setAttribute("aria-hidden","true");const o=["dm-icon"];s&&o.push(s),i.setAttribute("class",o.join(" "));const r=document.createElementNS(lc,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#dm-icon-${e}`),i.appendChild(r),i}};class hc{static stripeColors={none:"transparent",lighter:"var(--dm-gray-100, #f8f9fa)",light:"var(--dm-gray-200, #e9ecef)",medium:"var(--dm-gray-300, #dee2e6)",dark:"var(--dm-gray-400, #ced4da)","primary-tint":"rgba(100, 149, 237, 0.05)","success-tint":"rgba(40, 167, 69, 0.05)","warning-tint":"rgba(255, 193, 7, 0.05)","danger-tint":"rgba(220, 53, 69, 0.05)","info-tint":"rgba(23, 162, 184, 0.05)",default:"var(--dm-table-stripe-bg, #f9f9f9)"};static hoverColors={none:"transparent",lighter:"var(--dm-gray-200, #e9ecef)",light:"var(--dm-gray-300, #dee2e6)",medium:"var(--dm-gray-400, #ced4da)",dark:"var(--dm-gray-500, #adb5bd)",default:"var(--dm-hover-bg, #f0f0f0)"};constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={data:[],columns:[],rowKey:"id",sortable:!0,multiSort:!1,defaultSort:null,filterable:!0,searchable:!0,searchPlaceholder:"Search...",pagination:!0,pageSize:10,pageSizeOptions:[10,25,50,100],selectable:!1,selectionMode:"single",editable:!1,editMode:"cell",resizable:!0,loadingSkeleton:!1,loadingLabel:"Loading...",striped:!0,hover:!0,bordered:!0,responsive:!0,evenRowColor:null,oddRowColor:null,hoverColor:null,classes:{wrapper:"domma-table-wrapper",table:"domma-table",header:"domma-table-header",body:"domma-table-body",row:"domma-table-row",cell:"domma-table-cell",selected:"domma-table-selected",sorted:"domma-table-sorted",sortAsc:"domma-table-sort-asc",sortDesc:"domma-table-sort-desc",pagination:"domma-table-pagination",search:"domma-table-search"},exportPanel:!1,exportOptions:["copy","csv","excel","json"],columnToggle:!1,regexSearch:!1,persistSettings:!1,storageKey:null,onSort:null,onFilter:null,onPageChange:null,onSelect:null,onEdit:null,onRender:null,onExport:null,...t},this._originalData=[...this.options.data],this._data=[...this.options.data],this._filteredData=[...this._data],this._currentPage=1,this._pageSize=this.options.pageSize,this._sorts=[],this._filters=[],this._searchQuery="",this._selected=new Set,this._editingCell=null,this._eventListeners=new Map,this._columnDropdownOpen=!1,this._searchIsRegex=!1,this._loading=!(!this.options.loadingSkeleton||this.options.data&&this.options.data.length),this._columns=this.options.columns.map(e=>({key:e.key||e,title:e.title||e.key||e,sortable:!1!==e.sortable&&this.options.sortable,filterable:!1!==e.filterable,editable:e.editable||!1,width:e.width||null,render:e.render||null,filterOptions:e.filterOptions||null,visible:!1!==e.visible})),this.options.persistSettings&&this._loadSettings(),this._init()}_init(){this.element&&(this.options.defaultSort&&(this._sorts=[this.options.defaultSort]),this.render())}_resolveColor(e,t,n){return e?t[e]?t[e]:e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("var(")?e:n:n}_getRowColors(e){const t=this.options;if(!t.striped)return{background:"transparent",hover:t.hover?this._resolveColor(t.hoverColor,hc.hoverColors,hc.hoverColors.default):"transparent"};const n=e%2==1,s=this._resolveColor(t.evenRowColor,hc.stripeColors,"transparent"),i=this._resolveColor(t.oddRowColor,hc.stripeColors,hc.stripeColors.default);return{background:n?i:s,hover:t.hover?this._resolveColor(t.hoverColor,hc.hoverColors,hc.hoverColors.default):null}}setData(e){return this._loading=!1,this._originalData=[...e],this._data=[...e],this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}getData(){return[...this._getPageData()]}setLoading(e=!0){return this._loading=!!e,this.render(),this}isLoading(){return this._loading}getFilteredData(){return[...this._filteredData]}getOriginalData(){return[...this._originalData]}addRow(e){return this._loading=!1,this._originalData.push(e),this._data.push(e),this._applyFiltersAndSort(),this.render(),this}updateRow(e,t){const n=this._findRowIndex(e);return-1!==n&&(this._originalData[n]={...this._originalData[n],...t},this._data[n]={...this._data[n],...t},this._applyFiltersAndSort(),this.render()),this}removeRow(e){const t=this._findRowIndex(e);return-1!==t&&(this._originalData.splice(t,1),this._data.splice(t,1),this._applyFiltersAndSort(),this.render()),this}_findRowIndex(e){const t=this.options.rowKey;return"number"==typeof e?e:this._originalData.findIndex(n=>n[t]===e)}sort(e,t="asc"){return this._sorts=[{column:e,direction:t}],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({column:e,direction:t,sorts:this._sorts}),this}sortMultiple(e){return this._sorts=e,this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({sorts:this._sorts}),this}clearSort(){return this._sorts=[],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this}_applySort(e){return 0===this._sorts.length?e:[...e].sort((e,t)=>{for(const n of this._sorts){const{column:s,direction:i}=n,o=e[s],r=t[s];let a=0;if(null==o?a=1:null==r||o<r?a=-1:o>r&&(a=1),0!==a)return"desc"===i?-a:a}return 0})}search(e){return this._searchQuery=this._searchIsRegex?e.trim():e.toLowerCase().trim(),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({query:e,type:"search",isRegex:this._searchIsRegex}),this}setSearchMode(e){return this._searchIsRegex=e,this._searchQuery&&(this._applyFiltersAndSort(),this.render()),this}toggleSearchMode(){return this.setSearchMode(!this._searchIsRegex)}filter(e,t,n="equals"){return this._filters=this._filters.filter(t=>t.column!==e),null!=t&&""!==t&&this._filters.push({column:e,value:t,operator:n}),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({column:e,value:t,operator:n,type:"column"}),this}filterBy(e){return this._customFilter=e,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}clearFilters(){return this._filters=[],this._searchQuery="",this._customFilter=null,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}_applyFilters(e){let t=e;if(this._searchQuery)if(this._searchIsRegex)try{const e=new RegExp(this._searchQuery,"i");t=t.filter(t=>this._columns.some(n=>{const s=t[n.key];return null!=s&&e.test(String(s))}))}catch(e){t=[]}else t=t.filter(e=>this._columns.some(t=>{const n=e[t.key];return null!=n&&String(n).toLowerCase().includes(this._searchQuery)}));for(const e of this._filters)t=t.filter(t=>{const n=t[e.column];return this._matchFilter(n,e.value,e.operator)});return this._customFilter&&(t=t.filter(this._customFilter)),t}_matchFilter(e,t,n){if(null==e)return!1;const s=String(e).toLowerCase(),i=String(t).toLowerCase();switch(n){case"equals":default:return s===i;case"contains":return s.includes(i);case"startsWith":return s.startsWith(i);case"endsWith":return s.endsWith(i);case"gt":return Number(e)>Number(t);case"lt":return Number(e)<Number(t);case"gte":return Number(e)>=Number(t);case"lte":return Number(e)<=Number(t);case"between":const[n,o]=t,r=Number(e);return r>=n&&r<=o;case"in":return t.includes(e)}}_applyFiltersAndSort(){this._filteredData=this._applyFilters(this._data),this._filteredData=this._applySort(this._filteredData)}page(e){const t=this._getTotalPages();return this._currentPage=Math.max(1,Math.min(e,t)),this.render(),this.options.onPageChange&&this.options.onPageChange(this.pageInfo()),this}pageSize(e){return this._pageSize=e,this._currentPage=1,this.render(),this._saveSettings(),this}nextPage(){return this.page(this._currentPage+1)}prevPage(){return this.page(this._currentPage-1)}firstPage(){return this.page(1)}lastPage(){return this.page(this._getTotalPages())}pageInfo(){const e=this._getTotalPages();return{page:this._currentPage,pageSize:this._pageSize,totalPages:e,totalRows:this._filteredData.length,startRow:(this._currentPage-1)*this._pageSize+1,endRow:Math.min(this._currentPage*this._pageSize,this._filteredData.length)}}_getTotalPages(){return this.options.pagination&&Math.ceil(this._filteredData.length/this._pageSize)||1}_getPageData(){if(!this.options.pagination)return this._filteredData;const e=(this._currentPage-1)*this._pageSize,t=e+this._pageSize;return this._filteredData.slice(e,t)}select(e){if(!this.options.selectable)return this;const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return"single"===this.options.selectionMode&&this._selected.clear(),this._selected.add(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.delete(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}toggleSelect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)?this.deselect(e):this.select(e),this}selectAll(){if(!this.options.selectable||"single"===this.options.selectionMode)return this;const e=this.options.rowKey;for(const t of this._filteredData)this._selected.add(t[e]);return this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselectAll(){return this._selected.clear(),this.render(),this.options.onSelect&&this.options.onSelect([]),this}getSelected(){const e=this.options.rowKey;return this._filteredData.filter(t=>this._selected.has(t[e]))}isSelected(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)}_getStorageKey(){return this.options.storageKey||(this.element.id?`domma-table-${this.element.id}`:"domma-table-default")}_loadSettings(){try{const e=this._getStorageKey(),t=me.get(e);t&&t.columns&&t.columns.forEach(e=>{const t=this._columns.find(t=>t.key===e.key);t&&(t.visible=e.visible,e.width&&(t.width=e.width))}),t&&t.pageSize&&this.options.pagination&&(this._pageSize=t.pageSize,this.options.pageSize=t.pageSize),t&&t.sorts&&this.options.sortable&&(this._sorts=t.sorts)}catch(e){console.warn("Failed to load table settings:",e)}}_saveSettings(){if(this.options.persistSettings)try{const e=this._getStorageKey(),t={columns:this._columns.map(e=>({key:e.key,visible:e.visible,width:e.width})),pageSize:this._pageSize,sorts:this._sorts,timestamp:Date.now()};me.set(e,t)}catch(e){console.warn("Failed to save table settings:",e)}}clearSettings(){if(this.options.persistSettings){const e=this._getStorageKey();me.remove(e)}}showColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!0,this.render(),this._saveSettings()),this}hideColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!1,this.render(),this._saveSettings()),this}toggleColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!t.visible,this.render(),this._saveSettings()),this}getVisibleColumns(){return this._columns.filter(e=>e.visible)}getHiddenColumns(){return this._columns.filter(e=>!e.visible)}resizeColumn(e,t){const n=this._columns.find(t=>t.key===e);return n&&(n.width=t,this.render()),this}getColumns(){return[...this._columns]}editCell(e,t){return this.options.editable?(this._editingCell={rowIndex:e,column:t},this.render(),this):this}saveEdits(){return this._editingCell=null,this.render(),this}cancelEdits(){return this._editingCell=null,this.render(),this}toCSV(e={}){const{columns:t=this._columns.filter(e=>e.visible),includeHeaders:n=!0}=e,s=[],i=this._getExportData();n&&s.push(t.map(e=>`"${e.title}"`).join(","));for(const e of i){const n=t.map(t=>{const n=e[t.key];return null==n?'""':`"${String(n).replace(/"/g,'""')}"`});s.push(n.join(","))}return s.join("\n")}_getExportData(){const e=this.getSelected();return e.length>0?e:this._filteredData}toJSON(e={}){const{columns:t=this._columns.filter(e=>e.visible),pretty:n=!1}=e,s=t.map(e=>e.key),i=this._getExportData().map(e=>{const t={};for(const n of s)t[n]=e[n];return t});return n?JSON.stringify(i,null,2):JSON.stringify(i)}download(e,t){let n,s;switch(e){case"csv":n=this.toCSV(),s="text/csv",t=t||"data.csv";break;case"excel":n=this.toExcel(),s="application/vnd.ms-excel",t=t||"data.xls";break;default:n=this.toJSON({pretty:!0}),s="application/json",t=t||"data.json"}const i=new Blob([n],{type:s}),o=URL.createObjectURL(i),r=document.createElement("a");if(r.href=o,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o),this.options.onExport){const n=this._getExportData(),s=this.getSelected();this.options.onExport({format:e,filename:t,rowCount:n.length,selectedOnly:s.length>0})}}toExcel(e={}){const{columns:t=this._columns.filter(e=>e.visible)}=e,n=this._getExportData();let s='\n <html xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <head>\n <meta charset="UTF-8">\n \x3c!--[if gte mso 9]>\n <xml>\n <x:ExcelWorkbook>\n <x:ExcelWorksheets>\n <x:ExcelWorksheet>\n <x:Name>Data</x:Name>\n <x:WorksheetOptions>\n <x:DisplayGridlines/>\n </x:WorksheetOptions>\n </x:ExcelWorksheet>\n </x:ExcelWorksheets>\n </x:ExcelWorkbook>\n </xml>\n <![endif]--\x3e\n <style>\n table { border-collapse: collapse; }\n th, td { border: 1px solid #000; padding: 8px; }\n th { background: #f0f0f0; font-weight: bold; }\n </style>\n </head>\n <body>\n <table>\n <thead>\n <tr>';for(const e of t)s+=`<th>${this._escapeHtml(e.title)}</th>`;s+="</tr></thead><tbody>";for(const e of n){s+="<tr>";for(const n of t){const t=e[n.key];s+=`<td>${null!=t?this._escapeHtml(String(t)):""}</td>`}s+="</tr>"}return s+="</tbody></table></body></html>",s}async copyToClipboard(e="text"){let t;const n=this._getExportData();if("json"===e)t=this.toJSON({pretty:!0});else if("csv"===e)t=this.toCSV();else{const e=this._columns.filter(e=>e.visible),s=[];s.push(e.map(e=>e.title).join("\t"));for(const t of n)s.push(e.map(e=>t[e.key]??"").join("\t"));t=s.join("\n")}return await y.copyToClipboard(t),this.options.onExport&&this.options.onExport({format:"clipboard",rowCount:this._filteredData.length}),this}_escapeHtml(e){return o(e)}render(){if(!this.element)return this;const e=this.options,t=e.classes,n=this._columns.filter(e=>e.visible),s=this._getPageData();this._restoreIconsBeforeRebuild(),this.element.innerHTML="",this._clearEventListeners();const i=document.createElement("div");i.className=t.wrapper;const o=document.createElement("div");if(o.className="domma-table-toolbar",e.searchable){const t=document.createElement("div");t.className="domma-table-search-wrapper";const n=document.createElement("input");if(n.type="text",n.className="domma-table-search-input"+(this._searchIsRegex?" regex-mode":""),n.placeholder=this._searchIsRegex?"Regex pattern...":e.searchPlaceholder,n.value=this._searchQuery,n.setAttribute("aria-label","Search table"),this._addEventHandler(n,"input",y.debounce(e=>{this.search(e.target.value)},300)),t.appendChild(n),e.regexSearch){const e=document.createElement("button");e.type="button",e.className="domma-table-regex-button"+(this._searchIsRegex?" active":""),e.title=this._searchIsRegex?"Regex mode (click for text)":"Text mode (click for regex)",e.setAttribute("aria-label",this._searchIsRegex?"Regex search mode enabled":"Regex search mode disabled"),e.setAttribute("aria-pressed",this._searchIsRegex?"true":"false"),e.innerHTML=".*",this._addEventHandler(e,"click",()=>{this._searchIsRegex=!this._searchIsRegex,this._searchQuery&&(this._searchQuery=this._searchIsRegex?n.value.trim():n.value.toLowerCase().trim(),this._applyFiltersAndSort()),this.render()}),t.appendChild(e)}o.appendChild(t)}if(e.columnToggle){const e=document.createElement("div");e.className="domma-table-column-toggle";const t=document.createElement("button");t.type="button",t.className="domma-table-column-button",t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this._columnDropdownOpen?"true":"false"),t.setAttribute("aria-label","Toggle column visibility"),t.innerHTML=`${cc.html("columns",{size:16})} Columns`;const n=document.createElement("div");n.className="domma-column-dropdown"+(this._columnDropdownOpen?" show":"");for(const e of this._columns){const t=document.createElement("label");t.className="domma-column-toggle-item";const s=document.createElement("span");s.className="domma-column-toggle-label",s.textContent=e.title;const i=document.createElement("div");i.className="domma-toggle-switch";const o=document.createElement("input");o.type="checkbox",o.checked=e.visible,o.style.cssText="opacity: 0; width: 0; height: 0; position: absolute;";const r=document.createElement("span");r.className="domma-toggle-track"+(e.visible?" active":"");const a=document.createElement("span");a.className="domma-toggle-knob"+(e.visible?" active":""),r.appendChild(a),i.appendChild(o),i.appendChild(r),this._addEventHandler(t,"click",t=>{t.preventDefault(),t.stopPropagation(),e.visible=!e.visible,e.visible?(r.classList.add("active"),a.classList.add("active")):(r.classList.remove("active"),a.classList.remove("active")),o.checked=e.visible,this._columnDropdownOpen=!0,this.render(),this._saveSettings()}),t.appendChild(s),t.appendChild(i),n.appendChild(t)}this._addEventHandler(t,"click",e=>{e.stopPropagation(),this._columnDropdownOpen=!this._columnDropdownOpen,this._columnDropdownOpen?n.classList.add("show"):n.classList.remove("show")}),this._addEventHandler(document,"click",()=>{this._columnDropdownOpen&&(this._columnDropdownOpen=!1,n.classList.remove("show"))}),this._addEventHandler(n,"click",e=>{e.stopPropagation()}),e.appendChild(t),e.appendChild(n),o.appendChild(e)}if(e.exportPanel){const t=document.createElement("div");t.className="domma-table-export-wrapper";let n=!1;const s=document.createElement("div");s.className="domma-export-mode-toggle";const i=document.createElement("span");i.className="domma-export-mode-label active",i.textContent="Copy";const r=document.createElement("label");r.className="domma-export-toggle-switch";const a=document.createElement("input");a.type="checkbox",a.className="domma-export-toggle-input";const l=document.createElement("span");l.className="domma-export-toggle-slider";const c=document.createElement("span");c.className="domma-export-toggle-knob",l.appendChild(c),r.appendChild(a),r.appendChild(l);const h=document.createElement("span");h.className="domma-export-mode-label",h.textContent="Download";const d=()=>{n?(l.classList.add("active"),c.classList.add("active"),i.classList.remove("active"),h.classList.add("active")):(l.classList.remove("active"),c.classList.remove("active"),i.classList.add("active"),h.classList.remove("active"))};this._addEventHandler(a,"change",()=>{n=a.checked,d()}),d(),s.appendChild(i),s.appendChild(r),s.appendChild(h),t.appendChild(s);const u=document.createElement("span");u.className="domma-export-separator",t.appendChild(u);const p={text:{label:"Text",icon:cc.html("clipboard",{size:16}),format:"text"},csv:{label:"CSV",icon:cc.html("document",{size:16}),format:"csv"},excel:{label:"Excel",icon:cc.html("grid",{size:16}),format:"excel"},json:{label:"JSON",icon:cc.html("file-code",{size:16}),format:"json"}},m=e.exportOptions.map(e=>"copy"===e?"text":e);for(const e of m){const s=p[e];if(!s)continue;const i=document.createElement("button");i.type="button",i.className="domma-export-button",i.setAttribute("data-export",e),i.innerHTML=`${s.icon} ${s.label}`;const o=(e,t=!0)=>{const n=i.innerHTML;i.innerHTML=e,i.classList.add(t?"success":"error"),setTimeout(()=>{i.innerHTML=n,i.classList.remove("success","error")},1500)};this._addEventHandler(i,"click",()=>{const e=this.getSelected(),t=e.length>0?e.length:this._filteredData.length,i=e.length>0?` (${t} selected)`:` (${t} rows)`;if(n){const e="text"===s.format?"csv":s.format;this.download(e),o("✓ Downloaded!"+i)}else{const e="excel"===s.format?"text":s.format;this.copyToClipboard(e),o("✓ Copied!"+i)}}),t.appendChild(i)}o.appendChild(t)}(e.searchable||e.columnToggle||e.exportPanel)&&i.appendChild(o);const r=document.createElement("table");r.className=t.table,r.style.cssText="width: 100%; border-collapse: collapse;";const a=document.createElement("thead");a.className=t.header;const l=document.createElement("tr");if(e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("th");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); width: 40px;";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label","Select all rows"),t.checked=this._selected.size>0&&this._selected.size===s.length,t.disabled=this._loading,this._addEventHandler(t,"change",()=>{t.checked?this.selectAll():this.deselectAll()}),e.appendChild(t),l.appendChild(e)}for(const e of n){const n=document.createElement("th");n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); text-align: left;",e.width&&(n.style.width="number"==typeof e.width?e.width+"px":e.width);const s=this._sorts.find(t=>t.column===e.key);if(s&&(n.classList.add(t.sorted),n.classList.add("asc"===s.direction?t.sortAsc:t.sortDesc)),e.sortable){n.style.cursor="pointer",n.tabIndex=0,n.setAttribute("aria-sort",s?"asc"===s.direction?"ascending":"descending":"none"),n.innerHTML=`${e.title} <span style="opacity: 0.5" aria-hidden="true">${s?"asc"===s.direction?"▲":"▼":"⇅"}</span>`;const t=()=>{const t=this._sorts.find(t=>t.column===e.key),n="asc"===t?.direction?"desc":"asc";this.sort(e.key,n)};this._addEventHandler(n,"click",t),this._addEventHandler(n,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}else n.textContent=e.title;l.appendChild(n)}a.appendChild(l),r.appendChild(a);const c=document.createElement("tbody");c.className=t.body;const h=e.rowKey;if(this._loading){const s=parseInt(e.loadingSkeleton,10),o=s>0?s:Math.min(this._pageSize||5,5),a=n.length+(e.selectable&&"multiple"===e.selectionMode?1:0);for(let e=0;e<o;e++){const n=document.createElement("tr");n.className=`${t.row} domma-table-skeleton-row`,n.setAttribute("aria-hidden","true");for(let s=0;s<a;s++){const i=document.createElement("td");i.className=t.cell,i.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const o=document.createElement("span");o.className="skeleton skeleton-text",o.style.width=`${[80,60,70,50][(e+s)%4]}%`,i.appendChild(o),n.appendChild(i)}c.appendChild(n)}r.setAttribute("aria-busy","true");const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),i.appendChild(l),setTimeout(()=>{l.isConnected&&(l.textContent=e.loadingLabel)},100)}else e.loadingSkeleton&&r.setAttribute("aria-busy","false");if((this._loading?[]:s).forEach((s,i)=>{const o=document.createElement("tr");o.className=t.row;const r=this._getRowColors(i);if(o.style.background=r.background,e.hover&&r.hover){o.style.transition="background 0.2s";const e=r.background;this._addEventHandler(o,"mouseenter",()=>o.style.background=r.hover),this._addEventHandler(o,"mouseleave",()=>o.style.background=e)}if(this._selected.has(s[h])?(o.classList.add(t.selected),o.style.background="var(--dm-primary-light, #e3f2fd)",o.setAttribute("aria-selected","true")):e.selectable&&o.setAttribute("aria-selected","false"),e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("td");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label",`Select row ${i+1}`),t.checked=this._selected.has(s[h]),this._addEventHandler(t,"change",()=>{this.toggleSelect(s[h])}),e.appendChild(t),o.appendChild(e)}e.selectable&&"single"===e.selectionMode&&(o.style.cursor="pointer",this._addEventHandler(o,"click",()=>{this.toggleSelect(s[h])}));for(const r of n){const n=document.createElement("td");n.className=t.cell,n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";if(this._editingCell&&this._editingCell.rowIndex===i&&this._editingCell.column===r.key&&r.editable){const t=document.createElement("input");t.type="text",t.value=s[r.key]||"",t.style.cssText="width: 100%; padding: 4px; border: 1px solid var(--dm-primary, #007bff);",this._addEventHandler(t,"blur",()=>{this.updateRow(s[h],{[r.key]:t.value}),this.saveEdits(),e.onEdit&&e.onEdit({row:s,column:r.key,oldValue:s[r.key],newValue:t.value})}),this._addEventHandler(t,"keydown",e=>{"Enter"===e.key?t.blur():"Escape"===e.key&&this.cancelEdits()}),n.appendChild(t),setTimeout(()=>t.focus(),0)}else r.render?n.innerHTML=r.render(s[r.key],s,i):n.textContent=s[r.key]??"",r.editable&&e.editable&&(n.style.cursor="pointer",this._addEventHandler(n,"dblclick",()=>{this.editCell(i,r.key)}));o.appendChild(n)}c.appendChild(o)}),r.appendChild(c),i.appendChild(r),e.pagination&&!this._loading){const n=document.createElement("div");n.className=t.pagination,n.setAttribute("role","navigation"),n.setAttribute("aria-label","Table pagination"),n.style.cssText="display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 10px 0;";const s=this.pageInfo(),o=document.createElement("span");o.textContent=`Showing ${s.startRow}-${s.endRow} of ${s.totalRows}`;const r=document.createElement("span");r.innerHTML="Show ";const a=document.createElement("select");a.className="form-select",a.setAttribute("aria-label","Rows per page"),a.style.cssText="width: auto; display: inline-block; margin: 0 5px;";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=t,e.textContent=t,t===this._pageSize&&(e.selected=!0),a.appendChild(e)}this._addEventHandler(a,"change",()=>{this.pageSize(Number(a.value))}),r.appendChild(a),r.appendChild(document.createTextNode(" entries"));const l=document.createElement("span");l.setAttribute("role","group"),l.setAttribute("aria-label","Pagination controls");const c=(e,t,n=!1,s=!1,i="")=>{const o=document.createElement("button");return o.type="button",i&&o.setAttribute("aria-label",i),s?o.innerHTML=e:o.textContent=e,o.disabled=n,n&&o.setAttribute("aria-disabled","true"),o.style.cssText="padding: 6px 12px; margin: 0 2px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-surface, #fff); cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;",n&&(o.style.opacity="0.5"),this._addEventHandler(o,"click",t),o};l.appendChild(c(cc.html("chevrons-left",{size:14}),()=>this.firstPage(),1===this._currentPage,!0,"First page")),l.appendChild(c(cc.html("chevron-left",{size:14}),()=>this.prevPage(),1===this._currentPage,!0,"Previous page"));const h=5;let d=Math.max(1,this._currentPage-Math.floor(h/2)),u=Math.min(s.totalPages,d+h-1);d=Math.max(1,u-h+1);for(let e=d;e<=u;e++){const t=e===this._currentPage,n=c(e,()=>this.page(e),!1,!1,`Page ${e}`);t&&(n.setAttribute("aria-current","page"),n.style.background="var(--dm-primary, #007bff)",n.style.color="var(--dm-primary-text, #fff)",n.style.borderColor="var(--dm-primary, #007bff)"),l.appendChild(n)}l.appendChild(c(cc.html("chevron-right",{size:14}),()=>this.nextPage(),this._currentPage===s.totalPages,!0,"Next page")),l.appendChild(c(cc.html("chevrons-right",{size:14}),()=>this.lastPage(),this._currentPage===s.totalPages,!0,"Last page")),n.appendChild(r),n.appendChild(o),n.appendChild(l),i.appendChild(n)}return this.element.appendChild(i),this._reinitRenderedContent(),e.onRender&&e.onRender(this),this}_reinitRenderedContent(){try{cc.scan(this.element)}catch{}const e="undefined"!=typeof window&&window.Domma&&window.Domma.elements&&window.Domma.elements.tooltip;"function"==typeof e&&this.element.querySelectorAll("[data-tooltip]").forEach(t=>{try{e(t,{position:"top",trigger:"hover",delay:{show:200,hide:0}})}catch{}})}_addEventHandler(e,t,n){e.addEventListener(t,n),this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push({event:t,handler:n})}_clearEventListeners(){for(const[e,t]of this._eventListeners)for(const{event:n,handler:s}of t)e.removeEventListener(n,s);this._eventListeners.clear()}_restoreIconsBeforeRebuild(){this.element.querySelectorAll('svg[data-icon-processed="true"][data-original-icon]').forEach(e=>{const t=e.getAttribute("data-original-icon");if(t){const n=document.createElement("span");n.setAttribute("data-icon",t);const s=e.getAttribute("data-icon-size"),i=e.getAttribute("data-icon-color")||e.getAttribute("data-icon-colour"),o=e.getAttribute("data-icon-class");s&&n.setAttribute("data-icon-size",s),i&&n.setAttribute("data-icon-colour",i),o&&n.setAttribute("data-icon-class",o),e.replaceWith(n)}})}on(e,t){if(["sort","filter","page","select","edit","render"].includes(e)){const n="on"+e.charAt(0).toUpperCase()+e.slice(1);this.options[n]=t}return this}off(e){const t="on"+e.charAt(0).toUpperCase()+e.slice(1);return this.options[t]=null,this}refresh(){return this._applyFiltersAndSort(),this.render(),this}destroy(){this._clearEventListeners(),this.element&&(this.element.innerHTML="")}}const dc={_instances:new Map,create(e,t={}){const n="string"==typeof e?document.querySelector(e):e,s=new hc(n,t);return n&&this._instances.set(n,s),s},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()}},uc=["fontFamily","fontSize","fontWeight","fontStyle","fontVariant","fontStretch","fontFeatureSettings","fontKerning","fontVariationSettings","lineHeight","letterSpacing","wordSpacing","textIndent","textAlign","textTransform","direction","tabSize","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],pc=new WeakMap,mc=new WeakMap,fc=new Set(["text","search","url","tel"]);function _c(e){return!!e&&!e.disabled&&!e.readOnly&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName&&fc.has(e.type)||"true"===e.getAttribute?.("contenteditable")||""===e.getAttribute?.("contenteditable"))}const gc="domma:editor-caret",vc="dm-editor-caret-preference";function bc(e=globalThis.window){try{const t=e.localStorage.getItem(gc);return["smooth","native"].includes(t)?t:"auto"}catch{return"auto"}}function yc(e){if(!_c(e))return{refresh(){},destroy(){}};const t=pc.get(e);if(t)return t;const n=e.ownerDocument,s=n.defaultView,i=e.parentElement,o="INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName,r="INPUT"===e.tagName,a=()=>e.getRootNode().activeElement===e;if(!i||!s?.ResizeObserver||!s.matchMedia)return{refresh(){},destroy(){}};const l=s.matchMedia("(prefers-reduced-motion: reduce)"),c=s.matchMedia("(forced-colors: active)");let h="",d=!1;const u=n.createElement("div");u.setAttribute("aria-hidden","true"),u.style.cssText="position:fixed;left:-100000px;top:0;visibility:hidden;pointer-events:none;box-sizing:border-box;height:auto;min-height:0;border-style:solid;";const p=n.createTextNode(""),m=n.createElement("span");u.append(p,m),o||n.body.appendChild(u);const f=n.createElement("div");f.className="dm-smooth-caret-layer",f.setAttribute("aria-hidden","true"),f.style.cssText="position:absolute;overflow:hidden;pointer-events:none;z-index:3;display:none;";const _=n.createElement("span");_.className="dm-smooth-caret",_.style.cssText="position:absolute;top:0;left:0;width:2px;pointer-events:none;will-change:transform;",f.appendChild(_),i.appendChild(f);let g=null,v=null,b=null,y=!1,k=!1,w=!1,x=null,M=!0,L=null,C=bc(s);const A=[];function E(e,t,n,s){e.addEventListener(t,n,s),A.push(()=>e.removeEventListener(t,n,s))}function S(){f.style.display="none",x=null,clearTimeout(v),b?.cancel(),L&&(L.value?e.style.setProperty("caret-color",L.value,L.priority):e.style.removeProperty("caret-color"),L=null)}function $(){if(g=null,w)return;const t=o?n.getSelection():null,A=o?!t?.isCollapsed||!e.contains(t?.anchorNode):e.selectionStart!==e.selectionEnd,E="native"===C||"auto"===C&&l.matches;if(e.dataset.caretMode=c.matches?"forced-colors":E?"native"===C?"native":"system-reduced-motion":"smooth",!a()||!_c(e)||y||k||E||c.matches||A||!e.getClientRects().length)return void S();d||"static"!==s.getComputedStyle(i).position||(h=i.style.position,i.style.position="relative",d=!0);const $=s.getComputedStyle(e),z=e.getBoundingClientRect(),T=i.getBoundingClientRect();let B,j,O,D;if(o){const i=t.getRangeAt(0).cloneRange();let o=i.startContainer,r=1===o.nodeType?o:o.parentElement;if(1===o.nodeType){const e=o.childNodes[i.startOffset],t=o.childNodes[i.startOffset-1],a=e||t;if(a){const t=n.createTreeWalker(a,s.NodeFilter.SHOW_TEXT),l=[];if(3===a.nodeType&&a.length)l.push(a);else{let e;for(;e=t.nextNode();)e.length&&l.push(e)}const c=e?l[0]:l[l.length-1];c?(i.setStart(c,e?0:c.length),i.collapse(!0),o=c):1===a.nodeType&&"BR"!==a.tagName&&(r=a)}}let a=i.getClientRects()[0],l=!1;if((!a||!a.height)&&3===o.nodeType&&o.length){const e=i.startOffset;i.setStart(o,e>0?e-1:0),i.setEnd(o,e>0?e:1),a=i.getClientRects()[0],l=e>0}const c=1===o.nodeType?r:o.parentElement,h=s.getComputedStyle(c||e);if(D=parseFloat(h.lineHeight)||1.2*parseFloat(h.fontSize),O=a?.height||1.2*parseFloat(h.fontSize),a?.height)B=(l?a.right:a.left)-z.left,j=a.top-z.top;else{const t=(c||e).getBoundingClientRect();B=t.left-z.left+parseFloat(h.paddingLeft),j=t.top-z.top+parseFloat(h.paddingTop)}}else{for(const e of uc)u.style[e]=$[e];u.style.width=e.clientWidth+parseFloat($.borderLeftWidth)+parseFloat($.borderRightWidth)+"px",u.style.whiteSpace=r||"off"===e.wrap?"pre":"pre-wrap",u.style.overflowWrap=r||"off"===e.wrap?"normal":"break-word",p.data=e.value.slice(0,e.selectionStart),m.textContent=e.value.slice(e.selectionStart)||"";const t=m.getClientRects()[0];if(!t)return void S();const n=u.getBoundingClientRect();B=t.left-n.left-e.scrollLeft,D=parseFloat($.lineHeight)||1.2*parseFloat($.fontSize),O=Math.min(D,1.2*parseFloat($.fontSize)),j=r?e.clientTop+(e.clientHeight-O)/2:t.top-n.top-e.scrollTop}if(B<e.clientLeft||B>e.clientLeft+e.clientWidth||j+O<e.clientTop||j>=e.clientTop+e.clientHeight)return void S();const N=L?L.color:$.caretColor;f.style.left=z.left-T.left+i.scrollLeft-i.clientLeft+"px",f.style.top=z.top-T.top+i.scrollTop-i.clientTop+"px",f.style.width=z.width+"px",f.style.height=z.height+"px",_.style.height=O+"px",_.style.background="auto"===N||"transparent"===N?$.color:N,_.style.transition=!M&&x&&Math.abs(j-x.y)<1.5*D?"transform 100ms cubic-bezier(.2,.7,.3,1)":"none",_.style.transform=`translate(${B}px, ${j}px)`,f.style.display="block",L||(L={value:e.style.getPropertyValue("caret-color"),priority:e.style.getPropertyPriority("caret-color"),color:N},e.style.setProperty("caret-color","transparent","important")),b?.cancel(),_.style.opacity="1",clearTimeout(v),v=setTimeout(()=>{!w&&"none"!==f.style.display&&_.animate&&(b=_.animate([{opacity:1},{opacity:0}],{duration:1e3,iterations:1/0,easing:"steps(2, jump-none)"}))},500),x={x:B,y:j},M=!1}function z(e=!1){w||(M||=e,null===g&&(g=s.requestAnimationFrame($)))}for(const t of["input","keyup","select","selectionchange"])E(e,t,()=>z());E(n,"selectionchange",()=>{a()&&z()}),E(e,"focus",()=>z(!0)),E(e,"blur",S),E(s,"blur",S),E(s,"focus",()=>z(!0)),E(e,"scroll",()=>z(!0),{passive:!0}),E(e,"pointerdown",()=>{k=!0,S()}),E(n,"pointerup",()=>{k&&(k=!1,z(!0))}),E(e,"compositionstart",()=>{y=!0,S()}),E(e,"compositionend",()=>{y=!1,z(!0)});const T=e=>{C=e.type===vc?e.detail:bc(s),z(!0)};E(s,vc,T),E(s,"storage",T),E(n,"pointercancel",()=>{k=!1,z(!0)}),E(l,"change",()=>z(!0)),E(c,"change",()=>z(!0));const B=new s.ResizeObserver(()=>z(!0));B.observe(e),z(!0);const j={refresh(){z(!0)},destroy(){if(!w){w=!0,pc.delete(e),S(),null!==g&&s.cancelAnimationFrame(g),B.disconnect();for(const e of A)e();delete e.dataset.caretMode,u.remove(),f.remove(),d&&(i.style.position=h)}}};return pc.set(e,j),j}const kc={attach:yc,install:function(e=globalThis.document){if(!e?.addEventListener)return{destroy(){}};const t=mc.get(e);if(t)return t;const n=e.ownerDocument||e;let s=null;const i=()=>{s?.api.destroy(),s=null,o?.disconnect()},o=n.defaultView?.MutationObserver?new n.defaultView.MutationObserver(()=>{s&&!s.element.isConnected&&i()}):null,r=e=>{const t=(e.composedPath?.()||[e.target]).find(_c);t&&s?.element!==t&&(i(),pc.has(t)||(s={element:t,api:yc(t)},o?.observe(n,{childList:!0,subtree:!0})))},a=e=>{s&&(e.composedPath?.()||[e.target]).includes(s.element)&&i()};e.addEventListener("focusin",r,!0),e.addEventListener("focusout",a,!0);const l=n.activeElement;l&&r({target:l,composedPath:()=>[l]});const c={destroy(){i(),e.removeEventListener("focusin",r,!0),e.removeEventListener("focusout",a,!0),mc.delete(e)}};return mc.set(e,c),c},getPreference:bc,setPreference:function(e,t=globalThis.window){const n=["smooth","native"].includes(e)?e:"auto";try{t.localStorage.setItem(gc,n)}catch{}t.dispatchEvent(new t.CustomEvent(vc,{detail:n}))}},wc={apiUrl:null,token:null,user:null,config:{},eventHandlers:{},initialized:!1,init(e={}){this.config={apiUrl:e.apiUrl||(()=>{if("undefined"==typeof window)return"http://localhost:3000/api";const{hostname:e,origin:t}=window.location;return"localhost"===e||"127.0.0.1"===e?`http://${e}:3000/api`:`${t}/api`})(),storageKey:e.storageKey||"auth_token",userStorageKey:e.userStorageKey||"auth_user",autoCheck:!1!==e.autoCheck},this.apiUrl=this.config.apiUrl,this.token=me.get(this.config.storageKey),this.user=me.get(this.config.userStorageKey),this.config.autoCheck&&this.token&&this._verifyToken().catch(e=>{this._isTokenRejection(e)&&this.emit("tokenExpired",null)}),this.initialized=!0},async login(e,t){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const n=await b.post(`${this.apiUrl}/auth/login`,{email:e,password:t});if(!n.success||!n.token)throw new Error(n.message||"Login failed");return this.token=n.token,this.user=n.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("login",this.user),this.user}catch(e){throw this.emit("error",e.message||"Login failed"),e}},async register(e,t,n){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const s=await b.post(`${this.apiUrl}/auth/register`,{email:e,password:t,name:n});if(!s.success||!s.token)throw new Error(s.message||"Registration failed");return this.token=s.token,this.user=s.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("register",this.user),this.user}catch(e){throw this.emit("error",e.message||"Registration failed"),e}},logout(){this.token=null,this.user=null,this._clearToken(),this._clearUser(),this.emit("logout",null)},getUser(){return this.user},isAuthenticated(){return!!this.token&&!!this.user},getHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}},getApiUrl(){return this.apiUrl},getRole(){return this.user?.role||null},hasRole(e){return this.user?.role===e},hasAnyRole(e){return e.includes(this.user?.role)},isAdmin(){return"admin"===this.user?.role},isSubscriber(){return"subscriber"===this.user?.role},isGuest(){return"guest"===this.user?.role},async _verifyToken(){if(!this.token)throw new Error("No token to verify");try{const e=await b.get(`${this.apiUrl}/auth/me`,{headers:this.getHeaders(),silent:!0});if(!e||!e.success||!e.user){const e=new Error("Token verification failed");throw e.tokenRejected=!0,e}return this.user=e.user,this._storeUser(this.user),this.user}catch(e){throw this._isTokenRejection(e)&&(e.tokenRejected=!0,this._clearToken(),this._clearUser()),e}},_isTokenRejection:e=>!!e&&(!0===e.tokenRejected||401===e.status||403===e.status),_storeToken(e){me.set(this.config.storageKey,e)},_storeUser(e){me.set(this.config.userStorageKey,e)},_clearToken(){me.remove(this.config.storageKey),this.token=null},_clearUser(){me.remove(this.config.userStorageKey),this.user=null},on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)},off(e,t){this.eventHandlers[e]&&(this.eventHandlers[e]=t?this.eventHandlers[e].filter(e=>e!==t):[])},emit(e,t){this.eventHandlers[e]&&this.eventHandlers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in auth event handler for '${e}':`,t)}})}};class xc extends C{static componentName="login-form";static defaults={emailPlaceholder:"your@email.com",passwordPlaceholder:"Enter your password",buttonText:"Login",showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-login-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n required>\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="email"]').value,n=e.querySelector('[name="password"]').value;this.options.onSubmit&&this.options.onSubmit(t,n);try{await wc.login(t,n),this.options.onSuccess&&this.options.onSuccess(wc.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}}class Mc extends C{static componentName="register-form";static defaults={namePlaceholder:"Your name",emailPlaceholder:"your@email.com",passwordPlaceholder:"Create a password",buttonText:"Register",minPasswordLength:6,showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-register-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Name</label>':""}\n <input\n type="text"\n class="form-input"\n name="name"\n placeholder="${e.namePlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Confirm Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="confirmPassword"\n placeholder="Re-enter your password"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n \x3c!-- Honeypot field - hidden from users, bots will fill it --\x3e\n <div class="form-group" style="position: absolute; left: -9999px; opacity: 0; pointer-events: none;" aria-hidden="true">\n <label for="website">Website</label>\n <input\n type="text"\n class="form-input"\n name="website"\n id="website"\n tabindex="-1"\n autocomplete="off">\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="name"]').value,n=e.querySelector('[name="email"]').value,s=e.querySelector('[name="password"]').value,i=e.querySelector('[name="confirmPassword"]').value;if(e.querySelector('[name="website"]').value)return console.warn("[Auth] Honeypot triggered - possible bot detected"),void(this.options.onError&&this.options.onError(new Error("Registration failed. Please try again.")));if(s===i){this.options.onSubmit&&this.options.onSubmit(n,s,t);try{await wc.register(n,s,t),this.options.onSuccess&&this.options.onSuccess(wc.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}else this.options.onError&&this.options.onError(new Error("Passwords do not match. Please try again."))}}class Lc extends C{static componentName="auth-tabs";static defaults={activeTab:"login",loginText:"Login",registerText:"Register",onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();this.element.querySelectorAll("[data-tab]").forEach(e=>{this._addEventListener(e,"click",()=>{this.switchTab(e.getAttribute("data-tab"))})})}render(){const e=this.options,t=`\n <div class="btn-group btn-group-block" style="margin-bottom: 1.5rem;">\n <button class="btn ${"login"===e.activeTab?"active":""}" data-tab="login">\n ${e.loginText}\n </button>\n <button class="btn ${"register"===e.activeTab?"active":""}" data-tab="register">\n ${e.registerText}\n </button>\n </div>\n `;this.element.innerHTML=t}switchTab(e){this.options.activeTab=e;this.element.querySelectorAll("[data-tab]").forEach(t=>{t.getAttribute("data-tab")===e?t.classList.add("active"):t.classList.remove("active")}),this.options.onChange&&this.options.onChange(e)}}class Cc extends C{static componentName="user-info";static defaults={showIcon:!0,showRole:!0,logoutText:"Logout",onLogout:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.render(),this._addEventListener(this.element,"click",e=>{e.target.closest?.(".auth-logout-btn")&&this.handleLogout()}),this._onAuthChange=()=>this.render(),wc.on("login",this._onAuthChange),wc.on("logout",this._onAuthChange))}destroy(){wc.off("login",this._onAuthChange),wc.off("logout",this._onAuthChange),super.destroy()}render(){const e=this.options,t=wc.getUser();if(!t)return void(this.element.innerHTML="");this.element.innerHTML="";const n=document.createElement("div");n.className="auth-user-info";const s=document.createElement("span");if(s.className="auth-user-email",e.showIcon){const e=document.createElement("span");e.setAttribute("data-icon","user"),e.setAttribute("data-icon-size","18"),s.appendChild(e)}const i=document.createTextNode(t.email);if(s.appendChild(i),!1!==e.showRole&&t.role){const e={admin:"badge-danger",subscriber:"badge-primary",guest:"badge-secondary"}[t.role]||"badge-secondary",n=document.createElement("span");n.className=`badge ${e}`,n.textContent=t.role.charAt(0).toUpperCase()+t.role.slice(1),s.appendChild(n)}const o=document.createElement("button");o.className="auth-logout-btn",o.textContent=e.logoutText,n.appendChild(s),n.appendChild(o),this.element.appendChild(n)}handleLogout(){wc.logout(),this.options.onLogout&&this.options.onLogout()}}wc.LoginForm=xc,wc.RegisterForm=Mc,wc.AuthTabs=Lc,wc.UserInfo=Cc,wc.createLoginForm=(e,t)=>new xc(e,t),wc.createRegisterForm=(e,t)=>new Mc(e,t),wc.createAuthTabs=(e,t)=>new Lc(e,t),wc.createUserInfo=(e,t)=>new Cc(e,t);const Ac={_routes:[],_views:{},_currentRoute:null,_container:null,_defaultRoute:"/",_notFoundView:null,_middleware:[],_transitioning:!1,_routing:!1,_missedChange:!1,_shownPath:null,_transitions:{},_initialised:!1,_templateCache:{},init(e={}){if(this._initialised)return console.warn("[Domma Router] Already initialised"),this;if(this._container=document.querySelector(e.container),!this._container)throw new Error(`[Domma Router] Container "${e.container}" not found`);return this._routes=e.routes||[],this._views=e.views||{},this._defaultRoute=e.default||"/",this._notFoundView=e.notFound||"404",this._transitions=e.transitions||{enter:"fadeIn",leave:"fadeOut",duration:200},this._onHashChange=()=>this._runRouteChange(),window.addEventListener("hashchange",this._onHashChange),this._runRouteChange(),this._initialised=!0,pl.publish("router:ready",{router:this}),this},navigate(e,t={}){this._initialised?t.replace?window.location.replace(`#${e}`):window.location.hash=e:console.error("[Domma Router] Router not initialised. Call R.init() first.")},back(){window.history.back()},forward(){window.history.forward()},current(){return this._currentRoute},view(e,t){return this._views[e]=t,this},route(e){return this._routes.push(e),this},use(e){return this._middleware.push(e),this},destroy(){this._onHashChange&&(window.removeEventListener("hashchange",this._onHashChange),this._onHashChange=null),this._routes=[],this._views={},this._middleware=[],this._currentRoute=null,this._shownPath=null,this._routing=!1,this._missedChange=!1,this._initialised=!1},_runRouteChange(){const e=this._handleRouteChange();return e&&"function"==typeof e.catch&&e.catch(e=>this._reportError(e,window.location.hash.slice(1)||this._defaultRoute)),e},_reportError(e,t,n){console.error(`[Domma Router] Error on ${t}:`,e),pl.publish("router:error",{error:e,route:t,view:n})},async _handleRouteChange(){if(this._routing||this._transitioning)this._missedChange=!0;else{this._routing=!0;try{await this._routeOnce();let e=0;for(;this._missedChange&&e<5;e++){this._missedChange=!1;const e=window.location.hash.slice(1)||this._defaultRoute;if(this._shownPath===e)break;await this._routeOnce()}this._missedChange&&e>=5&&setTimeout(()=>this._handleRouteChange(),0)}finally{this._routing=!1,this._missedChange=!1}}},async _routeOnce(){const e=window.location.hash.slice(1)||this._defaultRoute,{route:t,params:n}=this._matchRoute(e);if(!t){const t=await this._renderNotFound(e);return this._matchRoute(e).route||(this._shownPath=e),t}const s=this._currentRoute,i={...t,params:n,query:this._parseQuery(e),path:e},o=await this._runMiddleware(i,s);if(!0===o){if(s?.onLeave){if(!1===await s.onLeave())return void this._restoreAddress(e)}if(pl.publish("router:beforeChange",{from:s,to:i}),t.onEnter){if(!1===await t.onEnter(n,i))return void this._restoreAddress(e)}t.title&&(document.title=t.title),await this._renderView(t.view,n),this._currentRoute=i,this._shownPath=e,pl.publish("router:afterChange",{from:s,to:i})}else o&&"string"==typeof o.redirect?window.location.replace(`#${o.redirect}`):this._restoreAddress(e)},_restoreAddress(e){const t=this._shownPath;if(null==t||t===e)return;(window.location.hash.slice(1)||this._defaultRoute)===e&&window.history&&"function"==typeof window.history.replaceState&&window.history.replaceState(window.history.state,"",`#${t}`)},_stripQuery(e){const t=String(e),n=t.indexOf("?");return-1===n?t:t.slice(0,n)},_parseQuery(e){const t=String(e),n=t.indexOf("?");if(-1===n)return{};try{return Object.fromEntries(new URLSearchParams(t.slice(n+1)))}catch{return{}}},_decode(e){try{return decodeURIComponent(e)}catch{return e}},_matchRoute(e){e=this._stripQuery(e);for(const t of this._routes){const n=this._extractParams(t.path,e);if(null!==n)return{route:t,params:n}}return{route:null,params:{}}},_extractParams(e,t){const n=e.split("/").filter(Boolean),s=t.split("/").filter(Boolean);if(n.length!==s.length)return null;const i={};for(let e=0;e<n.length;e++)if(n[e].startsWith(":"))i[n[e].slice(1)]=this._decode(s[e]);else if(n[e]!==s[e]&&n[e]!==this._decode(s[e]))return null;return i},async _runMiddleware(e,t){for(const n of this._middleware){let s=!1,i=null;const o=e=>{s=!0,"string"==typeof e&&(i=e)};if(await n(e,t,o),!s)return!1;if(null!==i)return{redirect:i}}return!0},async _renderView(e,t){this._transitioning=!0;try{const n=this._views[e];if(!n)return void console.error(`[Domma Router] View "${e}" not found`);const s=_(this._container);await new Promise(e=>{s.fadeOut(this._transitions.duration,e)}),await this._renderContent(n,t,s),await new Promise(e=>{s.fadeIn(this._transitions.duration,e)})}catch(t){this._showContainer(),this._reportError(t,window.location.hash.slice(1)||this._defaultRoute,e)}finally{this._transitioning=!1}},_showContainer(){const e=this._container&&(this._container[0]||this._container);e&&e.style&&(e.style.display="",e.style.opacity="",e.style.transition="")},async _loadTemplate(e){if(this._templateCache[e])return this._templateCache[e];try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template: ${e} (${t.status})`);const n=await t.text();return this._templateCache[e]=n,n}catch(e){throw console.error("[Domma Router] Template load error:",e),e}},async _renderContent(e,t,n){let s;if("object"==typeof e&&e.component&&!Array.isArray(e)){const s=e.component,i=n[0]||n,o="function"==typeof e.props?e.props(t):e.props||{},r=document.createElement(s);for(const[e,t]of Object.entries(o)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?r.setAttribute(n,""):!1!==t&&null!=t&&r.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;i.firstChild;)i.removeChild(i.firstChild);return i.appendChild(r),void("function"==typeof e.onMount&&e.onMount(n))}if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(s=await e(t),n.html(s,{safe:!1}),cc.scan(this._container)):"string"==typeof e&&(s=this._renderTemplate(e,t),n.html(s,{safe:!1}),cc.scan(this._container));else{let i=e.template;!i&&e.templateUrl&&(i=await this._loadTemplate(e.templateUrl));let o={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));o=Object.fromEntries(n)}"function"==typeof i?s=await i(t):"string"==typeof i&&(s=this._renderTemplate(i,t,o)),n.html(s,{safe:!1}),cc.scan(this._container),e.onMount&&"function"==typeof e.onMount&&e.onMount(n)}},_renderTemplate:(e,t,n={})=>"function"==typeof y.render?y.render(e,t||{},{partials:n}):e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]||""),async _renderNotFound(e){if(this._views[this._notFoundView])await this._renderView(this._notFoundView,{path:e});else{const t=this._container;t.textContent="";const n=document.createElement("div");n.style.cssText="text-align: center; padding: 4rem 1rem;";const s=document.createElement("h1");s.style.cssText="font-size: 4rem; margin-bottom: 1rem;",s.textContent="404";const i=document.createElement("p");i.style.cssText="font-size: 1.25rem; color: #666;",i.textContent=`Page not found: ${e}`;const o=document.createElement("a");o.href="#/",o.style.cssText="color: #3b82f6; text-decoration: underline; margin-top: 1rem; display: inline-block;",o.textContent="Go Home",n.appendChild(s),n.appendChild(i),n.appendChild(o),t.appendChild(n)}}},Ec=new Set(["zero","one","two","few","many","other"]),Sc=new Set(["ordinal","select"]),$c=/^=-?\d+(\.\d+)?$/,zc=/\{([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\}/g,Tc=new Set(["ar","arc","ckb","dv","fa","he","iw","ks","ps","sd","syr","ug","ur","yi","ji"]),Bc=new Set(["Arab","Hebr","Thaa","Syrc","Nkoo","Adlm","Rohg","Mand","Samr"]),jc=new Map,Oc=new Map,Dc=new Map,Nc=new Map,Ic=new Map,Hc=new Set,Wc=new WeakMap;let Pc="en",Fc=[],Rc=null,Vc=null;const qc=e=>null!==e&&"object"==typeof e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e));function Uc(e){return!!qc(e)&&("string"==typeof e.select||"string"==typeof e.other&&Object.keys(e).every(e=>Ec.has(e)||Sc.has(e)||$c.test(e)))}function Kc(e,t,n){for(const s of Object.keys(e)){const i=e[s],o=t?`${t}.${s}`:s;if(null!=i)if("string"==typeof i)n.set(o,i);else if("number"==typeof i||"boolean"==typeof i)n.set(o,String(i));else if(Uc(i)){const e=Object.create(null);for(const t of Object.keys(i))e[t]=i[t];n.set(o,e)}else qc(i)&&Kc(i,o,n)}return n}function Yc(e){if("string"!=typeof e||!e.trim())throw new RangeError(`Domma i18n: invalid locale "${e}"`);const t=e.trim().replace(/_/g,"-");return"undefined"!=typeof Intl&&"function"==typeof Intl.getCanonicalLocales?Intl.getCanonicalLocales(t)[0]:t}function Gc(e){const t=[],n=e.split("-");for(let e=n.length;e>0;e--)t.push(n.slice(0,e).join("-"));return t}function Jc(e){const t=new Set;for(const n of[e,...Fc])for(const e of Gc(n))t.add(e);return[...t]}function Xc(e,t){for(const n of Jc(t)){const t=jc.get(n);if(t&&t.has(e))return{message:t.get(e),locale:n}}return null}function Zc(e,t){if(!e)return;let n=e;for(const e of t.split(".")){if(null==n||"object"!=typeof n||!Object.prototype.hasOwnProperty.call(n,e))return;n=n[e]}return n}function Qc(e,t,n){return t&&"string"==typeof e&&-1!==e.indexOf("{")?e.replace(zc,(e,s)=>{const i=Zc(t,s);return void 0===i?e:n(null==i?"":String(i))}):e}function eh(e,t,n,s){if("string"==typeof e.select){const n=Zc(t,e.select),s=null!=n&&"select"!==n&&"string"==typeof e[String(n)]?e[String(n)]:e.other;return"string"==typeof s?s:""}const i=Number(Zc(t,"count"));if(!Number.isFinite(i))return e.other;if("string"==typeof e[`=${i}`])return e[`=${i}`];if(0===i&&"string"==typeof e.zero)return e.zero;const o=s&&s.ordinal||!0===e.ordinal?"ordinal":"cardinal";let r="other";try{r=function(e,t){return sh("plural",e,{type:t},()=>new Intl.PluralRules(e,{type:t}))}(n,o).select(i)}catch{}return"string"==typeof e[r]?e[r]:e.other}function th(e,t){const n=Ic.get(e);if(n)for(const s of[...n])try{s(t)}catch(t){console.error(`Domma i18n: error in "${e}" listener`,t)}"undefined"!=typeof document&&"undefined"!=typeof CustomEvent&&document.dispatchEvent(new CustomEvent(`dm:i18n:${e}`,{detail:t}))}function nh(e){if(!e||"object"!=typeof e)return[Pc,void 0];const{locale:t,...n}=e;return[t?Yc(t):Pc,n]}function sh(e,t,n,s){const i=`${e}|${t}|${n?JSON.stringify(n):""}`;let o=Nc.get(i);return o||(o=s(),Nc.set(i,o)),o}const ih={add(e,t){const n=Yc(e);if(!qc(t))return ih;let s=jc.get(n);s||(s=new Map,jc.set(n,s));for(const[e,n]of Kc(t,"",new Map))s.set(e,n);return ih},load(e,t,n={}){const s=Yc(e),i="function"==typeof t;let o=Oc,r=`${s}|${i?"":String(t).replace("{locale}",s)}`;if(i&&(Dc.has(s)||Dc.set(s,new Map),o=Dc.get(s),r=t),o.has(r)&&!n.reload)return o.get(r);const a=(i?Promise.resolve().then(()=>t(s)):b.get(String(t).replace("{locale}",s))).then(e=>{const t=qc(e)?e:{};return ih.add(s,t),th("loaded",{locale:s,messages:t}),Jc(Pc).includes(s)&&ih.translate(),t},e=>{throw o.get(r)===a&&o.delete(r),e});return o.set(r,a),a},locale(e){if(void 0===e)return Pc;const t=Yc(e);if(t===Pc)return Pc;const n=Pc;return Pc=t,Vc&&me.set(Vc,t),ah(t),th("change",{locale:t,previous:n}),ih.translate(),Pc},fallback:e=>(void 0===e||(Fc=(Array.isArray(e)?e:[e]).filter(Boolean).map(Yc)),[...Fc]),has:(e,t={})=>null!==Xc(e,t.locale?Yc(t.locale):Pc),t:(e,t,n={})=>rh(e,t,n,String),html:(e,t,n={})=>rh(e,t,n,o),onMissing:e=>(Rc="function"==typeof e?e:null,ih),on:(e,t)=>"function"!=typeof t?()=>{}:(Ic.has(e)||Ic.set(e,new Set),Ic.get(e).add(t),()=>ih.off(e,t)),off:(e,t)=>(t?Ic.get(e)?.delete(t):Ic.delete(e),ih),locales:()=>[...jc.keys()],dir(e=Pc){const t=Yc(e);try{const e=new Intl.Locale(t),n="function"==typeof e.getTextInfo?e.getTextInfo():e.textInfo;if(n&&n.direction)return"rtl"===n.direction?"rtl":"ltr";if(e.script)return Bc.has(e.script)?"rtl":"ltr"}catch{}const n=t.split("-"),s=n.find(e=>4===e.length);return s?Bc.has(s[0].toUpperCase()+s.slice(1).toLowerCase())?"rtl":"ltr":Tc.has(n[0].toLowerCase())?"rtl":"ltr"},translate(e){if("undefined"==typeof document)return 0;const t="[data-i18n],[data-i18n-html],[data-i18n-attr]",n=new Set;for(const s of function(e){return null==e?[document]:"string"==typeof e?[...document.querySelectorAll(e)]:"function"!=typeof e.get||"number"!=typeof e.length||e.nodeType?"number"!=typeof e.length||e.nodeType?[e]:[...e]:e.get()}(e))s&&(1===s.nodeType&&s.matches(t)&&n.add(s),"function"==typeof s.querySelectorAll&&s.querySelectorAll(t).forEach(e=>n.add(e)));for(const e of n)ph(e);return n.size},detect(e={}){const{from:t=["storage","navigator","html"],supported:n,fallback:s,apply:i=!0}=e;e.storageKey&&(Vc=e.storageKey);const o=Array.isArray(n)&&n.length?n.map(Yc):null,r=e=>{let t;try{t=Yc(e)}catch{return null}if(!o)return t;if(o.includes(t))return t;const n=t.split("-")[0];return o.find(e=>e===n)||o.find(e=>e.split("-")[0]===n)||null};let a=null;for(const e of t){let t=[];"storage"===e&&Vc?t=[me.get(Vc)]:"navigator"===e&&"undefined"!=typeof navigator?t=navigator.languages&&navigator.languages.length?[...navigator.languages]:[navigator.language]:"html"===e&&"undefined"!=typeof document&&document.documentElement&&(t=[document.documentElement.getAttribute("lang")]);for(const e of t)if("string"==typeof e&&e&&(a=r(e)))break;if(a)break}const l=a||(s?Yc(s):Pc);return i&&(l===Pc?(Vc&&me.set(Vc,l),ah(l)):ih.locale(l)),l},number(e,t){const[n,s]=nh(t);return sh("number",n,s,()=>new Intl.NumberFormat(n,s)).format(e)},currency(e,t,n){const[s,i]=nh(n),o={...i,style:"currency",currency:t};return sh("number",s,o,()=>new Intl.NumberFormat(s,o)).format(e)},date(e,t){const n=(s=e)instanceof Date?s:s&&"function"==typeof s.toDate?s.toDate():null==s?new Date:new Date(s);var s;if(Number.isNaN(n.getTime()))return"";const[i,o]=nh(t);return sh("date",i,o,()=>new Intl.DateTimeFormat(i,o)).format(n)},relative(e,t,n){const[s,i]=nh(n);return sh("relative",s,i,()=>new Intl.RelativeTimeFormat(s,i)).format(e,t)},list(e,t){const[n,s]=nh(t);return sh("list",n,s,()=>new Intl.ListFormat(n,s)).format([...e].map(String))},reset:()=>(jc.clear(),Oc.clear(),Dc.clear(),Nc.clear(),Ic.clear(),Hc.clear(),hh.clear(),Pc="en",Fc=[],Rc=null,Vc=null,ih)};function oh(e,t,n,i){const o=n&&n.locale?Yc(n.locale):Pc,r=Xc(e,o);let a;if(r)a="string"==typeof r.message?r.message:eh(r.message,t,r.locale,n);else if(a=function(e,t){let n;if(th("missing",{key:e,locale:t}),Rc)try{n=Rc(e,t)}catch(e){console.error("Domma i18n: error in onMissing hook",e)}const i=`${t}|${e}`;return Hc.has(i)||!1===s("i18nWarnings",!0)||"undefined"==typeof console||(Hc.add(i),console.warn(`Domma i18n: missing translation "${e}" for locale "${t}" (window.DommaOptions = {i18nWarnings: false} silences this)`)),"string"==typeof n?n:void 0}(e,o),void 0===a)return null;return Qc(a,t,i)}function rh(e,t,n,s){const i=oh(e,t,n,s);return null!==i?i:n&&"string"==typeof n.default?Qc(n.default,t,s):s===String?e:o(e)}function ah(e){"undefined"!=typeof document&&document.documentElement&&(document.documentElement.setAttribute("lang",e),document.documentElement.setAttribute("dir",ih.dir(e)))}const lh=/^(on.*|style|srcdoc|formaction)$/i,ch=new Set(["href","xlink:href","src","action","poster","cite","background","data","codebase","longdesc","manifest","ping","usemap","lowsrc","dynsrc"]),hh=new Set;function dh(e,t){hh.has(e)||"undefined"==typeof console||(hh.add(e),console.warn(t))}function uh(e,t,n){const s=e.toLowerCase();if("srcset"===s){if(t.split(",").every(e=>!e.trim()||l(e.trim().split(/\s+/)[0])))return t}else if(!ch.has(s)||l(t))return t;return dh(`url:${s}:${n}`,`Domma i18n: "${n}" is not a safe URL for ${s}; data-i18n-attr only writes http(s), mailto, tel or relative URLs`),null}function ph(e){let t=Wc.get(e);t||(t={text:e.textContent,html:e.innerHTML,attrs:Object.create(null)},Wc.set(e,t));const n=function(e){const t=e.getAttribute("data-i18n-params");if(t)try{const e=JSON.parse(t);return qc(e)?e:void 0}catch{return void console.warn("Domma i18n: data-i18n-params is not valid JSON",e)}}(e),s=e.getAttribute("data-i18n-html"),i=e.getAttribute("data-i18n");if(s){const i=oh(s,n,null,o);e.innerHTML=null===i?t.html:u(i)}else if(i){const s=oh(i,n,null,String);e.textContent=null===s?t.text:s}const r=e.getAttribute("data-i18n-attr");if(r)for(const[s,i]of function(e){return e.split(";").map(e=>{const t=e.lastIndexOf(":");if(-1===t)return null;const n=e.slice(0,t).trim(),s=e.slice(t+1).trim();return n&&s?[n,s]:null}).filter(Boolean)}(r)){if(lh.test(s)){dh(`attr:${s.toLowerCase()}`,`Domma i18n: data-i18n-attr will not write "${s}" (event handlers, style, srcdoc and formaction are refused)`);continue}s in t.attrs||(t.attrs[s]=e.getAttribute(s));let o=oh(i,n,null,String);null!==o&&(o=uh(s,o,i)),null!==o?e.setAttribute(s,o):null==t.attrs[s]?e.removeAttribute(s):e.setAttribute(s,t.attrs[s])}}const mh=new Map,fh=new Map;function _h(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function gh(e,t={}){if(null==e)return void 0!==t.default?"function"==typeof t.default?t.default():t.default:null;const n=t.type;if(n===pl.types?.number||"number"===n){const t=Number(e);return isNaN(t)?null:t}if(n===pl.types?.boolean||"boolean"===n)return""===e||"true"===e||"false"!==e&&Boolean(e);if(n===pl.types?.array||"array"===n||n===pl.types?.object||"object"===n)try{return JSON.parse(e)}catch{return e}return e}function vh(e,t){if(fh.has(e))return void console.warn(`[Domma Component] "${e}" is already registered.`);const{template:n,templateUrl:s,props:i={},data:o,computed:r={},methods:a={},onBeforeMount:l,onMount:c,onUpdated:h,onBeforeUnmount:d,onUnmount:u,onPropsChanged:p,style:m=""}=t,f=Object.keys(i),_=f.map(_h);class g extends Ls{static get observedAttributes(){return _}constructor(){super(),this._model=null,this._props={},this._bindings=null,this._template=null,this._contentRoot=null,this._context=null,this._unsubs=[],this._computeds=new Map,this._effects=[],this._updateQueued=!1,this._teardown=!1}connectedCallback(){if(this._initialised)return this._teardown=!1,void c?.call(this._ctx());this._initialised=!0,this._initProps(),this._initModel(),this._initComputeds(),this._injectStyles(),this._contentRoot=document.createElement("div"),this._contentRoot.className="dm-component-root",this.shadowRoot.appendChild(this._contentRoot),l?.call(this._ctx()),this._renderComponent().then(()=>{this._wireBindings(),c?.call(this._ctx())})}disconnectedCallback(){this._teardown=!0,d?.call(this._ctx()),this._cleanup();for(const e of this._unsubs)e();this._unsubs=[];for(const e of this._effects)e.dispose();this._effects=[];for(const e of this._computeds.values())e.dispose();this._computeds.clear(),this._model&&this._model.destroy(),u?.call(this._ctx())}attributeChangedCallback(e,t,n){if(t===n)return;const s=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(this._props[s]=gh(n,i[s]),p?.call(this._ctx(),s,t,n),this._initialised&&this._bindings){for(const e of this._computeds.values())e.invalidate();this._rerenderFull()}}_initProps(){for(const e of f){const t=_h(e),n=this.hasAttribute(t)?this.getAttribute(t):null;this._props[e]=gh(n,i[e])}}_initModel(){const e=o?o():{},t={};for(const n of Object.keys(e))t[n]={};this._model=pl.create(t,e)}_initComputeds(){for(const[e,t]of Object.entries(r))this._computeds.set(e,Ai(()=>t.call(this._ctx()),{label:e}))}async _renderComponent(){let e=n;!e&&s&&(e=await async function(e){if(mh.has(e))return mh.get(e);const t=await fetch(e);if(!t.ok)throw new Error(`[Domma Component] Failed to load template: ${e} (${t.status})`);const n=await t.text();return mh.set(e,n),n}(s)),e?(this._template=e,this._bindings=Ya.compile(e,this._mergeData(),this._contentRoot,(e,t)=>y.render(e,t))):this._contentRoot.textContent=""}_rerenderFull(){this._bindings&&(this._bindings.rerenderAll(this._mergeData()),h?.call(this._ctx()))}_wireBindings(){if(this._bindings){for(const e of this._bindings.bindings){const t=[...e.deps].filter(e=>this._computeds.has(e)||!Object.prototype.hasOwnProperty.call(this._props,e));if(0===t.length)continue;let n=!1;const s=Ei(()=>{for(const e of t)this._readBound(e);n?Si(()=>{this._bindings.update(e.id,this._mergeData()),this._scheduleUpdate()}):n=!0},{label:`${this.tagName.toLowerCase()}:${e.id}`});this._effects.push(s)}this._wireUpdateWatcher()}}_wireUpdateWatcher(){if(!h||!this._model)return;let e=!1;const t=Ei(()=>{this._model.get(),e?Si(()=>this._scheduleUpdate()):e=!0},{label:`${this.tagName.toLowerCase()}:updated`});this._effects.push(t)}_readBound(e){return this._computeds.has(e)?this._computeds.get(e).get():Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._model?this._model.get(e):void 0}_scheduleUpdate(){this._updateQueued||(this._updateQueued=!0,Promise.resolve().then(()=>{this._updateQueued=!1,!this._teardown&&this._initialised&&this._bindings&&h?.call(this._ctx())}))}_getStyles(){return""+(m||"")}_ctx(){if(this._context)return this._context;const e=this,t={get data(){return e._model?e._model.tracked():{}},get props(){return{...e._props}},get root(){return e.shadowRoot},get el(){return e},set(t){e._model&&e._model.set(t)}};for(const[n,s]of Object.entries(r))Object.defineProperty(t,n,{get(){const t=e._computeds.get(n);return t?t.get():s.call(e._ctx())},enumerable:!0,configurable:!0});for(const[e,n]of Object.entries(a))t[e]=n.bind(t);return this._context=t,t}_mergeData(){const e=this._model?this._model.toJSON():{},t={};for(const[e,n]of this._computeds.entries())t[e]=n.get();const n={},s=this._ctx();for(const e of Object.keys(a))n[e]=s[e];const i={...n,...e,...this._props,...t},o=this._model;return hi(i,{onWrite:o?(e,t)=>o.set({[e]:t}):void 0})}}const v=e.includes("-")?e:`domma-${e}`;return customElements.define(v,g),fh.set(e,t),g}const bh={define:(e,t)=>vh(e,t),has:e=>fh.has(e),registry:()=>new Map(fh),get templateCache(){return mh}};let yh=!1!==s("cloak",!0);yh&&"undefined"!=typeof document&&document.body?document.body.classList.add("dm-cloaked"):yh&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",()=>{yh&&document.body.classList.add("dm-cloaked")});const kh=(e,t)=>_(e,t);kh.version="0.58.1",kh.buildInfo={version:"0.58.1",built:"25/10/2026 09:04",commit:"bcc485e"},kh.http=b,kh.utils=y,kh.setup=e=>(!1===e.cloak&&(yh=!1,"undefined"!=typeof document&&document.body&&(document.body.classList.remove("dm-cloaked"),document.body.classList.add("dm-ready"))),e.noStyles?B.init({disabled:!0}):(e.theme||e.autoDetectTheme)&&B.init({theme:e.theme,autoDetect:e.autoDetectTheme,persist:!1!==e.persistTheme}),e.scanIcons&&cc.scan(),El.process(e)),kh.update=(e,t)=>El.update(e,t),kh.config=e=>El.config(e),kh.getComponent=e=>El.getComponent(e),kh.reset=e=>El.reset(e),kh.ready=e=>El.ready(e),kh.models=pl,kh.elements=ci,kh.effects=Al,kh.dates=Hl,kh.tables=dc,kh.forms=fl,kh.smoothCaret=kc,kh.theme=B,kh.icons=cc,kh.storage=me,kh.auth=wc,kh.router=Ac,kh.sanitize=p,kh.components=bh,kh.i18n=ih,kh.t=(e,t,n)=>ih.t(e,t,n),kh.component=(e,t)=>vh(e,t),kh.DesktopNotification=Ws;const wh=kh,xh=y,Mh=pl,Lh=Hl,Ch=me,Ah=wc,Eh=fl,Sh=b,$h=ci,zh=cc,Th=dc,Bh=Ac,jh={extend:pl.extend.bind(pl),pick:pl.pick.bind(pl),omit:pl.omit.bind(pl)};if(kh.M=Mh,kh.D=Lh,kh.S=Ch,kh.A=Ah,kh.F=Eh,kh.H=Sh,kh.E=$h,kh.I=zh,kh.T=Th,kh.R=Bh,kh.B=jh,kh.isDomma=e=>e instanceof f,function(e,i){const o={},r={};if(e.noConflict=(n=!1)=>{if("undefined"==typeof window)return e;const s=n?Object.keys(r).filter(e=>"Domma"!==e):t;for(const e of s)r[e]&&window[e]===r[e]&&(void 0===o[e]?delete window[e]:window[e]=o[e],delete r[e]);return e},"undefined"==typeof window)return e;const a=s("globals",!0),l=(e,t)=>{"safe"===a&&"Domma"!==e&&((e,t)=>void 0!==e&&e!==t&&!n(e))(window[e],t)||(o[e]=n(window[e])?void 0:window[e],r[e]=t,window[e]=t)};if(l("Domma",e),!1!==a)for(const[e,t]of Object.entries(i))l(e,t)}(kh,{$:wh,_:xh,M:Mh,D:Lh,S:Ch,A:Ah,F:Eh,H:Sh,E:$h,I:zh,T:Th,R:Bh,B:jh}),"undefined"!=typeof document&&"undefined"!=typeof window){const e=()=>{yh&&document.body.classList.contains("dm-cloaked")&&document.body.classList.add("dm-ready")};"complete"===document.readyState?setTimeout(e,0):window.addEventListener("load",e)}e.$=wh,e.A=Ah,e.B=jh,e.D=Lh,e.Domma=kh,e.E=$h,e.F=Eh,e.H=Sh,e.I=zh,e.M=Mh,e.R=Bh,e.S=Ch,e.T=Th,e._=xh,e.components=bh,e.default=kh,e.i18n=ih,e.smoothCaret=kc,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Domma={})}(this,function(e){"use strict";const t=["$","_"],n=e=>"undefined"!=typeof Element&&e instanceof Element||"undefined"!=typeof HTMLCollection&&e instanceof HTMLCollection;function s(e,t){if("undefined"==typeof window)return t;const n=window.DommaOptions;return n&&"object"==typeof n&&e in n?n[e]:t}const i={"&":"&","<":"<",">":">",'"':""","'":"'"};function o(e){return null==e?"":String(e).replace(/[&<>"']/g,e=>i[e])}const r=/^(https?:|mailto:|tel:)$/;function a(e){if(!e||"string"!=typeof e)return null;try{const t="undefined"!=typeof location?location.href:"http://localhost/",n=new URL(e,t);return r.test(n.protocol)?n.href:null}catch{return null}}function l(e){return null!==a(e)}function c(){return"undefined"!=typeof window&&void 0!==window.DOMPurify}const h={ALLOWED_TAGS:["b","i","em","strong","u","s","mark","small","del","ins","sub","sup","p","br","hr","div","span","blockquote","pre","code","ul","ol","li","dl","dt","dd","h1","h2","h3","h4","h5","h6","a","table","thead","tbody","tfoot","tr","th","td","caption","col","colgroup","img","figure","figcaption","article","section","nav","aside","header","footer","main","time","address"],ALLOWED_ATTR:["href","title","target","rel","class","id","alt","src","width","height","colspan","rowspan","aria-label","aria-describedby","aria-hidden","role"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,FORCE_BODY:!0},d={default:h,strict:{ALLOWED_TAGS:["b","i","em","strong","p","br","a","ul","ol","li"],ALLOWED_ATTR:["href","title","target"],ALLOW_DATA_ATTR:!1},basic:{ALLOWED_TAGS:["b","i","em","strong","br"],ALLOWED_ATTR:[],ALLOW_DATA_ATTR:!1}};function u(e,t={}){if(null==e||""===e)return"";if(e=String(e),c()){const n=t.preset||"default",s={...d[n]||h,...t.allowedTags&&{ALLOWED_TAGS:t.allowedTags},...t.allowedAttrs&&{ALLOWED_ATTR:t.allowedAttrs},...void 0!==t.allowDataAttrs&&{ALLOW_DATA_ATTR:t.allowDataAttrs}};try{return window.DOMPurify.sanitize(e,s)}catch(t){return console.error("DOMPurify sanitisation failed:",t),o(e)}}return console.warn("DOMPurify not available. Using HTML escape fallback. For better XSS protection, include DOMPurify."),o(e)}"undefined"==typeof window||c()||!1===s("purifyWarning",!0)||console.warn("%c⚠️ Security Warning: DOMPurify not loaded","color: orange; font-weight: bold; font-size: 14px;","\nFor robust XSS protection, include DOMPurify before Domma:",'\n<script src="https://cdn.jsdelivr.net/npm/dompurify@3/dist/purify.min.js"><\/script>',"\nCurrently using HTML escape fallback.");var p={sanitise:u,sanitiseBasic:function(e){return u(e,{preset:"basic"})},sanitiseUserContent:function(e){return u(e,{preset:"strict"})},escape:function(e){return o(e)},hasDOMPurify:function(){return c()},isSafeUrl:l,safeUrl:a};const m={TABLE:["<table>","</table>",""],THEAD:["<table><thead>","</thead></table>",":scope > thead"],TBODY:["<table><tbody>","</tbody></table>",":scope > tbody"],TFOOT:["<table><tfoot>","</tfoot></table>",":scope > tfoot"],TR:["<table><tbody><tr>","</tr></tbody></table>",":scope > tbody > tr"],COLGROUP:["<table><colgroup>","</colgroup></table>",":scope > colgroup"]};class f{constructor(e,t){if("string"==typeof e)if(e.trim().startsWith("<")){const t=document.createElement("div");t.innerHTML=e.trim(),this.elements=Array.from(t.children)}else{const n=t||document;this.elements=Array.from(n.querySelectorAll(e))}else e instanceof Node?this.elements=[e]:e instanceof NodeList||e instanceof HTMLCollection?this.elements=Array.from(e):Array.isArray(e)?this.elements=e.filter(e=>e instanceof HTMLElement):this.elements=e instanceof f?[...e.elements]:[];this.length=this.elements.length;for(let e=0;e<this.elements.length;e++)this[e]=this.elements[e]}find(e){const t=[];return this.elements.forEach(n=>{t.push(...n.querySelectorAll(e))}),new f(t)}children(e){const t=[];return this.elements.forEach(e=>{t.push(...e.children)}),new f(e?t.filter(t=>t.matches(e)):t)}parent(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&(e&&!n.parentElement.matches(e)||t.includes(n.parentElement)||t.push(n.parentElement))}),new f(t)}parents(e){const t=[];return this.elements.forEach(n=>{let s=n.parentElement;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.parentElement}),new f(t)}closest(e){const t=[];return this.elements.forEach(n=>{const s=n.closest(e);s&&!t.includes(s)&&t.push(s)}),new f(t)}siblings(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&Array.from(n.parentElement.children).forEach(s=>{s===n||t.includes(s)||e&&!s.matches(e)||t.push(s)})}),new f(t)}next(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new f(t)}nextAll(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.nextElementSibling}),new f(t)}prev(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new f(t)}prevAll(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.unshift(s),s=s.previousElementSibling}),new f(t)}first(){return new f(this.elements[0]?[this.elements[0]]:[])}last(){return new f(this.elements.length?[this.elements[this.elements.length-1]]:[])}eq(e){const t=e<0?this.elements.length+e:e;return new f(this.elements[t]?[this.elements[t]]:[])}get(e){if(void 0===e)return this.elements;const t=e<0?this.elements.length+e:e;return this.elements[t]}filter(e){return new f("function"==typeof e?this.elements.filter((t,n)=>e.call(t,n,t)):this.elements.filter(t=>t.matches(e)))}not(e){return new f("function"==typeof e?this.elements.filter((t,n)=>!e.call(t,n,t)):this.elements.filter(t=>!t.matches(e)))}is(e){return this.elements.some(t=>t.matches(e))}has(e){return new f(this.elements.filter(t=>t.querySelector(e)))}add(e){const t=new f(e),n=[...this.elements];return t.elements.forEach(e=>{n.includes(e)||n.push(e)}),new f(n)}contents(){const e=[];return this.elements.forEach(t=>{e.push(...t.childNodes)}),new f(e)}toArray(){return[...this.elements]}index(e){if(void 0===e){const e=this.elements[0];return e&&e.parentElement?Array.from(e.parentElement.children).indexOf(e):-1}return"string"==typeof e?new f(e).elements.indexOf(this.elements[0]):this.elements.indexOf(e)}each(e){return this.elements.forEach((t,n)=>e.call(t,n,t)),this}html(e,t={}){if(void 0===e){const e=this.elements[0];return e?e.innerHTML:""}if(!1===t.safe)return this.each((t,n)=>{n.innerHTML=e});const n=p.sanitise(e,t);return this.each((s,i)=>{i.innerHTML=m[i.tagName]?function(e,t,n){const s=()=>p.sanitise(t,n),i=m[e.tagName];if(!i||!p.hasDOMPurify()||null==t||""===t)return s();const[o,r,a]=i,l=document.createElement("template");l.innerHTML=p.sanitise(o+String(t)+r,n);const c=l.content.childNodes,h=1===c.length?c[0]:null;if(!h||"TABLE"!==h.nodeName)return s();const d=a?h.querySelector(a):h;return d?d.innerHTML:s()}(i,e,t):n})}text(e){return void 0===e?this.elements.map(e=>e.textContent).join(""):this.each((t,n)=>{n.textContent=e})}val(e){if(void 0===e){const e=this.elements[0];if(!e)return;return"checkbox"===e.type||"radio"===e.type?e.checked?e.value:void 0:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}return this.each((t,n)=>{"checkbox"===n.type||"radio"===n.type?n.checked=Array.isArray(e)?e.includes(n.value):n.value===e:"SELECT"===n.tagName&&n.multiple&&Array.isArray(e)?Array.from(n.options).forEach(t=>{t.selected=e.includes(t.value)}):n.value=e})}attr(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.setAttribute(e,t)})}):void 0===t?this.elements[0]?this.elements[0].getAttribute(e):void 0:this.each((n,s)=>{s.setAttribute(e,t)})}removeAttr(e){const t=e.split(/\s+/);return this.each((e,n)=>{t.forEach(e=>n.removeAttribute(e))})}prop(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n[e]=t})}):void 0===t?this.elements[0]?this.elements[0][e]:void 0:this.each((n,s)=>{s[e]=t})}removeProp(e){return this.each((t,n)=>{delete n[e]})}data(e,t){if(void 0===e){const e=this.elements[0];if(!e)return;const t={};return Object.keys(e.dataset).forEach(n=>{t[n]=e.dataset[n]}),t}return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.dataset[e]=t})}):void 0===t?this.elements[0]?this.elements[0].dataset[e]:void 0:this.each((n,s)=>{s.dataset[e]=t})}removeData(e){return this.each((t,n)=>{delete n.dataset[e]})}css(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.style[e]=t})}):void 0===t?this.elements[0]?getComputedStyle(this.elements[0])[e]:"":this.each((n,s)=>{s.style[e]=t})}addClass(e){if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.add(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.add(...t)})}removeClass(e){if(void 0===e)return this.each((e,t)=>{t.className=""});if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.remove(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.remove(...t)})}toggleClass(e,t){if("function"==typeof e)return this.each((n,s)=>{const i=e.call(s,n,s.className,t);i&&i.split(/\s+/).filter(Boolean).forEach(e=>{s.classList.toggle(e,t)})});const n=e.split(/\s+/).filter(Boolean);return this.each((e,s)=>{n.forEach(e=>{s.classList.toggle(e,t)})})}hasClass(e){return this.elements.some(t=>t.classList.contains(e))}append(e){const t=this.elements.length-1;return this.each((n,s)=>{this._getNodes(e,n,s,n===t).forEach(e=>s.appendChild(e))})}prepend(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.firstChild;i.forEach(e=>s.insertBefore(e,o))})}after(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode,r=s.nextSibling;i.forEach(e=>o.insertBefore(e,r))})}before(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode;i.forEach(e=>o.insertBefore(e,s))})}appendTo(e){return new f(e).append(this),this}prependTo(e){return new f(e).prepend(this),this}insertAfter(e){return new f(e).after(this),this}insertBefore(e){return new f(e).before(this),this}wrap(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);n.parentNode&&(n.parentNode.insertBefore(s,n),s.appendChild(n))})}wrapAll(e){if(0===this.elements.length)return this;const t=this._getWrapper(e,0,this.elements[0]);return this.elements[0].parentNode.insertBefore(t,this.elements[0]),this.elements.forEach(e=>t.appendChild(e)),this}wrapInner(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);for(;n.firstChild;)s.appendChild(n.firstChild);n.appendChild(s)})}unwrap(e){return this.parent(e).each((e,t)=>{const n=t.parentNode;for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}),this}remove(e){return(e?this.filter(e):this).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this}detach(){return this.remove()}empty(){return this.each((e,t)=>{t.innerHTML=""})}clone(e=!0){return new f(this.elements.map(t=>t.cloneNode(e)))}replaceWith(e){const t=this.elements.length-1;return this.each((n,s)=>{const i=this._getNodes(e,n,s,n===t),o=s.parentNode;i.forEach((e,t)=>{0===t?o.replaceChild(e,s):o.insertBefore(e,i[t-1].nextSibling)})})}replaceAll(e){return new f(e).replaceWith(this),this}_getNodes(e,t,n,s=!0){if("function"==typeof e&&(e=e.call(n,t,n.innerHTML)),"string"==typeof e){if(e.trim().startsWith("<")){const t=document.createElement("div");return t.innerHTML=e,Array.from(t.childNodes)}return[document.createTextNode(e)]}return e instanceof HTMLElement?[s?e:e.cloneNode(!0)]:e instanceof f?e.elements.map(e=>s?e:e.cloneNode(!0)):[]}_getWrapper(e,t,n){let s;if("function"==typeof e&&(e=e.call(n,t)),"string"==typeof e){const t=document.createElement("div");t.innerHTML=e.trim(),s=t.firstElementChild}else s=e instanceof HTMLElement?e.cloneNode(!0):e instanceof f?e.elements[0].cloneNode(!0):document.createElement("div");return s}on(e,t,n){"function"==typeof t&&(n=t,t=null);const s=e.split(/\s+/);return this.each((e,i)=>{s.forEach(e=>{if(t){const s=e=>{const s=e.target.closest(t);s&&i.contains(s)&&n.call(s,e)};i.addEventListener(e,s),i._dommaHandlers=i._dommaHandlers||[],i._dommaHandlers.push({event:e,selector:t,handler:n,delegated:s})}else i.addEventListener(e,n)})})}off(e,t,n){return"function"==typeof t&&(n=t,t=null),this.each((s,i)=>{if(e){e.split(/\s+/).forEach(e=>{t&&i._dommaHandlers?i._dommaHandlers=i._dommaHandlers.filter(s=>!!(s.event!==e||s.selector!==t||n&&s.handler!==n)||(i.removeEventListener(e,s.delegated),!1)):n&&i.removeEventListener(e,n)})}})}one(e,t,n){"function"==typeof t&&(n=t,t=null);const s=this,i=function(o){n.call(this,o),s.off(e,t,i)};return this.on(e,t,i)}trigger(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.each((e,t)=>{t.dispatchEvent(n)})}triggerNative(e){return this.each((t,n)=>{const s=new Event(e,{bubbles:!0,cancelable:!0});n.dispatchEvent(s)})}click(e){return e?this.on("click",e):this.triggerNative("click")}dblclick(e){return e?this.on("dblclick",e):this.trigger("dblclick")}mousedown(e){return e?this.on("mousedown",e):this.trigger("mousedown")}mouseup(e){return e?this.on("mouseup",e):this.trigger("mouseup")}mousemove(e){return e?this.on("mousemove",e):this.trigger("mousemove")}mouseover(e){return e?this.on("mouseover",e):this.trigger("mouseover")}mouseout(e){return e?this.on("mouseout",e):this.trigger("mouseout")}mouseenter(e){return e?this.on("mouseenter",e):this.trigger("mouseenter")}mouseleave(e){return e?this.on("mouseleave",e):this.trigger("mouseleave")}keydown(e){return e?this.on("keydown",e):this.trigger("keydown")}keyup(e){return e?this.on("keyup",e):this.trigger("keyup")}keypress(e){return e?this.on("keypress",e):this.trigger("keypress")}focus(e){return e?this.on("focus",e):this.each((e,t)=>t.focus())}blur(e){return e?this.on("blur",e):this.each((e,t)=>t.blur())}change(e){return e?this.on("change",e):this.trigger("change")}select(e){return e?this.on("select",e):this.trigger("select")}submit(e){return e?this.on("submit",e):this.each((e,t)=>{t.submit&&t.submit()})}scroll(e){return e?this.on("scroll",e):this.trigger("scroll")}resize(e){return e?this.on("resize",e):this.trigger("resize")}hover(e,t){return this.on("mouseenter",e),t?this.on("mouseleave",t):this.on("mouseleave",e),this}show(e,t){return this.each((n,s)=>{e?(s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",t&&setTimeout(()=>t.call(s),this._getDuration(e))})):(s.style.display="",t&&t.call(s))})}hide(e,t){return this.each((n,s)=>{e?(s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))):(s.style.display="none",t&&t.call(s))})}toggle(e,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new f(s).show(e,t):new f(s).hide(e,t)})}fadeIn(e=400,t){return this.each((n,s)=>{s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",setTimeout(()=>{s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}fadeOut(e=400,t){return this.each((n,s)=>{s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})}fadeToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display||"0"===getComputedStyle(s).opacity?new f(s).fadeIn(e,t):new f(s).fadeOut(e,t)})}fadeTo(e,t,n){return this.each((s,i)=>{i.style.display="",i.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{i.style.opacity=String(t),setTimeout(()=>{i.style.transition="",n&&n.call(i)},this._getDuration(e))})})}slideUp(e=400,t){return this.each((n,s)=>{const i=s.offsetHeight;s.style.overflow="hidden",s.style.height=i+"px",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height="0",setTimeout(()=>{s.style.display="none",s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideDown(e=400,t){return this.each((n,s)=>{s.style.display="";const i=s.scrollHeight;s.style.overflow="hidden",s.style.height="0",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height=i+"px",setTimeout(()=>{s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new f(s).slideDown(e,t):new f(s).slideUp(e,t)})}animate(e,t=400,n="ease",s){"function"==typeof t?(s=t,t=400,n="ease"):"function"==typeof n&&(s=n,n="ease");const i=Object.keys(e).join(", "),o=this._getDuration(t);return this.each((t,r)=>{r.style.transition=`${i} ${o}ms ${n}`,requestAnimationFrame(()=>{Object.entries(e).forEach(([e,t])=>{r.style[e]="number"==typeof t?t+"px":t}),setTimeout(()=>{r.style.transition="",s&&s.call(r)},o)})})}stop(){return this.each((e,t)=>{const n=getComputedStyle(t);t.style.transition="none",["opacity","height","width"].forEach(e=>{t.style[e]&&(t.style[e]=n[e])})})}delay(e){return new Promise(t=>{setTimeout(()=>t(this),e)})}_getDuration(e){return"number"==typeof e?e:"fast"===e?200:"slow"===e?600:400}width(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().width}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new f(n).width()):e;n.style.width="number"==typeof s?s+"px":s})}height(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().height}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new f(n).height()):e;n.style.height="number"==typeof s?s+"px":s})}innerWidth(){const e=this.elements[0];return e?e.clientWidth:void 0}innerHeight(){const e=this.elements[0];return e?e.clientHeight:void 0}outerWidth(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetWidth;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginLeft)+parseFloat(e.marginRight)}return n}outerHeight(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetHeight;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginTop)+parseFloat(e.marginBottom)}return n}offset(e){if(void 0===e){const e=this.elements[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}return this.each((t,n)=>{"static"===getComputedStyle(n).position&&(n.style.position="relative");const s=new f(n).offset(),i=parseFloat(getComputedStyle(n).left)||0,o=parseFloat(getComputedStyle(n).top)||0;void 0!==e.left&&(n.style.left=i+e.left-s.left+"px"),void 0!==e.top&&(n.style.top=o+e.top-s.top+"px")})}position(){const e=this.elements[0];if(e)return{top:e.offsetTop,left:e.offsetLeft}}scrollTop(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageYOffset:e.scrollTop}return this.each((t,n)=>{n===window?window.scrollTo(window.pageXOffset,e):n.scrollTop=e})}scrollLeft(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageXOffset:e.scrollLeft}return this.each((t,n)=>{n===window?window.scrollTo(e,window.pageYOffset):n.scrollLeft=e})}offsetParent(){return new f(this.elements.map(e=>e.offsetParent||document.body))}}const _=(e,t)=>"function"==typeof e?("loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(),new f([])):new f(e,t);function g(e){if(!e)return{};if("function"==typeof e.forEach&&!Array.isArray(e)&&"function"==typeof e.get){const t={};return e.forEach((e,n)=>{t[n]=e}),t}return Array.isArray(e)?Object.fromEntries(e):{...e}}async function v(e,t){if("HEAD"===t||204===e.status||205===e.status||304===e.status)return null;const n=e.headers,s=n&&"function"==typeof n.get?n.get("content-type")||"":null;if(null===s||"function"!=typeof e.text)return e.json();if("0"===n.get("content-length"))return null;const i=await e.text();if(""===i)return null;if(/[/+]json\b/i.test(s))return JSON.parse(i);if(s)return i;try{return JSON.parse(i)}catch{return i}}const b={async request(e,t,n=null,s={}){const{headers:i,silent:o,timeout:r,credentials:a,signal:l,...c}=s||{},h={...c,method:e,headers:g(i),credentials:a||"same-origin"};null!=n&&"GET"!==e&&"HEAD"!==e&&(!function(e){return"undefined"!=typeof FormData&&e instanceof FormData||"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams||"undefined"!=typeof Blob&&e instanceof Blob||!("undefined"==typeof ArrayBuffer||!(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))||"undefined"!=typeof ReadableStream&&e instanceof ReadableStream}(n)?(function(e,t){const n=t.toLowerCase();return Object.keys(e).some(e=>e.toLowerCase()===n)}(h.headers,"Content-Type")||(h.headers["Content-Type"]="application/json"),h.body=JSON.stringify(n)):h.body=n);let d=null,u=null;r>0&&"undefined"!=typeof AbortController?(u=new AbortController,d=setTimeout(()=>{const e="undefined"!=typeof DOMException?new DOMException(`Request timed out after ${r}ms`,"TimeoutError"):Object.assign(new Error(`Request timed out after ${r}ms`),{name:"TimeoutError"});u.abort(e)},r),l&&(l.aborted?u.abort(l.reason):l.addEventListener("abort",()=>u.abort(l.reason),{once:!0})),h.signal=u.signal):l&&(h.signal=l);try{const n=await fetch(t,h);if(!n.ok){let t,s=`HTTP Error: ${n.status}`;try{if(t=await v(n,e),null===t||"object"!=typeof t)throw new Error("not JSON");t.message?s=t.message:t.error&&(s=t.error)}catch(e){s=`HTTP Error: ${n.status} ${n.statusText}`}const i=new Error(s);throw i.status=n.status,i.statusText=n.statusText,i.body=t,i}return await v(n,e)}catch(e){throw o||console.error("Domma HTTP Error:",e),e}finally{d&&clearTimeout(d)}},get(e,t){return this.request("GET",e,null,t)},post(e,t,n){return this.request("POST",e,t,n)},put(e,t,n){return this.request("PUT",e,t,n)},patch(e,t,n){return this.request("PATCH",e,t,n)},delete(e,t){const{data:n=null,...s}=t||{};return this.request("DELETE",e,n,s)},head(e,t){return this.request("HEAD",e,null,t)},options(e,t){return this.request("OPTIONS",e,null,t)}},y={chunk(e,t=1){if(!e||t<1)return[];const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n},compact:e=>e?e.filter(Boolean):[],concat:(e,...t)=>e?e.concat(...t):[],difference(e,...t){if(!e)return[];const n=new Set(t.flat());return e.filter(e=>!n.has(e))},differenceBy(e,t,n){if(!e)return[];const s=new Set(t.map(n));return e.filter(e=>!s.has(n(e)))},differenceWith:(e,t,n)=>e?e.filter(e=>!t.some(t=>n(e,t))):[],drop:(e,t=1)=>e?e.slice(t):[],dropRight(e,t=1){if(!e)return[];const n=e.length-t;return n>0?e.slice(0,n):[]},dropRightWhile(e,t){if(!e)return[];let n=e.length;for(;n--&&t(e[n],n,e););return e.slice(0,n+1)},dropWhile(e,t){if(!e)return[];let n=0;for(;n<e.length&&t(e[n],n,e);)n++;return e.slice(n)},eq:(e,t)=>e===t||e!=e&&t!=t,fill:(e,t,n=0,s)=>e?e.fill(t,n,s):[],findIndex(e,t,n=0){if(!e)return-1;for(let s=n;s<e.length;s++)if(t(e[s],s,e))return s;return-1},findLastIndex(e,t,n){if(!e)return-1;for(let s=void 0!==n?n:e.length-1;s>=0;s--)if(t(e[s],s,e))return s;return-1},first:e=>e?e[0]:void 0,head(e){return this.first(e)},flatten:e=>e?e.flat(1):[],flattenDeep:e=>e?e.flat(1/0):[],flattenDepth:(e,t=1)=>e?e.flat(t):[],fromPairs:e=>e?Object.fromEntries(e):{},indexOf:(e,t,n=0)=>e?e.indexOf(t,n):-1,initial:e=>e?e.slice(0,-1):[],intersection(...e){if(!e.length)return[];return e[0].filter(t=>e.every(e=>e.includes(t)))},join:(e,t=",")=>e?e.join(t):"",last:e=>e?e[e.length-1]:void 0,lastIndexOf:(e,t,n)=>e?void 0!==n?e.lastIndexOf(t,n):e.lastIndexOf(t):-1,nth(e,t=0){if(e)return t<0?e[e.length+t]:e[t]},pull(e,...t){if(!e)return[];const n=new Set(t);for(let t=e.length-1;t>=0;t--)n.has(e[t])&&e.splice(t,1);return e},pullAt(e,...t){if(!e)return[];const n=t.flat().sort((e,t)=>t-e),s=[];return n.forEach(t=>{t>=0&&t<e.length&&s.unshift(e.splice(t,1)[0])}),s},reverse:e=>e?e.reverse():[],slice:(e,t=0,n)=>e?void 0!==n?e.slice(t,n):e.slice(t):[],tail:e=>e?e.slice(1):[],take:(e,t=1)=>e?e.slice(0,t):[],takeRight(e,t=1){if(!e)return[];const n=Math.max(0,e.length-t);return e.slice(n)},union:(...e)=>[...new Set(e.flat())],uniq:e=>e?[...new Set(e)]:[],uniqBy(e,t){if(!e)return[];const n=new Set;return e.filter(e=>{const s=t(e);return!n.has(s)&&(n.add(s),!0)})},without(e,...t){if(!e)return[];const n=new Set(t);return e.filter(e=>!n.has(e))},xor(...e){if(!e.length)return[];const t=new Map;return e.flat().forEach(e=>{t.set(e,(t.get(e)||0)+1)}),[...t.entries()].filter(([,e])=>1===e).map(([e])=>e)},zip(...e){if(!e.length)return[];const t=Math.max(...e.map(e=>e.length)),n=[];for(let s=0;s<t;s++)n.push(e.map(e=>e[s]));return n},zipObject(e,t){if(!e)return{};const n={};return e.forEach((e,s)=>{n[e]=t?t[s]:void 0}),n},times(e,t){if((e=Math.floor(e))<1)return[];const n=new Array(e);for(let s=0;s<e;s++)n[s]=t?t(s):s;return n},range(e,t,n){if(void 0===t&&(t=e,e=0),0===(n=void 0===n?e<t?1:-1:n))return[];const s=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(s);for(let t=0;t<s;t++)i[t]=e+t*n;return i},uniqueId:(()=>{let e=0;return function(t=""){const n=++e;return t?`${t}${n}`:String(n)}})(),countBy(e,t){const n={};return this.each(e,e=>{const s=t(e);n[s]=(n[s]||0)+1}),n},each:(e,t)=>(Array.isArray(e)?e.forEach((n,s)=>t(n,s,e)):e&&"object"==typeof e&&Object.keys(e).forEach(n=>t(e[n],n,e)),e),forEach(e,t){return this.each(e,t)},eachRight(e,t){if(Array.isArray(e))for(let n=e.length-1;n>=0;n--)t(e[n],n,e);else if(e&&"object"==typeof e){Object.keys(e).reverse().forEach(n=>t(e[n],n,e))}return e},forEachRight(e,t){return this.eachRight(e,t)},every:(e,t)=>Array.isArray(e)?e.every(t):!e||"object"!=typeof e||Object.values(e).every(t),filter:(e,t)=>Array.isArray(e)?e.filter(t):e&&"object"==typeof e?Object.values(e).filter(t):[],find:(e,t)=>Array.isArray(e)?e.find(t):e&&"object"==typeof e?Object.values(e).find(t):void 0,findLast(e,t){if(Array.isArray(e)){for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return e[n]}else if(e&&"object"==typeof e){return Object.values(e).reverse().find(t)}},flatMap(e,t){return this.map(e,t).flat(1)},flatMapDeep(e,t){return this.map(e,t).flat(1/0)},groupBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]||(n[s]=[]),n[s].push(e)}),n},includes:(e,t,n=0)=>"string"==typeof e||Array.isArray(e)?e.includes(t,n):!(!e||"object"!=typeof e)&&Object.values(e).includes(t),keyBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]=e}),n},map:(e,t)=>Array.isArray(e)?e.map(t):e&&"object"==typeof e?Object.entries(e).map(([n,s])=>t(s,n,e)):[],orderBy(e,t,n){const s=Array.isArray(e)?[...e]:Object.values(e),i=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n||"asc"];return s.sort((e,t)=>{for(let n=0;n<i.length;n++){const s=i[n],r=o[n]||"asc",a="function"==typeof s?s(e):e[s],l="function"==typeof s?s(t):t[s];if(a<l)return"asc"===r?-1:1;if(a>l)return"asc"===r?1:-1}return 0})},partition(e,t){const n=[],s=[];return this.each(e,(i,o)=>{t(i,o,e)?n.push(i):s.push(i)}),[n,s]},reduce(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduce(t,n):e.reduce(t);if(e&&"object"==typeof e){const s=Object.entries(e);let i=n,o=0;void 0===i&&s.length>0&&(i=s[0][1],o=1);for(let n=o;n<s.length;n++){const[o,r]=s[n];i=t(i,r,o,e)}return i}return n},reduceRight(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduceRight(t,n):e.reduceRight(t);if(e&&"object"==typeof e){const s=Object.entries(e).reverse();let i=n,o=0;void 0===i&&s.length>0&&(i=s[0][1],o=1);for(let n=o;n<s.length;n++){const[o,r]=s[n];i=t(i,r,o,e)}return i}return n},reject(e,t){return this.filter(e,(e,n,s)=>!t(e,n,s))},sample(e){const t=Array.isArray(e)?e:Object.values(e||{});return t[Math.floor(Math.random()*t.length)]},sampleSize(e,t=1){return this.shuffle(Array.isArray(e)?[...e]:Object.values(e||{})).slice(0,t)},shuffle(e){const t=Array.isArray(e)?[...e]:Object.values(e||{});for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},size:e=>null==e?0:"string"==typeof e||Array.isArray(e)?e.length:"object"==typeof e?Object.keys(e).length:0,some:(e,t)=>Array.isArray(e)?e.some(t):!(!e||"object"!=typeof e)&&Object.values(e).some(t),sortBy:(e,t)=>(Array.isArray(e)?[...e]:Object.values(e)).sort((e,n)=>{const s="function"==typeof t?t(e):e[t],i="function"==typeof t?t(n):n[t];return s<i?-1:s>i?1:0}),after(e,t){let n=0;return function(...s){if(++n>=e)return t.apply(this,s)}},ary:(e,t=e.length)=>function(...n){return e.apply(this,n.slice(0,t))},before(e,t){let n,s=0;return function(...i){return++s<e&&(n=t.apply(this,i)),n}},bind:(e,t,...n)=>function(...s){return e.apply(t,[...n,...s])},curry:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...s,...e])}},curryRight:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...e,...s])}},debounce(e,t=0,n={}){let s,i,o,r,a,l=0;const c=n.leading||!1,h=!1!==n.trailing,d=n.maxWait;function u(t){const n=i,s=o;return i=o=void 0,l=t,r=e.apply(s,n),r}function p(e){const n=e-a;return void 0===a||n>=t||n<0||void 0!==d&&e-l>=d}function m(){const e=Date.now();if(p(e))return f(e);s=setTimeout(m,function(e){const n=e-a,s=e-l,i=t-n;return void 0!==d?Math.min(i,d-s):i}(e))}function f(e){return s=void 0,h&&i?u(e):(i=o=void 0,r)}function _(...e){const n=Date.now(),h=p(n);if(i=e,o=this,a=n,h){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),c?u(e):r}(a);if(void 0!==d)return s=setTimeout(m,t),u(a)}return void 0===s&&(s=setTimeout(m,t)),r}return _.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=a=o=s=void 0},_.flush=function(){return void 0===s?r:f(Date.now())},_},defer(e,...t){return setTimeout(()=>e.apply(this,t),1)},delay(e,t,...n){return setTimeout(()=>e.apply(this,n),t)},flip:e=>function(...t){return e.apply(this,t.reverse())},flow(...e){const t=e.length;return 0===t?function(e){return e}:1===t?e[0]:function(...n){let s=e[0].apply(this,n);for(let n=1;n<t;n++)s=e[n].call(this,s);return s}},compose(...e){return this.flow(...e.reverse())},memoize(e,t){const n=new Map,s=function(...s){const i=t?t.apply(this,s):s[0];if(n.has(i))return n.get(i);const o=e.apply(this,s);return n.set(i,o),o};return s.cache=n,s},negate:e=>function(...t){return!e.apply(this,t)},once(e){return this.before(2,e)},partial:(e,...t)=>function(...n){return e.apply(this,[...t,...n])},partialRight:(e,...t)=>function(...n){return e.apply(this,[...n,...t])},throttle(e,t=0,n={}){const s=!1!==n.leading,i=!1!==n.trailing;return this.debounce(e,t,{leading:s,trailing:i,maxWait:t})},unary(e){return this.ary(e,1)},wrap:(e,t)=>function(...n){return t.apply(this,[e,...n])},assign:(e,...t)=>Object.assign(e||{},...t),assignIn(e,...t){const n=e||{};return t.forEach(e=>{if(e)for(const t in e)n[t]=e[t]}),n},extend(e,...t){return this.assignIn(e,...t)},at(e,...t){return t.flat().map(t=>this.get(e,t))},clone:e=>null===e||"object"!=typeof e?e:Array.isArray(e)?[...e]:{...e},cloneDeep(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>this.cloneDeep(e));if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=this.cloneDeep(e[n]));return t},defaults(e,...t){const n=e||{};return t.forEach(e=>{e&&Object.keys(e).forEach(t=>{void 0===n[t]&&(n[t]=e[t])})}),n},defaultsDeep(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],i=e[t];void 0===s?n[t]=this.cloneDeep(i):s&&"object"==typeof s&&i&&"object"==typeof i&&!Array.isArray(s)&&!Array.isArray(i)&&this.defaultsDeep(s,i)})}),n},entries:e=>e?Object.entries(e):[],toPairs(e){return this.entries(e)},findKey(e,t){if(e)for(const n of Object.keys(e))if(t(e[n],n,e))return n},findLastKey(e,t){if(!e)return;const n=Object.keys(e).reverse();for(const s of n)if(t(e[s],s,e))return s},forIn(e,t){if(e)for(const n in e)if(!1===t(e[n],n,e))break;return e},forOwn(e,t){if(e)for(const n of Object.keys(e))if(!1===t(e[n],n,e))break;return e},get(e,t,n){if(!e)return n;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let i=e;for(const e of s){if(null==i)return n;i=i[e]}return void 0===i?n:i},has(e,t){if(!e)return!1;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(const e of n){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;s=s[e]}return!0},invert(e){const t={};return e&&Object.entries(e).forEach(([e,n])=>{t[n]=e}),t},invertBy(e,t=e=>e){const n={};return e&&Object.entries(e).forEach(([e,s])=>{const i=t(s);n[i]||(n[i]=[]),n[i].push(e)}),n},keys:e=>e?Object.keys(e):[],keysIn(e){const t=[];for(const n in e)t.push(n);return t},mapKeys(e,t){const n={};return e&&Object.entries(e).forEach(([s,i])=>{n[t(i,s,e)]=i}),n},mapValues(e,t){const n={};return e&&Object.entries(e).forEach(([s,i])=>{n[s]=t(i,s,e)}),n},merge(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],i=e[t];s&&"object"==typeof s&&i&&"object"==typeof i&&!Array.isArray(s)&&!Array.isArray(i)?this.merge(s,i):n[t]=i})}),n},omit(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return Object.keys(e).forEach(t=>{n.has(t)||(s[t]=e[t])}),s},omitBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)||(n[e]=s)}),n},pick(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return n.forEach(t=>{t in e&&(s[t]=e[t])}),s},pickBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)&&(n[e]=s)}),n},set(e,t,n){if(!e)return e;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let i=e;for(let e=0;e<s.length-1;e++){const t=s[e],n=s[e+1];t in i&&null!==i[t]&&"object"==typeof i[t]||(i[t]=/^\d+$/.test(n)?[]:{}),i=i[t]}return i[s[s.length-1]]=n,e},unset(e,t){if(!e)return!0;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(let e=0;e<n.length-1;e++){const t=n[e];if(!(t in s))return!0;s=s[t]}return delete s[n[n.length-1]]},setIfUndefined(e,t,n){return void 0===this.get(e,t)&&this.set(e,t,n),e},values:e=>e?Object.values(e):[],valuesIn(e){const t=[];for(const n in e)t.push(e[n]);return t},isArray:e=>Array.isArray(e),isBoolean:e=>"boolean"==typeof e||e instanceof Boolean,isDate:e=>e instanceof Date,isEmpty:e=>null==e||(Array.isArray(e)||"string"==typeof e?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"!=typeof e||0===Object.keys(e).length),isEqual(e,t){if(e===t)return!0;if(null===e||null===t)return e===t;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>this.isEqual(e,t[n]));if(Array.isArray(e)||Array.isArray(t))return!1;const n=Object.keys(e),s=Object.keys(t);return n.length===s.length&&n.every(n=>this.isEqual(e[n],t[n]))},isMatch(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t);for(const s of n){const n=e[s],i=t[s];if("object"==typeof i&&null!==i){if(!this.isMatch(n,i))return!1}else if(n!==i)return!1}return!0},isFinite:e=>Number.isFinite(e),isFunction:e=>"function"==typeof e,isInteger:e=>Number.isInteger(e),isNaN:e=>Number.isNaN(e),isNil:e=>null==e,isNull:e=>null===e,isNumber:e=>"number"==typeof e||e instanceof Number,isObject:e=>null!==e&&"object"==typeof e,isPlainObject(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},isRegExp:e=>e instanceof RegExp,isString:e=>"string"==typeof e||e instanceof String,isSymbol:e=>"symbol"==typeof e,isUndefined:e=>void 0===e,parseInt:(e,t)=>(void 0===t&&(t=/^0x/i.test(e)?16:10),null==e?NaN:"number"==typeof e?Math.trunc(e):(e=String(e).trim(),parseInt(e,t))),toNumber(e){if("number"==typeof e)return e;if("symbol"==typeof e)return NaN;if(this.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=this.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.trim();const t=/^0b[01]+$/i.test(e),n=/^0o[0-7]+$/i.test(e),s=/^[-+]0x[0-9a-f]+$/i.test(e);return t||n?parseInt(e.slice(2),t?2:8):s?NaN:+e},toInteger(e){const t=this.toNumber(e);return Number.isNaN(t)?0:0!==t&&Number.isFinite(t)?Math.trunc(t):t},toFinite(e){const t=17976931348623157e292;if(!e)return 0===e?e:0;const n=this.toNumber(e);return n===1/0?t:n===-1/0?-t:n==n?n:0},toSafeInteger(e){const t=9007199254740991,n=this.toInteger(e);return n<-9007199254740991?-9007199254740991:n>t?t:n},toString(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>null==e?"":this.toString(e)).join(",");if("symbol"==typeof e)return e.toString();const t=String(e);return"0"===t&&1/e==-1/0?"-0":t},toArray(e){return e?this.isArray(e)?[...e]:"string"==typeof e?e.split(""):this.isObject(e)?"function"==typeof e[Symbol.iterator]?[...e]:Object.values(e):[]:[]},castArray(...e){if(!e.length)return[];const t=e[0];return this.isArray(t)?t:[t]},toLength(e){const t=4294967295,n=this.toInteger(e);return n<0?0:n>t?t:n},toPlainObject(e){const t={};for(const n in e)t[n]=e[n];return t},add:(e,t)=>e+t,ceil(e,t=0){const n=Math.pow(10,t);return Math.ceil(e*n)/n},divide:(e,t)=>e/t,floor(e,t=0){const n=Math.pow(10,t);return Math.floor(e*n)/n},max:e=>e&&e.length?Math.max(...e):void 0,maxBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])>("function"==typeof t?t(e):e[t])?n:e)},mean(e){return e&&e.length?this.sum(e)/e.length:NaN},meanBy(e,t){return e&&e.length?this.sumBy(e,t)/e.length:NaN},min:e=>e&&e.length?Math.min(...e):void 0,minBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])<("function"==typeof t?t(e):e[t])?n:e)},multiply:(e,t)=>e*t,round(e,t=0){const n=Math.pow(10,t);return Math.round(e*n)/n},subtract:(e,t)=>e-t,sum:e=>e?e.reduce((e,t)=>e+t,0):0,sumBy:(e,t)=>e?e.reduce((e,n)=>e+("function"==typeof t?t(n):n[t]),0):0,clamp:(e,t,n)=>(void 0===n&&(n=t,t=void 0),void 0!==t&&e<t?t:void 0!==n&&e>n?n:e),inRange:(e,t,n)=>(void 0===n&&(n=t,t=0),t>n&&([t,n]=[n,t]),e>=t&&e<n),random:(e=0,t=1,n)=>("boolean"==typeof e?(n=e,e=0,t=1):"boolean"==typeof t&&(n=t,t=e,e=0),e>t&&([e,t]=[t,e]),n||e%1!=0||t%1!=0?e+Math.random()*(t-e):e+Math.floor(Math.random()*(t-e+1))),camelCase:e=>e?e.replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()):"",capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",endsWith:(e,t,n)=>!!e&&(void 0!==n?e.slice(0,n).endsWith(t):e.endsWith(t)),escape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,e=>t[e])},kebabCase:e=>e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():"",lowerCase(e){return e?this.words(e).join(" ").toLowerCase():""},lowerFirst:e=>e?e.charAt(0).toLowerCase()+e.slice(1):"",pad(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s,o=Math.floor(i/2),r=i-o;return n.repeat(Math.ceil(o/n.length)).slice(0,o)+e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},padEnd(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s;return e+n.repeat(Math.ceil(i/n.length)).slice(0,i)},padStart(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const i=t-s;return n.repeat(Math.ceil(i/n.length)).slice(0,i)+e},repeat:(e="",t=1)=>e.repeat(Math.max(0,Math.floor(t))),replace:(e="",t,n)=>e.replace(t,n),snakeCase(e){return e?this.words(e).join("_").toLowerCase():""},split:(e="",t,n)=>e.split(t,n),startCase(e){return e?this.words(e).map(e=>this.capitalize(e)).join(" "):""},startsWith:(e,t,n=0)=>!!e&&e.startsWith(t,n),toLower:e=>e?e.toLowerCase():"",toUpper:e=>e?e.toUpperCase():"",trim(e="",t){if(!t)return e.trim();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+|[${n}]+$`,"g"),"")},trimEnd(e="",t){if(!t)return e.trimEnd();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`[${n}]+$`,"g"),"")},trimStart(e="",t){if(!t)return e.trimStart();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+`,"g"),"")},truncate(e="",t={}){const n=t.length||30,s=t.omission||"...",i=t.separator;if(e.length<=n)return e;let o=n-s.length;if(o<1)return s;let r=e.slice(0,o);if(i){const e="string"==typeof i?r.lastIndexOf(i):r.search(new RegExp(i.source+"(?!.*"+i.source+")"));e>-1&&(r=r.slice(0,e))}return r+s},unescape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>t[e])},upperCase(e){return e?this.words(e).join(" ").toUpperCase():""},upperFirst:e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",words:(e="",t)=>t?e.match(t)||[]:(e=e.replace(/([a-z])([A-Z])/g,"$1 $2")).match(/[a-zA-Z0-9]+/g)||[],sprintf(e,...t){if(!e)return"";let n=0;return e.replace(/%(?:(\d+)\$)?([+-])?(\d+)?(?:\.(\d+))?([sdifojx%])/g,(e,s,i,o,r,a)=>{if("%"===a)return"%";const l=s?parseInt(s,10)-1:n++,c=t[l];if(void 0===c)return e;if(null===c)return"null";let h;switch(a){case"s":default:h=String(c);break;case"d":case"i":h=String(parseInt(c,10));break;case"f":const e=parseFloat(c);h=void 0!==r?e.toFixed(parseInt(r,10)):String(e);break;case"o":h=Object.prototype.toString.call(c);break;case"j":try{h=JSON.stringify(c)}catch(e){h="[Circular]"}break;case"x":h=parseInt(c,10).toString(16)}if(o){const e=parseInt(o,10),t="0"===i?"0":" ";h="-"===i?h.padEnd(e," "):h.padStart(e,t)}if("+"===i&&("d"===a||"i"===a||"f"===a)){parseFloat(h)>=0&&!h.startsWith("+")&&(h="+"+h)}return h})},format(e,...t){return this.sprintf(e,...t)},template(e,t={}){const{partials:n={},helpers:s={}}=t,i=e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),o=(e,t)=>"."===t?e:t.startsWith("@")?e[t]:t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:"",e),r=(e,t,a=null)=>{let l=e;return l=l.replace(/\{\{#with\s+([^}]+)\}\}([\s\S]*?)\{\{\/with\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return i&&"object"==typeof i?r(s,i,t):""}),l=l.replace(/\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return Array.isArray(i)?i.map((e,n)=>{const o="object"==typeof e?{...e,"@index":n,"@first":0===n,"@last":n===i.length-1}:{".":e,"@index":n,"@first":0===n,"@last":n===i.length-1};return r(s,o,t)}).join(""):""}),l=l.replace(/\{\{#if\s+([^}]+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g,(e,n,s,i="")=>{const l=o(t,n.trim()),c=Array.isArray(l)?l.length>0:Boolean(l);return r(c?s:i,t,a)}),l=l.replace(/\{\{#unless\s+([^}]+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(e,n,s)=>{const i=o(t,n.trim());return(Array.isArray(i)?0===i.length:!i)?r(s,t,a):""}),l=l.replace(/\{\{>\s*([^}]+)\}\}/g,(e,s)=>{const i=n[s.trim()];return i?r(i,t,a):""}),l=l.replace(/\{\{\{([^}]+)\}\}\}/g,(e,n)=>{const s=o(t,n.trim());return null!=s?String(s):""}),l=l.replace(/\{\{([^#/>][^}]*)\}\}/g,(e,n)=>{const r=n.trim(),a=r.match(/^(\w+)\s+(.+)$/);if(a&&s[a[1]]){const e=a[2].split(/\s+/).map(e=>/^["'].*["']$/.test(e)?e.slice(1,-1):o(t,e));return i(s[a[1]](...e))}const l=o(t,r);return i(l)}),l};return(t={})=>r(e,t)},render(e,t,n={}){return this.template(e,n)(t)},async copyToClipboard(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){}const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(e){return!1}finally{document.body.removeChild(t)}},escapeHtml:e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),chain(e){const t={_value:e,value(){return this._value}};["chunk","compact","concat","difference","drop","dropRight","fill","findIndex","findLastIndex","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","join","last","lastIndexOf","nth","pull","pullAll","pullAt","remove","reverse","slice","sortedIndex","sortedUniq","tail","take","takeRight","union","uniq","uniqBy","unzip","without","xor","zip","countBy","each","every","filter","find","findLast","flatMap","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","assign","assignIn","at","defaults","entries","extend","findKey","findLastKey","forIn","forOwn","functions","get","has","invert","invertBy","invoke","keys","mapKeys","mapValues","merge","omit","omitBy","pick","pickBy","result","set","toPairs","transform","unset","update","values","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return this._value=y[e](this._value,...t),this})});return["sum","mean","min","max","toArray","toJSON","toString"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return y[e](this._value,...t)})}),t}},k=new WeakMap;function w(e){return e?.constructor?.componentName||e?.componentName}function x(e,t){const n=function(e){return e&&k.get(e)||[]}(e);for(let e=n.length-1;e>=0;e--)if(!t||w(n[e])===t)return n[e];return null}function M(e,t){if(!e||"object"!=typeof e)return;const n=k.get(e)||[];n.includes(t)||n.push(t),k.set(e,n)}function L(e,t){if(!e)return;const n=k.get(e);if(!n)return;const s=n.filter(e=>e!==t);s.length?k.set(e,s):k.delete(e)}class C{static componentName="component";constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={...this.constructor.defaults,...t},this._eventHandlers=[],this._listeners={},this.element&&(this.element._dommaComponent=this,M(this.element,this))}on(e,t){return"function"==typeof t&&(this._listeners[e]||=[]).push(t),this}once(e,t){if("function"!=typeof t)return this;const n=(...s)=>(this.off(e,n),t.apply(this,s));return n._original=t,this.on(e,n)}off(e,t){return this._listeners[e]?(this._listeners[e]=t?this._listeners[e].filter(e=>e!==t&&e._original!==t):[],this):this}_notify(e,...t){let n=!0;for(const s of[...this._listeners?.[e]||[]])!1===s.apply(this,t)&&(n=!1);return n}_emit(e,...t){const n=this._notify(e,...t);if(!this.element||"undefined"==typeof CustomEvent||!this.element.dispatchEvent)return n;const s=this.constructor.componentName,i=this.element.dispatchEvent(new CustomEvent(`dm:${s}:${e}`,{bubbles:!0,cancelable:!0,detail:{instance:this,args:t}}));return n&&i}_fire(e,...t){const n=e.toLowerCase(),s=this._optionFor(n),i="function"==typeof s?s.apply(this.options,t):void 0,o=this._emit(n,...t);return!(!1===i||!o)&&i}_optionFor(e){for(const t of Object.keys(this.options))if(t.length>2&&t.startsWith("on")&&t.slice(2).toLowerCase()===e)return this.options[t];return this.options[`on${t=e,t.charAt(0).toUpperCase()+t.slice(1)}`];var t}_forcedClose(...e){this._forceClose=!0;try{return this.close(...e)}finally{this._forceClose=!1}}_mayClose(...e){return this._forceClose||!1!==this._fire("beforeclose",...e)}setOptions(e){return this.options={...this.options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}_addEventListener(e,t,n){e.addEventListener(t,n),this._eventHandlers.push({element:e,event:t,handler:n})}destroy(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[],this._listeners={},this.element&&(this.element._dommaComponent===this&&delete this.element._dommaComponent,L(this.element,this))}}class A extends C{static componentName="tree-view";static defaults={data:[],idKey:"id",parentKey:"parent_id",childrenKey:"children",labelKey:"name",iconKey:"icon",colorKey:"color",expandedByDefault:!0,expandedNodes:[],selectable:!0,multiSelect:!1,selectedNodes:[],renderNode:null,getBadge:null,getNodeIcon:null,getNodeClass:null,actions:[],indentSize:1.5,showIcons:!0,showToggleButtons:!0,toggleIcon:"chevron-down",onSelect:null,onDeselect:null,onExpand:null,onCollapse:null,onAction:null,onClick:null};constructor(e,t={}){super(e,t),this.element?(this._tree=[],this._flatMap={},this._expandedNodes=new Set,this._selectedNodes=new Set,this._init()):console.error("TreeView: Element not found",e)}_init(){this.element.classList.contains("dm-treeview")||this.element.classList.add("dm-treeview"),this.options.expandedNodes.length>0&&this.options.expandedNodes.forEach(e=>this._expandedNodes.add(e)),this.options.selectedNodes.length>0&&this.options.selectedNodes.forEach(e=>this._selectedNodes.add(e)),this.options.data&&this.options.data.length>0&&this.setData(this.options.data),this._setupEventListeners()}_setupEventListeners(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-node");if(!t||e.target.closest(".dm-treeview-toggle")||e.target.closest(".dm-treeview-action"))return;const n=this._parseNodeId(t.dataset.nodeId);this._handleSelect(n,e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-toggle");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId);this.toggle(n)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-action");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId),s=t.dataset.action;this._handleAction(s,n,e)}})}_buildTree(e){const t={},n=[],s=this.options.idKey,i=this.options.parentKey,o=this.options.childrenKey;return e.forEach(e=>{t[e[s]]={...e,[o]:[]}}),e.forEach(e=>{const r=t[e[s]],a=e[i];null==a?n.push(r):t[a]?t[a][o].push(r):n.push(r)}),this._sortTree(n),{tree:n,nodeMap:t}}_sortTree(e){const t=this.options.childrenKey,n=this.options.labelKey;e.sort((e,t)=>{const s=(e[n]||"").toLowerCase(),i=(t[n]||"").toLowerCase();return s.localeCompare(i)}),e.forEach(e=>{e[t]&&e[t].length>0&&this._sortTree(e[t])})}_render(){const e=this._tree.map(e=>this._renderNode(e,0)).join("");this.element.innerHTML=e}_renderNode(e,t){const n=this.options.idKey,s=this.options.childrenKey,i=e[n],o=e[s]&&e[s].length>0,r=this._expandedNodes.has(i),a=this._selectedNodes.has(i),l={isExpanded:r,isSelected:a,hasChildren:o},c=this.options.renderNode?this.options.renderNode(e,t,l):this._defaultRenderNode(e,t,l),h=this.options.getBadge?this.options.getBadge(e):null;let d=`\n <div class="dm-treeview-node ${a?"dm-treeview-node-selected":""} ${this.options.getNodeClass?this.options.getNodeClass(e):""}"\n data-node-id="${i}"\n data-depth="${t}"\n style="padding-left: ${t*this.options.indentSize}rem;">\n <div class="dm-treeview-node-content">\n ${o&&this.options.showToggleButtons?this._renderToggle(i,r):'<span class="dm-treeview-spacer"></span>'}\n ${c}\n ${null!=h?`<span class="dm-treeview-badge">${h}</span>`:""}\n </div>\n ${this.options.actions.length>0?this._renderActions(e):""}\n </div>\n `;return o&&r&&(d+=`<div class="dm-treeview-children" data-parent-id="${i}">`,e[s].forEach(e=>{d+=this._renderNode(e,t+1)}),d+="</div>"),d}_defaultRenderNode(e,t,n){const s=this.options.labelKey,i=this.options.iconKey,o=this.options.colorKey,r=e[s]||"",a=this.options.getNodeIcon?this.options.getNodeIcon(e):e[i],l=e[o];let c="";return this.options.showIcons&&a&&(c+=`<span class="dm-treeview-icon" data-icon="${this._escapeHtml(a)}" ${l?`style="color: ${this._escapeHtml(l)};"`:""}></span>`),c+=`<span class="dm-treeview-label">${this._escapeHtml(r)}</span>`,c}_renderToggle(e,t){return`\n <button type="button"\n class="dm-treeview-toggle ${t?"dm-treeview-expanded":"dm-treeview-collapsed"}"\n data-node-id="${e}"\n aria-label="${t?"Collapse":"Expand"}">\n <span data-icon="${this.options.toggleIcon}"></span>\n </button>\n `}_renderActions(e){const t=e[this.options.idKey],n=this.options.actions.filter(t=>"function"!=typeof t.visible||t.visible(e));if(0===n.length)return"";let s='<div class="dm-treeview-actions">';return n.forEach(e=>{s+=`\n <button type="button"\n class="dm-treeview-action"\n data-node-id="${t}"\n data-action="${e.name}"\n title="${e.tooltip||e.name}"\n aria-label="${e.tooltip||e.name}">\n ${e.icon?`<span data-icon="${e.icon}"></span>`:e.name}\n </button>\n `}),s+="</div>",s}_handleSelect(e,t){if(!this.options.selectable)return;const n=this._flatMap[e];if(!n)return;this._fire("click",e,n,t);const s=this._selectedNodes.has(e);this.options.multiSelect?s?this.deselect(e):this.select(e):s?this.deselect(e):(this.deselectAll(!0),this.select(e))}_handleAction(e,t,n){const s=this._flatMap[t];s&&this._fire("action",e,t,s,n)}_parseNodeId(e){const t=Number(e);return isNaN(t)||e!==t.toString()?e:t}_escapeHtml(e){return o(e)}setData(e){const{tree:t,nodeMap:n}=this._buildTree(e);return this._tree=t,this._flatMap=n,this.options.expandedByDefault&&Object.keys(n).forEach(e=>{const t=n[e],s=this.options.childrenKey;t[s]&&t[s].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this._render(),this}getData(){return this._tree}getFlatData(){return Object.values(this._flatMap)}refresh(){return this._render(),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&window.Domma.icons.scan(this.element),this}getNode(e){return this._flatMap[e]||null}updateNode(e,t){const n=this._flatMap[e];return n&&(Object.assign(n,t),this.refresh()),this}select(e,t=!1){if(!this.options.selectable)return this;const n=this._flatMap[e];return n?(this._selectedNodes.add(e),this.refresh(),t||this._fire("select",e,n,null),this):this}deselect(e,t=!1){const n=this._flatMap[e];return n?(this._selectedNodes.delete(e),this.refresh(),t||this._fire("deselect",e,n,null),this):this}toggleSelect(e){return this._selectedNodes.has(e)?this.deselect(e):this.select(e),this}selectAll(){return this.options.multiSelect?(Object.keys(this._flatMap).forEach(e=>{this._selectedNodes.add(this._parseNodeId(e))}),this.refresh(),this):this}deselectAll(e=!1){const t=Array.from(this._selectedNodes);return this._selectedNodes.clear(),this.refresh(),e||t.forEach(e=>{const t=this._flatMap[e];t&&this._fire("deselect",e,t,null)}),this}getSelected(){return Array.from(this._selectedNodes)}getSelectedNodes(){return this.getSelected().map(e=>this._flatMap[e]).filter(Boolean)}isSelected(e){return this._selectedNodes.has(e)}expand(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.add(e),this.refresh(),t||this._fire("expand",e,n,null),this):this}collapse(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.delete(e),this.refresh(),t||this._fire("collapse",e,n,null),this):this}toggle(e){return this._expandedNodes.has(e)?this.collapse(e):this.expand(e),this}expandAll(){return Object.keys(this._flatMap).forEach(e=>{const t=this._flatMap[e],n=this.options.childrenKey;t[n]&&t[n].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this.refresh(),this}collapseAll(){return this._expandedNodes.clear(),this.refresh(),this}isExpanded(e){return this._expandedNodes.has(e)}getExpanded(){return Array.from(this._expandedNodes)}getParent(e){const t=this._flatMap[e];if(!t)return null;const n=t[this.options.parentKey];return null!=n&&this._flatMap[n]||null}getChildren(e){const t=this._flatMap[e];if(!t)return[];return t[this.options.childrenKey]||[]}getAncestors(e){const t=[];let n=this.getParent(e);for(;n;)t.unshift(n),n=this.getParent(n[this.options.idKey]);return t}getDescendants(e){const t=[];return this.getChildren(e).forEach(e=>{t.push(e);const n=e[this.options.idKey];t.push(...this.getDescendants(n))}),t}getSiblings(e){if(!this._flatMap[e])return[];const t=this.getParent(e);return t?this.getChildren(t[this.options.idKey]).filter(t=>t[this.options.idKey]!==e):this._tree.filter(t=>t[this.options.idKey]!==e)}getLevel(e){return this.getAncestors(e).length}find(e){for(const t in this._flatMap){const n=this._flatMap[t];if(e(n))return n}return null}filter(e){const t=[];for(const n in this._flatMap){const s=this._flatMap[n];e(s)&&t.push(s)}return t}forEach(e){for(const t in this._flatMap)e(this._flatMap[t],t);return this}scrollToNode(e,t={}){const n=this.element.querySelector(`[data-node-id="${e}"]`);return n&&n.scrollIntoView({behavior:t.behavior||"smooth",block:t.block||"center",inline:t.inline||"nearest"}),this}destroy(){this._tree=[],this._flatMap={},this._expandedNodes.clear(),this._selectedNodes.clear(),this.element.innerHTML="",super.destroy()}}const E="domma-theme",S="domma-theme-variant",$="dm-theme-",z=["ocean-light","ocean-dark","forest-light","forest-dark","sunset-light","sunset-dark","royal-light","royal-dark","lemon-light","lemon-dark","silver-light","silver-dark","charcoal-light","charcoal-dark","christmas-light","christmas-dark","unicorn-light","unicorn-dark","dreamy-light","dreamy-dark","grayve-light","grayve-dark","mint-light","mint-dark","wedding-light","wedding-dark","core-light","corporate-light","corporate-dark","admin-smooth-steel","admin-smooth-indigo","admin-smooth-teal","admin-sharp-steel","admin-sharp-indigo","admin-sharp-teal","admin-slate-steel","admin-slate-indigo","admin-slate-teal"],T="charcoal-dark";const B=new class{constructor(){this._theme=T,this._listeners=[],this._target=null,this._initialised=!1,this._systemMediaQuery=null,this._autoDetect=!1,this._disabled=!1}init(e={}){const{theme:t=null,autoDetect:n=!1,persist:s=!0,disabled:i=!1,target:o=document.body}=e;if(i)return this._disabled=!0,this._initialised=!0,this;this._target="string"==typeof o?document.querySelector(o):o,this._target||(this._target=document.body),this._persist=s,this._autoDetect=n;let r=t;if(s){const e=this._loadFromStorage();e&&!t&&(r=e)}if(n&&!r){r="dark"===this._getSystemPreference()?"charcoal-dark":"charcoal-light",this._setupSystemListener()}return r=r||T,z.includes(r)||(console.warn(`Invalid theme: ${r}. Using default: ${T}`),r=T),this._theme=r,this._applyTheme(),this._initialised=!0,this}get(){return this._theme}getBase(){return this._theme.split("-").slice(0,-1).join("-")}getMode(){return this._theme.split("-").pop()}isDark(){return"dark"===this.getMode()}isLight(){return"light"===this.getMode()}set(e){if(!z.includes(e))return console.warn(`Invalid theme: ${e}. Available themes: ${z.join(", ")}`),this;const t=this._theme;return t===e||(this._theme=e,this._applyTheme(),this._saveToStorage(),this._notifyListeners(t,e)),this}onChange(e){return"function"!=typeof e?(console.warn("onChange requires a function callback"),()=>{}):(this._listeners.push(e),()=>{const t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)})}preview(e){if(!z.includes(e))return console.warn(`Invalid theme for preview: ${e}`),()=>{};const t=this._theme;return this._theme=e,this._applyTheme(!1),()=>{this._theme=t,this._applyTheme(!1)}}listThemes(){return[...z]}listBases(){return["ocean","forest","sunset","royal","lemon","silver","charcoal","christmas","unicorn","dreamy","grayve","mint","wedding","corporate","admin-smooth","admin-sharp","admin-slate"]}getConfig(){return{theme:this._theme,base:this.getBase(),mode:this.getMode(),autoDetect:this._autoDetect,persist:this._persist,disabled:this._disabled}}_updateMetaThemeColor(){const e={light:"#ffffff",dark:"#121212"};let t=document.querySelector('meta[name="theme-color"]');t||(t=document.createElement("meta"),t.name="theme-color",document.head.appendChild(t)),t.content=e[this.getMode()]||e.dark}isDisabled(){return this._disabled}enable(){return this._disabled=!1,this._target||(this._target=document.body),this._applyTheme(),this}disable(){if(this._disabled=!0,this._target){const e=this._target.className.split(" ").filter(e=>!e.startsWith($));this._target.className=e.join(" ").trim(),this._target.removeAttribute("data-mode")}return this}_applyTheme(e=!0){if(this._disabled)return;const t=this._target||document.body;if(!t)return void console.error("[ThemeEngine] No target element available for theme application");const n=t.className.split(" ").filter(e=>!e.startsWith($));n.push(`${$}${this._theme}`),t.className=n.join(" ").trim();const s=this.isDark()?"dark":"light";t.setAttribute("data-mode",s),e&&this._updateMetaThemeColor()}_saveToStorage(){if(this._persist&&"undefined"!=typeof localStorage)try{localStorage.setItem(E,this._theme),localStorage.removeItem(S)}catch(e){}}_loadFromStorage(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(E);if(e&&z.includes(e))return e;const t=e,n=localStorage.getItem(S);if(t&&["light","dark"].includes(t)){const e=`${n||"charcoal"}-${t}`;if(console.log(`[ThemeEngine] Migrating theme: ${t} + ${n} → ${e}`),z.includes(e))return localStorage.setItem(E,e),localStorage.removeItem(S),e}return null}catch(e){return null}}_getSystemPreference(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}_setupSystemListener(){if("undefined"==typeof window||!window.matchMedia)return;this._systemMediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{if(!this._autoDetect)return;const t=e.matches?"dark":"light",n=`${this.getBase()}-${t}`;z.includes(n)&&this.set(n)};this._systemMediaQuery.addEventListener?this._systemMediaQuery.addEventListener("change",e):this._systemMediaQuery.addListener(e)}_notifyListeners(e,t){this._listeners.forEach(n=>{try{n(e,t)}catch(e){console.error("[ThemeEngine] Error in change listener:",e)}})}destroy(){this._systemMediaQuery&&this._systemMediaQuery.removeEventListener,this._listeners=[],this._target=null,this._initialised=!1}};"undefined"!=typeof document&&!1!==s("theme",!0)&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{B._initialised||B.init({persist:!0,autoDetect:!1})}):B._initialised||B.init({persist:!0,autoDetect:!1}));const j="dm-context-cursor-rules",O={fill:"#111827",halo:"#ffffff"},D="M1,1 L1,17 L5.2,12.9 L8,19 L10.6,17.7 L7.9,11.8 L13.6,11.6 Z",N=[15.5,18.5,21.5];function I(e=("undefined"!=typeof document?document:null)){if(!e||!e.documentElement||"function"!=typeof getComputedStyle)return{...O};let t;try{t=getComputedStyle(e.documentElement)}catch{return{...O}}const n=(t.getPropertyValue("--dm-text")||"").trim(),s=(t.getPropertyValue("--dm-text-inverse")||"").trim();return{fill:n||O.fill,halo:s||O.halo}}function H(e={}){return`url('data:image/svg+xml,${t=function({size:e=26,fill:t,halo:n}={}){const s=t&&n?{fill:t,halo:n}:{...I(),...t?{fill:t}:{},...n?{halo:n}:{}},i=Math.max(12,Math.min(32,Number(e)||26)),o=(e,t,n)=>`<path d="M17.2 ${e}h5.4" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,r=(e,t,n)=>`<path d="M14.4 ${e}h.01" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,a=N.map(e=>r(e,s.halo,3.6)+o(e,s.halo,3.4)).join(""),l=N.map(e=>r(e,s.fill,1.9)+o(e,s.fill,1.7)).join("");return[`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 26 26">`,`<path d="${D}" fill="${s.halo}" stroke="${s.halo}" stroke-width="2.6" stroke-linejoin="round"/>`,`<path d="${D}" fill="${s.fill}"/>`,a,l,"</svg>"].join("")}(e),encodeURIComponent(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/!/g,"%21")}') 1 1, context-menu`;var t}const W=new Map,P=new Map;let F=null;function R(e,t){return`${e}{cursor:${t};}@media (forced-colors:active){${e}{cursor:context-menu;}}`}function V(){const e=function(){if("undefined"==typeof document)return null;let e=document.getElementById(j);return e||(e=document.createElement("style"),e.id=j,document.head.appendChild(e)),e}();if(!e)return;if(!W.size&&!P.size)return void(e.textContent="");const t=I(),n=[];P.forEach(({selector:e,value:t})=>n.push(R(e,t))),W.forEach(({selector:e,size:s})=>{n.push(R(e,H({size:s,...t})))}),e.textContent=n.join("\n")}function q(){W.size&&!F?F=B.onChange(()=>V()):!W.size&&F&&(F(),F=null)}function U(e,t,n){t&&(W.delete(e),P.delete(e),"glyph"===n.kind?W.set(e,{selector:t,size:n.size||26}):"keyword"===n.kind?P.set(e,{selector:t,value:"context-menu"}):"custom"===n.kind&&n.value&&P.set(e,{selector:t,value:n.value}),q(),V())}const K=new Set;let Y=null,G=!1,J=0,X=0;const Z=e=>"function"==typeof e,Q={primary:"var(--dm-primary)",success:"var(--dm-success)",danger:"var(--dm-danger)",warning:"var(--dm-warning)",info:"var(--dm-info)"},ee={none:"0",sm:"sm",md:"md",lg:"lg",xl:"xl"};const te=e=>Z(e)&&Z(e.subscribe);function ne(e,...t){return te(e)?e():Z(e)?e(...t):e}function se(e){const t=[];let n=e instanceof Element?e:null;for(;n;){const e=[];for(const t of K)t._enabledFlag&&t.matchesContainer(n)&&e.push(t);e.length>1&&e.sort((e,t)=>t.options.priority-e.options.priority);for(const s of e)t.push({instance:s,container:n});n=n.parentElement||(n.parentNode&&n.parentNode.host?n.parentNode.host:null)}return t}function ie(e,t){const n=se(e),s=n.findIndex(e=>e.instance.options.exclusive);let i=0,o=null;if(s>-1){const r=n[s];o=r.instance._accept(r.container,e,t),o&&(i=s)}const r=[];for(let a=i;a<n.length;a++){if(a===s&&o){r.push(o);continue}const i=n[a],l=i.instance._accept(i.container,e,t);l&&r.push(l)}return r}let oe=null,re=null,ae=null,le=null,ce=null,he=null,de=null;function ue(){G||"undefined"==typeof document||(G=!0,oe=e=>{e.shiftKey&&function(e){for(const t of se(e))if(t.instance.options.nativeOnShift)return!0;return!1}(e.target)||(Y&&Y.close(),function(e,t,n){const s=ie(e.target,e);if(!s.length)return!1;const i=s[0],o=i.instance._assembleItems(s,e);!o.length&&!i.instance.options.render||(e.preventDefault(),X=Date.now(),i.instance._openResolved(t,n,i,o,e,!1,s))}(e,e.clientX,e.clientY))},document.addEventListener("contextmenu",oe),re=e=>{const t="ContextMenu"===e.key,n="F10"===e.key&&e.shiftKey;if(!t&&!n)return;if(Y)return;const s=document.activeElement;if(!s||s===document.body)return;const i=ie(s,e);if(!i.length)return;const o=i[0];if(!o.instance.options.keyboardTrigger)return;const r=o.instance._assembleItems(i,e);if(!r.length&&!o.instance.options.render)return;e.preventDefault();const a=s.getBoundingClientRect();X=Date.now(),o.instance._openResolved(a.left+a.width/2,a.top+a.height/2,o,r,e,!0,i)},document.addEventListener("keydown",re),ae=e=>{if(Y)return;if(!e.touches||1!==e.touches.length)return;const t=e.touches[0],n=ie(e.target,e);if(!n.length)return;const s=n[0],i=s.instance.options.longPress;i&&(de={x:t.clientX,y:t.clientY,target:e.target},he=setTimeout(()=>{if(he=null,Date.now()-X<400)return;const t=s.instance._assembleItems(n,e);(t.length||s.instance.options.render)&&(X=Date.now(),s.instance._openResolved(de.x,de.y,s,t,e,!1,n))},i))},le=e=>{if(!(he&&de&&e.touches&&e.touches.length))return;const t=e.touches[0];(Math.abs(t.clientX-de.x)>10||Math.abs(t.clientY-de.y)>10)&&(clearTimeout(he),he=null)},ce=()=>{he&&(clearTimeout(he),he=null)},document.addEventListener("touchstart",ae,{passive:!0}),document.addEventListener("touchmove",le,{passive:!0}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))}class pe extends C{static componentName="context-menu";static defaults={items:[],match:null,exclude:null,enabled:!0,inherit:"append",priority:0,exclusive:!1,nativeOnShift:!0,closeOnSelect:!0,closeOnEscape:!0,closeOnClickOutside:!0,closeOnScroll:!0,longPress:500,cursor:"auto",cursorSize:26,className:"",minWidth:"200px",maxWidth:"320px",maxHeight:"60vh",offset:[2,2],flip:!0,animation:!0,animationDuration:120,transition:"scale",easing:"cubic-bezier(0.16, 1, 0.3, 1)",accent:null,surface:null,radius:null,shadow:null,opacity:null,density:"comfortable",itemTemplate:null,submenuDelay:150,render:null,keyboardTrigger:!0,typeahead:!0,ariaLabel:"Context menu",model:null,modelKey:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onSelect:null};constructor(e,t={}){super(e,t),this.selector="string"==typeof e?e:null,this._node=this.selector?null:this.element,this._menu=null,this._submenus=[],this._isOpen=!1,this._enabledFlag=!0,this._focusIndex=-1,this._renderedItems=[],this._ctx=null,this._typeaheadBuffer="",this._typeaheadTimer=null,this._submenuTimer=null,this._observableDispose=null,this._restoreFocusTo=null,this._chain=null,this._cursorId=++J,K.add(this),ue(),this._applyTouchCallout(),this._applyCursor()}_applyCursor(){const{cursor:e,cursorSize:t,match:n}=this.options;if(!1===e||null===e||"undefined"==typeof document)return;let s=this.selector;if(!s){if(!this._node)return;this._node.setAttribute("data-dm-ctx-cursor",String(this._cursorId)),s=`[data-dm-ctx-cursor="${this._cursorId}"]`}const i=n?`${s} ${n}`:s;"auto"===e?U(this._cursorId,i,{kind:"keyword"}):"glyph"===e?U(this._cursorId,i,{kind:"glyph",size:t}):"string"==typeof e&&U(this._cursorId,i,{kind:"custom",value:e})}_applyTouchCallout(){this.options.longPress&&this.selector&&"undefined"!=typeof document&&document.querySelectorAll(this.selector).forEach(e=>{e.style.webkitTouchCallout="none"})}matchesContainer(e){return this.selector?Z(e.matches)&&e.matches(this.selector):e===this._node}_accept(e,t,n){const s=this.options;if(s.exclude&&t.closest(s.exclude)&&e.contains(t.closest(s.exclude)))return null;let i=e;if(s.match){const n=t.closest(s.match);if(!n||!e.contains(n))return null;i=n}const o={target:i,container:e,x:n&&void 0!==n.clientX?n.clientX:0,y:n&&void 0!==n.clientY?n.clientY:0,event:n,menu:null,instance:this};return ne(s.enabled,i,o)?!1===this._fire("beforeopen",o)?null:{instance:this,container:e,target:i,ctx:o}:null}_ownItems(e){const t=this.options;let n;return n=t.model&&t.modelKey&&Z(t.model.get)?t.model.get(t.modelKey):ne(t.items,e.target,e.ctx),Array.isArray(n)?n:[]}_assembleItems(e,t){const n=e[0],s=this._ownItems(n),i=this.options.inherit;if(!i||e.length<2)return this._filterItems(s,n);let o=[];for(let t=1;t<e.length;t++){const n=e[t],s=n.instance._filterItems(n.instance._ownItems(n),n);s.length&&(o.length&&o.push({type:"divider"}),o=o.concat(s))}const r=this._filterItems(s,n);return o.length?r.length?"prepend"===i?o.concat([{type:"divider"}],r):r.concat([{type:"divider"}],o):o:r}_filterItems(e,t){const n=e.filter(e=>!!e&&(void 0===e.visible||!!ne(e.visible,t.target,t.ctx))),s=[];for(const e of n){const t="divider"===e.type||e.divider;(!t||s.length&&!s[s.length-1]._isDivider)&&s.push(t?{type:"divider",_isDivider:!0}:e)}for(;s.length&&s[s.length-1]._isDivider;)s.pop();return s}open(e,t,n){const s=n||(this.selector?document.querySelector(this.selector):this._node);if(!s)return this;const i=ie(s,{clientX:e,clientY:t,target:s}),o=i.find(e=>e.instance===this)||i[0];if(!o)return this;const r=[o,...i.filter(e=>e!==o)],a=o.instance._assembleItems(r,null);return a.length||o.instance.options.render?(Y&&Y.close(),o.instance._openResolved(e,t,o,a,null,!1,r),this):this}_openResolved(e,t,n,s,i,o=!1,r=null){Y&&Y!==this&&Y.close(),this._isOpen&&this._forcedClose();const a=this.options;if(this._chain=r||[n],this._ctx=n.ctx,this._ctx.x=e,this._ctx.y=t,this._renderedItems=s,this._restoreFocusTo=o?document.activeElement:null,a.render){const n=a.render(this._ctx);return n?(this._menu=n,n.parentNode||document.body.appendChild(n),n.style.position="fixed",this._applyTheme(n),n.classList.add("is-open"),this._ctx.menu=n,this._positionAt(n,e,t),this._bindOpenListeners(),this._isOpen=!0,Y=this,void this._fire("open",this._ctx)):(this._chain=null,void(this._ctx=null))}this._menu=this._createMenu(),this._renderInto(this._menu,s,n),document.body.appendChild(this._menu),this._ctx.menu=this._menu,this._positionAt(this._menu,e,t),this._bindOpenListeners(),this._isOpen=!0,Y=this,te(a.items)&&(this._observableDispose=a.items.subscribe(()=>{this._isOpen&&this.refresh()})),a.animation?requestAnimationFrame(()=>{this._menu&&this._menu.classList.add("is-open")}):this._menu.classList.add("is-open"),this._menu.focus({preventScroll:!0}),o&&this._moveFocus(1),this._fire("open",this._ctx)}close(){if(!this._isOpen)return this;if(!this._mayClose(this._ctx))return this;this._closeSubmenus(0),this._unbindOpenListeners(),this._observableDispose&&(Z(this._observableDispose)?this._observableDispose():Z(this._observableDispose.dispose)&&this._observableDispose.dispose(),this._observableDispose=null);const e=this._menu,t=this.options;return this._menu=null,this._isOpen=!1,this._focusIndex=-1,Y===this&&(Y=null),e&&(t.animation?(e.classList.remove("is-open"),setTimeout(()=>e.remove(),t.animationDuration)):e.remove()),this._restoreFocusTo&&Z(this._restoreFocusTo.focus)&&this._restoreFocusTo.focus({preventScroll:!0}),this._restoreFocusTo=null,this._fire("close",this._ctx),this._ctx=null,this}refresh(){if(!this._isOpen||!this._ctx)return this;const e=this._chain&&this._chain.length?this._chain[0]:{instance:this,container:this._ctx.container,target:this._ctx.target,ctx:this._ctx},t=this._assembleItems(this._chain&&this._chain.length?this._chain:[e],null);return this._renderedItems=t,this._closeSubmenus(0),this._renderInto(this._menu,t,e),this._positionAt(this._menu,this._ctx.x,this._ctx.y),this}isOpen(){return this._isOpen}toggle(e,t,n){return this._isOpen?this.close():this.open(e,t,n)}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setItems(e){return this.options.items=e,this._isOpen&&this.refresh(),this}enable(){return this._enabledFlag=!0,this}disable(){return this._isOpen&&this.close(),this._enabledFlag=!1,this}_createMenu(e=!1){const t=this.options,n=document.createElement("div");return n.className="dm-context-menu"+(e?" dm-context-menu-sub":"")+(t.className?" "+t.className:""),n.setAttribute("role","menu"),n.setAttribute("tabindex","-1"),e||n.setAttribute("aria-label",t.ariaLabel),n.style.minWidth=t.minWidth,n.style.maxWidth=t.maxWidth,n.style.maxHeight=t.maxHeight,this._applyTheme(n),n}_applyTheme(e){const t=this.options;e.dataset.transition=t.animation?t.transition||"scale":"none","compact"===t.density&&(e.dataset.density="compact");const n=(t,n)=>{null!=n&&""!==n&&e.style.setProperty(t,n)};var s;if(n("--dm-ctx-accent",(s=t.accent)?Q[s]||s:null),n("--dm-ctx-surface",t.surface),n("--dm-ctx-radius",function(e){return e?"none"===e?"0":ee[e]?`var(--dm-radius-${e})`:e:null}(t.radius)),n("--dm-ctx-shadow",function(e){return e?"none"===e?"none":ee[e]?`var(--dm-shadow-${e})`:e:null}(t.shadow)),n("--dm-ctx-duration",`${t.animationDuration}ms`),n("--dm-ctx-easing",t.easing),null!==t.opacity&&void 0!==t.opacity){const e=Math.min(100,Math.max(20,Number(t.opacity)||100));e<100&&n("--dm-ctx-opacity",String(e/100))}}_renderInto(e,t,n){if(!e)return;e.innerHTML="";const s=this.options;t.forEach((t,i)=>{if("divider"===t.type||t.divider){const t=document.createElement("div");return t.className="dm-context-menu-divider",t.setAttribute("role","separator"),void e.appendChild(t)}if("header"===t.type||t.header){const n=document.createElement("div");return n.className="dm-context-menu-header",n.setAttribute("role","presentation"),n.textContent=t.header||t.label||"",void e.appendChild(n)}const o=!!ne(t.disabled,n.target,n.ctx),r=document.createElement("button");r.type="button",r.className="dm-context-menu-item",r.setAttribute("role","checkbox"===t.type?"menuitemcheckbox":"radio"===t.type?"menuitemradio":"menuitem"),r.setAttribute("tabindex","-1"),r.dataset.index=String(i),t.danger&&r.classList.add("is-danger");for(const e of[].concat(t.className||[]).join(" ").split(/\s+/))e&&r.classList.add(e);if(o&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0),"checkbox"===t.type||"radio"===t.type){const e=!!ne(t.checked,n.target,n.ctx);r.setAttribute("aria-checked",String(e)),e&&r.classList.add("is-checked")}if(s.itemTemplate)r.innerHTML=s.itemTemplate(t,i);else{const e=document.createElement("span");e.className="dm-context-menu-icon",t.icon&&(e.setAttribute("data-icon",t.icon),e.setAttribute("data-size","16")),r.appendChild(e);const n=document.createElement("span");if(n.className="dm-context-menu-label",n.textContent=t.label||t.text||t.name||"",r.appendChild(n),t.shortcut){const e=document.createElement("span");e.className="dm-context-menu-shortcut",e.textContent=t.shortcut,r.appendChild(e)}}const a=t.submenu;if(a){r.classList.add("has-submenu"),r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false");const e=document.createElement("span");e.className="dm-context-menu-chevron",e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-size","14"),r.appendChild(e)}o||(r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),a?this._openSubmenu(r,t,n,this._depthOf(e)):this._activate(t,i)}),r.addEventListener("mouseenter",()=>{this._closeSubmenus(this._depthOf(e)),clearTimeout(this._submenuTimer),a&&(this._submenuTimer=setTimeout(()=>this._openSubmenu(r,t,n,this._depthOf(e)),s.submenuDelay))})),e.appendChild(r)}),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&Z(window.Domma.icons.scan)&&window.Domma.icons.scan(e)}_depthOf(e){const t=this._submenus.indexOf(e);return-1===t?0:t+1}_openSubmenu(e,t,n,s){this._closeSubmenus(s);const i=this._filterItems(ne(t.submenu,n.target,n.ctx)||[],n);if(!i.length)return;const o=this._createMenu(!0);this._renderInto(o,i,n),document.body.appendChild(o),this._submenus[s]=o;const r=e.getBoundingClientRect();this._positionAt(o,r.right,r.top,r),e.setAttribute("aria-expanded","true"),e.classList.add("is-open"),o.dataset.owner=e.dataset.index,this.options.animation?requestAnimationFrame(()=>o.classList.add("is-open")):o.classList.add("is-open")}_closeSubmenus(e){for(let t=this._submenus.length-1;t>=e;t--){const e=this._submenus[t];if(!e)continue;const n=this._menu&&void 0!==e.dataset.owner?this._menu.querySelector(`[data-index="${e.dataset.owner}"]`):null;n&&(n.setAttribute("aria-expanded","false"),n.classList.remove("is-open")),e.remove(),this._submenus.splice(t,1)}}_activate(e,t){const n=this._ctx,s=this.options;this._fire("select",e,n),Z(e.action)&&e.action(n?n.target:null,n),s.closeOnSelect&&this.close()}_positionAt(e,t,n,s=null){const i=this.options,[o,r]=i.offset,a=e.offsetWidth,l=e.offsetHeight,c=document.documentElement.clientWidth,h=document.documentElement.clientHeight;let d=t+o,u=n+r;if(i.flip){if(d+a>c-8){const e=s?s.left-a:t-a-o;e>=8&&(d=e)}if(u+l>h-8){const e=s?n-l+s.height:n-l-r;e>=8&&(u=e)}}d=a<=c-16?Math.max(8,Math.min(d,c-a-8)):8,u=l<=h-16?Math.max(8,Math.min(u,h-l-8)):8,e.style.left=d+"px",e.style.top=u+"px"}_bindOpenListeners(){const e=this.options;this._outsideHandler=e=>{this._isOpen&&(this._menu&&this._menu.contains(e.target)||this._submenus.some(t=>t&&t.contains(e.target))||this.close())},e.closeOnClickOutside&&document.addEventListener("mousedown",this._outsideHandler,!0),this._contextHandler=e=>{this._menu&&this._menu.contains(e.target)&&e.preventDefault()},document.addEventListener("contextmenu",this._contextHandler),this._keyHandler=e=>this._onKeyDown(e),document.addEventListener("keydown",this._keyHandler,!0),e.closeOnScroll&&(this._scrollHandler=()=>this.close(),window.addEventListener("scroll",this._scrollHandler,!0)),this._resizeHandler=()=>this.close(),window.addEventListener("resize",this._resizeHandler)}_unbindOpenListeners(){this._outsideHandler&&(document.removeEventListener("mousedown",this._outsideHandler,!0),this._outsideHandler=null),this._contextHandler&&(document.removeEventListener("contextmenu",this._contextHandler),this._contextHandler=null),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,!0),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),clearTimeout(this._submenuTimer),clearTimeout(this._typeaheadTimer)}_focusableItems(){const e=this._submenus.length?this._submenus[this._submenus.length-1]:this._menu;return e?Array.from(e.querySelectorAll(".dm-context-menu-item:not(.is-disabled)")):[]}_moveFocus(e){const t=this._focusableItems();if(!t.length)return;let n=t.indexOf(document.activeElement)+e;n<0&&(n=t.length-1),n>=t.length&&(n=0),t[n].focus({preventScroll:!0})}_onKeyDown(e){if(!this._isOpen)return;const t=this.options;switch(e.key){case"Escape":if(!t.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void(this._submenus.length?this._closeSubmenus(this._submenus.length-1):this.close());case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"Home":{e.preventDefault();const t=this._focusableItems()[0];return void(t&&t.focus({preventScroll:!0}))}case"End":{e.preventDefault();const t=this._focusableItems();return void(t.length&&t[t.length-1].focus({preventScroll:!0}))}case"ArrowRight":{const t=document.activeElement;return void(t&&t.classList.contains("has-submenu")&&(e.preventDefault(),t.click(),requestAnimationFrame(()=>this._moveFocus(1))))}case"ArrowLeft":if(this._submenus.length){e.preventDefault(),this._closeSubmenus(this._submenus.length-1);const t=this._focusableItems();t.length&&t[0].focus({preventScroll:!0})}return;case"Enter":case" ":{const t=document.activeElement;return void(t&&t.classList.contains("dm-context-menu-item")&&(e.preventDefault(),t.click()))}}!t.typeahead||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||this._typeahead(e.key)}_typeahead(e){clearTimeout(this._typeaheadTimer),this._typeaheadBuffer+=e.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeaheadBuffer=""},600);const t=this._focusableItems().find(e=>{const t=e.querySelector(".dm-context-menu-label");return t&&t.textContent.toLowerCase().startsWith(this._typeaheadBuffer)});t&&t.focus({preventScroll:!0})}destroy(){var e;this._forcedClose(),K.delete(this),e=this._cursorId,(W.delete(e)||P.delete(e))&&(q(),V()),this._node&&this._node.getAttribute("data-dm-ctx-cursor")===String(this._cursorId)&&this._node.removeAttribute("data-dm-ctx-cursor"),G&&!K.size&&(G=!1,document.removeEventListener("contextmenu",oe),document.removeEventListener("keydown",re),document.removeEventListener("touchstart",ae),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),oe=re=ae=le=ce=null),super.destroy()}}pe.closeAll=function(){Y&&Y.close()},pe.active=function(){return Y},pe.registry=function(e=null){return e?se(e).map(e=>e.instance):Array.from(K)};const me={_prefix:"domma:",_available:null,isAvailable(){if(null!==this._available)return this._available;try{const e=`${this._prefix}__test__`;localStorage.setItem(e,"test"),localStorage.removeItem(e),this._available=!0}catch(e){this._available=!1}return this._available},_prefixKey(e){return`${this._prefix}${e}`},_unprefixKey(e){return e.slice(this._prefix.length)},get(e,t=null){if(!this.isAvailable())return t;try{const n=this._prefixKey(e),s=localStorage.getItem(n);return null===s?t:JSON.parse(s)}catch(n){return console.warn(`Domma storage: Failed to parse key "${e}"`,n),t}},set(e,t){if(!this.isAvailable())return!1;try{const n=this._prefixKey(e),s=JSON.stringify(t);return localStorage.setItem(n,s),!0}catch(t){return console.warn(`Domma storage: Failed to set key "${e}"`,t),!1}},remove(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return localStorage.removeItem(t),!0}catch(t){return console.warn(`Domma storage: Failed to remove key "${e}"`,t),!1}},has(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return null!==localStorage.getItem(t)}catch(e){return!1}},clear(){if(!this.isAvailable())return 0;try{const e=this.keys();return e.forEach(e=>this.remove(e)),e.length}catch(e){return console.warn("Domma storage: Failed to clear storage",e),0}},keys(){if(!this.isAvailable())return[];try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith(this._prefix)&&e.push(this._unprefixKey(n))}return e}catch(e){return[]}},size(e){if(!this.isAvailable())return 0;try{const t=this._prefixKey(e),n=localStorage.getItem(t);return n?new Blob([n]).size:0}catch(e){return 0}},totalSize(){if(!this.isAvailable())return 0;try{let e=0;return this.keys().forEach(t=>{e+=this.size(t)}),e}catch(e){return 0}},getAll(){if(!this.isAvailable())return{};const e={};return this.keys().forEach(t=>{e[t]=this.get(t)}),e},setAll(e){if(!this.isAvailable()||!e)return!1;let t=!0;return Object.keys(e).forEach(n=>{this.set(n,e[n])||(t=!1)}),t}},fe="sortable:",_e='input, textarea, select, button, option, a[href], [contenteditable=""], [contenteditable="true"]',ge=e=>"function"==typeof e;class ve extends C{static componentName="sortable";static defaults={items:null,handle:null,nest:!1,live:null,axis:"y",key:"data-id",animation:200,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)",threshold:4,touchDelay:220,nestZone:.5,accepts:null,disabled:!1,keyboard:!0,persist:!1,autoScroll:!0,ghostParent:null,onStart:null,onMove:null,onSort:null,onDrop:null,onCancel:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._drag=null,this._pending=null,this._animating=new WeakSet,this._flips=new WeakMap,this._docHandlers=[],this.element.classList.add("dm-sortable"),this._markHandles(),"undefined"!=typeof MutationObserver&&(this._observer=new MutationObserver(()=>this._markHandles()),this._observer.observe(this.element,{childList:!0,subtree:!0})),this._addEventListener(this.element,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this.element,"dragstart",e=>{(this._pending||this._drag)&&e.preventDefault()}),this.options.persist&&this._isLive()&&this.restore())}toArray(){return this._items().map(e=>this._keyOf(e))}sort(e,{animate:t=!0}={}){const n=()=>{const t=this._items(),n=new Map(e.map((e,t)=>[String(e),t])),s=t.filter(e=>n.has(this._keyOf(e)));if(!s.length)return;const i=[...s].sort((e,t)=>n.get(this._keyOf(e))-n.get(this._keyOf(t)));s.map(e=>{const t=document.createComment("");return e.before(t),t}).forEach((e,t)=>{e.replaceWith(i[t])})};return t?this.animate(n):n(),this}restore(){const e=this._storageKey()?me.get(this._storageKey()):null;return Array.isArray(e)&&e.length&&this.sort(e,{animate:!1}),this}forget(){const e=this._storageKey();return e&&me.remove(e),this}animate(e){const t=this._snapshot(),n=e();return n&&ge(n.then)?n.then(e=>(this._playFlip(t),e)):(this._playFlip(t),n)}enable(){return this.options.disabled=!1,this.element?.classList.remove("dm-sortable-disabled"),this}disable(){return this._drag&&this._cancel(),this.options.disabled=!0,this.element?.classList.add("dm-sortable-disabled"),this}get dragging(){return!!this._drag}destroy(){this._drag&&this._finish(!1),this._clearPending(),this._observer?.disconnect(),this._liveRegion?.remove(),this.element&&(this.element.classList.remove("dm-sortable","dm-sortable-disabled","dm-sortable-active"),this.element.querySelectorAll(".dm-sortable-handle").forEach(e=>e.classList.remove("dm-sortable-handle"))),super.destroy()}_applyOptions(){this._markHandles(),this.element?.classList.toggle("dm-sortable-disabled",!!this.options.disabled)}_isLive(){return null==this.options.live?!this.options.nest:!!this.options.live}_items(){const e=this.element;if(!e)return[];return(this.options.items?Array.from(e.querySelectorAll(this.options.items)):Array.from(e.children)).filter(t=>!t.classList.contains("dm-sortable-ghost")&&!t.classList.contains("dm-sortable-indicator")&&!t.classList.contains("dm-sortable-live")&&this._ownerOf(t)===e)}_ownerOf(e){let t=e.parentElement;for(;t&&!t.classList.contains("dm-sortable");)t=t.parentElement;return t}_itemFrom(e){if(!(e instanceof Element))return null;const t=this._items();let n=e;for(;n&&n!==this.element;){if(t.includes(n))return n;n=n.parentElement}return null}_keyOf(e){const t=this.options.key,n=t?e.getAttribute(t):null;return null==n?null:String(n)}_byKey(e){return null==e?null:this._items().find(t=>this._keyOf(t)===e)||null}_markHandles(){this.element&&this.options.handle&&this.element.querySelectorAll(this.options.handle).forEach(e=>{e.classList.contains("dm-sortable-handle")||e.classList.add("dm-sortable-handle")})}_storageKey(){const e=this.options.persist;return e?!0===e?this.element?.id?fe+this.element.id:null:fe+e:null}_duration(){return function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animation)||0)}_onPointerDown(e){if(this.options.disabled||this._drag||this._pending||0!==e.button||e._dmSortable)return;const t=this._itemFrom(e.target);if(!t)return;e._dmSortable=!0;const{handle:n}=this.options;if(n){const s=e.target.closest(n);if(!s||!t.contains(s))return;e.preventDefault()}else if(e.target.closest(_e)&&e.target.closest(_e)!==t)return;const s="touch"===e.pointerType&&!n;this._pending={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,ready:!s,timer:null},s&&(this._pending.timer=setTimeout(()=>{this._pending&&(this._pending.ready=!0,this._guard(()=>this._begin(this._pending.startX,this._pending.startY)))},this.options.touchDelay)),this._listenDoc("pointermove",e=>this._guard(()=>this._onPointerMove(e))),this._listenDoc("pointerup",e=>this._guard(()=>this._onPointerUp(e))),this._listenDoc("pointercancel",e=>this._guard(()=>this._onPointerCancel(e))),this._listenDoc("keydown",e=>{"Escape"===e.key&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._guard(()=>this._cancel()))},!0),this._listenDoc("contextmenu",e=>{this._drag&&e.preventDefault()},!0),this._listenWin("blur",()=>this._guard(()=>{this._drag?this._cancel():this._clearPending()})),this._listenDoc("touchmove",e=>{this._drag&&e.preventDefault()},{passive:!1})}_onPointerMove(e){const t=this._pending;if(t&&e.pointerId===t.pointerId&&!this._drag){const n=Math.hypot(e.clientX-t.startX,e.clientY-t.startY);if(!t.ready)return void(n>8&&this._clearPending());if(n<this.options.threshold)return;this._begin(t.startX,t.startY)}if(this._drag&&e.pointerId===this._drag.pointerId){if("mouse"===e.pointerType&&0===e.buttons)return void this._onPointerUp(e);e.preventDefault(),this._moveTo(e.clientX,e.clientY)}}_guard(e){try{return e()}catch(e){if(this._drag){try{this._cancel()}catch{}this._drag&&this._finish(!1)}else this._clearPending();throw e}}_onPointerUp(e){if(this._drag&&e.pointerId===this._drag.pointerId)return this._moveTo(e.clientX,e.clientY),void this._drop();this._clearPending()}_onPointerCancel(e){this._drag&&e.pointerId===this._drag.pointerId?this._cancel():this._clearPending()}_listenDoc(e,t,n){document.addEventListener(e,t,n),this._docHandlers.push({target:document,event:e,handler:t,opts:n})}_listenWin(e,t,n){window.addEventListener(e,t,n),this._docHandlers.push({target:window,event:e,handler:t,opts:n})}_unlistenDoc(){for(const{target:e,event:t,handler:n,opts:s}of this._docHandlers)e.removeEventListener(t,n,s);this._docHandlers=[]}_clearPending(){this._pending?.timer&&clearTimeout(this._pending.timer),this._pending=null,this._drag||this._unlistenDoc()}_begin(e,t){const{item:n,pointerId:s}=this._pending;this._pending.timer&&clearTimeout(this._pending.timer),this._pending=null;const i=n.getBoundingClientRect(),o=this._items(),r=n.cloneNode(!0);r.removeAttribute("id"),this.options.key&&r.removeAttribute(this.options.key),r.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),r.classList.add("dm-sortable-ghost"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,{position:"fixed",left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`,margin:"0",boxSizing:"border-box",pointerEvents:"none",transform:"translate3d(0, 0, 0)"}),(this.options.ghostParent||this.element).appendChild(r),requestAnimationFrame(()=>r.classList.add("dm-sortable-ghost-lifted")),n.classList.add("dm-sortable-placeholder"),this.element.classList.add("dm-sortable-active"),document.documentElement.classList.add("dm-sortable-dragging");try{window.getSelection?.().removeAllRanges()}catch{}if(this._drag={item:n,pointerId:s,ghost:r,rect:i,offsetX:e-i.left,offsetY:t-i.top,x:e,y:t,from:o.indexOf(n),previous:o.map(e=>this._keyOf(e)),origin:{parent:n.parentNode,next:n.nextSibling},key:this._keyOf(n),target:null,zone:null,indicator:null,scrollRaf:null},!this._isLive()){const e=document.createElement("div");e.className="dm-sortable-indicator",e.setAttribute("aria-hidden","true"),this.element.appendChild(e),this._drag.indicator=e}this._signal("start",{item:n,from:this._drag.from}),this.options.autoScroll&&this._scrollLoop()}_moveTo(e,t){const n=this._drag;if(!n||n.settling)return;n.x=e,n.y=t,n.ghost.style.transform=`translate3d(${e-n.offsetX-n.rect.left}px, ${t-n.offsetY-n.rect.top}px, 0)`;const s=document.elementFromPoint(e,t),i=s?this._itemFrom(s):null;this._isLive()?i&&i!==n.item&&!this._animating.has(i)&&this._liveSwap(i,e,t):this._indicate(i,e,t),this._signal("move",{item:n.item,target:n.target||i,zone:n.zone,x:e,y:t})}_liveSwap(e,t,n){const s=this._drag,i=this._items(),o=i.indexOf(s.item),r=i.indexOf(e);if(o<0||r<0)return;const a=s.item.getBoundingClientRect(),l=e.getBoundingClientRect(),c="x"===this.options.axis,h=c?t:n,d=c?a.width:a.height,u=c?l.left:l.top,p=c?l.right:l.bottom,m=o<r;(m?h>p-d:h<u+d)&&(this.options.accepts&&!this.options.accepts(s.item,e,m?"after":"before")||this._flipItems(()=>{m?e.after(s.item):e.before(s.item)}))}_zoneFor(e,t,n){const s=e.getBoundingClientRect(),i="x"===this.options.axis,o=i?s.width:s.height,r=o?(i?t-s.left:n-s.top)/o:.5;if(this.options.nest){const e=(1-Math.min(Math.max(this.options.nestZone,0),1))/2;return r<e?"before":r>1-e?"after":"into"}return r<.5?"before":"after"}_indicate(e,t,n){const s=this._drag;let i=null;if(e&&e!==s.item&&(i=this._zoneFor(e,t,n),this.options.accepts&&!this.options.accepts(s.item,e,i)))if("into"===i){const o=e.getBoundingClientRect(),r="x"===this.options.axis?o.left+o.width/2:o.top+o.height/2;i=("x"===this.options.axis?t:n)<r?"before":"after",this.options.accepts(s.item,e,i)||(i=null)}else i=null;i||(e=null),s.target===e&&s.zone===i||(s.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),e&&e.classList.add("dm-sortable-over",`dm-sortable-over-${i}`),s.target=e,s.zone=i),this._placeIndicator()}_placeIndicator(){const e=this._drag,t=e?.indicator;if(!t)return;if(!e.target)return void t.classList.remove("is-visible");const n=e.target.getBoundingClientRect(),s="x"===this.options.axis;let i;i="into"===e.zone?{left:n.left,top:n.top,width:n.width,height:n.height}:s?{left:("before"===e.zone?n.left:n.right)-1.5,top:n.top,width:3,height:n.height}:{left:n.left,top:("before"===e.zone?n.top:n.bottom)-1.5,width:n.width,height:3};const o=!t.classList.contains("is-visible");o&&(t.style.transition="none"),Object.assign(t.style,{left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`}),t.classList.toggle("is-into","into"===e.zone),t.classList.add("is-visible"),o&&(t.offsetWidth,t.style.transition="")}_drop(){const e=this._drag;if(!e)return;if(this._suppressClick(),this._isLive()){const t=this.toArray(),n=this._items().indexOf(e.item),s=n!==e.from;return this._finish(!0),s&&(this._save(t),this._signal("sort",{item:e.item,from:e.from,to:n,order:t,previous:e.previous})),void this._signal("end",{item:e.item,changed:s})}const{target:t,zone:n}=e;if(!t||!n)return void this._cancel();const s={item:e.item,target:t,zone:n,key:e.key,targetKey:this._keyOf(t)};this._unlistenDoc(),e.scrollRaf&&cancelAnimationFrame(e.scrollRaf),e.settling=!0;let i=!0;const o=this.animate(()=>{if(ge(this.options.onDrop)){const e=this.options.onDrop(s);return!1===e&&(i=!1),e}"before"===n?t.before(e.item):"after"===n&&t.after(e.item)});this._emit("drop",s);const r=()=>{this._drag===e&&(i?(this._finish(!0),this._signal("end",{item:e.item,changed:!0})):this._cancel())};o&&ge(o.then)?o.then(r,()=>{this._drag===e&&this._cancel()}):r()}_cancel(){const e=this._drag;e&&(this._isLive()&&this._flipItems(()=>{e.origin.parent&&e.origin.parent.insertBefore(e.item,e.origin.next?.parentNode===e.origin.parent?e.origin.next:null)}),this._finish(!1),this._signal("cancel",{item:e.item}),this._signal("end",{item:e.item,changed:!1}))}_finish(e){const t=this._drag;if(!t)return;this._drag=null,this._unlistenDoc(),t.scrollRaf&&cancelAnimationFrame(t.scrollRaf),t.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),t.indicator?.remove(),this.element?.classList.remove("dm-sortable-active"),document.documentElement.classList.remove("dm-sortable-dragging");const n=(e&&null!=t.key?this._byKey(t.key):null)||(t.item.isConnected?t.item:null);t.item!==n&&t.item.classList.remove("dm-sortable-placeholder");const s=t.ghost,i=this._duration();if(!n||!i)return s.remove(),n?.classList.remove("dm-sortable-placeholder"),void(n&&this._announce(n));s.isConnected||(this.options.ghostParent||this.element).appendChild(s),n.classList.add("dm-sortable-placeholder","dm-sortable-landing");const o=n.getBoundingClientRect();s.style.transition=`transform ${i}ms ${this.options.easing}, width ${i}ms ${this.options.easing}, height ${i}ms ${this.options.easing}, scale ${i}ms ${this.options.easing}, box-shadow ${i}ms ${this.options.easing}`,s.classList.remove("dm-sortable-ghost-lifted"),s.style.transform=`translate3d(${o.left-t.rect.left}px, ${o.top-t.rect.top}px, 0)`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`;let r=!1;const a=()=>{r||(r=!0,s.remove(),n.classList.remove("dm-sortable-placeholder","dm-sortable-landing"),this._announce(n))};s.addEventListener("transitionend",e=>{"transform"===e.propertyName&&a()}),setTimeout(a,i+80)}_suppressClick(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,!0),setTimeout(()=>document.removeEventListener("click",e,!0),0)}_scrollLoop(){const e=this._drag;if(!e)return;const t="x"===this.options.axis?"x":"y",n=function(e,t){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const e=getComputedStyle(n),s="x"===t?e.overflowX:e.overflowY;if(("x"===t?n.scrollWidth>n.clientWidth:n.scrollHeight>n.clientHeight)&&/(auto|scroll|overlay)/.test(s))return n;n=n.parentElement}return null}(this.element,t),s=()=>{if(this._drag!==e||e.settling)return;const i=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},o="x"===t?e.x:e.y,r="x"===t?i.left:i.top,a="x"===t?i.right:i.bottom;let l=0;if(o<r+48?l=-Math.ceil(18*(1-Math.max(o-r,0)/48)):o>a-48&&(l=Math.ceil(18*(1-Math.max(a-o,0)/48))),l){const s=n||window;"x"===t?s.scrollBy(l,0):s.scrollBy(0,l),this._moveTo(e.x,e.y)}e.scrollRaf=requestAnimationFrame(s)};e.scrollRaf=requestAnimationFrame(s)}_onKeyDown(e){if(!this.options.keyboard||this.options.disabled||this._drag||!this._isLive()||!e.altKey)return;const t="x"===this.options.axis,n=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";if(e.key!==n&&e.key!==s)return;const i=this._itemFrom(e.target);if(!i||e.target!==i&&(!this.options.handle||!e.target.closest(this.options.handle)))return;const o=this._items(),r=o.indexOf(i),a=e.key===n?r-1:r+1;if(a<0||a>=o.length)return;const l=o[a];if(this.options.accepts&&!this.options.accepts(i,l,e.key===n?"before":"after"))return;e.preventDefault();const c=o.map(e=>this._keyOf(e));this._flipItems(()=>{e.key===n?l.before(i):l.after(i)}),e.target.focus();const h=this.toArray();this._save(h),this._signal("sort",{item:i,from:r,to:a,order:h,previous:c}),this._signal("end",{item:i,changed:!0}),this._announce(i)}_announce(e){const t=this._items(),n=t.indexOf(e);if(!(n<0)){if(!this._liveRegion){const e=document.createElement("div");e.className="dm-sortable-live",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),this._liveRegion=e}this._liveRegion.textContent=`Moved to position ${n+1} of ${t.length}`}}_snapshot({withDragged:e=!1}={}){const t=new Map,n=this._drag;for(const s of this._items()){if(n&&s===n.item&&!e)continue;const i=s.getBoundingClientRect();t.set(s,i);const o=this._keyOf(s);null!=o&&t.set(`key:${o}`,i)}return t}_playFlip(e){const t=this._duration();if(t)for(const n of this._items()){const s=this._keyOf(n),i=e.get(n)||(null!=s?e.get(`key:${s}`):null);if(!i||!ge(n.animate))continue;const o=n.getBoundingClientRect(),r=i.left-o.left,a=i.top-o.top;if(Math.abs(r)<.5&&Math.abs(a)<.5)continue;this._flips.get(n)?.cancel(),this._animating.add(n);const l=n.animate([{transform:`translate(${r}px, ${a}px)`},{transform:"translate(0, 0)"}],{duration:t,easing:this.options.easing});this._flips.set(n,l);const c=()=>{this._flips.get(n)===l&&(this._flips.delete(n),this._animating.delete(n))};l.onfinish=c,l.oncancel=c}}_flipItems(e){const t=this._snapshot({withDragged:!0});e(),this._playFlip(t)}_save(e){const t=this._storageKey();t&&this._isLive()&&me.set(t,e.filter(e=>null!=e))}_signal(e,t){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];ge(n)&&n(t),this._emit(e,t)}}const be="input-group-icon",ye=/^[a-z0-9-]+$/i,ke=/^(text|search|email|url|tel|password|number|date|datetime-local|time|month|week)$/,we=/^(text|search|email|url|tel|password)$/;let xe=0;function Me(e){return null==e||!1===e||""===e?null:"string"==typeof e||"number"==typeof e?{text:String(e)}:"object"!=typeof e?null:e.icon&&ye.test(e.icon)?{icon:e.icon}:null!=e.text&&""!==e.text?{text:String(e.text)}:null}function Le(){return"undefined"!=typeof window&&(window.Domma?.icons||window.I)||null}function Ce(e,t){e.textContent="";const n=document.createElement("span");n.setAttribute("data-icon",t),n.setAttribute("aria-hidden","true"),e.appendChild(n),Le()?.scan?.(e)}function Ae(e,t){const n=document.createElement("span");if(n.className=`input-group-addon input-group-addon-${t}`,n.setAttribute("aria-hidden","true"),e.icon){const t=document.createElement("span");t.setAttribute("data-icon",e.icon),n.appendChild(t)}else n.textContent=e.text;return n}function Ee(e,t,n,s){const i=document.createElement("button");return i.type="button",i.className=`input-group-btn input-group-btn-${t} input-group-${e}`,i.setAttribute("aria-label",n),Ce(i,s),i}function Se(e){const t=String(e),n=t.match(/e-(\d+)$/i);if(n)return Number(n[1]);const s=t.indexOf(".");return-1===s?0:t.length-s-1}function $e(e,t){const n=e.getAttribute(t);if(null==n||""===n||"any"===n)return null;const s=Number(n);return Number.isFinite(s)?s:null}class ze extends C{static componentName="input-group";static defaults={prefix:null,suffix:null,reveal:!1,clear:!1,stepper:!1,counter:!1,labels:{reveal:"Show password",clear:"Clear",decrease:"Decrease",increase:"Increase"}};constructor(e,t={}){if(super(e,t),this.options.labels={...ze.defaults.labels,...t.labels||{}},this.input=this.element,this._extraHandlers=[],this._timers={},this.extras={},!this.input)return;const n=this.input.parentElement;this._ownsWrapper=!(n&&n.classList.contains(be)),this._ownsWrapper?(this.wrapper=document.createElement("div"),this.wrapper.className=be,this.input.before(this.wrapper),this.wrapper.appendChild(this.input)):this.wrapper=n,this._manageAddons=this._ownsWrapper||"prefix"in t||"suffix"in t,this._render(),this._buildExtras()}update(e={}){const{prefix:t,suffix:n}=e;let s=!1;void 0!==t&&(this.options.prefix=t,s=!0),void 0!==n&&(this.options.suffix=n,s=!0),s&&(this._manageAddons=!0,this._render());const i=["reveal","clear","stepper","counter"].filter(t=>void 0!==e[t]);return i.length||e.labels?(i.forEach(t=>{this.options[t]=e[t]}),e.labels&&(this.options.labels={...this.options.labels,...e.labels}),this._teardownExtras(),this._buildExtras()):this._syncEdges(),this}refresh(){const e=this.extras;if(!e||!this.input)return this;const t=this.input,n=t.disabled||t.readOnly;if(e.clear&&(e.clear.hidden=n||""===t.value),e.reveal&&(e.reveal.disabled=t.disabled),e.decrease){const{min:s,max:i}=this._limits(),o=""===t.value?null:Number(t.value),r=null!=o&&Number.isFinite(o);e.decrease.disabled=n||r&&null!=s&&o<=s,e.increase.disabled=n||r&&null!=i&&o>=i,[e.decrease,e.increase].forEach(e=>{e.disabled&&document.activeElement===e&&t.focus()}),e.decrease.disabled&&e.increase.disabled&&this._stopRepeat()}if(e.counter){const n=this._counterLimit(),s=t.value.length;e.counter.textContent=n?`${s} / ${n}`:String(s),e.counter.classList.toggle("is-warning",!!n&&s>=Math.ceil(.9*n)&&s<=n),e.counter.classList.toggle("is-over",!!n&&s>n)}return this._syncEdges(),this}_applyOptions(){this.options.labels={...ze.defaults.labels,...this.options.labels||{}},this._render(),this._teardownExtras(),this._buildExtras()}_render(){const e=this.wrapper;if(e){if(this._manageAddons){e.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove());const t=Me(this.options.prefix),n=Me(this.options.suffix);t&&e.prepend(Ae(t,"left")),n&&e.append(Ae(n,"right")),(t&&t.icon||n&&n.icon)&&Le()?.scan?.(e)}this._syncEdges()}}_syncEdges(){const e=this.wrapper;if(!e||!this.input)return;const t=e=>e&&!e.hidden;let n=!1,s=!1;for(let e=this.input.previousElementSibling;e;e=e.previousElementSibling)if(t(e)){n=!0;break}for(let e=this.input.nextElementSibling;e;e=e.nextElementSibling)if(t(e)){s=!0;break}e.classList.toggle("has-addon-left",n),e.classList.toggle("has-addon-right",s)}_listen(e,t,n,s){e.addEventListener(t,n,s),this._extraHandlers.push({el:e,event:t,handler:n,opts:s})}_limits(){return{min:$e(this.input,"min"),max:$e(this.input,"max"),step:$e(this.input,"step")}}_counterLimit(){const e=this.options.counter;if("number"==typeof e&&e>0)return e;const t=this.input.maxLength;return t>0?t:null}_buildExtras(){const e=this.input,t=this.wrapper;if(!e||!t)return;const n=this.options,s=n.labels,i=e.tagName.toLowerCase(),o="textarea"===i?"textarea":(e.getAttribute("type")||"text").toLowerCase(),r="password"===o,a={},l=[];if(n.stepper&&"number"===o&&(a.decrease=Ee("decrease","left",s.decrease,"minus"),a.increase=Ee("increase","right",s.increase,"plus"),e.before(a.decrease),this._bindStep(a.decrease,-1),this._bindStep(a.increase,1)),n.clear&&("textarea"===i||ke.test(o))&&(a.clear=Ee("clear","right",s.clear,"x"),l.push(a.clear),this._listen(a.clear,"mousedown",e=>e.preventDefault()),this._listen(a.clear,"click",()=>{e.value="",this._fireInput(),e.focus(),this.refresh()})),n.reveal&&r&&(a.reveal=Ee("reveal","right",s.reveal,"eye"),a.reveal.setAttribute("aria-pressed","false"),l.push(a.reveal),this._listen(a.reveal,"mousedown",e=>e.preventDefault()),this._listen(a.reveal,"click",()=>this._setRevealed("true"!==a.reveal.getAttribute("aria-pressed")))),a.increase&&l.push(a.increase),l.length&&e.after(...l),e.id&&Object.values(a).forEach(t=>t.setAttribute("aria-controls",e.id)),n.counter&&("textarea"===i||we.test(o))){a.counter=document.createElement("div"),a.counter.className="form-counter",a.counter.id=`${e.id||"input"}-counter-${++xe}`,a.counter.setAttribute("aria-live","polite"),t.after(a.counter);const n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);this._describedBy=e.getAttribute("aria-describedby"),e.setAttribute("aria-describedby",[...n,a.counter.id].join(" "))}this.extras=a,Object.keys(a).length&&(this._listen(e,"input",()=>this.refresh()),this._listen(e,"change",()=>this.refresh()),e.form&&this._listen(e.form,"reset",()=>{a.reveal&&this._setRevealed(!1),this._timers.reset=setTimeout(()=>this.refresh(),0)})),this.refresh()}_setRevealed(e){const t=this.extras?.reveal;t&&(this.input.type=e?"text":"password",t.setAttribute("aria-pressed",e?"true":"false"),Ce(t,e?"eye-off":"eye"))}_fireInput(){this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0}))}step(e){const t=this.input;if(!t||t.disabled||t.readOnly)return this;const{min:n,max:s,step:i}=this._limits(),o=i&&i>0?i:1,r=null!=n?n:0,a=Math.max(Se(o),Se(r)),l=""!==t.value&&Number.isFinite(Number(t.value))?Number(t.value):null,c=((l??0)-r)/o;let h=r+(e>0?Math.floor(c+1e-9)+1:Math.ceil(c-1e-9)-1)*o;return null!=n&&h<n&&(h=n),null!=s&&h>s&&(h=s),h=Number(h.toFixed(a)),l!==h&&(t.value=String(h),this._fireInput()),this.refresh(),this}_bindStep(e,t){this._listen(e,"pointerdown",n=>{0!==n.button||e.disabled||(n.preventDefault(),this._pointerStepped=!0,this.step(t),this._stopRepeat(),this._timers.delay=setTimeout(()=>{this._timers.repeat=setInterval(()=>{e.disabled?this._stopRepeat():this.step(t)},70)},400))}),["pointerup","pointerleave","pointercancel","blur"].forEach(t=>{this._listen(e,t,()=>this._stopRepeat())}),this._listen(e,"click",e=>{e.detail>0&&this._pointerStepped?this._pointerStepped=!1:this.step(t)})}_stopRepeat(){clearTimeout(this._timers.delay),clearInterval(this._timers.repeat),this._timers.delay=this._timers.repeat=null}_teardownExtras(){this._stopRepeat(),clearTimeout(this._timers.reset);for(const{el:e,event:t,handler:n,opts:s}of this._extraHandlers)e.removeEventListener(t,n,s);this._extraHandlers=[];const e=this.extras||{};e.reveal&&this.input&&(this.input.type="password"),e.counter&&this.input&&(this._describedBy?this.input.setAttribute("aria-describedby",this._describedBy):this.input.removeAttribute("aria-describedby")),Object.values(e).forEach(e=>e.remove()),this.extras={},this._syncEdges()}destroy(){this._teardownExtras(),this.wrapper&&(this._manageAddons&&this.wrapper.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove()),this._syncEdges(),this._ownsWrapper&&this.wrapper.parentNode&&(this.wrapper.before(this.input),this.wrapper.remove())),this.wrapper=null,super.destroy()}}const Te=new Set(["text","card","list","table","custom"]),Be={type:"text",lines:null,count:null,rows:5,columns:4,header:!0,avatar:!0,image:!0,animate:!0,template:null,label:"Loading..."},je=new WeakMap;function Oe(e){return e?"string"==typeof e?document.querySelector(e):1===e.nodeType?e:"number"==typeof e.length&&e[0]&&1===e[0].nodeType?e[0]:null:null}function De(e,t){const n=parseInt(e,10);return Number.isFinite(n)&&n>0?Math.min(n,100):t}function Ne(e,t){let n="";for(let s=0;s<e;s++)n+=t(s);return n}function Ie(e,t=""){const n=t?` ${t}`:"";return`<div class="skeleton-lines">${Ne(e,()=>`<div class="skeleton skeleton-text${n}"></div>`)}</div>`}function He(e={}){const t={...Be,...e};switch(Te.has(t.type)?t.type:"text"){case"card":{const e=De(t.lines,3);return Ne(De(t.count,1),()=>'<div class="skeleton-card">'+(t.image?'<div class="skeleton skeleton-image"></div>':"")+'<div class="skeleton-card-body"><div class="skeleton skeleton-heading"></div>'+Ie(e)+"</div></div>")}case"list":{const e=De(t.lines,2);return'<div class="skeleton-list">'+Ne(De(t.count,3),()=>'<div class="skeleton-list-item">'+(t.avatar?'<div class="skeleton skeleton-circle"></div>':"")+'<div class="skeleton-list-item-content"><div class="skeleton skeleton-text skeleton-w-50"></div>'+Ne(e-1,()=>'<div class="skeleton skeleton-text skeleton-text-sm skeleton-w-75"></div>')+"</div></div>")+"</div>"}case"table":{const e=De(t.columns,4),n=t=>Ne(e,()=>`<div class="skeleton skeleton-text${t}"></div>`);return`<div class="skeleton-table" style="--dm-skeleton-columns: ${e}">`+(t.header?`<div class="skeleton-table-row skeleton-table-head">${n(" skeleton-w-50")}</div>`:"")+Ne(De(t.rows,5),()=>`<div class="skeleton-table-row">${n("")}</div>`)+"</div>"}case"custom":{const e="function"==typeof t.template?t.template(t):t.template;return null==e?"":String(e)}default:return Ne(De(t.count,1),()=>Ie(De(t.lines,3)))}}function We(e){const t=e.dataset||{},n={};t.skeleton&&Te.has(t.skeleton)&&(n.type=t.skeleton);for(const e of["lines","count","rows","columns"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["avatar","image","animate","header"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return t.skeletonLabel&&(n.label=t.skeletonLabel),n}function Pe(e,t={}){const n=Oe(e);if(!n)return null;const s=je.get(n);s&&s.remove();const i={...Be,...We(n),...t},o=document.createDocumentFragment();for(;n.firstChild;)o.appendChild(n.firstChild);const r=document.createElement("template");r.innerHTML=He(i);const a=Array.from(r.content.childNodes);for(const e of a)1===e.nodeType&&(e.setAttribute("aria-hidden","true"),i.animate||e.classList.add("skeleton-static"));const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),n.appendChild(r.content),n.appendChild(l),setTimeout(()=>{l.parentNode===n&&(l.textContent=i.label)},100),n.setAttribute("aria-busy","true"),n.classList.add("is-skeleton-loading");let c=!0;const h=()=>{for(const e of a)e.parentNode===n&&n.removeChild(e);l.parentNode===n&&n.removeChild(l),n.setAttribute("aria-busy","false"),n.classList.remove("is-skeleton-loading"),n.hasAttribute("data-skeleton")&&n.setAttribute("data-skeleton-done",""),je.get(n)===d&&je.delete(n),L(n,d),c=!1},d={element:n,options:i,get active(){return c},remove:()=>c?(h(),n.appendChild(o),n):n,replace(e){const t=je.get(n);return!c&&t&&t!==d?n:(c&&h(),n.textContent="",null==e||("string"==typeof e?n.innerHTML=e:e.nodeType?n.appendChild(e):"number"==typeof e.length&&Array.from(e).forEach(e=>e&&e.nodeType&&n.appendChild(e))),n)},destroy:()=>d.remove()};return Object.defineProperty(d,"componentName",{value:"skeleton"}),je.set(n,d),M(n,d),d}function Fe(e){return e?"string"==typeof e?"undefined"==typeof document?null:document.querySelector(e):1===e.nodeType?e:"function"==typeof e.get&&void 0!==e.length?e.get(0)||null:e[0]&&1===e[0].nodeType?e[0]:null:null}function Re(e){return e?"string"==typeof e?"undefined"==typeof document?[]:Array.from(document.querySelectorAll(e)):1===e.nodeType?[e]:"number"==typeof e.length?Array.from(e).filter(e=>e&&1===e.nodeType):[]:[]}function Ve(e,t=!1){return null==e?t:""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&Boolean(e)}function qe(e,t=0){if(null==e||""===e)return t;const n=Number(e);return Number.isFinite(n)?n:t}function Ue(e,t,n={}){if(e.replaceChildren(),null==t)return;if("undefined"!=typeof Node&&t instanceof Node)return void e.appendChild(t);const s=String(t);n.text?e.textContent=s:e.innerHTML=!1===n.safe?s:u(s)}function Ke(e){const t="undefined"!=typeof window?window.Domma?.icons:null;if(e&&t&&"function"==typeof t.scan)try{t.scan(e)}catch{}}Pe.while=async function(e,t,n={}){const s=Pe(e,n);try{const e=await("function"==typeof t?t():t);return s&&s.remove(),e}catch(e){throw s&&s.remove(),e}},Pe.get=function(e){const t=Oe(e);return t&&x(t,"skeleton")||null},Pe.remove=function(e){const t=Pe.get(e);return t?t.remove():null},Pe.scan=function(e=document){const t=Oe(e)||document;return Array.from(t.querySelectorAll("[data-skeleton]")).filter(e=>!je.has(e)&&!e.hasAttribute("data-skeleton-done")).map(e=>Pe(e))},Pe.markup=He;let Ye=0;function Ge(e){return Ye+=1,`${e}-${Ye}`}function Je(e,t,n={}){const s=x(e,t);return s?(n&&Object.keys(n).length&&s.setOptions(n),s):null}function Xe(){try{return"undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function Ze(e,t){if(!e||!t||"undefined"==typeof getComputedStyle)return;t.style.removeProperty("z-index");const n=parseInt(getComputedStyle(t).zIndex,10)||0;let s=0;for(let t=e;t&&1===t.nodeType;t=t.parentElement||t.getRootNode?.().host){const e=parseInt(getComputedStyle(t).zIndex,10);!Number.isNaN(e)&&e>s&&(s=e)}s>0&&s>=n&&(t.style.zIndex=String(s+1))}const Qe=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),et=[];function tt(e){return e?e.assignedSlot?e.assignedSlot:e.parentNode&&11===e.parentNode.nodeType&&e.parentNode.host?e.parentNode.host:e.parentNode:null}function nt(){if("undefined"==typeof document)return null;let e=document.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function st(e){if(!e.matches(Qe))return!1;if(e.tabIndex<0)return!1;if(e.matches(":disabled"))return!1;if("INPUT"===e.tagName&&"hidden"===e.type)return!1;if("SUMMARY"===e.tagName&&e.parentElement?.querySelector(":scope > summary")!==e)return!1;for(let t=e;t;t=tt(t))if(1===t.nodeType&&(t.hasAttribute("hidden")||t.hasAttribute("inert")))return!1;return!e.parentElement?.closest?.('[contenteditable]:not([contenteditable="false"])')&&!("function"==typeof e.checkVisibility&&!e.checkVisibility({visibilityProperty:!0}))}function it(e,t,n){const s=1===e.nodeType&&"SLOT"===e.tagName&&"function"==typeof e.assignedElements?e.assignedElements({flatten:!0}).length?e.assignedElements({flatten:!0}):Array.from(e.children):Array.from(e.children||[]);for(const e of s)t.push(e),n&&e.shadowRoot?it(e.shadowRoot,t,n):it(e,t,n)}function ot(e,t){const n=Array.isArray(e)?e:[e],s=[];for(const e of n)e&&(t&&e.shadowRoot?it(e.shadowRoot,s,t):it(e,s,t));return s}function rt(e,t,n=0){if("undefined"==typeof document||!e)return null;const s=document.body;for(let i=e;i&&i!==s&&i!==document.documentElement;i=tt(i)){if(1!==i.nodeType)continue;if(i.hasAttribute("data-focus-trap-allow"))return i;let e="";try{e=getComputedStyle(i).position}catch{}if("fixed"===e&&!(n>0&&at(i)<n&<(i,t)))return i;if(tt(i)===s&&("absolute"===e||t&&!t.has(i)))return i}return null}function at(e){let t=0;for(let n=e;n&&1===n.nodeType;n=tt(n)){let e=NaN;try{e=parseInt(getComputedStyle(n).zIndex,10)}catch{}!Number.isNaN(e)&&e>t&&(t=e)}return t}function lt(e,t){if(!t)return!0;let n=e;for(;n&&tt(n)&&tt(n)!==document.body;)n=tt(n);return!n||t.has(n)}function ct(e,t={}){const n=ot(e,!1!==t.shadow).filter(st),s=new Map,i=n.filter(e=>{if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!0;const t=e.form||e.getRootNode(),i=`${e.name}`;s.has(t)||s.set(t,new Map);const o=s.get(t);if(!o.has(i)){const s=n.filter(n=>"INPUT"===n.tagName&&"radio"===n.type&&n.name===e.name&&(n.form||n.getRootNode())===t);o.set(i,s.find(e=>e.checked)||s[0])}return o.get(i)===e});return[...i.filter(e=>e.tabIndex>0).sort((e,t)=>e.tabIndex-t.tabIndex),...i.filter(e=>e.tabIndex<=0)]}function ht(e,t){return"function"==typeof e?!!e(t):!!e}const dt=["click","keydown","input","change","submit"];class ut extends C{static componentName="focus-trap";static defaults={initialFocus:void 0,fallbackFocus:void 0,returnFocus:!0,escapeDeactivates:!1,clickOutsideDeactivates:!1,allowOutsideClick:!1,allowOutsideFocus:!1,allowScriptFocus:!1,inert:!1,shadow:!0,preventScroll:!0,register:!0,onActivate:null,onDeactivate:null,onPause:null,onUnpause:null};constructor(e,t={}){const n=ut._resolve(e),s=n[0]?._dommaComponent;super(n[0]||null,t),!1===this.options.register&&this.element&&(L(this.element,this),s?this.element._dommaComponent=s:delete this.element._dommaComponent),this._containers=n,this._bodyAtStart=null,this._floor=0,this._pendingTab=null,this._active=!1,this._paused=!1,this._returnTo=null,this._lastFocused=null,this._madeFocusable=[],this._inerted=[],this._bound=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onTab=this._onTab.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onClick=this._onClick.bind(this),this._onInsideEvent=this._onInsideEvent.bind(this)}static _resolve(e){if(Array.isArray(e))return e.map(e=>Fe(e)).filter(Boolean);if("string"==typeof e)return Re(e);const t=Fe(e);return t?[t]:[]}static top(){return et[et.length-1]||null}activate(e={}){if(this._active||this._destroyed||!this._containers.length)return this;const t=ut.top();t&&t!==this&&t.pause(),this._active=!0,this._paused=!1,et.push(this),this._returnTo=nt(),this._lastFocused=null,this._bodyAtStart="undefined"!=typeof document&&document.body?new Set(document.body.children):null,this._floor=at(this._containers[0]),this._applyInert(),this._bind();const n="initialFocus"in e?e.initialFocus:this.options.initialFocus;return!1!==n&&this._focusInitial(n),this._fire("activate",this),this}deactivate(e={}){if(!this._active)return this;this._active=!1,this._paused=!1,this._unbind(),this._clearInert();const t=ut.top()===this,n=et.indexOf(this);n>-1&&et.splice(n,1),this._clearFocusable(),this._pendingTab=null;const s="returnFocus"in e?e.returnFocus:this.options.returnFocus,i=this._returnTo;let o=!0===s?i:s&&!1!==s?Fe(s):null;if(this._returnTo=null,!t){for(const e of et.slice(Math.max(n,0)))e._returnTo&&this._contains(e._returnTo)&&(e._returnTo=o||i);o=null}const r=ut.top();if(t&&r&&r._paused&&r.unpause({focus:!o,_leaving:this}),o&&o.isConnected&&"function"==typeof o.focus)try{o.focus({preventScroll:!!this.options.preventScroll})}catch{}if(t&&o&&r&&ut.top()===r&&!r._paused){const e=nt();e===o||r._contains(e)||r._focus(r._lastFocused&&r._lastFocused.isConnected&&st(r._lastFocused)?r._lastFocused:r._firstTarget())}return this._fire("deactivate",this),this}pause(){return!this._active||this._paused||(this._paused=!0,this._unbind(),this._clearInert(),this._fire("pause",this)),this}unpause(e={}){if(!this._active||!this._paused)return this;if(ut.top()!==this)return this;this._paused=!1,this._applyInert(),this._bind();const t=nt(),n=t&&t!==document.body&&!(e._leaving&&e._leaving._contains(t))&&this._mayFocusOutside(t,null);return!1===e.focus||this._contains(t)||n||this._focus(this._lastFocused&&st(this._lastFocused)?this._lastFocused:this._firstTarget()),this._fire("unpause",this),this}updateContainers(e){const t=ut._resolve(e),n=t[0]||null;return n!==this.element&&(this.element&&!1!==this.options.register&&L(this.element,this),this.element=n,n&&!1!==this.options.register&&M(n,this)),this._containers=t,this._active&&!this._paused&&(this._clearInert(),this._applyInert()),this}containers(){return this._containers.slice()}isActive(){return this._active}isPaused(){return this._active&&this._paused}tabbables(){return ct(this._containers,{shadow:this.options.shadow})}destroy(){this._destroyed||(this.deactivate({returnFocus:!1}),this._destroyed=!0,super.destroy())}_contains(e){return!!e&&this._containers.some(t=>function(e,t){for(let n=t;n;n=tt(n))if(n===e)return!0;return!1}(t,e))}_eventInside(e){const t="function"==typeof e.composedPath?e.composedPath():[];return t.length?this._containers.some(e=>t.includes(e)):this._contains(e.target)}_bind(){if(!this._bound&&"undefined"!=typeof document){document.addEventListener("keydown",this._onKeyDown,!0),window.addEventListener("keydown",this._onTab),document.addEventListener("focusin",this._onFocusIn,!0),document.addEventListener("pointerdown",this._onPointerDown,!0),document.addEventListener("mousedown",this._onPointerDown,!0),document.addEventListener("click",this._onClick,!0);for(const e of dt)document.addEventListener(e,this._onInsideEvent,!0);this._bound=!0}}_unbind(){if(this._bound){document.removeEventListener("keydown",this._onKeyDown,!0),window.removeEventListener("keydown",this._onTab),document.removeEventListener("focusin",this._onFocusIn,!0),document.removeEventListener("pointerdown",this._onPointerDown,!0),document.removeEventListener("mousedown",this._onPointerDown,!0),document.removeEventListener("click",this._onClick,!0);for(const e of dt)document.removeEventListener(e,this._onInsideEvent,!0);this._bound=!1}}_fallback(){const e=this.options.fallbackFocus,t="function"==typeof e?e():e?Fe(e):null;if(t)return t;const n=this._containers[0];return n&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),this._madeFocusable.push(n)),n}_clearFocusable(){for(const e of this._madeFocusable)e.removeAttribute("tabindex");this._madeFocusable=[]}_firstTarget(){return this.tabbables()[0]||this._fallback()}_focusInitial(e){let t=null;if("function"==typeof e?t=Fe(e()):e&&(t="string"==typeof e&&this._containers.map(t=>t.querySelector(e)).find(Boolean)||Fe(e)),!t){const e=nt();if(this._contains(e)&&e!==document.body)return void(this._lastFocused=e);t=this._firstTarget()}this._focus(t)}_focus(e,t=!1){if(e&&"function"==typeof e.focus){try{e.focus({preventScroll:!t&&!!this.options.preventScroll})}catch{}this._lastFocused=e}}_tabTo(e,t,n=!1){if(this._focus(e,!0),!t||!e||nt()===e)return;const s=t.indexOf(e);for(let e=1;s>-1&&e<t.length;e++){const i=t[(s+(n?-e:e)+t.length*e)%t.length];if(this._focus(i,!0),nt()===i)return}}_gone(){return!this._containers.some(e=>e.isConnected)&&(this.deactivate({returnFocus:!1}),!0)}_mayFocusOutside(e,t){const n=this.options.allowOutsideFocus;return"function"==typeof n?!!n(e,t):"layers"!==n?!!n:!et.some(t=>t!==this&&t._contains(e))&&!!rt(e,this._bodyAtStart,this._floor)}_onKeyDown(e){if(this._gone())return;if("Escape"===e.key&&!e.defaultPrevented&&ht(this.options.escapeDeactivates,e))return e.preventDefault(),void this.deactivate();if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey)return;const t={shift:e.shiftKey,fromInside:this._contains(nt())};this._pendingTab=t,setTimeout(()=>{this._pendingTab===t&&(this._pendingTab=null)},0)}_onTab(e){if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey)return;if(this._pendingTab=null,e.defaultPrevented||this._gone())return;const t=nt();if(t&&t!==document.body&&!this._contains(t)){const n=this._mayFocusOutside(t,e)?rt(t,this._bodyAtStart,this._floor):null;if(n)return void this._tabInLayer(e,n,t)}const n=this.tabbables();if(e.preventDefault(),!n.length)return void this._tabTo(this._fallback());let s,i=n.indexOf(t);s=i>-1?e.shiftKey?n[(i-1+n.length)%n.length]:n[(i+1)%n.length]:t&&this._contains(t)?this._nextFrom(t,n,e.shiftKey):e.shiftKey?n[n.length-1]:n[0],this._tabTo(s,n,e.shiftKey)}_nextFrom(e,t,n){const s=ot(this._containers,!1!==this.options.shadow),i=s.indexOf(e);if(i<0)return n?t[t.length-1]:t[0];const o=e=>s.indexOf(e);if(n){const e=t.filter(e=>o(e)<i);return e[e.length-1]||t[t.length-1]}return t.find(e=>o(e)>i)||t[0]}_tabInLayer(e,t,n){const s=ct(t,{shadow:this.options.shadow}),i=s.indexOf(n);if(e.preventDefault(),i>-1){const t=s[e.shiftKey?i-1:i+1];if(t)return void t.focus({preventScroll:!1})}else if(s.length)return void s[e.shiftKey?s.length-1:0].focus({preventScroll:!1});const o=this.tabbables(),r=this._lastFocused&&this._lastFocused.isConnected&&this._contains(this._lastFocused)?this._lastFocused:null;if(!o.length)return void this._tabTo(r||this._fallback());if(!r)return void this._tabTo(e.shiftKey?o[o.length-1]:o[0]);if(e.shiftKey)return void this._tabTo(r);const a=o.indexOf(r);this._tabTo(a>-1?o[(a+1)%o.length]:this._nextFrom(r,o,!1))}_onFocusIn(e){if(this._gone())return;const t="function"==typeof e.composedPath&&e.composedPath()[0]||e.target;if(this._eventInside(e))return void(this._lastFocused=t);const n=this._pendingTab;if(this._pendingTab=null,this._mayFocusOutside(t,e))return;if(n&&n.fromInside){e.stopImmediatePropagation?.();const t=this.tabbables();return void this._tabTo(t.length?n.shift?t[t.length-1]:t[0]:this._fallback())}if(this.options.allowScriptFocus&&this._scriptTurn)return;e.stopImmediatePropagation?.();const s=this._lastFocused&&this._lastFocused.isConnected&&this._contains(this._lastFocused)?this._lastFocused:null;if(s&&/^(IFRAME|OBJECT|EMBED)$/.test(s.tagName)){const e=this.tabbables(),n=this._containers.some(e=>4&e.compareDocumentPosition(t));return void this._tabTo(e.length?n?e[0]:e[e.length-1]:this._fallback())}this._focus(s||this._firstTarget())}_onPointerDown(e){if(!this._eventInside(e)){if(ht(this.options.clickOutsideDeactivates,e)){const t=e.target?.closest?.(Qe);return void this.deactivate({returnFocus:!t&&this.options.returnFocus})}ht(this.options.allowOutsideClick,e)||e.preventDefault()}}_onInsideEvent(e){if(!this.options.allowScriptFocus||!this._eventInside(e))return;if("keydown"===e.type&&"Tab"===e.key)return;const t={};this._scriptTurn=t,setTimeout(()=>{this._scriptTurn===t&&(this._scriptTurn=null)},0)}_onClick(e){this._eventInside(e)||ht(this.options.clickOutsideDeactivates,e)||ht(this.options.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}_applyInert(){if(!this.options.inert||"undefined"==typeof document)return;const e=this._containers,t=new Set;for(const n of e)for(let s=n;s&&s!==document.body&&s.parentElement;s=s.parentElement)for(const n of s.parentElement.children)n===s||t.has(n)||e.some(e=>n.contains(e))||/^(SCRIPT|STYLE|TEMPLATE|LINK|META)$/.test(n.tagName)||(t.add(n),n.hasAttribute("inert")||(n.setAttribute("inert",""),this._inerted.push(n)))}_clearInert(){for(const e of this._inerted)e.removeAttribute("inert");this._inerted=[]}}function pt(e,t={}){return new ut(e,t)}const mt=["top","bottom","left","right"],ft={top:"bottom",bottom:"top",left:"right",right:"left"},_t={top:["right","left"],bottom:["right","left"],left:["bottom","top"],right:["bottom","top"]},gt=["bottom","top","right","left"],vt="a[href], button, input, select, textarea, summary",bt=e=>"function"==typeof e,yt=e=>"undefined"!=typeof Node&&e instanceof Node,kt=[],wt=new WeakMap;let xt=0,Mt=!1;function Lt(e){return e?"string"==typeof e?document.querySelector(e):yt(e)?e:"function"==typeof e.get&&yt(e.get(0))?e.get(0):yt(e[0])?e[0]:null:null}function Ct(e,t){return e?ct(e,t):[]}function At(e){if(e&&"object"==typeof e)return{show:Number(e.show)||0,hide:Number(e.hide)||0};const t=Number(e)||0;return{show:t,hide:t}}const Et=".dm-context-menu";function St(e){const t=e.target;if(!(t instanceof Element&&t.closest(Et)))for(const e of kt.slice().reverse())e._open&&e.options.closeOnOutside&&(e._contains(t)||e.hide({returnFocus:!1}))}function $t(e){if("Escape"!==e.key&&"Esc"!==e.key)return;const t=kt[kt.length-1];if(!t||!t.options.closeOnEscape)return;const n=e.target;if(t._panel&&n instanceof Node&&t._panel.contains(n))return;if(n instanceof Element&&n.closest(Et))return;const s=t._contains(document.activeElement);e.preventDefault(),e.stopPropagation(),t.hide({returnFocus:s})}function zt(e){const t=e.target;if(!(t instanceof Element&&t.closest(Et)))for(const e of kt.slice().reverse())e._open&&e._closesOnFocusLeave()&&(e._contains(t)||e.hide({returnFocus:!1}))}function Tt(){Mt&&!kt.length&&(Mt=!1,document.removeEventListener("pointerdown",St,!0),document.removeEventListener("keydown",$t,!0),document.removeEventListener("focusin",zt,!0))}class Bt extends C{static componentName="popover";static defaults={content:"",title:"",html:!1,trigger:"click",placement:"bottom",flip:!0,offset:10,arrow:!0,dismissible:!1,closeOnOutside:!0,closeOnEscape:!0,group:"default",width:null,maxWidth:null,className:"",id:null,role:null,ariaLabel:null,autoFocus:null,trapFocus:!1,delay:{show:80,hide:120},animation:!0,animationDuration:150,container:null,zIndex:null,onShow:null,onShown:null,onHide:null,onHidden:null};constructor(e,t={}){if(super(Lt(e),t),this._open=!1,this._panel=null,this._parent=null,this._timers={show:null,hide:null,remove:null,shown:null},this._triggerHandlers=[],this._openHandlers=[],this._savedAttrs=null,this._frame=null,this._resizeObserver=null,this._destroyed=!1,!this.element)return;const n=wt.get(this.element);n&&n!==this&&(n.destroy(),this.element._dommaComponent=this),wt.set(this.element,this),this.id=this.options.id||"dm-popover-"+ ++xt,this._saveAttrs(),this._applyTriggerAria(),this._bindTrigger()}get panel(){return this._panel}get trigger(){return this.element}isOpen(){return this._open}show(e={}){if(!this.element||this._destroyed||!this.element.isConnected)return this;if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open)return this;if(!this._phase("show",!0))return this;this._openedBy=e.via||"api";const t=this._ensurePanel();this._render(),this._parent=kt.slice().reverse().find(e=>e!==this&&e._panel&&e._panel.contains(this.element))||null;const n=this.options.group;if(null!=n&&!1!==n)for(const e of kt.slice())e!==this&&e.options.group===n&&(e._isAncestorOf(this)||e.hide({returnFocus:!1}));clearTimeout(this._timers.remove),clearTimeout(this._timers.shown);const s=Lt(this.options.container)||document.body;if(t.parentNode!==s&&s.appendChild(t),this._open=!0,kt.push(this),Mt||"undefined"==typeof document||(Mt=!0,document.addEventListener("pointerdown",St,!0),document.addEventListener("keydown",$t,!0),document.addEventListener("focusin",zt,!0)),this._bindOpen(),this._setExpanded(!0),t.classList.remove("is-open"),this.update(),!this._open)return this;t.offsetHeight,t.classList.add("is-open");(void 0!==e.focus?e.focus:null!==this.options.autoFocus?this.options.autoFocus:"click"===this._openedBy||"api"===this._openedBy&&this._triggers().includes("click"))&&this._focusInside();const i=this._duration();return i?this._timers.shown=setTimeout(()=>{this._open&&this._phase("shown")},i):this._phase("shown"),this}hide(e={}){if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),!this._open)return this;if(!this._phase("hide",!e._force)&&!e._force)return this;for(const e of kt.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});const t=this._panel,n=t&&t.contains(document.activeElement),s=void 0!==e.returnFocus?e.returnFocus:n;this._open=!1,this._parent=null;const i=kt.indexOf(this);if(i>-1&&kt.splice(i,1),this._unbindOpen(),Tt(),this._setExpanded(!1),clearTimeout(this._timers.shown),this._releaseTrap(),s&&this.element&&bt(this.element.focus)){this._returningFocus=!0;try{this.element.focus({preventScroll:!0})}finally{this._returningFocus=!1}}if(t){t.classList.remove("is-open");const e=()=>{this._open||(t.remove(),this._phase("hidden"))},n=this._duration();n?this._timers.remove=setTimeout(e,n):e()}return this}toggle(e={}){return this._open?this.hide(e):this.show(e)}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}isVisible(){return this.isOpen()}setContent(e){return this.options.content=e,this._panel&&(this._renderBody(),this._open&&this.update()),this}setTitle(e){return this.options.title=e,this._panel&&(this._renderTitle(),this._open&&this.update()),this}update(){return this._open&&this._panel&&this.element?this.element.isConnected?(this._position(),this):(this.hide({returnFocus:!1}),this):this}destroy(){if(this._destroyed)return;this._destroyed=!0;if(kt.indexOf(this)>-1){for(const e of kt.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});kt.splice(kt.indexOf(this),1)}const e=this._panel&&this._panel.contains(document.activeElement);this._open=!1,this._releaseTrap(),this._trap&&(this._trap.destroy(),this._trap=null),this._unbindOpen(),Tt(),Object.values(this._timers).forEach(e=>clearTimeout(e)),this._panel&&(this._panel.remove(),this._panel=null),this._unbindTrigger(),this._restoreAttrs(),e&&this.element&&bt(this.element.focus)&&this.element.focus({preventScroll:!0}),this.element&&wt.get(this.element)===this&&wt.delete(this.element),bt(this._onDestroy)&&this._onDestroy(this),super.destroy()}setOptions(e={}){return this._changedKeys=Object.keys(e||{}),super.setOptions(e)}_applyOptions(){if(this.element&&!this._destroyed){if(this._unbindTrigger(),this._applyTriggerAria(),this._bindTrigger(),this._panel){this._styleNode();const e=this._changedKeys||[];(e.includes("content")||e.includes("html"))&&this._renderBody(),e.includes("title")||e.includes("html")?this._renderTitle():this._label(),this._open&&this.update()}this._changedKeys=null}}_triggers(){return String(this.options.trigger||"click").split(/[\s,]+/).filter(Boolean)}_role(){if(this.options.role)return this.options.role;const e=this._triggers();return e.length&&e.every(e=>"hover"===e||"focus"===e)?"tooltip":"dialog"}_closesOnFocusLeave(){const e=this._triggers();return this.options.closeOnOutside||e.includes("focus")||e.includes("hover")}_on(e,t,n,s){e.addEventListener(t,n),s.push({el:e,event:t,handler:n})}_bindTrigger(){const e=this.element,t=this._triggerHandlers,n=this._triggers(),s=()=>At(this.options.delay);n.includes("click")&&(this._on(e,"click",t=>{if(e.matches?.("a[href]")&&t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void(!1!==this.options.autoFocus&&this._focusInside());this.toggle({via:"click"})},t),e.matches?.(vt)||this._on(e,"keydown",t=>{if(t.target===e&&!t.repeat&&("Enter"===t.key||" "===t.key)){if(t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void this._focusInside();this.toggle({focus:!0,via:"click"})}},t)),n.includes("hover")&&(this._on(e,"mouseenter",()=>this._scheduleShow(s().show),t),this._on(e,"mouseleave",()=>this._scheduleHide(s().hide,"hover"),t)),(n.includes("focus")||n.includes("hover"))&&(this._on(e,"focusin",()=>{this._returningFocus||this.show({focus:!1,via:"focus"})},t),this._on(e,"focusout",e=>{this._contains(e.relatedTarget)||this._scheduleHide(0,"focus")},t)),this._on(e,"keydown",e=>{if("Tab"!==e.key||e.shiftKey||!this._open||!this._panel)return;const t=Ct(this._panel);t.length&&(e.preventDefault(),t[0].focus())},t)}_unbindTrigger(){for(const{el:e,event:t,handler:n}of this._triggerHandlers)e.removeEventListener(t,n);this._triggerHandlers=[]}_scheduleShow(e){clearTimeout(this._timers.hide),clearTimeout(this._timers.show),this._open||(e>0?this._timers.show=setTimeout(()=>this.show({focus:!1,via:"hover"}),e):this.show({focus:!1,via:"hover"}))}_scheduleHide(e,t=null){clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open&&(t&&"click"===this._openedBy||(e>0?this._timers.hide=setTimeout(()=>this.hide(),e):this.hide()))}_saveAttrs(){const e=this.element,t=["aria-haspopup","aria-expanded","aria-controls","aria-describedby","tabindex","role"];this._savedAttrs={};for(const n of t)this._savedAttrs[n]=e.hasAttribute(n)?e.getAttribute(n):null}_restoreAttrs(){const e=this.element;if(e&&this._savedAttrs){for(const[t,n]of Object.entries(this._savedAttrs))null===n?e.removeAttribute(t):e.setAttribute(t,n);e.classList.remove("dm-popover-trigger","is-popover-open")}}_applyTriggerAria(){const e=this.element;this._restoreAttrs(),e.classList.add("dm-popover-trigger"),"dialog"===this._role()&&(e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",this._open?"true":"false"));const t=this._triggers();!(t.includes("click")||t.includes("focus")||t.includes("hover"))||e.matches?.(vt)||e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),!t.includes("click")||e.matches?.(vt)||e.hasAttribute("role")||e.setAttribute("role","button"),this._open&&this._setExpanded(!0)}_setExpanded(e){const t=this.element;if(t)if(t.classList.toggle("is-popover-open",e),"dialog"===this._role())t.setAttribute("aria-expanded",e?"true":"false"),e?t.setAttribute("aria-controls",this.id):null!=this._savedAttrs?.["aria-controls"]?t.setAttribute("aria-controls",this._savedAttrs["aria-controls"]):t.removeAttribute("aria-controls");else{const n=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==this.id);e&&n.push(this.id),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}}_ensurePanel(){if(this._panel)return this._panel;const e=document.createElement("div");e.id=this.id,e.setAttribute("tabindex","-1");const t=document.createElement("div");t.className="dm-popover-arrow",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="dm-popover-header";const s=document.createElement("div");s.className="dm-popover-title",s.id=`${this.id}-title`,n.appendChild(s);const i=document.createElement("div");i.className="dm-popover-body";const o=document.createElement("button");o.type="button",o.className="dm-popover-close",o.setAttribute("aria-label","Close");const r=document.createElement("span");return r.setAttribute("data-icon","x"),r.setAttribute("data-icon-size","16"),r.setAttribute("aria-hidden","true"),o.appendChild(r),e.append(t,n,i,o),this._panel=e,this._parts={arrow:t,header:n,title:s,body:i,close:o},o.addEventListener("click",()=>this.hide({returnFocus:!0})),e.addEventListener("keydown",e=>this._onPanelKeyDown(e)),e.addEventListener("mouseenter",()=>{this._triggers().includes("hover")&&clearTimeout(this._timers.hide)}),e.addEventListener("mouseleave",()=>{this._triggers().includes("hover")&&this._scheduleHide(At(this.options.delay).hide,"hover")}),e.addEventListener("focusin",()=>this._holdTrap()),e.addEventListener("focusout",e=>{this._trap?.isActive()&&!this._panel.contains(e.relatedTarget)&&setTimeout(()=>{this._panel&&!this._panel.contains(document.activeElement)&&this._releaseTrap()},0);const t=this._triggers();(t.includes("focus")||t.includes("hover"))&&(this._contains(e.relatedTarget)||this._scheduleHide(0,"focus"))}),this._styleNode(),e}_styleNode(){const e=this._panel,t=this.options,n=this._role(),s=["dm-popover"];t.dismissible&&s.push("is-dismissible"),t.arrow||s.push("no-arrow"),this._open&&s.push("is-open"),e.classList.contains("has-title")&&s.push("has-title"),e.classList.contains("is-detached")&&s.push("is-detached"),t.className&&s.push(...String(t.className).split(/\s+/).filter(Boolean)),e.className=s.join(" "),e.setAttribute("role",n),e.dataset.animation=t.animation?"on":"off",e.style.setProperty("--dm-popover-duration",`${this._duration()}ms`);const i=(t,n)=>{null==n||""===n?e.style.removeProperty(t):e.style.setProperty(t,"number"==typeof n?`${n}px`:String(n))};i("--dm-popover-width",t.width),i("--dm-popover-max-width",t.maxWidth),null!==t.zIndex&&void 0!==t.zIndex?e.style.zIndex=String(t.zIndex):e.style.removeProperty("z-index"),this._parts.arrow.hidden=!t.arrow,this._parts.close.hidden=!t.dismissible}_render(){this._renderTitle(),this._renderBody()}_renderTitle(){const{title:e,header:t}=this._parts,n=this._fill(e,this.options.title);t.hidden=!n,this._panel.classList.toggle("has-title",n),this._label()}_renderBody(){this._fill(this._parts.body,this.options.content),"undefined"!=typeof window&&window.Domma?.icons&&bt(window.Domma.icons.scan)&&window.Domma.icons.scan(this._panel)}_label(){const e=this._panel;!this._parts.header.hidden?(e.setAttribute("aria-labelledby",this._parts.title.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.options.ariaLabel?e.setAttribute("aria-label",this.options.ariaLabel):e.removeAttribute("aria-label"))}_fill(e,t){e.textContent="";let n=t;if(bt(n)&&(n=n.call(this,this)),null==n||!1===n||""===n)return!1;if(yt(n))return e.appendChild(n),!0;if("object"==typeof n&&"number"==typeof n.length&&yt(n[0]))return Array.from(n).forEach(t=>yt(t)&&e.appendChild(t)),!0;const s=String(n);return this.options.html?e.innerHTML=p.sanitise(s):e.textContent=s,!0}_duration(){return!this.options.animation||function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animationDuration)||0)}_holdTrap(){this.options.trapFocus&&this._open&&this._panel&&(this._trap||(this._trap=new ut(this._panel,{initialFocus:!1,returnFocus:!1,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:!0,register:!1})),this._trap.isActive()||this._trap.activate())}_releaseTrap(){this._trap?.isActive()&&this._trap.deactivate({returnFocus:!1})}_focusInside(){const e=this._panel;if(!e)return;(Ct(e).filter(e=>!e.closest(".dm-popover-close"))[0]||e).focus({preventScroll:!0})}_onPanelKeyDown(e){if(!this._open)return;if("Escape"===e.key||"Esc"===e.key){if(e.defaultPrevented||!this.options.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void this.hide({returnFocus:!0})}if("Tab"!==e.key)return;const t=Ct(this._panel),n=t[0],s=t[t.length-1],i=document.activeElement;if(this.options.trapFocus){if(this._trap?.isActive())return;return t.length?void(!e.shiftKey||i!==n&&i!==this._panel?e.shiftKey||i!==s||(e.preventDefault(),n.focus()):(e.preventDefault(),s.focus())):void e.preventDefault()}if(e.shiftKey&&(!t.length||i===n||i===this._panel))return e.preventDefault(),void this.element.focus();if(!(e.shiftKey||t.length&&i!==s)){const t=this._nextTabbableAfterTrigger();e.preventDefault(),this.hide({returnFocus:!t}),t&&(t.focus(),document.activeElement!==t&&this.element.focus({preventScroll:!0}))}}_nextTabbableAfterTrigger(){const e=this.element,t=e.closest(".dm-popover"),n=ut.top();if(!t&&n&&n!==this._trap&&n.containers().some(t=>t.contains(e))){const t=n.tabbables(),s=t.indexOf(e);if(s>-1)return t.slice(s+1).concat(t.slice(0,s)).find(t=>!e.contains(t))||null;const i=t.filter(t=>!e.contains(t));return i.find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||i[0]||null}return Ct(t||document.body,{shadow:!1}).filter(n=>n.closest(".dm-popover")===t&&!e.contains(n)).find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||null}_bindOpen(){const e=this._openHandlers,t=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame;this._frameIsTimeout=!e;const t=e?requestAnimationFrame:e=>setTimeout(e,16);this._frame=t(()=>{this._frame=null,this.update()})},n=()=>t();window.addEventListener("scroll",n,{capture:!0,passive:!0}),e.push({el:window,event:"scroll",handler:n,capture:!0}),window.addEventListener("resize",t),e.push({el:window,event:"resize",handler:t}),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(t),this._resizeObserver.observe(this._panel),this._resizeObserver.observe(this.element))}_unbindOpen(){for(const{el:e,event:t,handler:n,capture:s}of this._openHandlers)e.removeEventListener(t,n,s?{capture:!0}:void 0);this._openHandlers=[],this._resizeObserver?.disconnect(),this._resizeObserver=null,this._frame&&(this._frameIsTimeout?clearTimeout(this._frame):"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this._frame),this._frame=null)}_contains(e){return!(!e||!yt(e))&&(!(!this.element||!this.element.contains(e))||(!(!this._panel||!this._panel.contains(e))||kt.some(t=>t!==this&&t._parent===this&&t._contains(e))))}_isAncestorOf(e){let t=e._parent;for(;t;){if(t===this)return!0;t=t._parent}return!1}_position(){const e=this._panel,t=this.options,n=this.element.getBoundingClientRect(),{width:s,height:i}=function(){const e=document.documentElement;return{width:e.clientWidth||window.innerWidth||0,height:e.clientHeight||window.innerHeight||0}}(),o=n.bottom<0||n.top>i||n.right<0||n.left>s;e.classList.toggle("is-detached",o),e.style.left="0px",e.style.top="0px";const r=e.offsetWidth,a=e.offsetHeight,[l,c]=function(e){if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0];const t=Number(e);return[0,Number.isFinite(t)?t:10]}(t.offset);let[h,d]=function(e){const[t,n]=String(e||"bottom").split("-");return["auto"===t||mt.includes(t)?t:"bottom","start"===n||"end"===n?n:"center"]}(t.placement);const u={top:n.top-8,bottom:i-n.bottom-8,left:n.left-8,right:s-n.right-8},p=e=>u[e]>=(e=>("top"===e||"bottom"===e?a:r)+c)(e);if("auto"===h)h=gt.find(p)||gt.reduce((e,t)=>u[t]>u[e]?t:e);else if(t.flip&&!p(h)){const e=[ft[h],..._t[h]].find(p);e?h=e:u[ft[h]]>u[h]&&(h=ft[h])}let m,f;const _="top"===h||"bottom"===h;_?(f="top"===h?n.top-c-a:n.bottom+c,m="start"===d?n.left+l:"end"===d?n.right-r-l:n.left+n.width/2-r/2+l):(m="left"===h?n.left-c-r:n.right+c,f="start"===d?n.top+l:"end"===d?n.bottom-a-l:n.top+n.height/2-a/2+l);const g=(e,t,n)=>t+16>n?8:Math.min(Math.max(e,8),n-t-8);m=g(m,r,s),f=g(f,a,i),e.style.left=`${Math.round(m)}px`,e.style.top=`${Math.round(f)}px`,e.dataset.side=h,e.dataset.placement="center"===d?h:`${h}-${d}`;const v=this._parts.arrow;if(t.arrow)if(_){const t=n.left+n.width/2-m-(e.clientLeft||0);v.style.left=`${Math.round(Math.min(Math.max(t,12),r-12))}px`,v.style.top=""}else{const t=n.top+n.height/2-f-(e.clientTop||0);v.style.top=`${Math.round(Math.min(Math.max(t,12),a-12))}px`,v.style.left=""}}_phase(e,t=!1){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];let s=!0;return bt(n)&&!1===n.call(this,this)&&t&&(s=!1),!this._emit(e,this)&&t&&(s=!1),s}static scan(e=document,t=null){const n="string"==typeof e?document.querySelector(e):Lt(e)||e;if(!n||!bt(n.querySelectorAll))return[];const s=[],i="[data-popover], [data-popover-content]",o=Array.from(n.querySelectorAll(i));bt(n.matches)&&n.matches(i)&&o.unshift(n);for(const e of o){if(wt.has(e))continue;const n=Bt.optionsFromAttributes(e);s.push(t?t(e,n):new Bt(e,n))}return s}static optionsFromAttributes(e){const t=e.dataset||{},n={},s=e=>void 0!==e&&"false"!==e&&"0"!==e;if(t.popover&&(n.content=t.popover),t.popoverContent){const e=document.querySelector(t.popoverContent);e&&(n.content=()=>{if("TEMPLATE"===e.tagName)return e.content.cloneNode(!0);const t=e.cloneNode(!0);return t.removeAttribute("id"),t.removeAttribute("hidden"),t})}return t.popoverTitle&&(n.title=t.popoverTitle),t.popoverTrigger&&(n.trigger=t.popoverTrigger),t.popoverPlacement&&(n.placement=t.popoverPlacement),void 0!==t.popoverGroup&&(n.group=""===t.popoverGroup||"none"===t.popoverGroup?null:t.popoverGroup),void 0!==t.popoverDismissible&&(n.dismissible=s(t.popoverDismissible)),void 0!==t.popoverArrow&&(n.arrow=s(t.popoverArrow)),t.popoverWidth&&(n.width=t.popoverWidth),t.popoverMaxWidth&&(n.maxWidth=t.popoverMaxWidth),t.popoverClass&&(n.className=t.popoverClass),n}static closeAll(e){for(const t of kt.slice().reverse())void 0!==e&&t.options.group!==e||t.hide({returnFocus:!1})}static getInstance(e){const t=Lt(e);return t&&x(t,"popover")||null}static openPopovers(){return kt.slice()}}const jt=["xs","sm","md","lg","xl"],Ot=["circle","rounded","square"],Dt=["online","away","busy","offline"],Nt={none:0,sm:.15,md:.25,lg:.4},It=/^[a-z0-9-]+$/i,Ht={name:null,src:null,alt:null,size:"md",shape:"circle",status:null,statusLabels:null,icon:null,title:null,ring:!1,tone:null,decorative:!1},Wt={online:"online",away:"away",busy:"busy",offline:"offline"},Pt=new WeakMap,Ft=new WeakMap;function Rt(e){return!!e&&"object"==typeof e&&1===e.nodeType}function Vt(e){return e?"string"==typeof e?document.querySelector(e):Rt(e)?e:"function"==typeof e.get&&Rt(e.get(0))?e.get(0):"number"==typeof e.length&&Rt(e[0])?e[0]:null:null}function qt(e){const t=e.match(/^\P{M}\p{M}*/u);return t?t[0]:""}function Ut(e){if(null==e)return"";let t=String(e).trim();if(!t)return"";const n=t.indexOf("@");n>0&&!/\s/.test(t)&&(t=t.slice(0,n)),t=t.replace(/\([^)]*\)|\[[^\]]*\]/g," ");const s=t.split(/[\s._+\-]+/u).map(e=>e.replace(/^[^\p{L}\p{N}]+/u,"")).filter(Boolean);if(!s.length)return"";return(qt(s[0])+(s.length>1?qt(s[s.length-1]):"")).toUpperCase()}function Kt(e){const t=String(e??"").trim().toLowerCase().replace(/\s+/g," ");let n=2166136261;for(const e of t)n^=e.codePointAt(0),n=Math.imul(n,16777619);return(n>>>0)%8}function Yt(e,t,n){return e.includes(t)?t:n}function Gt(e,t){if(t&&!e.icon){const e=document.createElement("span");return e.className="avatar-initials",e.setAttribute("aria-hidden","true"),e.textContent=t,e}const n=document.createElement("span");return n.className="avatar-icon",n.setAttribute("aria-hidden","true"),n.setAttribute("data-icon",e.icon&&It.test(e.icon)?e.icon:"user"),n}function Jt(e){e.querySelector(".avatar-icon[data-icon]")&&("undefined"!=typeof window&&(window.Domma?.icons||window.I)||null)?.scan?.(e)}function Xt(e,t,n=null){const s=Yt(jt,t.size,"md"),i=Yt(Ot,t.shape,"circle"),o=Ut(t.name||(t.alt&&!t.src?t.alt:"")),r=function(e){const t=parseInt(e.tone,10);if(Number.isFinite(t))return(t%8+8)%8;const n=e.name||e.alt||e.src;return n?Kt(n):null}(t);if(e.classList.remove(...function(e){return Array.from(e.classList).filter(e=>"avatar"===e||/^avatar-(xs|sm|md|lg|xl|rounded|square|ring|tone-\d+)$/.test(e))}(e)),e.classList.add("avatar",`avatar-${s}`),"circle"!==i&&e.classList.add(`avatar-${i}`),null!=r&&e.classList.add(`avatar-tone-${r}`),t.ring&&e.classList.add("avatar-ring"),e.textContent="",t.src){const n=document.createElement("img");n.className="avatar-img",n.alt="",n.decoding="async",n.addEventListener("error",()=>{n.parentNode===e&&(e.replaceChild(Gt(t,o),n),e.classList.add("avatar-img-failed"),Jt(e))},{once:!0}),n.src=String(t.src),e.appendChild(n)}else e.appendChild(Gt(t,o));e.classList.remove("avatar-img-failed");const a=Yt(Dt,t.status,null);if(a){const t=document.createElement("span");t.className=`avatar-status avatar-status-${a}`,t.setAttribute("aria-hidden","true"),e.appendChild(t)}const l=function(e){const t=String(e.alt??e.name??"").trim(),n=Yt(Dt,e.status,null);if(!n)return t;const s=e.statusLabels&&e.statusLabels[n]||Wt[n];return t?`${t} (${s})`:s}(t),c=/^(A|BUTTON)$/.test(e.tagName);e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-hidden"),t.decorative&&!c?e.setAttribute("aria-hidden","true"):l?(c||e.setAttribute("role","img"),e.setAttribute("aria-label",l)):c||e.setAttribute("aria-hidden","true");const h=!0===t.title?l:t.title;return h?e.setAttribute("title",String(h)):null!=n?e.setAttribute("title",n):e.removeAttribute("title"),Jt(e),{initials:o,tone:r,label:l,size:s,shape:i}}function Zt(e){const t=e.dataset||{},n={},s=e.classList,i=jt.find(e=>s.contains(`avatar-${e}`));i&&(n.size=i),s.contains("avatar-rounded")&&(n.shape="rounded"),s.contains("avatar-square")&&(n.shape="square"),s.contains("avatar-ring")&&(n.ring=!0);const o=Array.from(s).find(e=>/^avatar-tone-\d+$/.test(e));o&&(n.tone=Number(o.slice(12))),t.avatar&&(n.name=t.avatar);const r=["src","alt","size","shape","status","icon","title","tone"];for(const e of r){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["ring","decorative"]){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return n}const Qt=["role","aria-label","aria-hidden","title"];function en(e,t={}){let n;if(e&&"object"==typeof e&&!Rt(e)&&"number"!=typeof e.length&&"function"!=typeof e.get&&(t=e,e=null),null==e)n=document.createElement("span");else if(n=Vt(e),!n)return null;const s=Pt.get(n);s&&s.destroy();const i={children:document.createDocumentFragment(),classes:new Set(n.classList),attrs:Object.fromEntries(Qt.map(e=>[e,n.getAttribute(e)]))};for(;n.firstChild;)i.children.appendChild(n.firstChild);let o={...Ht,...Zt(n),...t},r=Xt(n,o,i.attrs.title);const a={element:n,get options(){return o},get initials(){return r.initials},get tone(){return r.tone},get label(){return r.label},update:(e={})=>(o={...o,...e},r=Xt(n,o,i.attrs.title),a),destroy(){if(Pt.get(n)!==a)return n;Pt.delete(n),L(n,a),n.textContent="",n.appendChild(i.children),n.className=[...i.classes].join(" "),n.className||n.removeAttribute("class");for(const[e,t]of Object.entries(i.attrs))null==t?n.removeAttribute(e):n.setAttribute(e,t);return n.hasAttribute("data-avatar")&&n.setAttribute("data-avatar-done",""),n}};return Object.defineProperty(a,"componentName",{value:"avatar"}),Pt.set(n,a),M(n,a),a}en.initials=Ut,en.tone=Kt,en.get=function(e){const t=Vt(e);return t&&x(t,"avatar")||null},en.scan=function(e=document){const t=Vt(e)||document;if("function"!=typeof t.querySelectorAll)return[];const n=Array.from(t.querySelectorAll("[data-avatar]"));return"function"==typeof t.matches&&t.matches("[data-avatar]")&&n.unshift(t),n.filter(e=>!Pt.has(e)&&!e.hasAttribute("data-avatar-done")).map(e=>en(e))};const tn={people:[],max:null,size:"md",shape:"circle",overlap:null,label:null,statusLabels:null,onMore:null,popover:!0,moreLabel:null};function nn(e){return null==e?null:"string"==typeof e?{name:e}:"object"==typeof e?e:null}function sn(e,t,n={}){const s=e.href&&(e.name||e.alt)?e.href:null,i=document.createElement(s?"a":"span");s&&i.setAttribute("href",String(s));return en(i,{name:e.name,src:e.src,alt:e.alt,status:e.status,icon:e.icon,tone:e.tone,title:e.title??!0,size:t.size,shape:t.shape,statusLabels:t.statusLabels,...n}).element}function on(e,t={}){const n=Vt(e);if(!n)return null;const s=Ft.get(n);s&&s.destroy();const i=/^(UL|OL)$/.test(n.tagName),o=document.createDocumentFragment(),r=new Set(n.classList),a=n.getAttribute("aria-label"),l=n.style.getPropertyValue("--dm-avatar-overlap");for(;n.firstChild;)o.appendChild(n.firstChild);const c=i?n:document.createElement("ul");i||n.appendChild(c);let h={...tn,...t};const d={people:[],shown:[],hidden:[],more:null,popover:null},u=()=>{d.popover&&d.popover.destroy(),d.popover=null,d.more=null},p=()=>{const e=document.activeElement,t=!!e&&(d.more&&d.more===e||d.popover&&d.popover.panel&&d.popover.panel.contains(e));u();const n=(Array.isArray(h.people)?h.people:[]).map(nn).filter(Boolean),s=Yt(jt,h.size,"md"),o=parseInt(h.max,10),r=Number.isFinite(o)&&o>=0&&o<n.length?o:n.length;d.people=n,d.shown=n.slice(0,r),d.hidden=n.slice(r),c.textContent="";for(const e of Array.from(c.classList))/^avatar-group-(xs|sm|md|lg|xl)$/.test(e)&&c.classList.remove(e);c.classList.add("avatar-group",`avatar-group-${s}`),h.label?c.setAttribute("aria-label",String(h.label)):i&&null!=a?c.setAttribute("aria-label",a):c.removeAttribute("aria-label");const l=null==(p=h.overlap)||""===p?null:"number"==typeof p&&Number.isFinite(p)?`${p}px`:Object.prototype.hasOwnProperty.call(Nt,p)?`calc(var(--dm-avatar-size, 2.5rem) * ${Nt[p]})`:String(p);var p;null!=l?c.style.setProperty("--dm-avatar-overlap",l):c.style.removeProperty("--dm-avatar-overlap");let m=d.shown.length+1;for(const e of d.shown){const t=document.createElement("li");t.className="avatar-group-item",t.style.setProperty("--dm-avatar-z",String(m--)),t.appendChild(sn(e,{...h,size:s})),c.appendChild(t)}if(d.hidden.length){const e=d.hidden.length,t=d.hidden.map(e=>e.name||e.alt||"").filter(Boolean),n=document.createElement("li");n.className="avatar-group-item",n.style.setProperty("--dm-avatar-z",String(m));const i=document.createElement("button");i.type="button",i.className=`avatar avatar-more avatar-${s}`,"rounded"!==h.shape&&"square"!==h.shape||i.classList.add(`avatar-${h.shape}`),i.textContent=`+${e}`;const o="function"==typeof h.moreLabel?h.moreLabel(e,t):`${e} more${t.length?`: ${function(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}(t)}`:""}`;i.setAttribute("aria-label",String(o)),n.appendChild(i),c.appendChild(n),d.more=i;const r=d.hidden;"function"==typeof h.onMore?i.addEventListener("click",e=>h.onMore(r.slice(),e)):!1!==h.popover?d.popover=new Bt(i,{title:`${e} more`,content:()=>function(e,t){const n=document.createElement("ul");n.className="avatar-more-list";for(const s of e){const e=document.createElement("li"),i=document.createElement(s.href?"a":"span");i.className="avatar-more-person",s.href&&i.setAttribute("href",String(s.href));const o=document.createElement("span");en(o,{name:s.name,alt:s.alt,src:s.src,icon:s.icon,tone:s.tone,size:"xs",shape:t.shape,decorative:!0});const r=document.createElement("span");r.className="avatar-more-name",r.textContent=s.name||s.alt||"",i.append(o,r),e.appendChild(i),n.appendChild(e)}return n}(r,h),placement:"bottom",className:"avatar-more-popover",maxWidth:"18rem"}):t.length&&(i.title=t.join(", "))}t&&(d.more?d.more.focus():(c.hasAttribute("tabindex")||c.setAttribute("tabindex","-1"),c.focus()))};p();const m={element:c,get options(){return h},get people(){return d.people},get shown(){return d.shown},get hidden(){return d.hidden},get more(){return d.more},get popover(){return d.popover},update:(e={})=>(h={...h,...e},p(),m),setPeople:e=>m.update({people:e}),destroy:()=>(Ft.get(n)!==m||(Ft.delete(n),L(n,m),c!==n&&L(c,m),u(),i?(c.textContent="",c.className=[...r].join(" "),c.className||c.removeAttribute("class"),null==a?c.removeAttribute("aria-label"):c.setAttribute("aria-label",a),l?c.style.setProperty("--dm-avatar-overlap",l):c.style.removeProperty("--dm-avatar-overlap")):n.textContent="",n.appendChild(o)),n)};return Object.defineProperty(m,"componentName",{value:"avatar-group"}),Ft.set(n,m),M(n,m),c!==n&&M(c,m),m}on.get=function(e){const t=Vt(e);return t&&x(t,"avatar-group")||null};class rn extends C{static componentName="card";static defaults={hoverable:!0,shadow:"medium",rounded:!0,animation:!0,animationDuration:200,collapsible:!1,collapsed:!1,persistKey:null,title:"",icon:"",content:"",safe:!0,clickable:!1,color:null,onCollapse:null,onExpand:null,onClick:null};constructor(e,t={}){super(Fe(e),t),this.element&&(void 0!==t.hover&&void 0===t.hoverable&&(this.options.hoverable=t.hover),this._added=[],this._made=[],this._apply(),this._bind(),Ve(this.options.collapsible)&&this._restoreState())}_addClass(...e){for(const t of e)this.element.classList.contains(t)||(this.element.classList.add(t),this._added.push(t))}_apply(){const e=this.element,t=this.options;this._addClass("card"),e.classList.toggle("card-hover",Ve(t.hoverable,!0)),e.classList.toggle("card-clickable",Ve(t.clickable)||"function"==typeof t.onClick);for(const t of["none","sm","lg"])e.classList.remove(`card-shadow-${t}`);const n={none:"none",small:"sm",sm:"sm",large:"lg",lg:"lg"}[t.shadow];if(n&&e.classList.add(`card-shadow-${n}`),e.classList.toggle("card-square",!1===t.rounded||"false"===t.rounded),this._colorClass&&e.classList.remove(this._colorClass),this._colorClass=t.color?`card-${t.color}`:null,this._colorClass&&!e.classList.contains(this._colorClass)?e.classList.add(this._colorClass):this._colorClass&&(this._colorClass=null),e.classList.toggle("card-no-animation",!1===t.animation||"false"===t.animation),e.style.setProperty("--dm-card-duration",`${qe(t.animationDuration,200)}ms`),t.title&&!this._header()){const n=document.createElement("div");n.className="card-header";const s=document.createElement("h4");if(s.className="card-title",t.icon){const e=document.createElement("span");e.setAttribute("data-icon",t.icon),e.className="card-title-icon",s.appendChild(e)}s.appendChild(document.createTextNode(String(t.title))),n.appendChild(s),e.insertBefore(n,e.firstChild),this._made.push(n),Ke(n)}t.content&&this.setContent(t.content,{safe:t.safe});const s=Ve(t.collapsible);e.classList.toggle("card-collapsible",s);const i=this._header();if(s&&i){if(!i.querySelector(":scope > .card-collapse-icon")){const e=document.createElement("span");e.className="card-collapse-icon",e.appendChild(function(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(const[e,n]of Object.entries({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))t.setAttribute(e,n);const n=document.createElementNS(e,"path");return n.setAttribute("d","M6 9l6 6 6-6"),t.appendChild(n),t}()),i.appendChild(e),this._made.push(e)}i.hasAttribute("tabindex")||(i.setAttribute("tabindex","0"),this._headerTabindex=!0),i.setAttribute("role","button"),i.setAttribute("aria-expanded",String(!this.isCollapsed()))}}_header(){return this.element.querySelector(":scope > .card-header")}_body(){return this.element.querySelector(":scope > .card-body")}_bind(){this._addEventListener(this.element,"click",e=>{const t=this._header();Ve(this.options.collapsible)&&t&&t.contains(e.target)&&!e.target.closest("a, button, input, select, textarea, [data-no-collapse]")?this.toggle():this._fire("click",this,e)}),this._addEventListener(this.element,"keydown",e=>{const t=this._header();Ve(this.options.collapsible)&&e.target===t&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle()))})}_storageKey(){return this.options.persistKey||(this.element.id?`domma-card-${this.element.id}`:null)}_restoreState(){const e=this._storageKey(),t=e?me.get(e):null;(t?.collapsed||!t?.collapsed&&Ve(this.options.collapsed))&&this._setCollapsed(!0,!1,!1)}_saveState(){const e=this._storageKey();e&&me.set(e,{collapsed:this.isCollapsed()})}_setCollapsed(e,t=!0,n=!0){const s=this.element,i=this._body(),o=s.classList.contains("card-no-animation")||!n?0:qe(this.options.animationDuration,200);clearTimeout(this._heightTimer),e?(i&&o&&(i.style.height=`${i.scrollHeight}px`,i.offsetHeight),s.classList.add("card-collapsed"),i&&(i.style.height=""),this._fire("collapse",this)):(s.classList.remove("card-collapsed"),i&&o&&(i.style.height="0px",i.offsetHeight,i.style.height=`${i.scrollHeight}px`,this._heightTimer=setTimeout(()=>{s.classList.contains("card-collapsed")||(i.style.height="")},o)),this._fire("expand",this)),this._header()?.setAttribute("aria-expanded",String(!e)),t&&this._saveState()}collapse(){return this.isCollapsed()||this._setCollapsed(!0),this}expand(){return this.isCollapsed()&&this._setCollapsed(!1),this}toggle(){return this._setCollapsed(!this.isCollapsed()),this}isCollapsed(){return this.element.classList.contains("card-collapsed")}setShadow(e){return this.options.shadow=e,this._apply(),this}setHoverable(e){return this.options.hoverable=e,this.element.classList.toggle("card-hover",Ve(e,!0)),this}setContent(e,t={}){const n=this.getBody();return Ue(n,e,{safe:t.safe??this.options.safe}),Ke(n),this}getBody(){let e=this._body();if(!e){e=document.createElement("div"),e.className="card-body";const t=this.element.querySelector(":scope > .card-footer");this.element.insertBefore(e,t),this._made.push(e)}return e}updateHeight(){const e=this._body();return e&&!this.isCollapsed()&&(e.style.height=""),this}_applyOptions(){this._apply(),Ve(this.options.collapsible)||this.element.classList.remove("card-collapsed")}destroy(){clearTimeout(this._heightTimer);const e=this.element;if(e){e.classList.remove(...this._added,"card-hover","card-clickable","card-collapsible","card-collapsed","card-square","card-no-animation","card-shadow-none","card-shadow-sm","card-shadow-lg"),e.style.removeProperty("--dm-card-duration"),this._colorClass&&e.classList.remove(this._colorClass);for(const e of this._made)(e.classList?.contains("card-collapse-icon")||e.classList?.contains("card-header"))&&e.remove();const t=this._header();t&&(this._headerTabindex&&t.removeAttribute("tabindex"),t.removeAttribute("role"),t.removeAttribute("aria-expanded"))}super.destroy()}}const an={small:"400px",sm:"400px",medium:"600px",md:"600px",large:"800px",lg:"800px",xl:"1140px",xlarge:"1140px",full:"96vw"},ln=[];let cn=!1;function hn(e){if("Escape"!==e.key||e.defaultPrevented)return;const t=ln[ln.length-1];t&&!1!==t.options.keyboard&&!1!==t.options.closeOnEscape&&t.close()}function dn(){cn&&!ln.length&&(document.removeEventListener("keydown",hn),cn=!1)}const un='[data-close], [data-dismiss="modal"], [data-dm-close], .modal-close, .btn-close';class pn extends C{static componentName="modal";static defaults={backdrop:!0,backdropClose:!0,keyboard:!0,closeOnEscape:!0,animation:"fade",animationDuration:300,closeButton:!0,size:"medium",centered:!0,scrollable:!1,title:"",content:"",footer:"",buttons:[],safe:!0,className:"",headerClass:"",bodyClass:"",footerClass:"",focus:!0,trapFocus:!0,returnFocus:!0,visible:!1,onOpen:null,onOpened:null,onClose:null,onClosed:null,onBeforeOpen:null,onBeforeClose:null,onButtonClick:null};constructor(e,t={}){const n=Fe(e),s=!n;let i=n;s&&(i=document.createElement("div"),i.className="dm-modal"),super(i,t),this._factoryMade=s,this._isOpen=!1,this._timers=[],this._restoreFocus=null,this._given=t||{},this._init()}_init(){const e=this.element,t=this.options;if(this._factoryMade||"size"in this._givenOptions()||(e.classList.contains("modal-sm")?t.size="small":e.classList.contains("modal-lg")?t.size="large":e.classList.contains("modal-xl")&&(t.size="xl"),e.dataset.size&&(t.size=e.dataset.size)),this._authored=!this._factoryMade&&!!e.querySelector(":scope > .modal-header, :scope > .modal-body, :scope > .modal-footer, :scope > .modal-content, :scope > .modal-dialog"),e.shadowRoot&&e.shadowRoot.querySelector(".modal-dialog"))this._host=e;else if(!e.shadowRoot&&function(e){return["ARTICLE","ASIDE","BLOCKQUOTE","BODY","DIV","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","MAIN","NAV","P","SECTION","SPAN"].includes(e.tagName)||e.tagName.includes("-")}(e))e.attachShadow({mode:"open"}),this._host=e;else if(e.shadowRoot)this._host=e;else{const t=document.createElement("div");for(t.className="dm-modal-inner";e.firstChild;)t.appendChild(e.firstChild);t.attachShadow({mode:"open"}),e.appendChild(t),this._host=t}this._addedClasses=["dm-modal-host"],this._host.classList.add("dm-modal-host"),this._host!==e&&e.classList.add("dm-modal-host"),this._authored&&(this._host.classList.add("dm-modal-authored"),this._addedClasses.push("dm-modal-authored")),this._addedAttrs=[];const n=(t,n)=>{e.hasAttribute(t)||(e.setAttribute(t,n),this._addedAttrs.push(t))};n("role","dialog"),n("aria-modal","true");const s=e.querySelector(".modal-title");s&&(s.id||(s.id=Ge("dm-modal-title")),n("aria-labelledby",s.id));for(const t of e.querySelectorAll(un))t.hasAttribute("aria-label")||t.setAttribute("aria-label","Close");this._factoryMade&&t.content&&Ue(e,t.content,{safe:t.safe}),this._render(),this._bind(),Ve(t.visible)&&this.open()}_wantsTrap(){const e=this.options;return!!Ve(e.trapFocus,!0)&&(Ve(e.backdrop,!0)||"trapFocus"in this._givenOptions())}_startTrap(){this._wantsTrap()&&"undefined"!=typeof document&&(this._trap||(this._trap=new ut(this.element,{initialFocus:!1,fallbackFocus:()=>this._dialog,returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1})),this._trap.activate())}_givenOptions(){return this._given||{}}_render(){const e=this.options,t=this._host.shadowRoot;t.replaceChildren();const n=document.createElement("style");n.textContent='\n:host {\n display: none;\n position: fixed;\n inset: 0;\n z-index: 1050;\n align-items: center;\n justify-content: center;\n pointer-events: auto;\n --dm-modal-duration: 300ms;\n}\n:host(.dm-modal-visible) { display: flex; }\n:host(.dm-modal-no-backdrop) { pointer-events: none; }\n:host(.dm-modal-top) { align-items: flex-start; padding-top: 5vh; }\n* { box-sizing: border-box; }\n.modal-backdrop {\n position: fixed;\n inset: 0;\n background: var(--dm-modal-backdrop, rgba(0, 0, 0, 0.5));\n opacity: 0;\n transition: opacity var(--dm-modal-duration) ease;\n}\n:host(.dm-modal-shown) .modal-backdrop { opacity: 1; }\n.modal-dialog {\n position: relative;\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n max-width: min(var(--dm-modal-width, 600px), 90%);\n max-height: 90vh;\n background: var(--dm-surface, #fff);\n color: var(--dm-text, #212529);\n border: 1px solid var(--dm-border, transparent);\n border-radius: var(--dm-radius-lg, 8px);\n box-shadow: var(--dm-shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.3));\n overflow: hidden;\n outline: none;\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n transition: opacity var(--dm-modal-duration) ease, transform var(--dm-modal-duration) ease;\n}\n:host([data-animation="zoom"]) .modal-dialog { transform: scale(0.7); }\n:host([data-animation="slide"]) .modal-dialog { transform: translateY(-50px); }\n:host(.dm-modal-shown) .modal-dialog { opacity: 1; transform: none; }\n:host([data-animation="none"]) .modal-dialog,\n:host([data-animation="none"]) .modal-backdrop { transition: none; }\n.modal-content { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }\n.modal-header {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--dm-border, #e5e7eb);\n}\n.modal-header[hidden], .modal-footer[hidden] { display: none; }\n.modal-title { margin: 0; flex: 1; font-size: 1.25rem; font-weight: 600; color: inherit; }\n.modal-close {\n margin-left: auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: none;\n background: none;\n font-size: 1.5rem;\n line-height: 1;\n cursor: pointer;\n color: var(--dm-text-muted, #6b7280);\n border-radius: var(--dm-radius-sm, 4px);\n}\n.modal-close:hover { color: var(--dm-text, #212529); }\n.modal-close:focus-visible, .modal-footer button:focus-visible {\n outline: 2px solid var(--dm-border-focus, var(--dm-primary, #6495ED));\n outline-offset: 2px;\n}\n.modal-body { padding: 1.5rem; overflow: auto; min-height: 0; flex: 1 1 auto; }\n:host(.dm-modal-authored) .modal-body { padding: 0; }\n.modal-body-scrollable { max-height: 60vh; overflow-y: auto; }\n.modal-footer {\n display: flex;\n justify-content: flex-end;\n flex-wrap: wrap;\n gap: 0.5rem;\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n /* --dm-background-alt: every theme sets it (--dm-surface-secondary is light outside .dm-theme-dark) */\n background: var(--dm-background-alt, var(--dm-surface, #f9fafb));\n}\n.modal-footer button {\n padding: 0.5rem 1rem;\n border: 1px solid transparent;\n border-radius: var(--dm-radius-md, 4px);\n font: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n background: var(--dm-secondary, #6c757d);\n color: var(--dm-secondary-text, #fff);\n transition: filter 0.15s ease;\n}\n.modal-footer button:hover { filter: brightness(0.92); }\n.modal-footer .btn-primary { background: var(--dm-primary, #6495ED); color: var(--dm-primary-text, #fff); }\n.modal-footer .btn-success { background: var(--dm-success, #28a745); color: var(--dm-success-text, #fff); }\n.modal-footer .btn-danger { background: var(--dm-danger, #dc3545); color: var(--dm-danger-text, #fff); }\n.modal-footer .btn-warning { background: var(--dm-warning, #ffc107); color: var(--dm-warning-text, #212529); }\n.modal-footer .btn-info { background: var(--dm-info, #17a2b8); color: var(--dm-info-text, #fff); }\n.modal-footer .btn-outline, .modal-footer .btn-ghost, .modal-footer .btn-link {\n background: transparent;\n color: var(--dm-text, #212529);\n border-color: var(--dm-border, #dee2e6);\n}\n',t.appendChild(n);const s=!1===e.animation||"none"===e.animation||"false"===e.animation?"none":String(e.animation||"fade");this._host.dataset.animation=s,this._host.style.setProperty("--dm-modal-duration",`${"none"===s?0:qe(e.animationDuration,300)}ms`);const i=an[e.size]||(e.size?String(e.size):an.medium);this._host.style.setProperty("--dm-modal-width",i),this._host.classList.toggle("dm-modal-no-backdrop",!Ve(e.backdrop,!0)),this._host.classList.toggle("dm-modal-top",!1===e.centered||"false"===e.centered),this._backdrop=null,Ve(e.backdrop,!0)&&(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",this._backdrop.setAttribute("part","backdrop"),t.appendChild(this._backdrop));const o=document.createElement("div");o.className="modal-dialog"+(e.className?" "+e.className:""),o.setAttribute("part","dialog"),o.tabIndex=-1,this._dialog=o;const r=document.createElement("div");r.className="modal-content",r.setAttribute("part","content");const a=document.createElement("div");if(a.className="modal-header"+(e.headerClass?" "+e.headerClass:""),a.setAttribute("part","header"),this._titleEl=document.createElement("h3"),this._titleEl.className="modal-title",this._titleEl.setAttribute("part","title"),this._titleEl.id=Ge("dm-modal-shadow-title"),e.title?this._titleEl.textContent=String(e.title):this._titleEl.hidden=!0,a.appendChild(this._titleEl),Ve(e.closeButton,!0)&&!this._authored){const e=document.createElement("button");e.type="button",e.className="modal-close",e.setAttribute("part","close"),e.setAttribute("aria-label","Close"),e.innerHTML="×",e.addEventListener("click",()=>this.close()),a.appendChild(e)}a.hidden=!e.title&&(this._authored||!Ve(e.closeButton,!0)),this._header=a,r.appendChild(a),!e.title||this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("aria-label")||(this.element.setAttribute("aria-label",String(e.title)),this._addedAttrs.push("aria-label"));const l=document.createElement("div");l.className=`modal-body${e.bodyClass?" "+e.bodyClass:""}${Ve(e.scrollable)?" modal-body-scrollable":""}`,l.setAttribute("part","body"),l.appendChild(document.createElement("slot")),this._body=l,r.appendChild(l);const c=document.createElement("div");c.className="modal-footer"+(e.footerClass?" "+e.footerClass:""),c.setAttribute("part","footer");const h=document.createElement("slot");h.name="footer",c.appendChild(h),this._footer=c,this._footerText=null,e.footer&&(this._footerText=document.createElement("span"),this._footerText.textContent=String(e.footer),c.appendChild(this._footerText)),r.appendChild(c),this._renderButtons(),o.appendChild(r),t.appendChild(o)}_renderButtons(){const e=this._footer;for(const t of e.querySelectorAll("button[data-button-id]"))t.remove();const t=Array.isArray(this.options.buttons)?this.options.buttons:[];t.forEach((t,n)=>{const s=t.id||`btn-${n}`,i=document.createElement("button");i.type="button",i.className=`btn btn-${t.variant||"secondary"}${t.className?" "+t.className:""}`,i.textContent=t.text||"Button",i.dataset.buttonId=s,i.addEventListener("click",e=>{this._fire("buttonClick",s,this),"function"==typeof t.onClick&&t.onClick(this,e),!1!==t.close&&this.close()}),e.appendChild(i)});const n=this.element.querySelector(':scope > [slot="footer"]');e.hidden=!t.length&&!this._footerText&&!n}_bind(){const e=this._host;this._addEventListener(e.shadowRoot,"pointerdown",e=>{this._downOnBackdrop=e.composedPath()[0]===this._backdrop}),this._addEventListener(e.shadowRoot,"click",e=>{const t=e.composedPath()[0]===this._backdrop,n=!1!==this._downOnBackdrop;this._downOnBackdrop=void 0,t&&n&&this._isOpen&&Ve(this.options.backdropClose,!0)&&this.close()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest?.(un);t&&this.element.contains(t)&&this._ownsNode(t)&&(e.preventDefault(),this.close())})}_ownsNode(e){const t=e.closest(".dm-modal-host");return!t||t===this.element||t===this._host}_later(e,t){const n=setTimeout(()=>{this._timers=this._timers.filter(e=>e!==n),e()},t);this._timers.push(n)}_clearTimers(){this._timers.forEach(clearTimeout),this._timers=[]}_duration(){return"none"===this._host.dataset.animation?0:qe(this.options.animationDuration,300)}open(){if(this._isOpen)return this;if(!1===this._fire("beforeOpen",this))return this;this._clearTimers(),this._isOpen=!0;const e=this._host;this._factoryMade&&!this.element.isConnected&&_n().appendChild(this.element),"none"===this.element.style.display&&this.element.style.removeProperty("display"),this.element.hidden=!1,e.classList.add("dm-modal-visible"),e!==this.element&&this.element.classList.add("dm-modal-visible"),ln.push(this),cn||"undefined"==typeof document||(document.addEventListener("keydown",hn),cn=!0),Ve(this.options.focus,!0)&&"undefined"!=typeof document&&(this._restoreFocus=document.activeElement),this._startTrap();const t=()=>{if(this._isOpen&&(e.classList.add("dm-modal-shown"),Ve(this.options.focus,!0)&&!this.element.contains(document.activeElement)))try{this._dialog.focus({preventScroll:!0})}catch{}};return this._duration()&&"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(t)):t(),this._fire("open",this),this._later(()=>this._fire("opened",this),this._duration()),this}close(){if(!this._isOpen)return this;if(!this._mayClose(this))return this;this._clearTimers(),this._isOpen=!1;const e=this._host;e.classList.remove("dm-modal-shown");const t=ln.indexOf(this);if(t>-1&&ln.splice(t,1),dn(),this._trap&&this._trap.isActive()){const e=Ve(this.options.focus,!0)&&Ve(this.options.returnFocus,!0);this._trap.deactivate({returnFocus:e}),this._restoreFocus=null}this._fire("close",this);const n=()=>{e.classList.remove("dm-modal-visible"),this.element.classList.remove("dm-modal-visible");const t=Ve(this.options.returnFocus,!0)?this._restoreFocus:null;if(this._restoreFocus=null,t&&"function"==typeof t.focus&&t.isConnected)try{t.focus({preventScroll:!0})}catch{}this._fire("closed",this)},s=this._duration();return s?this._later(n,s):n(),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}setTitle(e){return this.options.title=e,this._titleEl.textContent=null==e?"":String(e),this._titleEl.hidden=!e,this._header.hidden=!e&&(this._authored||!Ve(this.options.closeButton,!0)),this}setContent(e,t={}){const n=Array.from(this.element.querySelectorAll(":scope > [slot]")),s=this._host===this.element?this.element:this._host;return Ue(s,e,{safe:t.safe??this.options.safe}),n.forEach(e=>s.appendChild(e)),this}setButtons(e){return this.options.buttons=e||[],this._renderButtons(),this}_applyOptions(){const e=this._isOpen;this._render(),e&&this._host.classList.add("dm-modal-visible","dm-modal-shown")}destroy(){if(this._destroyed)return;this._destroyed=!0;const e=this._isOpen;e&&this._forcedClose();const t=ln.indexOf(this);t>-1&&ln.splice(t,1),dn(),this._trap&&(this._trap.destroy(),this._trap=null),super.destroy();const n=this.element;if(this._factoryMade){const t=()=>n.remove();return void(e&&this._duration()?setTimeout(t,this._duration()):t())}this._clearTimers();this._host.shadowRoot.replaceChildren(document.createElement("slot")),this._host.classList.remove(...this._addedClasses,"dm-modal-visible","dm-modal-shown","dm-modal-no-backdrop","dm-modal-top"),n.classList.remove("dm-modal-host","dm-modal-visible"),delete this._host.dataset.animation,this._host.style.removeProperty("--dm-modal-duration"),this._host.style.removeProperty("--dm-modal-width");for(const e of this._addedAttrs)n.removeAttribute(e)}remove(...e){return this.destroy(...e)}}const mn={size:"large",buttons:[{id:"close",text:"Close",variant:"secondary"}]};let fn=null;function _n(){return fn&&fn.isConnected||(fn=document.createElement("div"),fn.className="dm-dialog-container",fn.style.cssText="position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1040;",document.body.appendChild(fn)),fn}function gn(e={}){const t=_n(),n=new vn(null,{...mn,...e});return n.element.style.zIndex=String(1050+10*ln.length),t.appendChild(n.element),n}class vn extends pn{get _factoryCreated(){return!0}}const bn={top:"bottom",bottom:"top",left:"right",right:"left"},yn=new Set;let kn=null;function wn(e){yn.delete(e),!yn.size&&kn&&(kn.disconnect(),kn=null)}class xn extends C{static componentName="tooltip";static defaults={content:"",position:"top",trigger:"hover",delay:0,hideDelay:0,animation:!0,offset:8,html:!1,safe:!0,visible:!1,className:"",maxWidth:null,onShow:null,onHide:null};constructor(e,t={}){super(e,xn.normalise(t)),this.element&&(this._visible=!1,this._bubble=null,this._timers={},this._takeTitle(),this._bindTrigger(),Ve(this.options.visible)&&this.show())}static normalise(e={}){const t={...e};return t.placement&&!t.position&&(t.position=t.placement),t.delay&&"object"==typeof t.delay&&(void 0!==t.delay.hide&&void 0===t.hideDelay&&(t.hideDelay=t.delay.hide),t.delay=t.delay.show??0),t}_takeTitle(){const e=this.element,t=this.options.content;null!=t&&""!==t||e.dataset.tooltip||!e.hasAttribute("title")||(this._title=e.getAttribute("title"),e.removeAttribute("title"))}_content(){const e=this.options.content;return null!=e&&""!==e?"function"==typeof e?e(this.element):e:this.element.dataset.tooltip||this._title||""}_bindTrigger(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[];const e=this.element,t=String(this.options.trigger||"hover").split(/\s+/);if(t.includes("hover")&&(this._addEventListener(e,"mouseenter",()=>this.show()),this._addEventListener(e,"mouseleave",()=>this.hide())),t.includes("focus")||t.includes("hover")){const n=!t.includes("focus");this._addEventListener(e,"focusin",e=>{let t=!0;try{t=e.target.matches(":focus-visible")}catch{}n&&!t||this.show()}),this._addEventListener(e,"focusout",()=>this.hide())}t.includes("click")&&this._addEventListener(e,"click",()=>this.toggle()),this._addEventListener(e,"keydown",e=>{"Escape"===e.key&&this._visible&&this.hide({immediate:!0})})}_clear(e){clearTimeout(this._timers[e]),this._timers[e]=null}_make(){const e=this.options,t=document.createElement("div");t.className="domma-tooltip"+(e.className?" "+e.className:""),t.id=Ge("dm-tooltip"),t.setAttribute("role","tooltip"),e.maxWidth&&(t.style.maxWidth="number"==typeof e.maxWidth?`${e.maxWidth}px`:String(e.maxWidth)),Ve(e.animation,!0)||(t.style.transition="none"),this._bubble=t,this._write(),document.body.appendChild(t);const n=(this.element.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);n.includes(t.id)||this.element.setAttribute("aria-describedby",[...n,t.id].join(" "))}_write(){if(!this._bubble)return;const e=this._content();Ue(this._bubble,e,{text:!Ve(this.options.html),safe:this.options.safe})}_unmake(){const e=this._bubble;if(!e)return;this._bubble=null,e.remove();const t=(this.element.getAttribute("aria-describedby")||"").split(/\s+/).filter(t=>t&&t!==e.id);t.length?this.element.setAttribute("aria-describedby",t.join(" ")):this.element.removeAttribute("aria-describedby")}_place(){const e=this._bubble;if(!e)return;const t=this.element.getBoundingClientRect(),n=e.getBoundingClientRect(),s=qe(this.options.offset,8),i=window.innerWidth,o=window.innerHeight,r=e=>{switch(e){case"bottom":return{top:t.bottom+s,left:t.left+(t.width-n.width)/2};case"left":return{top:t.top+(t.height-n.height)/2,left:t.left-n.width-s};case"right":return{top:t.top+(t.height-n.height)/2,left:t.right+s};default:return{top:t.top-n.height-s,left:t.left+(t.width-n.width)/2}}},a=e=>e.top>=0&&e.left>=0&&e.top+n.height<=o&&e.left+n.width<=i;let l=bn[this.options.position]?this.options.position:"top",c=r(l);!a(c)&&a(r(bn[l]))&&(l=bn[l],c=r(l)),c.left=Math.min(Math.max(8,c.left),Math.max(8,i-n.width-8)),c.top=Math.min(Math.max(8,c.top),Math.max(8,o-n.height-8)),e.style.top=`${Math.round(c.top)}px`,e.style.left=`${Math.round(c.left)}px`,e.dataset.position=l}_onScroll=()=>{this._visible&&(this.element.isConnected?this._place():this.close({immediate:!0}))};open(){if(this._clear("hide"),this._visible||this._timers.show)return this;const e=()=>{var e;(this._timers.show=null,this.element.isConnected)&&(this._bubble||this._make(),this._visible=!0,this._place(),this._bubble.offsetHeight,this._bubble.classList.add("show"),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),window.addEventListener("resize",this._onScroll,{passive:!0}),e=this,yn.add(e),!kn&&"undefined"!=typeof MutationObserver&&document.body&&(kn=new MutationObserver(()=>{for(const e of[...yn])e.element&&e.element.isConnected||e.close({immediate:!0})}),kn.observe(document.body,{childList:!0,subtree:!0})),this._fire("show",this))},t=qe(this.options.delay,0);return t>0?this._timers.show=setTimeout(e,t):e(),this}close(e={}){if(this._clear("show"),!this._visible||this._timers.hide)return this;const t=()=>{this._timers.hide=null,this._visible=!1,wn(this),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.removeEventListener("resize",this._onScroll);const t=this._bubble;t&&t.classList.remove("show");const n=Ve(this.options.animation,!0)&&!e.immediate?150:0;n?this._timers.fade=setTimeout(()=>{this._visible||this._unmake()},n):this._unmake(),this._fire("hide",this)},n=e.immediate?0:qe(this.options.hideDelay,0);return n>0?this._timers.hide=setTimeout(t,n):t(),this}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}toggle(){return this._visible?this.close():this.open()}isVisible(){return this._visible}isOpen(){return this._visible}setContent(e){return this.options.content=e,this._write(),this._visible&&this._place(),this}setPosition(e){return this.options.position=e,this._visible&&this._place(),this}setOptions(e={}){return super.setOptions(xn.normalise(e))}_applyOptions(){this._bindTrigger(),this._write(),this._visible&&this._place()}destroy(){Object.values(this._timers||{}).forEach(clearTimeout),this._bubble&&(window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.removeEventListener("resize",this._onScroll)),this._unmake(),this._visible=!1,wn(this),void 0!==this._title&&this.element&&!this.element.hasAttribute("title")&&this.element.setAttribute("title",this._title),super.destroy()}}const Mn=["primary","secondary","success","danger","warning","info","light","dark"],Ln={small:"badge-sm",sm:"badge-sm",large:"badge-lg",lg:"badge-lg"};class Cn extends C{static componentName="badge";static defaults={variant:"primary",size:"medium",pill:!1,outline:!1,removable:!1,pulse:!1,onClick:null,onRemove:null};constructor(e,t={}){super(Fe(e),t),this.element&&(this._had=new Set(this.element.classList),this._apply(),this._addEventListener(this.element,"click",e=>{this._removeBtn&&this._removeBtn.contains(e.target)||this._fire("click",e,this)}))}_apply(){const e=this.element,t=this.options,n=e=>this._had.has(e);for(const t of Mn)n(`badge-${t}`)||e.classList.remove(`badge-${t}`);for(const t of["badge-sm","badge-lg","badge-pill","badge-rounded","badge-outline","badge-pulse"])n(t)||e.classList.remove(t);const s=Mn.includes(t.variant)?t.variant:"primary";for(const t of Mn)e.classList.remove(`badge-outline-${t}`);if(Ve(t.outline)?e.classList.add("badge","badge-outline",`badge-outline-${s}`):e.classList.add("badge",`badge-${s}`),Ln[t.size]&&e.classList.add(Ln[t.size]),e.classList.add(Ve(t.pill)?"badge-pill":"badge-rounded"),Ve(t.pulse)&&e.classList.add("badge-pulse"),Ve(t.removable)&&!this._removeBtn){const t=document.createElement("button");t.type="button",t.className="domma-badge-remove",t.setAttribute("aria-label","Remove"),t.textContent="×",t.addEventListener("click",e=>{e.stopPropagation(),!1!==this._fire("remove",this,e)&&(this.element.remove(),this.destroy())}),e.appendChild(t),this._removeBtn=t}else!Ve(t.removable)&&this._removeBtn&&(this._removeBtn.remove(),this._removeBtn=null)}_applyOptions(){this._apply()}setVariant(e){return this.options.variant=e,this._apply(),this}setSize(e){return this.options.size=e,this._apply(),this}setText(e){for(const e of Array.from(this.element.childNodes))e!==this._removeBtn&&e.remove();return this.element.insertBefore(document.createTextNode(null==e?"":String(e)),this._removeBtn||null),this}destroy(){const e=this.element;if(e){for(const t of["badge",...Mn.map(e=>`badge-${e}`),...Mn.map(e=>`badge-outline-${e}`),"badge-sm","badge-lg","badge-pill","badge-rounded","badge-outline","badge-pulse"])this._had?.has(t)||e.classList.remove(t);this._removeBtn?.remove(),this._removeBtn=null}super.destroy()}remove(...e){return this.destroy(...e)}}const An=new Set(["IMG","INPUT","BR","HR","AREA","BASE","COL","EMBED","LINK","META","SOURCE","TRACK","WBR","TEXTAREA","SELECT"]);class En extends C{static componentName="number-badge";static defaults={count:0,max:null,variant:"danger",dot:!1,pulse:!1,borderColor:null,label:null,onChange:null};constructor(e,t={}){if(super(Fe(e),t),!this.element)return;const n=this.element;this._holder=An.has(n.tagName)&&n.parentElement?n.parentElement:n,this._hostClassAdded=!this._holder.classList.contains("badge-counter-host"),this._holder.classList.add("badge-counter-host"),this.counter=document.createElement("span"),this.counter.className="badge-counter",this.counter.setAttribute("role","status"),this.counter.setAttribute("aria-live","polite"),this._holder.appendChild(this.counter),this._paint()}_paint(){const e=this.options,t=this.counter,n=Math.max(0,Math.trunc(qe(e.count,0)));e.count=n,t.className=`badge-counter badge-counter-${Mn.includes(e.variant)?e.variant:"danger"}`,Ve(e.dot)&&t.classList.add("badge-dot"),Ve(e.pulse)&&t.classList.add("badge-pulse"),Ve(e.dot)||0!==n||t.classList.add("badge-counter-hidden"),t.style.borderColor=e.borderColor||"";const s=null==e.max?null:qe(e.max,null);t.textContent=Ve(e.dot)?"":null!==s&&n>s?`${s}+`:String(n),t.setAttribute("aria-label",e.label||(Ve(e.dot)?"New":String(n)))}_applyOptions(){this._paint()}setCount(e){const t=this.options.count;return this.options.count=e,this._paint(),this.options.count!==t&&this._fire("change",this.options.count,t,this),this}increment(e=1){return this.setCount(this.getCount()+qe(e,1))}decrement(e=1){return this.setCount(Math.max(0,this.getCount()-qe(e,1)))}getCount(){return qe(this.options.count,0)}setDot(e){return this.options.dot=e,this._paint(),this}setVariant(e){return this.options.variant=e,this._paint(),this}setPulse(e){return this.options.pulse=e,this._paint(),this}destroy(){this.counter?.remove(),this._holder&&this._hostClassAdded&&this._holder.classList.remove("badge-counter-host"),super.destroy()}remove(...e){return this.destroy(...e)}}const Sn={small:24,sm:24,medium:40,md:40,large:64,lg:64},$n=["primary","secondary","success","danger","warning","info"],zn={spinner:0,dots:3,pulse:0,bars:4};class Tn extends C{static componentName="loader";static defaults={type:"spinner",size:"medium",color:"primary",overlay:!1,text:"",centered:!0,visible:!0,fullscreen:!1,label:"Loading",onShow:null,onHide:null};constructor(e,t={}){super(Fe(e),t),this.element&&(this.indicator=document.createElement("div"),this.indicator.setAttribute("role","status"),this.indicator.setAttribute("aria-live","polite"),this._visible=!1,this._render(),this.element.appendChild(this.indicator),Ve(this.options.visible,!0)?this.show():this._setShown(!1))}_render(){const e=this.options,t=this.indicator,n=void 0!==zn[e.type]?e.type:"spinner",s=Ve(e.overlay);var i,o;t.className=`dm-loader dm-loader-js${s?" dm-loader-overlay":""}${Ve(e.centered,!0)&&!s?" dm-loader-centered":""}`,t.style.setProperty("--dm-loader-size",`${i=e.size,"number"==typeof i?i:null==i||""===i||isNaN(i)?Sn[i]||Sn.medium:parseInt(i,10)}px`),t.style.setProperty("--dm-loader-color",(o=e.color)?$n.includes(o)?`var(--dm-${o})`:"white"===o?"#fff":"dark"===o?"var(--dm-text)":String(o):"var(--dm-primary)"),t.setAttribute("aria-label",e.text?String(e.text):String(e.label||"Loading")),this.element.classList.toggle("dm-loader-host",s);const r=document.createElement("div");r.className=`dm-loader-anim dm-loader-anim-${n}`,r.setAttribute("aria-hidden","true");for(let e=0;e<zn[n];e++)r.appendChild(document.createElement("span"));t.replaceChildren(r),this._textEl=null,e.text&&(this._textEl=document.createElement("span"),this._textEl.className="dm-loader-text",this._textEl.textContent=String(e.text),t.appendChild(this._textEl))}_setShown(e){this.indicator.hidden=!e,Ve(this.options.fullscreen)&&(this.element.style.display=e?"flex":"none")}show(){const e=this._visible;return this._visible=!0,this._setShown(!0),!this.indicator.isConnected&&this.element&&this.element.appendChild(this.indicator),e||this._fire("show",this),this}hide(){const e=this._visible;return this._visible=!1,this._setShown(!1),e&&this._fire("hide",this),this}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}isOpen(){return this._visible}setText(e){return this.options.text=e,this._render(),this}setType(e){return this.options.type=e,this._render(),this}setSize(e){return this.options.size=e,this._render(),this}setColor(e){return this.options.color=e,this._render(),this}_applyOptions(){this._render(),this._setShown(this._visible)}destroy(){this.indicator?.remove(),this.element?.classList.remove("dm-loader-host"),Ve(this.options.fullscreen)&&this.element&&(this.element.style.display="none"),super.destroy()}}class Bn extends C{static componentName="back-to-top";static defaults={showAfter:null,duration:300,position:"bottom-right",offset:null,target:null,zIndex:null,label:"Scroll back to top",onShow:null,onHide:null,onScroll:null};constructor(e,t={}){let n=Fe(e);let s=!1;n&&("BUTTON"===n.tagName||"A"===n.tagName||n.tagName.includes("-")||n.classList.contains("dm-back-to-top"))||(n=document.createElement("button"),n.type="button",s=!0),super(n,t),this._made=s,this._visible=!1,this._scrolling=!1,n.tagName.includes("-")?(this.button=n.querySelector(":scope > button.dm-back-to-top")||document.createElement("button"),this.button.type="button",this.button.isConnected||n.appendChild(this.button)):this.button=n,this.button.classList.add("dm-back-to-top"),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",String(this.options.label)),this.button.hasAttribute("title")||this.button.setAttribute("title","Back to top"),this.button.querySelector("svg")||this.button.textContent.trim()||this.button.appendChild(function(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(const[e,n]of Object.entries({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))t.setAttribute(e,n);const n=document.createElementNS(e,"path");return n.setAttribute("d","M18 15l-6-6-6 6"),t.appendChild(n),t}()),s&&document.body.appendChild(n),this._place(),this._addEventListener(this.button,"click",e=>{e.preventDefault(),this.scroll()}),this._watch()}_place(){const e=this.options,t=this.button,n=t.style,s=this._container(),i=!(!s||!s.contains(t));t.classList.toggle("dm-back-to-top-contained",i);const o="bottom-left"===e.position||e.offset&&"object"==typeof e.offset&&void 0!==e.offset.left;t.classList.toggle("dm-back-to-top-left",o);const r=e.offset,a=e=>null==e||""===e?"":`${qe(e,16)}px`;let l="",c="";r&&"object"==typeof r?(l=a(r.bottom),c=a(o?r.left:r.right)):(l=a(r),c=a(r)),n.bottom=l,i?(n.left="",n.right="",n.marginLeft=o?c:"",n.marginRight=o?"":c):(n.left=o?c||"1.5rem":"auto",n.right=o?"auto":c,o||c||(n.right=""),o||(n.left="")),n.zIndex=null===e.zIndex||void 0===e.zIndex?"":String(e.zIndex)}_container(){const e=this.options.target;return e?"string"==typeof e?document.querySelector(e):e:null}_watch(){this._scrollTarget&&this._scrollTarget.removeEventListener("scroll",this._onScroll),this._box=this._container(),this._scrollTarget=this._box||window,this._onScroll=()=>this._check(),this._scrollTarget.addEventListener("scroll",this._onScroll,{passive:!0}),this._check()}_check(){const e=this._box,t=this.options.showAfter??(e?e.clientHeight:window.innerHeight);(e?e.scrollTop:window.scrollY)>qe(t,0)?this.show():this.hide()}scroll(e){if(this._scrolling)return this;const t=this._box,n=t?t.scrollTop:window.scrollY,s=Xe()?0:qe(e??this.options.duration,300),i=e=>{t?t.scrollTop=e:window.scrollTo(0,e)};if(this._fire("scroll",this),!s||"function"!=typeof requestAnimationFrame)return i(0),this;this._scrolling=!0;const o=performance.now(),r=e=>{const t=Math.min((e-o)/s,1);i(n*(1-t*(2-t))),t<1?requestAnimationFrame(r):this._scrolling=!1};return requestAnimationFrame(r),this}show(){return this._visible||(this._visible=!0,this.button.classList.add("show"),this._fire("show",this)),this}hide(){return this._visible?(this._visible=!1,this.button.classList.remove("show"),this._fire("hide",this),this):this}open(...e){return this.show(...e)}close(...e){return this.hide(...e)}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}isOpen(){return this._visible}getButton(){return this.button}setShowAfter(e){return this.options.showAfter=null===e||""===e?null:qe(e,null),this._check(),this}setPosition(e){return this.options.position=e,this._place(),this}setOffset(e){return this.options.offset=e,this._place(),this}_applyOptions(){this._place(),this._watch()}destroy(){this._scrollTarget&&this._scrollTarget.removeEventListener("scroll",this._onScroll),this._made?this.element.remove():this.button.classList.remove("dm-back-to-top","show","dm-back-to-top-contained","dm-back-to-top-left"),super.destroy()}}const jn={success:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",error:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",warning:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",info:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"};function On(e){const t=jn[e];if(!t||"undefined"==typeof document)return null;const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg");s.setAttribute("width","20"),s.setAttribute("height","20"),s.setAttribute("viewBox","0 0 20 20"),s.setAttribute("fill","currentColor"),s.setAttribute("aria-hidden","true");const i=document.createElementNS(n,"path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d",t),s.appendChild(i),s}const Dn={};let Nn=[];class In extends C{static componentName="toast";static defaults={message:"",title:"",type:"default",position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,html:!1,safe:!0,icon:"",actions:[],maxToasts:5,className:"",onShow:null,onClose:null,onPause:null,onResume:null,onAction:null};constructor(e,t={}){super(document.createElement("div"),t),void 0!==e&&(this.options.message=e),this.options.action&&!(this.options.actions||[]).length&&(this.options.actions=[this.options.action]),this._visible=!1,this._timer=null,this._remaining=0,this._started=0,this._paused=!1,this._render(),this._bind()}_render(){const e=this.options,t=this.element,n=e.type||"default";t.className=`domma-toast domma-toast-${n}${e.className?" "+e.className:""}`;const s="error"===n;t.setAttribute("role",s?"alert":"status"),t.setAttribute("aria-live",s?"assertive":"polite"),t.setAttribute("aria-atomic","true"),t.replaceChildren();const i=e.icon;if(i){const n=document.createElement("div");if(n.className="domma-toast-icon","undefined"!=typeof Node&&i instanceof Node)n.appendChild(i);else if("string"!=typeof i||i.includes("<"))Ue(n,i,{safe:e.safe});else{const e=document.createElement("span");e.setAttribute("data-icon",i),n.appendChild(e)}t.appendChild(n),Ke(n)}const o=document.createElement("div");if(o.className="domma-toast-content",this._titleEl=document.createElement("div"),this._titleEl.className="domma-toast-title",this._titleEl.textContent=e.title?String(e.title):"",this._titleEl.hidden=!e.title,o.appendChild(this._titleEl),this._messageEl=document.createElement("div"),this._messageEl.className="domma-toast-message",this._writeMessage(),o.appendChild(this._messageEl),this._actionsEl=document.createElement("div"),this._actionsEl.className="domma-toast-actions",o.appendChild(this._actionsEl),this._renderActions(),t.appendChild(o),Ve(e.closable,!0)){const e=document.createElement("button");e.type="button",e.className="domma-toast-close",e.setAttribute("aria-label","Close"),e.innerHTML="×",e.addEventListener("click",()=>this.close()),t.appendChild(e)}if(this._bar=null,Ve(e.showProgress,!0)&&qe(e.duration,3e3)>0){const e=document.createElement("div");e.className="domma-toast-progress",this._bar=document.createElement("div"),this._bar.className="domma-toast-progress-bar",e.appendChild(this._bar),t.appendChild(e)}t.style.setProperty("--dm-toast-duration",`${qe(e.animationDuration,300)}ms`)}_writeMessage(){const e=this.options,t=e.message;"undefined"!=typeof Node&&t instanceof Node?Ue(this._messageEl,t):Ue(this._messageEl,null==t?"":String(t),{text:!Ve(e.html),safe:e.safe})}_renderActions(){const e=Array.isArray(this.options.actions)?this.options.actions:[];this._actionsEl.replaceChildren(),this._actionsEl.hidden=!e.length,e.forEach((e,t)=>{const n=document.createElement("button");n.type="button",n.className="domma-toast-action"+(e.primary?" is-primary":""),n.textContent=e.label??e.text??"OK",n.addEventListener("click",n=>{"function"==typeof e.onClick&&e.onClick(n,this),this._fire("action",{action:e,index:t},this),!1!==e.closeOnClick&&this.close()}),this._actionsEl.appendChild(n)})}_bind(){this._addEventListener(this.element,"mouseenter",()=>{Ve(this.options.pauseOnHover,!0)&&this._pause()}),this._addEventListener(this.element,"mouseleave",()=>{Ve(this.options.pauseOnHover,!0)&&this._resume()})}_startTimer(){if(clearTimeout(this._timer),this._timer=null,!(this._remaining<=0)&&(this._started=Date.now(),this._timer=setTimeout(()=>this.close(),this._remaining),this._bar)){const e=this._bar;e.style.transition="none",e.style.width=this._remaining/qe(this.options.duration,3e3)*100+"%";const t=()=>{e.style.transition=`width ${this._remaining}ms linear`,e.style.width="0%"};"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(t)):t()}}_pause(){if(!this._paused&&this._timer){if(this._paused=!0,clearTimeout(this._timer),this._timer=null,this._remaining=Math.max(0,this._remaining-(Date.now()-this._started)),this._bar){const e=this._bar.getBoundingClientRect().width,t=this._bar.parentElement?.getBoundingClientRect().width||0;this._bar.style.transition="none",this._bar.style.width=t?e/t*100+"%":this._bar.style.width}this._fire("pause",this)}}_resume(){this._paused&&(this._paused=!1,this._startTimer(),this._fire("resume",this))}open(){if(this._visible)return this;const e=this.options;for(;Nn.length>=qe(e.maxToasts,5);){const e=Nn.shift();e?.close()}this._visible=!0,Nn.push(this);(function(e){let t=Dn[e];return t&&t.isConnected||(t=document.createElement("div"),t.className=`domma-toast-container domma-toast-${e}`,t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.setAttribute("data-focus-trap-allow",""),document.body.appendChild(t),Dn[e]=t),t})(e.position||"top-right").appendChild(this.element);const t=()=>{this.element.classList.remove("hiding"),this.element.classList.add("show")};return"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t(),this._remaining=qe(e.duration,3e3),this._startTimer(),this._fire("show",this),this}close(){return this._visible?(this._visible=!1,clearTimeout(this._timer),this._timer=null,Nn=Nn.filter(e=>e!==this),this.element.classList.remove("show"),this.element.classList.add("hiding"),setTimeout(()=>{this._fire("close",this),this.element.remove(),super.destroy()},qe(this.options.animationDuration,300)),this):this}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}toggle(){return this._visible?this.close():this.open()}isVisible(){return this._visible}isOpen(){return this._visible}setMessage(e){return this.options.message=e,this._writeMessage(),this}setTitle(e){return this.options.title=e,this._titleEl.textContent=e?String(e):"",this._titleEl.hidden=!e,this}setType(e){const t=this.options.type||"default";this.options.type=e||"default",this.element.classList.remove(`domma-toast-${t}`),this.element.classList.add(`domma-toast-${this.options.type}`);const n="error"===this.options.type;return this.element.setAttribute("role",n?"alert":"status"),this.element.setAttribute("aria-live",n?"assertive":"polite"),this}setActions(e){return this.options.actions=e||[],this._renderActions(),this}_applyOptions(){const e=this._visible;this._render(),e&&this.element.classList.add("show")}destroy(){clearTimeout(this._timer),this._visible=!1,Nn=Nn.filter(e=>e!==this),this.element.remove(),super.destroy()}}function Hn(e,t={}){return!e||"object"!=typeof e||"undefined"!=typeof Node&&e instanceof Node||(e=(t={...e,...t}).message),new In(e,t).open()}const Wn=e=>(t,n={})=>Hn(t,{...n,type:e,icon:n.icon??On(e)}),Pn=Object.assign((e,t={})=>Hn(e,t),{show:Hn,success:Wn("success"),error:Wn("error"),warning:Wn("warning"),info:Wn("info"),closeAll(){for(const e of[...Nn])e.close();Nn=[]}}),Fn="dm-command-palette";function Rn(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgentData?.platform||navigator.platform||navigator.userAgent||"";return/mac|iphone|ipad|ipod/i.test(e)}const Vn={space:" ",esc:"escape",return:"enter",plus:"+",del:"delete"};function qn(e){if(!e||"string"!=typeof e)return null;const t=e.toLowerCase().split("+").map(e=>e.trim());let n=t.pop();if(""===n&&""===t[t.length-1]&&(t.pop(),n="+"),!n)return null;const s=(...e)=>t.some(t=>e.includes(t));return{key:Vn[n]||n,mod:s("mod"),ctrl:s("ctrl","control"),meta:s("meta","cmd","command","super"),alt:s("alt","option","opt"),shift:s("shift")}}function Un(e,t,n=Rn()){if(!t||!e||!e.key)return!1;const s=t.meta||t.mod&&n,i=t.ctrl||t.mod&&!n;if(!!e.metaKey!=!!s||!!e.ctrlKey!=!!i||!!e.altKey!=!!t.alt)return!1;const o=e.key.toLowerCase();return(!(o.length>1||/[a-z]/.test(o))||!!e.shiftKey==!!t.shift)&&(o===t.key||/^[a-z0-9]$/.test(t.key)&&(e.code===`Key${t.key.toUpperCase()}`||e.code===`Digit${t.key}`))}const Kn={enter:"↵",escape:"Esc",backspace:"⌫",delete:"Del",tab:"Tab"," ":"Space",arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→"};function Yn(e,t=Rn()){const n=qn(e);if(!n)return[];const s=[];return(n.ctrl||n.mod&&!t)&&s.push(t?"⌃":"Ctrl"),n.alt&&s.push(t?"⌥":"Alt"),n.shift&&s.push(t?"⇧":"Shift"),(n.meta||n.mod&&t)&&s.push(t?"⌘":"Meta"),s.push(Kn[n.key]||(1===n.key.length?n.key.toUpperCase():n.key.charAt(0).toUpperCase()+n.key.slice(1))),s}function Gn(e,t){if(0===t)return!0;const n=e[t-1],s=e[t];return!/[\p{L}\p{N}]/u.test(n)||n===n.toLowerCase()&&s!==s.toLowerCase()}function Jn(e,t){const n=String(e??"").trim().toLowerCase(),s=String(t??"");if(!n)return{score:0,indices:[]};const i=s.toLowerCase();if(i.length!==s.length)return null;const o=i.indexOf(n);if(o>-1){const e=Array.from({length:n.length},(e,t)=>o+t);let t=1e3-2*o-.5*(s.length-n.length);return 0===o?t+=300:Gn(s,o)&&(t+=150),{score:t,indices:e}}const r=n.replace(/\s+/g,""),a=[];let l=0,c=0,h=-2;for(const e of r){let t=-1;if(i[c]===e&&h===c-1)t=c;else for(let n=c;n<i.length;n++)if(i[n]===e&&(t<0&&(t=n),Gn(s,n))){t=n;break}if(t<0)return null;l+=10,t===h+1&&(l+=15),Gn(s,t)&&(l+=20),l-=.75*Math.min(t-h-1,20),a.push(t),h=t,c=t+1}return{score:l-.1*s.length,indices:a}}function Xn(e,t){const n=Jn(t,e.title),s=e.subtitle?Jn(t,e.subtitle):null;let i=n?n.score+50:-1/0;for(const n of Array.isArray(e.keywords)?e.keywords:[]){const e=Jn(t,n);e&&(i=Math.max(i,.8*e.score))}return s&&(i=Math.max(i,.6*s.score)),i===-1/0?null:{score:i,title:n?n.indices:[],subtitle:s?s.indices:[]}}function Zn(e,t,n){const s=String(t??"");if(!n||!n.length)return void(e.textContent=s);const i=new Set(n);let o="",r=!1;const a=()=>{if(o){if(r){const t=document.createElement("span");t.className=`${Fn}-match`,t.textContent=o,e.appendChild(t)}else e.appendChild(document.createTextNode(o));o=""}};for(let e=0;e<s.length;e++){const t=i.has(e);t!==r&&(a(),r=t),o+=s[e]}a()}const Qn=e=>String(e.id??e.title??""),es=new Set;const ts=a,ns=e=>`${e}:saved`;function ss(e){if(!e||"object"!=typeof e||"function"==typeof e.action||e.children)return null;if("string"!=typeof e.href||!ts(e.href))return null;const t={id:Qn(e),href:e.href};for(const n of["title","subtitle","group","icon","target"])"string"==typeof e[n]&&(t[n]=e[n]);return Array.isArray(e.keywords)&&(t.keywords=e.keywords.filter(e=>"string"==typeof e)),t.id&&t.title?t:null}class is extends C{static componentName="command-palette";static defaults={commands:[],source:null,debounce:150,hotkey:"mod+k",placeholder:"Type a command or search…",label:"Command palette",maxResults:50,recentKey:null,recentLimit:5,recentLabel:"Recent",resolveRecent:null,sourceGroup:null,emptyText:"No results",loadingText:"Searching…",pageLoadingText:"Loading…",errorText:"Something went wrong. Try again.",backLabel:"Back",footer:!0,resultsText:e=>1===e?"1 result":`${e} results`,navigate:null,animationDuration:150,className:"",mac:void 0,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onQuery:null,onBeforeSelect:null,onSelect:null,onRun:null};constructor(e={}){super(is._makeRoot(),e),this._isOpen=!1,this._commands=Array.isArray(this.options.commands)?this.options.commands.slice():[],this._pages=[],this._query="",this._results=[],this._active=-1,this._sourceResults=[],this._loading=!1,this._error=null,this._timers=new Set,this._known=new Map,this._abort=null,this._sourceToken=0,this._build(),this._bind(),this._trap=new ut(this.element,{initialFocus:()=>this._input,returnFocus:!0,allowOutsideClick:!0,register:!1})}static _makeRoot(){const e=document.createElement("div");return e.className=Fn,e.hidden=!0,e}get _mac(){return void 0===this.options.mac?Rn():!!this.options.mac}_build(){const e=this.options,t=this.element;e.className&&t.classList.add(...String(e.className).split(/\s+/).filter(Boolean));const n=Ge(`${Fn}-list`);this._idBase=Ge(`${Fn}-opt`);const s=document.createElement("div");s.className=`${Fn}-backdrop`,this._backdrop=s;const i=document.createElement("div");i.className=`${Fn}-panel`,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label",String(e.label)),this._panel=i;const o=document.createElement("div");o.className=`${Fn}-crumbs`,o.hidden=!0;const r=document.createElement("button");r.type="button",r.className=`${Fn}-back`,r.setAttribute("aria-label",String(e.backLabel));const a=document.createElement("span");a.setAttribute("data-icon","arrow-left"),a.setAttribute("data-icon-size","16"),a.setAttribute("aria-hidden","true"),r.appendChild(a);const l=document.createElement("ol");l.className=`${Fn}-trail`,l.setAttribute("aria-label","Location"),o.append(r,l),this._crumbs=o,this._back=r,this._trail=l;const c=document.createElement("div");c.className=`${Fn}-search`;const h=document.createElement("span");h.className=`${Fn}-search-icon`,h.setAttribute("data-icon","search"),h.setAttribute("data-icon-size","18"),h.setAttribute("aria-hidden","true");const d=document.createElement("input");d.type="text",d.className=`${Fn}-input`,d.setAttribute("role","combobox"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",n),d.setAttribute("aria-autocomplete","list"),d.setAttribute("aria-label",String(e.label)),d.setAttribute("autocomplete","off"),d.setAttribute("autocapitalize","off"),d.setAttribute("spellcheck","false"),d.placeholder=String(e.placeholder??"");const u=document.createElement("span");u.className=`${Fn}-spinner`,u.setAttribute("aria-hidden","true"),u.hidden=!0,c.append(h,d,u),this._input=d,this._spinner=u;const p=document.createElement("div");p.className=`${Fn}-list`,p.id=n,p.setAttribute("role","listbox"),p.setAttribute("aria-label",String(e.label)),this._list=p;const m=document.createElement("div");m.className=`${Fn}-status`,m.hidden=!0,this._status=m;const f=document.createElement("div");if(f.className="sr-only",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true"),this._live=f,i.append(o,c,p,m,f),!1!==e.footer){const e=document.createElement("div");e.className=`${Fn}-footer`,e.setAttribute("aria-hidden","true");const t=(t,n)=>{const s=document.createElement("span");s.className=`${Fn}-hint`;for(const e of t){const t=document.createElement("kbd");t.textContent=e,s.appendChild(t)}s.appendChild(document.createTextNode(` ${n}`)),e.appendChild(s)};t(["↑","↓"],"to move"),t(["↵"],"to run"),t(["⌫"],"to go back"),t(["Esc"],"to close"),i.appendChild(e)}t.append(s,i),document.body.appendChild(t),Ke(t)}_bind(){this._addEventListener(this._input,"input",()=>this._setQuery(this._input.value)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this._back,"click",()=>this.back()),this._addEventListener(this._backdrop,"pointerdown",()=>{this._downOnBackdrop=!0}),this._addEventListener(this.element,"click",e=>{const t=!1!==this._downOnBackdrop;this._downOnBackdrop=!1,e.target===this._backdrop&&t&&this._isOpen&&this.close()}),this._addEventListener(this._panel,"pointerdown",()=>{this._downOnBackdrop=!1}),this._addEventListener(this._list,"pointermove",e=>{const t=e.target.closest?.(`.${Fn}-item`);if(!t||"true"===t.getAttribute("aria-disabled"))return;const n=Number(t.dataset.index);n!==this._active&&this._setActive(n,{scroll:!1})}),this._addEventListener(this._list,"mousedown",e=>e.preventDefault()),this._addEventListener(this._list,"click",e=>{const t=e.target.closest?.(`.${Fn}-item`);if(!t)return;const n=this._results[Number(t.dataset.index)];n&&this._choose(n.command,e)});const e=this._hotkeys();e.length&&(this._hotkeyList=e,es.add(this),this._addEventListener(document,"keydown",t=>{if(t.defaultPrevented||t.repeat||t.isComposing)return;const n=e.find(e=>Un(t,e,this._mac));if(!n)return;const s="function"==typeof t.composedPath?t.composedPath()[0]:t.target;!(n.mod||n.ctrl||n.meta||n.alt)&&function(e){return!(!e||1!==e.nodeType)&&(!!e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))}(s)||(t.preventDefault(),this.toggle())}))}_hotkeys(){const e=this.options.hotkey;return e?(Array.isArray(e)?e:[e]).map(qn).filter(Boolean):[]}_later(e,t){const n=setTimeout(()=>{this._timers.delete(n),e()},t);return this._timers.add(n),n}_clearTimer(e){e&&(clearTimeout(e),this._timers.delete(e))}_duration(){return Xe()?0:qe(this.options.animationDuration,150)}open(e){if(this._destroyed)return this;if(this._isOpen)return"string"==typeof e&&this._setQuery(e,{write:!0}),this;if(!1===this._fire("beforeOpen",this))return this;this._isOpen=!0,this._clearTimer(this._hideTimer),this.element.isConnected||document.body.appendChild(this.element),this._pages=[],this._sourceResults=[],this._error=null,this._input.value="string"==typeof e?e:"",this._query=this._input.value,this.element.hidden=!1,this._input.setAttribute("aria-expanded","true");const t=this._duration();return this.element.style.setProperty("--dm-command-palette-duration",`${t}ms`),t&&"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>requestAnimationFrame(()=>{this._isOpen&&this.element.classList.add("is-open")})):this.element.classList.add("is-open"),this._renderCrumbs(),this._update({resetActive:!0}),this._usesSource()&&this._runSource(this._query),this._trap.activate(),this._fire("open",this),this}close(){if(!this._isOpen)return this;if(!this._mayClose(this))return this;this._isOpen=!1,this._cancelSource(),this.element.classList.remove("is-open"),this._input.setAttribute("aria-expanded","false"),this._input.removeAttribute("aria-activedescendant"),this._trap.deactivate();const e=()=>{this._hideTimer=null,this._isOpen||(this.element.hidden=!0)},t=this._duration();return t?this._hideTimer=this._later(e,t):e(),this._fire("close",this),this}toggle(...e){return this._isOpen?this.close():this.open(...e)}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setCommands(e){return this._commands=Array.isArray(e)?e.slice():[],this.options.commands=this._commands,this._refresh(),this}addCommands(e){for(const t of Array.isArray(e)?e:[e]){if(!t)continue;const e=this._commands.findIndex(e=>Qn(e)===Qn(t));e>-1?this._commands[e]=t:this._commands.push(t)}return this._refresh(),this}removeCommand(e){return this._commands=this._commands.filter(t=>Qn(t)!==String(e)),this.options.commands=this._commands,this._refresh(),this}getCommands(){return this._commands.slice()}back(){if(!this._pages.length)return!1;const e=this._pages.pop();return e.abort?.abort(),this._input.value=e.query||"",this._query=this._input.value,this._renderCrumbs(),this._update({resetActive:!0}),!this._pages.length&&this._usesSource()&&this._runSource(this._query),this._input.focus({preventScroll:!0}),!0}query(){return this._query}recent(){if(!this.options.recentKey)return[];const e=me.get(this.options.recentKey,[]);return Array.isArray(e)?e.map(String):[]}clearRecent(){return this.options.recentKey&&(me.remove(this.options.recentKey),me.remove(ns(this.options.recentKey))),this._refresh(),this}destroy(){if(this._destroyed)return;this._isOpen&&this._forcedClose(),this._destroyed=!0,es.delete(this),this._cancelSource();for(const e of this._timers)clearTimeout(e);this._timers.clear(),clearTimeout(this._liveTimer),this._trap.destroy();const e=this.element;super.destroy(),e.remove()}_applyOptions(){Array.isArray(this.options.commands)&&this.options.commands!==this._commands&&(this._commands=this.options.commands.slice()),this._input.placeholder=String(this._currentPage()?.command.placeholder??this.options.placeholder??""),this._refresh()}_refresh(){this._isOpen&&this._update()}_currentPage(){return this._pages[this._pages.length-1]||null}_usesSource(){return!this._pages.length&&"function"==typeof this.options.source}_setQuery(e,t={}){t.write&&(this._input.value=e),(e!==this._query||t.write)&&(this._query=e,this._fire("query",e,this),this._update({resetActive:!0}),this._usesSource()&&(this._cancelSource(),this._loading=!0,this._renderStatus(),this._debounceTimer=this._later(()=>this._runSource(e),qe(this.options.debounce,150))))}_cancelSource(){this._clearTimer(this._debounceTimer),this._debounceTimer=null,this._abort&&this._abort.abort(),this._abort=null,this._loading=!1,this._sourceToken+=1}_runSource(e){this._cancelSource();const t=this._sourceToken,n="function"==typeof AbortController?new AbortController:null;let s;this._abort=n,this._loading=!0,this._error=null,this._renderStatus();try{s=Promise.resolve(this.options.source(e,{signal:n?.signal,palette:this}))}catch(e){s=Promise.reject(e)}s.then(e=>{t===this._sourceToken&&this._isOpen&&(this._loading=!1,this._abort=null,this._sourceResults=Array.isArray(e)?e:[],this._update())},e=>{t===this._sourceToken&&this._isOpen&&(this._loading=!1,this._abort=null,e&&"AbortError"===e.name||(this._error=e||new Error("source failed"),this._sourceResults=[],this._update()))})}_findById(e,t=this._commands,n=0){for(const s of t){if(Qn(s)===e)return s;if(n<8&&Array.isArray(s.children)){const t=this._findById(e,s.children,n+1);if(t)return t}}return null}_remember(e){this._known.set(Qn(e),e);const t=this.options.recentKey;if(!t)return;const n=Qn(e),s=[n,...this.recent().filter(e=>e!==n)].slice(0,Math.max(1,qe(this.options.recentLimit,5)));me.set(t,s);const i=this._saved(),o={};for(const e of s)i[e]&&(o[e]=i[e]);const r=this._findById(n)?null:ss(e);r?o[n]=r:delete o[n],Object.keys(o).length?me.set(ns(t),o):me.remove(ns(t))}_saved(){const e=this.options.recentKey?me.get(ns(this.options.recentKey),null):null;return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}_restore(e){let t=null;if("function"==typeof this.options.resolveRecent)try{t=this.options.resolveRecent(e)||null,t&&Qn(t)!==e&&(t=null)}catch(e){t=null}if(!t){const n=ss(this._saved()[e]);n&&Qn(n)===e&&(t=n)}return t&&this._known.set(e,t),t}_compute(){const e=this.options,t=this._currentPage(),n=this._query.trim(),s=Math.max(1,qe(e.maxResults,50)),i=new Map,o=(e,t,n)=>{const s=null==e?"":String(e);i.has(s)||i.set(s,{name:s,items:[],best:-1/0});const o=i.get(s);o.items.push({command:t,match:n}),o.best=Math.max(o.best,n?n.score:0)},r=t?t.commands||[]:this._commands,a=new Set;if(!n&&!t&&e.recentKey)for(const t of this.recent()){const n=this._findById(t)||this._known.get(t)||this._restore(t);n&&!n.hidden&&(o(e.recentLabel,n,null),a.add(n))}const l=[];for(const e of r){if(!e||e.hidden||a.has(e))continue;if(!n){l.push({command:e,match:null});continue}const t=Xn(e,n);t&&l.push({command:e,match:t})}n&&l.sort((e,t)=>t.match.score-e.match.score);for(const{command:e,match:t}of l)o(e.group,e,t);let c=[...i.values()];if(n&&c.sort((e,t)=>t.best-e.best),!t&&this._sourceResults.length){const t=new Map;for(const s of this._sourceResults){if(!s)continue;const i=s.group??e.sourceGroup,o=null==i?"":String(i);t.has(o)||t.set(o,{name:o,items:[],best:0});const r=n?Jn(n,s.title):null,a=n&&s.subtitle?Jn(n,s.subtitle):null;t.get(o).items.push({command:s,match:{score:0,title:r?r.indices:[],subtitle:a?a.indices:[]}})}c=c.concat([...t.values()])}let h=s;const d=[];for(const e of c){if(h<=0)break;const t=e.items.slice(0,h);h-=t.length,t.length&&d.push({name:e.name,items:t})}return d}_update(e={}){const t=this._results[this._active]?.command,n=this._compute();this._renderList(n);let s=-1;!e.resetActive&&t&&(s=this._results.findIndex(e=>e.command===t)),(s<0||this._results[s]?.command.disabled)&&(s=this._nextEnabled(-1,1,!1)),this._setActive(s,{scroll:!0}),this._renderStatus()}_nextEnabled(e,t,n=!0){const s=this._results.length;if(!s)return-1;let i=e;for(let e=0;e<s;e++){if(i+=t,i>=s){if(!n)return-1;i=0}if(i<0){if(!n)return-1;i=s-1}if(!this._results[i].command.disabled)return i}return-1}_setActive(e,t={}){const n=this._list.querySelector(`.${Fn}-item.is-active`);n&&(n.classList.remove("is-active"),n.setAttribute("aria-selected","false")),this._active=e;const s=e>-1?this._results[e]?.row:null;s?(s.classList.add("is-active"),s.setAttribute("aria-selected","true"),this._input.setAttribute("aria-activedescendant",s.id),!1!==t.scroll&&"function"==typeof s.scrollIntoView&&s.scrollIntoView({block:"nearest"})):this._input.removeAttribute("aria-activedescendant")}_renderList(e){const t=this._list;t.replaceChildren(),this._results=[];const n=this._mac;let s=0;for(const i of e){let e=t;if(i.name){const n=document.createElement("div");n.className=`${Fn}-group`,n.setAttribute("role","group");const o=document.createElement("div");o.className=`${Fn}-group-heading`,o.id=`${this._idBase}-g${s}`,o.setAttribute("aria-hidden","true"),o.textContent=i.name,n.setAttribute("aria-labelledby",o.id),n.appendChild(o),t.appendChild(n),e=n}for(const{command:t,match:o}of i.items){const i=this._results.length,r=this._renderItem(t,o,i,n);e.appendChild(r),this._results.push({command:t,match:o,row:r}),s+=1}}Ke(t);const i=this._results.length;t.hidden=!i,this._input.setAttribute("aria-expanded",String(this._isOpen&&i>0))}_renderItem(e,t,n,s){const i=document.createElement("div");i.className=`${Fn}-item`,i.id=`${this._idBase}-${n}`,i.dataset.index=String(n),i.setAttribute("role","option"),i.setAttribute("aria-selected","false"),e.disabled&&i.setAttribute("aria-disabled","true");const o=document.createElement("span");o.className=`${Fn}-icon`,o.setAttribute("aria-hidden","true"),e.icon&&(o.setAttribute("data-icon",String(e.icon)),o.setAttribute("data-icon-size","16")),i.appendChild(o);const r=document.createElement("span");r.className=`${Fn}-text`;const a=document.createElement("span");if(a.className=`${Fn}-title`,Zn(a,e.title,t?.title),r.appendChild(a),e.subtitle){const n=document.createElement("span");n.className=`${Fn}-subtitle`,Zn(n,e.subtitle,t?.subtitle),r.appendChild(n)}if(i.appendChild(r),e.shortcut){const t=document.createElement("span");t.className=`${Fn}-shortcut`,t.setAttribute("aria-hidden","true");for(const n of Yn(e.shortcut,s)){const e=document.createElement("kbd");e.textContent=n,t.appendChild(e)}i.appendChild(t);const n=function(e,t){const n=qn(e);if(!n)return"";const s=[];(n.ctrl||n.mod&&!t)&&s.push("Control"),n.alt&&s.push("Alt"),n.shift&&s.push("Shift"),(n.meta||n.mod&&t)&&s.push("Meta");const i=" "===n.key?"Space":n.key;return s.push(1===i.length?i.toUpperCase():i.charAt(0).toUpperCase()+i.slice(1)),s.join("+")}(e.shortcut,s);n&&i.setAttribute("aria-keyshortcuts",n)}if(e.children){const e=document.createElement("span");e.className=`${Fn}-more`,e.setAttribute("aria-hidden","true"),e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-icon-size","16"),i.appendChild(e)}return i}_renderCrumbs(){const e=this._currentPage();this._crumbs.hidden=!e,this._trail.replaceChildren();for(const e of this._pages){const t=document.createElement("li");t.textContent=String(e.command.title??""),this._trail.appendChild(t)}const t=this._trail.lastElementChild;t&&t.setAttribute("aria-current","page"),this._input.placeholder=String(e?.command.placeholder??this.options.placeholder??"")}_renderStatus(){const e=this.options,t=this._currentPage(),n=t?t.loading:this._loading&&this._usesSource(),s=t?t.error:this._error,i=this._results.length;this._spinner.hidden=!n,this._list.setAttribute("aria-busy",String(!!n));let o="",r="";s?(o=String(e.errorText),r="error"):!i&&n?(o=String(t?e.pageLoadingText:e.loadingText),r="loading"):i||(o=String(e.emptyText),r="empty"),this._status.textContent=o,this._status.hidden=!o,this._status.dataset.state=r,this.element.dataset.state=r||"results",clearTimeout(this._liveTimer);const a=s||n&&!i?o:i?"function"==typeof e.resultsText?e.resultsText(i):`${i}`:o;this._liveTimer=setTimeout(()=>{this._isOpen&&(this._live.textContent=a)},250)}_onKeyDown(e){if(e.isComposing)return;const t=e.target===this._input;switch(e.key){case"Escape":return e.preventDefault(),e.stopPropagation(),void(this.back()||this.close());case"ArrowDown":case"ArrowUp":if(!t)return;return e.preventDefault(),void this._setActive(this._nextEnabled(this._active,"ArrowDown"===e.key?1:-1));case"Home":case"End":if(!t||e.shiftKey||!this._results.length)return;return e.preventDefault(),void this._setActive("Home"===e.key?this._nextEnabled(-1,1):this._nextEnabled(this._results.length,-1));case"Enter":{if(!t)return;e.preventDefault();const n=this._results[this._active];return void(n&&this._choose(n.command,e))}case"Backspace":return void(t&&""===this._input.value&&this._pages.length&&(e.preventDefault(),this.back()))}}_choose(e,t){e&&!e.disabled&&!1!==this._fire("beforeSelect",e,this)&&(this._fire("select",e,this),e.children?this._enter(e):this._run(e,t))}_enter(e){this._cancelSource(),this._sourceResults=[],this._error=null;const t={command:e,query:this._query,commands:[],loading:!1,error:null,abort:null};if(this._pages.push(t),this._input.value="",this._query="",this._renderCrumbs(),Array.isArray(e.children))t.commands=e.children;else if("function"==typeof e.children){let n;t.loading=!0,t.abort="function"==typeof AbortController?new AbortController:null;try{n=Promise.resolve(e.children(e,{signal:t.abort?.signal,palette:this}))}catch(e){n=Promise.reject(e)}n.then(e=>{t.loading=!1,t.commands=Array.isArray(e)?e:[],this._currentPage()===t&&this._update({resetActive:!0})},e=>{t.loading=!1,e&&"AbortError"===e.name||(t.error=e||new Error("children failed"),this._currentPage()===t&&this._update({resetActive:!0}))})}this._update({resetActive:!0}),this._input.focus({preventScroll:!0})}_run(e,t){if(this._remember(e),!0!==e.keepOpen&&this.close(),this._fire("run",e,this),"function"==typeof e.action)e.action(e,this,t);else if(e.href){const n=ts(e.href),s="_blank"===e.target||!(!t||!t.metaKey&&!t.ctrlKey);n&&("function"==typeof this.options.navigate?this.options.navigate(n,{newTab:s,command:e}):s?window.open(n,"_blank","noopener"):window.location.assign(n))}this._isOpen&&this._update()}}const os="split-pane:";function rs(e,t,n){const s=Array.isArray(e)?e[t]:e;return null==s?n:s}const as=e=>Math.round(1e3*e)/1e3;class ls extends C{static componentName="split-pane";static defaults={direction:"horizontal",sizes:null,minSize:0,maxSize:null,gutterSize:8,snapOffset:0,collapsible:!1,collapsedSize:0,collapseButton:!1,persistKey:null,cursor:null,disabled:!1,step:1,largeStep:10,gutterLabel:"Resize panes",onBeforeDrag:null,onDragStart:null,onDrag:null,onDragEnd:null,onResize:null,onCollapse:null,onExpand:null};constructor(e,t={}){super(e,t),this.element&&(this._gutters=[],this._drag=null,this._collapsed=[],this._restoreTo=[],this._addedIds=[],this._frame=0,this._containerStyle=this.element.getAttribute("style"),this.panes=Array.from(this.element.children),this._paneStyles=this.panes.map(e=>e.getAttribute("style")),this._build())}get horizontal(){return"vertical"!==this.options.direction}_build(){const e=this.element;e.classList.add("dm-split",this.horizontal?"dm-split-horizontal":"dm-split-vertical"),this.panes.forEach((e,t)=>{e.classList.add("dm-split-pane"),e.id||(e.id=Ge("dm-split-pane"),this._addedIds.push(e)),t>0&&this._gutters.push(this._makeGutter(t-1))}),this._gutters.forEach((t,n)=>e.insertBefore(t,this.panes[n+1]));let t=this._normalise(this.options.sizes);const n=this._load();n&&(t=n.sizes,this._collapsed=n.collapsed,this._restoreTo=n.restoreTo),this._sizes=t,this._apply(this._clampAll(t)),this._applyOptions(),"undefined"!=typeof ResizeObserver&&(this._observer=new ResizeObserver(()=>{this._frame||this._drag||(this._frame=requestAnimationFrame(()=>{this._frame=0,this.element&&this._apply(this._clampAll(this._sizes))}))}),this._observer.observe(e))}_makeGutter(e){const t=document.createElement("div");return t.className="dm-split-gutter",t.setAttribute("role","separator"),t.setAttribute("aria-orientation",this.horizontal?"vertical":"horizontal"),t.setAttribute("aria-controls",this.panes[e].id),t.dataset.index=String(e),this._addEventListener(t,"pointerdown",t=>this._onPointerDown(t,e)),this._addEventListener(t,"keydown",t=>this._onKey(t,e)),this._addEventListener(t,"dblclick",t=>{this.options.disabled||t.target.closest(".dm-split-toggle")||this._toggleFromGutter(e)}),t}_applyOptions(){if(!this._gutters)return;const e=this.options,t=Ve(e.disabled),n=`${Math.max(0,qe(e.gutterSize,8))}px`;this.element.classList.toggle("dm-split-disabled",t),this._gutters.forEach((s,i)=>{s.style.flex=`0 0 ${n}`,s.style.cursor=t?"":e.cursor||(this.horizontal?"col-resize":"row-resize"),s.setAttribute("aria-label",e.gutterLabel||"Resize panes"),s.tabIndex=t?-1:0,t?s.setAttribute("aria-disabled","true"):s.removeAttribute("aria-disabled"),this._syncButton(s,i)}),this._apply(this._clampAll(this._sizes))}_syncButton(e,t){const n=Ve(this.options.collapseButton)&&null!==this._collapseTarget(t);let s=e.querySelector(".dm-split-toggle");n?(s||(s=document.createElement("button"),s.type="button",s.className="dm-split-toggle",s.tabIndex=-1,s.setAttribute("aria-hidden","true"),this._addEventListener(s,"pointerdown",e=>e.stopPropagation()),this._addEventListener(s,"click",e=>{e.stopPropagation(),this.options.disabled||this._toggleFromGutter(t)}),e.appendChild(s)),s.disabled=Ve(this.options.disabled)):s&&s.remove()}_normalise(e){const t=this.panes.length;if(!t)return[];const n=Array.isArray(e)&&e.length===t?e.map(e=>Math.max(0,parseFloat(e)||0)):null,s=n?n.reduce((e,t)=>e+t,0):0;return!n||s<=0?Array(t).fill(100/t):n.map(e=>e/s*100)}_available(){const e=this.element;let t=this.horizontal?e.clientWidth:e.clientHeight;if(t>0){const n=getComputedStyle(e);t-=this.horizontal?(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0):(parseFloat(n.paddingTop)||0)+(parseFloat(n.paddingBottom)||0)}else{const n=e.getBoundingClientRect();t=this.horizontal?n.width:n.height}return Math.max(0,t-this._gutters.length*Math.max(0,qe(this.options.gutterSize,8)))}_toPercent(e,t,n){if(null==e||""===e)return n;const s=String(e).trim();if(s.endsWith("%"))return Math.min(100,Math.max(0,parseFloat(s)||0));const i=parseFloat(s);return Number.isFinite(i)?t<=0?i>0?n:0:Math.min(100,Math.max(0,i/t*100)):n}_limits(e,t=this._available()){const n=this.options,s=!!this._collapsed[e],i=s?this._toPercent(rs(n.collapsedSize,e,0),t,0):this._toPercent(rs(n.minSize,e,0),t,0),o=s?i:this._toPercent(rs(n.maxSize,e,null),t,100);return{min:i,max:Math.max(i,o)}}_clampAll(e){const t=this._available(),n=e.slice();for(let e=0;e<2;e++)for(let e=0;e<n.length;e++){const{min:s,max:i}=this._limits(e,t),o=Math.min(i,Math.max(s,n[e])),r=o-n[e];if(!r)continue;let a=r;for(const s of this._neighbours(e)){if(!a)break;const e=this._limits(s,t),i=Math.min(e.max,Math.max(e.min,n[s]-a));a-=n[s]-i,n[s]=i}n[e]=o-a}return n}_neighbours(e){const t=[];for(let n=1;n<this.panes.length;n++)e+n<this.panes.length&&t.push(e+n),e-n>=0&&t.push(e-n);return t}_apply(e){this._sizes=e.map(as);const t=this._gutters.length*Math.max(0,qe(this.options.gutterSize,8));this.panes.forEach((e,n)=>{const s=this._sizes[n];e.style.flex=`0 0 calc(${s}% - ${as(t*s/100)}px)`,e.classList.toggle("dm-split-collapsed",!!this._collapsed[n])}),this._syncAria()}_syncAria(){const e=this._available();this._gutters.forEach((t,n)=>{const s=this._limits(n,e),i=this._limits(n+1,e),o=this._sizes[n]+this._sizes[n+1];t.setAttribute("aria-valuenow",String(Math.round(this._sizes[n]))),t.setAttribute("aria-valuemin",String(Math.round(Math.max(s.min,o-i.max)))),t.setAttribute("aria-valuemax",String(Math.round(Math.min(s.max,o-i.min))))})}_moveBoundary(e,t,{snap:n=!1}={}){const s=this._available(),i=this._limits(e,s),o=this._limits(e+1,s),r=this._sizes[e]+this._sizes[e+1],a=Math.max(i.min,r-o.max),l=Math.min(i.max,r-o.min);let c=Math.min(l,Math.max(a,t));if(n&&s>0){const e=Math.max(0,qe(this.options.snapOffset,0))/s*100;c-i.min<=e?c=Math.max(a,i.min):r-c-o.min<=e&&(c=Math.min(l,r-o.min))}const h=this._sizes.slice();h[e]=c,h[e+1]=r-c;const d=Math.abs(h[e]-this._sizes[e])>1e-6;return d&&(this._apply(h),this._fire("resize",this.getSizes())),d}_onPointerDown(e,t){if(this.options.disabled||this._drag)return;if(void 0!==e.button&&0!==e.button)return;if(!1===this._fire("beforedrag",t,e))return;e.preventDefault();const n=this._gutters[t],s=this.horizontal&&"rtl"===getComputedStyle(this.element).direction;this._drag={index:t,pointerId:e.pointerId,start:this.horizontal?e.clientX:e.clientY,startSize:this._sizes[t],available:this._available(),sign:s?-1:1,gutter:n};try{n.setPointerCapture?.(e.pointerId)}catch{}this.element.classList.add("dm-split-dragging"),n.classList.add("is-dragging"),n.addEventListener("pointermove",this._onPointerMove),n.addEventListener("pointerup",this._onPointerUp),n.addEventListener("pointercancel",this._onPointerUp),n.addEventListener("lostpointercapture",this._onPointerUp),this._fire("dragstart",this.getSizes(),t)}_onPointerMove=e=>{const t=this._drag;if(!t||void 0!==t.pointerId&&void 0!==e.pointerId&&e.pointerId!==t.pointerId)return;if(t.available<=0)return;const n=((this.horizontal?e.clientX:e.clientY)-t.start)*t.sign;this._uncollapseForDrag(t.index);const s=t.startSize+n/t.available*100;this._moveBoundary(t.index,s,{snap:!0})&&this._fire("drag",this.getSizes(),t.index)};_onPointerUp=e=>{const t=this._drag;if(!t)return;this._drag=null;const n=t.gutter;n.removeEventListener("pointermove",this._onPointerMove),n.removeEventListener("pointerup",this._onPointerUp),n.removeEventListener("pointercancel",this._onPointerUp),n.removeEventListener("lostpointercapture",this._onPointerUp);try{void 0!==e?.pointerId&&n.releasePointerCapture?.(e.pointerId)}catch{}this.element.classList.remove("dm-split-dragging"),n.classList.remove("is-dragging"),this._save(),this._fire("dragend",this.getSizes(),t.index)};_uncollapseForDrag(e){for(const t of[e,e+1])this._collapsed[t]&&(this._collapsed[t]=!1,this._restoreTo[t]=void 0,this._fire("expand",t))}_onKey(e,t){if(this.options.disabled)return;const n=this.horizontal&&"rtl"===getComputedStyle(this.element).direction,s=this.horizontal?n?"ArrowRight":"ArrowLeft":"ArrowUp",i=this.horizontal?n?"ArrowLeft":"ArrowRight":"ArrowDown",o=e.shiftKey?qe(this.options.largeStep,10):qe(this.options.step,1);let r=null;if(e.key===s)r=this._sizes[t]-o;else if(e.key===i)r=this._sizes[t]+o;else if("Home"===e.key)r=-1/0;else{if("End"!==e.key){if("Enter"===e.key){if(null===this._collapseTarget(t))return;return e.preventDefault(),void this._toggleFromGutter(t)}return}r=1/0}e.preventDefault(),this._uncollapseForDrag(t),this._moveBoundary(t,r)&&this._save()}_isCollapsible(e){const t=this.options.collapsible;return Array.isArray(t)?Ve(t[e]):Ve(t)}_collapseTarget(e){return this._collapsed[e]&&this._isCollapsible(e)?e:this._collapsed[e+1]&&this._isCollapsible(e+1)?e+1:this._isCollapsible(e)?e:this._isCollapsible(e+1)?e+1:null}_toggleFromGutter(e){const t=this._collapseTarget(e);null!==t&&(this._collapsed[t]?this.expand(t):this.collapse(t))}collapse(e){if(!this.panes?.[e]||this._collapsed[e])return this;const t=e+1<this.panes.length?e+1:e-1;if(t<0)return this;this._restoreTo[e]=this._sizes[e],this._collapsed[e]=!0;const n=this._limits(e).min,s=this._sizes.slice();return s[t]+=s[e]-n,s[e]=n,this._apply(this._clampAll(s)),this._save(),this._fire("resize",this.getSizes()),this._fire("collapse",e),this}expand(e){if(!this.panes?.[e]||!this._collapsed[e])return this;this._collapsed[e]=!1;const t=e+1<this.panes.length?e+1:e-1,n=this._restoreTo[e]??100/this.panes.length;this._restoreTo[e]=void 0;const s=this._sizes.slice(),i=this._limits(t),o=Math.max(0,Math.min(n-s[e],s[t]-i.min));return s[e]+=o,s[t]-=o,this._apply(this._clampAll(s)),this._save(),this._fire("resize",this.getSizes()),this._fire("expand",e),this}isCollapsed(e){return!!this._collapsed?.[e]}getSizes(){return(this._sizes||[]).map(e=>Math.round(100*e)/100)}setSizes(e){return this.panes?.length?(this._collapsed=[],this._restoreTo=[],this._apply(this._clampAll(this._normalise(e))),this._save(),this._fire("resize",this.getSizes()),this):this}_load(){const e=this.options.persistKey;if(!e)return null;let t=null;try{t=me.get(os+e)}catch{return null}const n=Array.isArray(t)?t:t?.sizes;return Array.isArray(n)&&n.length===this.panes.length&&n.every(Number.isFinite)?{sizes:this._normalise(n),collapsed:Array.isArray(t?.collapsed)?t.collapsed.map(Boolean):[],restoreTo:Array.isArray(t?.restoreTo)?t.restoreTo.map(e=>Number.isFinite(e)?e:void 0):[]}:null}_save(){const e=this.options.persistKey;if(e)try{me.set(os+e,{sizes:this.getSizes(),collapsed:this.panes.map((e,t)=>!!this._collapsed[t]),restoreTo:this.panes.map((e,t)=>this._restoreTo[t]??null)})}catch{}}destroy(){this._drag&&this._onPointerUp({}),this._frame&&cancelAnimationFrame(this._frame),this._observer?.disconnect(),this._observer=null;for(const e of this._gutters||[])e.remove();this._gutters=[],(this.panes||[]).forEach((e,t)=>{e.classList.remove("dm-split-pane","dm-split-collapsed");const n=this._paneStyles[t];null===n?e.removeAttribute("style"):e.setAttribute("style",n)});for(const e of this._addedIds||[])e.removeAttribute("id");this.element&&(this.element.classList.remove("dm-split","dm-split-horizontal","dm-split-vertical","dm-split-dragging","dm-split-disabled"),null===this._containerStyle||void 0===this._containerStyle?this.element.removeAttribute("style"):this.element.setAttribute("style",this._containerStyle)),super.destroy(),this._onDestroy?.()}}class cs extends C{static componentName="virtual-list";static defaults={items:null,count:0,getItem:null,itemHeight:40,estimatedItemHeight:40,overscan:4,render:null,safe:!0,keyField:null,label:null,loadMore:null,threshold:200,loadingTemplate:null,endTemplate:null,errorTemplate:null,rowClass:"",onRender:null,onScroll:null,onLoadMore:null,onLoaded:null,onEnd:null,onError:null,onItemClick:null};constructor(e,t={}){super(e,t),this.element&&(this._id=Ge("dm-vlist"),this._rows=new Map,this._rowByEl=new WeakMap,this._heights=new Map,this._offsets=null,this._dirtyFrom=0,this._active=-1,this._focusWithin=!1,this._frame=0,this._range={start:0,end:-1},this._load={busy:!1,done:!1,error:null,page:0,gen:0},this._statusHeight=0,this._setData(this.options.items,this.options.count,this.options.getItem),this._build(),this._render())}_setData(e,t,n){Array.isArray(e)||e&&"number"!=typeof e&&"number"==typeof e.length?(this._items=Array.from(e),this._count=null,this._getItem=null):"function"==typeof n?(this._items=null,this._count=Math.max(0,Math.floor(qe(t,0))),this._getItem=n):(this._items=[],this._count=null,this._getItem=null),this._dirtyFrom=0}get count(){return this._items?this._items.length:this._count}_itemAt(e){return this._items?this._items[e]:this._getItem(e)}_keyOf(e,t){const n=this.options.keyField;return"function"==typeof n?n(e,t):n&&null!==e&&"object"==typeof e&&void 0!==e[n]?e[n]:t}get _fixed(){const e=this.options.itemHeight;return"auto"!==e&&qe(e,0)>0}get _rowHeight(){return qe(this.options.itemHeight,40)}get _estimate(){return Math.max(1,qe(this.options.estimatedItemHeight,40))}_syncOffsets(){const e=this.count;if(!this._offsets||this._offsets.length!==e+1){const t=new Float64Array(e+1);this._offsets=t,this._dirtyFrom=0}if(this._dirtyFrom>e)return;const t=this._offsets,n=this._estimate;for(let s=this._dirtyFrom;s<e;s++){const e=this._heights.get(this._keyOf(this._itemAt(s),s));t[s+1]=t[s]+(void 0===e?n:e)}this._dirtyFrom=e+1}_dirty(e){this._dirtyFrom=Math.min(this._dirtyFrom,Math.max(0,e))}_offset(e){return this._fixed?e*this._rowHeight:(this._syncOffsets(),this._offsets[Math.min(Math.max(0,e),this.count)])}_heightOf(e){return this._fixed?this._rowHeight:this._offset(e+1)-this._offset(e)}_total(){return this._offset(this.count)}_indexAt(e){const t=this.count;if(!t)return 0;if(this._fixed)return Math.min(t-1,Math.max(0,Math.floor(e/this._rowHeight)));this._syncOffsets();const n=this._offsets;let s=0,i=t-1;for(;s<i;){const t=s+i+1>>1;n[t]<=e?s=t:i=t-1}return s}_viewport(){return Math.max(0,this.element.clientHeight||0)}getVisibleRange(){if(!this.count||!this.element)return{start:0,end:-1};const e=this.element.scrollTop;return{start:this._indexAt(e),end:this._indexAt(e+Math.max(1,this._viewport())-1)}}_build(){const e=this.element;for(this._original=document.createDocumentFragment();e.firstChild;)this._original.appendChild(e.firstChild);e.classList.add("dm-vlist"),e.classList.toggle("dm-vlist-fixed",this._fixed),this._spacer=document.createElement("div"),this._spacer.className="dm-vlist-spacer",this._spacer.setAttribute("aria-hidden","true"),this._list=document.createElement("div"),this._list.className="dm-vlist-items",this._list.id=this._id,this._list.setAttribute("role","list"),this._list.tabIndex=-1,this.options.label&&this._list.setAttribute("aria-label",this.options.label),this._status=document.createElement("div"),this._status.className="dm-vlist-status",this._status.setAttribute("role","status"),this._status.setAttribute("aria-live","polite"),this._status.hidden=!0,e.append(this._spacer,this._list,this._status),this._addEventListener(e,"scroll",this._onScroll),this._addEventListener(this._list,"click",this._onClick),this._addEventListener(this._list,"keydown",this._onKey),this._addEventListener(this._list,"focusin",this._onFocusIn),this._addEventListener(this._list,"focusout",this._onFocusOut),this._addEventListener(this._status,"click",e=>{e.target.closest?.("[data-vlist-retry]")&&this.retry()}),"undefined"!=typeof ResizeObserver&&(this._hostObserver=new ResizeObserver(()=>this._schedule()),this._hostObserver.observe(e),this._rowObserver=new ResizeObserver(e=>this._onRowResize(e)))}_schedule(){if(this._frame||!this.element)return;const e="function"==typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,16);this._frame=e(()=>{this._frame=0,this.element&&this._render()})}_onScroll=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame?requestAnimationFrame:e=>setTimeout(e,16);this._frame=e(()=>{this._frame=0,this.element&&(this._render(),this._fire("scroll",this.getVisibleRange()))})};_makeRow(){const e=document.createElement("div");return e.className="dm-vlist-row"+(this.options.rowClass?` ${this.options.rowClass}`:""),e.setAttribute("role","listitem"),e.tabIndex=-1,e}_fillRow(e,t,n){const s=this.options.render;"function"==typeof s?Ue(e,s(t,n),{safe:!1!==this.options.safe&&"false"!==this.options.safe}):e.textContent=null==t?"":String("object"==typeof t?t.label??t.title??t.name??"":t)}_render(e=!1){if(!this.element||!this._list)return;const t=this._focusWithin&&this._list.contains(document.activeElement);let n=!1;for(let t=0;t<3;t++){const s=this._renderPass(e&&0===t);if(s.range&&(n=!0),!s.resized)break}const s=this.count;if(this._active>=s&&(this._active=s-1),this._syncTabStop(),t&&!this._list.contains(document.activeElement)){(this._rowFor(this._active)||this._list).focus({preventScroll:!0})}n&&this._fire("render",{...this._range}),this._maybeLoad()}_renderPass(e){const t=this.count,n=this._fixed,s=this.element.scrollTop,i=this._viewport(),o=Math.max(0,Math.floor(qe(this.options.overscan,4)));let r=0,a=-1;if(t){const e=this._indexAt(s),n=this._indexAt(s+Math.max(1,i)-1);r=Math.max(0,e-o),a=Math.min(t-1,n+o)}const l=new Map;for(let e=r;e<=a;e++)l.set(this._keyOf(this._itemAt(e),e),e);this._focusWithin&&this._active>=0&&this._active<t&&(this._active<r||this._active>a)&&l.set(this._keyOf(this._itemAt(this._active),this._active),this._active);for(const[e,t]of this._rows)l.has(e)||(this._rowObserver?.unobserve(t.el),t.el.remove(),this._rows.delete(e));const c=this.options.loadMore&&!this._load.done?-1:t,h=[],d=document.createDocumentFragment();for(const[t,s]of l){const i=this._itemAt(s);let o=this._rows.get(t);if(o?(e||o.item!==i||o.index!==s)&&(this._fillRow(o.el,i,s),o.item=i,n||h.push(o)):(o={el:this._makeRow(),index:-1,item:void 0,key:t},this._rows.set(t,o),this._rowByEl.set(o.el,o),this._fillRow(o.el,i,s),o.item=i,d.appendChild(o.el),h.push(o)),o.index!==s&&(o.index=s,o.el.dataset.index=String(s),o.el.setAttribute("aria-posinset",String(s+1))),o.el.getAttribute("aria-setsize")!==String(c)&&o.el.setAttribute("aria-setsize",String(c)),n){const e=`${this._rowHeight}px`;o.el.style.height!==e&&(o.el.style.height=e)}}d.firstChild&&this._list.appendChild(d);let u=!1;if(!n&&h.length){let e=0;const n=t?this._indexAt(s):0,i=h.map(e=>e.el.offsetHeight);h.forEach((t,s)=>{const o=i[s];if(!o)return;const r=this._heightOf(t.index);Math.abs(o-r)<.5?this._heights.set(t.key,o):(t.index<n&&(e+=o-r),this._heights.set(t.key,o),this._dirty(t.index),u=!0)});for(const e of h)this._rowObserver?.observe(e.el);e&&(this.element.scrollTop=s+e)}for(const e of this._rows.values()){const t=`translateY(${this._offset(e.index)}px)`;e.el.style.transform!==t&&(e.el.style.transform=t)}this._placeStatus();const p=r!==this._range.start||a!==this._range.end;return this._range={start:r,end:a},{range:p,resized:u}}_placeStatus(){const e=this._total(),t=`translateY(${e}px)`;this._status.style.transform!==t&&(this._status.style.transform=t);const n=`${e+(this._status.hidden?0:this._statusHeight)}px`;this._spacer.style.height!==n&&(this._spacer.style.height=n)}_onRowResize(e){if(this._fixed||!this.element)return;let t=!1,n=0;const s=this.element.scrollTop,i=this.count?this._indexAt(s):0;for(const s of e){const e=this._rowByEl.get(s.target);if(!e||this._rows.get(e.key)!==e)continue;const o=s.borderBoxSize?.[0],r=o?o.blockSize:e.el.offsetHeight;if(!r)continue;const a=this._heights.get(e.key);if(void 0!==a&&Math.abs(a-r)<.5)continue;const l=this._heightOf(e.index);e.index<i&&(n+=r-l),this._heights.set(e.key,r),this._dirty(e.index),t=!0}t&&(n&&(this.element.scrollTop=s+n),this._schedule())}_rowFor(e){for(const t of this._rows.values())if(t.index===e)return t.el;return null}_syncTabStop(){let e=this._rowFor(this._active);if(!e&&this.count){const{start:t}=this.getVisibleRange();e=this._rowFor(t)||this._list.querySelector(".dm-vlist-row")}for(const t of this._rows.values()){const n=t.el===e?0:-1;t.el.tabIndex!==n&&(t.el.tabIndex=n)}}_rowOf(e){const t=e?.closest?.(".dm-vlist-row");return t&&t.parentNode===this._list?t:null}_onClick=e=>{const t=this._rowOf(e.target);if(!t)return;const n=Number(t.dataset.index);this._active=n,this._syncTabStop(),this._fire("itemclick",this._itemAt(n),n,e)};_onFocusIn=e=>{this._focusWithin=!0;const t=this._rowOf(e.target);t&&(this._active=Number(t.dataset.index),this._syncTabStop())};_onFocusOut=e=>{e.relatedTarget&&this._list.contains(e.relatedTarget)||(this._focusWithin=!1)};_onKey=e=>{const t=this._rowOf(e.target);if(!t||e.target!==t)return;const n=Number(t.dataset.index),s=this.count,i=this.getVisibleRange(),o=Math.max(1,i.end-i.start);let r=null;switch(e.key){case"ArrowDown":r=n+1;break;case"ArrowUp":r=n-1;break;case"Home":r=0;break;case"End":r=s-1;break;case"PageDown":r=n+o;break;case"PageUp":r=n-o;break;case"Enter":return e.preventDefault(),void this._fire("itemclick",this._itemAt(n),n,e);default:return}e.preventDefault(),this.focusIndex(Math.min(s-1,Math.max(0,r)))};focusIndex(e){const t=this.count;if(!t)return this;const n=Math.min(t-1,Math.max(0,Math.floor(qe(e,0))));this._active=n,this._focusWithin=!0,this.scrollToIndex(n,{align:"auto"});const s=this._rowFor(n);return s&&s.focus({preventScroll:!0}),this._syncTabStop(),this}_maybeLoad(){const e=this._load;if("function"!=typeof this.options.loadMore||e.busy||e.done||e.error)return;const t=this.element;this._total()-(t.scrollTop+this._viewport())<=Math.max(0,qe(this.options.threshold,200))&&this._loadNext()}_loadNext(){const e=this._load;e.busy=!0;const t=e.gen;let n;this._list.setAttribute("aria-busy","true"),this._showStatus("loading"),this._placeStatus(),this._fire("loadmore",{count:this.count,page:e.page});try{n=Promise.resolve(this.options.loadMore({count:this.count,page:e.page}))}catch(e){n=Promise.reject(e)}n.then(n=>{if(t!==this._load.gen||!this.element)return;const s=Array.isArray(n)?n:Array.isArray(n?.items)?n.items:[],i=!Array.isArray(n)&&!!n?.done||0===s.length;e.busy=!1,e.page+=1,this._list.removeAttribute("aria-busy"),i&&(e.done=!0),this._showStatus(i?"end":null),s.length?this._appendItems(s):this._render(),this._fire("loaded",s),i&&this._fire("end")},n=>{t===this._load.gen&&this.element&&(e.busy=!1,e.error=n||new Error("loadMore failed"),this._list.removeAttribute("aria-busy"),this._showStatus("error"),this._placeStatus(),this._fire("error",e.error))})}retry(){return this._load?.error?(this._load.error=null,this._loadNext(),this):this}isDone(){return!!this._load?.done}_template(e){const t=this.options,n={loading:t.loadingTemplate,end:t.endTemplate,error:t.errorTemplate}[e],s="function"==typeof n?n(this._load.error):n;if(null!=s&&""!==s)return s;if("loading"===e){const e=document.createElement("div");e.className="dm-vlist-loading";const t=document.createElement("span");return t.className="dm-vlist-spinner",t.setAttribute("aria-hidden","true"),e.append(t,document.createTextNode("Loading more…")),e}if("error"===e){const e=document.createElement("div");e.className="dm-vlist-error";const t=document.createElement("button");return t.type="button",t.className="btn btn-sm btn-outline",t.dataset.vlistRetry="",t.textContent="Retry",e.append(document.createTextNode("Could not load more. "),t),e}return null}_showStatus(e){const t=this._status,n=e?this._template(e):null;if(t.dataset.state=e||"",null==n)return t.replaceChildren(),t.hidden=!0,void(this._statusHeight=0);Ue(t,n,{safe:!1!==this.options.safe&&"false"!==this.options.safe}),t.hidden=!1,this._statusHeight=t.offsetHeight||0}setItems(e){return this._setData(e||[],0,null),this.options.keyField||this._heights.clear(),this._resetLoading(),this._render(),this}setCount(e){return this._items||(this._count=Math.max(0,Math.floor(qe(e,0))),this._dirty(0),this._render()),this}_resetLoading(){const e=this._load;e.gen+=1,e.busy=!1,e.done=!1,e.error=null,e.page=0,this._list?.removeAttribute("aria-busy"),this._status&&this._showStatus(null)}_materialise(){if(this._items)return;const e=[];for(let t=0;t<this._count;t++)e.push(this._getItem(t));this._items=e,this._count=null,this._getItem=null}_appendItems(e){this._materialise();const t=this._items.length;for(const t of e)this._items.push(t);this._dirty(t),this._render()}append(e){return e?.length?(this._appendItems(Array.from(e)),this):this}prepend(e){if(!e?.length)return this;this._materialise();const t=Array.from(e);this.options.keyField||this._heights.clear();let n=0;this._fixed?n=t.length*this._rowHeight:t.forEach((e,t)=>{const s=this._heights.get(this._keyOf(e,t));n+=void 0===s?this._estimate:s});const s=this.element.scrollTop;return this._items.unshift(...t),this._active>=0&&(this._active+=t.length),this._dirty(0),this._spacer.style.height=`${this._total()+this._statusHeight}px`,this.element.scrollTop=s+n,this._render(),this}indexOfKey(e){const t=this.count;for(let n=0;n<t;n++)if(this._keyOf(this._itemAt(n),n)===e)return n;return-1}update(e,t){const n=this.count,s="number"==typeof e?Math.floor(e):this.indexOfKey(e);if(!(s>=0&&s<n))return this;this._items&&(this._items[s]=t);const i=this._keyOf(t,s),o=this._rows.get(i);return o&&(o.item=void 0),this._render(),this}scrollToIndex(e,t={}){const n=this.count;if(!n||!this.element)return this;const s=Math.min(n-1,Math.max(0,Math.floor(qe(e,0)))),i=t.align||"auto",o=!!t.smooth&&!Xe()&&"function"==typeof this.element.scrollTo,r=()=>{const e=this._offset(s),t=this._heightOf(s),n=this._viewport(),o=this.element.scrollTop;return"start"===i?e:"end"===i?e+t-n:"center"===i?e+t/2-n/2:e<o?e:e+t>o+n?e+t-n:null},a=r();if(null===a)return this._render(),this;const l=Math.max(0,this._total()+this._statusHeight-this._viewport()),c=Math.min(l,Math.max(0,a));if(o)return this.element.scrollTo({top:c,behavior:"smooth"}),this;if(this.element.scrollTop=c,this._render(),!this._fixed)for(let e=0;e<2;e++){const e=r();if(null===e||Math.abs(e-this.element.scrollTop)<1)break;this.element.scrollTop=Math.max(0,e),this._render()}return this}refresh(){return this._dirty(0),this._render(!0),this}getRenderedRange(){return{...this._range}}_applyOptions(){this._list&&(this.element.classList.toggle("dm-vlist-fixed",this._fixed),this.options.label?this._list.setAttribute("aria-label",this.options.label):this._list.removeAttribute("aria-label"),this._dirty(0),this._render(!0))}setOptions(e={}){const t="items"in e||"count"in e||"getItem"in e;return this.options={...this.options,...e},t&&(this._setData(this.options.items,this.options.count,this.options.getItem),this.options.keyField||this._heights.clear()),this._applyOptions(),this}destroy(){this._load&&(this._load.gen+=1),this._frame&&(("function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearTimeout)(this._frame),this._frame=0),this._hostObserver?.disconnect(),this._rowObserver?.disconnect(),this._hostObserver=this._rowObserver=null,this._spacer?.remove(),this._list?.remove(),this._status?.remove(),this._rows?.clear(),this.element&&(this.element.classList.remove("dm-vlist","dm-vlist-fixed"),this._original&&this.element.appendChild(this._original)),this._original=null,super.destroy(),this._onDestroy?.(),this._list=null}}const hs={prompt:"Drop files here or click to browse",hint:null,remove:"Remove {name}",retry:"Retry",cancel:"Cancel upload of {name}",added:"{name} added",removed:"{name} removed",type:"{name} was not added: that type of file is not accepted",size:"{name} was not added: it is larger than {max}",small:"{name} was not added: it is smaller than {min}",count:"{name} was not added: no more than {max} files",uploading:"Uploading {percent}%",done:"Uploaded",failed:"Upload failed",cancelled:"Cancelled",required:"Please add a file"};function ds(e){const t=Number(e)||0;if(t<1024)return`${t} B`;const n=["KB","MB","GB","TB"];let s=t,i=-1;do{s/=1024,i++}while(s>=1024&&i<n.length-1);return`${s>=10?Math.round(s):Math.round(10*s)/10} ${n[i]}`}function us(e){if(!e)return[];return(Array.isArray(e)?e:String(e).split(",")).map(e=>String(e).trim().toLowerCase()).filter(Boolean)}function ps(e,t){return String(e??"").replace(/\{(\w+)\}/g,(e,n)=>void 0!==t[n]?String(t[n]):e)}function ms(e){const t=e?.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}const fs={zones:0,armed:!1,timer:null};function _s(e){ms(e)&&(clearTimeout(fs.timer),fs.timer=setTimeout(ys,1500),e.defaultPrevented||e.target?.closest?.('input[type="file"]')||(e.preventDefault(),e.dataTransfer.dropEffect="none"))}function gs(e){e.defaultPrevented||e.target?.closest?.('input[type="file"]')||e.preventDefault(),ys()}function vs(e){e.relatedTarget||ys()}function bs(e){!fs.armed&&ms(e)&&(fs.armed=!0,document.addEventListener("dragover",_s),document.addEventListener("drop",gs),document.addEventListener("dragleave",vs),fs.timer=setTimeout(ys,1500))}function ys(){clearTimeout(fs.timer),fs.timer=null,fs.armed&&(fs.armed=!1,document.removeEventListener("dragover",_s),document.removeEventListener("drop",gs),document.removeEventListener("dragleave",vs))}class ks extends C{static componentName="dropzone";static defaults={accept:null,multiple:null,maxFiles:null,maxSize:null,minSize:null,previews:!0,name:null,input:null,list:!0,upload:null,autoUpload:!0,retry:0,labels:{},disabled:!1,className:"",onBeforeAdd:null,onAdd:null,onReject:null,onRemove:null,onChange:null,onUploadStart:null,onProgress:null,onSuccess:null,onError:null,onComplete:null};constructor(e,t={}){super(e,t),this.element&&(this._entries=[],this._queue=[],this._active=0,this._batch=!1,this._added=[],this._canSync=function(){try{return"undefined"!=typeof DataTransfer&&!!(new DataTransfer).items}catch{return!1}}(),this._labels={...hs,...this.options.labels||{}},this._setupZone(),this._setupInput(),this._setupList(),this._bind(),this._applyDisabled(),0===fs.zones++&&document.addEventListener("dragenter",bs),this._guarded=!0)}_setupZone(){const e=this.element;if("INPUT"===e.tagName&&"file"===e.type){const t=document.createElement("div");e.after(t),this._added.push(t),this.zone=t,this._givenInput=e}else this.zone=e;const t=this.zone;this._restoreZone=["role","tabindex","aria-disabled","aria-describedby"].reduce((e,n)=>(e[n]=t.getAttribute(n),e),{}),this._zoneClasses=["dm-dropzone",...String(this.options.className||"").split(/\s+/).filter(Boolean)].filter(e=>!t.classList.contains(e)),t.classList.add(...this._zoneClasses),this._isLabel="LABEL"===t.tagName,this._isLabel||t.setAttribute("role","button"),t.setAttribute("tabindex","0")}_findInput(){const e=this.options;if(this._givenInput)return this._givenInput;if(e.input){const t="string"==typeof e.input?document.querySelector(e.input):e.input;if(t&&"INPUT"===t.tagName)return t}const t=this.zone.querySelector('input[type="file"]');if(t)return t;for(const e of[this.zone.nextElementSibling,this.zone.previousElementSibling])if(e&&e.matches?.('input[type="file"]'))return e;return null}_setupInput(){let e=this._findInput();e?this._restoreInput={hidden:e.hidden,name:e.getAttribute("name"),multiple:e.multiple,disabled:e.disabled,tabindex:e.getAttribute("tabindex"),accept:e.getAttribute("accept")}:(e=document.createElement("input"),e.type="file",this.zone.appendChild(e),this._added.push(e)),this.input=e;const t=this.options;null!==t.accept&&void 0!==t.accept||(t.accept=e.getAttribute("accept")||null),null!==t.multiple&&void 0!==t.multiple||(t.multiple=!this._restoreInput||e.multiple),!t.name&&e.name&&(t.name=e.name),t.name&&(e.name=t.name),e.multiple=Ve(t.multiple,!0);const n=us(t.accept).join(",");n&&e.setAttribute("accept",n),e.hidden=!0,e.tabIndex=-1}_setupList(){const e=this.zone,t=this.options;if(!Array.from(e.childNodes).some(e=>1===e.nodeType&&e!==this.input||3===e.nodeType&&e.textContent.trim())){const t=document.createElement("span");t.className="dm-dropzone-prompt";const n=document.createElement("span");n.className="dm-dropzone-icon",n.setAttribute("aria-hidden","true"),n.dataset.icon="upload";const s=document.createElement("span");s.className="dm-dropzone-text",s.textContent=this._labels.prompt,t.append(n,s);const i=this._hint();if(i){const e=document.createElement("span");e.className="dm-dropzone-hint",e.id=Ge("dm-dropzone-hint"),e.textContent=i,t.appendChild(e),this._hintId=e.id}e.insertBefore(t,e.firstChild),this._added.push(t),Ke(t)}if(this._hintId){const t=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);e.setAttribute("aria-describedby",[...t,this._hintId].join(" "))}const n=document.createElement("div");if(n.className="sr-only dm-dropzone-live",n.setAttribute("aria-live","polite"),n.setAttribute("role","status"),this._live=n,!1!==t.list){const n=document.createElement("ul");n.className="dm-dropzone-files",n.setAttribute("aria-label","Selected files"),n.hidden=!0,this._list=n;const s=!0===t.list||void 0===t.list||null===t.list?null:"string"==typeof t.list?document.querySelector(t.list):t.list;s&&1===s.nodeType?s.appendChild(n):e.after(n),this._added.push(n)}(this._list||e).after(n),this._added.push(n)}_hint(){if(null!==this._labels.hint&&void 0!==this._labels.hint)return String(this._labels.hint);const e=this.options,t=[],n=us(e.accept);return n.length&&t.push(n.join(", ")),e.maxSize&&t.push(`up to ${ds(e.maxSize)}`),e.maxFiles&&Ve(e.multiple,!0)&&t.push(`at most ${qe(e.maxFiles)} files`),t.join(" · ")}_bind(){const e=this.zone,t=this.input;this._addEventListener(e,"click",e=>{e.target===t||this._isLabel||this.browse()}),this._addEventListener(e,"keydown",t=>{t.target===e&&("Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this.browse()))}),this._addEventListener(t,"change",()=>{if(this._settingFiles)return;const e=Array.from(t.files||[]);e.length?this.addFiles(e):this._syncInput()}),this._addEventListener(e,"paste",e=>{const t=Array.from(e.clipboardData?.files||[]);t.length&&!this.isDisabled()&&(e.preventDefault(),this.addFiles(t))}),this._addEventListener(e,"dragenter",t=>{ms(t)&&!this.isDisabled()&&(t.preventDefault(),bs(t),e.classList.add("is-dragover"))}),this._addEventListener(e,"dragover",t=>{ms(t)&&!this.isDisabled()&&(t.preventDefault(),t.dataTransfer.dropEffect="copy",e.classList.add("is-dragover"))}),this._addEventListener(e,"dragleave",t=>{t.relatedTarget&&e.contains(t.relatedTarget)||e.classList.remove("is-dragover")}),this._addEventListener(e,"drop",t=>{e.classList.remove("is-dragover"),ms(t)&&(t.preventDefault(),ys(),this.isDisabled()||this.addFiles(t.dataTransfer.files))}),this._addEventListener(t,"invalid",()=>{e.classList.add("is-invalid"),this._announce(this._labels.required),e.focus()});const n=t.form;n&&!this._canSync&&this._addEventListener(n,"formdata",e=>{if(!this.options.upload&&!this.isDisabled()&&t.name){e.formData.delete(t.name);for(const n of this._entries)e.formData.append(t.name,n.file,n.name)}}),n&&this._addEventListener(n,"reset",()=>{this._timers=this._timers||[],this._timers.push(setTimeout(()=>{this._entries&&this.clear()},0))})}_applyDisabled(){const e=this.isDisabled();this.zone.classList.toggle("is-disabled",e),this.zone.setAttribute("tabindex",e?"-1":"0"),e?this.zone.setAttribute("aria-disabled","true"):this.zone.removeAttribute("aria-disabled"),this.input.disabled=e,this._list?.querySelectorAll("button").forEach(t=>{t.disabled=e})}_entryFor(e){return e&&this._entries.find(t=>t===e||t.id===e||t.file===e)||null}_makeEntry(e){return{id:Ge("dm-file"),file:e,name:String(e?.name??"file"),size:Number(e?.size)||0,type:String(e?.type||""),status:"queued",progress:0,response:null,error:null,attempts:0,preview:null}}_rejectReason(e,t){const n=this.options;if(!function(e,t){const n=us(t);if(!n.length)return!0;const s=String(e?.name||"").toLowerCase(),i=String(e?.type||"").toLowerCase();return n.some(e=>e.startsWith(".")?s.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,-1)):i===e)}(e.file,n.accept))return"type";if(n.maxSize&&e.size>qe(n.maxSize))return"size";if(n.minSize&&e.size<qe(n.minSize))return"size";const s=Ve(n.multiple,!0)?qe(n.maxFiles,0):1;return s&&t>=s?"count":null}_rejectMessage(e,t){const n=this.options;if("size"===t&&n.minSize&&e.size<qe(n.minSize))return ps(this._labels.small,{name:e.name,min:ds(n.minSize)});const s="size"===t?ds(n.maxSize):Ve(n.multiple,!0)?qe(n.maxFiles):1;return ps(this._labels[t],{name:e.name,max:s})}addFiles(e){if(!this._entries||this.isDisabled()||!e)return[];let t="number"==typeof e.length?Array.from(e):[e];if(t=t.filter(Boolean),!t.length)return[];const n=!Ve(this.options.multiple,!0),s=[],i=[];for(const e of t){const t=this._makeEntry(e),o=n?s.length:this._entries.length+s.length,r=this._rejectReason(t,o);r?(i.push(this._rejectMessage(t,r)),this._fire("reject",t,r)):!1!==this._fire("beforeadd",t)&&s.push(t)}if(s.length&&n)for(const e of this._entries.slice())this._drop(e);for(const e of s)this._entries.push(e),this._preview(e),this._renderEntry(e),i.push(ps(this._labels.added,{name:e.name})),this._fire("add",e);return this.zone.classList.remove("is-invalid"),i.length&&this._announce(i.join(". ")),s.length?(this._syncInput(),this._fire("change",this.getFiles()),this.options.upload&&Ve(this.options.autoUpload,!0)&&this.upload()):this._canSync&&!this.options.upload||this._syncInput(),s}removeFile(e){const t=this._entryFor(e);return!!t&&(this._drop(t),this._announce(ps(this._labels.removed,{name:t.name})),this._syncInput(),this._fire("change",this.getFiles()),this._pump(),!0)}_drop(e){this._abort(e),this._queue=this._queue.filter(t=>t!==e),this._entries=this._entries.filter(t=>t!==e),e.preview&&(URL.revokeObjectURL(e.preview),e.preview=null),e._row?.remove(),e._row=null,this._list&&(this._list.hidden=!this._entries.length),this._fire("remove",e)}clear(){if(!this._entries?.length)return this;for(const e of this._entries.slice())this._drop(e);return this._syncInput(),this._fire("change",this.getFiles()),this}getFiles(){return(this._entries||[]).map(e=>e.file)}getEntries(){return(this._entries||[]).slice()}browse(){return this.isDisabled()||this.input.click(),this}_syncInput(){const e=this.input;if(e){this._settingFiles=!0;try{if(this.options.upload||!this._canSync){try{e.value=""}catch{}return}const t=new DataTransfer;for(const e of this._entries)t.items.add(e.file);e.files=t.files}catch{this._canSync=!1}finally{this._settingFiles=!1}}}_announce(e){this._live&&e&&(this._live.textContent="",this._live.textContent=e)}_preview(e){if(Ve(this.options.previews,!0)&&/^image\//.test(e.type)&&"undefined"!=typeof URL&&"function"==typeof URL.createObjectURL)try{e.preview=URL.createObjectURL(e.file)}catch{e.preview=null}}_renderEntry(e){if(!this._list)return;const t=document.createElement("li");t.className="dm-dropzone-file",t.dataset.id=e.id;const n=document.createElement("span");if(n.className="dm-dropzone-thumb",n.setAttribute("aria-hidden","true"),e.preview){const t=document.createElement("img");t.alt="",t.src=e.preview,n.appendChild(t)}else{const t=e.name.lastIndexOf(".");n.textContent=t>0?e.name.slice(t+1,t+5).toUpperCase():"FILE"}const s=document.createElement("span");s.className="dm-dropzone-meta";const i=document.createElement("span");i.className="dm-dropzone-name",i.textContent=e.name,i.title=e.name;const o=document.createElement("span");o.className="dm-dropzone-size",o.textContent=ds(e.size);const r=document.createElement("span");r.className="dm-dropzone-status",s.append(i,o,r);const a=document.createElement("span");a.className="dm-dropzone-progress",a.setAttribute("role","progressbar"),a.setAttribute("aria-valuemin","0"),a.setAttribute("aria-valuemax","100"),a.setAttribute("aria-label",e.name),a.hidden=!0;const l=document.createElement("span");l.className="dm-dropzone-progress-bar",a.appendChild(l);const c=document.createElement("button");c.type="button",c.className="btn btn-sm btn-ghost dm-dropzone-retry",c.textContent=this._labels.retry,c.hidden=!0,c.addEventListener("click",()=>this.retry(e.id));const h=document.createElement("button");h.type="button",h.className="dm-dropzone-remove",h.setAttribute("aria-label",ps(this._labels.remove,{name:e.name}));const d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.dataset.icon="x",d.dataset.iconSize="16",d.textContent="×",h.appendChild(d),h.addEventListener("click",()=>{const n=t.nextElementSibling||t.previousElementSibling;this.removeFile(e.id),(n?.querySelector(".dm-dropzone-remove")||this.zone).focus()}),t.append(n,s,a,c,h),e._row=t,e._ui={status:r,bar:a,barFill:l,retry:c,remove:h},this._list.appendChild(t),this._list.hidden=!1,d.isConnected&&"undefined"!=typeof window&&window.Domma?.icons&&(d.textContent="",Ke(h)),this._paintEntry(e)}_paintEntry(e){const t=e._ui;if(!t)return;e._row.dataset.status=e.status;const n=this._labels,s={queued:"",uploading:ps(n.uploading,{percent:e.progress}),done:n.done,error:e.error?.message?`${n.failed}: ${e.error.message}`:n.failed,cancelled:n.cancelled}[e.status]||"";t.status.textContent=s,t.bar.hidden="uploading"!==e.status&&"done"!==e.status,t.bar.setAttribute("aria-valuenow",String(e.progress)),t.barFill.style.width=`${e.progress}%`,t.retry.hidden=!this.options.upload||!["error","cancelled"].includes(e.status),t.remove.setAttribute("aria-label",ps("uploading"===e.status?n.cancel:n.remove,{name:e.name}))}upload(){if(!this.options.upload||!this._entries)return this;for(const e of this._entries)["queued","error","cancelled"].includes(e.status)&&!this._queue.includes(e)&&(e.status="queued",e.error=null,e.attempts=0,this._queue.push(e),this._paintEntry(e));return this._queue.length&&(this._batch=!0),this._pump(),this}retry(e){if(void 0===e)return this.upload();const t=this._entryFor(e);return t&&this.options.upload&&["error","cancelled"].includes(t.status)?(t.status="queued",t.error=null,t.attempts=0,this._queue.push(t),this._batch=!0,this._paintEntry(t),this._pump(),this):this}cancel(e){const t=void 0===e?this._entries.slice():[this._entryFor(e)].filter(Boolean);for(const e of t)"uploading"===e.status?this._abort(e):this._queue.includes(e)&&(this._queue=this._queue.filter(t=>t!==e),e.status="cancelled",this._paintEntry(e));return this._pump(),this}_abort(e){const t=e._xhr;if(t){e._xhr=null,e._aborted=!0;try{t.abort()}catch{}e.status="cancelled",this._active=Math.max(0,this._active-1),this._paintEntry(e)}}_pump(){const e=this.options.upload||{},t=Math.max(1,qe(e.concurrency,2));for(;this._active<t&&this._queue.length;)this._send(this._queue.shift());this._maybeComplete()}_maybeComplete(){!this._batch||this._active||this._queue.length||(this._batch=!1,this._fire("complete",this.getEntries()))}_send(e){const t=this.options.upload,n=t=>"function"==typeof t?t(e):t,s=n(t.url),i="function"==typeof t.xhr?t.xhr(e):new XMLHttpRequest;e._xhr=i,e._aborted=!1,e.status="uploading",e.progress=0,e.attempts+=1,this._active++,this._paintEntry(e),this._fire("uploadstart",e);const o=()=>e._xhr===i&&(e._xhr=null,this._active=Math.max(0,this._active-1),!0),r=t=>{e.attempts<=qe(this.options.retry,0)?(e.status="queued",this._queue.push(e)):(e.status="error",e.error=t,this._fire("error",e,t)),this._paintEntry(e),this._pump()};i.upload?.addEventListener?.("progress",t=>{if(e._xhr!==i||!t.lengthComputable||!t.total)return;const n=Math.min(100,Math.round(t.loaded/t.total*100));n!==e.progress&&(e.progress=n,this._paintEntry(e),this._fire("progress",e,n))}),i.addEventListener("load",()=>{if(!o())return;let t=i.responseText;try{t=JSON.parse(i.responseText)}catch{}i.status>=200&&i.status<300?(e.status="done",e.progress=100,e.response=t,this._paintEntry(e),this._fire("success",e,t),this._pump()):r({status:i.status,message:i.statusText||`HTTP ${i.status}`,response:t})}),i.addEventListener("error",()=>{o()&&r({status:0,message:"Network error",response:null})}),i.addEventListener("abort",()=>{!e._aborted&&o()&&(e.status="cancelled",this._paintEntry(e),this._pump())});try{i.open(String(t.method||"POST").toUpperCase(),s,!0),t.withCredentials&&(i.withCredentials=!0);const o=n(t.headers)||{};for(const[e,t]of Object.entries(o))null!=t&&i.setRequestHeader(e,String(t));const r=new FormData,a=n(t.data)||{};for(const[e,t]of Object.entries(a))null!=t&&r.append(e,t);r.append(t.field||"file",e.file,e.name),i.send(r)}catch(e){o()&&r({status:0,message:e?.message||"Upload failed",response:null})}}isDisabled(){return Ve(this.options.disabled)}enable(){return this.setOptions({disabled:!1})}disable(){return this.setOptions({disabled:!0})}_applyOptions(){if(!this._entries)return;this._labels={...hs,...this.options.labels||{}};const e=this.options;this.input.multiple=Ve(e.multiple,!0);const t=us(e.accept).join(",");t?this.input.setAttribute("accept",t):this.input.removeAttribute("accept"),e.name&&(this.input.name=e.name),this._applyDisabled(),this._entries.forEach(e=>this._paintEntry(e))}destroy(){if(!this.element||!this._entries)return super.destroy();(this._timers||[]).forEach(clearTimeout);for(const e of this._entries)this._abort(e),e.preview&&URL.revokeObjectURL(e.preview);this._entries=null,this._queue=[],this._guarded&&(fs.zones<=0||0===--fs.zones&&(document.removeEventListener("dragenter",bs),ys()),this._guarded=!1);const e=this.zone;e.classList.remove(...this._zoneClasses,"is-dragover","is-disabled","is-invalid");for(const[t,n]of Object.entries(this._restoreZone))null===n?e.removeAttribute(t):e.setAttribute(t,n);if(this._restoreInput){const e=this.input;e.hidden=this._restoreInput.hidden,e.multiple=this._restoreInput.multiple,e.disabled=this._restoreInput.disabled,null===this._restoreInput.tabindex?e.removeAttribute("tabindex"):e.setAttribute("tabindex",this._restoreInput.tabindex),null===this._restoreInput.name?e.removeAttribute("name"):e.setAttribute("name",this._restoreInput.name),null===this._restoreInput.accept?e.removeAttribute("accept"):e.setAttribute("accept",this._restoreInput.accept)}for(const e of this._added)e.remove();this._added=[],super.destroy(),this._onDestroy?.()}}const ws=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"];function xs(e){const t=String(e);if(t.includes("e-"))return Number(t.split("e-")[1])||0;const n=t.indexOf(".");return-1===n?0:t.length-n-1}const Ms=(()=>{let e=null;return t=>(null===e&&(e="undefined"!=typeof HTMLInputElement&&Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")||void 0),e?e.get.call(t):t.value)})();class Ls extends C{static componentName="range-slider";static defaults={min:0,max:100,step:1,value:null,range:!1,orientation:"horizontal",ticks:!1,tickLabels:!1,labels:null,tooltip:"hover",marks:null,disabled:!1,name:null,names:null,minDistance:0,rtl:null,ariaLabel:null,ariaLabels:null,className:"",onInput:null,onChange:null,onBeforeChange:null};constructor(e,t={}){super(e,Ls.fromInput(e,t)),this.element&&(this._isInput="INPUT"===this.element.tagName,this._made=[],this._hooked=[],this._dispatching=!1,this._drag=null,this._timers=[],this._setupInputs(),this._values=this._initialValues(),this._render(),this._writeInputs(),this._setDefaults(),this._bindInputs())}static fromInput(e,t={}){const n={...t};if(!e||"INPUT"!==e.tagName)return n;const s=t=>e.getAttribute(t);return void 0===n.min&&null!==s("min")&&(n.min=qe(s("min"),0)),void 0===n.max&&null!==s("max")&&(n.max=qe(s("max"),100)),void 0===n.step&&null!==s("step")&&(n.step="any"===s("step")?"any":qe(s("step"),1)),void 0!==n.value||null===s("value")||n.range||(n.value=qe(s("value"),null)),void 0===n.name&&e.name&&(n.name=e.name),void 0===n.disabled&&e.disabled&&(n.disabled=!0),n}get _min(){return qe(this.options.min,0)}get _max(){const e=qe(this.options.max,100);return e>this._min?e:this._min+1}get _step(){if("any"===this.options.step)return null;const e=qe(this.options.step,1);return e>0?e:1}get _keyStep(){return this._step??(this._max-this._min)/100}_snap(e){const t=this._min,n=this._max;let s=qe(e,t);const i=this._step;if(i){s=t+Math.round((s-t)/i)*i;const e=t+Math.floor((n-t)/i+1e-9)*i;s=Math.min(s,e),s=Number(s.toFixed(Math.max(xs(i),xs(t))))}return Math.min(Math.max(s,t),n)}get _minDistance(){return this.options.range?Math.max(0,qe(this.options.minDistance,0)):0}_normalise(e){if(!this.options.range){const t=Array.isArray(e)?e[0]:e;return[this._snap(t)]}let t=e;"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t,this._values?this._values[1]:this._max]);let n=this._snap(t[0]??this._min),s=this._snap(t[1]??this._max);n>s&&([n,s]=[s,n]);const i=this._minDistance;return s-n<i&&(s=this._snap(n+i),s-n<i&&(n=this._snap(s-i))),[n,s]}_initialValues(){const e=this.options;if(null!==e.value&&void 0!==e.value&&""!==e.value)return this._normalise(e.value);if(e.range){const e=this._inputs[0].getAttribute("value"),t=this._inputs[1].getAttribute("value");return this._normalise([null!==e?e:this._min,null!==t?t:this._max])}return this._normalise(this._min+(this._max-this._min)/2)}_format(e,t){const n=this.options.labels||this.options.format;if("function"==typeof n)try{const s=n(e,t);if(null!=s)return String(s)}catch{}return String(e)}_pct(e){return(e-this._min)/(this._max-this._min)*100}get _vertical(){return"vertical"===this.options.orientation}get _rtl(){if(null!==this.options.rtl&&void 0!==this.options.rtl)return Ve(this.options.rtl);try{return"function"==typeof getComputedStyle&&"rtl"===getComputedStyle(this.element).direction}catch{return!1}}_setupInputs(){const e=this.options,t=e=>{const t=document.createElement("input");return t.type="range",e?e.after(t):this.element.appendChild(t),this._made.push(t),t},n=this._isInput?this.element:t(null);if(this._inputs=[n],e.range&&this._inputs.push(t(n)),this._isInput){const e=this.element;this._restore={name:e.getAttribute("name"),hidden:e.hidden,tabindex:e.getAttribute("tabindex"),ariaHidden:e.getAttribute("aria-hidden"),min:e.getAttribute("min"),max:e.getAttribute("max"),step:e.getAttribute("step"),disabled:e.getAttribute("disabled"),value:e.getAttribute("value")}}const s=Array.isArray(e.names)?e.names:[];this._inputs.forEach((t,n)=>{const i=s[n]||(t.name?null:e.name);i&&(t.name=i),t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true")}),this._syncInputAttrs(),this._hookValues()}_syncInputAttrs(){for(const e of this._inputs)e.min=String(this._min),e.max=String(this._max),e.step=this._step?String(this._step):"any",e.disabled=Ve(this.options.disabled)}_hookValues(){const e="undefined"!=typeof HTMLInputElement?HTMLInputElement.prototype:null,t=e&&Object.getOwnPropertyDescriptor(e,"value");if(!t||!t.set)return;const n=this;this._inputs.forEach((e,s)=>{try{Object.defineProperty(e,"value",{configurable:!0,enumerable:!0,get(){return t.get.call(this)},set(e){t.set.call(this,e),n._writing||n._fromInputs(s)}}),this._hooked.push(e)}catch{}})}_writeInputs(){this._writing=!0;try{this._inputs.forEach((e,t)=>{e.value=String(this._values[t])})}finally{this._writing=!1}}_setDefaults(){this._inputs.forEach((e,t)=>{e.hasAttribute("value")||e.setAttribute("value",String(this._values[t]))})}_fromInputs(){if(!this._inputs)return;const e=this._inputs.map(e=>Number(Ms(e))),t=this._normalise(this.options.range?e:e[0]);this._values=t,this._writeInputs(),this._paint()}_bindInputs(){for(const e of this._inputs){const t=()=>{this._dispatching||this._fromInputs()};this._addEventListener(e,"input",t),this._addEventListener(e,"change",t)}const e=this._inputs[0].form;e&&this._addEventListener(e,"reset",()=>{this._timers.push(setTimeout(()=>{this._inputs&&this._fromInputs()},0))});const t=this._inputs[0].labels?Array.from(this._inputs[0].labels):[];for(const e of t)this._addEventListener(e,"click",e=>{this._thumbs?.[0]?.contains(e.target)||(e.preventDefault(),Ve(this.options.disabled)||this._thumbs[0].focus())});this._labels=t}_labelText(){if(this.options.ariaLabel)return String(this.options.ariaLabel);const e=this._labels?.[0]||this._inputs[0].labels&&this._inputs[0].labels[0];return e?e.textContent.replace(/\s+/g," ").trim():this.element.getAttribute("aria-label")||""}_render(){this._root&&(this._unbindRoot(),this._root.remove());const e=this.options,t=document.createElement("div");t.className="dm-range-slider"+(e.className?" "+e.className:""),t.dataset.orientation=this._vertical?"vertical":"horizontal",t.dataset.tooltipMode=["always","never"].includes(e.tooltip)?e.tooltip:"hover",e.range&&t.classList.add("is-range"),this._rtl&&t.setAttribute("dir","rtl");const n=document.createElement("div");n.className="dm-range-track";const s=document.createElement("div");s.className="dm-range-fill",n.appendChild(s),t.appendChild(n),this._ticksEl=this._renderTicks(t),this._marksEl=this._renderMarks(t);const i=this._labelText(),o=Array.isArray(e.ariaLabels)?e.ariaLabels:[];this._thumbs=this._values.map((n,s)=>{const r=document.createElement("div");r.className="dm-range-thumb",r.id=Ge("dm-range-thumb"),r.setAttribute("role","slider"),r.dataset.index=String(s),this._vertical&&r.setAttribute("aria-orientation","vertical");let a=o[s];if(!a&&e.range&&(a=[i,0===s?"minimum":"maximum"].filter(Boolean).join(" ")),a||(a=i),a&&r.setAttribute("aria-label",a),"never"!==t.dataset.tooltipMode){const e=document.createElement("span");e.className="dm-range-tooltip",e.setAttribute("aria-hidden","true"),r.appendChild(e)}return t.appendChild(r),r}),this._fillEl=s,this._track=n,this._root=t;const r=this._inputs[this._inputs.length-1];this._isInput?r.after(t):this.element.appendChild(t),this._bindRoot(),this._applyDisabled(),this._paint()}_tickValues(){const e=this.options.ticks;if(!e)return[];const t=this._min,n=this._max;if(Array.isArray(e))return e.map(Number).filter(e=>Number.isFinite(e)&&e>=t&&e<=n);let s=!0===e||"true"===e?this._keyStep:qe(e,0);if(!(s>0))return[];const i=Math.floor((n-t)/s+1e-9);i>100&&(s*=Math.ceil(i/100));const o=[],r=Math.max(xs(s),xs(t));for(let e=t;e<=n+1e-9;e+=s)o.push(Number(e.toFixed(r)));return o[o.length-1]!==n&&o.push(n),o}_place(e,t){this._vertical?e.style.bottom=`${t}%`:e.style[this._rtl?"right":"left"]=`${t}%`}_renderTicks(e){const t=this._tickValues();if(!t.length)return null;const n=Array.isArray(this.options.ticks)||Ve(this.options.tickLabels),s=document.createElement("div");s.className="dm-range-ticks",s.setAttribute("aria-hidden","true");for(const e of t){const t=document.createElement("span");if(t.className="dm-range-tick",t.dataset.value=String(e),this._place(t,this._pct(e)),n){const n=document.createElement("span");n.className="dm-range-tick-label",n.textContent=this._format(e,"tick"),t.appendChild(n)}s.appendChild(t)}return n&&e.classList.add("has-tick-labels"),e.appendChild(s),s}_renderMarks(e){const t=(Array.isArray(this.options.marks)?this.options.marks:[]).map(e=>e&&"object"==typeof e?e:{value:e}).filter(e=>Number.isFinite(Number(e.value))&&Number(e.value)>=this._min&&Number(e.value)<=this._max);if(!t.length)return null;const n=document.createElement("div");n.className="dm-range-marks",n.setAttribute("aria-hidden","true");for(const e of t){const t=this._snap(e.value),s=document.createElement("span");s.className="dm-range-mark",s.dataset.value=String(t),this._place(s,this._pct(t));const i=document.createElement("span");i.className="dm-range-mark-label",i.textContent=void 0!==e.label&&null!==e.label?String(e.label):this._format(t,"mark"),s.appendChild(i),n.appendChild(s)}return e.classList.add("has-marks"),e.appendChild(n),n}_paint(){if(!this._root)return;const e=this._values,t=e.map(e=>this._pct(e)),n=this._vertical?"bottom":this._rtl?"right":"left",s=this._vertical?"height":"width",i=this._fillEl;i.style.left=i.style.right=i.style.bottom="";const[o,r]=this.options.range?t:[0,t[0]];i.style[n]=`${o}%`,i.style[s]=r-o+"%";const a=this._minDistance;this._thumbs.forEach((s,i)=>{s.style.left=s.style.right=s.style.bottom="",s.style[n]=`${t[i]}%`;const o=e[i];let r=this._min,l=this._max;this.options.range&&(0===i?l=this._snap(e[1]-a):r=this._snap(e[0]+a)),s.setAttribute("aria-valuemin",String(r)),s.setAttribute("aria-valuemax",String(l)),s.setAttribute("aria-valuenow",String(o)),this.options.labels||this.options.format?s.setAttribute("aria-valuetext",this._format(o,"aria")):s.removeAttribute("aria-valuetext");const c=s.querySelector(".dm-range-tooltip");c&&(c.textContent=this._format(o,"tooltip"))});for(const t of this._ticksEl?this._ticksEl.children:[]){const n=Number(t.dataset.value);t.classList.toggle("is-in-range",this.options.range?n>=e[0]&&n<=e[1]:n<=e[0])}}_applyDisabled(){const e=Ve(this.options.disabled);this._root.classList.toggle("is-disabled",e);for(const t of this._thumbs)t.tabIndex=e?-1:0,e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled");for(const t of this._inputs)t.disabled=e}_bindRoot(){const e=this._root;this._rootHandlers=[[e,"pointerdown",e=>this._onPointerDown(e)],[e,"pointermove",e=>this._onPointerMove(e)],[e,"pointerup",e=>this._onPointerUp(e)],[e,"pointercancel",e=>this._onPointerUp(e,!0)],[e,"lostpointercapture",e=>this._onPointerUp(e)],[e,"keydown",e=>this._onKeyDown(e)]];for(const[e,t,n]of this._rootHandlers)e.addEventListener(t,n)}_unbindRoot(){for(const[e,t,n]of this._rootHandlers||[])e.removeEventListener(t,n);this._rootHandlers=[]}_valueAt(e){const t=this._track.getBoundingClientRect();let n;return this._vertical?n=t.height?(t.bottom-e.clientY)/t.height:0:(n=t.width?(e.clientX-t.left)/t.width:0,this._rtl&&(n=1-n)),n=Math.min(Math.max(n,0),1),this._snap(this._min+n*(this._max-this._min))}_pickThumb(e,t){const n=e.target?.closest?.(".dm-range-thumb");if(n&&this._root.contains(n))return Number(n.dataset.index);if(!this.options.range)return 0;const[s,i]=this._values,o=Math.abs(t-s),r=Math.abs(t-i);return o===r?t<s?0:1:o<r?0:1}_onPointerDown(e){if(Ve(this.options.disabled))return;if(void 0!==e.button&&0!==e.button)return;const t=e.target?.closest?.(".dm-range-mark"),n=t?Number(t.dataset.value):this._valueAt(e),s=this._pickThumb(e,n),i=this._thumbs[s];e.preventDefault(),i.focus({preventScroll:!0});try{this._root.setPointerCapture(e.pointerId)}catch{}this._drag={index:s,pointerId:e.pointerId,start:this._values.slice()},this._root.classList.add("is-dragging"),i.classList.add("is-active"),e.target?.closest?.(".dm-range-thumb")||this._propose(s,n)}_onPointerMove(e){!this._drag||void 0!==e.pointerId&&e.pointerId!==this._drag.pointerId||this._propose(this._drag.index,this._valueAt(e))}_onPointerUp(e,t=!1){const n=this._drag;if(n&&(void 0===e.pointerId||void 0===n.pointerId||e.pointerId===n.pointerId)){this._drag=null,this._root.classList.remove("is-dragging"),this._thumbs[n.index]?.classList.remove("is-active");try{this._root.releasePointerCapture?.(n.pointerId)}catch{}t?this._same(n.start)||this._apply(n.start,n.index,"input"):this._same(n.start)||this._commit(n.index)}}_onKeyDown(e){const t=e.target?.closest?.(".dm-range-thumb");if(!t||!ws.includes(e.key)||Ve(this.options.disabled))return;e.preventDefault();const n=Number(t.dataset.index),s=this._values[n],i=this._keyStep,o=this._rtl&&!this._vertical?-1:1;let r=s;switch(e.key){case"ArrowRight":r=s+i*o;break;case"ArrowLeft":r=s-i*o;break;case"ArrowUp":r=s+i;break;case"ArrowDown":r=s-i;break;case"PageUp":r=s+10*i;break;case"PageDown":r=s-10*i;break;case"Home":r=this._min;break;case"End":r=this._max}this._propose(n,r)&&this._commit(n)}_same(e){return e.length===this._values.length&&e.every((e,t)=>e===this._values[t])}_shape(e){return this.options.range?e.slice():e[0]}_propose(e,t){let n=this._snap(t);if(this.options.range){const t=this._minDistance;n=0===e?Math.min(n,this._snap(this._values[1]-t)):Math.max(n,this._snap(this._values[0]+t)),0===e&&n>this._values[1]&&(n=this._values[1]),1===e&&n<this._values[0]&&(n=this._values[0])}if(n===this._values[e])return!1;const s=this._values.slice();return s[e]=n,!1!==this._fire("beforechange",this._shape(s),this._shape(this._values))&&(this._apply(s,e,"input"),!0)}_apply(e,t,n){this._values=e,this._writeInputs(),this._paint(),this._dispatch(this._inputs[t]||this._inputs[0],"input"),"input"===n&&this._fire("input",this.getValue())}_commit(e){this._dispatch(this._inputs[e]||this._inputs[0],"change"),this._fire("change",this.getValue())}_dispatch(e,t){this._dispatching=!0;try{e.dispatchEvent(new Event(t,{bubbles:!0}))}finally{this._dispatching=!1}}getValue(){return this._shape(this._values||[])}setValue(e,t={}){if(!this._values)return this;const n=this._normalise(e);if(this._same(n))return this;if(!t.silent&&!1===this._fire("beforechange",this._shape(n),this.getValue()))return this;const s=n.findIndex((e,t)=>e!==this._values[t]);return t.silent?(this._values=n,this._writeInputs(),this._paint(),this):(this._apply(n,s,"input"),this._commit(s),this)}setRange(e,t){if(!this._values)return this;this.options.min=qe(e,this._min),this.options.max=qe(t,this._max),this._syncInputAttrs();const n=this._values.slice();return this._values=this._normalise(this.options.range?n:n[0]),this._writeInputs(),this._render(),this._same(n)||(this._apply(this._values,0,"input"),this._commit(0)),this}enable(){return this.setOptions({disabled:!1})}disable(){return this.setOptions({disabled:!0})}isDisabled(){return Ve(this.options.disabled)}_applyOptions(){this._values&&(this.options.range=2===this._inputs.length,this._syncInputAttrs(),this._values=this._normalise(this.options.range?this._values:this._values[0]),this._writeInputs(),this._render())}destroy(){if(!this.element)return super.destroy();this._timers.forEach(clearTimeout),this._timers=[],this._unbindRoot(),this._root?.remove(),this._root=null;for(const e of this._hooked)delete e.value;this._hooked=[];for(const e of this._made)e.remove();if(this._made=[],this._isInput&&this._restore){const e=this.element;e.hidden=this._restore.hidden,null===this._restore.name?e.removeAttribute("name"):e.setAttribute("name",this._restore.name),null===this._restore.tabindex?e.removeAttribute("tabindex"):e.setAttribute("tabindex",this._restore.tabindex);for(const t of["aria-hidden","min","max","step","disabled","value"]){const n=this._restore["aria-hidden"===t?"ariaHidden":t];null===n?e.removeAttribute(t):e.setAttribute(t,n)}}this._inputs=null,this._values=null,this._thumbs=[],super.destroy(),this._onDestroy?.()}}const Cs="undefined"==typeof HTMLElement?class{}:HTMLElement;class As extends Cs{static defaults={};static get observedAttributes(){return[]}constructor(){super(),this._eventHandlers=[],this._options={},this._initialised=!1,this.attachShadow({mode:"open"})}connectedCallback(){this._initialised||(this._options={...this._mergeOptions(),...this._options},this._onBeforeMount?.(),this._injectStyles(),this._render(),this._bindEvents(),this._initialised=!0),this._onConnect?.()}disconnectedCallback(){this._onBeforeUnmount?.(),this._cleanup(),this._onDisconnect?.()}attributeChangedCallback(e,t,n){t!==n&&this._initialised&&(this._options[this._attrToOption(e)]=this._parseAttrValue(n),this._onAttributeChange?.(e,t,n))}_onBeforeMount(){}_onUpdated(){}_onBeforeUnmount(){}_mergeOptions(){const e={...this.constructor.defaults};for(const t of this.attributes){e[this._attrToOption(t.name)]=this._parseAttrValue(t.value)}return e}_attrToOption(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_parseAttrValue(e){if(""===e||"true"===e)return!0;if("false"===e)return!1;if(!isNaN(e)&&""!==e)return Number(e);try{return JSON.parse(e)}catch{return e}}_injectStyles(){const e=document.createElement("style");e.textContent=this._getStyles(),this.shadowRoot.appendChild(e)}_getStyles(){return this.constructor.styles||""}_render(){}_bindEvents(){}_addEventListener(e,t,n,s){e.addEventListener(t,n,s),this._eventHandlers.push({element:e,event:t,handler:n,options:s})}_cleanup(){for(const{element:e,event:t,handler:n,options:s}of this._eventHandlers)e.removeEventListener(t,n,s);this._eventHandlers=[]}_emit(e,t={}){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}setOptions(e){return this._options={...this._options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}destroy(){this._cleanup(),this.remove()}}const Es=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),Ss={"domma-badge":{make:(e,t)=>new Cn(e,t),attrs:["variant","size","pill","outline","removable","pulse"],methods:["setVariant","setSize","setText"]},"domma-number-badge":{make:(e,t)=>new En(e,t),attrs:["count","max","variant","dot","pulse","border-color","label"],numbers:["count","max"],methods:["setCount","increment","decrement","getCount","setDot","setVariant","setPulse"]},"domma-tooltip":{make:(e,t)=>new xn(e,t),attrs:["content","position","placement","trigger","delay","hide-delay","animation","offset","html","visible","max-width"],numbers:["delay","hideDelay","offset"],methods:["show","hide","toggle","isVisible","setContent","setPosition"]},"domma-loader":{make:(e,t)=>new Tn(e,t),attrs:["type","size","color","overlay","text","centered","visible"],methods:["show","hide","toggle","isVisible","setText","setType","setSize","setColor"],visible:!0},"domma-back-to-top":{make:(e,t)=>new Bn(e,t),attrs:["show-after","duration","position","offset","target","z-index","label"],numbers:["showAfter","duration","offset","zIndex"],methods:["scroll","show","hide","toggle","isVisible","getButton","setShowAfter","setPosition","setOffset"]},"domma-card":{make:(e,t)=>new rn(e,t),attrs:["hoverable","shadow","rounded","animation","animation-duration","collapsible","collapsed","persist-key","title","icon"],numbers:["animationDuration"],methods:["collapse","expand","toggle","isCollapsed","setShadow","setHoverable","setContent","getBody","updateHeight"]},"domma-modal":{make:(e,t)=>new pn(e,t),attrs:["backdrop","backdrop-close","keyboard","animation","animation-duration","close-button","size","centered","scrollable","title","footer","visible"],numbers:["animationDuration"],methods:["open","close","toggle","isOpen","setTitle","setContent","setButtons"]}},$s=Object.keys(Ss),zs=$s.join(",");function Ts(e,t,n){if(null!==n)return""===n||"true"===n||"false"!==n&&((e.numbers||[]).includes(t)&&""!==n.trim()&&!isNaN(n)?Number(n):n)}function Bs(e){const t="undefined"==typeof HTMLElement?class{}:HTMLElement;class n extends t{static get observedAttributes(){return e.attrs}connectedCallback(){this.dommaInstance||(this.dommaInstance=e.make(this,function(e,t){const n={};for(const s of t.attrs)e.hasAttribute(s)&&(n[Es(s)]=Ts(t,Es(s),e.getAttribute(s)));return n}(this,e)))}attributeChangedCallback(t,n,s){if(!this.dommaInstance||n===s)return;const i=Es(t);this.dommaInstance.setOptions({[i]:Ts(e,i,s)})}get instance(){return this.dommaInstance}setOptions(e){return this.dommaInstance?.setOptions(e),this}destroy(){this.dommaInstance?.destroy(),this.dommaInstance=null}}for(const t of e.methods)n.prototype[t]=function(...e){const n=this.dommaInstance;if(!n)return;const s=n[t](...e);return s===n?this:s};return n}let js=!1,Os=null;function Ds(){if(!js&&"undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement){js=!0,Os?.disconnect(),Os=null;for(const[e,t]of Object.entries(Ss))customElements.get(e)||customElements.define(e,Bs(t))}}if("undefined"!=typeof document&&"undefined"!=typeof customElements){const e=()=>{!function(e=("undefined"!=typeof document?document:null)){!js&&e&&"function"==typeof e.querySelector&&e.querySelector(zs)&&Ds()}(),!js&&"undefined"!=typeof MutationObserver&&document.documentElement&&(Os=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)if(1===e.nodeType&&($s.includes(e.localName)||e.querySelector?.(zs)))return void Ds()}),Os.observe(document.documentElement,{childList:!0,subtree:!0}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}function Ns(e){if(!e.length)return null;const t=e[0],n=e.slice();return Object.defineProperty(t,"all",{value:()=>n.slice(),configurable:!0,writable:!0}),t}class Is extends C{static componentName="tabs";static defaults={active:0,animation:"fade",animationDuration:200,tabSelector:".tab-item, [data-tab]",panelSelector:".tab-panel, [data-panel]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._activeIndex=this.options.active,this._init()}_init(){if(!this.element)return;const e=this.options;this._tabs=this.element.querySelectorAll(e.tabSelector),this._panels=this.element.querySelectorAll(e.panelSelector);const t=this.element.querySelector(".tabs-list, .tab-list, .nav-tabs, [data-tab-list]")||this.element;t.hasAttribute("role")||t.setAttribute("role","tablist"),this._tabs.forEach((e,t)=>{e.hasAttribute("role")||e.setAttribute("role","tab");const n=this._panels[t];n&&(n.hasAttribute("role")||n.setAttribute("role","tabpanel"),e.id||(e.id="dm-tab-"+Math.random().toString(36).substring(2,9)),n.id||(n.id="dm-panel-"+Math.random().toString(36).substring(2,9)),e.hasAttribute("aria-controls")||e.setAttribute("aria-controls",n.id),n.hasAttribute("aria-labelledby")||n.setAttribute("aria-labelledby",e.id)),this._addEventListener(e,"click",e=>{e.preventDefault(),this.activate(t)})}),this._updateState()}activate(e){if("string"==typeof e){const t=Array.from(this._tabs).findIndex(t=>t.dataset?.tab===e||t.getAttribute("data-tab")===e||t.getAttribute("href")===e||t.getAttribute("href")===`#${e}`);e=-1!==t?t:Number(e)}if(e===this._activeIndex)return this;if(e<0||e>=this._tabs.length)return this;this.options;const t=this._activeIndex;return this._activeIndex=e,this._updateState(),this._fire("change",{index:e,oldIndex:t,tab:this._tabs[e],panel:this._panels[e]}),this}_updateState(){const e=this.options;this._tabs.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-selected",s?"true":"false"),t.setAttribute("tabindex",s?"0":"-1"),s?t.classList.add(e.activeClass):t.classList.remove(e.activeClass)}),this._panels.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-hidden",s?"false":"true"),s?(t.style.display="block","fade"===e.animation&&(t.style.opacity="0",t.style.transition=`opacity ${e.animationDuration}ms ease`,t.offsetHeight,t.style.opacity="1")):t.style.display="none"})}getActive(){return this._activeIndex}show(e){return this.activate(e)}next(){const e=(this._activeIndex+1)%this._tabs.length;return this.activate(e)}prev(){const e=(this._activeIndex-1+this._tabs.length)%this._tabs.length;return this.activate(e)}}class Hs extends C{static componentName="accordion";static defaults={allowMultiple:!1,multiExpand:null,activeIndex:null,animation:!0,animationDuration:300,headerSelector:".accordion-header, [data-accordion-header]",contentSelector:".accordion-body, .accordion-content, [data-accordion-content]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),null!==this.options.multiExpand&&(this.options.allowMultiple=this.options.multiExpand),this._init()}_init(){if(!this.element)return;const e=this.options;this._headers=this.element.querySelectorAll(e.headerSelector);const t=[...this.element.querySelectorAll(e.contentSelector)];this._contents=t.filter(e=>!t.some(t=>t!==e&&t.contains(e))),this._contents.forEach((t,n)=>{const s=this._headers[n];s&&(s.hasAttribute("role")||"BUTTON"===s.tagName||s.setAttribute("role","button"),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.id||(s.id="dm-accordion-hdr-"+Math.random().toString(36).substring(2,9)),t.id||(t.id="dm-accordion-body-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-controls")||s.setAttribute("aria-controls",t.id),t.hasAttribute("aria-labelledby")||t.setAttribute("aria-labelledby",s.id),t.hasAttribute("role")||t.setAttribute("role","region")),t.style.overflow="hidden",t.style.transition=e.animation?`height ${e.animationDuration}ms ease`:"none";const i=s?.parentElement;let o=i?.classList.contains(e.activeClass);null!==e.activeIndex&&(o=Array.isArray(e.activeIndex)?e.activeIndex.includes(n):e.activeIndex===n,o?i?.classList.add(e.activeClass):i?.classList.remove(e.activeClass)),s&&s.setAttribute("aria-expanded",o?"true":"false"),t.setAttribute("aria-hidden",o?"false":"true"),t.style.height=o?"auto":"0"}),this._headers.forEach((e,t)=>{this._addEventListener(e,"click",()=>{this.toggle(t)}),this._addEventListener(e,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle(t))})})}toggle(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement,o=i?.classList.contains(t.activeClass);return t.allowMultiple||this._headers.forEach((t,n)=>{n!==e&&this._close(n)}),o?this._close(e):this._open(e),this._fire("change",{index:e,isOpen:!o,header:n,content:s}),this}_open(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement;n&&n.setAttribute("aria-expanded","true"),s&&s.setAttribute("aria-hidden","false"),i?.classList.add(t.activeClass),s.style.height=s.scrollHeight+"px",setTimeout(()=>{s.style.height="auto"},t.animationDuration)}_close(e){const t=this.options,n=this._headers[e],s=this._contents[e],i=n?.parentElement;n&&n.setAttribute("aria-expanded","false"),s&&s.setAttribute("aria-hidden","true"),i?.classList.remove(t.activeClass),s.style.height=s.scrollHeight+"px",s.offsetHeight,s.style.height="0"}open(e){return e>=0&&e<this._headers.length&&this._open(e),this}close(e){return e>=0&&e<this._headers.length&&this._close(e),this}openAll(){return this._headers.forEach((e,t)=>this._open(t)),this}closeAll(){return this._headers.forEach((e,t)=>this._close(t)),this}}class Ws extends C{static componentName="list-group";static defaults={selectable:!1,multiSelect:!1,activeClass:"active",disabledClass:"disabled",itemSelector:".list-group-item",keyboard:!0,loop:!0,focusOnInit:!1,onChange:null,onSelect:null,onDeselect:null};constructor(e,t={}){super(e,t),this._items=[],this._focusedIndex=-1,this._init()}_init(){if(this.element&&(this.refresh(),this.options.selectable&&(this.element.setAttribute("role","listbox"),this.options.multiSelect&&this.element.setAttribute("aria-multiselectable","true")),this._addEventListener(this.element,"click",e=>{if(!this.options.selectable)return;const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;if(t.classList.contains(this.options.disabledClass))return;const n=this._items.indexOf(t);-1!==n&&this._handleItemClick(n,e)}),this._addEventListener(this.element,"focusin",e=>{const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;const n=this._items.indexOf(t);-1!==n&&(this._focusedIndex=n)}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)&&e.setAttribute("aria-disabled","true")}),this.options.keyboard&&this._setupKeyboard(),this._initTabindex(),this.options.focusOnInit&&this._items.length>0)){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));-1!==e&&this._moveFocus(e)}}_initTabindex(){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));this._items.forEach((t,n)=>{t.setAttribute("tabindex",n===e?"0":"-1")}),-1!==e&&(this._focusedIndex=e)}_setupKeyboard(){this._addEventListener(this.element,"keydown",e=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,1));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,-1));break;case"Home":e.preventDefault(),this._moveFocus(this._firstEnabledIndex());break;case"End":e.preventDefault(),this._moveFocus(this._lastEnabledIndex());break;case"Enter":case" ":if(e.preventDefault(),this.options.selectable&&-1!==this._focusedIndex){const t=this._items[this._focusedIndex];t&&!t.classList.contains(this.options.disabledClass)&&this._handleItemClick(this._focusedIndex,e)}}})}_nextEnabledIndex(e,t){const n=this._items.length;if(0===n)return-1;let s=e,i=0;do{if(s+=t,this.options.loop)s=(s%n+n)%n;else{if(s<0)return this._firstEnabledIndex();if(s>=n)return this._lastEnabledIndex()}if(i++,i>n)return-1}while(this._items[s].classList.contains(this.options.disabledClass));return s}_firstEnabledIndex(){return this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass))}_lastEnabledIndex(){for(let e=this._items.length-1;e>=0;e--)if(!this._items[e].classList.contains(this.options.disabledClass))return e;return-1}_moveFocus(e){-1===e||e>=this._items.length||(-1!==this._focusedIndex&&this._items[this._focusedIndex]&&this._items[this._focusedIndex].setAttribute("tabindex","-1"),this._items[e].setAttribute("tabindex","0"),this._items[e].focus({preventScroll:!0}),this._focusedIndex=e)}_handleItemClick(e,t){const n=this._items[e],s=n.classList.contains(this.options.activeClass);if(this.options.multiSelect)s?(n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this._fire("deselect",n,e,t)):(n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this._fire("select",n,e,t));else{if(this._items.filter((t,n)=>n!==e&&t.classList.contains(this.options.activeClass)).forEach(e=>{e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false");const n=this._items.indexOf(e);this._fire("deselect",e,n,t)}),s)return n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this._fire("deselect",n,e,t),void this._fire("change",this.getSelected(),t);n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this._fire("select",n,e,t)}this._fire("change",this.getSelected(),t)}_updateAriaSelected(){this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",String(e.classList.contains(this.options.activeClass)))})}select(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.contains(this.options.disabledClass)||(this.options.multiSelect||this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this._fire("deselect",e,t,null))}),t.classList.add(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","true"),this._fire("select",t,e,null),this._fire("change",this.getSelected(),null)),this}deselect(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","false"),this._fire("deselect",t,e,null),this._fire("change",this.getSelected(),null),this}toggle(e){if(e<0||e>=this._items.length)return this;return this._items[e].classList.contains(this.options.activeClass)?this.deselect(e):this.select(e)}selectAll(){return this.options.multiSelect?(this._items.forEach((e,t)=>{e.classList.contains(this.options.disabledClass)||(e.classList.add(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","true"),this._fire("select",e,t,null))}),this._fire("change",this.getSelected(),null),this):this}deselectAll(){return this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this._fire("deselect",e,t,null))}),this._fire("change",this.getSelected(),null),this}getSelected(){return this._items.filter(e=>e.classList.contains(this.options.activeClass))}isSelected(e){return!(e<0||e>=this._items.length)&&this._items[e].classList.contains(this.options.activeClass)}enable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.disabledClass),t.removeAttribute("aria-disabled"),this}disable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.add(this.options.disabledClass),t.setAttribute("aria-disabled","true"),this}getItems(){return[...this._items]}getItem(e){return this._items[e]||null}refresh(){return this.element?(this._items=Array.from(this.element.querySelectorAll(this.options.itemSelector)),this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",e.classList.contains(this.options.activeClass)?"true":"false")}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}),this._initTabindex(),this):this}destroy(){this._items.forEach(e=>{e.removeAttribute("tabindex"),e.removeAttribute("aria-disabled")}),this.options.selectable&&(this.element.removeAttribute("role"),this.element.removeAttribute("aria-multiselectable"),this._items.forEach(e=>{e.removeAttribute("aria-selected")})),super.destroy()}}class Ps extends C{static componentName="dropdown";static defaults={trigger:"click",position:"bottom-start",offset:[0,4],animation:!0,animationDuration:150,hoverOpenDelay:0,hoverCloseDelay:300,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOthers:!0,flip:!0,items:[],model:null,modelKey:null,itemTemplate:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onSelect:null};static _open=new Set;constructor(e,t={}){super(e,t),this._menu=null,this._isOpen=!1,this._items=[...this.options.items],this._selectedValue=null,this._modelUnsubscribe=null,this._hoverOpenTimer=null,this._hoverCloseTimer=null,this._removeTimer=null,this._init()}_init(){if(!this.element)return;const e=this.options;this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._addEventListener(this.element,"click",()=>{"hover"===e.trigger?this.open():this.toggle()}),"hover"===e.trigger&&(this._addEventListener(this.element,"mouseenter",()=>this._hoverIn()),this._addEventListener(this.element,"mouseleave",()=>this._hoverOut())),e.closeOnClickOutside&&(this._outsideClickHandler=e=>{this._isOpen&&(this.element.contains(e.target)||this._menu&&this._menu.contains(e.target)||this.close())},document.addEventListener("click",this._outsideClickHandler)),e.closeOnEscape&&(this._keydownHandler=e=>{"Escape"===e.key&&this._isOpen&&(this.close(),"function"==typeof this.element.focus&&this.element.focus())},document.addEventListener("keydown",this._keydownHandler)),e.model&&e.modelKey&&this._bindToModel(e.model,e.modelKey)}_bindToModel(e,t){if(e&&"function"==typeof e.get){const n=e.get(t);Array.isArray(n)&&(this._items=[...n]);const s=e=>{Array.isArray(e)&&(this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()))};"function"==typeof e.onFieldChange?this._modelUnsubscribe=e.onFieldChange(t,s):"function"==typeof e.onChange&&(this._modelUnsubscribe=e.onChange(({field:e,newValue:n})=>{e===t&&s(n)}))}}open(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen&&!1===this._fire("beforeopen",this))return this;if(this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),this._isOpen)return this;return this.options.closeOthers&&Ps._open.forEach(e=>{e!==this&&e.close()}),this._fire("open",this),this._menu?(this._renderMenu(),this._menu.style.pointerEvents="",this._menu.classList.add("show")):this._createMenu(),this._isOpen=!0,Ps._open.add(this),this.element.setAttribute("aria-expanded","true"),this._positionMenu(),this._bindOpenListeners(),this}close(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen)return this;if(!this._mayClose(this))return this;const e=this.options,t=e.animation?e.animationDuration:0;this._isOpen=!1,Ps._open.delete(this),this.element.setAttribute("aria-expanded","false"),this._unbindOpenListeners();const n=this._menu;return n&&(n.classList.remove("show"),n.style.pointerEvents="none",this._removeTimer=setTimeout(()=>{this._removeTimer=null,this._menu=null,n.remove()},t)),this._fire("close",this),this}toggle(){return this._isOpen?this.close():this.open()}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}_hoverIn(){if(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null,this._isOpen)return;const e=this.options.hoverOpenDelay;e?(clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=setTimeout(()=>this.open(),e)):this.open()}_hoverOut(){clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=null,this._scheduleHoverClose()}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{this._hoverCloseTimer=null,this.close()},this.options.hoverCloseDelay)}_pointerInSafeZone(e,t){if(!this.element)return!1;const n=this.element.getBoundingClientRect(),s=this._menu?this._menu.getBoundingClientRect():null,i=n=>!!n&&e>=n.left-2&&e<=n.right+2&&t>=n.top-2&&t<=n.bottom+2;if(i(n))return!0;if(!s)return!1;if(i(s))return!0;if(e<Math.min(n.left,s.left)-2)return!1;if(e>Math.max(n.right,s.right)+2)return!1;if(t<Math.min(n.top,s.top)-2)return!1;if(t>Math.max(n.bottom,s.bottom)+2)return!1;if(s.top>=n.bottom){if(t>=n.bottom-2&&t<=s.top+2)return!0}else if(n.top>=s.bottom&&t>=s.bottom-2&&t<=n.top+2)return!0;if(s.left>=n.right){if(e>=n.right-2&&e<=s.left+2)return!0}else if(n.left>=s.right&&e>=s.right-2&&e<=n.left+2)return!0;return!1}_bindOpenListeners(){this._openListenersBound||(this._openListenersBound=!0,this._repositionHandler=()=>this._positionMenu(),window.addEventListener("resize",this._repositionHandler),window.addEventListener("scroll",this._repositionHandler,!0),"hover"===this.options.trigger&&(this._pointerMoveHandler=e=>{this._isOpen&&(this._pointerInSafeZone(e.clientX,e.clientY)?(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null):this._hoverCloseTimer||this._scheduleHoverClose())},document.addEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerLeaveHandler=()=>this._scheduleHoverClose(),document.documentElement.addEventListener("mouseleave",this._pointerLeaveHandler)))}_unbindOpenListeners(){this._openListenersBound&&(this._openListenersBound=!1,this._repositionHandler&&(window.removeEventListener("resize",this._repositionHandler),window.removeEventListener("scroll",this._repositionHandler,!0),this._repositionHandler=null),this._pointerMoveHandler&&(document.removeEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerMoveHandler=null),this._pointerLeaveHandler&&(document.documentElement.removeEventListener("mouseleave",this._pointerLeaveHandler),this._pointerLeaveHandler=null))}_createMenu(){const e=this.options;this._menu=document.createElement("div"),this._menu.className="domma-dropdown-menu",this._menu.setAttribute("role","menu"),this._renderMenu(),document.body.appendChild(this._menu),this._addEventListener(this._menu,"click",e=>{const t=e.target.closest(".domma-dropdown-item");if(!t||!this._menu||!this._menu.contains(t))return;if(t.classList.contains("disabled"))return;const n=Number(t.dataset.index);this._selectItem(this._items[n],n,t.dataset.value)}),"hover"===e.trigger&&(this._addEventListener(this._menu,"mouseenter",()=>{clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null}),this._addEventListener(this._menu,"mouseleave",()=>this._scheduleHoverClose())),this._menu.offsetHeight,this._menu.classList.add("show")}_renderMenu(){if(!this._menu)return;const e=this.options;this._menu.innerHTML="",this._items.forEach((t,n)=>{const s=document.createElement("div");if(s.className="domma-dropdown-item",s.setAttribute("role","menuitem"),s.dataset.index=n,"string"==typeof t)s.textContent=t,s.dataset.value=t;else{if(t.divider)return s.className="domma-dropdown-divider",s.setAttribute("role","separator"),void this._menu.appendChild(s);if(t.header)return s.className="domma-dropdown-header",s.setAttribute("role","presentation"),s.textContent=t.header,void this._menu.appendChild(s);if(e.itemTemplate?s.innerHTML=e.itemTemplate(t,n):s.textContent=t.label||t.text||t.name||"",s.dataset.value=void 0!==t.value?t.value:n,t.disabled&&(s.classList.add("disabled"),s.setAttribute("aria-disabled","true")),t.icon){const e=document.createElement("span");e.className="domma-dropdown-icon",e.innerHTML=t.icon,s.insertBefore(e,s.firstChild)}}this._menu.appendChild(s)})}_selectItem(e,t,n){const s=this.options;if(this._selectedValue=n,this._fire("select",{item:e,index:t,value:n},this),s.model&&s.modelKey&&"function"==typeof s.model.set){const e=s.selectedKey||s.modelKey+"_selected";s.model.set(e,n)}s.closeOnSelect&&this.close()}_positionMenu(){if(!this._menu||!this.element)return;Ze(this.element,this._menu);const e=this.options,t=this.element.getBoundingClientRect(),[n,s]=e.offset,i=this._menu.offsetWidth,o=this._menu.offsetHeight,r=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=e=>{switch(e){case"bottom-end":return[t.bottom+s,t.right-i+n];case"top-start":return[t.top-o-s,t.left+n];case"top-end":return[t.top-o-s,t.right-i+n];case"left-start":return[t.top+s,t.left-i-n];case"left-end":return[t.bottom-o+s,t.left-i-n];case"right-start":return[t.top+s,t.right+n];case"right-end":return[t.bottom-o+s,t.right+n];default:return[t.bottom+s,t.left+n]}},c=String(e.position||"bottom-start").split("-"),h=["bottom","top","left","right"].includes(c[0])?c[0]:"bottom",d="end"===c[1]?"end":"start";let[u,p]=l(`${h}-${d}`);if(e.flip){const e={bottom:"top",top:"bottom",left:"right",right:"left"},c=a-8-(t.bottom+s),m=t.top-s-8,f=r-8-(t.right+n),_=t.left-n-8;("bottom"===h&&o>c&&m>=o||"top"===h&&o>m&&c>=o||"right"===h&&i>f&&_>=i||"left"===h&&i>_&&f>=i)&&([u,p]=l(`${e[h]}-${d}`)),i<=r-16&&(p=Math.max(8,Math.min(p,r-i-8))),o<=a-16&&(u=Math.max(8,Math.min(u,a-o-8)))}u+=window.scrollY,p+=window.scrollX,this._menu.style.top=u+"px",this._menu.style.left=p+"px"}setItems(e){return this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()),this}addItem(e){return this._items.push(e),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}removeItem(e){return this._items.splice(e,1),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}getSelected(){return this._selectedValue}isOpen(){return this._isOpen}destroy(){super.destroy(),clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),clearTimeout(this._removeTimer),this._unbindOpenListeners(),Ps._open.delete(this),this._outsideClickHandler&&(document.removeEventListener("click",this._outsideClickHandler),this._outsideClickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this._modelUnsubscribe&&"function"==typeof this._modelUnsubscribe&&this._modelUnsubscribe(),this._menu&&(this._menu.remove(),this._menu=null),this._isOpen=!1}}class Fs{static permission="undefined"!=typeof Notification?Notification.permission:"denied";static isSupported="undefined"!=typeof Notification;static _instances=[];static defaults={title:"Notification",body:"",icon:null,badge:null,tag:null,requireInteraction:!1,silent:!1,data:null,onClick:null,onClose:null,onError:null,onShow:null};static async requestPermission(){if(!Fs.isSupported)return console.warn("Notifications are not supported in this browser"),"denied";try{const e=await Notification.requestPermission();return Fs.permission=e,e}catch(e){return console.error("Error requesting notification permission:",e),"denied"}}static notify(e,t={}){const n=new Fs({title:e,...t});return n.show(),n}static closeAll(){Fs._instances.forEach(e=>{e.isShown()&&e.close()}),Fs._instances=[]}constructor(e={}){this.options={...Fs.defaults,...e},this.notification=null,this._shown=!1}async show(){if(!Fs.isSupported)return console.warn("Notifications are not supported in this browser"),this.options.onError&&this.options.onError(new Error("Notifications not supported")),this;if("granted"!==Fs.permission){if("default"!==Fs.permission)return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this;if("granted"!==await Fs.requestPermission())return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this}try{const e={};this.options.body&&(e.body=this.options.body),this.options.icon&&(e.icon=this.options.icon),this.options.badge&&(e.badge=this.options.badge),this.options.tag&&(e.tag=this.options.tag),void 0!==this.options.requireInteraction&&(e.requireInteraction=this.options.requireInteraction),void 0!==this.options.silent&&(e.silent=this.options.silent),this.options.data&&(e.data=this.options.data),this.notification=new Notification(this.options.title,e),this._shown=!0,Fs._instances.push(this),this.options.onClick&&(this.notification.onclick=e=>{this.options.onClick(e,this)}),this.options.onClose?this.notification.onclose=e=>{this._shown=!1;const t=Fs._instances.indexOf(this);t>-1&&Fs._instances.splice(t,1),this.options.onClose(e,this)}:this.notification.onclose=()=>{this._shown=!1;const e=Fs._instances.indexOf(this);e>-1&&Fs._instances.splice(e,1)},this.options.onError&&(this.notification.onerror=e=>{this._shown=!1,this.options.onError(e,this)}),this.options.onShow&&(this.notification.onshow=e=>{this.options.onShow(e,this)})}catch(e){console.error("Error showing notification:",e),this.options.onError&&this.options.onError(e)}return this}close(){return this.notification&&this._shown&&(this.notification.close(),this._shown=!1),this}isShown(){return this._shown}}class Rs extends C{static componentName="timer";static defaults={duration:6e4,autoStart:!1,format:"mm:ss",showControls:!1,updateInterval:100,notification:!1,notificationOptions:{},sound:!1,soundUrl:null,onTick:null,onComplete:null,onStart:null,onPause:null,onReset:null};constructor(e,t={}){super(e,t),e||(this.element=null,this.options={...Rs.defaults,...t}),this._running=!1,this._remaining=this.options.duration,this._intervalId=null,this._startTime=null,this._pausedTime=null,this._display=null,this._controls=null,this._audio=null,this._init()}_init(){this.element&&(this._createDisplay(),this.options.showControls&&this._createControls()),this.options.sound&&this.options.soundUrl&&(this._audio=new Audio(this.options.soundUrl)),this.options.autoStart&&this.start()}_createDisplay(){if(!this.element)return;const e=document.createElement("div");e.className="dm-timer",this._display=document.createElement("div"),this._display.className="dm-timer-display";const t=document.createElement("span");t.className="dm-timer-time",t.textContent=this._formatTime(this._remaining),this._display.appendChild(t),e.appendChild(this._display),this.element.innerHTML="",this.element.appendChild(e),this._container=e}_createControls(){if(!this.element||!this._container)return;const e=document.createElement("div");e.className="dm-timer-controls",this._startBtn=document.createElement("button"),this._startBtn.className="dm-timer-button dm-timer-start",this._startBtn.textContent="Start",this._startBtn.addEventListener("click",()=>this.start()),this._pauseBtn=document.createElement("button"),this._pauseBtn.className="dm-timer-button dm-timer-pause",this._pauseBtn.textContent="Pause",this._pauseBtn.style.display="none",this._pauseBtn.addEventListener("click",()=>this.pause()),this._resetBtn=document.createElement("button"),this._resetBtn.className="dm-timer-button dm-timer-reset",this._resetBtn.textContent="Reset",this._resetBtn.addEventListener("click",()=>this.reset()),e.appendChild(this._startBtn),e.appendChild(this._pauseBtn),e.appendChild(this._resetBtn),this._container.appendChild(e),this._controls=e}_updateDisplay(){if(!this._display)return;const e=this._display.querySelector(".dm-timer-time");e&&(e.textContent=this._formatTime(this._remaining))}_formatTime(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60,o=this.options.format.toLowerCase();if("hh:mm:ss"===o)return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`;if("mm:ss"===o){const e=Math.floor(t/60);return`${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`}return"ss"===o?String(t).padStart(2,"0"):`${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`}_tick(){if(!this._running)return;const e=Date.now()-this._startTime;this._remaining=Math.max(0,this.options.duration-e),this._updateDisplay(),this._fire("tick",this._remaining),0===this._remaining&&this._complete()}_complete(){if(this.stop(),this.options.sound&&this._audio&&this._audio.play().catch(e=>{console.warn("Failed to play timer sound:",e)}),this.options.notification&&Fs.isSupported){const e={title:"Timer Complete",body:"Your countdown has finished",...this.options.notificationOptions};Fs.notify(e.title,e)}this._fire("complete")}start(){return this._running||(this._running=!0,this._startTime=Date.now()-(this.options.duration-this._remaining),this._intervalId=setInterval(()=>this._tick(),this.options.updateInterval),this._startBtn&&(this._startBtn.style.display="none"),this._pauseBtn&&(this._pauseBtn.style.display="inline-block"),this._fire("start")),this}pause(){return this._running?(this._running=!1,this._pausedTime=Date.now(),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this._fire("pause"),this):this}reset(){return this.stop(),this._remaining=this.options.duration,this._updateDisplay(),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this._fire("reset"),this}stop(){return this._running=!1,this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this}add(e){return this._remaining=Math.min(this._remaining+e,864e5),this._updateDisplay(),this}subtract(e){return this._remaining=Math.max(0,this._remaining-e),this._updateDisplay(),0===this._remaining&&this._running&&this._complete(),this}setDuration(e){return this.options.duration=e,this._running||(this._remaining=e,this._updateDisplay()),this}isRunning(){return this._running}getRemaining(){return this._remaining}getElapsed(){return this.options.duration-this._remaining}destroy(){this.stop(),this._startBtn&&this._startBtn.removeEventListener("click",this.start),this._pauseBtn&&this._pauseBtn.removeEventListener("click",this.pause),this._resetBtn&&this._resetBtn.removeEventListener("click",this.reset),this.element&&this._container&&this.element.removeChild(this._container),this._display=null,this._controls=null,this._audio=null,this._container=null,super.destroy&&super.destroy()}}class Vs{static defaults={alarms:[],timezone:"local",checkInterval:3e4,storageKey:"domma-alarms",onTrigger:null,onSnooze:null,onDismiss:null,onAlarmAdd:null,onAlarmRemove:null};static _instance=null;static _checkInterval=null;static _nextAlarmId=1;constructor(e={}){if(Vs._instance)return Vs._instance;this.options={...Vs.defaults,...e},this._alarms=[],this._init(),Vs._instance=this}_init(){this._loadAlarms(),this._startChecking()}_loadAlarms(){try{const e=localStorage.getItem(this.options.storageKey);if(e){const t=JSON.parse(e);if(this._alarms=Array.isArray(t)?t:[],this._alarms.length>0){const e=Math.max(...this._alarms.map(e=>{const t=String(e.id).match(/\d+$/);return t?parseInt(t[0]):0}));Vs._nextAlarmId=e+1}}else this.options.alarms&&this.options.alarms.length>0&&(this._alarms=this.options.alarms.map(e=>({id:"alarm-"+Vs._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e})),this._saveAlarms())}catch(e){console.error("Failed to load alarms from localStorage:",e),this._alarms=[]}}_saveAlarms(){try{localStorage.setItem(this.options.storageKey,JSON.stringify(this._alarms))}catch(e){console.error("Failed to save alarms to localStorage:",e)}}_startChecking(){Vs._checkInterval||(Vs._checkInterval=setInterval(()=>{this._checkAlarms()},this.options.checkInterval),this._checkAlarms())}_stopChecking(){Vs._checkInterval&&(clearInterval(Vs._checkInterval),Vs._checkInterval=null)}_checkAlarms(){const e=new Date;this._alarms.forEach(t=>{t.enabled&&(t.snoozedUntil&&e<new Date(t.snoozedUntil)||(t.snoozedUntil&&e>=new Date(t.snoozedUntil)&&(t.snoozedUntil=null,this._saveAlarms()),this._shouldTrigger(t,e)&&this._triggerAlarm(t)))})}_shouldTrigger(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),i=t.getHours(),o=t.getMinutes();if(i!==n||o!==s)return!1;if(e.lastTriggered){if(t-new Date(e.lastTriggered)<5e4)return!1}return!!this._matchesRepeatPattern(e,t)}_parseTime(e){const[t,n]=e.split(":").map(e=>parseInt(e,10));return{hours:t,minutes:n}}_matchesRepeatPattern(e,t){if(!e.repeat)return!0;const n=t.getDay();if("daily"===e.repeat)return!0;if("weekdays"===e.repeat)return n>=1&&n<=5;if("weekends"===e.repeat)return 0===n||6===n;if(Array.isArray(e.repeat)){const t=["sun","mon","tue","wed","thu","fri","sat"][n];return e.repeat.includes(t)}return!1}_triggerAlarm(e){if(e.lastTriggered=Date.now(),this._saveAlarms(),e.sound&&e.soundUrl){new Audio(e.soundUrl).play().catch(e=>{console.warn("Failed to play alarm sound:",e)})}if(e.notification&&Fs.isSupported){const t={title:"Alarm",body:e.label||`Alarm at ${e.time}`,requireInteraction:!0,...e.notificationOptions};Fs.notify(t.title,t)}this.options.onTrigger&&this.options.onTrigger(e),e.repeat||(e.enabled=!1,this._saveAlarms())}add(e){const t={id:"alarm-"+Vs._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e};return this._alarms.push(t),this._saveAlarms(),this.options.onAlarmAdd&&this.options.onAlarmAdd(t),t}removeAlarm(e){const t=this._alarms.findIndex(t=>t.id===e);if(-1===t)return!1;const n=this._alarms.splice(t,1)[0];return this._saveAlarms(),this.options.onAlarmRemove&&this.options.onAlarmRemove(n),!0}remove(e){return this.removeAlarm(e)}update(e,t){const n=this._alarms.find(t=>t.id===e);return n?(Object.assign(n,t),this._saveAlarms(),n):null}enable(e){return null!==this.update(e,{enabled:!0})}disable(e){return null!==this.update(e,{enabled:!1})}toggle(e){const t=this._alarms.find(t=>t.id===e);return t?(t.enabled=!t.enabled,this._saveAlarms(),t.enabled):null}snooze(e,t=3e5){const n=this._alarms.find(t=>t.id===e);return!!n&&(n.snoozedUntil=Date.now()+t,this._saveAlarms(),this.options.onSnooze&&this.options.onSnooze(n,t),!0)}getAlarms(){return[...this._alarms]}getAlarm(e){return this._alarms.find(t=>t.id===e)||null}getNextAlarm(){const e=new Date;let t=null,n=null;return this._alarms.forEach(s=>{if(!s.enabled)return;const i=this._getNextOccurrence(s,e);i&&(!n||i<n)&&(n=i,t={...s,nextTrigger:i})}),t}_getNextOccurrence(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),i=new Date(t),o=new Date(i);o.setHours(n,s,0,0),o<=i&&o.setDate(o.getDate()+1);for(let t=0;t<7;t++){if(this._matchesRepeatPattern(e,o))return o;o.setDate(o.getDate()+1)}return null}clearAll(){return this._alarms=[],this._saveAlarms(),this}destroy(){this._stopChecking(),this._alarms=[],Vs._instance=null}}class qs extends C{static componentName="carousel";static defaults={autoplay:!1,interval:5e3,pauseOnHover:!0,loop:!0,animation:"slide",animationDuration:500,animationEasing:"ease",heightMode:"crop",height:null,showArrows:!0,showIndicators:!0,slideSelector:".carousel-slide, [data-slide]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._currentIndex=0,this._autoplayTimer=null,this._isAnimating=!1,this._init()}_init(){if(!this.element)return;const e=this.options;if(this._slides=this.element.querySelectorAll(e.slideSelector),this._track=this.element.querySelector(".carousel-track"),0===this._slides.length)return;this.element.style.position="relative",this.element.style.overflow="hidden";const t="fade"===e.animation||"crossfade"===e.animation;this._slides.forEach((n,s)=>{t?(n.style.position=0===s?"relative":"absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.opacity=0===s?"1":"0",n.style.zIndex=0===s?"1":"0",n.style.transition=`opacity ${e.animationDuration}ms ${e.animationEasing}`):(n.style.position="relative",n.style.width="100%",n.style.flexShrink="0")}),"slide"===e.animation&&this._track&&(this._track.style.display="flex",this._track.style.transition=`transform ${e.animationDuration}ms ${e.animationEasing}`),this._initHeight(),e.showArrows&&this._createArrows(),e.showIndicators&&this._createIndicators(),e.autoplay&&(this._startAutoplay(),e.pauseOnHover&&(this._addEventListener(this.element,"mouseenter",()=>this._stopAutoplay()),this._addEventListener(this.element,"mouseleave",()=>this._startAutoplay()))),this._addEventListener(this.element,"keydown",e=>{"ArrowLeft"===e.key&&this.prev(),"ArrowRight"===e.key&&this.next()}),this.element.tabIndex=0,this._updateState()}_initHeight(){this._images=Array.from(this._slides,e=>e.querySelector(":scope > img")).filter(Boolean),this._originalHeight=this.element.style.getPropertyValue("--dm-carousel-height"),this._originalHeightPriority=this.element.style.getPropertyPriority("--dm-carousel-height"),this._wasSized=this.element.classList.contains("carousel-sized");const e=()=>this._sizeSlides();for(const t of this._images)this._addEventListener(t,"load",e),this._addEventListener(t,"error",e);"undefined"!=typeof ResizeObserver?(this._heightObserver=new ResizeObserver(e),this._heightObserver.observe(this.element)):this._addEventListener(window,"resize",e),e()}_sizeSlides(){const e=this.element.clientWidth,t=Number(this.options.height);let n=t>0&&Number.isFinite(t)?t:0;if(!n){const t=this._images.filter(e=>e.naturalWidth>0&&e.naturalHeight>0).map(t=>e*t.naturalHeight/t.naturalWidth);if(!t.length||!e)return;const s=Math.min(...t);n="average"===this.options.heightMode?(s+Math.max(...t))/2:s;for(const e of this._slides)if(!e.querySelector(":scope > img")){const t=e.style.height;e.style.height="auto",n=Math.max(n,e.scrollHeight),e.style.height=t}}const s=`${n}px`;this.element.style.getPropertyValue("--dm-carousel-height")!==s&&this.element.style.setProperty("--dm-carousel-height",s),this.element.classList.add("carousel-sized")}_applyOptions(){this._images&&this._sizeSlides()}_createArrows(){const e=document.createElement("button");e.className="carousel-arrow carousel-prev",e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>',e.style.cssText="\n position: absolute;\n top: 50%;\n left: 1rem;\n transform: translateY(-50%);\n z-index: 10;\n background: rgba(255,255,255,0.9);\n border: none;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n ",this._addEventListener(e,"click",()=>this.prev()),this._addEventListener(e,"mouseenter",()=>e.style.background="#fff"),this._addEventListener(e,"mouseleave",()=>e.style.background="rgba(255,255,255,0.9)");const t=document.createElement("button");t.className="carousel-arrow carousel-next",t.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>',t.style.cssText=e.style.cssText.replace("left: 1rem","right: 1rem"),this._addEventListener(t,"click",()=>this.next()),this._addEventListener(t,"mouseenter",()=>t.style.background="#fff"),this._addEventListener(t,"mouseleave",()=>t.style.background="rgba(255,255,255,0.9)"),this.element.appendChild(e),this.element.appendChild(t),this._prevBtn=e,this._nextBtn=t}_createIndicators(){const e=document.createElement("div");e.className="carousel-indicators",e.style.cssText="\n position: absolute;\n bottom: 1rem;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 0.5rem;\n z-index: 10;\n ",this._slides.forEach((t,n)=>{const s=document.createElement("button");s.className="carousel-indicator",s.style.cssText="\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.5);\n cursor: pointer;\n padding: 0;\n transition: all 0.2s ease;\n ",this._addEventListener(s,"click",()=>this.goTo(n)),e.appendChild(s)}),this.element.appendChild(e),this._indicators=e}_updateState(e=null){const t=this.options;if("fade"===t.animation?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):"crossfade"===t.animation?null===e||e===this._currentIndex?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):this._applyCrossfade(e,this._currentIndex):this._track&&(this._track.style.transform=`translateX(-${100*this._currentIndex}%)`),this._indicators){this._indicators.querySelectorAll(".carousel-indicator").forEach((e,t)=>{e.style.background=t===this._currentIndex?"rgba(255,255,255,1)":"rgba(255,255,255,0.5)",e.style.transform=t===this._currentIndex?"scale(1.2)":"scale(1)"})}!t.loop&&this._prevBtn&&this._nextBtn&&(this._prevBtn.style.opacity=0===this._currentIndex?"0.3":"1",this._prevBtn.style.pointerEvents=0===this._currentIndex?"none":"auto",this._nextBtn.style.opacity=this._currentIndex===this._slides.length-1?"0.3":"1",this._nextBtn.style.pointerEvents=this._currentIndex===this._slides.length-1?"none":"auto")}_applyCrossfade(e,t){const n=this._slides[e],s=this._slides[t];s.style.position="absolute",s.style.opacity="0",s.style.zIndex="2",n.style.position="relative",n.style.opacity="1",n.style.zIndex="1",this._slides.forEach((n,s)=>{s!==e&&s!==t&&(n.style.position="absolute",n.style.opacity="0",n.style.zIndex="0")}),s.offsetWidth,requestAnimationFrame(()=>{s.style.opacity="1",n.style.opacity="0"}),this._crossfadeSwapTimer&&clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=setTimeout(()=>{s.style.position="relative",s.style.zIndex="1",n.style.position="absolute",n.style.zIndex="0",this._crossfadeSwapTimer=null},this.options.animationDuration)}_startAutoplay(){this._autoplayTimer||(this._autoplayTimer=setInterval(()=>{this.next()},this.options.interval))}_stopAutoplay(){this._autoplayTimer&&(clearInterval(this._autoplayTimer),this._autoplayTimer=null)}goTo(e){if(this._isAnimating)return this;const t=this.options,n=this._currentIndex,s=this._slides.length-1;if(t.loop)e<0&&(e=s),e>s&&(e=0);else if(e<0||e>s)return this;return e===this._currentIndex||(this._isAnimating=!0,this._currentIndex=e,this._updateState(n),setTimeout(()=>{this._isAnimating=!1},t.animationDuration),this._fire("change",{index:e,oldIndex:n,slide:this._slides[e]})),this}next(){return this.goTo(this._currentIndex+1)}prev(){return this.goTo(this._currentIndex-1)}play(){return this._startAutoplay(),this}pause(){return this._stopAutoplay(),this}getIndex(){return this._currentIndex}getSlide(e=this._currentIndex){return this._slides[e]}destroy(){super.destroy(),this._stopAutoplay(),this._heightObserver?.disconnect(),this.element&&this._images&&(this._wasSized||this.element.classList.remove("carousel-sized"),this._originalHeight?this.element.style.setProperty("--dm-carousel-height",this._originalHeight,this._originalHeightPriority):this.element.style.removeProperty("--dm-carousel-height")),this._crossfadeSwapTimer&&(clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=null)}}class Us extends C{static componentName="cookie-consent";static defaults={message:'We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.',acceptAllText:"Accept All",rejectAllText:"Reject All",customizeText:"Customize",savePreferencesText:"Save Preferences",privacyPolicyText:"Privacy Policy",privacyPolicyUrl:"/privacy-policy",cookiePolicyText:"Cookie Policy",cookiePolicyUrl:null,categories:{necessary:{label:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",required:!0},functional:{label:"Functional Cookies",description:"These cookies enable personalized features and functionality.",required:!1},analytics:{label:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",required:!1},marketing:{label:"Marketing Cookies",description:"These cookies are used to deliver relevant ads and marketing campaigns.",required:!1}},position:"bottom",theme:"light",layout:"bar",animation:!0,backdrop:!1,autoShow:!0,hideAfterAction:!0,reopenSelector:"[data-cookie-consent-open]",storageKey:"domma-cookie-consent",storageDuration:365,defaultState:"undecided",requireExplicitConsent:!0,consentVersion:"1.0",onVersionMismatch:null,onAccept:null,onReject:null,onCustomize:null,onChange:null,onShow:null,onHide:null};constructor(e={}){super(null,e),this._state=null,this._preferences={},this._customizeModal=null,this._isVisible=!1,this._init()}_init(){this._loadPreferences(),this._createUI(),this._setupEventHandlers(),this.options.autoShow&&!this._hasConsented()&&this.open(),this._setupReopenTriggers()}_loadPreferences(){const e=Domma.storage.get(this.options.storageKey);if(e&&e.timestamp){if((Date.now()-e.timestamp)/864e5<=this.options.storageDuration)return e.version&&e.version!==this.options.consentVersion?(this._state="undecided",this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),void this._fire("versionmismatch",e.version,this.options.consentVersion)):(this._state=e.state,void(this._preferences=e.preferences||{}))}this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent})}_savePreferences(){Domma.storage.set(this.options.storageKey,{state:this._state,preferences:this._preferences,timestamp:Date.now(),version:this.options.consentVersion})}_hasConsented(){return"accepted"===this._state||"rejected"===this._state||"customized"===this._state}_createUI(){this.element=document.createElement("div"),this.element._dommaComponent=this,M(this.element,this),this.element.className=`dm-cookie-consent dm-cookie-consent-${this.options.position} dm-cookie-consent-${this.options.layout} dm-cookie-consent-${this.options.theme}`,this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Cookie consent"),this.element.style.display="none",this.options.animation&&this.element.classList.add("dm-cookie-consent-animated");let e='<div class="dm-cookie-consent-content">';e+=`<div class="dm-cookie-consent-message">${this.options.message}`;const t=[];this.options.privacyPolicyUrl&&t.push(`<a href="${this.options.privacyPolicyUrl}" target="_blank" rel="noopener">${this.options.privacyPolicyText}</a>`),this.options.cookiePolicyUrl&&t.push(`<a href="${this.options.cookiePolicyUrl}" target="_blank" rel="noopener">${this.options.cookiePolicyText}</a>`),t.length>0&&(e+=` ${t.join(" | ")}`),e+="</div>",e+='<div class="dm-cookie-consent-buttons">',Object.keys(this.options.categories).length>1&&(e+=`<button type="button" class="btn btn-outline dm-cookie-consent-customize">${this.options.customizeText}</button>`),e+=`<button type="button" class="btn btn-outline dm-cookie-consent-reject">${this.options.rejectAllText}</button>`,e+=`<button type="button" class="btn btn-primary dm-cookie-consent-accept">${this.options.acceptAllText}</button>`,e+="</div></div>",this.options.backdrop&&"modal"===this.options.layout&&(e=`<div class="dm-cookie-consent-backdrop"></div>${e}`),this.element.innerHTML=e,document.body.appendChild(this.element)}_createCustomizeModal(){if(this._customizeModal)return;this._customizeModal=document.createElement("div"),this._customizeModal.className="dm-cookie-consent-modal",this._customizeModal.setAttribute("role","dialog"),this._customizeModal.setAttribute("aria-label","Customize cookie preferences");let e='<div class="dm-cookie-consent-modal-content">';e+='<div class="dm-cookie-consent-modal-header">',e+="<h3>Cookie Preferences</h3>",e+='<button type="button" class="dm-cookie-consent-modal-close" aria-label="Close">×</button>',e+="</div>",e+='<div class="dm-cookie-consent-modal-body">',Object.entries(this.options.categories).forEach(([t,n])=>{const s=this._preferences[t]?"checked":"",i=n.required?"disabled":"";e+='<div class="dm-cookie-consent-category">',e+='<label class="dm-cookie-consent-category-label">',e+=`<input type="checkbox" class="dm-cookie-consent-category-toggle" data-category="${t}" ${s} ${i}>`,e+='<div class="dm-cookie-consent-category-info">',e+=`<div class="dm-cookie-consent-category-name">${n.label}`,n.required&&(e+=' <span class="dm-cookie-consent-required">(Required)</span>'),e+="</div>",e+=`<div class="dm-cookie-consent-category-description">${n.description}</div>`,e+="</div></label></div>"}),e+="</div>",e+='<div class="dm-cookie-consent-modal-footer">',e+='<button type="button" class="btn btn-outline dm-cookie-consent-modal-cancel">Cancel</button>',e+=`<button type="button" class="btn btn-primary dm-cookie-consent-modal-save">${this.options.savePreferencesText}</button>`,e+="</div></div>",e=`<div class="dm-cookie-consent-modal-backdrop"></div>${e}`,this._customizeModal.innerHTML=e,document.body.appendChild(this._customizeModal),this._setupModalHandlers()}_setupEventHandlers(){const e=this.element.querySelector(".dm-cookie-consent-accept");e&&e.addEventListener("click",()=>this.accept());const t=this.element.querySelector(".dm-cookie-consent-reject");t&&t.addEventListener("click",()=>this.reject());const n=this.element.querySelector(".dm-cookie-consent-customize");if(n&&n.addEventListener("click",()=>this.showCustomize()),this.options.backdrop&&"modal"===this.options.layout){const e=this.element.querySelector(".dm-cookie-consent-backdrop");e&&e.addEventListener("click",()=>{this.options.requireExplicitConsent||this.close()})}}_setupModalHandlers(){if(!this._customizeModal)return;const e=this._customizeModal.querySelector(".dm-cookie-consent-modal-close");e&&e.addEventListener("click",()=>this.hideCustomize());const t=this._customizeModal.querySelector(".dm-cookie-consent-modal-cancel");t&&t.addEventListener("click",()=>this.hideCustomize());const n=this._customizeModal.querySelector(".dm-cookie-consent-modal-save");n&&n.addEventListener("click",()=>this.saveCustomPreferences());const s=this._customizeModal.querySelector(".dm-cookie-consent-modal-backdrop");s&&s.addEventListener("click",()=>this.hideCustomize())}_setupReopenTriggers(){this.options.reopenSelector&&document.addEventListener("click",e=>{e.target.closest(this.options.reopenSelector)&&(e.preventDefault(),this.open())})}open(){return this._isVisible||(this.element.style.display="",this.options.animation?requestAnimationFrame(()=>{this.element.classList.add("dm-cookie-consent-visible")}):this.element.classList.add("dm-cookie-consent-visible"),this._isVisible=!0,this.options.onShow&&this.options.onShow.call(this),this._emit("show")),this}close(){if(!this._isVisible)return this;const e=()=>{this.element.style.display="none",this._isVisible=!1,this.options.onHide&&this.options.onHide.call(this),this._emit("hide")};return this.options.animation?(this.element.classList.remove("dm-cookie-consent-visible"),setTimeout(e,300)):(this.element.classList.remove("dm-cookie-consent-visible"),e()),this}toggle(){return this.isOpen()?this.close():this.open()}isOpen(){return this._isVisible}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}accept(){Object.keys(this.options.categories).forEach(e=>{this._preferences[e]=!0}),this._state="accepted",this._savePreferences(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this._emit("accept",this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}reject(){Object.entries(this.options.categories).forEach(([e,t])=>{this._preferences[e]=t.required}),this._state="rejected",this._savePreferences(),this.options.onReject&&this.options.onReject.call(this),this._emit("reject"),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}showCustomize(){this._createCustomizeModal(),this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;e.checked=this._preferences[t]||!1}),this._customizeModal.style.display="flex",this.options.animation?requestAnimationFrame(()=>{this._customizeModal.classList.add("dm-cookie-consent-modal-visible")}):this._customizeModal.classList.add("dm-cookie-consent-modal-visible"),this.options.onCustomize&&this.options.onCustomize.call(this,this._preferences),this._emit("customize",this._preferences)}hideCustomize(){if(!this._customizeModal)return;const e=()=>{this._customizeModal.style.display="none"};this.options.animation?(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),setTimeout(e,300)):(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),e())}saveCustomPreferences(){this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;this._preferences[t]=e.checked}),this._state="customized",this._savePreferences(),this.hideCustomize(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this._emit("accept",this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences),this.options.hideAfterAction&&this.close()}getState(){return this._state}getPreferences(){return{...this._preferences}}isAccepted(e=null){return e?!0===this._preferences[e]:"accepted"===this._state||"customized"===this._state}reset(){this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),Domma.storage.remove(this.options.storageKey),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this._emit("change",this._state,this._preferences)}destroy(){this.close(),this.hideCustomize(),super.destroy(),di._instances.get("cookieConsent")===this&&di._instances.delete("cookieConsent"),this.element&&(this.element.remove(),this.element=null),this._customizeModal&&(this._customizeModal.remove(),this._customizeModal=null)}}const Ks={_container:null,_stack:[],_topHandler(){for(let e=this._stack.length-1;e>=0;e--)if(this._stack[e].overlay.isConnected)return this._stack[e].handler;return null},_defaults:{title:"",message:"",confirmText:"OK",cancelText:"Cancel",inputPlaceholder:"",inputValue:"",inputType:"text",animation:!0,backdrop:!0,backdropClose:!1,keyboard:!0,danger:!1,trapFocus:!0,returnFocus:!0,className:""},_ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",document.body.appendChild(this._container)),this._container},_createDialog(e,t){const n={...this._defaults,...t},s=this._ensureContainer();return new Promise(t=>{const i=document.createElement("div");i.className="dm-dialog-overlay"+(n.animation?" dm-dialog-animate":"");const r=document.createElement("div");r.className=`dm-dialog dm-dialog-${e}${n.className?" "+n.className:""}`,r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let a='<div class="dm-dialog-content">';if(n.title){a+=`<div class="dm-dialog-header"><h3 class="dm-dialog-title">${p.sanitise(String(n.title),{preset:"basic"})}</h3></div>`}if(a+='<div class="dm-dialog-body">',n.message){a+=`<p class="dm-dialog-message">${p.sanitise(String(n.message),{preset:"basic"})}</p>`}if("prompt"===e){const e=o(n.inputPlaceholder||""),t=o(n.inputValue||"");a+=`<input type="${n.inputType}" class="dm-dialog-input form-input" placeholder="${e}" value="${t}">`}a+="</div>",a+='<div class="dm-dialog-footer">',"confirm"!==e&&"prompt"!==e||(a+=`<button type="button" class="btn btn-outline dm-dialog-cancel">${n.cancelText}</button>`);a+=`<button type="button" class="btn ${n.danger?"btn-danger":"btn-primary"} dm-dialog-confirm">${n.confirmText}</button>`,a+="</div></div>",r.innerHTML=a,i.appendChild(r),s.appendChild(i);const l=r.querySelector(".dm-dialog-confirm"),c=r.querySelector(".dm-dialog-cancel"),h=r.querySelector(".dm-dialog-input"),d=!1!==n.trapFocus&&"false"!==n.trapFocus?pt(r,{initialFocus:!1,returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1}):null;d?.activate();const u=h||n.danger&&c||l;setTimeout(()=>{m||u?.focus()},50),h&&h.select();let m=!1,f=()=>{};const _=e=>{m||(m=!0,f(),d&&(d.deactivate({returnFocus:!1!==n.returnFocus&&"false"!==n.returnFocus}),d.destroy()),n.animation?(i.classList.add("dm-dialog-closing"),setTimeout(()=>{i.remove(),t(e)},200)):(i.remove(),t(e)))},g=()=>{_("prompt"===e?h.value:"confirm"===e||void 0)},v=()=>{_("prompt"===e&&null)};l.addEventListener("click",g),c?.addEventListener("click",v),n.backdropClose&&i.addEventListener("click",e=>{e.target===i&&v()});const b=new Set;r.addEventListener("keydown",e=>{e.repeat||b.add(e.key),"Enter"!==e.key&&" "!==e.key||!e.repeat||b.has(e.key)||e.preventDefault()});const y=e=>{e.preventDefault(),e.stopImmediatePropagation()},k=t=>{if(Ks._topHandler()===k)if(t.repeat||b.add(t.key),"Escape"===t.key)y(t),n.keyboard&&v();else if("Enter"===t.key&&n.keyboard){if(t.repeat&&!b.has("Enter"))return;if("function"==typeof t.target?.closest&&t.target.closest("button")&&r.contains(t.target))return;if(n.danger&&"confirm"===e)return void y(t);"prompt"===e&&t.target!==h||(y(t),g())}};Ks._stack.push({overlay:i,handler:k});let w=!1;const x=setTimeout(()=>{m||(w=!0,window.addEventListener("keydown",k,!0))},0);f=()=>{clearTimeout(x);const e=Ks._stack.findIndex(e=>e.handler===k);-1!==e&&Ks._stack.splice(e,1),w&&window.removeEventListener("keydown",k,!0)}})},alert(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("alert",{...t,message:e})},confirm(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("confirm",{...t,message:e})},prompt(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("prompt",{...t,message:e})}};class Ys extends C{static componentName="button-group";static defaults={mode:"single",activeClass:"active",allowEmpty:!1,onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.buttons=Array.from(this.element.querySelectorAll(".btn")),this.buttons.forEach((e,t)=>{e.dataset.index=t,this._addEventListener(e,"click",n=>{n.preventDefault(),this._handleClick(e,t)})}))}_handleClick(e,t){const n=e.classList.contains(this.options.activeClass);"single"===this.options.mode?n&&this.options.allowEmpty?this.options.allowEmpty&&e.classList.remove(this.options.activeClass):(this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),e.classList.add(this.options.activeClass)):e.classList.toggle(this.options.activeClass),this._fire("change",this.getValue(),t,e)}getValue(){const e=this.buttons.map((e,t)=>e.classList.contains(this.options.activeClass)?t:-1).filter(e=>-1!==e);return"single"===this.options.mode?e.length>0?e[0]:null:e}getActive(){const e=this.buttons.filter(e=>e.classList.contains(this.options.activeClass));return"single"===this.options.mode?e.length>0?e[0]:null:e}setValue(e){const t=Array.isArray(e)?e:[e];return this.buttons.forEach((e,n)=>{t.includes(n)?e.classList.add(this.options.activeClass):e.classList.remove(this.options.activeClass)}),this}toggle(e){return e>=0&&e<this.buttons.length&&this._handleClick(this.buttons[e],e),this}selectAll(){return"multiple"===this.options.mode&&(this.buttons.forEach(e=>e.classList.add(this.options.activeClass)),this._fire("change",this.getValue(),-1,null)),this}deselectAll(){return this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),this._fire("change",this.getValue(),-1,null),this}}class Gs extends C{static componentName="breadcrumbs";static defaults={items:[],separator:"/",homeIcon:!1,responsive:!0,onChange:null};static separators={"/":"/",">":"›","→":"→",chevron:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>'};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_getSeparatorHTML(){const{separator:e}=this.options;return Gs.separators[e]||e}_render(){const{items:e,homeIcon:t,responsive:n}=this.options,s=this._getSeparatorHTML();this.element.className="dm-breadcrumbs",n&&this.element.classList.add("dm-breadcrumbs-responsive"),this.element.setAttribute("aria-label","Breadcrumb");let i="";e.forEach((n,o)=>{const r=o===e.length-1,a=0===o;o>0&&(i+=`<span class="dm-breadcrumbs-separator" aria-hidden="true">${s}</span>`);let l=n.text||n;a&&t&&(l=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align: middle; margin-right: 4px;"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>${l}`),r||n.active?i+=`<span class="dm-breadcrumbs-item active" aria-current="page">${l}</span>`:i+=`<a href="${n.url||"#"}" class="dm-breadcrumbs-item dm-breadcrumbs-link" data-index="${o}">${l}</a>`}),this.element.innerHTML=i,this._injectStyles()}_injectStyles(){}_bindEvents(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-breadcrumbs-link");if(t){const n=parseInt(t.dataset.index,10);this.options.onChange&&e.preventDefault(),this._fire("change",this.options.items[n],n,e)}})}setItems(e){return this.options.items=e,this._render(),this}addItem(e){if(this.options.items.length>0){const e=this.options.items[this.options.items.length-1];"object"==typeof e&&(e.active=!1)}return this.options.items.push(e),this._render(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render()),this}getItems(){return[...this.options.items]}}class Js extends C{static componentName="navbar";static defaults={brand:null,items:[],position:"static",variant:"light",collapsible:!0,collapseAt:993,appearOnHover:!1,hoverCloseDelay:250,actions:[],onItemClick:null};constructor(e,t={}){super(e,t),this._isCollapsed=!0,this._pinned=null,this._hoverSuppressed=null,this._navCloseTimer=null,this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_render(){const{brand:e,items:t,position:n,variant:s,collapsible:i,actions:o}=this.options;this.element.className="navbar",this.element.classList.add(`navbar-${s}`),"static"!==n&&this.element.classList.add(`navbar-${n}`),this.element.setAttribute("role","navigation");let r='<div class="navbar-container">';e&&(r+='<div class="navbar-brand">',e.url&&(r+=`<a href="${e.url}" class="navbar-brand-link">`),e.html?r+=e.html:(e.logo&&(r+=`<img src="${e.logo}" alt="${e.text||""}" class="navbar-logo">`),e.text&&(r+=`<span class="navbar-brand-text">${e.text}</span>`)),e.url&&(r+="</a>"),r+="</div>"),i&&(r+='\n <button class="navbar-toggle" aria-label="Toggle navigation" aria-expanded="false">\n <span class="navbar-toggle-icon"></span>\n </button>\n '),r+='<div class="navbar-collapse">',r+='<ul class="navbar-nav">',r+=this._renderItems(t,0,""),r+="</ul>",o&&o.length>0&&(r+='<div class="navbar-actions">',o.forEach((e,t)=>{const n=e.variant||"primary",s=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";r+=`<a href="${e.url||"#"}" class="navbar-action dm-btn dm-btn-${n}" data-action="${t}">${s}${e.text}</a>`}),r+="</div>"),r+="</div>",r+="</div>",this.element.innerHTML=r,this._toggle=this.element.querySelector(".navbar-toggle"),this._collapse=this.element.querySelector(".navbar-collapse"),this._scanIcons()}_renderItems(e,t,n){let s="";return(e||[]).forEach((e,i)=>{const o=""===n?`${i}`:`${n}.${i}`;if(e.divider)return void(s+='<li class="navbar-dropdown-divider"></li>');const r=e.items&&e.items.length>0,a=0===t?18:16,l=e.icon?`<span data-icon="${e.icon}" data-size="${a}" style="margin-right: 6px; vertical-align: middle;"></span>`:"",c='<svg class="navbar-caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>';if(r)0===t?(s+='<li class="navbar-item navbar-dropdown">',s+=`<button class="navbar-link navbar-dropdown-toggle" data-index="${i}" data-path="${o}">${l}${e.text}${c}</button>`,s+='<ul class="navbar-dropdown-menu">'):(s+='<li class="navbar-item navbar-dropdown navbar-dropdown-sub">',s+=`<button class="navbar-dropdown-toggle navbar-submenu-toggle" data-path="${o}">${l}${e.text}${c}</button>`,s+='<ul class="navbar-dropdown-menu navbar-dropdown-submenu">'),s+=this._renderItems(e.items,t+1,o),s+="</ul></li>";else{const r=e.url||"#",a=e.external||r.startsWith("http://")||r.startsWith("https://")?' target="_blank" rel="noopener noreferrer"':"";if(0===t)s+=`<li class="navbar-item"><a href="${r}" class="navbar-link${e.active?" active":""}" data-index="${i}" data-path="${o}"${a}>${l}${e.text}</a></li>`;else{s+=`<li><a href="${r}" class="navbar-dropdown-item" data-path="${o}"${1===t?` data-index="${n}" data-subindex="${i}"`:""}${a}>${l}${e.text}</a></li>`}}}),s}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",()=>{this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-link:not(.navbar-dropdown-toggle)");if(t){const n=parseInt(t.dataset.index,10);this.options.onItemClick&&e.preventDefault(),this._fire("itemclick",this.options.items[n],n,e),window.innerWidth<this.options.collapseAt&&this.collapse()}const n=e.target.closest(".navbar-dropdown-item");if(n){this.options.onItemClick&&e.preventDefault();const t=n.dataset.path,s=t?t.split(".").map(e=>parseInt(e,10)):[parseInt(n.dataset.index,10),parseInt(n.dataset.subindex,10)];let i={items:this.options.items};for(let e=0;e<s.length-1;e++)i=i.items[s[e]];const o=s[s.length-1],r=i.items[o],a=i.items===this.options.items?null:i;this._fire("itemclick",r,o,e,a)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-dropdown-toggle");if(!t)return;const n=t.closest(".navbar-dropdown");if(this._pinned===n)return this._pinned=null,this._hoverSuppressed=n,void this._reconcileDropdowns(null,!0);this._pinned=n,this._hoverSuppressed=null,this._reconcileDropdowns(n)}),this._addEventListener(document,"click",e=>{e.target.closest(".navbar-dropdown")||(this._pinned=null,this._hoverSuppressed=null,this._reconcileDropdowns(null,!0))}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&(this._collapse?.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false"))}),this.options.appearOnHover&&(this._addEventListener(this.element,"mouseover",e=>{window.innerWidth<this.options.collapseAt||e.target.closest(".navbar-dropdown")&&(this._hoverSuppressed&&this._hoverSuppressed.contains(e.target)||(this._hoverSuppressed=null,clearTimeout(this._navCloseTimer),this._reconcileDropdowns(e.target)))}),this._addEventListener(this.element,"mouseout",e=>{window.innerWidth<this.options.collapseAt||e.relatedTarget&&this.element.contains(e.relatedTarget)||(clearTimeout(this._navCloseTimer),this._navCloseTimer=setTimeout(()=>{this._reconcileDropdowns(null)},this.options.hoverCloseDelay))}))}_reconcileDropdowns(e,t=!1){const n=new Set,s=e=>{for(let t=e;t&&t!==this.element;t=t.parentElement)t.classList&&t.classList.contains("navbar-dropdown")&&n.add(t)};s(e),!t&&this._pinned&&s(this._pinned),this.element.querySelectorAll(".navbar-dropdown").forEach(e=>{n.has(e)?e.classList.contains("open")||(e.classList.add("open"),this._positionMenu(e)):e.classList.remove("open")})}_positionMenu(e){if(window.innerWidth<this.options.collapseAt)return;const t=e.querySelector(":scope > .navbar-dropdown-menu");if(!t)return;const n=t.classList.contains("navbar-dropdown-submenu");t.classList.remove("navbar-dropdown-flip-x","navbar-dropdown-flip-end"),t.style.top="",t.style.maxHeight="",t.style.overflowY="",requestAnimationFrame(()=>{let e=t.getBoundingClientRect();if(!e.width&&!e.height)return;e.right>window.innerWidth-8&&(t.classList.add(n?"navbar-dropdown-flip-x":"navbar-dropdown-flip-end"),e=t.getBoundingClientRect());const s=e.bottom-(window.innerHeight-8);s>0&&(n?t.style.top=-Math.min(Math.ceil(s),Math.floor(e.top-8))+"px":t.querySelector(".navbar-dropdown-sub")||(t.style.maxHeight=Math.max(120,Math.floor(window.innerHeight-e.top-8))+"px",t.style.overflowY="auto"))})}setActive(e){return this.options.items.forEach((t,n)=>{t.active=n===e}),this._render(),this}setItems(e){return this.options.items=e,this._render(),this}expand(){return this._collapse&&(this._collapse.classList.add("show"),this._isCollapsed=!1,this._toggle&&this._toggle.setAttribute("aria-expanded","true")),this}collapse(){return this._collapse&&(this._collapse.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false")),this}toggle(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}destroy(){clearTimeout(this._navCloseTimer),this._pinned=null,this._hoverSuppressed=null,super.destroy()}}class Xs extends C{static componentName="sidebar";static defaults={position:"left",fixed:!0,width:"250px",top:"0",header:null,items:[],footer:null,variant:"dark",collapsible:!0,collapseAt:768,activeSection:null,expandedSections:[],persistExpanded:!1,persistKey:null,animationDuration:200,push:!0,contentSelector:".main-content",scrollSpy:!1,scrollSpyOffset:"-100px 0px -50% 0px",scrollSpyThreshold:.5,floating:!1,customContent:null,collapsibleDesktop:!1,collapsedWidth:"60px",persistCollapsed:!1,persistCollapseKey:null,onItemClick:null,onBeforeOpen:null,onBeforeClose:null,onToggle:null,onExpand:null,onCollapse:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._isCollapsed=!1,this._expandedItems=new Set(this.options.expandedSections||[]),this._init()}_init(){this.element&&(this._loadExpandedState(),this._loadCollapsedState(),this._findContentElement(),this._render(),this._bindEvents(),this._scanIcons(),this._handleInitialPushState(),this.options.scrollSpy&&this._initScrollSpy(),this._isCollapsed&&this.options.collapsibleDesktop&&setTimeout(()=>{this._createFloatingToggle()},0))}_findContentElement(){this.options.push&&this.options.contentSelector&&(this._contentElement=document.querySelector(this.options.contentSelector),this._contentElement||console.warn(`[Sidebar] Push mode enabled but content element "${this.options.contentSelector}" not found`))}_handleInitialPushState(){if(this.options.push&&this._contentElement){const e=window.innerWidth>=this.options.collapseAt;(!this.options.collapsible||e)&&this._applyPush()}}_render(){const{position:e,fixed:t,width:n,top:s,header:i,items:o,footer:r,variant:a,collapsible:l,collapsibleDesktop:c,collapsedWidth:h}=this.options;this.element.className="sidebar",this.element.classList.add(`sidebar-${a}`),this.element.classList.add(`sidebar-${e}`),t&&this.element.classList.add("sidebar-fixed"),c&&this.element.classList.add("sidebar-desktop-collapsible"),this._isCollapsed&&c&&this.element.classList.add("sidebar-collapsed"),n&&(this.element.style.setProperty("--sidebar-width",n),this.element.style.width=n),h&&this.element.style.setProperty("--sidebar-collapsed-width",h),s&&t&&(this.element.style.top=s,this.element.style.height=`calc(100vh - ${s})`),this.element.setAttribute("role","navigation"),this.element.setAttribute("aria-label","Sidebar navigation");let d="";if(i){if(d+='<div class="sidebar-header">',i.icon&&(d+=`<span class="sidebar-header-icon" data-icon="${i.icon}" data-size="24"></span>`),i.title&&(d+=`<h3 class="sidebar-header-title">${i.title}</h3>`),l&&!1!==i.toggle){const e="right"===this.options.position?"chevron-right":"chevron-left",t=this._isCollapsed&&c?"chevron-right":e;d+=`\n <button class="sidebar-toggle-btn" aria-label="Toggle sidebar" aria-expanded="${this._isOpen}">\n <span class="sidebar-toggle-icon" data-icon="${t}" data-size="20"></span>\n </button>\n `}d+="</div>"}d+='<nav class="sidebar-nav">',d+=this._renderItems(o),d+="</nav>",r&&(d+='<div class="sidebar-footer">',r.html?d+=r.html:r.text&&(d+=`<p class="sidebar-footer-text">${r.text}</p>`),d+="</div>"),this.element.innerHTML=d,this._toggle=this.element.querySelector(".sidebar-toggle-btn"),this._nav=this.element.querySelector(".sidebar-nav"),this._overlay=null,this._floatingToggle=null}_renderItems(e,t=0,n=""){if(!e||0===e.length)return"";let s=`<ul class="sidebar-menu" data-depth="${t}">`;return e.forEach((e,i)=>{const o=n?`${n}.${i}`:`${i}`;if(e.divider)return void(s+='<li class="sidebar-divider"></li>');if(e.heading)return void(s+=`<li class="sidebar-heading">${e.heading}</li>`);const r=e.items&&e.items.length>0,a=this._expandedItems.has(o),l=e.section===this.options.activeSection;s+=`<li class="sidebar-item ${r?"has-children":""} ${a?"open":""}" data-path="${o}" data-depth="${t}">`,s+=r?`\n <button class="sidebar-link sidebar-link-toggle ${l?"active":""}" data-path="${o}">\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n <svg class="sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M9 18l6-6-6-6"/>\n </svg>\n </button>\n `:`\n <a href="${e.url||"#"}" class="sidebar-link ${l?"active":""}" data-path="${o}" ${e.section?`data-section="${e.section}"`:""}>\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n </a>\n `,r&&(s+=`<div class="sidebar-submenu" ${a?'style="display: block;"':""}>`,s+=this._renderItems(e.items,t+1,o),s+="</div>"),s+="</li>"}),s+="</ul>",s}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",e=>{e.stopPropagation();window.innerWidth>=this.options.collapseAt&&this.options.collapsibleDesktop?this.toggleCollapse():this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link:not(.sidebar-link-toggle)");if(t){const n=t.dataset.path,s=this._getItemByPath(n);s&&s.section&&this.setActive(s.section),this._fire("itemclick",s,n,e),window.innerWidth<this.options.collapseAt&&this.close()}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link-toggle");if(t){e.preventDefault();const n=t.dataset.path,s=t.closest(".sidebar-item");this._toggleSubmenu(s,n)}}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&this.close()}),this._addEventListener(document,"click",e=>{this._isOpen&&!this.element.contains(e.target)&&window.innerWidth<this.options.collapseAt&&this.close()})}_toggleSubmenu(e,t){const n=e.querySelector(":scope > .sidebar-submenu");if(!n)return;const s=e.classList.contains("open"),i=this._getItemByPath(t),o=parseInt(e.dataset.depth,10);s?(this._collapseSubmenu(e,n),this._expandedItems.delete(t),this._fire("collapse",i,o)):(this._expandSubmenu(e,n),this._expandedItems.add(t),this._fire("expand",i,o)),this._saveExpandedState()}_expandSubmenu(e,t){e.classList.add("open"),t.style.display="block";const n=t.scrollHeight;t.style.height="0",t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height=`${n}px`,setTimeout(()=>{t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_collapseSubmenu(e,t){const n=t.scrollHeight;t.style.height=`${n}px`,t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height="0",setTimeout(()=>{e.classList.remove("open"),t.style.display="",t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_getItemByPath(e){if(!e)return null;const t=e.split(".").map(e=>parseInt(e,10));let n=this.options.items;for(const e of t){if(!n||!n[e])return null;n=n[e],n.items&&t.indexOf(e)<t.length-1&&(n=n.items)}return n}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_loadExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=localStorage.getItem(e);if(t){const e=JSON.parse(t);this._expandedItems=new Set(e)}}catch(e){console.warn("Failed to load sidebar expanded state:",e)}}_saveExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=Array.from(this._expandedItems);localStorage.setItem(e,JSON.stringify(t))}catch(e){console.warn("Failed to save sidebar expanded state:",e)}}_loadCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`,t=localStorage.getItem(e);null!==t&&(this._isCollapsed="true"===t)}catch(e){console.warn("Failed to load sidebar collapsed state:",e)}}_saveCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`;localStorage.setItem(e,this._isCollapsed.toString())}catch(e){console.warn("Failed to save sidebar collapsed state:",e)}}_initScrollSpy(){const e=[];this.element.querySelectorAll(".sidebar-link[data-section]").forEach(t=>{const n=t.dataset.section,s=document.getElementById(n);s&&e.push({element:s,id:n,link:t})}),0!==e.length&&(this._scrollSpyObserver=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=e.find(e=>e.element===t.target);n&&this.setActive(n.id)}})},{threshold:this.options.scrollSpyThreshold,rootMargin:this.options.scrollSpyOffset}),e.forEach(({element:e})=>{this._scrollSpyObserver.observe(e)}))}_createOverlay(){this._overlay||(this._overlay=document.createElement("div"),this._overlay.className="sidebar-overlay",document.body.appendChild(this._overlay),this._addEventListener(this._overlay,"click",()=>{this.close()}))}_removeOverlay(){this._overlay&&(this._overlay.remove(),this._overlay=null)}_applyPush(){if(!this.options.push||!this._contentElement)return;const e="right"===this.options.position?"sidebar-push-active-right":"sidebar-push-active";this._contentElement.classList.add(e),this._contentElement.style.setProperty("--sidebar-push-width",this.options.width)}_removePush(){this.options.push&&this._contentElement&&this._contentElement.classList.remove("sidebar-push-active","sidebar-push-active-right")}open(){return this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this.element.classList.add("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","true"),window.innerWidth<this.options.collapseAt&&this._createOverlay(),this._applyPush(),this._fire("toggle",!0)),this}close(){return this._isOpen&&this._mayClose()?(this._isOpen=!1,this.element.classList.remove("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","false"),this._removeOverlay(),this._removePush(),this._fire("toggle",!1),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}collapse(){return!this.options.collapsibleDesktop||this._isCollapsed||(this._isCollapsed=!0,this.element.classList.add("sidebar-collapsed"),this._saveCollapsedState(),this._createFloatingToggle(),this._removePush(),this._fire("collapse")),this}expand(){if(!this.options.collapsibleDesktop||!this._isCollapsed)return this;this._isCollapsed=!1,this.element.classList.remove("sidebar-collapsed"),this._saveCollapsedState(),this._removeFloatingToggle(),this._applyPush();const e="right"===this.options.position?"chevron-right":"chevron-left";return this._updateToggleIcon(e),this._fire("expand"),this}_createFloatingToggle(){if(this._floatingToggle)return;this._floatingToggle=document.createElement("button"),this._floatingToggle.className="sidebar-floating-toggle show","right"===this.options.position&&this._floatingToggle.classList.add("right");const e="right"===this.options.position?"chevron-left":"chevron-right";this._floatingToggle.innerHTML=`<span data-icon="${e}" data-size="20"></span>`,this._floatingToggle.addEventListener("click",()=>{this.expand()}),document.body.appendChild(this._floatingToggle),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._floatingToggle)}_removeFloatingToggle(){this._floatingToggle&&(this._floatingToggle.remove(),this._floatingToggle=null)}_updateToggleIcon(e){if(!this._toggle)return;const t=this._toggle.querySelector(".sidebar-toggle-icon");t&&(t.setAttribute("data-icon",e),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._toggle))}toggleCollapse(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}setActive(e){return this.options.activeSection=e,this.element.querySelectorAll(".sidebar-link").forEach(t=>{t.dataset.section===e?t.classList.add("active"):t.classList.remove("active")}),this}setItems(e){return this.options.items=e,this._expandedItems.clear(),this._render(),this._bindEvents(),this._scanIcons(),this}addItem(e,t=null){return null===t||t>=this.options.items.length?this.options.items.push(e):this.options.items.splice(t,0,e),this._render(),this._bindEvents(),this._scanIcons(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render(),this._bindEvents(),this._scanIcons()),this}expandAll(){return this.element.querySelectorAll(".sidebar-item.has-children").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&!e.classList.contains("open")&&(this._expandSubmenu(e,n),this._expandedItems.add(t))}),this._saveExpandedState(),this}collapseAll(){return this.element.querySelectorAll(".sidebar-item.has-children.open").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&(this._collapseSubmenu(e,n),this._expandedItems.delete(t))}),this._saveExpandedState(),this}destroy(){this._scrollSpyObserver&&(this._scrollSpyObserver.disconnect(),this._scrollSpyObserver=null),this._removeOverlay(),this._removeFloatingToggle(),super.destroy()}}class Zs extends C{static componentName="footer";static defaults={variant:"light",layout:"simple",brand:null,columns:[],links:[],social:[],copyright:null,className:"",position:"static"};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._scanIcons())}_render(){const{variant:e,layout:t,brand:n,columns:s,links:i,social:o,copyright:r,className:a,position:l}=this.options;this.element.className="footer",this.element.classList.add(`footer-${e}`),this.element.classList.add(`footer-${t}`),"static"!==l&&this.element.classList.add(`footer-${l}`),a&&this.element.classList.add(a),this.element.setAttribute("role","contentinfo");let c='<div class="footer-container">';"columns"===t&&s&&s.length>0?c+=this._renderColumnsLayout(n,s,o,r):c+="minimal"===t?this._renderMinimalLayout(r,o):this._renderSimpleLayout(n,i,o,r),c+="</div>",this.element.innerHTML=c}_renderSimpleLayout(e,t,n,s){let i='<div class="footer-simple-content">';return e&&(i+='<div class="footer-brand">',e.url&&(i+=`<a href="${e.url}" class="footer-brand-link">`),e.logo&&(i+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(i+=`<span class="footer-brand-text">${e.text}</span>`),e.url&&(i+="</a>"),i+="</div>"),t&&t.length>0&&(i+='<nav class="footer-nav">',t.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";i+=`<a href="${e.url||"#"}" class="footer-link">${t}${e.text}</a>`}),i+="</nav>"),n&&n.length>0&&(i+=this._renderSocial(n)),i+="</div>",s&&(i+=this._renderCopyright(s)),i}_renderColumnsLayout(e,t,n,s){let i="";return i+='<div class="footer-columns-content">',e&&(i+='<div class="footer-column footer-column-brand">',e.logo&&(i+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(i+=`<p class="footer-brand-text">${e.text}</p>`),e.description&&(i+=`<p class="footer-brand-description">${e.description}</p>`),i+="</div>"),t.forEach(e=>{i+='<div class="footer-column">',e.title&&(i+=`<h4 class="footer-column-title">${e.title}</h4>`),e.links&&e.links.length>0&&(i+='<ul class="footer-column-links">',e.links.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";i+=`<li><a href="${e.url||"#"}" class="footer-column-link">${t}${e.text}</a></li>`}),i+="</ul>"),i+="</div>"}),i+="</div>",i+='<div class="footer-bottom">',n&&n.length>0&&(i+=this._renderSocial(n)),s&&(i+=this._renderCopyright(s)),i+="</div>",i}_renderMinimalLayout(e,t){let n='<div class="footer-minimal-content">';return e&&(n+=this._renderCopyright(e)),t&&t.length>0&&(n+=this._renderSocial(t)),n+="</div>",n}_renderSocial(e){let t='<div class="footer-social">';return e.forEach(e=>{t+=`\n <a href="${e.url||"#"}" class="footer-social-link" aria-label="${e.label||e.icon}" target="_blank" rel="noopener noreferrer">\n <span data-icon="${e.icon}" data-size="20"></span>\n </a>\n `}),t+="</div>",t}_renderCopyright(e){return`<div class="footer-copyright">${"string"==typeof e?e:e.text||`© ${e.year||(new Date).getFullYear()} All rights reserved`}</div>`}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}setBrand(e){return this.options.brand=e,this._render(),this._scanIcons(),this}setLinks(e){return this.options.links=e,this._render(),this._scanIcons(),this}setColumns(e){return this.options.columns=e,this._render(),this._scanIcons(),this}setSocial(e){return this.options.social=e,this._render(),this._scanIcons(),this}setCopyright(e){return this.options.copyright=e,this._render(),this}}class Qs extends C{static componentName="autocomplete";static defaults={data:[],dataSource:null,minChars:1,maxResults:10,debounce:300,filterFn:null,renderItem:null,highlightMatches:!0,position:"auto",placeholder:"",emptyMessage:"No results found",loadingMessage:"Loading...",caseSensitive:!1,selectOnEnter:!0,clearOnSelect:!1,onSelect:null,onChange:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onFilter:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._isOpen=!1,this._activeIndex=-1,this._filteredData=[],this._loading=!1,this._debounceTimer=null,this._dropdown=null,this._list=null,this._loadingEl=null,this._emptyEl=null,this._init();const n=e=>{e!==this.getValue()&&this.setValue(e)};this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)}))}_init(){this.element&&("INPUT"===this.element.tagName?(this.options.placeholder&&this.element.setAttribute("placeholder",this.options.placeholder),this._createDropdown(),this._bindEvents(),this.element.setAttribute("role","combobox"),this.element.setAttribute("aria-autocomplete","list"),this.element.setAttribute("aria-expanded","false"),this.element.setAttribute("aria-controls",this._dropdown.id)):console.error("Autocomplete requires an input element"))}_createDropdown(){let e=this.element.parentElement;e&&e.classList.contains("dm-autocomplete")||(e=document.createElement("div"),e.className="dm-autocomplete",this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element)),this._dropdown=document.createElement("div"),this._dropdown.className="dm-autocomplete-dropdown",this._dropdown.id=`autocomplete-${Math.random().toString(36).substr(2,9)}`,this._dropdown.setAttribute("role","listbox"),this._dropdown.style.display="none",this._loadingEl=document.createElement("div"),this._loadingEl.className="dm-autocomplete-loading",this._loadingEl.textContent=this.options.loadingMessage,this._loadingEl.style.display="none",this._dropdown.appendChild(this._loadingEl),this._emptyEl=document.createElement("div"),this._emptyEl.className="dm-autocomplete-empty",this._emptyEl.textContent=this.options.emptyMessage,this._emptyEl.style.display="none",this._dropdown.appendChild(this._emptyEl),this._list=document.createElement("ul"),this._list.className="dm-autocomplete-list",this._dropdown.appendChild(this._list),e.appendChild(this._dropdown)}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this.element,"input",e),this._addEventListener(this.element,"keydown",t),this._addEventListener(this.element,"focus",()=>{this.element.value.length>=this.options.minChars&&this._filterData(this.element.value)}),this._addEventListener(this.element,"blur",e=>{setTimeout(()=>{this._dropdown.contains(document.activeElement)||this.close()},200)})}_handleInput(e){const t=e.target.value;this._debounceTimer&&clearTimeout(this._debounceTimer),this.model&&this.modelKey&&this.model.set(this.modelKey,t),this._fire("change",t,e),t.length<this.options.minChars?this.close():this._debounceTimer=setTimeout(()=>{this._filterData(t)},this.options.debounce)}_handleKeydown(e){if(!this._isOpen)return void("ArrowDown"===e.key&&this.element.value.length>=this.options.minChars&&(e.preventDefault(),this._filterData(this.element.value)));const t=this._list.querySelectorAll(".dm-autocomplete-item");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Enter":e.preventDefault(),this._activeIndex>=0&&this.options.selectOnEnter&&this._selectItem(this._activeIndex);break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this._activeIndex>=0&&(e.preventDefault(),this._selectItem(this._activeIndex)),this.close()}}async _filterData(e){let t=[];if(this.options.dataSource){this._setLoading(!0);try{t=await this.options.dataSource(e)}catch(e){console.error("Autocomplete dataSource error:",e),t=[]}this._setLoading(!1)}else{const n=this.options.filterFn||this._defaultFilter.bind(this);t=this.options.data.filter(t=>n(t,e))}this.options.maxResults&&(t=t.slice(0,this.options.maxResults)),t=this._fire("filter",t,e)||t,this._filteredData=t,this._renderResults(e)}_defaultFilter(e,t){const n="string"==typeof e?e:e.label||e.value||String(e),s=this.options.caseSensitive?t:t.toLowerCase();return(this.options.caseSensitive?n:n.toLowerCase()).includes(s)}_renderResults(e){if(this._list.innerHTML="",this._activeIndex=-1,0===this._filteredData.length)return this._emptyEl.style.display="block",this._list.style.display="none",void this.open();this._emptyEl.style.display="none",this._list.style.display="block",this._filteredData.forEach((t,n)=>{const s=document.createElement("li");if(s.className="dm-autocomplete-item",s.setAttribute("role","option"),s.setAttribute("data-index",n),this.options.renderItem){const n=this.options.renderItem(t,e);s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const n="string"==typeof t?t:t.label||t.value||String(t);this.options.highlightMatches?s.innerHTML=this._highlightMatch(n,e):s.textContent=n}s.addEventListener("click",()=>{this._selectItem(n)}),s.addEventListener("mouseenter",()=>{this._activeIndex=n,this._updateActive()}),this._list.appendChild(s)}),this.open()}_highlightMatch(e,t){if(!t)return e;const n=new RegExp(`(${this._escapeRegex(t)})`,this.options.caseSensitive?"g":"gi");return e.replace(n,'<span class="dm-autocomplete-match">$1</span>')}_escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_updateActive(){const e=this._list.querySelectorAll(".dm-autocomplete-item");if(e.forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.setAttribute("aria-selected","true"),e.scrollIntoView({block:"nearest"})):(e.classList.remove("active"),e.setAttribute("aria-selected","false"))}),this._activeIndex>=0){const t=e[this._activeIndex];if(t){const e=t.id||`autocomplete-item-${this._activeIndex}`;t.id=e,this.element.setAttribute("aria-activedescendant",e)}}else this.element.removeAttribute("aria-activedescendant")}_selectItem(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value||t.label||String(t);this.element.value=n,this._fire("select",t,{target:this.element}),this.options.clearOnSelect&&setTimeout(()=>{this.element.value=""},100),this.close(),this.element.focus()}_setLoading(e){this._loading=e,e?(this._loadingEl.style.display="block",this._list.style.display="none",this._emptyEl.style.display="none",this.open()):this._loadingEl.style.display="none"}_updatePosition(){if(!this._isOpen||!this._dropdown)return;const e=this.element.getBoundingClientRect(),t=this._dropdown.offsetHeight,n=window.innerHeight;let s=this.options.position;if("auto"===s){const i=n-e.bottom,o=e.top;s=i>=t||i>=o?"below":"above"}"above"===s?(this._dropdown.style.top="auto",this._dropdown.style.bottom="100%",this._dropdown.style.marginBottom="4px",this._dropdown.style.marginTop="0"):(this._dropdown.style.top="100%",this._dropdown.style.bottom="auto",this._dropdown.style.marginTop="4px",this._dropdown.style.marginBottom="0")}open(){return this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this._dropdown.style.display="block",this.element.setAttribute("aria-expanded","true"),this._updatePosition(),this._fire("open")),this}close(){return this._isOpen&&this._mayClose()?(this._isOpen=!1,this._dropdown.style.display="none",this.element.setAttribute("aria-expanded","false"),this._activeIndex=-1,this._fire("close"),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setValue(e){return this.element.value=e,this}getValue(){return this.element.value}setData(e){return this.options.data=e,this}refresh(){const e=this.element.value;return e.length>=this.options.minChars&&this._filterData(e),this}focus(){return this.element.focus(),this}clearValue(){return this.element.value="",this.close(),this}destroy(){this._forcedClose(),this._dropdown&&this._dropdown.parentNode&&this._dropdown.parentNode.removeChild(this._dropdown),this._debounceTimer&&clearTimeout(this._debounceTimer),this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class ei extends C{static componentName="pillbox";static defaults={data:[],value:[],placeholder:"Add items...",searchable:!0,creatable:!1,maxItems:null,duplicates:!1,clearable:!0,size:"medium",renderPill:null,renderOption:null,pillTemplate:"<span>{label}</span>",validatePill:null,maxItemsMessage:"Maximum {max} items allowed",duplicateMessage:"Item already exists",noResultsMessage:"No results found",onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onAdd:null,onRemove:null,onChange:null,onCreate:null,onMaxReached:null,onValidationError:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._pills=[],this._isOpen=!1,this._activeIndex=-1,this._container=null,this._input=null,this._clearBtn=null,this._dropdown=null,this._optionsList=null,this._filteredData=[],this._init();const n=e=>{if(!Array.isArray(e))return;const t=this.getValue();JSON.stringify(t)!==JSON.stringify(e)&&this.setValue(e)};this._container&&(this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)})))}_init(){this.element&&("INPUT"===this.element.tagName?(this.element.style.display="none",this._createStructure(),this.options.value&&this.options.value.length>0&&this.options.value.forEach(e=>{const t=this._findItemByValue(e);t?this._addPill(t.value,t.label):"string"==typeof e&&this._addPill(e,e)}),this._bindEvents(),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false")):console.error("Pillbox requires an input element"))}_createStructure(){const e=document.createElement("div");if(e.className=`dm-pillbox dm-pillbox-${this.options.size}`,this._container=document.createElement("div"),this._container.className="dm-pillbox-container",this._input=document.createElement("input"),this._input.type="text",this._input.className="dm-pillbox-input",this._input.placeholder=this.options.placeholder,this._container.appendChild(this._input),e.appendChild(this._container),this.options.clearable&&(this._clearBtn=document.createElement("button"),this._clearBtn.type="button",this._clearBtn.className="dm-pillbox-clear",this._clearBtn.innerHTML="×",this._clearBtn.title="Clear all",this._clearBtn.style.display="none",e.appendChild(this._clearBtn)),this.options.searchable){this._dropdown=document.createElement("div"),this._dropdown.className="dm-pillbox-dropdown",this._dropdown.style.display="none",this._optionsList=document.createElement("ul"),this._optionsList.className="dm-pillbox-options",this._dropdown.appendChild(this._optionsList);const t=document.createElement("div");t.className="dm-pillbox-empty",t.textContent=this.options.noResultsMessage,t.style.display="none",this._dropdown.appendChild(t),e.appendChild(this._dropdown)}this.element.parentNode.insertBefore(e,this.element.nextSibling),this._wrapper=e}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this._input,"input",e),this._addEventListener(this._input,"keydown",t),this._addEventListener(this._input,"focus",()=>{this.options.searchable&&this._input.value&&this._filterOptions(this._input.value)}),this._addEventListener(this._input,"blur",()=>{setTimeout(()=>{this._dropdown?.contains(document.activeElement)||this.close()},200)}),this._clearBtn&&this._addEventListener(this._clearBtn,"click",()=>{this.clear(),this._input.focus()}),this._addEventListener(this._container,"click",e=>{e.target===this._container&&this._input.focus()})}_handleInput(e){const t=e.target.value;this.options.searchable&&t?this._filterOptions(t):this.close()}_handleKeydown(e){const t=this._input.value;if("Backspace"===e.key&&!t&&this._pills.length>0){e.preventDefault();const t=this._container.querySelectorAll(".dm-pill")[this._pills.length-1];return void this._removePill(t)}if("Enter"===e.key&&t)return e.preventDefault(),void(this._isOpen&&this._activeIndex>=0?this._selectOption(this._activeIndex):this.options.creatable&&this._createPill(t));if(this._isOpen){const t=this._optionsList.querySelectorAll(".dm-pillbox-option");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this.close()}}}_filterOptions(e){const t=e.toLowerCase(),n=this._pills.map(e=>e.value);this._filteredData=this.options.data.filter(e=>{const s="string"==typeof e?e:e.value,i="string"==typeof e?e:e.label||e.value;return!n.includes(s)&&(!e.disabled&&i.toLowerCase().includes(t))}),this._renderOptions()}_renderOptions(){this._optionsList.innerHTML="",this._activeIndex=-1;const e=this._dropdown.querySelector(".dm-pillbox-empty");if(0===this._filteredData.length)return e.style.display="block",this._optionsList.style.display="none",void this.open();e.style.display="none",this._optionsList.style.display="block",this._filteredData.forEach((e,t)=>{const n=document.createElement("li");if(n.className="dm-pillbox-option",n.setAttribute("data-index",t),this.options.renderOption){const t=this.options.renderOption(e);n.innerHTML="string"==typeof t?t:"","string"!=typeof t&&n.appendChild(t)}else{const t="string"==typeof e?e:e.label||e.value;n.textContent=t}n.addEventListener("click",()=>{this._selectOption(t)}),n.addEventListener("mouseenter",()=>{this._activeIndex=t,this._updateActive()}),this._optionsList.appendChild(n)}),this.open()}_updateActive(){this._optionsList.querySelectorAll(".dm-pillbox-option").forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.scrollIntoView({block:"nearest"})):e.classList.remove("active")})}_selectOption(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value,s="string"==typeof t?t:t.label||t.value;this._addPill(n,s),this._input.value="",this.close(),this._input.focus()}_createPill(e){if(!e.trim())return;const t=this._validate(e);t?this._fire("validationerror",t,e):(this._addPill(e,e),this._input.value="",this._fire("create",e))}_addPill(e,t){const n=this._validate(e);if(n)return void this._fire("validationerror",n,e);const s=document.createElement("div");if(s.className="dm-pill",s.setAttribute("data-value",e),this.options.renderPill){const n=this.options.renderPill({value:e,label:t});s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const e=this.options.pillTemplate.replace("{label}",t);s.innerHTML=e}const i=document.createElement("button");i.type="button",i.className="dm-pill-remove",i.innerHTML="×",i.title=`Remove ${t}`,i.addEventListener("click",e=>{e.stopPropagation(),this._removePill(s)}),s.appendChild(i),this._container.insertBefore(s,this._input),this._pills.push({value:e,label:t,element:s}),this._updateHiddenInput(),this._clearBtn&&(this._clearBtn.style.display="block"),this._fire("add",e,s),this._triggerChange()}_removePill(e){const t=e.getAttribute("data-value"),n=this._pills.findIndex(e=>e.value===t);-1!==n&&(this._pills[n],e.remove(),this._pills.splice(n,1),this._updateHiddenInput(),0===this._pills.length&&this._clearBtn&&(this._clearBtn.style.display="none"),this._fire("remove",t,e),this._triggerChange())}_validate(e){if(this.options.maxItems&&this._pills.length>=this.options.maxItems)return this._fire("maxreached"),this.options.maxItemsMessage.replace("{max}",this.options.maxItems);if(!this.options.duplicates&&this._pills.some(t=>t.value===e))return this.options.duplicateMessage;if(this.options.validatePill){const t=this.options.validatePill(e);if(!0!==t&&void 0!==t)return"string"==typeof t?t:"Invalid value"}return null}_findItemByValue(e){return this.options.data.find(t=>("string"==typeof t?t:t.value)===e)}_updateHiddenInput(){const e=this._pills.map(e=>e.value);this.element.value=JSON.stringify(e)}_triggerChange(){const e=this.getValue();this.model&&this.modelKey&&this.model.set(this.modelKey,e),this._fire("change",e)}open(){return!this._dropdown||this._isOpen||!1===this._fire("beforeopen")||(this._isOpen=!0,this._dropdown.style.display="block",this._input.setAttribute("aria-expanded","true"),this._fire("open")),this}close(){return this._dropdown&&this._isOpen&&this._mayClose()?(this._isOpen=!1,this._dropdown.style.display="none",this._input.setAttribute("aria-expanded","false"),this._activeIndex=-1,this._fire("close"),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}getValue(){return this._pills.map(e=>e.value)}setValue(e){return this.clear(),Array.isArray(e)&&e.forEach(e=>{const t=this._findItemByValue(e);if(t){const n="string"==typeof t?t:t.label||t.value;this._addPill(e,n)}else"string"==typeof e&&this._addPill(e,e)}),this}addPill(e,t){return t=t||e,this._addPill(e,t),this}removePill(e){const t=this._container.querySelector(`.dm-pill[data-value="${e}"]`);return t&&this._removePill(t),this}removePillAt(e){return e>=0&&e<this._pills.length&&this._removePill(this._pills[e].element),this}clear(){return[...this._pills].forEach(e=>{this._removePill(e.element)}),this}getCount(){return this._pills.length}setData(e){return this.options.data=e,this}focus(){return this._input.focus(),this}enable(){return this._input.disabled=!1,this._wrapper.classList.remove("disabled"),this}disable(){return this._input.disabled=!0,this._wrapper.classList.add("disabled"),this.close(),this}destroy(){this._forcedClose(),this._wrapper&&this._wrapper.parentNode&&this._wrapper.parentNode.removeChild(this._wrapper),this.element.style.display="",this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class ti extends C{static componentName="slideover";static _stack=[];static _top(){return ti._prune(),ti._stack[ti._stack.length-1]||null}static _prune(){ti._stack=ti._stack.filter(e=>e._isOpen&&e.element&&e.element.isConnected)}static _removeFromStack(e){ti._prune();const t=ti._stack.lastIndexOf(e);-1!==t&&ti._stack.splice(t,1)}static defaults={position:"right",size:"lg",backdrop:!0,backdropClose:!0,keyboard:!0,animation:!0,animationDuration:300,closeOnEscape:!0,title:"",content:"",closable:!0,closeIcon:"x",headerClass:"",bodyClass:"",footerClass:"",customSizes:{},trapFocus:!0,returnFocus:!0,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null,onClosed:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._backdrop=null,this._trap=null,this._trapAsked=!!t&&Object.prototype.hasOwnProperty.call(t,"trapFocus")&&!1!==t.trapFocus&&"false"!==t.trapFocus,this._originalBodyOverflow=null,this._keydownHandler=null,this._init()}_init(){this.element&&(this._setupElement(),this._bindEvents())}_setupElement(){const e=this.element;this.options,e.classList.add("dm-slideover"),e.style.position="fixed",e.style.top="0",e.style.height="100vh",e.style.backgroundColor="var(--dm-surface, #fff)",e.style.boxShadow=this._getBoxShadow(),e.style.zIndex="9999",e.style.display="none",e.style.flexDirection="column",e.style.overflow="hidden",this._applyPosition(),this._applySize(),this._applyAnimation()}_applyPosition(){const e=this.element,t=this.options.position;switch(e.classList.remove("dm-slideover-left","dm-slideover-right","dm-slideover-top","dm-slideover-bottom"),e.classList.add(`dm-slideover-${t}`),t){case"left":e.style.left="-100%",e.style.right="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"right":e.style.right="-100%",e.style.left="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"top":e.style.top="-100%",e.style.bottom="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue();break;case"bottom":e.style.bottom="-100%",e.style.top="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue()}}_applySize(){const e=this._getSizeValue(),t=this.options.position;["left","right"].includes(t)?this.element.style.width=e:this.element.style.height=e}_getSizeValue(){const{size:e,customSizes:t}=this.options;if(t&&t[e])return t[e];const n={sm:"25%",md:"50%",lg:"75%",xl:"90%",full:"100%"};return"string"==typeof e&&(e.includes("px")||e.includes("%")||e.includes("rem")||e.includes("em"))?e:n[e]||n.lg}_applyAnimation(){this.options.animation?this.element.style.transition=`all ${this.options.animationDuration}ms ease`:this.element.style.transition="none"}_getBoxShadow(){switch(this.options.position){case"left":return"2px 0 8px rgba(0,0,0,0.15)";case"right":default:return"-2px 0 8px rgba(0,0,0,0.15)";case"top":return"0 2px 8px rgba(0,0,0,0.15)";case"bottom":return"0 -2px 8px rgba(0,0,0,0.15)"}}_bindEvents(){if(this.options.closable){const e=this.element.querySelector('[data-dismiss="slideover"], .dm-slideover-close');e&&this._addEventListener(e,"click",()=>this.close())}this._keydownHandler=e=>{if(this._isOpen&&this.options.keyboard&&"Escape"===e.key){if(ti._top()!==this)return;this.options.closeOnEscape&&this.close()}}}_createBackdrop(){this.options.backdrop&&(this._backdrop=document.createElement("div"),this._backdrop.className="dm-slideover-backdrop",this._backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9998;\n display: none;\n transition: opacity ${this.options.animationDuration}ms ease;\n opacity: 0;\n `,this.options.backdropClose&&this._backdrop.addEventListener("click",()=>this.close()),document.body.appendChild(this._backdrop))}_showBackdrop(){this._backdrop&&(this._backdrop.style.display="block",requestAnimationFrame(()=>{this._backdrop&&(this._backdrop.style.opacity="1")}))}_hideBackdrop(){this._backdrop&&(this._backdrop.style.opacity="0",setTimeout(()=>{this._backdrop&&(this._backdrop.style.display="none")},this.options.animationDuration))}_getOpenPosition(){switch(this.options.position){case"left":return{left:"0",right:"auto"};case"right":return{right:"0",left:"auto"};case"top":return{top:"0",bottom:"auto"};case"bottom":return{bottom:"0",top:"auto"}}}open(){if(this._isOpen)return this;const e=this.element;if(!e)return this;if(!1===this._fire("beforeopen",this))return this;this.options.backdrop&&!this._backdrop&&this._createBackdrop(),this._originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._showBackdrop(),e.style.display="flex";const t=this._getOpenPosition();return requestAnimationFrame(()=>{Object.assign(e.style,t)}),this.options.keyboard&&document.addEventListener("keydown",this._keydownHandler),this._isOpen=!0,ti._removeFromStack(this),ti._stack.push(this),this._startTrap(),setTimeout(()=>{this._fire("open",this),this._createForm()},this.options.animationDuration),this}_wantsTrap(){const e=this.options;return!1!==e.trapFocus&&"false"!==e.trapFocus&&(!!e.backdrop||!0===this._trapAsked)}_startTrap(){if(!this._wantsTrap()||"undefined"==typeof document)return;const e=this.element;e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),this._addedTabindex=!0),this._trap||(this._trap=pt(e,{initialFocus:()=>{const t=document.activeElement;return t&&t!==document.body&&e.contains(t)?t:e},returnFocus:!0,escapeDeactivates:!1,allowOutsideClick:!0,allowOutsideFocus:"layers",allowScriptFocus:!0,register:!1})),this._trap.activate()}_stopTrap(){this._trap&&this._trap.isActive()&&this._trap.deactivate({returnFocus:!1!==this.options.returnFocus&&"false"!==this.options.returnFocus})}_createForm(){if(this._schema&&!this._formaForm&&window.Domma&&window.Domma.forms&&window.Domma.forms.create)try{console.log("📝 Creating Forma form with schema:",this._schema);let e=this._schema;if(this._schema.fields&&Array.isArray(this._schema.fields)){e={};for(const t of this._schema.fields)t.name&&(e[t.name]={type:t.type||"string",label:t.label,required:t.required||!1,default:t.defaultValue,min:t.validation?.minLength,max:t.validation?.maxLength,pattern:t.validation?.pattern?new RegExp(t.validation.pattern):void 0,options:t.options,formConfig:{placeholder:t.placeholder,hint:t.help,rows:t.rows,accept:t.accept,multiple:t.multiple}});console.log("📝 Converted schema:",e)}const t={onSubmit:(e,t)=>(console.log("📝 Schema form submitted:",e),this._onSave&&this._onSave(e,t,this),!1),onCancel:()=>{console.log("📝 Schema form cancelled"),this.close()},layout:"stacked",showLabels:!0,showHelperText:!0,showHints:!0,cssFramework:"domma",className:"domma-form",fieldClassName:"col-6 mb-3",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint"};this._formaForm=window.Domma.forms.create(e,this._data||{},t),this._formaForm.renderTo("#schema-form-container"),console.log("📝 Forma form created and rendered successfully")}catch(e){console.error("📝 Failed to create Forma form:",e);const t=this.element.querySelector(".dm-slideover-body");t&&(t.innerHTML="<p>Form creation failed. Please try again.</p>")}}close(){if(!this._isOpen)return this;const e=this.element;if(!e)return this;if(!this._mayClose(this))return this;if(this._stopTrap(),this._fire("close",this),this._applyPosition(),this._hideBackdrop(),null!==this._originalBodyOverflow&&(document.body.style.overflow=this._originalBodyOverflow),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),ti._removeFromStack(this),this._formaForm)try{this._formaForm.destroy&&this._formaForm.destroy(),this._formaForm=null;const t=e.querySelector("#schema-form-container");t&&(t.innerHTML="")}catch(e){console.warn("Error cleaning up form:",e)}return setTimeout(()=>{e.style.display="none",this._isOpen=!1,this._fire("closed",this)},this.options.animationDuration),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}setTitle(e){const t=this.element.querySelector(".dm-slideover-header .dm-slideover-title");return t&&(t.textContent=e),this}setContent(e){const t=this.element.querySelector(".dm-slideover-body");return t&&("string"==typeof e?t.innerHTML=p.sanitise(String(e)):e instanceof Element&&(t.innerHTML="",t.appendChild(e))),this}setSize(e){return this.options.size=e,this._applySize(),this}setPosition(e){return this.options.position=e,this.element.style.boxShadow=this._getBoxShadow(),this._applyPosition(),this}destroy(){this._forcedClose(),this._backdrop&&(this._backdrop.remove(),this._backdrop=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),ti._removeFromStack(this),this._trap&&(this._trap.destroy(),this._trap=null),this._addedTabindex&&this.element&&(this.element.removeAttribute("tabindex"),this._addedTabindex=!1),super.destroy()}static create(e={}){const t=document.createElement("div");t.className="dm-slideover";const{title:n,content:s,schema:i,data:o={},closable:r=!0,closeIcon:a="x",onSave:l}=e;let c="";if((n||r)&&(c+='<div class="dm-slideover-header">',n&&(c+=`<h5 class="dm-slideover-title">${n}</h5>`),r&&(c+='<button type="button" class="btn btn-ghost-secondary dm-slideover-close" data-dismiss="slideover" aria-label="Close">',window.Domma&&window.Domma.icons?c+=Domma.icons.render(a,{size:20}).outerHTML:c+="×",c+="</button>"),c+="</div>"),c+='<div class="dm-slideover-body">',i?(c+='<div class="container-fluid p-4">',c+='<div class="card">',c+='<div class="card-body p-4">',c+='<div class="row g-3" id="schema-form-container"></div>',c+="</div>",c+="</div>",c+="</div>"):s&&(c+="string"==typeof s?s:""),c+="</div>",t.innerHTML=c,document.body.appendChild(t),s instanceof Element&&!i){const e=t.querySelector(".dm-slideover-body");e.innerHTML="",e.appendChild(s)}const h=new ti(t,e);return h._schema=i,h._data=o,h._onSave=l,h}}class ni extends C{static componentName="progression";static defaults={mode:"timeline",items:[],layout:"vertical",animation:!0,animationDelay:100,responsive:!0,theme:"default",clickable:!1,onItemClick:null,allowHtml:!1,yearWidth:"80px",contentMaxWidth:"600px",dateFormat:"YYYY",showConnector:!0,showProgress:!0,progressPosition:"top",statusIcons:!0,allowStatusChange:!1,onStatusChange:null,currentItem:null,completedAnimation:!0,icons:{planned:"circle","in-progress":"clock",completed:"check-circle",blocked:"alert-circle",cancelled:"x-circle"},colors:{planned:"var(--dm-gray-400)","in-progress":"var(--dm-primary)",completed:"var(--dm-success)",blocked:"var(--dm-danger)",cancelled:"var(--dm-gray-500)"}};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.element.classList.add("dm-progression",`dm-progression-${this.options.mode}`,`dm-progression-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this._attachEvents(),this.options.animation&&this._animateItems())}_renderItems(){const e=this.options.items;Array.isArray(e)&&0!==e.length&&(this.element.innerHTML="","roadmap"===this.options.mode&&this.options.showProgress&&"top"===this.options.progressPosition&&this._renderProgressBar(),e.forEach((e,t)=>{const n="roadmap"===this.options.mode?this._renderRoadmapItem(e,t):this._renderTimelineItem(e,t);this.element.appendChild(n)}),"roadmap"===this.options.mode&&this.options.showProgress&&"bottom"===this.options.progressPosition&&this._renderProgressBar())}_renderTimelineItem(e,t){const n=document.createElement("div");return n.className="dm-progression-item dm-timeline-item",n.setAttribute("data-index",t),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease"),n.innerHTML=`\n <div class="dm-progression-marker dm-timeline-year">${this._escapeHtml(e.year||e.date||"")}</div>\n <div class="dm-progression-content dm-timeline-content">\n <h4 class="dm-progression-title dm-timeline-title">${this._escapeHtml(e.title||"")}</h4>\n <p class="dm-progression-description dm-timeline-description">${this._renderContent(e.description||"")}</p>\n </div>\n `,n}_renderRoadmapItem(e,t){const n=document.createElement("div"),s=e.status||"planned",i=this.options.currentItem===e.id||this.options.currentItem===t;n.className=`dm-progression-item dm-progression-status-${s}${i?" dm-progression-current":""}`,n.setAttribute("data-index",t),n.setAttribute("data-id",e.id||t),n.setAttribute("data-status",s),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease");let o='<div class="dm-progression-marker dm-progression-status-marker">';this.options.statusIcons&&this.options.icons[s]?o+=`<span class="dm-progression-status-icon" data-icon="${this.options.icons[s]}"></span>`:o+='<span class="dm-progression-status-dot"></span>',o+="</div>";let r='<div class="dm-progression-content">';return e.date&&(r+=`<div class="dm-progression-date">${this._escapeHtml(e.date)}</div>`),r+=`<h4 class="dm-progression-title">${this._escapeHtml(e.title||"")}</h4>`,e.description&&(r+=`<p class="dm-progression-description">${this._renderContent(e.description)}</p>`),"in-progress"===s&&"number"==typeof e.progress&&(r+=`\n <div class="dm-progression-item-progress">\n <div class="dm-progression-item-progress-bar" style="width: ${Math.min(100,Math.max(0,e.progress))}%"></div>\n </div>\n <div class="dm-progression-item-progress-text">${e.progress}%</div>\n `),e.priority&&(r+=`<span class="dm-progression-priority dm-progression-priority-${this._escapeHtml(e.priority)}">${this._escapeHtml(e.priority)}</span>`),e.tags&&Array.isArray(e.tags)&&e.tags.length>0&&(r+='<div class="dm-progression-tags">',e.tags.forEach(e=>{r+=`<span class="dm-progression-tag">${this._escapeHtml(e)}</span>`}),r+="</div>"),e.assignee&&(r+=`<div class="dm-progression-assignee">${this._escapeHtml(e.assignee)}</div>`),r+="</div>",n.innerHTML=o+r,n}_renderProgressBar(){const e=this.getProgress(),t=document.createElement("div");t.className="dm-progression-progress",t.innerHTML=`\n <div class="dm-progression-progress-bar" style="width: ${e}%"></div>\n <div class="dm-progression-progress-text">${Math.round(e)}% Complete</div>\n `,this.element.appendChild(t)}_attachEvents(){this.options.clickable&&(this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-item");if(t){const e=parseInt(t.getAttribute("data-index"),10),n=this.options.items[e];n&&this._fire("itemclick",n,e,t)}}),"roadmap"===this.options.mode&&this.options.allowStatusChange&&this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-marker");if(t){const e=t.closest(".dm-progression-item"),n=parseInt(e.getAttribute("data-index"),10),s=this.options.items[n];s&&"completed"!==s.status&&this._cycleStatus(s,n)}}))}_cycleStatus(e,t){const n=["planned","in-progress","completed"],s=n.indexOf(e.status||"planned"),i=n[(s+1)%n.length];this.setStatus(t,i)}_animateItems(){this.element.querySelectorAll(".dm-progression-item").forEach((e,t)=>{setTimeout(()=>{e.style.opacity="1",e.style.transform="translateY(0)"},t*this.options.animationDelay)})}_escapeHtml(e){return o(e)}_sanitizeHtml(e){return"undefined"!=typeof DOMPurify?DOMPurify.sanitize(e,{ALLOWED_TAGS:["p","strong","em","u","br","ul","ol","li","code","pre","a","h1","h2","h3","h4","h5","h6","blockquote","span","div"],ALLOWED_ATTR:["href","target","class","id"]}):(console.warn("DOMPurify not available, falling back to HTML escaping"),this._escapeHtml(e))}_renderContent(e){return this.options.allowHtml?this._sanitizeHtml(e):this._escapeHtml(e)}_findItemIndex(e){return"number"==typeof e?e:this.options.items.findIndex(t=>t.id===e)}setItems(e){return this.options.items=e,this._renderItems(),this.options.animation&&this._animateItems(),this}addItem(e){return this.options.items.push(e),this._renderItems(),this.options.animation&&this._animateItems(),this}getItems(){return[...this.options.items]}getItem(e){const t=this._findItemIndex(e);return t>=0?{...this.options.items[t]}:null}updateItem(e,t){const n=this._findItemIndex(e);return n>=0&&(this.options.items[n]={...this.options.items[n],...t},this._renderItems(),this.options.animation&&this._animateItems()),this}removeItem(e){const t=this._findItemIndex(e);return t>=0&&(this.options.items.splice(t,1),this._renderItems(),this.options.animation&&this._animateItems()),this}setLayout(e){return this.element.classList.remove(`dm-progression-${this.options.layout}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.layout}`),this.options.layout=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`),this}setTheme(e){return"default"!==this.options.theme&&(this.element.classList.remove(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.theme=e,"default"!==e&&(this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`)),this}setMode(e){return this.element.classList.remove(`dm-progression-${this.options.mode}`),"timeline"===this.options.mode&&(this.element.classList.remove("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.mode=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===e&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this.options.animation&&this._animateItems(),this}getMode(){return this.options.mode}refresh(){return this._renderItems(),this.options.animation&&this._animateItems(),this}setStatus(e,t){const n=this._findItemIndex(e);if(n>=0){const e=this.options.items[n].status;this.options.items[n].status=t,this._fire("statuschange",this.options.items[n],e,t),this._renderItems(),this.options.animation&&this._animateItems()}return this}getStatus(e){const t=this.getItem(e);return t?t.status:null}getItemsByStatus(e){return this.options.items.filter(t=>t.status===e)}setCurrent(e){const t=this._findItemIndex(e);return t>=0&&(this.options.currentItem=this.options.items[t].id||t,this._renderItems(),this.options.animation&&this._animateItems()),this}getCurrent(){return null===this.options.currentItem?null:this.getItem(this.options.currentItem)}getProgress(){if("roadmap"!==this.options.mode||0===this.options.items.length)return 0;const e=this.options.items.filter(e=>"completed"===e.status).length;return Math.round(e/this.options.items.length*100)}markComplete(e){return this.setStatus(e,"completed")}markInProgress(e){return this.setStatus(e,"in-progress")}markBlocked(e){return this.setStatus(e,"blocked")}}class si extends C{static componentName="signature";static defaults={width:null,height:180,penColour:"#000000",penWidth:2,format:"png",label:"Signature",guideLine:!0,placeholder:"Sign here",colours:["#000000","#1e40af","#15803d","#b91c1c"],widths:[1,2,4],toolbar:!0,name:"signature",disabled:!1,typeFallback:!1,minStrokeLength:3,respectMotionPreference:!0,onChange:null,onClear:null,onBegin:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._strokes=[],this._undoneStrokes=[],this._currentStroke=null,this._mode="draw",this._isDrawing=!1,this._currentColour=this.options.penColour,this._currentWidth=this.options.penWidth,this._resizeObserver=null,this._canvas=null,this._ctx=null,this._canvasW=0,this._canvasH=0,this._dpr=1,this._render(),this._initCanvas(),this._initEvents(),this.options.disabled&&this.disable())}_esc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_render(){const e=this.options,t=this._esc.bind(this),n=e.colours.map(e=>{const n=t(e),s=e===this._currentColour;return`<button class="signature-colour-swatch${s?" active":""}" data-colour="${n}" style="background:${n}" aria-label="Pen colour ${n}" aria-pressed="${s}" title="${n}"></button>`}).join(""),s=e.widths.map(e=>{const t=parseFloat(e)||2,n=t===this._currentWidth,s=Math.max(2,Math.min(2.5*t,12));return`<button class="signature-width-btn${n?" active":""}" data-width="${t}" aria-label="Pen width ${t}px" aria-pressed="${n}">\n <span class="signature-width-dot" style="width:${s}px;height:${s}px;"></span>\n </button>`}).join(""),i=e.typeFallback?'\n <div class="signature-mode-toggle" role="group" aria-label="Input mode">\n <button class="signature-mode-btn active" data-mode="draw" aria-pressed="true">Draw</button>\n <button class="signature-mode-btn" data-mode="type" aria-pressed="false">Type</button>\n </div>':"",o=e.toolbar?`\n <div class="signature-toolbar">\n <span class="signature-label">${t(e.label)}</span>\n <div class="signature-colours" role="group" aria-label="Pen colour">${n}</div>\n <div class="signature-widths" role="group" aria-label="Pen width">${s}</div>\n <div class="signature-actions">\n <button class="signature-btn" data-action="undo" aria-label="Undo" disabled>\n <span data-icon="undo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn" data-action="redo" aria-label="Redo" disabled>\n <span data-icon="redo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn signature-btn-clear" data-action="clear" aria-label="Clear signature">Clear</button>\n </div>\n ${i}\n </div>`:"",r=parseInt(e.height,10)||180,a=t(e.format.toUpperCase()),l=t(e.name),c=t(e.placeholder),h=`\n ${o}\n <div class="signature-canvas-wrapper" style="height:${r}px;">\n <canvas class="signature-canvas" tabindex="0" aria-label="Draw your signature here"></canvas>\n ${e.guideLine?'<div class="signature-guide-line" aria-hidden="true"></div>':""}\n <div class="signature-placeholder" aria-hidden="true">${c}</div>\n <input class="signature-type-input" type="text" placeholder="${c}" style="display:none;" aria-label="Type your signature">\n </div>\n <div class="signature-footer">\n <span class="signature-status" aria-live="polite">Draw your signature above</span>\n <span class="signature-format-badge">${a}</span>\n </div>\n <input type="hidden" name="${l}" value="">\n `;this.element.classList.add("signature"),this.element.setAttribute("role","application"),this.element.setAttribute("aria-label",t(e.label)),this.element.textContent="",this.element.insertAdjacentHTML("afterbegin",h),this._canvas=this.element.querySelector(".signature-canvas"),this._wrapper=this.element.querySelector(".signature-canvas-wrapper"),this._placeholder=this.element.querySelector(".signature-placeholder"),this._statusEl=this.element.querySelector(".signature-status"),this._hiddenInput=this.element.querySelector('input[type="hidden"]'),this._typeInput=this.element.querySelector(".signature-type-input"),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(this.element)}_initCanvas(){this._canvas&&(this._ctx=this._canvas.getContext("2d"),this._scaleCanvas(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._scaleCanvas(),this._redraw()}),this._resizeObserver.observe(this._wrapper)))}_scaleCanvas(){const e=window.devicePixelRatio||1,t=this._wrapper.clientWidth,n=this._wrapper.clientHeight;this._canvas.width=t*e,this._canvas.height=n*e,this._ctx.setTransform(e,0,0,e,0,0),this._dpr=e,this._canvasW=t,this._canvasH=n}_initEvents(){const e=this._canvas;e&&(this._addEventListener(e,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(e,"pointermove",e=>this._onPointerMove(e)),this._addEventListener(e,"pointerup",e=>this._onPointerUp(e)),this._addEventListener(e,"pointercancel",e=>this._onPointerUp(e)),this._addEventListener(e,"pointerleave",e=>{this._isDrawing&&this._onPointerUp(e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest("[data-action]");if(t){const e=t.dataset.action;return void("undo"===e?this.undo():"redo"===e?this.redo():"clear"===e&&this.clear())}const n=e.target.closest(".signature-colour-swatch");if(n)return void this._setColour(n.dataset.colour);const s=e.target.closest(".signature-width-btn");if(s)return void this._setPenWidth(parseFloat(s.dataset.width));const i=e.target.closest(".signature-mode-btn");i&&this._setMode(i.dataset.mode)}),this._typeInput&&this._addEventListener(this._typeInput,"input",()=>this._renderTypeToCanvas()))}_onPointerDown(e){if(this.options.disabled||"draw"!==this._mode)return;e.preventDefault(),this._canvas.setPointerCapture(e.pointerId),this._isDrawing=!0,this.element.classList.add("signature-signing");const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke={points:[{x:t,y:n,pressure:s}],colour:this._currentColour,width:this._currentWidth},this._undoneStrokes=[],this._updateState(),this._fire("begin",this._currentStroke)}_onPointerMove(e){if(!this._isDrawing||!this._currentStroke)return;e.preventDefault();const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke.points.push({x:t,y:n,pressure:s}),this._redrawCurrentStroke()}_onPointerUp(e){if(!this._isDrawing)return;this._isDrawing=!1,this.element.classList.remove("signature-signing"),this._currentStroke&&this._currentStroke.points.length>=this.options.minStrokeLength&&this._strokes.push(this._currentStroke);const t=this._currentStroke;this._currentStroke=null,this._redraw(),this._updateState(),this._updateHiddenInput(),t&&this._fire("end",t),this._fire("change",this._hiddenInput.value)}_getPoint(e){const t=this._canvas.getBoundingClientRect();return{x:(e.clientX-t.left)/this._canvasW,y:(e.clientY-t.top)/this._canvasH}}_redraw(){if(!this._ctx)return;const e=this._canvasW,t=this._canvasH;this._ctx.clearRect(0,0,e,t);for(const n of this._strokes)this._drawStroke(this._ctx,n,e,t);this._placeholder&&(this._placeholder.style.display=this._strokes.length>0?"none":"")}_redrawCurrentStroke(){this._redraw(),this._currentStroke&&this._drawStroke(this._ctx,this._currentStroke,this._canvasW,this._canvasH)}_drawStroke(e,t,n,s){const i=t.points;if(0!==i.length){if(e.save(),e.strokeStyle=t.colour,e.fillStyle=t.colour,e.lineCap="round",e.lineJoin="round",1===i.length){const o=t.width*(.4+.6*i[0].pressure);e.beginPath(),e.arc(i[0].x*n,i[0].y*s,o/2,0,2*Math.PI),e.fill()}else{e.beginPath(),e.moveTo(i[0].x*n,i[0].y*s);for(let o=1;o<i.length-1;o++){const r=(i[o].x+i[o+1].x)/2*n,a=(i[o].y+i[o+1].y)/2*s;e.lineWidth=t.width*(.4+.6*i[o].pressure),e.quadraticCurveTo(i[o].x*n,i[o].y*s,r,a),e.stroke(),e.beginPath(),e.moveTo(r,a)}const o=i[i.length-1];e.lineWidth=t.width*(.4+.6*o.pressure),e.lineTo(o.x*n,o.y*s),e.stroke()}e.restore()}}_updateState(){const e=this.element.querySelector('[data-action="undo"]'),t=this.element.querySelector('[data-action="redo"]');e&&(e.disabled=0===this._strokes.length),t&&(t.disabled=0===this._undoneStrokes.length),this._statusEl&&(this._isDrawing?this._statusEl.textContent="Signing…":this._strokes.length>0?this._statusEl.textContent="Signature captured":this._statusEl.textContent="Draw your signature above")}_setColour(e){this._currentColour=e,this.element.querySelectorAll(".signature-colour-swatch").forEach(t=>{const n=t.dataset.colour===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setPenWidth(e){this._currentWidth=e,this.element.querySelectorAll(".signature-width-btn").forEach(t=>{const n=parseFloat(t.dataset.width)===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setMode(e){if(this._mode===e)return;this._mode=e,this.element.querySelectorAll(".signature-mode-btn").forEach(t=>{const n=t.dataset.mode===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")});this.element.querySelectorAll('.signature-colours, .signature-widths, [data-action="undo"], [data-action="redo"]').forEach(t=>{t.style.display="type"===e?"none":""}),"type"===e?(this._canvas.style.display="none",this._typeInput&&(this._typeInput.style.display="",this._typeInput.focus())):(this._canvas.style.display="",this._typeInput&&(this._typeInput.style.display="none")),this.clear(!0)}_renderTypeToCanvas(){const e=this._typeInput?this._typeInput.value.trim():"";this._strokes=[],this._undoneStrokes=[];const t=this._ctx,n=this._canvasW,s=this._canvasH;t.clearRect(0,0,n,s),e&&(t.save(),t.fillStyle=this._currentColour,t.font=`${Math.min(.55*s,72)}px 'Brush Script MT', 'Segoe Script', cursive`,t.textAlign="center",t.textBaseline="middle",t.fillText(e,n/2,s/2),t.restore()),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value)}_updateHiddenInput(){if(!this._hiddenInput)return;const e=this.isEmpty()&&"type"!==this._mode;this._hiddenInput.value=e?"":this.toBase64()}toBase64(e){return"svg"===(e||this.options.format)?this._toSVGBase64():this._canvas.toDataURL("image/png")}_toSVGBase64(){const e=this._canvasW,t=this._canvasH;let n="";for(const s of this._strokes){const i=s.points;if(0===i.length)continue;let o=`M ${(i[0].x*e).toFixed(2)} ${(i[0].y*t).toFixed(2)}`;for(let n=1;n<i.length-1;n++){const s=((i[n].x+i[n+1].x)/2*e).toFixed(2),r=((i[n].y+i[n+1].y)/2*t).toFixed(2);o+=` Q ${(i[n].x*e).toFixed(2)} ${(i[n].y*t).toFixed(2)} ${s} ${r}`}if(i.length>1){const n=i[i.length-1];o+=` L ${(n.x*e).toFixed(2)} ${(n.y*t).toFixed(2)}`}const r=i.reduce((e,t)=>e+t.pressure,0)/i.length,a=(s.width*(.4+.6*r)).toFixed(2);n+=`<path d="${o}" stroke="${s.colour}" stroke-width="${a}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>\n`}return"data:image/svg+xml;base64,"+btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">\n${n}</svg>`)}isEmpty(){return"type"===this._mode?!this._typeInput||""===this._typeInput.value.trim():0===this._strokes.length}clear(e=!1){!e&&this._strokes.length>0&&(this._undoneStrokes=[...this._strokes,...this._undoneStrokes]),this._strokes=[],this._currentStroke=null,this._redraw(),this._updateState(),this._hiddenInput&&(this._hiddenInput.value=""),e||(this._statusEl&&(this._statusEl.textContent="Signature cleared"),this._fire("clear"),this._fire("change",""))}undo(){0!==this._strokes.length&&(this._undoneStrokes.unshift(this._strokes.pop()),this._redraw(),this._updateState(),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value))}redo(){0!==this._undoneStrokes.length&&(this._strokes.push(this._undoneStrokes.shift()),this._redraw(),this._updateState(),this._updateHiddenInput(),this._fire("change",this._hiddenInput.value))}disable(){this.options.disabled=!0,this.element.classList.add("signature-disabled"),this._canvas&&this._canvas.setAttribute("aria-disabled","true"),this._typeInput&&(this._typeInput.disabled=!0),this.element.querySelectorAll("[data-action]").forEach(e=>{e.disabled=!0})}enable(){this.options.disabled=!1,this.element.classList.remove("signature-disabled"),this._canvas&&this._canvas.removeAttribute("aria-disabled"),this._typeInput&&(this._typeInput.disabled=!1),this._updateState();const e=this.element.querySelector('[data-action="clear"]');e&&(e.disabled=!1)}destroy(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),super.destroy()}}const ii=["January","February","March","April","May","June","July","August","September","October","November","December"],oi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ri(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return"";const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function ai(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getFullYear(),e.getMonth(),e.getDate());if("number"==typeof e)return ai(new Date(e));const t=String(e??"").trim();if(!t)return null;const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(t);if(n){const e=new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));return e.getMonth()===Number(n[2])-1?e:null}const s=new Date(t);return Number.isNaN(s.getTime())?null:new Date(s.getFullYear(),s.getMonth(),s.getDate())}function li(e,t){if(!e)return"";const n=e=>String(e).padStart(2,"0"),s={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:ii[e.getMonth()],MMM:ii[e.getMonth()].slice(0,3),MM:n(e.getMonth()+1),M:String(e.getMonth()+1),DDDD:oi[e.getDay()],DDD:oi[e.getDay()].slice(0,3),DD:n(e.getDate()),D:String(e.getDate())};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|D/g,e=>s[e])}function ci(e,t){return Boolean(e)&&Boolean(t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}class hi extends C{static componentName="date-picker";static defaults={value:null,format:"YYYY-MM-DD",min:null,max:null,firstDay:1,disabledDates:null,openOnFocus:!0,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,clearable:!0,todayButton:!0,readonlyInput:!1,inline:!1,position:"bottom-start",offset:[0,4],weekNumbers:!1,placeholder:null,onChange:null,onBeforeOpen:null,onOpen:null,onBeforeClose:null,onClose:null};static _open=null;constructor(e,t={}){super(e,t),this.element&&(this._panel=null,this._isOpen=!1,this._value=null,this._view=null,this._focused=null,this._init())}_init(){const e=this.element,t=this.options;"INPUT"===e.tagName&&"date"===e.type&&(e.type="text"),e.setAttribute("autocomplete","off"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","false"),t.readonlyInput&&(e.readOnly=!0),null!==t.placeholder?e.placeholder=t.placeholder:e.placeholder||(e.placeholder=t.format);const n=null!==t.value&&void 0!==t.value&&""!==t.value?t.value:e.value;if(this._value=this._clamp(ai(n)),this._view=this._value?new Date(this._value):this._clamp(new Date)||new Date,this._renderInput(),t.inline)return this._buildPanel(),e.insertAdjacentElement("afterend",this._panel),this._panel.classList.add("dm-datepicker--inline"),this._paint(),void(this._isOpen=!0);this._addEventListener(e,"click",()=>this.open()),t.openOnFocus&&this._addEventListener(e,"focus",()=>this.open()),this._addEventListener(e,"keydown",e=>this._onInputKey(e)),this._addEventListener(e,"change",()=>{if(this._suppress)return;const t=ai(e.value);this.setValue(t?ri(t):"",{silent:!1,fromInput:!0})})}getValue(){return this._value?ri(this._value):""}getDate(){return this._value?new Date(this._value):null}setValue(e,{silent:t=!1,fromInput:n=!1}={}){const s=this._clamp(ai(e)),i=!ci(s,this._value)||!s!=!this._value;return this._value=s,s&&(this._view=new Date(s)),this._renderInput(),this._panel&&this._paint(),i&&!t&&(n||(this._suppress=!0,this.element.dispatchEvent(new Event("input",{bubbles:!0})),this.element.dispatchEvent(new Event("change",{bubbles:!0})),this._suppress=!1),this._fire("change",this.getValue(),this.getDate(),this)),this}clear(){return this.setValue("")}_renderInput(){const e=this.getValue();this._suppress=!0,this.element.value=this._value?li(this._value,this.options.format):"",this._suppress=!1,"YYYY-MM-DD"===this.options.format?delete this.element.dataset.date:this.element.dataset.date=e}_min(){return ai(this.options.min)}_max(){return ai(this.options.max)}_clamp(e){if(!e)return null;const t=this._min(),n=this._max();return t&&e<t?new Date(t):n&&e>n?new Date(n):e}_disabled(e){const t=this._min(),n=this._max();if(t&&e<t)return!0;if(n&&e>n)return!0;if("function"==typeof this.options.disabledDates)try{return Boolean(this.options.disabledDates(new Date(e)))}catch{return!1}return!1}_buildPanel(){const e=document.createElement("div");e.className="dm-datepicker",this.options.weekNumbers&&e.setAttribute("data-week-numbers",""),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","false"),e.setAttribute("aria-label","Choose a date");const t=document.createElement("div");t.className="dm-datepicker-head";const n=document.createElement("button");n.type="button",n.className="dm-datepicker-nav",n.setAttribute("aria-label","Previous month"),n.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>',this._addEventListener(n,"click",()=>this._shiftMonth(-1));const s=document.createElement("button");s.type="button",s.className="dm-datepicker-nav",s.setAttribute("aria-label","Next month"),s.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>',this._addEventListener(s,"click",()=>this._shiftMonth(1));const i=document.createElement("select");i.className="dm-datepicker-select",i.setAttribute("aria-label","Month"),ii.forEach((e,t)=>{const n=document.createElement("option");n.value=String(t),n.textContent=e,i.appendChild(n)}),this._addEventListener(i,"change",()=>{this._view=new Date(this._view.getFullYear(),Number(i.value),1),this._paint()});const o=document.createElement("select");o.className="dm-datepicker-select",o.setAttribute("aria-label","Year"),this._addEventListener(o,"change",()=>{this._view=new Date(Number(o.value),this._view.getMonth(),1),this._paint()}),t.appendChild(n);const r=document.createElement("div");r.className="dm-datepicker-pickers",r.appendChild(i),r.appendChild(o),t.appendChild(r),t.appendChild(s),e.appendChild(t);const a=document.createElement("div");a.className="dm-datepicker-grid",a.setAttribute("role","grid"),e.appendChild(a);const l=document.createElement("div");l.className="dm-datepicker-foot",e.appendChild(l),this._addEventListener(a,"click",e=>{const t=e.target.closest("[data-dm-date]");t&&!t.hasAttribute("aria-disabled")&&(this.setValue(t.dataset.dmDate),this.options.closeOnSelect&&!this.options.inline&&this.close({focus:!0}))}),this._addEventListener(e,"keydown",e=>this._onPanelKey(e)),this._panel=e,this._grid=a,this._foot=l,this._monthSelect=i,this._yearSelect=o}_shiftMonth(e){this._view=new Date(this._view.getFullYear(),this._view.getMonth()+e,1),this._paint()}_paint(){const e=this.options,t=this._view,n=new Date,s=this._min(),i=this._max(),o=s?s.getFullYear():n.getFullYear()-100,r=i?i.getFullYear():n.getFullYear()+10;if(this._yearSelect.dataset.from!==String(o)||this._yearSelect.dataset.to!==String(r)){this._yearSelect.textContent="";for(let e=r;e>=o;e--){const t=document.createElement("option");t.value=String(e),t.textContent=String(e),this._yearSelect.appendChild(t)}this._yearSelect.dataset.from=String(o),this._yearSelect.dataset.to=String(r)}this._monthSelect.value=String(t.getMonth()),this._yearSelect.value=String(t.getFullYear());const a=this._grid;a.textContent="";const l=document.createElement("div");if(l.className="dm-datepicker-row dm-datepicker-weekdays",l.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week",l.appendChild(e)}for(let t=0;t<7;t++){const n=oi[(e.firstDay+t)%7],s=document.createElement("span");s.className="dm-datepicker-weekday",s.setAttribute("role","columnheader"),s.setAttribute("aria-label",n),s.textContent=n.slice(0,2),l.appendChild(s)}a.appendChild(l);const c=new Date(t.getFullYear(),t.getMonth(),1),h=(c.getDay()-e.firstDay+7)%7,d=new Date(c.getFullYear(),c.getMonth(),1-h);for(let s=0;s<6;s++){const i=document.createElement("div");if(i.className="dm-datepicker-row",i.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week";const t=new Date(d);t.setDate(d.getDate()+7*s),e.textContent=String(this._weekNumber(t)),i.appendChild(e)}for(let e=0;e<7;e++){const o=new Date(d.getFullYear(),d.getMonth(),d.getDate()+7*s+e),r=document.createElement("button");r.type="button",r.className="dm-datepicker-day",r.dataset.dmDate=ri(o),r.setAttribute("role","gridcell"),r.textContent=String(o.getDate()),r.setAttribute("aria-label",li(o,"DDDD D MMMM YYYY")),o.getMonth()!==t.getMonth()&&r.classList.add("is-outside"),ci(o,n)&&r.classList.add("is-today"),ci(o,this._value)&&(r.classList.add("is-selected"),r.setAttribute("aria-selected","true")),this._disabled(o)&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0);const a=this._focused||this._value||n;r.tabIndex=ci(o,a)?0:-1,i.appendChild(r)}a.appendChild(i)}this._paintFoot()}_paintFoot(){const e=this._foot;e.textContent="";const t=this.options;if(t.todayButton){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Today",n.addEventListener("click",()=>{const e=new Date;if(this._disabled(e))return this._view=new Date(e.getFullYear(),e.getMonth(),1),void this._paint();this.setValue(ri(e)),t.closeOnSelect&&!t.inline&&this.close({focus:!0})}),e.appendChild(n)}if(t.clearable){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Clear",n.disabled=!this._value,n.addEventListener("click",()=>{this.clear(),t.inline||this.close({focus:!0})}),e.appendChild(n)}e.childNodes.length?e.parentNode||this._panel.appendChild(e):e.remove()}_weekNumber(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()+3-(t.getDay()+6)%7);const n=new Date(t.getFullYear(),0,4);return n.setDate(n.getDate()+3-(n.getDay()+6)%7),1+Math.round((t-n)/6048e5)}open(){return this._isOpen||this.options.inline||this.element.disabled||!1===this._fire("beforeopen",this)||(hi._open&&hi._open!==this&&hi._open.close(),this._panel||this._buildPanel(),document.body.appendChild(this._panel),this._focused=this._value?new Date(this._value):null,this._paint(),this._position(),this._isOpen=!0,hi._open=this,this.element.setAttribute("aria-expanded","true"),this._onOutside=e=>{this._panel.contains(e.target)||e.target===this.element||this.close()},this._onReposition=()=>this._position(),this.options.closeOnClickOutside&&setTimeout(()=>document.addEventListener("mousedown",this._onOutside,!0),0),window.addEventListener("resize",this._onReposition),window.addEventListener("scroll",this._onReposition,!0),this._fire("open",this)),this}close({focus:e=!1}={}){return!this._isOpen||this.options.inline?this:this._mayClose(this)?(document.removeEventListener("mousedown",this._onOutside,!0),window.removeEventListener("resize",this._onReposition),window.removeEventListener("scroll",this._onReposition,!0),this._panel?.remove(),this._isOpen=!1,hi._open===this&&(hi._open=null),this.element.setAttribute("aria-expanded","false"),e&&this.element.focus(),this._fire("close",this),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}show(...e){return this.open(...e)}hide(...e){return this.close(...e)}isVisible(){return this.isOpen()}_position(){const e=this._panel;if(!e)return;Ze(this.element,e);const t=this.element.getBoundingClientRect(),[n,s]=this.options.offset;e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0";const i=e.getBoundingClientRect();let o=t.bottom+s,r=t.left+n;o+i.height>window.innerHeight&&t.top-i.height-s>0&&(o=t.top-i.height-s),this.options.position.endsWith("-end")&&(r=t.right-i.width),r=Math.max(8,Math.min(r,window.innerWidth-i.width-8)),e.style.top=`${o+window.scrollY}px`,e.style.left=`${r+window.scrollX}px`,e.style.visibility=""}_onInputKey(e){"ArrowDown"!==e.key&&"Enter"!==e.key?"Escape"===e.key&&this._isOpen&&(e.preventDefault(),this.close()):this._isOpen||(e.preventDefault(),this.open(),this._panel?.querySelector('[tabindex="0"]')?.focus())}_onPanelKey(e){const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key],n=this._focused||this._value||new Date;if(void 0!==t)return e.preventDefault(),void this._moveFocus(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t));if("PageUp"===e.key||"PageDown"===e.key){e.preventDefault();const t="PageUp"===e.key?-1:1;return void this._moveFocus(new Date(n.getFullYear(),n.getMonth()+t,n.getDate()))}if("Home"===e.key||"End"===e.key){e.preventDefault();const t="Home"===e.key?new Date(n.getFullYear(),n.getMonth(),1):new Date(n.getFullYear(),n.getMonth()+1,0);return void this._moveFocus(t)}"Escape"===e.key&&this.options.closeOnEscape&&(e.preventDefault(),this.close({focus:!0}))}_moveFocus(e){this._focused=e,e.getMonth()===this._view.getMonth()&&e.getFullYear()===this._view.getFullYear()||(this._view=new Date(e.getFullYear(),e.getMonth(),1)),this._paint(),this._panel?.querySelector(`[data-dm-date="${ri(e)}"]`)?.focus()}destroy(){this._forcedClose(),this._panel?.remove(),this._panel=null,super.destroy()}}const di={_instances:new Map,card(e,t={}){Ds();const n=Fe(e);if(!n)return null;const s=Je(n,"card",t)||new rn(n,t);return this._instances.set(n,s),s},modal(e,t={}){if(Ds(),e&&"object"==typeof e&&!e.nodeType&&"number"!=typeof e.length)return gn(e);const n=Fe(e);if(!n)return null;const s=Je(n,"modal",t)||new pn(n,t);return this._instances.set(n,s),s},tabs(e,t={}){const n=new Is(e,t);return n.element&&this._instances.set(n.element,n),n},accordion(e,t={}){const n=new Hs(e,t);return n.element&&this._instances.set(n.element,n),n},tooltip(e,t={}){Ds();const n=function(e,t={}){return e.map(e=>{const n=x(e,"tooltip");return n?n.setOptions(t):new xn(e,t)})}(Re(e),t);for(const e of n)this._instances.set(e.element,e);return Ns(n)},badge(e,t={}){Ds();const n=Fe(e);if(!n)return null;const s=Je(n,"badge",t)||new Cn(n,t);return this._instances.set(n,s),s},numberBadge(e,t={}){Ds();const n=Fe(e);if(!n)return null;const s=Je(n,"number-badge",t)||new En(n,t);return this._instances.set(n,s),s},dropdown(e,t={}){const n=new Ps(e,t);return n.element&&this._instances.set(n.element,n),n},carousel(e,t={}){const n=new qs(e,t);return n.element&&this._instances.set(n.element,n),n},cookieConsent(e={}){if(this._instances.has("cookieConsent"))return this._instances.get("cookieConsent");const t=new Us(e);return this._instances.set("cookieConsent",t),t},backToTop(e,t={}){Ds();const n=new Bn(e,t);return this._instances.set(n.element,n),this._instances.set("backToTop",n),n},buttonGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Ys(e,t);this._instances.set(e,n),s.push(n)}return Ns(s)},loader(e,t={}){Ds();const n=Fe(e);if(!n)return null;const s=new Tn(n,t);return this._instances.set(n,s),s},showLoader(e,t={}){const n=Fe(e);if(!n)return null;const s=x(n,"loader");return s?(Object.keys(t).length&&s.setOptions(t),s.show()):this.loader(n,{...t,visible:!0})},hideLoader(e){const t=Fe(e),n=t&&x(t,"loader");return n&&n.hide(),n||void 0},fullscreenLoader(e="Loading...",t={}){let n=document.getElementById("dm-loader-fullscreen");n||(n=document.createElement("div"),n.id="dm-loader-fullscreen",n.className="dm-loader-fullscreen",document.body.appendChild(n));const s={type:t.type||"spinner",size:t.size||"large",color:t.color||"white",text:e,overlay:!1,centered:!1,fullscreen:!0,visible:!0},i=x(n,"loader");if(i)return i.setOptions(s),i.show();const o=new Tn(n,s);return this._instances.set(n,o),o},breadcrumbs(e,t={}){const n=new Gs(e,t);return n.element&&this._instances.set(n.element,n),n},navbar(e,t={}){const n=new Js(e,t);return n.element&&this._instances.set(n.element,n),n},sidebar(e,t={}){const n=new Xs(e,t);return n.element&&this._instances.set(n.element,n),n},footer(e,t={}){const n=new Zs(e,t);return n.element&&this._instances.set(n.element,n),n},notification:(e={})=>new Fs(e),notify:(e,t={})=>e&&"object"==typeof e?Fs.notify(e.title,{...e,...t}):Fs.notify(e,t),timer(e,t={}){const n=new Rs(e,t);return n.element&&this._instances.set(n.element,n),n},alarm:(e={})=>new Vs(e),autocomplete(e,t={}){const n=new Qs(e,t);return n.element&&this._instances.set(n.element,n),n},pillbox(e,t={}){const n=new ei(e,t);return n.element&&this._instances.set(n.element,n),n},datePicker(e,t={}){const n=new hi(e,t);return n.element&&this._instances.set(n.element,n),n},chooser(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n){console.warn("[Domma.elements.chooser] host not found:",e);const n=t.multiple?[]:null;return{_root:null,element:null,getValue:()=>n,setValue(){},disable(){},enable(){},destroy(){}}}const s={variant:"card",multiple:!1,density:"comfortable",columns:3,glow:!1,glowColour:null,shadow:"none",shadowColour:null,accent:"primary",accentStyle:"border",options:[],...t};let i=void 0!==s.value?s.value:s.multiple?[]:null;const o=document.createElement("div");o.className="domma-chooser",o.setAttribute("data-variant",s.variant),o.setAttribute("data-density",s.density),o.style.setProperty("--picker-cols",String(s.columns)),o.style.setProperty("--picker-cols-md",String(Math.min(s.columns,2))),o.style.setProperty("--picker-cols-sm","1");const r={primary:1,success:1,info:1,warning:1,danger:1},a=e=>"string"==typeof e&&r[e];if(s.glow&&o.setAttribute("data-glow","true"),s.glowColour&&(a(s.glowColour)?o.setAttribute("data-glow-colour",s.glowColour):o.style.setProperty("--picker-glow-colour",s.glowColour)),s.shadow&&"none"!==s.shadow&&o.setAttribute("data-shadow",s.shadow),s.shadowColour&&o.style.setProperty("--picker-shadow-colour",s.shadowColour),s.accent&&(a(s.accent)?o.setAttribute("data-accent",s.accent):o.style.setProperty("--picker-accent",s.accent)),s.accentStyle&&"border"!==s.accentStyle&&o.setAttribute("data-accent-style",s.accentStyle),s.label){const e=document.createElement("label");if(e.className="picker-label",e.textContent=s.label,s.required){const t=document.createElement("span");t.className="picker-required",t.textContent="*",e.appendChild(t)}o.appendChild(e)}const l=document.createElement("div");l.className="picker-options",l.setAttribute("role",s.multiple?"group":"radiogroup"),o.appendChild(l);const c=e=>{const t=String(e);return s.multiple?Array.isArray(i)&&i.map(String).includes(t):null!=i&&String(i)===t},h=()=>{l.replaceChildren(),s.options.forEach((e,t)=>l.appendChild(((e,t)=>{const n=document.createElement("div");if(n.className="picker-option",n.setAttribute("role",s.multiple?"checkbox":"radio"),n.setAttribute("tabindex",s.multiple||0===t?"0":"-1"),n.setAttribute("data-value",String(e.value)),n.setAttribute("aria-checked",c(e.value)?"true":"false"),c(e.value)&&n.classList.add("is-selected"),e.disabled&&(n.classList.add("is-disabled"),n.setAttribute("aria-disabled","true")),e.recommended&&n.classList.add("is-recommended"),e.icon){const t=document.createElement("span");t.className="picker-option-icon",t.setAttribute("data-icon",e.icon),n.appendChild(t)}const i=document.createElement("span");if(i.className="picker-option-label",i.textContent=e.label,n.appendChild(i),e.description&&"compact"!==s.density&&"card"===s.variant){const t=document.createElement("span");t.className="picker-option-desc",t.textContent=e.description,n.appendChild(t)}if("card"===s.variant){const e=document.createElement("span");e.className="picker-option-tick",e.setAttribute("aria-hidden","true");const t=document.createElement("span");t.setAttribute("data-icon","check"),t.setAttribute("data-icon-size","12"),e.appendChild(t),n.appendChild(e)}if(e.badge&&e.badge.text){const t=document.createElement("span");t.className="picker-option-badge";const s=document.createElement("span");s.className="badge badge-"+(e.badge.type||"primary"),s.textContent=e.badge.text,t.appendChild(s),n.appendChild(t)}if(e.tooltip&&n.setAttribute("data-tooltip",e.tooltip),s.name){const t=document.createElement("input");t.className="picker-native-input",t.type=s.multiple?"checkbox":"radio",t.name=s.multiple?s.name+"[]":s.name,t.value=String(e.value),t.checked=c(e.value),t.disabled=!!e.disabled,t.tabIndex=-1,n.appendChild(t)}return n})(e,t))),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(l)},d=(e,t=!0)=>{i=e,h(),t&&"function"==typeof s.onChange&&s.onChange(i)};l.addEventListener("click",e=>{const t=e.target.closest(".picker-option");if(!t||t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value");if(s.multiple){const e=Array.isArray(i)?i.slice():[],t=e.indexOf(n);t>=0?e.splice(t,1):e.push(n),d(e)}else d(n)}),l.addEventListener("keydown",e=>{const t=e.target.closest(".picker-option");if(!t)return;const n=Array.from(l.querySelectorAll(".picker-option")).filter(e=>!e.classList.contains("is-disabled")),o=n.indexOf(t);if(s.multiple){if(" "===e.key||"Spacebar"===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value"),s=Array.isArray(i)?i.slice():[],o=s.indexOf(n);o>=0?s.splice(o,1):s.push(n),d(s)}return}if("Enter"===e.key||" "===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;return void d(t.getAttribute("data-value"))}let r=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)r=o+1;else{if("ArrowLeft"!==e.key&&"ArrowUp"!==e.key)return;r=o-1}e.preventDefault(),r<0&&(r=n.length-1),r>=n.length&&(r=0);const a=n[r];if(a){const e=a.getAttribute("data-value");d(e);const t=l.querySelector('.picker-option[data-value="'+e.replace(/"/g,'\\"')+'"]');t&&"function"==typeof t.focus&&t.focus()}}),n.appendChild(o),h();const u={_root:o,get element(){return o},getValue:()=>i,setValue(e){d(e,!1)},disable(){o.querySelectorAll(".picker-option").forEach(e=>e.classList.add("is-disabled"))},enable(){o.querySelectorAll(".picker-option").forEach(e=>e.classList.remove("is-disabled"))},destroy(){o.remove(),L(n,u),L(o,u)}};return Object.defineProperty(u,"componentName",{value:"chooser"}),M(n,u),M(o,u),u},contextMenu(e,t={}){const n=new pe(e,t);return n.element&&this._instances.set(n.element,n),n},sortable(e,t={}){const n=new ve(e,t);return n.element&&this._instances.set(n.element,n),n},skeleton:(e,t={})=>Pe(e,t),avatar:(e,t={})=>en(e,t),avatarGroup:(e,t={})=>on(e,t),inputGroup(e,t={}){const n=new ze(e,t);return n.element&&this._instances.set(n.element,n),n},popover(e,t={}){const n=new Bt(e,t);if(n.element){const e=n.element;this._instances.set(e,n),n._onDestroy=()=>{this._instances.get(e)===n&&this._instances.delete(e)}}return n},treeView(e,t={}){const n=new A(e,t);return n.element&&this._instances.set(n.element,n),n},slideover(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return e.schema,ti.create(e);const n=new ti(e,t);return n.element&&this._instances.set(n.element,n),n},progression(e,t={}){const n=new ni(e,t);return n.element&&this._instances.set(n.element,n),n},listGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Ws(e,t);n.element&&this._instances.set(e,n),s.push(n)}return Ns(s)},toast:Pn,dialog:Ks,alert:Ks.alert.bind(Ks),confirm:Ks.confirm.bind(Ks),prompt:Ks.prompt.bind(Ks),createModal:(e={})=>(Ds(),gn(e)),showModal:(e={})=>(Ds(),function(e={}){return new Promise(t=>{let n=!1;const s=gn({...e,onButtonClick(s,i,...o){"function"==typeof e.onButtonClick&&e.onButtonClick(s,i,...o),n=!0,t(s)}});s.on("closed",()=>{n||(n=!0,t(null))}),s.open()})}(e)),signature(e,t={}){const n=new si(e,t);return n.element&&this._instances.set(n.element,n),n},focusTrap(e,t={}){const n=new ut(e,t);return n.element?n:null},commandPalette:(e={})=>new is(e),splitPane(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"split-pane");return n?n.setOptions(t):new ls(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},virtualList(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"virtual-list");return n?n.setOptions(t):new cs(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},dropzone(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"dropzone");return n?Object.keys(t).length?n.setOptions(t):n:new ks(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},rangeSlider(e,t={}){const n=Fe(e);if(!n)return null;const s=function(e,t={}){const n=x(e,"range-slider");return n?Object.keys(t).length?n.setOptions(t):n:new Ls(e,t)}(n,t);return this._instances.set(n,s),s._onDestroy=()=>{this._instances.get(n)===s&&this._instances.delete(n)},s},slider(e,t={}){return this.rangeSlider(e,t)},get(e,t){const n="string"==typeof e?document.querySelector(e):e;if(!n)return;const s=this._instances.get(n);return!s||t&&s.constructor?.componentName!==t?x(n,t)||(t?void 0:s):s},destroy(e,t){const n="string"==typeof e?document.querySelector(e):e,s=this.get(n,t);s&&(s.destroy(),this._instances.get(n)===s&&this._instances.delete(n))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()},_registry:new Map,register(e,t){this._registry.set(e,t)},create(e,t,n={}){const s=this._registry.get(e);if(s)return new s(t,n);throw new Error(`Unknown component: ${e}`)}};function ui(e,{fallback:t,onWrite:n}={}){const s=t&&"object"==typeof t?Object.keys(t):[];return 0===s.length&&"function"!=typeof n?e:new Proxy({},{get:(n,s)=>"string"==typeof s&&!(s in e)&&s in t?t[s]:e[s],has:(n,i)=>i in e||"string"==typeof i&&s.length>0&&i in t,ownKeys:()=>[...new Set([...s,...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),set:(t,s,i)=>(e[s]=i,"string"==typeof s&&"function"==typeof n&&n(s,i),!0)})}
|
|
9
|
+
/*! domma-reactive v1.3.1 | MIT | https://github.com/pinpointzero73/domma-reactive */function pi(e,t){return fi(e,t,null)}function mi(e){return e===Object.prototype||null===e}function fi(e,t,n){if(Object.is(e,t))return!0;if(0===e&&0===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&Object.is(e.getTime(),t.getTime());const s=Array.isArray(e);if(s!==Array.isArray(t))return!1;if(!(s||mi(Object.getPrototypeOf(e))&&mi(Object.getPrototypeOf(t))))return!1;const i=n||new WeakMap,o=i.get(e);if(o){if(o.has(t))return!0;o.add(t)}else i.set(e,new Set([t]));if(s){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!fi(e[n],t[n],i))return!1;return!0}const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!fi(e[n],t[n],i))return!1}return!0}di.contextMenu.closeAll=pe.closeAll,di.contextMenu.active=pe.active,di.contextMenu.registry=pe.registry,di.skeleton.while=Pe.while,di.skeleton.get=Pe.get,di.skeleton.remove=Pe.remove,di.skeleton.scan=Pe.scan,di.skeleton.markup=Pe.markup,di.avatar.scan=en.scan,di.avatar.get=en.get,di.avatar.initials=en.initials,di.avatar.tone=en.tone,di.avatarGroup.get=on.get,di.popover.scan=e=>Bt.scan(e,(e,t)=>di.popover(e,t)),di.popover.closeAll=Bt.closeAll,di.popover.getInstance=Bt.getInstance,di.popover.open=Bt.openPopovers,di.focusTrap.tabbables=ct,di.focusTrap.top=()=>ut.top(),di.commandPalette.formatShortcut=Yn,di.commandPalette.fuzzyMatch=Jn,di.commandPalette.claims=function(e){for(const t of es)if(t._hotkeyList.some(n=>Un(e,n,t._mac)))return!0;return!1},di.buttonGroup.all=(e,t={})=>{const n=di.buttonGroup(e,t);return n?n.all():[]},di.tooltip.all=(e,t={})=>{const n=di.tooltip(e,t);return n?n.all():[]},di.listGroup.all=(e,t={})=>{const n=di.listGroup(e,t);return n?n.all():[]};const _i=Symbol.for("domma-reactive.reactive");function gi(e){return Object.defineProperty(e,_i,{value:!0,enumerable:!1}),e}function vi(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&!0===e[_i]}function bi(e,{expr:t,where:n,handler:s}={}){if("function"!=typeof e||!1===s?.tracks||!0===s?.acceptsReactive)return e;let i=!1;return s=>{const o=e(s);if(!vi(o))return o;if(!i){i=!0;const e=n?` in ${n}`:"";console.warn(`[Domma Reactive] "${t}"${e} is an observable, not its value - use "${t}.value". The binding reads it as empty (hidden, off, no rows) until then.`)}}}let yi=null;const ki=[],wi=new Set;let xi=!1,Mi=!1;class Li{constructor(e=null){this.subs=new Set,this.owner=e}track(){yi&&yi!==this.owner&&(this.subs.add(yi),yi.deps.add(this))}trigger(){if(0!==this.subs.size){for(const e of this.subs)e.invalidate(),wi.add(e);Ai()}}}class Ci{constructor(e,t={}){this.fn=e,this.label=t.label||(t.effect?"effect":"computed"),this.isEffect=!0===t.effect,this.onNotify=t.onNotify||null,this._write="function"==typeof t.write?t.write:null,this.deps=new Set,this.dep=new Li(this),this._value=void 0,this.dirty=!0,this.disposed=!1}_run(){const e=new Set(this.deps);for(const e of this.deps)e.subs.delete(this);this.deps.clear(),ki.push(yi),yi=this;try{return this.fn()}catch(t){console.warn(`[Domma Reactive] "${this.label}" threw during evaluation:`,t);for(const t of e)this.deps.add(t),t.subs.add(this);return}finally{yi=ki.pop()}}get(){if(this.dirty&&!this.disposed){const e=this._value;this._value=this._run(),this.dirty=!1,this._evaluated&&!pi(e,this._value)&&(this._pulledChange=!0),this._evaluated=!0}return this.dep.track(),this._value}get value(){return this.get()}set value(e){this.write(e)}write(e){this._write?zi(()=>this._write(e)):console.warn(`[Domma Reactive] "${this.label}" is a read-only computed - the assignment was ignored. Pass computed({read, write}) to say where a write should land.`)}set(e){this.write(e)}recompute(){if(this.disposed)return{changed:!1,value:this._value};const e=this._value;this._value=this._run(),this.dirty=!1;const t=this._pulledChange||!pi(e,this._value);return this._pulledChange=!1,this._evaluated=!0,{changed:t,value:this._value}}invalidate(){this.dirty=!0}dependents(){return this.dep.subs}notify(){!this.disposed&&this.onNotify&&this.onNotify(this._value,this)}dispose(){if(!this.disposed){for(const e of this.deps)e.subs.delete(this);this.deps.clear(),this.dep.subs.clear(),wi.delete(this),this.disposed=!0}}}function Ai(){xi||Mi||(xi=!0,Promise.resolve().then(Ei))}function Ei(){if(xi=!1,!Mi&&0!==wi.size){Mi=!0;try{const e=new Set(wi);wi.clear(),function(e){const t=20,n=new Map,s=new Set,i=[...e];for(;i.length>0;){const e=i.shift();if(e.disposed)continue;const o=(n.get(e)||0)+1;if(n.set(e,o),o>t){console.warn(`[Domma Reactive] "${e.label}" re-entered the flush ${t} times - likely a dependency cycle. Skipping.`);continue}if(e.isEffect){s.add(e);continue}if(0===e.dependents().size&&!e.onNotify)continue;const{changed:r}=e.recompute();if(r)for(const t of e.dependents())t.invalidate(),i.push(t)}for(const e of s)e.disposed||e.recompute()}(e)}finally{Mi=!1,wi.size>0&&Ai()}}}function Si(e,t={}){if(null!==e&&"object"==typeof e){const{read:n,...s}=e;if("function"!=typeof n)throw new TypeError("[Domma Reactive] computed({read, write}): `read` must be a function");return new Ci(n,{...s,...t,effect:!1})}return new Ci(e,{...t,effect:!1})}function $i(e,t={}){const n=new Ci(e,{...t,effect:!0,onNotify:null});return n.recompute(),n}function zi(e){ki.push(yi),yi=null;try{return e()}finally{yi=ki.pop()}}Object.defineProperty(Ci.prototype,_i,{value:!0,enumerable:!1});const Ti="[Domma Reactive]",Bi=new Map,ji=new Set(["notify","rateLimit","throttle"]);function Oi(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Ti} registerExtender: the name must be a non-empty string`);if("function"!=typeof t)throw new TypeError(`${Ti} registerExtender: "${e}" was not given a function`);return Bi.has(e)&&!ji.has(e)&&console.warn(`${Ti} registerExtender: "${e}" replaces an existing extender`),Bi.set(e,t),t}Oi("notify",(e,t)=>{"always"===t?e.setEquals(()=>!1):console.warn(`${Ti} extend: notify accepts only 'always' - got ${JSON.stringify(t)}`)});const Di=new WeakMap;Oi("rateLimit",(e,t)=>{const n=function(e){const t=e&&"object"==typeof e?e:{timeout:e},n=t.timeout;if("number"!=typeof n||!Number.isFinite(n)||n<0)return console.warn(`${Ti} extend: rateLimit needs a timeout in milliseconds - got ${JSON.stringify(n)}`),null;const s=t.method||"notifyWhenChangesStop";return"notifyWhenChangesStop"!==s&&"notifyAtFixedRate"!==s?(console.warn(`${Ti} extend: rateLimit method must be 'notifyWhenChangesStop' or 'notifyAtFixedRate' - got ${JSON.stringify(s)}`),null):{timeout:n,fixed:"notifyAtFixedRate"===s}}(t);if(!n)return;let s=Di.get(e.observable);s||(s={timeout:n.timeout,fixed:n.fixed,timer:null,latest:void 0,armed:!1},Di.set(e.observable,s),e.intercept(e=>t=>function(e,t,n){e.timeout<=0?t(n):(e.latest=n,e.fixed&&e.armed||(e.armed=!0,e.timer&&clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,e.armed=!1,t(e.latest)},e.timeout)))}(s,e,t))),s.timeout=n.timeout,s.fixed=n.fixed,0===n.timeout&&s.timer&&(clearTimeout(s.timer),s.timer=null,s.armed=!1)}),Oi("throttle",(e,t)=>{Bi.get("rateLimit")(e,t)});const Ni="[Domma Reactive]";function Ii(){const e=new Set;return{add(t){if("function"!=typeof t)throw new TypeError(`${Ni} subscribe: expected a function`);e.add(t);const n=()=>{e.delete(t)};return n.dispose=n,n},notify(t){if(0!==e.size)for(const n of[...e])try{n(t)}catch(e){console.warn(`${Ni} a subscriber threw:`,e)}},size:()=>e.size}}function Hi(e,t){let n=e.equals||pi,s=t;const i={observable:null,setEquals(e){if("function"!=typeof e)throw new TypeError(`${Ni} extend: setEquals expects a function`);n=e},intercept(e){if("function"!=typeof e)throw new TypeError(`${Ni} extend: intercept expects a function`);s=e(s)}};return{changed:(e,t)=>!n(e,t),announce:e=>s(e),attach:e=>{i.observable=e},extend:e=>function(e,t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){const t=Bi.get(n);t?t(e,s):console.warn(`${Ti} extend: no extender named "${n}". Registered: ${[...Bi.keys()].join(", ")}.`)}else console.warn(`${Ti} extend: expected an object of extenders`)}(i,e)}}function Wi(e,t={}){const n=new Li,s=Ii();let i=e;const o=Hi(t,e=>{n.trigger(),s.notify(e)}),r=e=>{const t=o.changed(i,e);i=e,t&&o.announce(i)},a={get value(){return n.track(),i},set value(e){r(e)},peek:()=>i,set:e=>r(e),subscribe:e=>s.add(e),extend:e=>(o.extend(e),a)};return o.attach(a),gi(a)}const Pi=["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"];const Fi=new Set(["$data","$root","$parent","$index","$length","$parents","$parentContext","$component"]),Ri=Object.freeze([]);function Vi(e){let t=null;return Object.defineProperty(e,"$parents",{enumerable:!0,get:()=>t??=function(e){const t=[];for(let n=e.$parentContext;null!==n;n=n.$parentContext)t.push(n.$data);return Object.freeze(t)}(e)}),Object.freeze(e)}function qi(e,t,n=null,s=null){const i=Ki(e);return Vi({$data:t,$root:i.$root,$parent:i.$data,$index:void 0===n?null:n,$length:void 0===s?null:s,$parentContext:i,$component:i.$component??null})}function Ui(e,t){const n=Ki(e);return Vi({$data:t,$root:n.$root,$parent:n.$data,$index:null,$length:null,$parentContext:n,$component:t})}function Ki(e){return function(e){return null!==e&&"object"==typeof e&&"$data"in e}(e)?e:(t=e,Object.freeze({$data:t,$root:t,$parent:null,$index:null,$length:null,$parents:Ri,$parentContext:null,$component:null}));var t}const Yi="[Domma Reactive]",Gi=64,Ji=new Set(["__proto__","constructor","prototype"]),Xi=new Map([["new","the `new` operator is not supported"],["delete","`delete` is not supported"],["typeof","`typeof` is not supported"],["void","`void` is not supported"],["instanceof","`instanceof` is not supported"],["in","the `in` operator is not supported"],["function","function expressions are not supported"],["class","class expressions are not supported"],["this","`this` is not supported - use $data"],["await","`await` is not supported"],["yield","`yield` is not supported"]]);class Zi extends Error{}const Qi=new Map,eo=function(e){const t=e=>vi(e)?e.value:e;function n(e){const n=t(e);return Array.isArray(n)?n:n instanceof Set?[...n]:[]}function s(n,s){if(null==s)return t(n);let i=t(n);for(const n of String(s).split("."))if(i=t(e(i,n)),null==i)return i;return i}function i(e){const[t,n]=e;return e.length>=2?e=>s(e,t)===n:e=>Boolean(s(e,t))}return new Map(Object.entries({len(e){const n=t(e);return"string"==typeof n||Array.isArray(n)?n.length:n instanceof Set||n instanceof Map?n.size:0},includes(e,s){const i=t(e);return"string"==typeof i?i.includes(String(s)):n(i).includes(s)},some:(e,...t)=>n(e).some(i(t)),every:(e,...t)=>n(e).every(i(t)),count(e,...t){const s=n(e);if(0===t.length)return s.length;const o=i(t);let r=0;for(const e of s)o(e)&&r++;return r},where:(e,...t)=>n(e).filter(i(t)),sum(e,t){let i=0;for(const o of n(e)){const e=Number(s(o,t));Number.isFinite(e)&&(i+=e)}return i},pluck:(e,t)=>n(e).map(e=>s(e,t)),sortBy(e,t,i="asc"){const o="desc"===i?-1:1;return n(e).map(e=>({item:e,by:s(e,t)})).sort((e,t)=>{const n=void 0===e.by||null===e.by,s=void 0===t.by||null===t.by;return n||s?n-s:"string"==typeof e.by&&"string"==typeof t.by?o*e.by.localeCompare(t.by):e.by<t.by?-o:e.by>t.by?o:0}).map(e=>e.item)},first:e=>n(e)[0],last(e){const t=n(e);return t[t.length-1]},join:(e,s=", ")=>n(e).map(e=>{const n=t(e);return null==n?"":String(n)}).join(String(s))}))}(bo),to=new Map,no=new Map,so=new WeakMap,io=new Set,oo=/[0-9]/,ro=/[\p{ID_Start}$_]/u,ao=/[\p{ID_Continue}$\u200C\u200D]/u,lo=["===","!==","&&","||","<=",">=","??","==","!=","<",">","+","-","*","/","%","!","?",":",".",",","(",")","[","]","{","}","="],co=new Map([["==","loose equality is not supported - use ==="],["!=","loose inequality is not supported - use !=="],["=","assignment is not supported"],["??","the ?? operator is not supported"]]),ho={n:"\n",t:"\t",r:"\r",b:"\b",f:"\f",v:"\v",0:"\0"};function uo(e,t){const n=e[t];let s="",i=t+1;for(;i<e.length;){const t=e[i];if("\\"===t){const t=e[i+1];if(void 0===t)break;if("u"===t){const t=e.slice(i+2,i+6);if(!/^[0-9a-fA-F]{4}$/.test(t))throw new Zi(`bad \\u escape at position ${i}`);s+=String.fromCharCode(parseInt(t,16)),i+=6;continue}s+=Object.prototype.hasOwnProperty.call(ho,t)?ho[t]:t,i+=2;continue}if(t===n)return{value:s,end:i+1};s+=t,i++}throw new Zi(`unterminated string starting at position ${t}`)}const po={"||":{bp:3,logical:!0},"&&":{bp:4,logical:!0},"===":{bp:5},"!==":{bp:5},"<":{bp:6},"<=":{bp:6},">":{bp:6},">=":{bp:6},"+":{bp:7},"-":{bp:7},"*":{bp:8},"/":{bp:8},"%":{bp:8}},mo=new Set(["-","+","!"]),fo=e=>Object.freeze(e);function _o(e,t=!1){const n=function(e){const t=[];let n=0;for(;n<e.length;){const s=e[n];if(/\s/.test(s)){n++;continue}if(oo.test(s)){const s=n;for(;n<e.length&&oo.test(e[n]);)n++;if("."===e[n])for(n++;n<e.length&&oo.test(e[n]);)n++;if("e"===e[n]||"E"===e[n]){const t=n;if(n++,"+"!==e[n]&&"-"!==e[n]||n++,oo.test(e[n]??""))for(;n<e.length&&oo.test(e[n]);)n++;else n=t}t.push({type:"num",value:Number(e.slice(s,n)),pos:s});continue}if('"'===s||"'"===s){const s=uo(e,n);t.push({type:"str",value:s.value,pos:n}),n=s.end;continue}if("`"===s)throw new Zi(`template literals are not supported at position ${n}`);if(ro.test(s)){const s=n;for(n++;n<e.length&&ao.test(e[n]);)n++;const i=e.slice(s,n);"true"===i?t.push({type:"num",value:!0,pos:s}):"false"===i?t.push({type:"num",value:!1,pos:s}):"null"===i?t.push({type:"num",value:null,pos:s}):t.push({type:"ident",value:i,pos:s});continue}const i=lo.find(t=>e.startsWith(t,n));if(i){const e=co.get(i);if(e)throw new Zi(`${e} (at position ${n})`);t.push({type:"punct",value:i,pos:n}),n+=i.length;continue}throw new Zi(`unexpected character "${s}" at position ${n}`)}return t.push({type:"eof",value:null,pos:e.length}),t}(e);let s=0,i=0;const o=()=>n[s],r=e=>"punct"===n[s].type&&n[s].value===e,a=(e,t=n[s])=>{throw new Zi(`${e} at position ${t.pos}`)},l=e=>!!r(e)&&(s++,!0),c=e=>{l(e)||a(`expected "${e}" but found ${go(o())}`)};function h(e){if(++i>Gi)throw new Zi("expression nests deeper than 64 levels");try{let t=function(){const e=o();if("num"===e.type||"str"===e.type)return s++,fo({type:"Literal",value:e.value});if("ident"===e.type){const t=Xi.get(e.value);return t&&a(t),s++,fo({type:"Identifier",name:e.value})}if("punct"===e.type){if(mo.has(e.value))return s++,fo({type:"Unary",operator:e.value,argument:h(9)});if("("===e.value){s++;const e=h(0);return c(")"),e}if("["===e.value)return s++,fo({type:"ArrayLiteral",elements:Object.freeze(d("]"))});if("{"===e.value)return s++,function(){const e=[];if(!r("}"))do{r("}")&&a('a trailing comma before "}" is not supported');const t=o();let n;"ident"===t.type||"str"===t.type?n=String(t.value):"punct"===t.type&&"["===t.value?a("computed keys are not supported in an object literal"):"punct"===t.type&&"."===t.value?a("spread is not supported in an object literal"):a(`expected a property name but found ${go(t)}`),Ji.has(n)&&a(`the key "${n}" is not allowed`),s++,(r(",")||r("}"))&&a(`shorthand properties are not supported - write ${n}: ${n}`),r("(")&&a("methods are not supported in an object literal"),c(":"),e.push(Object.freeze({key:n,value:h(0)}))}while(l(","));return c("}"),fo({type:"ObjectLiteral",entries:Object.freeze(e)})}()}return a(`unexpected ${go(e)}`)}();for(;;){const n=o();if("punct"!==n.type)break;if(10>e&&("."===n.value||"["===n.value||"("===n.value)){t=u(t);continue}if("?"===n.value&&2>e){s++;const e=h(0);c(":");const n=h(1);t=fo({type:"Conditional",test:t,consequent:e,alternate:n});continue}const i=Object.prototype.hasOwnProperty.call(po,n.value)?po[n.value]:void 0;if(!i||i.bp<=e)break;s++;const r=h(i.bp);t=fo({type:i.logical?"Logical":"Binary",operator:n.value,left:t,right:r})}return t}finally{i--}}function d(e){const t=[];if(!r(e))do{r(e)&&a(`a trailing comma before "${e}" is not supported`),t.push(h(0))}while(l(","));return c(e),t}function u(e){if(l(".")){const t=o();return"ident"!==t.type&&a(`expected a property name after "." but found ${go(t)}`),s++,fo({type:"Member",object:e,property:t.value,computed:!1})}if(l("[")){const t=h(0);return c("]"),fo({type:"Member",object:e,property:t,computed:!0})}c("(");const n=t&&"Member"===e.type;"Identifier"===e.type||n||a("only registered helpers can be called - `x.foo()` is not supported");const i=[];if(!r(")"))do{i.push(h(0))}while(l(","));return c(")"),fo(n?{type:"MethodCall",object:e.object,property:e.property,computed:e.computed,args:Object.freeze(i)}:{type:"Call",callee:e.name,args:Object.freeze(i)})}if(1===n.length)throw new Zi("the expression is empty");const p=h(0);"eof"!==o().type&&a(`unexpected ${go(o())}`);const m=function(e){let t=0;const n=[[e,1]];for(;n.length>0;){const[e,s]=n.pop();if(s>t&&(t=s),t>Gi)return t;for(const t of vo(e))n.push([t,s+1])}return t}(p);if(m>Gi)throw new Zi(`expression nests deeper than 64 levels (${m})`);return p}function go(e){return"eof"===e.type?"end of expression":"str"===e.type?`string ${JSON.stringify(e.value)}`:"num"===e.type?`literal ${String(e.value)}`:`"${e.value}"`}function vo(e){switch(e?.type){case"Member":return e.computed?[e.object,e.property]:[e.object];case"Unary":return[e.argument];case"Binary":case"Logical":return[e.left,e.right];case"Conditional":return[e.test,e.consequent,e.alternate];case"Call":return e.args;case"ArrayLiteral":return e.elements;case"ObjectLiteral":return e.entries.map(e=>e.value);case"MethodCall":return e.computed?[e.object,e.property,...e.args]:[e.object,...e.args];default:return[]}}function bo(e,t){if(null==e)return;const n=String(t);if(!Ji.has(n))return e[n];console.warn(`${Yi} blocked an expression from reading "${n}" - __proto__, constructor and prototype are not readable from an expression`)}const yo=new WeakSet;class ko extends Error{}function wo(e,t){if(!vi(e))return e;if(!yo.has(t)){yo.add(t);const e="Identifier"===t.type?t.name:"Member"!==t.type||t.computed?"an operand":`…${t.property}`;console.warn(`${Yi} "${e}" is an observable used in an expression, not its value - use "${e}.value". The expression reads as undefined until then.`)}throw new ko(name)}function xo(e,t,n){if(n>Gi)throw new Zi("evaluation nests deeper than 64 levels");switch(e.type){case"Literal":return e.value;case"Identifier":return function(e,t){return Fi.has(e)?t[e]:bo(t.$data,e)}(e.name,t);case"Member":return bo(xo(e.object,t,n+1),e.computed?xo(e.property,t,n+1):e.property);case"Unary":{const s=wo(xo(e.argument,t,n+1),e.argument);switch(e.operator){case"!":return!s;case"-":return-s;default:return+s}}case"Logical":{const s=wo(xo(e.left,t,n+1),e.left);return"&&"===e.operator?s?xo(e.right,t,n+1):s:s||xo(e.right,t,n+1)}case"Binary":{const s=wo(xo(e.left,t,n+1),e.left),i=wo(xo(e.right,t,n+1),e.right);switch(e.operator){case"+":return s+i;case"-":return s-i;case"*":return s*i;case"/":return s/i;case"%":return s%i;case"===":return s===i;case"!==":return s!==i;case"<":return s<i;case"<=":return s<=i;case">":return s>i;default:return s>=i}}case"Conditional":return wo(xo(e.test,t,n+1),e.test)?xo(e.consequent,t,n+1):xo(e.alternate,t,n+1);case"Call":return function(e,t){const n=Qi.get(e)??eo.get(e);if("function"==typeof n)return n(...t);io.has(e)||(io.add(e),console.warn(`${Yi} no helper named "${e}" is registered - expressions can only call helpers registered with registerHelper()`))}(e.callee,e.args.map(e=>xo(e,t,n+1)));case"ArrayLiteral":return e.elements.map(e=>xo(e,t,n+1));case"ObjectLiteral":{const s={};for(const{key:i,value:o}of e.entries)Object.defineProperty(s,i,{value:xo(o,t,n+1),enumerable:!0,writable:!0,configurable:!0});return s}case"MethodCall":throw new Zi("an expression cannot call a method - `x.foo()` is available to data-on-* handlers only, because a call during a render is a side effect");default:throw new Zi(`unknown node type "${e.type}"`)}}function Mo(e,t={}){const n="string"==typeof e?e:String(e??""),s=!0===t.methodCalls,i=s?no:to;if(i.has(n))return i.get(n);let o=null;try{o=_o(n,s),so.set(o,n)}catch(e){const s=t.template?` in template "${t.template}"`:"";console.warn(`${Yi} could not parse expression "${n}"${s}: ${e.message}. The binding is skipped.`),o=null}return i.size>=1e3&&i.clear(),i.set(n,o),o}function Lo(e,t){if(null!==e&&"object"==typeof e&&"string"==typeof e.type)try{return xo(e,Ki(t),0)}catch(t){if(t instanceof ko)return;const n=so.get(e);return void console.warn(`${Yi} expression ${void 0===n?"(not from parseExpression) ":`"${n}" `}threw during evaluation:`,t)}}function Co(e,t={}){const n=Mo(e,t);return null===n?null:e=>Lo(n,e)}function Ao(e,t={}){const n="string"==typeof e?Mo(e,t):e,s=new Set;if(null===n||"object"!=typeof n)return s;const i=[n];for(;i.length>0;){const e=i.pop();if(null!==e&&"object"==typeof e)if("Identifier"!==e.type)if("Member"!==e.type||e.computed||"Identifier"!==e.object?.type||"$data"!==e.object.name&&"$root"!==e.object.name)for(const t of vo(e))i.push(t);else s.add(e.property);else Fi.has(e.name)||s.add(e.name)}return s}function Eo(e,t){if("string"!=typeof e||!function(e){if(0===e.length||!ro.test(e[0]))return!1;for(const t of e.slice(1))if(!ao.test(t))return!1;return!Xi.has(e)}(e))throw new TypeError(`${Yi} registerHelper: "${String(e)}" is not a valid helper name (it must be a plain identifier, so that an expression can spell it)`);if("function"!=typeof t)throw new TypeError(`${Yi} registerHelper: "${e}" was given a ${typeof t}, not a function`);return Qi.set(e,t),io.delete(e),t}const So=/&(?:lt|gt|quot|apos|nbsp|amp|#39|#x27|#47|#x2[Ff]|#96|#x60);/g,$o={"<":"<",">":">",""":'"',"'":"'","'":"'","'":"'"," ":" ","&":"&","/":"/","/":"/","/":"/","`":"`","`":"`"};function zo(e){return e.includes("&")?e.replace(So,e=>$o[e]):e}const To=/\{\{#(if|unless|each|with)\s+([^}]+?)\s*\}\}/,Bo=/\{\{([#/])(if|unless|each|with)(?:\s+[^}]*?)?\s*\}\}|\{\{else\}\}/g,jo=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,Oo=/\{\{>\s*([^{}]+?)\s*\}\}/g,Do=/\{\{!\s*[^{}]*?\s*\}\}/g,No=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,Io=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,Ho=/[?:()[\]'"!<>=*/%]|&&|\|\||\s[-+]\s/,Wo={"&":"&","<":"<",">":">",'"':""","'":"'"},Po=e=>null==e?"":String(e);function Fo(e){return Array.isArray(e)?e.length>0:Boolean(e)}function Ro(e){if(!Array.isArray(e))return[];for(let t=0;t<e.length;t++){const n=e[t];if(null!==n&&"object"==typeof n&&!0===n._destroy)return e.filter(e=>!(null!==e&&"object"==typeof e&&!0===e._destroy))}return e}function Vo(e,t,n){const s=function(e,t,n){const s=e.trim();if("."===s)return null!==t&&"object"==typeof t&&"."in t?t["."]:t;return s.startsWith("@")?t?.[s]:Io.test(s)||!Ho.test(s)?function(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}(t,s):function(e,t,n={}){return Lo(Mo(e,n),t)}(s,t,n)}(e,t,n);if(!vi(s))return s;const i=e.trim();qo.has(i)||(qo.add(i),console.warn(`[Domma Reactive] "${i}" is an observable, not its value - use "${i}.value". It renders as empty until then.`))}const qo=new Set;function Uo(e,t,n){return e.replace(Do,"").replace(Oo,(e,s)=>{const i=n.partials?.[s.trim()];return void 0===i?"":Ko(i,t,n)}).replace(jo,(e,s)=>Po(Vo(s,t,n))).replace(No,(e,s)=>Po(Vo(s,t,n)).replace(/[&<>"']/g,e=>Wo[e]))}function Ko(e,t={},n={}){if("string"!=typeof e||0===e.length)return"";const s=e.match(To);if(!s)return Uo(e,t,n);const[i,o,r]=s,a=s.index+i.length,{close:l,alternate:c}=function(e,t,n){let s=0,i=-1;for(const o of e.slice(n).matchAll(Bo)){const e=n+o.index;if(void 0!==o[1])if("#"!==o[1]){if(0!==s)s--;else if(o[2]===t)return{close:e,alternate:i}}else s++;else 0===s&&-1===i&&(i=e)}return{close:-1,alternate:-1}}(e,o,a);if(-1===l)return Uo(e,t,n);const h="if"===o&&-1!==c&&c<l,d=e.slice(a,h?c:l),u=h?e.slice(c+8,l):"",p=Uo(e.slice(0,s.index),t,n),m=Ko(e.slice(l+`{{/${o}}}`.length),t,n),f=Vo(r,t,n);let _="";if("if"===o)_=Fo(f)?Ko(d,t,n):Ko(u,t,n);else if("unless"===o)_=Fo(f)?"":Ko(d,t,n);else if("each"===o){const e=Ro(f);_=e.map((t,s)=>Ko(d,function(e,t,n){const s={"@index":t,"@first":0===t,"@last":t===n-1};return null!==e&&"object"==typeof e?{...e,...s}:{".":e,...s}}(t,s,e.length),n)).join("")}else _=null!==f&&"object"==typeof f?Ko(d,f,n):"";return p+_+m}const Yo="[Domma Reactive]",Go=new Map,Jo=new Set;function Xo(e,t){Jo.has(e)||(Jo.add(e),console.warn(`${Yo} ${t}`))}function Zo(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Yo} registerBinding: the name must be a non-empty string`);if(null===t||"object"!=typeof t)throw new TypeError(`${Yo} registerBinding: "${e}" was not given a handler object`);if("function"!=typeof t.update)throw new TypeError(`${Yo} registerBinding: "${e}" has no update() function`);for(const n of["attach","detach"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`${Yo} registerBinding: "${e}".${n} is not a function`);return Go.has(e)&&console.warn(`${Yo} registerBinding: "${e}" replaces an existing binding handler`),Go.set(e,Object.freeze({...t})),t}function Qo(e){return Go.get(e)}function er(e){let t=null;for(const[n,s]of Go){if(s.attribute===e)return{kind:n,handler:s,arg:null};"string"==typeof s.attributePrefix&&e.startsWith(s.attributePrefix)&&e.length>s.attributePrefix.length&&(null===t||s.attributePrefix.length>t.handler.attributePrefix.length)&&(t={kind:n,handler:s,arg:e.slice(s.attributePrefix.length)})}return t}const tr=e=>null==e?"":String(e);function nr(e,t){if(null===e||"object"!=typeof e)return null;if("Identifier"===e.type){if(Fi.has(e.name))return null;const n=t.$data;return null===n||"object"!=typeof n||(Object.isFrozen(n)||Ji.has(e.name))?null:{object:n,key:e.name}}if("Member"===e.type){const n=Lo(e.object,t);if(null===n||"object"!=typeof n)return null;if(Object.isFrozen(n))return null;const s=tr(e.computed?Lo(e.property,t):e.property);return Ji.has(s)?null:{object:n,key:s}}return null}const sr={tracks:!0,update({binding:e,nodes:t,context:n}){const s=tr(e.evaluate(n));for(const e of t)e.textContent=s;return!0}},ir={tracks:!0,update({binding:e,nodes:t,context:n,render:s}){for(const i of t)for(const t of e.parts){const e=zo(s(t.tmpl,n.$data));i.setAttribute(t.name,e),"value"===t.name&&"value"in i&&(i.value=e)}return!0}},or={tracks:!0,capturesBody:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:i,reindex:o}){const r=s(e.body,n.$data);for(const e of t)i(e.open,e.close,r);return o(),!0}},rr={tracks:!0,region:!0,capturesBody:!0,primes:!0,attribute:"data-if",expression:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:i,reindex:o}){const r=Fo(e.evaluate(n))?s(e.body,n.$data):"";for(const e of t)i(e.open,e.close,r);return o(),!0}},ar=new WeakMap,lr={attributePrefix:"data-on-",expression:!0,methodCalls:!0,tracks:!1,update:()=>!1,attach({binding:e,node:t,controller:n}){if(!e.arg)return;const s=t=>function(e,t,n){const s=e.ast;if(null===s)return;let i,o,r=n.$data;if("MethodCall"===s.type){r=Lo(s.object,n);i=bo(r,s.computed?Lo(s.property,n):s.property),o=s.args.map(e=>Lo(e,n))}else"Call"===s.type?(i=Lo({type:"Identifier",name:s.callee},n),o=s.args.map(e=>Lo(e,n))):(i=Lo(s,n),o=[]);if("function"!=typeof i)return void Xo(`event:${e.id}:${e.expr}`,`data-on-${e.arg}="${e.expr}" did not resolve to a function - an event binding names a handler on your data, or calls one`);!1===i.call(r,...o,t)&&t.preventDefault()}(e,t,n.context());t.addEventListener(e.arg,s);let i=ar.get(t);i||ar.set(t,i=new Map),i.set(e.id,{type:e.arg,listener:s})},detach({binding:e,node:t}){const n=ar.get(t)?.get(e.id);n&&(t.removeEventListener(n.type,n.listener),ar.get(t).delete(e.id))}};const cr=new Set(["value","checked","selected","disabled","readonly","required","multiple","indeterminate","open","hidden"]),hr=new WeakMap,dr=new WeakMap,ur={attributePrefix:"data-bind-",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.arg;if("html"===s)return Xo("bind:html","data-bind-html is not supported - assigning innerHTML from data is an XSS hole. Use {{{triple-stache}}}, which says so where an author can see it."),!1;const i=e.evaluate(n);for(const n of t)"text"===s?n.textContent=tr(i):"class"===s?pr(e,n,i):"style"===s?_r(e,n,i):s.startsWith("style-")?mr(n,s.slice(6),i):cr.has(s)&&s in n?n[s]="value"===s?tr(i):Boolean(i):null==i||!1===i?n.removeAttribute(s):n.setAttribute(s,!0===i?"":tr(i));return!0}};function pr(e,t,n){let s=hr.get(e);s||hr.set(e,s=new WeakMap);for(const e of s.get(t)||[])t.classList.remove(e);const i=n?tr(n).split(/\s+/).filter(Boolean):[];for(const e of i)t.classList.add(e);s.set(t,i)}function mr(e,t,n){null!=n&&!1!==n&&""!==n?e.style.setProperty(t,tr(n)):e.style.removeProperty(t)}function fr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function _r(e,t,n){if(null!=n&&"object"!=typeof n)return void Xo(`bind:style:${e.id}`,`data-bind-style="${e.expr}" needs an object of CSS properties - got `+typeof n+". For a single property use data-bind-style-<property>.");let s=dr.get(e);s||dr.set(e,s=new WeakMap);const i=s.get(t)||[],o=[];for(const[e,s]of Object.entries(n||{})){const n=fr(e);mr(t,n,s),o.push(n)}for(const e of i)o.includes(e)||t.style.removeProperty(e);s.set(t,o)}const gr=Symbol("dm:option-value"),vr=Symbol("dm:pending-value"),br={attribute:"data-options",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Ro(e.evaluate(n));for(const i of t)kr(e,i,s,n);return!0}};function yr(e,t){const n=e.getAttribute(t);return null===n||""===n.trim()?null:Co(n)}function kr(e,t,n,s){if("SELECT"!==t.tagName)return void Xo(`options:${e.id}`,`data-options="${e.expr}" is on <${t.tagName.toLowerCase()}>, which has no options. Put it on a <select>.`);const i=yr(t,"data-options-text"),o=yr(t,"data-options-value"),r=yr(t,"data-options-caption"),a=vr in t?[].concat(t[vr]):function(e){return[...e.options].filter(e=>e.selected).map(e=>gr in e?e[gr]:e.value)}(t);if(t.textContent="",r){const e=document.createElement("option");e.value="",e.textContent=tr(r(s)),t.appendChild(e)}n.forEach((e,r)=>{const a=qi(s,e,r,n.length),l=document.createElement("option");l.textContent=tr(i?i(a):e);const c=o?o(a):e;null==c||"object"==typeof c?(l.value=`\0opt:${r}`,l[gr]=c):"string"!=typeof c?(l.value=tr(c),l[gr]=c):l.value=c,t.appendChild(l)}),function(e,t){if(0===t.length)return;let n=!1;for(const s of e.options){const i=gr in s?s[gr]:s.value,o=t.some(e=>e===i);e.multiple?(s.selected=o,n=n||o):o&&!n&&(s.selected=!0,n=!0)}e.multiple||n||(e.selectedIndex=e.options.length>0?0:-1);n&&delete e[vr]}(t,a)}const wr={attribute:"data-model",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.evaluate(n);for(const e of t)Cr(e,s);return!0},attach({binding:e,node:t,controller:n}){const s=()=>{const s=n.context(),i=nr(e.ast,s);if(null===i)return void Xo(`model:${e.id}:${e.expr}`,`data-model="${e.expr}" is not a settable path, so nothing was written`);const o=function(e){switch(Mr(e)){case"checkbox":return e.checked;case"radio":return e.checked?e.value:xr;case"select-multiple":return Array.from(e.options).filter(e=>e.selected).map(Lr);case"select":return-1===e.selectedIndex?"":Lr(e.options[e.selectedIndex]);case"number":return""===e.value?null:Number(e.value);default:return e.value}}(t);o!==xr&&(i.object[i.key]=o)},i=function(e){const t=Mr(e);return"text"===t||"number"===t?["input","change"]:["change"]}(t);for(const e of i)t.addEventListener(e,s);let o=ar.get(t);o||ar.set(t,o=new Map),o.set(e.id,{type:i,listener:s})},detach({binding:e,node:t}){const n=ar.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);ar.get(t).delete(e.id)}}},xr=Symbol("no-write");function Mr(e){const t=e.tagName;if("SELECT"===t)return e.multiple?"select-multiple":"select";if("INPUT"!==t)return"text";const n=String(e.type||"").toLowerCase();return"checkbox"===n||"radio"===n?n:"number"===n||"range"===n?"number":"text"}function Lr(e){return gr in e?e[gr]:e.value}function Cr(e,t){switch(Mr(e)){case"checkbox":{const n=Boolean(t);return void(e.checked!==n&&(e.checked=n))}case"radio":{const n=tr(t)===e.value;return void(e.checked!==n&&(e.checked=n))}case"select-multiple":{const n=Array.isArray(t)?t:[];if(0===e.options.length)return void(n.length>0&&(e[vr]=n));const s=new Set(n.map(tr));for(const t of e.options){const e=Lr(t),i=n.some(t=>t===e)||s.has(t.value);t.selected!==i&&(t.selected=i)}return}case"select":{const n=function(e,t){return[...e.options].find(e=>Lr(e)===t)||null}(e,t);if(n)return n.selected||(n.selected=!0),void delete e[vr];const s=tr(t);return e.value!==s&&(e.value=s),void(e.value!==s?e[vr]=t:delete e[vr])}default:{const n=tr(t);e.value!==n&&(e.value=n)}}}const Ar=new WeakSet,Er={attribute:"data-focus",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Fo(e.evaluate(n));for(const e of t){if("function"!=typeof e.focus)continue;if(s!==(e.ownerDocument.activeElement===e)){Ar.add(e);try{s?e.focus():e.blur()}finally{Ar.delete(e)}}}return!0},attach({binding:e,node:t,controller:n}){const s=s=>{if(Ar.has(t))return;const i=n.context(),o=nr(e.ast,i);null!==o?o.object[o.key]="focus"===s.type:Xo(`focus:${e.id}:${e.expr}`,`data-focus="${e.expr}" is not a settable path, so focus was not written back. Focus still follows the value.`)},i=["focus","blur"];for(const e of i)t.addEventListener(e,s);let o=ar.get(t);o||ar.set(t,o=new Map),o.set(e.id,{type:i,listener:s})},detach({binding:e,node:t}){const n=ar.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);ar.get(t).delete(e.id)}}};Zo("text",sr),Zo("attr",ir),Zo("block",or),Zo("raw",or),Zo("if",rr),Zo("event",lr),Zo("bind",ur),Zo("model",wr),Zo("options",br),Zo("focus",Er);const Sr=new WeakMap;let $r=0;function zr(e,t){if(null==e||"function"!=typeof t)return;let n=Sr.get(e);n||Sr.set(e,n=new Set),n.add(t),$r++}function Tr(e){const t=Sr.get(e);if(t){Sr.delete(e),$r-=t.size;for(const e of t)try{e()}catch(e){console.warn("[Domma Reactive] a disposer threw:",e)}}}function Br(e){if(0===$r||null==e)return;if(Tr(e),1!==e.nodeType&&11!==e.nodeType)return;const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null),n=[];let s;for(;s=t.nextNode();)Sr.has(s)&&n.push(s);for(const e of n)Tr(e)}const jr=["data-dm-t","data-dm-a","data-dm-b"];jr.map(e=>`[${e}]`).join(",");const Or=e=>`\x3c!--dm:${e}--\x3e`,Dr=e=>`\x3c!--/dm:${e}--\x3e`;function Nr(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function Ir(e,t){const n=[];for(let s=e.nextSibling;s&&s!==t;s=s.nextSibling)n.push(s);return n}function Hr(e,t,n){const s=e.parentNode;if(!s)return;let i=e.nextSibling;for(;i&&i!==t;){const e=i.nextSibling;Br(i),s.removeChild(i),i=e}n&&s.insertBefore(Nr(n),t)}const Wr="[Domma Reactive]";function Pr(e){const{bindings:t,getRoots:n,render:s,reactive:i=!1,label:o="",repaint:r=null}=e,a=new Map(t.map(e=>[e.id,e]));for(const e of t)e.seen=new WeakSet;const l=new Map;let c=[],h=!1,d=!1,u=Ki(e.context);function p(){d||(function(e,t,n){for(const e of n)e.nodes=null;const s=(e,n)=>{const s=t.get(e);s&&(s.nodes||=[]).push(n)},i=e=>{for(const t of jr){const n=e.getAttribute(t);if(null!==n)for(const t of n.split(/\s+/))s(t,e)}},o=new Map,r=e=>{const t=e.data;if(t.startsWith("/dm:")){const n=t.slice(4),i=o.get(n);if(!i)return;s(n,{open:i,close:e}),o.delete(n)}else t.startsWith("dm:")&&o.set(t.slice(3),e)};for(const t of e){if(8===t.nodeType){r(t);continue}if(1!==t.nodeType&&11!==t.nodeType)continue;1===t.nodeType&&i(t);const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null);let n;for(;n=e.nextNode();)8===n.nodeType?r(n):i(n)}}(n(),a,t),function(){for(const e of t){if(null===e.nodes){f(e.id);continue}const t=Qo(e.kind);let n=!1;for(const s of e.nodes){const i=void 0===s.nodeType?s.open:s;e.seen.has(i)||(e.seen.add(i),n=!0,void 0!==s.nodeType&&t?.attach?.({binding:e,node:s,controller:_}))}n&&(i||!0===e.prime)&&c.push(e)}}(),function(){if(h)return;h=!0;try{let e=0;for(;c.length>0;){if(++e>20){console.warn(`${Wr} a binding kept revealing new nodes after 20 rounds; giving up so the page still renders. Kinds still pending: ${[...new Set(c.map(e=>e.kind))].join(", ")}`);break}const t=c;c=[];for(const e of[!0,!1])for(const n of t)!0===Qo(n.kind)?.region===e&&m(n)}}finally{h=!1,c=[]}}())}function m(e){if(!i)return void _.update(e.id);const t=l.get(e.id);!t||t.disposed?l.set(e.id,$i(()=>_.update(e.id),{label:`${o||"binding"}:${e.id}`})):t.recompute()}function f(e){const t=l.get(e);t&&(l.delete(e),t.dispose())}const _={bindings:t,deps:e=>a.get(e)?.deps||new Set,context:()=>u,setContext(e){u=Ki(e)},refresh(e=null){for(const n of t)null!==n.nodes&&0!==n.nodes.length&&(null!==e&&!0!==e(n)||m(n))},index:p,update(e,t){if(void 0!==t&&(u=Ki(t)),d)return!1;const n=a.get(e);if(!n||!n.nodes||0===n.nodes.length)return!1;const i=Qo(n.kind);return void 0!==i&&!0===i.update({binding:n,nodes:n.nodes,context:u,render:s,replaceRegion:Hr,reindex:p,controller:_})},updateAll(e){void 0!==e&&(u=Ki(e));for(const e of t)_.update(e.id)},rerenderAll(e){void 0!==e&&(u=Ki(e)),r?.(u),p()},rerender(e){_.rerenderAll(e)},destroy(){d=!0;for(const e of t){const t=Qo(e.kind);if(void 0!==t?.detach&&null!==e.nodes)for(const n of e.nodes)void 0!==n.nodeType&&t.detach({binding:e,node:n,controller:_})}for(const e of l.values())e.dispose();l.clear();for(const e of n())Br(e)},effectCount:()=>l.size};return _}const Fr=new WeakMap,Rr=new Set;function Vr(e,t){Rr.has(e)||(Rr.add(e),console.warn(`[Domma Reactive] ${t}`))}function qr(e,t,n,s,i,o={}){const r=document.createComment("dm:item"),a=document.createComment("/dm:item"),l=e.content.cloneNode(!0);l.insertBefore(r,l.firstChild),l.appendChild(a);const c=Pr({bindings:e.bindings.map(e=>({...e})),render:e.render,context:o.context??qi(t,n,s,i),getRoots:()=>Ir(r,a),reactive:!0,label:e.label}),h={key:null,item:n,index:s,length:i,parentContext:t,open:r,close:a,runtime:c,disposed:!1,allNodes:()=>[r,...Ir(r,a),a],refresh(t,n,s,i){const o=t.$data!==h.parentContext.$data||t.$root!==h.parentContext.$root||!0===e.usesAncestors&&t!==h.parentContext||n!==h.item,r=s!==h.index||!0===e.usesLength&&i!==h.length;return h.item=n,h.index=s,h.length=i,h.parentContext=t,!(!o&&!r)&&(c.setContext(qi(t,n,s,i)),c.refresh(o?null:e=>!0===e.positional),!0)},dispose(e=!0){if(h.disposed)return;h.disposed=!0,function(e,t){const n=Sr.get(e);!n||!n.delete(t)||($r--,0===n.size&&Sr.delete(e))}(r,d),c.destroy();for(const e of Ir(r,a))Br(e);if(!e)return;const t=r.parentNode;if(t)for(const e of h.allNodes())t.removeChild(e)}},d=()=>h.dispose(!1);return zr(r,d),c.index(),h}function Ur(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}function Kr(e,t,n,s,i,o){let r=Fr.get(e.open);void 0===r&&(r={byKey:new Map},Fr.set(e.open,r),zr(e.open,()=>{for(const e of r.byKey.values())e.dispose(!1);r.byKey=new Map}));const a=r.byKey,l=new Map,c=[],h=Ro(t);for(let e=0;e<h.length;e++){const t=h[e];let r=Ur(t,s);null==r?(Vr(`key:missing:${o}:${s}`,`key=${s} is missing on an item of ${o} - falling back to position for that item, which reconciles no better than an unkeyed block. Give every item a stable identifier.`),r=`\0position:${e}`):l.has(r)&&(Vr(`key:duplicate:${o}:${s}`,`two items of ${o} share key=${s} value "${String(r)}" - a key must identify exactly one item. The duplicate is being kept apart by position, so it will not reconcile across changes.`),r=`\0duplicate:${e}:${String(r)}`);let d=a.get(r);void 0===d?(d=qr(n,i,t,e,h.length),d.key=r):(a.delete(r),d.refresh(i,t,e,h.length)),l.set(r,d),c.push(d)}for(const e of a.values())e.dispose();!function(e,t){const n=e.parentNode;if(!n)return;let s=e;for(const e of t)if(s.nextSibling!==e.open)for(const t of e.allNodes())n.insertBefore(t,s.nextSibling),s=t;else s=e.close}(e.open,c),r.byKey=l}function Yr(e){return{tracks:!0,region:!0,primes:!0,acceptsReactive:!0,update({binding:t,nodes:n,context:s,render:i}){const o=e(t,i),r=(a=t.evaluate(s),Array.isArray(a)?a:null!==a&&"object"==typeof a&&Array.isArray(a.value)?a.value:[]);var a;for(const e of n)Kr(e,r,o,t.keyPath,s,o.label);return!0}}}const Gr="[Domma Reactive]",Jr=new Map,Xr=new Set;function Zr(e,t){Xr.has(e)||(Xr.add(e),console.warn(`${Gr} ${t}`))}function Qr(e){return Jr.get(e)}const ea="data-param-";function ta(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function na(e,t,n){const s={},i=e.getAttribute("data-params");if(null!==i&&""!==i.trim()){const e=Co(i),o=null===e?null:e(n);null===e?Zr(`component:params:${t.id}`,`data-params="${i}" did not parse, in ${t.expr}`):null===o||"object"!=typeof o?Zr(`component:params:${t.id}`,`data-params="${i}" needs an object of params - got ${null===o?"null":typeof o}, in ${t.expr}`):Object.assign(s,o)}for(const i of[...e.attributes]){if(!i.name.startsWith(ea))continue;const e=ta(i.name.slice(11));if(""===e)continue;const o=Co(i.value);null!==o?(e in s&&Zr(`component:collide:${t.id}:${e}`,`"${e}" is given by both data-params and ${i.name}, in ${t.expr}. The attribute wins, but one of the two is redundant.`),s[e]=o(n)):Zr(`component:param:${t.id}:${e}`,`${i.name}="${i.value}" did not parse, in ${t.expr}`)}return Object.freeze(s)}function sa(e){const t=new Map;for(const n of[...e.childNodes]){const e=1===n.nodeType?n.getAttribute("data-slot")??"":"";t.has(e)||t.set(e,[]),t.get(e).push(n),n.remove()}return t}function ia(e,t){const n=`dm:${t}`,s=`/dm:${t}`;let i=null,o=null;const r=e=>{if(8!==e.nodeType)for(const t of e.childNodes)r(t);else e.data===n?i=e:e.data===s&&(o=e)};for(const t of e)if(r(t),null!==i&&null!==o)return{open:i,close:o};return null}function oa(e,t){const n=[];for(let s=e.nextSibling;null!==s&&s!==t;s=s.nextSibling)n.push(s);return n}function ra(e,t,n,s,i){const o=[],r=e.allNodes(),a=new Set;for(const e of t.slots??[]){if(a.has(e.name)){Zr(`component:slot:duplicate:${s.id}:${i}:${e.name}`,`the component "${i}" declares more than one `+(""===e.name?"default slot":`slot named "${e.name}"`)+". The first is filled and the rest keep their fallback content.");continue}a.add(e.name);const t=n.get(e.name);if(void 0===t||0===t.length)continue;const l=ia(r,e.id);if(null!==l){for(const e of oa(l.open,l.close))e.remove();for(const e of t)l.close.parentNode.insertBefore(e,l.close);o.push({name:e.name,nodes:t})}}for(const[e,t]of n)a.has(e)||0===t.length||t.every(e=>3===e.nodeType&&""===e.data.trim())||Zr(`component:slot:unmatched:${s.id}:${i}:${e}`,""===e?`the component "${i}" was given content but declares no {{#slot}}, so that content is not rendered. Add a slot to its template, or remove the content.`:`the component "${i}" has no slot named "${e}", so that content is not rendered. Check data-slot against the template's {{#slot}} blocks.`);return o}const aa=new WeakMap;function la(e,t,n,s,i){if(void 0===e.create)return t;try{return e.create(t,{element:n})}catch(e){return Zr(`component:create:${s.id}:${i}`,`the component "${i}" threw while being created, in ${s.expr}: ${e&&e.message}`),null}}function ca(e){if(null===e.instance)return;for(const{nodes:t}of e.placed)for(const e of t)e.remove();e.placed=[];const t=e.viewModel;if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose)try{t.dispose()}catch(e){console.warn(`${Gr} a component's dispose() threw:`,e)}e.instance.dispose(),e.instance=null,e.viewModel=null,e.name=null}const ha="[Domma Reactive]",da=/\{\{([#/])(if|unless|each|with|slot)(?:\s+([^}]+?))?\s*\}\}/g,ua=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,pa=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,ma=/\{\{>\s*[^{}]+?\s*\}\}/,fa=/\sdata-each\s*=\s*(?:"([^"]*)"|'([^']*)')/,_a=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>/g,ga=/([\w:@.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,va=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,ba=/^[@.]/,ya={".":e=>e.$data,"@index":e=>e.$index,"@first":e=>0===e.$index,"@last":e=>null!==e.$length&&e.$index===e.$length-1},ka=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wa={text:"txt",attr:"attr",raw:"raw",block:"blk"};function xa(e,t){if(0===t.length)return e;const n=[...t].sort((e,t)=>e.index-t.index||(e.order??0)-(t.order??0));let s="",i=0;for(const t of n)t.index<i||(s+=e.slice(i,t.index)+t.text,i=t.index+(t.skip??0));return s+e.slice(i)}function Ma(e,t){let n=null;for(const s of t)e>=s[0]&&e<s[1]&&(!n||s[0]>n[0])&&(n=s);return n}function La(e,t){for(const[n,s]of t)if(e>=n&&e<s)return!0;return!1}function Ca(e){return String(e).trim().split(".")[0]}function Aa(e,t){const n=String(t).trim().split(".");let s=e;for(const e of n){if(null==s)return;s=s[e]}return s}function Ea(e){const t=new Set;for(const n of e.matchAll(pa)){const e=n[1].trim();va.test(e)&&t.add(Ca(e))}for(const n of e.matchAll(ua)){const e=n[1].trim();va.test(e)&&t.add(Ca(e))}return t}function Sa(e){const t=[],n=[];for(const s of e.matchAll(da)){if("#"===s[1]){t.push({start:s.index,kind:s[2],expr:(s[3]||"").trim()});continue}let e=null;for(;t.length>0;){const n=t.pop();if(n.kind===s[2]){e=n;break}}e&&n.push({start:e.start,end:s.index+s[0].length,kind:e.kind,expr:e.expr})}return n}function $a(e,t){const n=e.lastIndexOf("<",t);return-1!==n&&n>e.lastIndexOf(">",t)}function za(e,t){const n=t[1],s=t.index,i=s+t[0].length;if("/"===t[3]||ka.has(n.toLowerCase()))return[s,i];const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<(/?)${o}(?=[\\s/>])`,"gi");let a=1;for(const t of e.slice(i).matchAll(r)){const n=i+t.index;if("/"===t[1]){if(a--,a>0)continue;const t=e.indexOf(">",n);return-1===t?null:[s,t+1]}const o=e.indexOf(">",n);-1!==o&&"/"===e[o-1]||a++}return null}function Ta(e,t){const n=[];for(const s of t){if("each"!==s.kind&&"with"!==s.kind)continue;const t=e.indexOf(Or(s.id)),i=e.indexOf(Dr(s.id));-1!==t&&-1!==i&&n.push([t,i,s])}return n}const Ba=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,ja=/\s+key\s*=\s*[A-Za-z_$][\w$]*(?:\.[\w$]+)*/,Oa=new Set;function Da(e){const t=Ba.exec(String(e));return null===t||""===t[1].trim()?null:{collection:t[1].trim(),key:t[2]}}function Na(e,t){const n=/^\{\{#(?:if|unless|each|with|slot)(?:\s+[^}]*?)?\s*\}\}/.exec(e.slice(t.start,t.end)),s=/\{\{\/(?:if|unless|each|with|slot)\s*\}\}$/.exec(e.slice(t.start,t.end));return null===n||null===s?[t.start,t.end]:[t.start+n[0].length,t.start+s.index]}function Ia(e,t){const n=[];for(const s of t){if(!0!==Qo(s.kind)?.capturesBody)continue;const t=Or(s.id),i=e.indexOf(t),o=e.indexOf(Dr(s.id));-1!==i&&-1!==o&&n.push([i+t.length,o])}n.sort((e,t)=>e[0]-t[0]);let s="",i=0;for(const[t,o]of n)t<i||(s+=e.slice(i,t),i=o);return s+=e.slice(i),s.replace(/\{\{\{[^{}]*\}\}\}/g,"").replace(/\{\{[^{}]*\}\}/g,"")}const Ha=/\$index|\$length|@index|@first|@last/;function Wa(e){const t=(e.parts??[]).map(e=>e.tmpl).join(" ");return`${e.expr??""} ${e.body??""} ${t}`}let Pa=0;function Fa(e,t,n,s,i){const{annotated:o,bindings:r,slots:a}=Ka(e,{...s,itemForms:!0,template:t,idPrefix:i});for(const e of r)e.positional=Ha.test(Wa(e));return{content:Nr(Ia(o,r)),bindings:r,slots:a,render:n,label:t,options:s,usesLength:/@last|\$length/.test(e),usesAncestors:/\$parentContext|\$parents/.test(e)}}function Ra(e,t,n=[]){if(!1===t.warnUnkeyed&&0===n.length)return;const s=`${t.template??""}|${e}`;if(Oa.has(s))return;Oa.add(s);const i=t.template?` in template "${t.template}"`:"",o=n.map(e=>`"${e}"`).join(", "),r=n.length?`, and its ${o} ${1===n.length?"binding is":"bindings are"} not attached`:"",a=n.length?` - ${1===n.length?"it binds":"they bind"} normally once the block has a key`:"";console.warn(`${ha} {{#each ${e}}}${i} has no key=, so it re-renders the whole block on every change - losing DOM node identity, focus and uncommitted input${r}. Write {{#each ${e} key=id}}, naming whichever property identifies an item, to reconcile instead${a}.`)}function Va(e,t){const n=`demoted|${t.template??""}|${e}`;if(Oa.has(n))return;Oa.add(n);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ha} {{#each ${e}}}${s} sits inside an unkeyed {{#each}} or a {{#with}}, so it cannot reconcile: its collection would be resolved against the top-level data. It has been demoted to a plain re-rendered block. Add key= to the ENCLOSING block and both will reconcile.`)}function qa(e,t){return null===e.factoryBox.value&&(e.factoryBox.value=function(e,t,n){const s=`${n.template?`${n.template} `:""}{{#each ${e.expr}}}`;return ma.test(e.body)&&console.warn(`${ha} {{> partial}} inside a keyed {{#each}} is not expanded - the block body is compiled once into a <template>, before any render pass exists to resolve a partial against. Inline it, in ${s}`),Fa(e.body,s,t,n,`i${++Pa}:`)}(e,t,e.factoryBox.options)),e.factoryBox.value}function Ua(e,t,n){const s={...n,methodCalls:!0===t.methodCalls},i=Mo(e,s);return null===i?null:{ast:i,evaluate:bi(Co(e,s),{expr:e,where:n?.template?`template "${n.template}"`:"",handler:t}),deps:!1===t.tracks?new Set:Ao(i)}}function Ka(e,t={}){const n=[],s=[],i=new Set,o=t.idPrefix??"",r=(e,n)=>{if(i.has(e))return;i.add(e);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ha} ${n}${s}`)},a=fa.exec(e);if(null!==a){const e=a[1]??a[2]??"";r("inert-each",`data-each="${e}" does nothing here. It is an applyBindings spelling, and this is compiled markup - write {{#each ${e}}} … {{/each}} instead. A data-each nested inside another list is compiled markup too, which is the usual way to meet this`)}for(const t of e.matchAll(_a)){const e=t[2]||"";if(!e.includes("data-param-"))continue;if(/\sdata-component\s*=/.test(e))continue;const n=/\s(data-param-[\w-]+)/.exec(e);r("orphan-param",`${null===n?"data-param-*":n[1]} does nothing on an element with no data-component. Check the component attribute is present and spelled correctly - and remember its value is an expression, so a literal name takes quotes: data-component="'my-thing'"`)}const l=Sa(e),c=function(e){const t=[];for(const n of e.matchAll(_a)){const s=n[2]||"";if(s.includes("data-"))for(const i of s.matchAll(ga)){const s=er(i[1]);if(null===s||!s.handler.region)continue;const o=za(e,n);if(null===o)break;t.push({start:o[0],end:o[1],kind:s.kind,arg:s.arg,expr:zo(void 0!==i[2]?i[2]:i[3]||"").trim()});break}}return t}(e),h=[],d=new Set,u=l.filter(e=>"with"===e.kind||"each"===e.kind&&null===Da(e.expr)).map(e=>[e.start,e.end]);for(const e of l)"each"===e.kind&&null!==Da(e.expr)&&(u.some(([t,n])=>e.start>t&&e.end<=n)?(d.add(e.start),Va(e.expr,t)):h.push([e.start,e.end]));const p=(e,t)=>h.some(([n,s])=>e>n&&t<=s),m=[...l.map((e,t)=>({...e,id:`${o}${t}_blk`,mustache:!0})).filter(e=>!p(e.start,e.end)),...c.map((e,t)=>({...e,id:`${o}${l.length+t}_${e.kind}`})).filter(e=>!p(e.start,e.end))],f=[];for(const t of m){if(t.mustache&&d.has(t.start)){const n=e.slice(t.start,t.end),s=ja.exec(n);null!==s&&f.push({index:t.start+s.index,text:"",order:1,skip:s[0].length}),t.expr=Da(t.expr)?.collection??t.expr}if(t.mustache&&"slot"===t.kind){const[n,i]=Na(e,t);f.push({index:t.start,text:Or(t.id),order:1,skip:n-t.start}),f.push({index:i,text:Dr(t.id),order:0,skip:t.end-i}),s.push({id:t.id,name:t.expr});continue}const n=t.mustache&&"each"===t.kind&&!d.has(t.start)&&Da(t.expr);if(n){f.push({index:t.start,text:Or(t.id)+Dr(t.id),order:1,skip:t.end-t.start}),t.keyed=n;const[s,i]=Na(e,t);t.rawBody=e.slice(s,i);continue}t.mustache&&"each"===t.kind&&(t.unkeyed=!0),f.push({index:t.start,text:Or(t.id),order:1}),f.push({index:t.end,text:Dr(t.id),order:0})}let _=xa(e,f),g=m.length;const v=e=>`${o}${g++}_${wa[e]??e}`;for(const e of m){if("slot"===e.kind)continue;if(-1===_.indexOf(Or(e.id)))continue;if(e.keyed){const s=Qo("each"),i=Ua(e.keyed.collection,s,t);if(null===i)continue;n.push({id:e.id,kind:"each",blockKind:"each",expr:e.keyed.collection,keyPath:e.keyed.key,body:e.rawBody,ast:i.ast,evaluate:i.evaluate,deps:i.deps,prime:!0===s.primes,factoryBox:{value:null,options:t},nodes:null});continue}if(e.mustache){n.push({id:e.id,kind:"block",blockKind:e.kind,expr:e.expr,body:"",deps:va.test(e.expr)?new Set([Ca(e.expr)]):Ea(e.expr),nodes:null});continue}const s=Qo(e.kind),i=Ua(e.expr,s,t);null!==i&&n.push({id:e.id,kind:e.kind,arg:e.arg,expr:e.expr,body:"",ast:i.ast,evaluate:i.evaluate,deps:i.deps,prime:!0===s.primes,nodes:null})}const b=[];for(const e of[..._.matchAll(ua)]){if(La(e.index,Ta(_,m)))continue;const t=e[1].trim();if(!va.test(t))continue;const s=v("raw");b.push({index:e.index,text:Or(s),order:1}),b.push({index:e.index+e[0].length,text:Dr(s),order:0}),n.push({id:s,kind:"raw",expr:t,body:e[0],deps:new Set([Ca(t)]),nodes:null})}_=xa(_,b);const y=n.filter(e=>"raw"===e.kind).map(e=>{const t=_.indexOf(Or(e.id)),n=_.indexOf(Dr(e.id));return-1!==t&&-1!==n?[t,n+Dr(e.id).length]:null}).filter(Boolean),k=Ta(_,m),w=[];for(const e of[..._.matchAll(pa)]){if(La(e.index,k))continue;if(La(e.index,y))continue;if($a(_,e.index))continue;const s=Ya(e[1].trim(),t,r);if(null===s)continue;const i=v("text");w.push({index:e.index,text:`<span data-dm-t="${i}">`,order:1}),w.push({index:e.index+e[0].length,text:"</span>",order:0}),n.push({id:i,...s,nodes:null})}_=xa(_,w);const x=Ta(_,m),M=[],L=new Map;for(const e of[..._.matchAll(_a)]){const s=e[2]||"",i=La(e.index,x),o=[],a=[];for(const l of s.matchAll(ga)){const s=l[1];if(s.startsWith("data-dm-"))continue;const c=void 0!==l[2]?l[2]:l[3]||"",h=er(s);if(null!==h){if(h.handler.region)continue;if(i){const t=Ma(e.index,x)?.[2];if(t?.unkeyed){const e=L.get(t)??[];e.includes(s)||e.push(s),L.set(t,e)}else r(`shifted:${s}`,`"${s}" inside a {{#with}} block is not bound: {{#with}} re-renders its body as a whole, so there is nothing to attach it to. Write the full path instead (data-model="obj.field" rather than data-model="field" inside {{#with obj}}) and it binds normally.`);continue}const o=h.handler,l=zo(c).trim(),d=!1===o.expression?{ast:null,evaluate:null,deps:new Set}:Ua(l,o,t);if(null===d)continue;const u=v(h.kind);a.push(u),n.push({id:u,kind:h.kind,arg:h.arg,expr:l,ast:d.ast,evaluate:d.evaluate,deps:d.deps,prime:!0===o.primes,nodes:null});continue}if(i)continue;if(!c.includes("{{"))continue;const d=Ea(c);0!==d.size&&o.push({name:s,tmpl:c,deps:[...d]})}const l=e.index+e[0].length-(e[3]?2:1);if(o.length>0){const e=v("attr"),t=new Set;for(const e of o)for(const n of e.deps)t.add(n);M.push({index:l,text:` data-dm-a="${e}"`,order:1}),n.push({id:e,kind:"attr",parts:o,deps:t,nodes:null})}a.length>0&&M.push({index:l,text:` data-dm-b="${a.join(" ")}"`,order:1})}_=xa(_,M);for(const e of n){if(!0!==Qo(e.kind)?.capturesBody)continue;const t=Or(e.id),n=_.indexOf(t),s=_.indexOf(Dr(e.id));-1!==n&&-1!==s&&(e.body=_.slice(n+t.length,s))}for(const e of m)e.unkeyed&&Ra(e.expr,t,L.get(e)??[]);return{annotated:_,bindings:n,slots:s}}function Ya(e,t,n){if(!0===t.itemForms&&void 0!==ya[e])return{kind:"text",expr:e,evaluate:ya[e],deps:new Set,prime:!0};if(va.test(e)){if(e.startsWith("$")){const n=Ua(e,Qo("text"),t);return null===n?null:{kind:"text",expr:e,ast:n.ast,evaluate:n.evaluate,deps:n.deps,prime:!0}}return{kind:"text",expr:e,evaluate:t=>Aa(t.$data,e),deps:new Set([Ca(e)]),prime:!1}}if(ba.test(e)||!Ho.test(e))return null;const s=Ua(e,Qo("text"),t);return null===s?(n(`expr:${e}`,`"{{${e}}}" is not bound`),null):{kind:"text",expr:e,ast:s.ast,evaluate:s.evaluate,deps:s.deps,prime:!0}}Zo("each",Yr(qa));const Ga=new WeakMap;!function(e){Zo("component",function(e){return{tracks:!0,primes:!0,attribute:"data-component",expression:!0,update({binding:t,nodes:n,context:s,render:i}){const o=t.evaluate(s);for(const r of n){let n=aa.get(r);if(void 0===n&&(n={name:null,instance:null,viewModel:null,slots:null,placed:[]},aa.set(r,n),zr(r,()=>ca(n))),n.name===o&&null!==n.instance)continue;if(ca(n),null===n.slots&&(n.slots=sa(r)),r.replaceChildren(),"string"!=typeof o||""===o){Zr(`component:name:${t.id}`,`data-component="${t.expr}" needs a component name - got `+(null===o?"null":typeof o)+". Remember that a literal name takes quotes, because every binding value is an expression: data-component=\"'my-thing'\"");continue}const a=Qr(o);if(void 0===a){Zr(`component:missing:${t.id}:${o}`,`no component is registered as "${o}", in ${t.expr}`);continue}const l=la(a,na(r,t,s),r,t,o);if(null===l)continue;const c=e(a,o,i,t.options??{});n.name=o,n.viewModel=l,n.instance=qr(c,s,l,null,null,{context:Ui(s,l)}),n.placed=ra(n.instance,c,n.slots,t,o),n.placed.length>0&&n.instance.runtime.index(),r.append(...n.instance.allNodes())}return!0},detach({node:e}){const t=aa.get(e);void 0!==t&&ca(t)}}}(e))}(function(e,t,n,s){let i=Ga.get(e);return void 0===i&&(i=function(e,t,n,s){return Fa(e,t,n,s,`c${++Pa}:`)}(e.template,`component ${t}`,n,s),Ga.set(e,i)),i});const Ja={annotate:Ka,compile:function(e,t,n,s,i={}){const o="function"==typeof s?s:Ko,{annotated:r,bindings:a}=Ka(e,i),l=e=>{n.replaceChildren(Nr(o(r,e.$data)))},c=Pr({bindings:a,render:o,context:Ki(t),getRoots:()=>[...n.childNodes],reactive:!0===i.reactive,label:i.template,repaint:l});return l(c.context()),c.index(),c},scanBlocks:Sa,resolvePath:Aa},Xa="[Domma Reactive]",Za="data-each",Qa=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,el=/^\s*dm\s+([a-zA-Z][\w-]*)\s*:\s*([\s\S]+?)\s*$/,tl=/^\s*\/dm\s*$/,nl=/\{\{\s*[\w$][\w$.]*\s*\}\}/,sl="data-dm-bound",il=new WeakSet,ol=new Set;function rl(e,t){ol.has(e)||(ol.add(e),console.warn(`${Xa} ${t}`))}function al(e){if(!e||1!==e.nodeType)return String(e);const t=e.id?`#${e.id}`:"",n=e.classList?.length?`.${[...e.classList].join(".")}`:"";return`<${e.tagName.toLowerCase()}${t}${n}>`}function ll(e,t){if(null!=e&&1===e.nodeType&&!1!==t(e))for(const n of[...e.children])ll(n,t)}function cl(e,t,n={}){if(null==t||1!==t.nodeType)throw new TypeError(`${Xa} applyBindings: expected an element to activate, got ${String(t)}`);const s="function"==typeof n.render?n.render:Ko,i=n.template||al(t);let o=Ki(e);const r=[],a=[],l=[];let c=!1,h=0;const d={context:()=>o,update:()=>!1,bindings:[]},u=function(e,t){const n=[];let s=0;const i=e=>{const o=[];for(const t of[...e.childNodes]){if(8===t.nodeType){if(tl.test(t.data)){const e=o.pop();void 0!==e&&n.push({...e,close:t});continue}const i=t.data.match(el);null!==i&&o.push({kind:i[1],expr:i[2],open:t,parent:e,seq:s++});continue}1===t.nodeType&&i(t)}for(const e of o)t(e)};return i(e),n.sort((e,t)=>e.seq-t.seq)}(t,e=>{rl(`virtual:unclosed:${i}:${e.kind}`,`\x3c!-- dm ${e.kind}: ${e.expr} --\x3e in ${i} has no matching \x3c!-- /dm --\x3e, so the block was skipped. Every virtual binding needs a closer.`)});for(const e of u)"each"===e.kind&&v(e,u);const p=[];ll(t,e=>{if(il.has(e))return h++,!1;const t=e.getAttribute(Za),n=function(e){const t=[];for(const n of[...e.attributes]){if(n.name===sl||n.name===Za)continue;const e=er(n.name);null!==e&&t.push({name:n.name,value:n.value.trim(),kind:e.kind,arg:e.arg,handler:e.handler})}return t}(e);return null===t&&0===n.length||(p.push({el:e,each:t,claims:n}),null===t)}),h>0&&rl(`double:${i}`,`applyBindings ran again over ${i}, where ${h} element(s) were already bound. Those were skipped rather than bound twice; the handle returned owns only what this call created. Dispose the first handle before re-applying.`);for(const{el:e}of p)il.add(e),e.setAttribute(sl,""),l.push(e);!function(e,t){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let s;for(;s=n.nextNode();)if(nl.test(s.data)&&!hl(s,e))return void rl(`interp:${t}`,`${t} contains "${s.data.trim().slice(0,40)}" - applyBindings does not interpolate {{ }} in already-rendered DOM, and leaves it as it found it. Use data-bind-text="expr", which the server can render alongside the text, or compile() if the markup should come from a template.`)}(t,i);let m=0;for(const e of p){null!==e.each&&g(e.el,e.each);for(const t of e.claims)_(e.el,t)}for(const e of u)b(e);function f(e,t,n){if(!1===t.expression)return{ast:null,evaluate:null,deps:new Set};const s={template:`${i} ${n}`,methodCalls:!0===t.methodCalls},o=Mo(e,s);return null===o?null:{ast:o,evaluate:bi(Co(e,s),{expr:e,where:s.template,handler:t}),deps:!1===t.tracks?new Set:Ao(o)}}function _(e,t){const{handler:n,kind:i,arg:r,value:l,name:c}=t,h=f(l,n,c);if(null===h)return;const u={id:`apply${m++}_${i}`,kind:i,arg:r,expr:l,ast:h.ast,evaluate:h.evaluate,deps:h.deps,nodes:[e]};d.bindings.push(u),"function"==typeof n.attach&&n.attach({binding:u,node:e,controller:d}),"function"==typeof n.detach&&a.push(()=>n.detach({binding:u,node:e,controller:d})),!0!==n.region?!1!==n.tracks&&y(()=>n.update({binding:u,nodes:[e],context:o,render:s,controller:d})):"if"===i?function(e,t){const n=document.createComment(`dm:if ${t.expr}`);e.parentNode?.insertBefore(n,e),y(()=>{const s=Fo(t.evaluate(o));return s&&null===e.parentNode?n.parentNode?.insertBefore(e,n.nextSibling):s||null===e.parentNode||e.parentNode.removeChild(e),!0}),a.push(()=>{null===e.parentNode&&n.parentNode?.insertBefore(e,n.nextSibling),n.parentNode?.removeChild(n)})}(e,u):rl(`region:${i}`,`"${c}" is a region binding, which needs a compiled template body. applyBindings has none - the markup is the page. Use compile() for ${i}, or data-if / data-each, which are implemented here directly.`)}function g(e,t){const n=Qa.exec(t);if(null===n||""===n[1].trim())return void rl(`each:unkeyed:${i}`,`${Za}="${t}" on ${al(e)} needs a key: write ${Za}="${t.trim()} key=id", naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const r=n[1].trim(),l=n[2],c=f(r,{expression:!0,tracks:!0,acceptsReactive:!0},Za);if(null===c)return;const h=e.innerHTML;e.replaceChildren();const u=document.createComment("dm:each"),p=document.createComment("/dm:each");e.append(u,p);const _={id:`apply${m++}_each`,kind:"each",expr:r,keyPath:l,body:h,ast:c.ast,evaluate:c.evaluate,deps:c.deps,factoryBox:{value:null,options:{template:i}},nodes:[{open:u,close:p}]};d.bindings.push(_);const g=Qo("each");y(()=>g.update({binding:_,nodes:_.nodes,context:o,render:s,controller:d})),a.push(()=>{Kr({open:u},[],qa(_,s),l,o,i),e.replaceChildren()})}function v(e,t){const n=document.createElement("div");for(const t of Ir(e.open,e.close))n.appendChild(t);for(const s of t){if(s===e||!n.contains(s.open))continue;s.consumed=!0;const t=[s.open,...Ir(s.open,s.close),s.close];for(const e of t)e.parentNode?.removeChild(e);rl(`virtual:nested:${i}:${s.kind}`,`\x3c!-- dm ${s.kind}: ${s.expr} --\x3e is inside a virtual list's body, which is compiled as a template - virtual bindings are not read there, so its content is left out. Use {{#${s.kind}}} inside the body, or data-if on an element.`)}e.body=n.innerHTML}function b(e){!0!==e.consumed&&("if"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm if --\x3e");if(null===t)return;const n={id:`apply${m++}_if`,kind:"if",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[{open:e.open,close:e.close}]};d.bindings.push(n);let s=null;const i=()=>{null!==s&&(e.close.parentNode?.insertBefore(s,e.close),s=null)};y(()=>{if(Fo(n.evaluate(o)))i();else if(null===s){s=document.createDocumentFragment();for(const t of Ir(e.open,e.close))s.appendChild(t)}return!0}),a.push(i)}(e):"each"===e.kind?function(e){const t=e.expr.match(Qa);if(null===t||""===t[1].trim())return void rl(`virtual:each:unkeyed:${i}`,`\x3c!-- dm each: ${e.expr} --\x3e needs a key: write \x3c!-- dm each: ${e.expr.trim()} key=id --\x3e, naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const n=t[1].trim(),r=t[2],l=f(n,{expression:!0,tracks:!0,acceptsReactive:!0},"\x3c!-- dm each --\x3e");if(null===l)return;const c={id:`apply${m++}_each`,kind:"each",expr:n,keyPath:r,body:e.body,ast:l.ast,evaluate:l.evaluate,deps:l.deps,factoryBox:{value:null,options:{template:i}},nodes:[{open:e.open,close:e.close}]};d.bindings.push(c);const h=Qo("each");y(()=>h.update({binding:c,nodes:c.nodes,context:o,render:s,controller:d})),a.push(()=>{Kr({open:e.open,close:e.close},[],qa(c,s),r,o,i)})}(e):"text"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm text --\x3e");if(null===t)return;for(const t of Ir(e.open,e.close))t.parentNode?.removeChild(t);const n=document.createTextNode("");e.close.parentNode?.insertBefore(n,e.close);const s={id:`apply${m++}_text`,kind:"text",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[n]};d.bindings.push(s),y(()=>{const e=s.evaluate(o);return n.data=null==e?"":String(e),!0}),a.push(()=>n.parentNode?.removeChild(n))}(e):rl(`virtual:kind:${e.kind}`,`\x3c!-- dm ${e.kind}: … --\x3e is not a virtual binding. Supported: if, each, text. Anything else needs an element to bind to.`))}function y(e){r.push($i(e,{label:`${i}:${r.length}`}))}return{get bindings(){return d.bindings.length},context:()=>o,update(e){if(!c){void 0!==e&&(o=Ki(e));for(const e of r)e.recompute()}},dispose(){if(!c){c=!0;for(const e of r)e.dispose();r.length=0;for(const e of a)try{e()}catch(e){console.warn(`${Xa} applyBindings teardown threw:`,e)}a.length=0;for(const e of l)il.delete(e),e.removeAttribute(sl);l.length=0}}}}function hl(e,t){for(let n=e.parentNode;n;n=n.parentNode){if(1===n.nodeType&&n.hasAttribute(Za))return!0;if(n===t)return!1}return!1}const dl=(e,t)=>y.isEqual(e,t);class ul{constructor(e,t={},n={}){this._schema=e,this._initialData={},this._bindings=new Map,this._changeCallbacks=new Set,this._fieldCallbacks=new Map,this._fields=new Map,this._trackedView=null,this._persistKey=n.persist||null,this._autoSave=!1!==n.autoSave;for(const n in e){const s=e[n],i=void 0!==s.default?s.default:null,o=void 0!==t[n]?t[n]:i;this._fields.set(n,Wi(o,{equals:dl})),this._initialData[n]=o}this._persistKey&&this._loadFromStorage()}get(e){if(e){const t=this._fields.get(e);return t?t.value:void 0}const t={};for(const[e,n]of this._fields)t[e]=n.value;return t}_field(e){let t=this._fields.get(e);return t||(t=Wi(null,{equals:dl}),this._fields.set(e,t)),t}_snapshot(){const e={};for(const[t,n]of this._fields)e[t]=n.peek();return e}tracked(){if(!this._trackedView){const e=this;this._trackedView=new Proxy({},{get(t,n){if("string"!=typeof n)return;const s=e._fields.get(n);return s?s.value:void 0},set:(t,n,s)=>("string"==typeof n&&e._setField(n,s),!0),has(t,n){if("string"!=typeof n)return!1;const s=e._fields.get(n);return!!s&&(s.value,!0)},ownKeys:()=>[...e._fields.keys()],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}return this._trackedView}set(e,t){if("object"==typeof e)for(const t in e)this._setField(t,e[t]);else this._setField(e,t);return this}_setField(e,t){const n=this._field(e),s=n.peek();if(this._schema[e]){const n=this._validateField(e,t);if(!n.valid)throw new Error(`Validation failed for ${e}: ${n.error}`)}const i=!dl(s,t);n.value=t,i&&(this._notifyChange(e,t,s),this._updateBindings(e,t),this._persistKey&&this._autoSave&&this._saveToStorage())}_validateField(e,t){const n=this._schema[e],s=null==t||""===t;if(n.required&&s)return{valid:!1,error:"Required field is empty"};if(!s&&n.type){const e=fl.types[n.type];if(e&&!e(t))return{valid:!1,error:`Expected type ${n.type}`}}if(void 0!==n.min&&"number"==typeof t&&t<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&"number"==typeof t&&t>n.max)return{valid:!1,error:`Value must be at most ${n.max}`};if(void 0!==n.minLength&&"string"==typeof t&&t.length<n.minLength)return{valid:!1,error:`Length must be at least ${n.minLength}`};if(void 0!==n.maxLength&&"string"==typeof t&&t.length>n.maxLength)return{valid:!1,error:`Length must be at most ${n.maxLength}`};if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:"Value does not match pattern"};if(n.validate&&"function"==typeof n.validate){const e=n.validate(t);if(!1===e)return{valid:!1,error:"Custom validation failed"};if("string"==typeof e)return{valid:!1,error:e}}return{valid:!0}}validate(){const e=[],t=this._snapshot();for(const n in this._schema){const s=this._validateField(n,t[n]);s.valid||e.push({field:n,error:s.error})}return{valid:0===e.length,errors:e}}toJSON(){return zi(()=>this._snapshot())}onChange(e,t){if("string"==typeof e){if("function"!=typeof t)throw new TypeError(`Model.onChange('${e}', callback) requires a callback function`);const n=e,s=e=>{e.field===n&&t(e)};return this._changeCallbacks.add(s),()=>this._changeCallbacks.delete(s)}if("function"!=typeof e)throw new TypeError("Model.onChange expects a callback, or (field, callback)");return this._changeCallbacks.add(e),()=>this._changeCallbacks.delete(e)}onFieldChange(e,t){return this._fieldCallbacks.has(e)||this._fieldCallbacks.set(e,new Set),this._fieldCallbacks.get(e).add(t),()=>this._fieldCallbacks.get(e)?.delete(t)}_notifyChange(e,t,n){for(const s of this._changeCallbacks)s({field:e,newValue:t,oldValue:n,model:this});if(this._fieldCallbacks.has(e))for(const s of this._fieldCallbacks.get(e))s(t,n,this)}_updateBindings(e,t){if(this._bindings.has(e))for(const n of this._bindings.get(e))n.update(t)}_addBinding(e,t){this._bindings.has(e)||this._bindings.set(e,new Set),this._bindings.get(e).add(t)}_removeBinding(e,t){this._bindings.has(e)&&this._bindings.get(e).delete(t)}reset(e=!1){for(const e in this._initialData)this.set(e,y.cloneDeep(this._initialData[e]));return e&&this._persistKey&&this.clearStorage(),this}destroy(e=!1){e&&this._persistKey&&this.clearStorage(),this._changeCallbacks.clear(),this._fieldCallbacks.clear(),this._bindings.clear(),this._fields.clear(),this._trackedView=null}save(){return this._saveToStorage()}load(){return this._loadFromStorage()}clearStorage(){return!!this._persistKey&&me.remove(`model:${this._persistKey}`)}getPersistKey(){return this._persistKey}isPersisted(){return null!==this._persistKey}_saveToStorage(){if(!this._persistKey)return!1;try{return me.set(`model:${this._persistKey}`,this._snapshot())}catch(e){return console.warn("Domma Model: Failed to save to storage",e),!1}}_loadFromStorage(){if(!this._persistKey)return!1;try{const e=me.get(`model:${this._persistKey}`);if(e&&"object"==typeof e){for(const t in e)void 0!==this._schema[t]&&(this._field(t).value=e[t]);return!0}return!1}catch(e){return console.warn("Domma Model: Failed to load from storage",e),!1}}}class pl{constructor(e,t,n,s={}){this.model=e,this.field=t,this.element=n,this.options=s,this.format=s.format||(e=>e),this.parse=s.parse||(e=>e),this.twoWay=s.twoWay||!1,this._eventHandler=null,this.update(e.get(t)),this.twoWay&&this._setupTwoWay()}update(e){const t=this.format(e),n=this.element;"INPUT"===n.tagName||"TEXTAREA"===n.tagName?"checkbox"===n.type?n.checked=Boolean(t):"radio"===n.type?n.checked=n.value===String(t):n.value=null!=t?t:"":"SELECT"===n.tagName?n.value=t:n.textContent=null!=t?t:""}_setupTwoWay(){const e=this.element,t=this._getEventType();this._eventHandler=t=>{let n;n="checkbox"===e.type?e.checked:"number"===e.type||"range"===e.type?""===e.value?null:Number(e.value):e.value;try{this.model.set(this.field,this.parse(n))}catch(e){console.warn("Binding validation error:",e.message)}},e.addEventListener(t,this._eventHandler)}_getEventType(){const e=this.element;return"SELECT"===e.tagName||"checkbox"===e.type||"radio"===e.type?"change":"input"}destroy(){if(this._eventHandler){const e=this._getEventType();this.element.removeEventListener(e,this._eventHandler)}this.model._removeBinding(this.field,this)}}const ml=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;const fl={_events:new Map,subscribe(e,t){return this._events.has(e)||this._events.set(e,new Set),this._events.get(e).add(t),()=>this.unsubscribe(e,t)},on(e,t){return this.subscribe(e,t)},unsubscribe(e,t){this._events.has(e)&&this._events.get(e).delete(t)},off(e,t){this.unsubscribe(e,t)},publish(e,t){if(this._events.has(e))for(const n of this._events.get(e))n(t)},emit(e,t){this.publish(e,t)},once(e,t){const n=s=>{this.unsubscribe(e,n),t(s)};return this.subscribe(e,n)},clear(e){e?this._events.delete(e):this._events.clear()},create:(e,t={},n={})=>new ul(e,t,n),extend(...e){const t={};for(const n of e)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]&&y.isPlainObject(t[e])?t[e]=y.merge(y.cloneDeep(t[e]),y.cloneDeep(n[e])):t[e]=y.cloneDeep(n[e]));return t},pick(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=y.cloneDeep(e[s]));return n},omit(e,t){const n=y.cloneDeep(e);for(const e of t)delete n[e];return n},observable:Wi,observableArray:function(e=[],t={}){const n=new Li,s=Ii();let i=Array.isArray(e)?e.slice():[];const o=Hi(t,e=>{n.trigger(),s.notify(e)}),r=()=>o.announce(i),a=e=>{const t=Array.isArray(e)?e.slice():[],n=o.changed(i,t);i=t,n&&r()},l={get value(){return n.track(),i},set value(e){a(e)},get length(){return n.track(),i.length},peek:()=>i,set:e=>a(e),remove:e=>{const t="function"==typeof e?e:t=>t===e;for(let e=i.length-1;e>=0;e--)t(i[e],e)&&i.splice(e,1);return r(),l},removeAll:()=>(i.length=0,r(),l),indexOf:e=>(n.track(),i.indexOf(e)),replace:(e,t)=>{const n=i.indexOf(e);return-1!==n&&(i[n]=t),r(),l},destroy:e=>{const t="function"==typeof e?e:t=>t===e;let n=0,s=0;for(let e=0;e<i.length;e++)t(i[e],e)&&(null!==i[e]&&"object"==typeof i[e]?(i[e]._destroy=!0,n++):s++);return s>0&&console.warn(`${Ni} destroy: ${s} matching item(s) are not objects and cannot carry a _destroy mark. Use remove() for an array of primitives.`),(n>0||0===s)&&r(),l},destroyAll:()=>l.destroy(()=>!0),subscribe:e=>s.add(e),extend:e=>(o.extend(e),l)};o.attach(l);for(const e of Pi)l[e]=(...t)=>{const n=Array.prototype[e].apply(i,t);return r(),n};return gi(l)},computed(e,t={}){const n=Si(e,{label:t.label,onNotify:t.onChange||null});return{get value(){return n.get()},set value(e){n.write(e)},get:()=>n.get(),set:e=>n.write(e),peek:()=>zi(()=>n.get()),dispose:()=>n.dispose(),_computation:n}},effect(e,t={}){const n=$i(e,{label:t.label});return()=>n.dispose()},untracked:e=>zi(e),flush(){xi=!1,Ei()},types:{string:e=>"string"==typeof e,number:e=>"number"==typeof e&&!Number.isNaN(e),boolean:e=>"boolean"==typeof e,array:e=>Array.isArray(e),object:e=>null!==e&&"object"==typeof e&&!Array.isArray(e),date:function(e){if(e instanceof Date)return!Number.isNaN(e.getTime());if("string"!=typeof e||!ml.test(e))return!1;const t=Date.parse(e);if(Number.isNaN(t))return!1;if(10===e.length){const n=new Date(t),[s,i,o]=e.split("-").map(Number);return n.getUTCFullYear()===s&&n.getUTCMonth()+1===i&&n.getUTCDate()===o}return!0},any:()=>!0},bind(e,t,n,s={}){const i="string"==typeof n?document.querySelectorAll(n):[n],o=[];for(const n of i){const i=new pl(e,t,n,s);e._addBinding(t,i),o.push(i)}return()=>{for(const e of o)e.destroy()}},applyBindings(e,t,n={}){const s=function(e){if("string"==typeof e)return document.querySelector(e);if(e&&1===e.nodeType)return e;if(e&&"object"==typeof e){const t=e[0]||(Array.isArray(e.elements)?e.elements[0]:null);if(t&&1===t.nodeType)return t}return null}(t);if(!s)throw new TypeError(`M.applyBindings: no element found for ${"string"==typeof t?`selector "${t}"`:String(t)}`);const{methods:i,...o}=n;return cl(function(e,t){return ui(e instanceof ul?e.tracked():e,{fallback:t})}(e,i),s,{render:(e,t)=>y.render(e,t),...o})},registerBinding:(e,t)=>Zo(e,t),unregisterBinding:e=>function(e){return Go.delete(e)}(e),registerExtender:(e,t)=>Oi(e,t),unregisterExtender:e=>function(e){return!ji.has(e)&&Bi.delete(e)}(e),registerHelper:(e,t)=>Eo(e,t),unregisterHelper:e=>function(e){return Qi.delete(e)}(e),_stores:new Map,store(e,t={}){if(!this._stores.has(e)){const n={state:{...t},listeners:new Set,getState(){return{...this.state}},setState(e){const t={...this.state};this.state={...this.state,...e};for(const e of this.listeners)e(this.state,t)},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},reset(e){this.state=e?{...e}:{...t};for(const e of this.listeners)e(this.state,{})}};this._stores.set(e,n)}return this._stores.get(e)},getStore(e){return this._stores.get(e)},removeStore(e){this._stores.delete(e)}};class _l{static defaults={layout:"stacked",columns:2,labelPosition:"top",showLabels:!0,showHelperText:!0,showHints:!0,validationMode:"blur",cssFramework:"domma",className:"domma-form",fieldClassName:"domma-form-field",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint",cardWrapper:!1};static inputTypes={string:"text",email:"email",password:"password",number:"number",integer:"number",float:"number",boolean:"checkbox",date:"date",datetime:"datetime-local",time:"time",url:"url",tel:"tel",color:"color",range:"range",file:"file",hidden:"hidden",signature:"signature"};constructor(e,t={},n={}){this.schema=e,this.data={...t},this._startData={...t},this.options={..._l.defaults,...n},this.model=null,this.errors={},this.touched=new Set,this.utils=window.Domma?.utils||y,this.models=window.Domma?.models||fl,e&&"object"==typeof e&&(this.model=this.models.create(e,t,{persist:n.persist,autoSave:n.autoSave}))}render(){if(!this.schema)throw new Error("Schema is required to render form");return this._buildForm()}renderTo(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`Form container not found: ${e}`);return t.innerHTML=this.render(),this.formElement=t.querySelector("form"),this._bindEvents(t),this._initTooltips(t),t}_buildForm(){const{className:e,layout:t,columns:n,cardWrapper:s}=this.options;let i=e;if("grid"===t){i+=` grid ${3===n?"grid-cols-3":"grid-cols-2"} gap-4`}else"inline"===t&&(i+=" domma-form-inline");let o="";if(s&&(o+='<div class="card"><div class="card-body">'),o+=`<form class="${i}" novalidate>`,this.options.sections&&Array.isArray(this.options.sections))for(const e of this.options.sections)o+=this._buildSection(e);else for(const e in this.schema)o+=this._buildField(e,this.schema[e]);if(!1!==this.options.showSubmitButton){const e=this.options.submitText||"Submit",t=this.options.resetText,n=this.options.buttonAlignment||"right";o+=`<div class="form-group form-buttons mt-4 ${"left"===n?"text-left":"center"===n?"text-center":"text-right"}">`,t&&(o+=`<button type="button" class="btn btn-secondary mr-2" data-action="reset">${this.utils.escapeHtml(t)}</button>`),o+=`<button type="submit" class="btn btn-primary">${this.utils.escapeHtml(e)}</button>`,o+="</div>"}return o+="</form>",s&&(o+="</div></div>"),o}_buildSection(e){let t="";e.title&&(t+='<fieldset class="domma-form-section">',t+=`<legend class="domma-form-section-title">${this.utils.escapeHtml(e.title)}</legend>`);t+=`<div class="${"grid"===e.layout?`grid grid-cols-${e.columns||2}`:"domma-form-section-content"}">`;for(const n of e.fields||[])this.schema[n]&&(t+=this._buildField(n,this.schema[n]));return t+="</div>",e.title&&(t+="</fieldset>"),t}_buildField(e,t){const{fieldClassName:n,showLabels:s,showHelperText:i,showHints:o,labelPosition:r}=this.options,a=t.formConfig||{},l=t.type||"string",c=t.label||this.utils.capitalize(e),h=this.data[e]||t.default||"",d=t.required||!1,u=a.disabled||t.readonly||!1,p=a.placeholder||"",m=a.hint||"",f=a.helperText||"",_=a.tooltip||"",g=a.span||1;let v="";if("grid"===this.options.layout&&g>1){const e=this.options.columns||2;2===g?v=" col-span-2":3===g&&3===e?v=" col-span-3":g>=e&&(v=3===e?" col-span-3":" col-span-2")}let b=`<div class="${n}${v}" data-field="${e}">`;if(s&&c&&"hidden"!==l&&"boolean"!==l&&"checkbox"!==l){const t=this.options.labelClassName,n=d?' <span class="text-danger">*</span>':"",s=_?` data-tooltip="${this.utils.escapeHtml(_)}"`:"",i=_?" has-tooltip":"";b+=`<label for="field-${this.utils.escapeHtml(e)}" class="${t}${i}"${s}>`,b+=`${this.utils.escapeHtml(c)}${n}`,_&&(b+=' <span class="tooltip-icon" data-icon="help-circle" style="display: inline-block; vertical-align: middle; opacity: 0.6; cursor: help;"></span>'),o&&m&&(b+=` <small class="${this.options.hintClassName}">${this.utils.escapeHtml(m)}</small>`),b+="</label>"}return b+=this._buildInput(e,t,{type:l,value:h,required:d,disabled:u,placeholder:p}),i&&f&&(b+=`<small class="${this.options.helperClassName}">${f}</small>`),b+=`<div class="${this.options.errorClassName}" data-error-for="${e}" style="display: none;"></div>`,b+="</div>",b}_buildInput(e,t,n){const{type:s,value:i,required:o,disabled:r,placeholder:a}=n,l=t.formConfig||{},c=`field-${e}`,h={id:c,name:e,class:this.options.inputClassName,...o&&{required:!0},...r&&{disabled:!0},...a&&{placeholder:a},...void 0!==t.min&&{min:t.min},...void 0!==t.max&&{max:t.max},...void 0!==(t.step??l.step)&&{step:t.step??l.step},...t.pattern&&{pattern:t.pattern},...l.autocomplete&&{autocomplete:l.autocomplete}},d=this._inputExtras(s,t);d&&(h["data-input-extras"]=this.utils.escapeHtml(JSON.stringify(d)));const u=Object.entries(h).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ");if("slider"===s||"range"===s&&l.slider){return`<input type="range" ${u} value="${Array.isArray(i)?"":this.utils.escapeHtml(i)}" data-slider-field="${this.utils.escapeHtml(e)}">`}if("dropzone"===s){const t=l.accept?` accept="${this.utils.escapeHtml([].concat(l.accept).join(","))}"`:"",n=!1===l.multiple?"":" multiple";return`<div class="domma-dropzone-field" data-dropzone-field="${this.utils.escapeHtml(e)}"><input type="file" id="${c}" name="${this.utils.escapeHtml(e)}"${t}${n}${r?" disabled":""}></div>`}switch(s){case"select":return this._wrapAddons(this._buildSelect(e,t,h,i),l);case"multiselect":return h.multiple=!0,this._buildSelect(e,t,h,i);case"textarea":const n=l.rows||3;return this._wrapAddons(`<textarea ${u} rows="${n}">${this.utils.escapeHtml(i)}</textarea>`,l);case"radio":return this._buildRadioGroup(e,t,h,i);case"checkbox-group":return this._buildCheckboxGroup(e,t,h,i);case"chooser":return this._buildChooser(e,t,h,i);case"checkbox":case"boolean":const o=i?"checked":"",r=t.label||this.utils.capitalize(e),a=t.required?' <span class="text-danger">*</span>':"",d=l.hint?` <small class="form-text text-muted">${l.hint}</small>`:"";return`<div class="form-check">\n <input type="checkbox" class="form-check-input" ${u} ${o}>\n <label class="form-check-label" for="${h.id}">${r}${a}</label>\n ${d}\n </div>`;case"file":return`<input type="file" ${u} accept="${l.accept||""}" ${l.multiple?"multiple":""}>`;case"signature":return`<div class="domma-signature-field" id="${c}" data-signature-field="${e}"></div>`;default:const p=`<input type="${_l.inputTypes[s]||"text"}" ${u} value="${this.utils.escapeHtml(i)}">`;return this._wrapAddons(p,l)}}_inputExtras(e,t){const n=t.formConfig||{};if(/^(select|multiselect|radio|checkbox-group|chooser|checkbox|boolean|file|signature|hidden|slider|range|dropzone)$/.test(e))return null;const s="textarea"===e?"textarea":_l.inputTypes[e]||"text",i={};if(n.reveal&&"password"===s&&(i.reveal=!0),n.clear&&/^(text|email|url|tel|password|number|date|datetime-local|time|textarea)$/.test(s)&&(i.clear=!0),n.stepper&&"number"===s&&(i.stepper=!0),n.counter&&/^(text|email|url|tel|password|textarea)$/.test(s)){const e="number"==typeof n.counter?n.counter:t.maxLength;i.counter=!("number"==typeof e&&e>0)||e}n.labels&&"object"==typeof n.labels&&(i.labels=n.labels);return Object.keys(i).filter(e=>"labels"!==e).length?i:null}_wrapAddons(e,t={}){const n=this._buildAddon(t.prefix,"left"),s=this._buildAddon(t.suffix,"right");if(!n&&!s)return e;return`<div class="${["input-group-icon",n&&"has-addon-left",s&&"has-addon-right"].filter(Boolean).join(" ")}">${n}${e}${s}</div>`}_buildAddon(e,t){if("string"==typeof e&&e&&(e={text:e}),!e||"object"!=typeof e)return"";const n=`input-group-addon input-group-addon-${t}`;let s="";return e.icon&&/^[a-z0-9-]+$/i.test(e.icon)?s=`<span data-icon="${e.icon}"></span>`:void 0!==e.text&&null!==e.text?s=this.utils.escapeHtml(String(e.text)):"string"==typeof e.html&&(s=e.html),s?`<span class="${n}">${s}</span>`:""}_buildSelect(e,t,n,s){let i=`<select ${Object.entries(n).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ")}>`;t.required?n.multiple||null!=s&&""!==s||(i+='<option value="" disabled selected>-- Select --</option>'):i+='<option value="">-- Select --</option>';const o=t.options||[],r=Array.isArray(s)?s:[s];for(const e of o)if("string"==typeof e){i+=`<option value="${e}" ${r.includes(e)?"selected":""}>${this.utils.capitalize(e)}</option>`}else if("object"==typeof e){const t=r.includes(e.value)?"selected":"";i+=`<option value="${e.value}" ${t}>${e.label}</option>`}return i+="</select>",i}_buildRadioGroup(e,t,n,s){const i=t.options||[];let o='<div class="domma-radio-group" role="radiogroup">';for(const t of i){const i="string"==typeof t?t:t.value,r="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${i}`;o+=`\n <label class="domma-radio-option" for="${a}">\n <input type="radio" class="form-check-input" id="${a}" name="${e}" value="${i}" ${i===s?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${r}</span>\n </label>\n `}return o+="</div>",o}_buildCheckboxGroup(e,t,n,s){const i=t.options||[],o=Array.isArray(s)?s:[];let r='<div class="domma-checkbox-group">';for(const t of i){const s="string"==typeof t?t:t.value,i="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${s}`;r+=`\n <label class="domma-checkbox-option" for="${a}">\n <input type="checkbox" class="form-check-input" id="${a}" name="${e}[]" value="${s}" ${o.includes(s)?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${i}</span>\n </label>\n `}return r+="</div>",r}_buildChooser(e,t,n,s){const i={variant:t.variant||"card",multiple:!!t.multiple,density:t.density||"comfortable",columns:t.columns||3,accent:t.accent||"primary",accentStyle:t.accentStyle||"border",glow:!!t.glow,glowColour:t.glowColour||null,shadow:t.shadow||"none",shadowColour:t.shadowColour||null,options:t.options||[],value:void 0!==s?s:t.multiple?[]:null,name:e,required:!!t.required},o=JSON.stringify(i).replace(/"/g,""");return`<div class="domma-chooser-field" id="${n.id}" data-chooser-field="${e}" data-chooser-config="${o}"></div>`}_bindEvents(e){e.addEventListener("submit",e=>{e.preventDefault(),this.handleSubmit()}),e.addEventListener("blur",e=>{e.target.matches("input, select, textarea")&&(this.validateField(e.target.name),this.touched.add(e.target.name))},!0),e.addEventListener("change",e=>{if(e.target.matches("input, select, textarea")){const t=e.target.name;if(this._sliders?.[t]||this._dropzones?.[t])return;if(this.model){const t=this._getFieldValue(e.target);try{this.model.set(e.target.name,t)}catch(t){this.setFieldError(e.target.name,t.message)}}}}),e.addEventListener("click",e=>{e.target.matches('[data-action="reset"]')&&(e.preventDefault(),this.reset())}),this._initSignatureFields(e),this._initChooserFields(e),this._initInputExtras(e),this._initSliderFields(e),this._initDropzoneFields(e)}_initialValue(e){const t=this.model?this.model.get(e):this.data[e];return null!=t&&""!==t?t:this.schema?.[e]?.default}_storeFieldValue(e,t){if(this.model)try{this.model.set(e,t)}catch(t){this.setFieldError(e,t.message)}else this.data[e]=t}_initSliderFields(e){this._destroyFieldControls("_sliders"),e.querySelectorAll("[data-slider-field]").forEach(e=>{const t=e.getAttribute("data-slider-field"),n=this.schema?.[t]||{},s=n.formConfig||{},i=["range","ticks","tickLabels","labels","format","tooltip","marks","minDistance","orientation","rtl","names","ariaLabels","className"],o={};for(const e of i)void 0!==s[e]&&(o[e]=s[e]);void 0!==n.min&&(o.min=n.min),void 0!==n.max&&(o.max=n.max);const r=n.step??s.step;void 0!==r&&(o.step=r);const a=this._initialValue(t);null!=a&&""!==a&&(o.value=a),n.label&&(o.ariaLabel=n.label),o.onChange=e=>this._storeFieldValue(t,e);const l=di.rangeSlider(e,o);l&&(this._sliders[t]=l,void 0!==a&&JSON.stringify(a)===JSON.stringify(l.getValue())||this._storeFieldValue(t,l.getValue()))})}_initDropzoneFields(e){this._destroyFieldControls("_dropzones"),e.querySelectorAll("[data-dropzone-field]").forEach(e=>{const t=e.getAttribute("data-dropzone-field"),n=this.schema?.[t]||{},s=n.formConfig||{},i=["accept","multiple","maxFiles","maxSize","minSize","previews","upload","autoUpload","retry","labels","list","className"],o={name:t};for(const e of i)void 0!==s[e]&&(o[e]=s[e]);(s.disabled||n.readonly)&&(o.disabled=!0),o.onChange=e=>{this._storeFieldValue(t,e),e.length&&this.clearFieldError(t)};const r=di.dropzone(e,o);r&&(this._dropzones[t]=r)})}_destroyFieldControls(e){Object.values(this[e]||{}).forEach(e=>e.destroy()),this[e]={}}_initInputExtras(e){this._destroyInputExtras(),e.querySelectorAll("[data-input-extras]").forEach(e=>{let t;try{t=JSON.parse(e.getAttribute("data-input-extras"))}catch(e){return}const n=new ze(e,t);n.input&&(this._inputGroups[e.name||e.id]=n)})}_destroyInputExtras(){Object.values(this._inputGroups||{}).forEach(e=>e.destroy()),this._inputGroups={}}reset(){this.formElement&&"function"==typeof this.formElement.reset&&this.formElement.reset(),this.model?this.model.reset():this.data={...this._startData};for(const[e,t]of Object.entries(this._sliders||{})){const n=this._initialValue(e);null!=n&&""!==n&&t.setValue(n,{silent:!0})}Object.values(this._dropzones||{}).forEach(e=>e.clear());for(const[e,t]of Object.entries(this._choosers||{}))"function"==typeof t.setValue&&t.setValue(this._initialValue(e));return Object.keys(this.errors).forEach(e=>this.clearFieldError(e)),this.touched.clear(),this}destroy(){this._destroyInputExtras(),this._destroyFieldControls("_sliders"),this._destroyFieldControls("_dropzones")}_initChooserFields(e){this._choosers||(this._choosers={});const t=e.querySelectorAll("[data-chooser-field]");if(!t.length)return;const n="function"==typeof di?.chooser?di.chooser.bind(di):window.Domma?.elements?.chooser?.bind(window.Domma.elements);n&&t.forEach(e=>{const t=JSON.parse((e.getAttribute("data-chooser-config")||"{}").replace(/"/g,'"')),s=e.getAttribute("data-chooser-field"),i=n(e,{...t,onChange:e=>{if(this.model)try{this.model.set(s,e)}catch(e){this.setFieldError(s,e.message)}else this.data[s]=e}});i&&(this._choosers[s]=i)})}_initSignatureFields(e){const t=e.querySelectorAll("[data-signature-field]");t.length&&window.Domma&&"function"==typeof window.Domma.elements?.signature&&t.forEach(e=>{const t=e.dataset.signatureField;window.Domma.elements.signature(e,{name:t,onChange:e=>{this.model&&this.model.set({[t]:e})}})})}_initTooltips(e){if(window.Domma&&window.Domma.icons&&"function"==typeof window.Domma.icons.scan&&window.Domma.icons.scan(e),window.Domma&&window.Domma.elements&&"function"==typeof window.Domma.elements.tooltip){e.querySelectorAll("label[data-tooltip]").forEach(e=>{window.Domma.elements.tooltip(e,{position:"top",trigger:"hover",delay:{show:200,hide:0}})})}}getData(){return this.model?this.model.get():this.data}setData(e){this.data={...this.data,...e},this.model&&this.model.set(e)}validate(){this.errors={};let e=!0;for(const t in this.schema){this.validateField(t)||(e=!1)}return e}validateField(e){const t=this.schema[e];if(!t)return!0;const n=this._getFieldValueByName(e);try{const s=this._validateFieldValue(e,n,t);if(!s.valid)return this.setFieldError(e,s.error),!1;if(this.model&&this.model._validateField){const t=this.model._validateField(e,n);if(!t.valid)return this.setFieldError(e,t.error),!1}return this.clearFieldError(e),!0}catch(t){return this.setFieldError(e,t.message),!1}}setFieldError(e,t){this.errors[e]=t;const n=document.querySelector(`[data-error-for="${e}"]`);n&&(n.textContent=t,n.style.display="block",n.parentElement.classList.add("has-error"))}clearFieldError(e){delete this.errors[e];const t=document.querySelector(`[data-error-for="${e}"]`);t&&(t.textContent="",t.style.display="none",t.parentElement.classList.remove("has-error"))}handleSubmit(){const e=this.validate(),t=this.getData();return e&&this.options.onSubmit?this.options.onSubmit(t,this):!e&&this.options.onValidationError&&this.options.onValidationError(this.errors,this),{isValid:e,data:t,errors:this.errors}}_getFieldValue(e){const{type:t,name:n}=e;if("checkbox"===t){if(n.endsWith("[]")){const e=document.querySelectorAll(`input[name="${n}"]:checked`);return Array.from(e).map(e=>e.value)}return e.checked}if("radio"===t){const e=document.querySelector(`input[name="${n}"]:checked`);return e?e.value:null}return"number"===t||"range"===t?""===e.value?null:Number(e.value):e.value}_getFieldValueByName(e){if(this._choosers&&this._choosers[e])return this._choosers[e].getValue();if(this._sliders&&this._sliders[e])return this._sliders[e].getValue();if(this._dropzones&&this._dropzones[e])return this._dropzones[e].getFiles();if(this.formElement){const t=this.formElement.querySelector(`[name="${e}"]`);if(t)return this._getFieldValue(t)}return this.model?this.model.get(e):this.data[e]}_validateFieldValue(e,t,n){const s="chooser"===n.type||"dropzone"===n.type?null==t||Array.isArray(t)&&0===t.length||""===t:null==t||""===t;if(n.required&&s)return{valid:!1,error:`${n.label||e} is required`};if(s)return{valid:!0};if("email"===n.type&&t){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return{valid:!1,error:"Please enter a valid email address"}}if("number"===n.type&&null!==t){const e=Number(t);if(isNaN(e))return{valid:!1,error:"Please enter a valid number"};if(void 0!==n.min&&e<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&e>n.max)return{valid:!1,error:`Value must be no more than ${n.max}`}}if("string"==typeof t){if(n.minLength&&t.length<n.minLength)return{valid:!1,error:`Must be at least ${n.minLength} characters`};if(n.maxLength&&t.length>n.maxLength)return{valid:!1,error:`Must be no more than ${n.maxLength} characters`}}if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:n.formConfig?.hint||"Invalid format"};if(n.validate&&"function"==typeof n.validate)try{const e=this.formElement?function(e){const t=new FormData(e),n={};for(const[e,s]of t.entries())n[e]?Array.isArray(n[e])?n[e].push(s):n[e]=[n[e],s]:n[e]=s;return e.querySelectorAll("input").forEach(e=>{"checkbox"!==e.type||e.checked?"checkbox"===e.type&&e.checked&&(n[e.name]="on"===e.value||e.value):n.hasOwnProperty(e.name)||(n[e.name]=!1)}),n}(this.formElement):this.data,s=n.validate(t,e);if(!0!==s)return{valid:!1,error:s||"Validation failed"}}catch(e){return{valid:!1,error:e.message||"Validation error"}}return{valid:!0}}}const gl={create:(e,t={},n={})=>new _l(e,t,n),render:(e,t,n={},s={})=>new _l(t,n,s).renderTo(e),wizard(e,t={}){if(!t.schema)throw new Error("Wizard options must include a schema with steps array");const{schema:{steps:n=[]},data:s={},...i}=t,o=`wizard-${Date.now()}`;let r=0,a={...s},l=null;const c="string"==typeof e?document.querySelector(e):e;if(!c)throw new Error(`Wizard target element not found: ${e}`);if(!Array.isArray(n)||0===n.length)throw new Error("Wizard schema must contain a non-empty steps array");n.forEach((e,t)=>{if(e.title||(e.title=`Step ${t+1}`),!e.fields)throw new Error(`Step ${t} is missing fields array`)});let h=null;function d(){h&&h.destroy(),h=null}function u(e){const t=e?function(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const{name:n,type:s,value:i,checked:o}=e;if(n)if("checkbox"===s)if(n.endsWith("[]")){const e=n.slice(0,-2);t[e]||(t[e]=[]),o&&t[e].push(i)}else t[n]=o;else"radio"===s?o&&(t[n]=i):"number"===s||"range"===s?t[n]=""===i?null:Number(i):"SELECT"===e.tagName&&e.hasAttribute("multiple")?t[n]=Array.from(e.selectedOptions).map(e=>e.value).filter(e=>e):t[n]=i}),t}(e):{};if(h)for(const e of["_sliders","_dropzones","_choosers"])for(const n of Object.keys(h[e]||{}))t[n]=h._getFieldValueByName(n);return t}function p(){const e=l?.querySelector("form");e&&Object.assign(a,u(e))}function m(e){return!h||(h.formElement=e,h.setData(a),h.validate())}function f(){if(d(),c.innerHTML=function(e){const t=n[e],s=new _l(t.fields,a,{...i,layout:t.layout||i.layout||"stacked",showSubmitButton:!1}),r=0===e,l=e===n.length-1;return`\n <div id="${o}" class="wizard">\n <div class="wizard-step active card" data-step="${e}">\n <div class="card-header wizard-header">\n <div class="wizard-progress mb-3">\n <div class="wizard-progress-bar" style="width: ${(e+1)/n.length*100}%"></div>\n </div>\n <div class="wizard-step-info">\n <h5 class="wizard-step-title card-title mb-2">${t.title}</h5>\n ${t.description?`<p class="wizard-step-description card-subtitle text-muted mb-2">${t.description}</p>`:""}\n <small class="text-muted">Step ${e+1} of ${n.length}</small>\n </div>\n </div>\n <div class="card-body wizard-content">\n ${s.render()}\n </div>\n <div class="card-footer wizard-nav d-flex justify-content-between">\n <button type="button" class="btn btn-secondary wizard-prev" ${r?'style="visibility: hidden;"':""}>\n ${i.prevText||"Previous"}\n </button>\n <button type="button" class="btn btn-primary wizard-${l?"submit":"next"}">\n ${l?i.finishText||"Finish":i.nextText||"Next"}\n </button>\n </div>\n </div>\n </div>\n `}(r),l=c.querySelector(`#${o}`),!l)return;const e=l.querySelector("form");e&&(h=new _l(n[r].fields,a,{...i,showSubmitButton:!1}),h.formElement=e,h._bindEvents(e));const t=l.querySelector(".wizard-prev"),s=l.querySelector(".wizard-next"),_=l.querySelector(".wizard-submit");t&&t.addEventListener("click",e=>{e.preventDefault(),r>0&&(p(),i.onStepChange&&i.onStepChange(r-1,a),r--,f())}),s&&s.addEventListener("click",t=>{t.preventDefault(),Object.assign(a,u(e));const s=h,o=m(e);i.onValidation&&i.onValidation(o,s?.errors||[],r),o&&r<n.length-1&&(i.onStepChange&&i.onStepChange(r+1,a),r++,f())}),_&&_.addEventListener("click",async t=>{t.preventDefault(),Object.assign(a,u(e));const n=h,s=m(e);if(i.onValidation&&i.onValidation(s,n?.errors||[],r),s&&i.onSubmit)try{await i.onSubmit(a,n)}catch(e){i.onError&&i.onError(e,a,n)}})}return f(),{nextStep:()=>{r<n.length-1&&(p(),i.onStepChange&&i.onStepChange(r+1,a),r++,f())},prevStep:()=>{r>0&&(p(),i.onStepChange&&i.onStepChange(r-1,a),r--,f())},goToStep:e=>{e>=0&&e<n.length&&(p(),i.onStepChange&&i.onStepChange(e,a),r=e,f())},getCurrentStep:()=>r,getStepData:()=>({...a}),setStepData:e=>{Object.assign(a,e),f()},validate:()=>{const e=l?.querySelector("form");return!e||m(e)},getElement:()=>l,destroy:()=>{d(),l?.remove(),l=null}}},modal(e,t={},n={}){const s=`form-${Date.now()}`;let i=null;const o=new _l(e,t,{...n,showSubmitButton:!1,onSubmit:async(e,t)=>{if(n.onSave)try{await n.onSave(e,t),!1!==n.closeOnSave&&i&&i.close()}catch(s){n.onError&&n.onError(s,e,t)}}}),r=`\n <div class="modal" id="modal-${s}" style="display: none;">\n <div class="modal-header">\n <h3 class="modal-title">${n.title||"Form"}</h3>\n <button type="button" class="modal-close" data-action="close">×</button>\n </div>\n <div class="modal-body">\n ${o.render()}\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-action="close">Cancel</button>\n <button type="button" class="btn btn-primary" data-action="save">${n.saveText||"Save"}</button>\n </div>\n </div>\n `,a=document.createElement("div");a.className="modal-backdrop",a.style.display="none";const l=document.createElement("div");l.innerHTML=r;const c=l.firstElementChild;return document.body.appendChild(a),document.body.appendChild(c),i={open(){a.style.display="block",c.style.display="block",setTimeout(()=>{a.classList.add("active"),c.classList.add("active")},10);const e=c.querySelector("form");e&&o._bindEvents(e),c.querySelectorAll('[data-action="close"]').forEach(e=>{e.addEventListener("click",()=>this.close())}),c.querySelector('[data-action="save"]').addEventListener("click",()=>{const e=c.querySelector("form");if(e){const t=new Event("submit",{cancelable:!0});e.dispatchEvent(t)}}),a.addEventListener("click",e=>{e.target===a&&this.close()})},close(){a.classList.remove("active"),c.classList.remove("active"),setTimeout(()=>{a.style.display="none",c.style.display="none",document.body.removeChild(a),document.body.removeChild(c)},300)},isOpen:()=>"none"!==c.style.display},i},crud(e){if(!e.schema)throw new Error("CRUD config must include a schema");if(!e.endpoint)throw new Error("CRUD config must include an API endpoint");const{schema:t,endpoint:n,tableSelector:s,title:i="Manage Items",primaryKey:o="id",displayField:r="name",headers:a={},onError:l=e=>console.error("CRUD Error:",e),onSuccess:c=e=>console.log("CRUD Success:",e)}=e;let h=null,d=[];return{async init(){await this.loadData(),this.createTable(),this.bindEvents()},async loadData(){try{window.Domma?.auth?.getApiUrl?.();const e=window.Domma?.auth?.token,t=e?{Authorization:`Bearer ${e}`}:{},s=await window.Domma.http.get(n,{headers:{...a,...t}});if(!s.success)throw new Error(s.message||"Failed to load data");d=s.data||[]}catch(e){throw l(e),e}},createTable(){if(!s)return;const e=Object.entries(t).map(([e,t])=>({key:e,title:t.label||(window.Domma?.utils||y).capitalize(e),sortable:!0,render:t.tableRender}));e.push({key:"actions",title:"Actions",sortable:!1,render:(e,t)=>{const n=window.Domma.icons.html("edit",{size:16,class:"inline-icon",colour:"var(--dm-info-light, #a5d8ff)",attrs:{style:"margin-right: 4px;"}}),s=window.Domma.icons.html("trash",{size:16,class:"inline-icon",colour:"var(--dm-danger-light, #ffacac)",attrs:{style:"margin-right: 4px;"}});return`\n <div class="btn-group btn-group-sm">\n <button class="btn btn-primary crud-edit-btn" data-id="${t[o]}">\n ${n}\n Edit\n </button>\n <button class="btn btn-danger crud-delete-btn" data-id="${t[o]}">\n ${s}\n Delete\n </button>\n </div>\n `}}),h=window.Domma.tables.create(s,{data:d,columns:e,pagination:!0,pageSize:25,striped:!0,selectable:!0,selectionMode:"multiple",exportPanel:!0,exportOptions:["text","csv","excel","json"],columnToggle:!0,regexSearch:!0,persistSettings:!0,storageKey:`domma-crud-${i.toLowerCase().replace(/\s+/g,"-")}`}),this.initializeTableIcons()},initializeTableIcons(){setTimeout(()=>{document.querySelectorAll("[data-icon]").forEach(e=>{const t=e.getAttribute("data-icon");if(window.Domma&&window.Domma.icons&&window.Domma.icons.render){const n=window.Domma.icons.render(t,{size:16,class:"inline-icon"});n&&(e.innerHTML="",e.appendChild(n))}})},100)},bindEvents(){const e=document.querySelector(".crud-add-btn");e&&e.addEventListener("click",()=>this.create()),document.addEventListener("click",e=>{if(e.target.matches(".crud-edit-btn")){const t=e.target.getAttribute("data-id");this.edit(t)}}),document.addEventListener("click",e=>{if(e.target.matches(".crud-delete-btn")){const t=e.target.getAttribute("data-id");this.delete(t)}});const t=document.querySelector(".crud-refresh-btn");t&&t.addEventListener("click",()=>this.refresh())},async create(){gl.modal(t,{},{title:`Create New ${i.slice(7)}`,size:"xl",saveText:"Create",showSubmitButton:!1,onSave:async e=>{try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},i=await window.Domma.http.post(n,e,{headers:{...a,...s}});if(!i.success)throw new Error(i.message||"Failed to create item");c("Item created successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async edit(e){const s=d.find(t=>t[o]==e);if(!s)return void l(new Error("Item not found"));gl.modal(t,s,{title:`Edit ${s[r]||"Item"}`,size:"xl",saveText:"Update",showSubmitButton:!1,onSave:async t=>{try{window.Domma?.auth?.getApiUrl?.();const s=window.Domma?.auth?.token,i=s?{Authorization:`Bearer ${s}`}:{},o=await window.Domma.http.put(`${n}/${e}`,t,{headers:{...a,...i}});if(!o.success)throw new Error(o.message||"Failed to update item");c("Item updated successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async delete(e){const t=d.find(t=>t[o]==e);if(!t)return void l(new Error("Item not found"));if(await window.Domma.elements.confirm(`Are you sure you want to delete "${t[r]||"this item"}"?\n\nThis action cannot be undone.`,{title:"Confirm Delete",confirmText:"Delete",cancelText:"Cancel",type:"warning"}))try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},i=await window.Domma.http.delete(`${n}/${e}`,{headers:{...a,...s}});if(!i.success)throw new Error(i.message||"Failed to delete item");c("Item deleted successfully"),await this.refresh()}catch(e){l(e)}},async refresh(){try{await this.loadData(),h&&(h.setData(d),this.initializeTableIcons())}catch(e){}},getData:()=>[...d],getTable:()=>h,addItem:e=>{d.push(e),h&&h.setData(d)},updateItem:(e,t)=>{const n=d.findIndex(t=>t[o]==e);-1!==n&&(d[n]={...d[n],...t},h&&h.setData(d))},removeItem:e=>{const t=d.findIndex(t=>t[o]==e);-1!==t&&(d.splice(t,1),h&&h.setData(d))}}}};function vl(e,t){if(![t.x,t.y,t.width,t.height].every(Number.isFinite)||t.width<=0||t.height<=0||t.alpha<=0)return;const n=Math.cos(t.flipPhase||0),s=t.width*(.12+.88*Math.abs(n)),i=Math.sin(t.curlPhase||0)*t.width*.32,o=-t.height/2,r=t.height/2;e.save(),e.globalAlpha*=t.alpha??1,e.translate(t.x,t.y),e.rotate(t.rotation||0),e.beginPath(),e.moveTo(-s/2,o),e.bezierCurveTo(-s/2+i,o+.3*t.height,-s/2-i,r-.3*t.height,-s/2,r),e.lineTo(s/2,r),e.bezierCurveTo(s/2-i,r-.3*t.height,s/2+i,o+.3*t.height,s/2,o),e.closePath(),e.fillStyle=t.colour,e.fill();const a=e.createLinearGradient(-s/2,o,s/2,r);a.addColorStop(0,n<0?"rgba(20,25,40,0.28)":"rgba(255,255,255,0.48)"),a.addColorStop(.42,"rgba(255,255,255,0.05)"),a.addColorStop(.7,"rgba(20,25,40,0.2)"),a.addColorStop(1,"rgba(255,255,255,0.3)"),e.fillStyle=a,e.fill(),e.beginPath(),e.moveTo(s/2,o),e.bezierCurveTo(s/2+i,o+.3*t.height,s/2-i,r-.3*t.height,s/2,r),e.strokeStyle="rgba(255,255,255,0.42)",e.lineWidth=.55,e.stroke(),e.restore()}function bl(e,t,n,s){const i=Math.cos(e.swayPhase);e.swayPhase+=e.swayFreq*s,e.x+=e.vx*s+(i-Math.cos(e.swayPhase))*n.sway,e.y+=e.vy*s,e.rotation+=e.rotationSpeed*s,e.flipPhase+=e.flipSpeed*s,e.curlPhase+=.025*s;const o=e.y/Math.max(1,t);e.alpha=o<n.fadeStart?1:Math.max(0,1-(o-n.fadeStart)/Math.max(.001,1-n.fadeStart)),(e.y-e.height>t||e.alpha<=.01)&&(e.alive=!1)}function yl(e,t){if(![t.x,t.y,t.size].every(Number.isFinite)||t.size<=0)return;const n=.12+.88*Math.abs(Math.sin(t.flapPhase||0));e.save(),e.translate(t.x,t.y),e.rotate((t.heading??-Math.PI/2)+Math.PI/2),e.scale(t.size/2.2,t.size/2.2),e.globalAlpha*=t.alpha??1,e.lineCap="round",e.lineJoin="round";const s=(t,n,s,i=.025)=>{e.beginPath();for(const[n,...s]of t)e[n](...s);n&&(e.fillStyle=n,e.fill()),s&&(e.strokeStyle=s,e.lineWidth=i,e.stroke())},i=(t,n,s,i,o)=>{e.beginPath(),e.ellipse(t,n,s,i,0,0,2*Math.PI),e.fillStyle=o,e.fill()};for(const o of[-1,1]){e.save(),e.scale(o*n,1);const r=e.createLinearGradient(0,0,1.1,-.8);r.addColorStop(0,"#504354"),r.addColorStop(.26,t.colourUpper||"#d891b4"),r.addColorStop(1,"#f5dabc");const a=e.createLinearGradient(0,0,.9,.7);a.addColorStop(0,"#63505d"),a.addColorStop(.35,t.colourLower||t.colourUpper||"#bd8fb3"),a.addColorStop(1,"#e8cbb6"),s([["moveTo",.045,-.04],["bezierCurveTo",.3,-.52,.73,-1.02,1.04,-.83],["bezierCurveTo",1.18,-.67,.91,-.13,.63,.03],["quadraticCurveTo",.32,.17,.045,-.04],["closePath"]],r,"#5b4a59",.035),s([["moveTo",.05,0],["bezierCurveTo",.52,-.05,.98,.2,.84,.54],["quadraticCurveTo",.74,.73,.52,.68],["quadraticCurveTo",.31,.87,.15,.54],["quadraticCurveTo",.03,.28,.05,0],["closePath"]],a,"#5b4a59",.035);for(const[e,t]of[[1.03,-.73],[.93,-.38],[.73,-.08],[.8,.37],[.61,.64],[.28,.67]])s([["moveTo",.08,0],["quadraticCurveTo",.53*e,.8*t,e,t]],null,"rgba(78,54,67,0.45)",.018);for(const[e,t,n]of[[.89,-.66,.04],[.87,-.47,.034],[.77,-.29,.03],[.69,.38,.035],[.55,.54,.03],[.35,.55,.028]])i(e,t,n,1.2*n,"#fff0d5");i(.48,-.33,.11,.14,"#69506c"),i(.48,-.33,.058,.075,"#e8c68f"),i(.45,.34,.085,.105,"rgba(90,65,86,0.65)"),e.restore()}i(0,.16,.052,.37,"#493f49"),i(0,-.12,.073,.15,"#5c4d56"),i(0,-.31,.072,.075,"#443a45");for(const e of[-1,1])s([["moveTo",.025*e,-.35],["quadraticCurveTo",.1*e,-.61,.2*e,-.56]],null,"#665362",.018),i(.2*e,-.56,.02,.025,"#d6b391");e.restore()}function kl(e){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e)return 0;const t=parseFloat(e);return Number.isFinite(t)?e.endsWith("ms")?t:e.endsWith("s")?1e3*t:0:0}function wl(e,t){let n;if("string"==typeof e)n=Array.from(document.querySelectorAll(e));else if(e instanceof Element)n=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error(`[Domma.effects.${t}] Invalid selector`),null;n=Array.from(e)}return 0===n.length?(console.warn(`[Domma.effects.${t}] No elements found`),null):n}function xl(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const Ml={club:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7},concert:{origins:["tl","tr"],motion:"sweep",sweepArc:120,speed:.8,beamWidth:18,flicker:!0,hz:6,colours:["#f43f5e","#fb923c","#facc15","#22c55e","#3b82f6"],intensity:.75},police:{origins:["tl","tr"],motion:"sweep",sweepArc:70,speed:2.2,beamWidth:22,flicker:!0,hz:8,colours:["#ef4444","#3b82f6"],intensity:.85},searchlight:{origins:["bl","br"],motion:"rotate",sweepArc:90,speed:.5,beamWidth:12,flicker:!1,hz:0,colours:["#fffbe6","#fde68a"],intensity:.6},scanner:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:60,speed:1.6,beamWidth:8,flicker:!1,hz:0,colours:["#22d3ee"],intensity:.7},mood:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:140,speed:.35,beamWidth:28,flicker:!1,hz:0,colours:["#a855f7","#6366f1","#ec4899","#38bdf8"],intensity:.45}};function Ll(e,t){let n=String(e).replace("#","");3===n.length&&(n=n.split("").map(e=>e+e).join(""));return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}const Cl={rainbow:["#ef4444","#f97316","#facc15","#22c55e","#0ea5e9","#6366f1","#a855f7","#ec4899"],festive:["#dc2626","#16a34a","#fbbf24","#3b82f6","#a855f7","#ec4899"],gold:["#fbbf24","#f59e0b","#fde68a","#fffbeb","#d97706","#fcd34d"],silver:["#e5e7eb","#cbd5e1","#94a3b8","#f8fafc","#9ca3af","#d1d5db"],pastel:["#fbcfe8","#bae6fd","#bbf7d0","#fef3c7","#ddd6fe","#fed7aa"],mono:["#1f2937","#4b5563","#9ca3af","#d1d5db","#f3f4f6"],sunset:["#f43f5e","#fb923c","#facc15","#f59e0b","#ec4899"],ocean:["#0ea5e9","#22d3ee","#06b6d4","#3b82f6","#6366f1"],forest:["#16a34a","#65a30d","#84cc16","#22c55e","#15803d"],bridal:["#ffffff","#fef3c7","#fce7f3","#fbcfe8","#f9a8d4"],meadow:["#84cc16","#a3e635","#bbf7d0","#bae6fd","#fef08a","#ddd6fe"],firefly:["#fde68a","#facc15","#f59e0b","#a3e635","#fef9c3"],aqua:["#a5f3fc","#67e8f9","#22d3ee","#bae6fd","#e0f2fe"],autumn:["#b45309","#d97706","#f59e0b","#ca8a04","#92400e","#dc2626"]};function Al(e){if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e&&Cl[e])return Cl[e];if("theme"===e||!e){const e=document.documentElement,t=getComputedStyle(e),n=["--dm-primary","--dm-secondary","--dm-success","--dm-warning","--dm-danger","--dm-info"].map(e=>t.getPropertyValue(e).trim()).filter(e=>e&&"transparent"!==e);return n.length>0?n:Cl.rainbow}return console.warn(`[Domma.effects] Unknown palette '${e}', using rainbow.`),Cl.rainbow}const El=Al;var Sl={breathe:function(e,t={}){const n={amplitude:6,duration:3e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,onStart:null,onComplete:null,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.breathe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.breathe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.breathe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-breathe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=`\n @keyframes ${i} {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-${n.amplitude}px);\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",i),r.textContent=o,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>{e.style.animationPlayState="paused"},n=()=>{e.style.animationPlayState="running"};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}if(n.onComplete&&"infinite"!==n.iterations){const t=()=>{n.onComplete(),e.removeEventListener("animationend",t)};e.addEventListener("animationend",t)}}),n.onStart&&n.onStart(),{pause(){s.forEach(e=>{e.style.animationPlayState="paused"})},resume(){s.forEach(e=>{e.style.animationPlayState="running"})},stop(){s.forEach(e=>{e.style.animation="none"})},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning(){if(0===s.length)return!1;const e=s[0];return"paused"!==e.style.animationPlayState&&"none"!==e.style.animation},isPaused:()=>0!==s.length&&"paused"===s[0].style.animationPlayState}},pulse:function(e,t={}){const n={scale:1.05,duration:2e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,respectMotionPreference:!0,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.pulse] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.pulse] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-pulse-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=`\n @keyframes ${i} {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(${n.scale});\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",i),r.textContent=o,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>e.style.animationPlayState="paused",n=()=>e.style.animationPlayState="running";e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>e.style.animation="none")},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning:()=>s.length>0&&"paused"!==s[0].style.animationPlayState&&"none"!==s[0].style.animation,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},scribe:function(e,t={}){const n={mode:"typewriter",speed:50,deleteSpeed:30,cursor:!0,cursorChar:"|",cursorBlink:!0,cursorType:"caret",loop:!1,loopDelay:1e3,pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,actions:[],onStart:null,onComplete:null,onCharacter:null,onRender:null,onUndoRender:null,onLoop:null,...t};let s;if("string"==typeof e)s=Array.from(document.querySelectorAll(e));else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.scribe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.scribe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){const e=n.actions.find(e=>void 0!==e.render);return e&&s.forEach(t=>{t.textContent=String(e.render)}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1}}const i="function"==typeof Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null,o=s.map(e=>({element:e,spans:[],cursor:null,action:0,task:null,exiting:[],frame:null,lastTime:null,elapsed:0,loops:0,lastRenderStart:0,started:!1,paused:!1,stopped:!1,destroyed:!1,hoverPaused:!1,hoverHandlers:null}));function r(e,t){e.cursor?.classList.toggle("dm-scribe-cursor-active",t)}function a(e){const t=e.parentElement;e.remove(),t?.classList.contains("dm-scribe-word-group")&&!t.childNodes.length&&t.remove()}const l={fade:220,bounce:380,glow:500};function c(e,t){t.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow");const s=Math.max(220,n.deleteSpeed);return t.style.animationDuration=`${s}ms`,t.classList.add("dm-scribe-out"),e.exiting.push({span:t,left:s}),s}function h(e){e.spans.forEach(a),e.spans=[],e.exiting.forEach(e=>a(e.span)),e.exiting=[],e.lastRenderStart=0}function d(e){null!==e.frame||!e.started||e.paused||e.stopped||e.destroyed||(e.frame=requestAnimationFrame(t=>function(e,t){if(e.frame=null,e.paused||e.stopped||e.destroyed)return;const n=null!==e.lastTime?Math.min(t-e.lastTime,64):0;e.elapsed+=n,e.lastTime=t,e.exiting=e.exiting.filter(e=>(e.left-=n,e.left>0||(a(e.span),!1)));let s=0;for(;s++<100&&!e.paused&&!e.stopped&&!e.destroyed&&(e.task||u(e),!(e.stopped||e.paused||e.destroyed));){const t=e.task;if("render"===t.type&&t.index>=t.units.length||"undo"===t.type&&t.deleted.length>=t.count&&!t.hold){p(e);continue}const n=t.hold||t.duration;if(e.elapsed<n)break;if(e.elapsed-=n,t.hold)t.hold=0;else if("render"===t.type)m(e,t);else if("undo"===t.type){const n=e.spans.pop();if(t.deleted.push(n.textContent),n.dmScribeEffect){const s=c(e,n);t.deleted.length>=t.count&&(t.hold=s)}else a(n)}else p(e)}d(e)}(e,t)))}function u(e){if(e.action>=n.actions.length)return r(e,!1),void(!0===n.loop||"number"==typeof n.loop&&e.loops<n.loop-1?e.task={type:"loop",duration:Math.max(0,n.loopDelay)}:(e.stopped=!0,r(e,!1),n.onComplete?.()));const t=n.actions[e.action];if(void 0!==t.render)e.lastRenderStart=e.spans.length,e.task={type:"render",text:String(t.render),units:(s=String(t.render),"word"===n.mode?s.match(/\s*\S+\s*|\s+/g)||[]:"sentence"===n.mode?s.match(/[^.!?]*[.!?]+\s*|[^.!?]+$/g)||[]:i?Array.from(i.segment(s),e=>e.segment):Array.from(s)),index:0,effect:t.effect||"none",duration:Math.max(0,n.speed)};else if(void 0!==t.undoRender){let s=0;!0===t.undoRender?s=e.spans.length-e.lastRenderStart:"all"===t.undoRender?s=e.spans.length:Number.isFinite(t.undoRender)&&(s=Math.floor(t.undoRender)),e.task={type:"undo",count:Math.max(0,Math.min(s,e.spans.length)),deleted:[],duration:Math.max(0,n.deleteSpeed)}}else e.task={type:"wait",duration:Math.max(0,kl(t.wait))};var s;r(e,"render"===e.task.type||"undo"===e.task.type)}function p(e){const t=e.task;e.task=null,"loop"===t.type?(h(e),e.action=0,e.loops++,n.onLoop?.(e.loops)):(e.action++,"render"===t.type&&n.onRender?.(t.text),"undo"===t.type&&n.onUndoRender?.(t.deleted.reverse().join("")))}function m(e,t){const s=t.units[t.index++],i=document.createElement("span");if(i.className="word"===n.mode?"dm-scribe-word":"sentence"===n.mode?"dm-scribe-sentence":"dm-scribe-char",i.textContent=s,/^\s+$/.test(s)&&i.classList.add("dm-scribe-space"),["fade","bounce","glow"].includes(t.effect)){const e=`dm-scribe-${t.effect}`;i.classList.add(e),i.dmScribeEffect=t.effect,n.speed>l[t.effect]&&(i.style.animationDuration=`${n.speed}ms`),"sentence"===n.mode&&"bounce"===t.effect&&i.classList.add("dm-scribe-transform-unit"),i.addEventListener("animationend",()=>i.classList.remove(e),{once:!0})}if("typewriter"!==n.mode||/^\s+$/.test(s))e.element.insertBefore(i,e.cursor);else{const t=e.spans.at(-1);let n=t?.parentElement;n?.classList.contains("dm-scribe-word-group")||(n=document.createElement("span"),n.className="dm-scribe-word-group",e.element.insertBefore(n,e.cursor)),n.appendChild(i)}e.spans.push(i),n.onCharacter?.(s,e.spans.length-1)}function f(e){e.destroyed||e.stopped||(e.paused=!0,null!==e.frame&&cancelAnimationFrame(e.frame),e.frame=null,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState="paused"}),e.exiting.forEach(e=>{e.span.style.animationPlayState="paused"}),r(e,!1))}function _(e){if(e.destroyed||e.stopped||e.started&&!e.paused)return;const t=!e.started;e.started=!0,e.paused=!1,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState=""}),e.exiting.forEach(e=>{e.span.style.animationPlayState=""}),r(e,"render"===e.task?.type||"undo"===e.task?.type),t&&n.onStart?.(),d(e)}return o.forEach(e=>{if(n.cursor){const t=document.createElement("span"),s=["block","underline"].includes(n.cursorType)?n.cursorType:"caret";t.className=`dm-scribe-cursor dm-scribe-cursor-${s}`,n.cursorBlink||t.classList.add("dm-scribe-cursor-no-blink"),t.textContent="underline"===s?" ":n.cursorChar,t.setAttribute("aria-hidden","true"),e.cursor=t,e.element.appendChild(t)}n.pauseOnHover&&(e.hoverHandlers={enter:()=>{!e.started||e.paused||e.stopped||(e.hoverPaused=!0,f(e))},leave:()=>{e.hoverPaused&&(e.hoverPaused=!1,_(e))}},e.element.addEventListener("mouseenter",e.hoverHandlers.enter),e.element.addEventListener("mouseleave",e.hoverHandlers.leave)),n.autoStart&&_(e)}),{pause(){o.forEach(e=>{e.hoverPaused=!1,f(e)})},resume(){o.forEach(_)},stop(){o.forEach(e=>{f(e),e.paused=!1,e.stopped=!0,e.spans.forEach(e=>{e.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow"),e.style.animationPlayState=""}),e.exiting.forEach(e=>a(e.span)),e.exiting=[],r(e,!1)})},restart(){o.forEach(e=>{e.destroyed||(f(e),h(e),Object.assign(e,{action:0,task:null,elapsed:0,lastTime:null,loops:0,stopped:!1,started:!1}),_(e))})},destroy(){o.forEach(e=>{f(e),e.destroyed=!0,h(e),e.cursor?.remove(),e.hoverHandlers&&(e.element.removeEventListener("mouseenter",e.hoverHandlers.enter),e.element.removeEventListener("mouseleave",e.hoverHandlers.leave))})},isRunning:()=>o.some(e=>e.started&&!e.paused&&!e.stopped&&!e.destroyed),isPaused:()=>o.some(e=>e.paused&&!e.destroyed)}},reveal:function(e,t={}){const n={animation:"fade",duration:600,easing:"ease-out",delay:0,stagger:0,threshold:.1,rootMargin:"0px",once:!0,respectMotionPreference:!0,onReveal:null,...t},s=wl(e,"reveal");if(!s)return null;if(n.respectMotionPreference&&xl())return s.forEach(e=>{e.classList.add("dm-reveal-visible")}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};s.forEach((e,t)=>{e.classList.add("dm-reveal",`dm-reveal-${n.animation}`),e.style.transitionDuration=`${n.duration}ms`,e.style.transitionTimingFunction=n.easing;const s=n.delay+t*n.stagger;s>0&&(e.style.transitionDelay=`${s}ms`),n.respectMotionPreference||e.setAttribute("data-force-animation","true")});const i=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(e.target.classList.add("dm-reveal-visible"),n.onReveal&&n.onReveal(e.target),n.once&&i.unobserve(e.target)):n.once||e.target.classList.remove("dm-reveal-visible")})},{threshold:n.threshold,rootMargin:n.rootMargin});return s.forEach(e=>i.observe(e)),{pause(){},resume(){},stop(){i.disconnect()},restart(){s.forEach(e=>{e.classList.remove("dm-reveal-visible"),i.observe(e)})},destroy(){i.disconnect(),s.forEach(e=>{e.classList.remove("dm-reveal","dm-reveal-visible",`dm-reveal-${n.animation}`),e.style.transitionDuration="",e.style.transitionTimingFunction="",e.style.transitionDelay=""})},isRunning:()=>!0,isPaused:()=>!1}},scramble:function(e,t={}){const n={speed:50,scrambleSpeed:30,characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*",revealOrder:"left-to-right",scrambleDuration:800,stagger:0,loop:!1,loopDelay:2e3,respectMotionPreference:!0,onComplete:null,onCharacter:null,...t},s=wl(e,"scramble");if(!s)return null;if(n.respectMotionPreference&&xl())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=s.map((e,t)=>({element:e,originalText:e.textContent,rafId:null,timeoutId:null,paused:!1,loopCount:0}));function o(){return n.characters[Math.floor(Math.random()*n.characters.length)]}function r(e){if(e.paused)return;const t=e.originalText,s=t.length;if(0===s)return void(n.onComplete&&n.onComplete());const i=function(e,t){const n=Array.from({length:e},(e,t)=>t);switch(t){case"right-to-left":return n.reverse();case"random":for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n;case"center-out":{const t=Math.floor(e/2),n=[t];for(let s=1;s<=t;s++)t-s>=0&&n.push(t-s),t+s<e&&n.push(t+s);return n}default:return n}}(s,n.revealOrder),a=new Array(s).fill(!1),l=t.split("").map(e=>" "===e?" ":o()),c=performance.now(),h=n.speed;e.rafId=requestAnimationFrame(function d(u){if(e.paused)return;const p=u-c;i.forEach((e,s)=>{if(a[e])return;const i=n.scrambleDuration+s*h;p>=i&&(a[e]=!0,l[e]=t[e],n.onCharacter&&n.onCharacter(t[e],e))});for(let e=0;e<s;e++)a[e]||" "===t[e]||(l[e]=o());if(e.element.innerHTML=l.map((e,t)=>`<span class="dm-scramble-char${a[t]?" dm-scramble-resolved":""}">${e}</span>`).join(""),a.every(Boolean))return n.onComplete&&n.onComplete(),void function(e){if(!1===n.loop)return;if("number"==typeof n.loop&&e.loopCount>=n.loop-1)return;e.loopCount++,e.timeoutId=setTimeout(()=>{e.paused||r(e)},n.loopDelay)}(e);e.rafId=requestAnimationFrame(d)})}return i.forEach((e,t)=>{const s=t*n.stagger;s>0?e.timeoutId=setTimeout(()=>r(e),s):r(e)}),{pause(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){i.forEach(e=>{e.paused=!1,r(e)})},stop(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},restart(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.loopCount=0,r(e)})},destroy(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},isRunning:()=>i.length>0&&!i[0].paused,isPaused:()=>i.length>0&&i[0].paused}},counter:function(e,t={}){const n={from:0,to:null,duration:2e3,easing:"ease-out",decimals:0,separator:",",prefix:"",suffix:"",stagger:0,trigger:"immediate",threshold:.5,respectMotionPreference:!0,onUpdate:null,onComplete:null,...t},s=wl(e,"counter");if(!s)return null;if(n.respectMotionPreference&&xl())return s.forEach(e=>{const t=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;e.textContent=n.prefix+i(t,n.decimals,n.separator)+n.suffix}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};function i(e,t,n){const s=e.toFixed(t);if(!n)return s;const i=s.split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,n),i.join(".")}const o=s.map((e,t)=>{const s=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;return{element:e,from:n.from,to:s,rafId:null,timeoutId:null,startTime:null,paused:!1,complete:!1}});function r(e){e.paused||(e.startTime=performance.now(),e.complete=!1,e.rafId=requestAnimationFrame(function t(s){if(e.paused)return;const o=s-e.startTime,r=Math.min(o/n.duration,1),a=function(e){switch(n.easing){case"linear":return e;case"ease-in-out":return e<.5?2*e*e:(4-2*e)*e-1;default:return 1-Math.pow(1-e,3)}}(r),l=e.from+(e.to-e.from)*a;e.element.textContent=n.prefix+i(l,n.decimals,n.separator)+n.suffix,n.onUpdate&&n.onUpdate(l),r<1?e.rafId=requestAnimationFrame(t):(e.complete=!0,e.element.textContent=n.prefix+i(e.to,n.decimals,n.separator)+n.suffix,n.onComplete&&n.onComplete())}))}let a=null;function l(e,t){t>0?e.timeoutId=setTimeout(()=>r(e),t):r(e)}return"scroll"===n.trigger?(a=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const t=o.find(t=>t.element===e.target);if(t&&!t.complete){l(t,o.indexOf(t)*n.stagger)}a.unobserve(e.target)}})},{threshold:n.threshold}),s.forEach(e=>a.observe(e))):o.forEach((e,t)=>{l(e,t*n.stagger)}),{pause(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){o.forEach(e=>{e.paused&&!e.complete&&(e.paused=!1,r(e))})},stop(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},restart(){o.forEach((e,t)=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.complete=!1,l(e,t*n.stagger)})},destroy(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},isRunning:()=>o.length>0&&!o[0].paused&&!o[0].complete,isPaused:()=>o.length>0&&o[0].paused}},ripple:function(e,t={}){const n={colour:"rgba(255, 255, 255, 0.35)",duration:600,opacity:.35,unbounded:!1,centered:!1,trigger:"pointerdown",respectMotionPreference:!0,...t},s=wl(e,"ripple");if(!s)return null;if(n.respectMotionPreference&&xl())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i="domma-ripple-keyframes";if(!document.getElementById(i)){const e=document.createElement("style");e.id=i,e.textContent="\n @keyframes dm-ripple-expand {\n 0% {\n transform: scale(0);\n opacity: var(--dm-ripple-opacity, 0.35);\n }\n 100% {\n transform: scale(4);\n opacity: 0;\n }\n }\n ",document.head.appendChild(e)}const o=new Map;return s.forEach(e=>{e.classList.add("dm-ripple-container");"static"===getComputedStyle(e).position&&(e.style.position="relative"),n.unbounded||(e.style.overflow="hidden"),n.respectMotionPreference||e.setAttribute("data-force-animation","true");const t=t=>{const s=e.getBoundingClientRect(),i=2*Math.max(s.width,s.height);let o,r;n.centered?(o=s.width/2,r=s.height/2):(o=(t.clientX||t.touches?.[0]?.clientX||s.width/2)-s.left,r=(t.clientY||t.touches?.[0]?.clientY||s.height/2)-s.top);const a=document.createElement("span");a.className="dm-ripple",n.respectMotionPreference||a.setAttribute("data-force-animation","true"),a.style.cssText=`\n position: absolute;\n border-radius: 50%;\n pointer-events: none;\n width: ${i}px;\n height: ${i}px;\n left: ${o-i/2}px;\n top: ${r-i/2}px;\n background: ${n.colour};\n --dm-ripple-opacity: ${n.opacity};\n animation: dm-ripple-expand ${n.duration}ms ease-out forwards;\n `,e.appendChild(a),setTimeout(()=>{a.remove()},n.duration)};e.addEventListener(n.trigger,t),o.set(e,t)}),{pause(){},resume(){},stop(){},restart(){},destroy(){s.forEach(e=>{o.has(e)&&(e.removeEventListener(n.trigger,o.get(e)),o.delete(e)),e.classList.remove("dm-ripple-container"),e.querySelectorAll(".dm-ripple").forEach(e=>e.remove())})},isRunning:()=>!0,isPaused:()=>!1}},shake:function(e,t={}){const n={intensity:6,duration:500,direction:"horizontal",easing:"ease-in-out",iterations:1,stagger:0,respectMotionPreference:!0,onComplete:null,...t},s=wl(e,"shake");if(!s)return null;if(n.respectMotionPreference&&xl())return n.onComplete&&n.onComplete(),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const i=`domma-shake-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o=n.intensity;let r;switch(n.direction){case"vertical":r=`\n 0%, 100% { transform: translateY(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateY(-${o}px); }\n 20%, 40%, 60%, 80% { transform: translateY(${o}px); }\n `;break;case"both":r=`\n 0%, 100% { transform: translate(0, 0); }\n 10% { transform: translate(-${o}px, -${o}px); }\n 20% { transform: translate(${o}px, ${o}px); }\n 30% { transform: translate(-${o}px, ${o}px); }\n 40% { transform: translate(${o}px, -${o}px); }\n 50% { transform: translate(-${o}px, 0); }\n 60% { transform: translate(${o}px, 0); }\n 70% { transform: translate(0, -${o}px); }\n 80% { transform: translate(0, ${o}px); }\n 90% { transform: translate(-${o}px, -${o}px); }\n `;break;default:r=`\n 0%, 100% { transform: translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateX(-${o}px); }\n 20%, 40%, 60%, 80% { transform: translateX(${o}px); }\n `}const a=document.createElement("style");a.setAttribute("data-domma-effect",i),a.textContent=`@keyframes ${i} { ${r} }`,document.head.appendChild(a);const l=new Map;return s.forEach((e,t)=>{const o=t*n.stagger,r=()=>{e.style.animation=`${i} ${n.duration}ms ${n.easing} ${n.iterations}`;const o=()=>{e.style.animation="",e.removeEventListener("animationend",o),l.delete(e),n.onComplete&&t===s.length-1&&n.onComplete()};e.addEventListener("animationend",o),l.set(e,o)};o>0?setTimeout(r,o):r()}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))})},restart(){s.forEach((e,t)=>{e.style.animation="none",e.offsetHeight,e.style.animation=`${i} ${n.duration}ms ${n.easing} ${n.iterations}`})},destroy(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))}),a.remove()},isRunning:()=>s.length>0&&""!==s[0].style.animation&&"paused"!==s[0].style.animationPlayState,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},twinkle:function(e,t={}){const n={count:100,minSize:1,maxSize:3,twinkleSpeed:.003,colour:"rgba(255, 240, 200, 1)",zIndex:1,shape:"star",respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.twinkle] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.twinkle] No elements found for selector:",e),null;let o=!1,r=!1,a=null;const l=`domma-twinkle-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];function h(e,t){const s=[];for(let i=0;i<n.count;i++)s.push({x:Math.random()*e,y:Math.random()*t,size:n.minSize+Math.random()*(n.maxSize-n.minSize),opacity:.3+.7*Math.random(),twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:n.twinkleSpeed+Math.random()*n.twinkleSpeed});return s}function d(e,t){const s=document.createElement("canvas");if(s.id=l+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","twinkle"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const i=s.getContext("2d");return{canvas:s,ctx:i,stars:h(s.width,s.height),container:e}}function u(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}e.stars=h(e.canvas.width,e.canvas.height)}if(s){const e=d(document.body,!0);e.isFixed=!0,c.push(e)}else i.forEach(e=>{const t=d(e,!1);t.isFixed=!1,c.push(t)});let p=null;if(s){const e=()=>c.forEach(e=>u(e));window.addEventListener("resize",e),c[0]._resizeHandler=e}else"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(()=>{c.forEach(e=>u(e))}),i.forEach(e=>p.observe(e)));function m(){o&&!r&&(c.forEach(({canvas:e,ctx:t,stars:s})=>{t.clearRect(0,0,e.width,e.height),s.forEach(e=>function(e,t){t.twinklePhase+=t.twinkleSpeed;const s=.3+.7*Math.sin(t.twinklePhase);if(e.save(),e.globalAlpha=t.opacity*s,e.fillStyle=n.colour,e.shadowColor=n.colour,"circle"===n.shape)e.shadowBlur=2*t.size,e.beginPath(),e.arc(t.x,t.y,.6*t.size,0,2*Math.PI),e.fill();else{e.shadowBlur=2*t.size,e.beginPath();for(let n=0;n<4;n++){const s=n*Math.PI/2,i=t.x+Math.cos(s)*t.size,o=t.y+Math.sin(s)*t.size,r=s+Math.PI/4,a=t.x+Math.cos(r)*(.3*t.size),l=t.y+Math.sin(r)*(.3*t.size);0===n?e.moveTo(i,o):e.lineTo(i,o),e.lineTo(a,l)}e.closePath(),e.fill(),e.shadowBlur=t.size,e.beginPath(),e.arc(t.x,t.y,.25*t.size,0,2*Math.PI),e.fill()}e.restore()}(t,e))}),a=requestAnimationFrame(m))}function f(){o||(o=!0,r=!1,m())}return f(),console.log(`[Domma.effects.twinkle] Initialised with ${n.count} stars (${s?"full-page":"container"} mode)`),{pause(){o&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){o&&r&&(r=!1,m())},stop(){o=!1,r=!1,a&&(cancelAnimationFrame(a),a=null)},restart(){this.stop(),c.forEach(e=>{e.stars=h(e.canvas.width,e.canvas.height)}),f()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),p&&(p.disconnect(),p=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>o&&!r,isPaused:()=>o&&r}},tickerTape:function(e,t={}){const n={palette:"theme",density:50,speed:1,sway:60,rotationSpeed:6,minWidth:5,maxWidth:9,minHeight:12,maxHeight:22,fadeStart:.55,burst:!1,burstCount:150,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.tickerTape] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.tickerTape] No elements found for selector:",e),null;const o=El(n.palette);let r=!1,a=!1,l=null;const c=`domma-ticker-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null,u=null;function p(e,t,s){const i=n.minWidth+Math.random()*(n.maxWidth-n.minWidth),r=n.minHeight+Math.random()*(n.maxHeight-n.minHeight);return{x:Math.random()*e,y:s?-r-40*Math.random():Math.random()*-t,vy:(1+2.2*Math.random())*n.speed,vx:.4*(Math.random()-.5)*n.speed,swayPhase:Math.random()*Math.PI*2,swayFreq:.005+.01*Math.random(),width:i,height:r,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*n.rotationSpeed*Math.PI/180,flipPhase:Math.random()*Math.PI*2,flipSpeed:.018+.035*Math.random(),curlPhase:Math.random()*Math.PI*2,alpha:1,colour:o[Math.floor(Math.random()*o.length)],alive:!0}}function m(e,t){const s=document.createElement("canvas");if(s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","ticker-tape"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const i=s.getContext("2d"),o={canvas:s,ctx:i,particles:[],container:e,isFixed:t,burstFired:!1};return _(o),o}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++){const t=p(e.width,e.height,!1);t.y=-Math.random()*e.height*1.5,e.particles.push(t)}e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(p(e.width,e.height,!1))}}function _(e){const t=e.isFixed?{width:window.innerWidth,height:window.innerHeight}:e.container.getBoundingClientRect();e.width=t.width||e.container.offsetWidth||1,e.height=t.height||e.container.offsetHeight||1;const n=Math.min(window.devicePixelRatio||1,3);e.canvas.width=Math.round(e.width*n),e.canvas.height=Math.round(e.height*n),e.ctx.setTransform(n,0,0,n,0,0)}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),h.push(e);const t=()=>h.forEach(e=>_(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>{h.forEach(e=>_(e))}),i.forEach(e=>d.observe(e)));function g(e=performance.now()){if(!r||a)return;const t=null===u?1:Math.min(3,Math.max(0,(e-u)/(1e3/60)));u=e,h.forEach(e=>{const{canvas:s,ctx:i,particles:o}=e;i.clearRect(0,0,e.width,e.height);for(let s=o.length-1;s>=0;s--){const r=o[s];bl(r,e.height,n,t),r.alive?vl(i,r):o.splice(s,1)}if(!n.burst){const t=n.density;for(;o.length<t&&Math.random()<.6;)o.push(p(e.width,e.height,!0))}}),l=requestAnimationFrame(g)}function v(){r||(r=!0,a=!1,u=null,g())}return v(),console.log(`[Domma.effects.tickerTape] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,u=null,g())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),h.forEach(e=>f(e)),v()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},butterflies:function(e,t={}){const n={palette:"meadow",density:18,speed:1,wander:1,riseSpeed:.4,flapSpeed:1,minSize:14,maxSize:26,twoTone:!0,burst:!1,burstCount:40,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.butterflies] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.butterflies] No elements found for selector:",e),null;const o=Al(n.palette);let r=!1,a=!1,l=null;const c=`domma-butterflies-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null;function u(e,t){const s=n.minSize+Math.random()*(n.maxSize-n.minSize),i=Math.random();let r,a;i<.6?(r=Math.random()*e,a=t+s):i<.8?(r=-s,a=t*(.4+.6*Math.random())):(r=e+s,a=t*(.4+.6*Math.random()));const l=-Math.PI/2+1.2*(Math.random()-.5),c=o[Math.floor(Math.random()*o.length)],h=n.twoTone?o[Math.floor(Math.random()*o.length)]:c;return{x:r,y:a,heading:l,targetHeading:l,speed:.6+.8*Math.random(),wanderTimer:60*Math.random(),flapPhase:Math.random()*Math.PI*2,flapSpeed:(.18+.12*Math.random())*n.flapSpeed,size:s,colourUpper:c,colourLower:h,alpha:1,alive:!0}}function p(e,t,s){e.wanderTimer-=1,e.wanderTimer<=0&&(e.targetHeading=-Math.PI/2+(Math.random()-.5)*(1.4*n.wander),e.wanderTimer=30+Math.random()*(60/Math.max(.2,n.wander)));let i=e.targetHeading-e.heading;for(;i>Math.PI;)i-=2*Math.PI;for(;i<-Math.PI;)i+=2*Math.PI;e.heading+=.05*i*n.wander;const o=e.speed*n.speed;e.x+=Math.cos(e.heading)*o+.3*Math.sin(e.flapPhase),e.y+=Math.sin(e.heading)*o-n.riseSpeed*n.speed,e.flapPhase+=e.flapSpeed,(e.y+e.size<0||e.y-e.size>2*s||e.x<3*-e.size||e.x>t+3*e.size)&&(e.alive=!1)}function m(e,t){const s=document.createElement("canvas");s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","butterflies"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const i=s.getContext("2d");return{canvas:s,ctx:i,particles:[],container:e,burstFired:!1}}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++)e.particles.push(u(e.canvas.width,e.canvas.height));e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(u(e.canvas.width,e.canvas.height))}}function _(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),h.push(e);const t=()=>h.forEach(e=>_(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>h.forEach(e=>_(e))),i.forEach(e=>d.observe(e)));function g(){r&&!a&&(h.forEach(e=>{const{canvas:t,ctx:s,particles:i}=e;s.clearRect(0,0,t.width,t.height);for(let e=i.length-1;e>=0;e--){const n=i[e];p(n,t.width,t.height),n.alive?yl(s,n):i.splice(e,1)}if(!n.burst)for(;i.length<n.density&&Math.random()<.3;)i.push(u(t.width,t.height))}),l=requestAnimationFrame(g))}function v(){r||(r=!0,a=!1,g())}return v(),console.log(`[Domma.effects.butterflies] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,g())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),h.forEach(e=>f(e)),v()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},strobe:function(e,t={}){const n={preset:"club",origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7,duration:null,zIndex:9999,respectMotionPreference:!0,...function(e){return Ml[e]?Ml[e]:(console.warn(`[Domma.effects.strobe] Unknown preset '${e}', using 'club'.`),Ml.club)}(t.preset||"club"),...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.strobe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};n.flicker&&n.hz>5&&console.warn(`[Domma.effects.strobe] flicker hz=${n.hz} exceeds 5Hz - rapid flashing can trigger photosensitive seizures.`);const s=!e||"body"===e||e===document.body;let i=[];if(!s&&("string"==typeof e?i=Array.from(document.querySelectorAll(e)):e instanceof Element?i=[e]:(e instanceof NodeList||Array.isArray(e))&&(i=Array.from(e)),0===i.length))return console.warn("[Domma.effects.strobe] No elements found for selector:",e),null;let o=!1,r=!1,a=null,l=null;const c=`domma-strobe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,h=[];let d=null;function u(){return n.origins.map((e,t)=>({corner:e,colour:n.colours[t%n.colours.length],phase:t/Math.max(1,n.origins.length)*Math.PI*2}))}const p=[{widthMul:1.9,alphaMul:.16},{widthMul:1,alphaMul:.5},{widthMul:.45,alphaMul:1}];function m(e,t){const s=document.createElement("canvas");s.id=c+(h.length>0?`-${h.length}`:""),s.setAttribute("data-domma-effect","strobe"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const i=s.getContext("2d");return{canvas:s,ctx:i,container:e,beams:u()}}function f(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,h.push(e);const t=()=>h.forEach(e=>f(e));window.addEventListener("resize",t),h[0]._resizeHandler=t}else i.forEach(e=>{const t=m(e,!1);t.isFixed=!1,h.push(t)}),"undefined"!=typeof ResizeObserver&&(d=new ResizeObserver(()=>h.forEach(e=>f(e))),i.forEach(e=>d.observe(e)));function _(){if(!o||r)return;let e=1;if(n.flicker){const t=.5+.5*Math.sin(("undefined"!=typeof performance&&performance.now?performance.now():Date.now())/1e3*n.hz*Math.PI*2);e=.4+.6*t}h.forEach(t=>{const{canvas:s,ctx:i,beams:o}=t,r=s.width,a=s.height;i.globalCompositeOperation="destination-out",i.fillStyle="rgba(0, 0, 0, 0.14)",i.fillRect(0,0,r,a),i.globalCompositeOperation="lighter";const l=r/2,c=a/2;o.forEach(t=>{const{x:s,y:o}=function(e,t,n){switch(e){case"tr":return{x:t,y:0};case"bl":return{x:0,y:n};case"br":return{x:t,y:n};default:return{x:0,y:0}}}(t.corner,r,a);let h;if("rotate"===n.motion)h=t.phase,t.phase+=.01*n.speed;else{h=Math.atan2(c-o,l-s)+Math.sin(t.phase)*(n.sweepArc*Math.PI/180)/2,t.phase+=.02*n.speed}!function(e,t,s,i,o,r,a,l){const c=1.5*Math.hypot(r,a),h=n.beamWidth*Math.PI/180/2;for(let r=0;r<p.length;r++){const a=p[r],d=h*a.widthMul,u=n.intensity*a.alphaMul*l;if(u<=.003)continue;const m=t+Math.cos(i-d)*c,f=s+Math.sin(i-d)*c,_=t+Math.cos(i+d)*c,g=s+Math.sin(i+d)*c,v=e.createRadialGradient(t,s,0,t,s,c);v.addColorStop(0,Ll(o,u)),v.addColorStop(.4,Ll(o,.4*u)),v.addColorStop(1,Ll(o,0)),e.fillStyle=v,e.beginPath(),e.moveTo(t,s),e.lineTo(m,f),e.lineTo(_,g),e.closePath(),e.fill()}}(i,s,o,h,t.colour,r,a,e)}),i.globalCompositeOperation="source-over"}),a=requestAnimationFrame(_)}function g(){o||(o=!0,r=!1,_(),n.duration&&(l=setTimeout(()=>v.stop(),n.duration)))}const v={pause(){o&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){o&&r&&(r=!1,_())},stop(){o=!1,r=!1,a&&(cancelAnimationFrame(a),a=null),l&&(clearTimeout(l),l=null),h.forEach(({canvas:e,ctx:t})=>t&&t.clearRect(0,0,e.width,e.height))},restart(){this.stop(),h.forEach(e=>{e.beams=u()}),g()},destroy(){this.stop(),s&&h[0]?._resizeHandler&&window.removeEventListener("resize",h[0]._resizeHandler),d&&(d.disconnect(),d=null),h.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),h.length=0},isRunning:()=>o&&!r,isPaused:()=>o&&r};return g(),console.log(`[Domma.effects.strobe] Initialised (${s?"full-page":"container"} mode, preset: ${n.preset})`),v}};const $l={_configs:new Map,_components:new Map,_eventHandlers:new Map,_initCallbacks:[],_domReady:!1,_autoWrap:!0,process(e,t={}){if(!e||"object"!=typeof e)return;(void 0!==t.autoWrap?t.autoWrap:this._autoWrap)&&!this._domReady&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,this._processConfig(e)},{once:!0}):this._processConfig(e)},_processConfig(e){e.$init&&"function"==typeof e.$init&&(this._initCallbacks.push(e.$init),e.$init(),delete e.$init),Object.keys(e).forEach(t=>{const n=e[t];if(this._configs.set(t,y.cloneDeep(n)),n.init&&"function"==typeof n.init){const e=_(t);n.init.call(e,e)}const s=_(t);if(n.component){const e=this.initComponent(t,n.component,n.options||{});e&&this._components.set(t,e)}n.initial&&this.applyProperties(s,n.initial),n.events&&this.bindEvents(t,n.events,!0)})},update(e,t){const n=this._configs.get(e);if(!n)return this.process({[e]:t}),this._configs.get(e);const s=y.merge({},n,t);this._configs.set(e,s);const i=_(e);if(t.options&&this._components.has(e)){const n=this._components.get(e);n&&"function"==typeof n.setOptions&&n.setOptions(t.options)}return t.initial&&this.applyProperties(i,t.initial),t.events&&this.updateEvents(e,t.events),s},config(e){if(!e){const e={};return this._configs.forEach((t,n)=>{e[n]=t}),e}return this._configs.get(e)||null},getComponent(e){return e?this._components.get(e)||null:new Map(this._components)},reset(e){if(!e){return void Array.from(this._configs.keys()).forEach(e=>this.reset(e))}const t=this._components.get(e);t&&"function"==typeof t.destroy&&t.destroy(),this._components.delete(e),this.unbindEvents(e),this._configs.delete(e)},initComponent(e,t,n){const s={card:di.card,modal:di.modal,tabs:di.tabs,accordion:di.accordion,tooltip:di.tooltip,carousel:di.carousel,dropdown:di.dropdown,contextMenu:di.contextMenu,sortable:di.sortable,skeleton:di.skeleton,avatar:di.avatar,avatarGroup:di.avatarGroup,inputGroup:di.inputGroup,popover:di.popover,badge:di.badge,numberBadge:di.numberBadge,listGroup:di.listGroup,cookieConsent:di.cookieConsent,backToTop:di.backToTop,buttonGroup:di.buttonGroup,loader:di.loader,breadcrumbs:di.breadcrumbs,navbar:di.navbar,sidebar:di.sidebar,footer:di.footer,notification:di.notification,timer:di.timer,alarm:di.alarm,autocomplete:di.autocomplete,pillbox:di.pillbox,signature:di.signature,form:gl.create,breathe:Sl.breathe,pulse:Sl.pulse,scribe:Sl.scribe}[t];if(s){if("form"===t){if(!n.schema)return console.error("Forms component requires a schema option"),null;const t=s(n.schema,n.data||{},n);return t.renderTo(e),t}return s.call(di,e,n)}console.warn(`Unknown component type: ${t}`)},applyProperties(e,t){Object.keys(t).forEach(n=>{"css"===n?e.css(t[n]):"text"===n?e.text(t[n]):"html"===n?e.html(t[n]):"addClass"===n?e.addClass(t[n]):"removeClass"===n?e.removeClass(t[n]):"toggleClass"===n?e.toggleClass(t[n]):"attr"===n&&Object.keys(t[n]).forEach(s=>{e.attr(s,t[n][s])})})},bindEvents(e,t,n=!1){const s=_(e);n&&!this._eventHandlers.has(e)&&this._eventHandlers.set(e,new Map),Object.keys(t).forEach(i=>{const o=t[i],r=e=>this.executeActions(e,o);s.on(i,r),n&&this._eventHandlers.get(e).set(i,r)})},unbindEvents(e){const t=this._eventHandlers.get(e);if(!t)return;const n=_(e);t.forEach((e,t)=>{n.off(t,e)}),this._eventHandlers.delete(e)},updateEvents(e,t){const n=this._eventHandlers.get(e),s=_(e);n&&Object.keys(t).forEach(e=>{n.has(e)&&(s.off(e,n.get(e)),n.delete(e))}),this.bindEvents(e,t,!0)},executeActions(e,t){if("function"==typeof t)return void t.call(e.target,e,_(e.target));const n=Array.isArray(t)?t:[t],s=_(e.target);n.forEach(t=>{if("function"==typeof t)return void t.call(e.target,e,s);const n=t.target?_(t.target):s;t.css&&n.css(t.css),t.text&&n.text(t.text),t.html&&n.html(t.html),t.addClass&&n.addClass(t.addClass),t.removeClass&&n.removeClass(t.removeClass),t.toggleClass&&n.toggleClass(t.toggleClass),t.log&&console.log(t.log)})},ready(e){"function"==typeof e?this._domReady||"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,e()},{once:!0}):console.warn("ready() requires a function")}},zl=1e3,Tl=6e4,Bl=36e5,jl=864e5,Ol=6048e5,Dl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Nl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Il=["January","February","March","April","May","June","July","August","September","October","November","December"],Hl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];class Wl{constructor(e){e instanceof Wl?this._date=new Date(e._date):e instanceof Date?this._date=new Date(e):this._date="string"==typeof e||"number"==typeof e?new Date(e):null==e?new Date:new Date(e)}add(e,t){const n=this._normalizeUnit(t),s=this._date;return"years"===n?s.setFullYear(s.getFullYear()+e):"months"===n?s.setMonth(s.getMonth()+e):"weeks"===n?s.setDate(s.getDate()+7*e):"days"===n?s.setDate(s.getDate()+e):"hours"===n?s.setHours(s.getHours()+e):"minutes"===n?s.setMinutes(s.getMinutes()+e):"seconds"===n?s.setSeconds(s.getSeconds()+e):"milliseconds"===n&&s.setMilliseconds(s.getMilliseconds()+e),this}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(0,1),n.setHours(0,0,0,0)):"months"===t||"month"===t?(n.setDate(1),n.setHours(0,0,0,0)):"weeks"===t||"week"===t?(n.setDate(n.getDate()-n.getDay()),n.setHours(0,0,0,0)):"days"===t||"day"===t?n.setHours(0,0,0,0):"hours"===t||"hour"===t?n.setMinutes(0,0,0):"minutes"===t||"minute"===t?n.setSeconds(0,0):"seconds"!==t&&"second"!==t||n.setMilliseconds(0),this}endOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(11,31),n.setHours(23,59,59,999)):"months"===t||"month"===t?(n.setMonth(n.getMonth()+1,0),n.setHours(23,59,59,999)):"weeks"===t||"week"===t?(n.setDate(n.getDate()+(6-n.getDay())),n.setHours(23,59,59,999)):"days"===t||"day"===t?n.setHours(23,59,59,999):"hours"===t||"hour"===t?n.setMinutes(59,59,999):"minutes"===t||"minute"===t?n.setSeconds(59,999):"seconds"!==t&&"second"!==t||n.setMilliseconds(999),this}set(e,t){const n=this._normalizeUnit(e),s=this._date;return"years"===n||"year"===n?s.setFullYear(t):"months"===n||"month"===n?s.setMonth(t):"days"===n||"day"===n||"date"===n?s.setDate(t):"hours"===n||"hour"===n?s.setHours(t):"minutes"===n||"minute"===n?s.setMinutes(t):"seconds"===n||"second"===n?s.setSeconds(t):"milliseconds"!==n&&"millisecond"!==n||s.setMilliseconds(t),this}get(e){if(!e)return this._date;const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?n.getFullYear():"months"===t||"month"===t?n.getMonth():"days"===t||"day"===t?n.getDay():"date"===t?n.getDate():"hours"===t||"hour"===t?n.getHours():"minutes"===t||"minute"===t?n.getMinutes():"seconds"===t||"second"===t?n.getSeconds():"milliseconds"===t||"millisecond"===t?n.getMilliseconds():this._date}year(){return this._date.getFullYear()}month(){return this._date.getMonth()}date(){return this._date.getDate()}day(){return this._date.getDay()}hour(){return this._date.getHours()}minute(){return this._date.getMinutes()}second(){return this._date.getSeconds()}millisecond(){return this._date.getMilliseconds()}dayOfYear(){const e=new Date(this._date.getFullYear(),0,0),t=this._date-e;return Math.floor(t/864e5)}week(){const e=new Date(this._date.getFullYear(),0,1),t=this._date-e;return Math.ceil(t/6048e5+e.getDay()/7)}quarter(){return Math.floor(this._date.getMonth()/3)+1}unix(){return Math.floor(this._date.getTime()/1e3)}valueOf(){return this._date.getTime()}format(e="YYYY-MM-DD HH:mm:ss"){const t=this._date,n=t.getFullYear(),s=t.getMonth(),i=t.getDate(),o=t.getDay(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),c=t.getMilliseconds(),h=r%12||12,d=(e,t=2)=>String(e).padStart(t,"0"),u={YYYY:n,YY:String(n).slice(-2),MMMM:Il[s],MMM:Hl[s],MM:d(s+1),M:s+1,dddd:Dl[o],ddd:Nl[o],DD:d(i),D:i,HH:d(r),H:r,hh:d(h),h:h,mm:d(a),m:a,ss:d(l),s:l,SSS:d(c,3),A:r<12?"AM":"PM",a:r<12?"am":"pm"},p=Object.keys(u).sort((e,t)=>t.length-e.length),m=new RegExp(p.join("|"),"g");return e.replace(m,e=>u[e])}toISOString(){return this._date.toISOString()}toDate(){return new Date(this._date)}toString(){return this._date.toString()}fromNow(e){const t=e?new Wl(e)._date:new Date,n=this._date.getTime()-t.getTime(),s=Math.abs(n),i=n<0;let o,r;return s<Tl?"just now":(s<Bl?(o=Math.floor(s/Tl),r=1===o?"minute":"minutes"):s<jl?(o=Math.floor(s/Bl),r=1===o?"hour":"hours"):s<Ol?(o=Math.floor(s/jl),r=1===o?"day":"days"):s<30*jl?(o=Math.floor(s/Ol),r=1===o?"week":"weeks"):s<365*jl?(o=Math.floor(s/(30*jl)),r=1===o?"month":"months"):(o=Math.floor(s/(365*jl)),r=1===o?"year":"years"),i?`${o} ${r} ago`:`in ${o} ${r}`)}to(e){const t=new Wl(e)._date.getTime()-this._date.getTime(),n=Math.abs(t),s=t>0;let i,o;return n<Tl?"just now":(n<Bl?(i=Math.floor(n/Tl),o=1===i?"minute":"minutes"):n<jl?(i=Math.floor(n/Bl),o=1===i?"hour":"hours"):n<Ol?(i=Math.floor(n/jl),o=1===i?"day":"days"):n<30*jl?(i=Math.floor(n/Ol),o=1===i?"week":"weeks"):n<365*jl?(i=Math.floor(n/(30*jl)),o=1===i?"month":"months"):(i=Math.floor(n/(365*jl)),o=1===i?"year":"years"),s?`in ${i} ${o}`:`${i} ${o} ago`)}isBefore(e,t){const n=new Wl(e);return t?this.clone().endOf(t).valueOf()<n.clone().startOf(t).valueOf():this._date.getTime()<n._date.getTime()}isAfter(e,t){const n=new Wl(e);return t?this.clone().startOf(t).valueOf()>n.clone().endOf(t).valueOf():this._date.getTime()>n._date.getTime()}isSame(e,t){const n=new Wl(e);if(!t)return this._date.getTime()===n._date.getTime();const s=this.clone().startOf(t).valueOf(),i=this.clone().endOf(t).valueOf(),o=n.valueOf();return o>=s&&o<=i}isBetween(e,t,n,s="()"){const i=new Wl(e),o=new Wl(t);let r,a,l;n?(r=i.clone().startOf(n).valueOf(),a=o.clone().endOf(n).valueOf(),l=this.clone().startOf(n).valueOf()):(r=i.valueOf(),a=o.valueOf(),l=this.valueOf());const c="["===s[0],h="]"===s[1];return(c?l>=r:l>r)&&(h?l<=a:l<a)}diff(e,t="milliseconds",n=!1){const s=new Wl(e),i=this._date.getTime()-s._date.getTime(),o=this._normalizeUnit(t);let r;return r="milliseconds"===o?i:"seconds"===o?i/zl:"minutes"===o?i/Tl:"hours"===o?i/Bl:"days"===o?i/jl:"weeks"===o?i/Ol:"months"===o?this._monthDiff(s):"years"===o?this._monthDiff(s)/12:i,n?r:Math.floor(r)}_monthDiff(e){const t=this._date,n=e._date;return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())}isValid(){return!isNaN(this._date.getTime())}isLeapYear(){const e=this._date.getFullYear();return e%4==0&&e%100!=0||e%400==0}daysInMonth(){return new Date(this._date.getFullYear(),this._date.getMonth()+1,0).getDate()}clone(){return new Wl(this._date)}_normalizeUnit(e){if(!e)return e;const t=String(e).toLowerCase().trim();return"year"===t?"years":"month"===t?"months":"week"===t?"weeks":"day"===t?"days":"hour"===t?"hours":"minute"===t?"minutes":"second"===t?"seconds":"millisecond"===t?"milliseconds":t}}const Pl=function(e){return new Wl(e)};Object.assign(Pl,{now:()=>Date.now(),parse(e,t){if(!t)return new Wl(e);const n={YYYY:{regex:"(\\d{4})",setter:"year"},YY:{regex:"(\\d{2})",setter:"year",transform:e=>2e3+parseInt(e)},MM:{regex:"(\\d{2})",setter:"month",transform:e=>parseInt(e)-1},M:{regex:"(\\d{1,2})",setter:"month",transform:e=>parseInt(e)-1},DD:{regex:"(\\d{2})",setter:"date"},D:{regex:"(\\d{1,2})",setter:"date"},HH:{regex:"(\\d{2})",setter:"hour"},H:{regex:"(\\d{1,2})",setter:"hour"},mm:{regex:"(\\d{2})",setter:"minute"},m:{regex:"(\\d{1,2})",setter:"minute"},ss:{regex:"(\\d{2})",setter:"second"},s:{regex:"(\\d{1,2})",setter:"second"}};let s=t;const i=[],o=Object.keys(n).sort((e,t)=>t.length-e.length);for(const e of o)if(t.includes(e)){-1!==s.indexOf(e)&&(s=s.replace(e,n[e].regex),i.push({token:e,...n[e]}))}s=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,e=>"("===e||")"===e?e:"\\"+e);try{const t=new RegExp("^"+s+"$"),n=e.match(t);if(!n)return new Wl(NaN);const o=new Wl;o.set("hour",0).set("minute",0).set("second",0).set("millisecond",0);for(let e=0;e<i.length;e++){let t=parseInt(n[e+1]);i[e].transform&&(t=i[e].transform(n[e+1])),o.set(i[e].setter,t)}return o}catch(e){return new Wl(NaN)}},isValid:e=>new Wl(e).isValid(),min(...e){const t=e.flat().map(e=>new Wl(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()<n.valueOf()&&(n=t[e]);return n},max(...e){const t=e.flat().map(e=>new Wl(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()>n.valueOf()&&(n=t[e]);return n},tokens:{YYYY:"Full year (2025)",YY:"Short year (25)",MM:"Month 01-12",M:"Month 1-12",DD:"Day 01-31",D:"Day 1-31",HH:"Hour 00-23",H:"Hour 0-23",hh:"Hour 01-12",h:"Hour 1-12",mm:"Minute 00-59",m:"Minute 0-59",ss:"Second 00-59",s:"Second 0-59",SSS:"Milliseconds",A:"AM/PM",a:"am/pm",ddd:"Day name short (Mon)",dddd:"Day name full (Monday)",MMM:"Month name short (Jan)",MMMM:"Month name full (January)"}});const Fl={"arrow-up":{viewBox:"0 0 24 24",path:"M12 19V5M5 12l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down":{viewBox:"0 0 24 24",path:"M12 5v14M19 12l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-left":{viewBox:"0 0 24 24",path:"M19 12H5M12 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-right":{viewBox:"0 0 24 24",path:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-left":{viewBox:"0 0 24 24",path:"M17 17L7 7M7 17V7h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-right":{viewBox:"0 0 24 24",path:"M7 17L17 7M7 7h10v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-left":{viewBox:"0 0 24 24",path:"M17 7L7 17M17 17H7V7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-right":{viewBox:"0 0 24 24",path:"M7 7l10 10M17 7v10H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},menu:{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h18","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"menu-alt":{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h12","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"dots-horizontal":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},"dots-vertical":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},grid:{viewBox:"0 0 24 24",path:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},list:{viewBox:"0 0 24 24",paths:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},columns:{viewBox:"0 0 24 24",path:"M12 3v18M3 3h18v18H3V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zM9 21V9m12-6H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},close:{viewBox:"0 0 24 24",path:"M18 6L6 18M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plus:{viewBox:"0 0 24 24",path:"M12 5v14M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minus:{viewBox:"0 0 24 24",path:"M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},search:{viewBox:"0 0 24 24",path:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},refresh:{viewBox:"0 0 24 24",path:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},edit:{viewBox:"0 0 24 24",path:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-2":{viewBox:"0 0 24 24",path:"M17 3a2.85 2.85 0 114 4L7.5 20.5 2 22l1.5-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-3":{viewBox:"0 0 24 24",path:"M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trash:{viewBox:"0 0 24 24",path:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filter:{viewBox:"0 0 24 24",path:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sort:{viewBox:"0 0 24 24",paths:["M3 6h7","M3 12h5","M3 18h3","M16 6l4 4-4 4","M20 10H10"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},user:{viewBox:"0 0 24 24",path:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},users:{viewBox:"0 0 24 24",path:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},settings:{viewBox:"0 0 24 24",path:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM15 12a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cog:{viewBox:"0 0 24 24",path:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tool:{viewBox:"0 0 24 24",path:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eye:{viewBox:"0 0 24 24",path:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-off":{viewBox:"0 0 24 24",path:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lock:{viewBox:"0 0 24 24",path:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlock:{viewBox:"0 0 24 24",path:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clock:{viewBox:"0 0 24 24",path:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calendar:{viewBox:"0 0 24 24",path:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},star:{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-filled":{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",fill:"currentColor"},sun:{viewBox:"0 0 24 24",path:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},globe:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},map:{viewBox:"0 0 24 24",path:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pin:{viewBox:"0 0 24 24",path:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},feather:{viewBox:"0 0 24 24",path:"M20.24 12.24a6 6 0 00-8.49-8.49L5 10.5V19h8.5zM16 8L2 22M17.5 15H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},palette:{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c.93 0 1.68-.75 1.68-1.68 0-.43-.16-.84-.44-1.13-.27-.29-.43-.7-.43-1.13 0-.93.76-1.69 1.69-1.69h1.98c3.03 0 5.52-2.49 5.52-5.52C22 6.48 17.52 2 12 2zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z",fill:"currentColor"},type:{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},square:{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mouse-pointer":{viewBox:"0 0 24 24",path:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z M13 13l6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"refresh-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sync:{viewBox:"0 0 24 24",path:"M1 4v6h6m16 10v-6h-6M2 20l6-6M22 4l-6 6M9 12l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gauge:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 0110 10c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z M8 12l4 4 4-4M12 16V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"map-pin":{viewBox:"0 0 24 24",path:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"help-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sliders:{viewBox:"0 0 24 24",path:"M4 21v-7m0-4V3m8 18v-9m0-4V3m8 18v-5m0-4V3M1 14h6m2-6h6m2 8h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-check":{viewBox:"0 0 24 24",path:"M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2m16-13l2 2 4-4M13 7a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},component:{viewBox:"0 0 24 24",path:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16zM3.27 6.96L12 12.01l8.73-5.05M12 22.08V12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 9.8a19.79 19.79 0 01-3.07-8.64A2 2 0 012 .18h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 14v2.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mail:{viewBox:"0 0 24 24",path:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z M22 6l-10 7L2 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2z M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},building:{viewBox:"0 0 24 24",path:"M3 21h18 M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16 M9 9h2 M9 13h2 M9 17h2 M13 9h2 M13 13h2 M13 17h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-2":{viewBox:"0 0 24 24",path:"M15 7h3a5 5 0 015 5 5 5 0 01-5 5h-3m-6 0H6a5 5 0 01-5-5 5 5 0 015-5h3 M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 11-8 0 4 4 0 018 0z M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cake:{viewBox:"0 0 24 24",path:"M20 21H4a2 2 0 01-2-2v-4a2 2 0 012-2h16a2 2 0 012 2v4a2 2 0 01-2 2z M8 13V9 M12 13V9 M16 13V9 M8 9a1 1 0 010-2 1 1 0 010 2z M12 9a1 1 0 010-2 1 1 0 010 2z M16 9a1 1 0 010-2 1 1 0 010 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sidebar:{viewBox:"0 0 24 24",path:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z M9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},window:{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2z M2 9h20 M5.5 6.5h.01 M8 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Rl={mail:{viewBox:"0 0 24 24",path:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mail-open":{viewBox:"0 0 24 24",path:"M3 19V9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2z M3 9l9 6 9-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},inbox:{viewBox:"0 0 24 24",path:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},send:{viewBox:"0 0 24 24",path:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-incoming":{viewBox:"0 0 24 24",path:"M14.5 2v6m0 0h6m-6 0l7-7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-outgoing":{viewBox:"0 0 24 24",path:"M21.5 2h-6m6 0v6m0-6l-7 7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M16.5 10.5l5.5-5.5M22 5l-5.5 5.5M10.68 13.31a16 16 0 003.41 2.6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7 2 2 0 011.72 2v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},chat:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chat-alt":{viewBox:"0 0 24 24",path:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-circle":{viewBox:"0 0 24 24",path:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-square":{viewBox:"0 0 24 24",path:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bell:{viewBox:"0 0 24 24",path:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bell-off":{viewBox:"0 0 24 24",path:"M13.73 21a2 2 0 01-3.46 0M18.63 13A17.89 17.89 0 0118 8M6.26 6.26A5.86 5.86 0 006 8c0 7-3 9-3 9h14M18 8a6 6 0 00-9.33-5M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},notification:{viewBox:"0 0 24 24",path:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z",fill:"currentColor"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},paperclip:{viewBox:"0 0 24 24",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rss:{viewBox:"0 0 24 24",path:"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0116 16M5 20a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wifi:{viewBox:"0 0 24 24",path:"M12 20h.01M2 8.82a15 15 0 0120 0M5 12.859a10 10 0 0114 0M8.5 16.429a5 5 0 017 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"wifi-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0119 12.55M5 12.55a10.94 10.94 0 015.17-2.39m3.64.46a10.88 10.88 0 012.69 1.92M8.5 16.429a5 5 0 013.5-1.43M12 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Vl={play:{viewBox:"0 0 24 24",path:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-filled":{viewBox:"0 0 24 24",path:"M5 3l14 9-14 9V3z",fill:"currentColor"},pause:{viewBox:"0 0 24 24",path:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pause-filled":{viewBox:"0 0 24 24",paths:["M6 4h4v16H6z","M14 4h4v16h-4z"],fill:"currentColor"},stop:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"stop-filled":{viewBox:"0 0 24 24",path:"M6 6h12v12H6z",fill:"currentColor"},"skip-back":{viewBox:"0 0 24 24",path:"M19 20L9 12l10-8v16zM5 19V5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"skip-forward":{viewBox:"0 0 24 24",path:"M5 4l10 8-10 8V4zM19 5v14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rewind:{viewBox:"0 0 24 24",path:"M11 19l-7-7 7-7m8 14l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"fast-forward":{viewBox:"0 0 24 24",path:"M13 5l7 7-7 7M5 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volume:{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-up":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-down":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-mute":{viewBox:"0 0 24 24",path:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-off":{viewBox:"0 0 24 24",path:"M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"camera-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M21 21H3a2 2 0 01-2-2V8a2 2 0 012-2h3m3-3h6l2 3h4a2 2 0 012 2v9.34m-7.72-2.06a4 4 0 11-5.56-5.56",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},video:{viewBox:"0 0 24 24",path:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"video-off":{viewBox:"0 0 24 24",path:"M16 16v1a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h2m5.66 0H14a2 2 0 012 2v3.34l1 1L23 7v10M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},image:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},images:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z M9 3h12a2 2 0 012 2v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},music:{viewBox:"0 0 24 24",path:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mic:{viewBox:"0 0 24 24",path:"M19 10v2a7 7 0 01-14 0v-2m7 9v4m-4 0h8m-4-13a3 3 0 00-3 3v4a3 3 0 006 0v-4a3 3 0 00-3-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mic-off":{viewBox:"0 0 24 24",path:"M1 1l22 22m-2-2a10 10 0 01-11 2.955M12 19v4m-4 0h8M9 9v3a3 3 0 005.12 2.12M15 9.34V4a3 3 0 00-5.94-.6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0118 0v6M21 19a2 2 0 01-2 2h-1a2 2 0 01-2-2v-3a2 2 0 012-2h3zM3 19a2 2 0 002 2h1a2 2 0 002-2v-3a2 2 0 00-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},radio:{viewBox:"0 0 24 24",path:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0 M16.24 7.76a6 6 0 010 8.49m-8.48-.01a6 6 0 010-8.49m11.31-2.82a10 10 0 010 14.14m-14.14 0a10 10 0 010-14.14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},film:{viewBox:"0 0 24 24",path:"M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM17 3l-5 4-5-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cast:{viewBox:"0 0 24 24",path:"M2 16.1A5 5 0 015.9 20M2 12.05A9 9 0 019.95 20M2 8V6a2 2 0 012-2h16a2 2 0 012 2v12a2 2 0 01-2 2h-6M2 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximise:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimise:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximize:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimize:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximise-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimise-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximize-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimize-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scissors:{viewBox:"0 0 24 24",path:"M6 9a3 3 0 100-6 3 3 0 000 6zM6 21a3 3 0 100-6 3 3 0 000 6zM20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M10 8l6 4-6 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ql={document:{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-text":{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z M14 2v6h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-remove":{viewBox:"0 0 24 24",path:"M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m2 11H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},folder:{viewBox:"0 0 24 24",path:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-open":{viewBox:"0 0 24 24",path:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h6a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-remove":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},download:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},upload:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-download":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-upload":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M8 19c-3.314 0-6-2.462-6-5.5S4.686 8 8 8c.642-2.87 3.251-5 6.375-5C18.086 3 21 5.91 21 9.5a6.458 6.458 0 01-.705 2.945A4.5 4.5 0 0119 21H8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},attachment:{viewBox:"0 0 24 24",path:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},copy:{viewBox:"0 0 24 24",path:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clipboard:{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-check":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-list":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},save:{viewBox:"0 0 24 24",path:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},archive:{viewBox:"0 0 24 24",path:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-code":{viewBox:"0 0 24 24",path:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-zip":{viewBox:"0 0 24 24",path:"M17 21H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2zM10 3v4h1V3h-1zm1 4h-1v2h1V7zm-1 2v2h1V9h-1zm1 2h-1v2h1v-2zm-1 2v2h1v-2h-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},server:{viewBox:"0 0 24 24",path:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-text":{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zM14 2v6h6M16 13H8M16 17H8M10 9H8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},book:{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-open":{viewBox:"0 0 24 24",path:"M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2V3zM22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-closed":{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-plus":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-minus":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ul={share:{viewBox:"0 0 24 24",path:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"share-alt":{viewBox:"0 0 24 24",path:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",fill:"currentColor"},bookmark:{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bookmark-filled":{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",fill:"currentColor"},"thumb-up":{viewBox:"0 0 24 24",path:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thumb-down":{viewBox:"0 0 24 24",path:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},comment:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-add":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-plus":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-remove":{viewBox:"0 0 24 24",path:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-group":{viewBox:"0 0 24 24",path:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-happy":{viewBox:"0 0 24 24",path:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-sad":{viewBox:"0 0 24 24",path:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},flag:{viewBox:"0 0 24 24",path:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M12 15V17M8 21H16M8 3H16V9C16 11.2091 14.2091 13 12 13C9.79086 13 8 11.2091 8 9V3ZM16 5H18C19.1046 5 20 5.89543 20 7V8C20 9.10457 19.1046 10 18 10H16M8 5H6C4.89543 5 4 5.89543 4 7V8C4 9.10457 4.89543 10 6 10H8M12 17V21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",path:"M12 8V21M12 8H8.464C7.103 8 6 6.897 6 5.536C6 4.175 7.103 3 8.464 3C10.059 3 11.162 4.162 12 5.536M12 8H15.536C16.897 8 18 6.897 18 5.536C18 4.175 16.897 3 15.536 3C13.941 3 12.838 4.162 12 5.536M20 12V21H4V12M3 8H21V12H3V8Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sparkles:{viewBox:"0 0 24 24",path:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fire:{viewBox:"0 0 24 24",path:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z M9.879 16.121A3 3 0 1012.015 11L11 14H9c0 .768.293 1.536.879 2.121z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},github:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"},twitter:{viewBox:"0 0 24 24",path:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",fill:"currentColor"},linkedin:{viewBox:"0 0 24 24",path:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",fill:"currentColor"},youtube:{viewBox:"0 0 24 24",path:"M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",fill:"currentColor"},"share-2":{viewBox:"0 0 24 24",path:"M18 8a3 3 0 100-6 3 3 0 000 6zM6 15a3 3 0 100-6 3 3 0 000 6zM18 22a3 3 0 100-6 3 3 0 000 6zM8.59 13.51l6.83 3.98M15.41 6.51l-6.82 3.98",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},facebook:{viewBox:"0 0 24 24",path:"M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},instagram:{viewBox:"0 0 24 24",path:"M2 7a5 5 0 015-5h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5zM16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zM17.5 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Kl={cart:{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cart-add":{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0zm6-8v-2m0 0V7m0 2h2m-2 0H11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-bag":{viewBox:"0 0 24 24",path:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M3 3h18v4H3V3zM3 7v12a2 2 0 002 2h14a2 2 0 002-2V7M3 11h18M12 7v14M8 11v10M16 11v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2m-5-3h9m0 0l-3-3m3 3l-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cash:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-dollar":{viewBox:"0 0 24 24",path:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-pound":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h6a3 3 0 003-3M9 12h6M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-euro":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h3a3 3 0 003-3M7 10h5m-5 4h5M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tag:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tags:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z M17 17l4.414-4.414a2 2 0 000-2.828L14 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M9 14l6 0M9 10l6 0M9 18l3 0M5 21l1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2V3l-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2v18z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barcode:{viewBox:"0 0 24 24",path:"M5 7v10M8 7v10M11 7v10M14 7v10M19 7v10M17 7v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},qrcode:{viewBox:"0 0 24 24",path:"M3 3h6v6H3V3zM15 3h6v6h-6V3zM3 15h6v6H3v-6zM15 15h2v2h-2v-2zM19 15h2v2h-2v-2zM15 19h2v2h-2v-2zM19 19h2v2h-2v-2zM5 5h2v2H5V5zM17 5h2v2h-2V5zM5 17h2v2H5v-2zM12 3h1v4h-1V3zM12 9h1v3h-1V9zM3 12h4v1H3v-1zM9 12h3v1H9v-1zM12 14h1v3h-1v-3zM12 19h1v2h-1v-2z",fill:"currentColor"},percent:{viewBox:"0 0 24 24",path:"M9 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM15 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM19 5L5 19",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},package:{viewBox:"0 0 24 24",path:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4M9 4l3 1.5L15 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},box:{viewBox:"0 0 24 24",path:"M12 3L2 8.5V15.5L12 21L22 15.5V8.5L12 3ZM12 12V21M12 12L2 7M12 12L22 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shipping:{viewBox:"0 0 24 24",path:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2M4 7V4h16v3M4 7h16M8 4v3M16 4v3M12 11v4m-2-2h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zM8 6h8v4H8V6zM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gem:{viewBox:"0 0 24 24",path:"M6 3h12l4 6-10 12L2 9l4-6z M11 3L8 9l4 12 4-12-3-6 M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-cart":{viewBox:"0 0 24 24",path:"M9 22a1 1 0 100-2 1 1 0 000 2z M20 22a1 1 0 100-2 1 1 0 000 2z M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Yl={check:{viewBox:"0 0 24 24",path:"M5 13l4 4L19 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"},"check-square":{viewBox:"0 0 24 24",path:"M9 11l3 3L22 4M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},x:{viewBox:"0 0 24 24",path:"M6 18L18 6M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",fill:"currentColor"},warning:{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"warning-filled":{viewBox:"0 0 24 24",path:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z",fill:"currentColor"},"alert-warning":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},info:{viewBox:"0 0 24 24",path:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"info-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z",fill:"currentColor"},question:{viewBox:"0 0 24 24",path:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},exclamation:{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-circle":{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ban:{viewBox:"0 0 24 24",path:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shield:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-x":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m5.618-6.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},spinner:{viewBox:"0 0 24 24",path:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-5.364l-2.828 2.828M9.464 14.536l-2.828 2.828m11.728 0l-2.828-2.828M9.464 9.464L6.636 6.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},loading:{viewBox:"0 0 24 24",path:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},loader:{viewBox:"0 0 24 24",path:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},circle:{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"circle-filled":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",fill:"currentColor"},dot:{viewBox:"0 0 24 24",path:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",fill:"currentColor"},badge:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zap:{viewBox:"0 0 24 24",path:"M13 10V3L4 14h7v7l9-11h-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18M17 6h6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6M17 18h6v-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},key:{viewBox:"0 0 24 24",path:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-alert":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-triangle":{viewBox:"0 0 24 24",path:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z M12 9v4 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Gl={"chevron-up":{viewBox:"0 0 24 24",path:"M5 15l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-down":{viewBox:"0 0 24 24",path:"M19 9l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-left":{viewBox:"0 0 24 24",path:"M15 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-right":{viewBox:"0 0 24 24",path:"M9 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-up":{viewBox:"0 0 24 24",path:"M17 11l-5-5-5 5M17 18l-5-5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-down":{viewBox:"0 0 24 24",path:"M7 13l5 5 5-5M7 6l5 5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-left":{viewBox:"0 0 24 24",path:"M11 17l-5-5 5-5M18 17l-5-5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-right":{viewBox:"0 0 24 24",path:"M13 7l5 5-5 5M6 7l5 5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"external-link":{viewBox:"0 0 24 24",path:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},link:{viewBox:"0 0 24 24",path:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlink:{viewBox:"0 0 24 24",path:"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 00-.12-7.07 5.006 5.006 0 00-6.95 0l-1.72 1.71M5.17 11.75l-1.71 1.71a5.004 5.004 0 00.12 7.07 5.006 5.006 0 006.95 0l1.71-1.71M8 2v3M2 8h3M16 22v-3M22 16h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-left":{viewBox:"0 0 24 24",path:"M9 14L4 9l5-5M20 20v-7a4 4 0 00-4-4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-right":{viewBox:"0 0 24 24",path:"M15 14l5-5-5-5M4 20v-7a4 4 0 014-4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-left":{viewBox:"0 0 24 24",path:"M9 10L4 15l5 5M20 4v7a4 4 0 01-4 4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-right":{viewBox:"0 0 24 24",path:"M15 10l5 5-5 5M4 4v7a4 4 0 004 4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-ccw":{viewBox:"0 0 24 24",path:"M1 4v6h6M23 20v-6h-6M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M3 13l4.64-4.36A9 9 0 0121 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M21 13l-4.64-4.36A9 9 0 003 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},move:{viewBox:"0 0 24 24",path:"M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"grip-vertical":{viewBox:"0 0 24 24",paths:["M9 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},"grip-horizontal":{viewBox:"0 0 24 24",paths:["M5 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M5 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},expand:{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shrink:{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-in":{viewBox:"0 0 24 24",path:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-out":{viewBox:"0 0 24 24",path:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-left":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM9 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-right":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM15 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-left":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-right":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM15 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-top":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 9h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-bottom":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 15h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layers:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM2 9h20M9 20V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hash:{viewBox:"0 0 24 24",path:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"more-horizontal":{viewBox:"0 0 24 24",path:"M12 12h.01M8 12h.01M16 12h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"},"more-vertical":{viewBox:"0 0 24 24",path:"M12 12h.01M12 8h.01M12 16h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}},Jl={tree:{viewBox:"0 0 24 24",path:"M12 2l2 4h-1l2 4h-1.5l2.5 5h-2l3 6H7l3-6H8l2.5-5H9l2-4h-1l2-4zm-1 19h2v3h-2v-3z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"star-decoration":{viewBox:"0 0 24 24",path:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",paths:["M12 2v20M2 12h20","M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07","M12 6l-2 2 2 2 2-2-2-2zM12 14l-2 2 2 2 2-2-2-2z","M6 12l2-2-2-2-2 2 2 2zM14 12l2 2 2-2-2-2-2 2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",paths:["M20 12v10H4V12","M22 7H2v5h20V7z","M12 22V7","M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z","M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"candy-cane":{viewBox:"0 0 24 24",path:"M14.5 3a4.5 4.5 0 0 0-4.5 4.5v13a.5.5 0 0 0 1 0V7.5a3.5 3.5 0 1 1 7 0v1a2.5 2.5 0 0 1-5 0v-.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bauble:{viewBox:"0 0 24 24",paths:["M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M12 6V3","M9 3h6","M12 6a1 1 0 0 0 1-1V4a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},bells:{viewBox:"0 0 24 24",paths:["M9 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M15 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M7 8L5 4M17 8l2-4M9 8V5M15 8V5","M11 5h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},holly:{viewBox:"0 0 24 24",paths:["M8 4c-2 2-3 5-1 8 1 2 3 3 5 3s4-1 5-3c2-3 1-6-1-8","M16 4c2 2 3 5 1 8-1 2-3 3-5 3s-4-1-5-3c-2-3-1-6 1-8","M10 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M14 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M12 19a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowman:{viewBox:"0 0 24 24",paths:["M12 22a5 5 0 1 0 0-10 5 5 0 0 0 0 10z","M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M9 9h.01M15 9h.01","M10 10.5s.5 1 2 1 2-1 2-1","M7 2l3 3M17 2l-3 3M12 2v3","M5 15h2M17 15h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},reindeer:{viewBox:"0 0 24 24",paths:["M12 22c-3 0-5-2-5-5 0-2 1-4 3-5l2-1 2 1c2 1 3 3 3 5 0 3-2 5-5 5z","M7 12c-2-1-3-3-3-5 0-1 .5-2 1-2s1 .5 1.5 1c.5.5 1 1.5 1.5 2","M17 12c2-1 3-3 3-5 0-1-.5-2-1-2s-1 .5-1.5 1c-.5.5-1 1.5-1.5 2","M4 5l1 2M3 7l2 1M20 5l-1 2M21 7l-2 1","M10 17h.01M14 17h.01","M12 19a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},sleigh:{viewBox:"0 0 24 24",paths:["M4 15h14c1 0 2 1 2 2v1H4v-3z","M6 15V8c0-1 1-2 2-2h8c1 0 2 1 2 2v7","M2 20c0-1 2-2 4-2h12c2 0 4 1 4 2","M3 18h1M20 18h1"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},wreath:{viewBox:"0 0 24 24",paths:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 2v2M12 20v2M2 12h2M20 12h2","M10 3l1 2M13 3l-1 2","M10 3h4"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"party-popper":{viewBox:"0 0 24 24",paths:["M5.8 11.3 2 22l10.7-3.79","M4 3h.01","M22 8h.01","M15 2h.01","M22 20h.01","M22 2 19.79 7.3 16 8l3.79.79L22 14","M9.6 14.4 14 10","M22 13c-1.93 1.93-5.07 1.93-7 0","M11 8c1.93-1.93 1.93-5.07 0-7","M2 13c1.93 1.93 5.07 1.93 7 0"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}},Xl={sun:{viewBox:"0 0 24 24",path:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunrise:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 2v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M8 6l4-4 4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunset:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 9v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M16 5l-4 4-4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-sun":{viewBox:"0 0 24 24",path:"M12 2v2M4.93 4.93l1.41 1.41M2 12h2M19 12a4 4 0 0 0-4-4h-.35A5.5 5.5 0 0 0 4 11a5 5 0 0 0 0 10h11a4 4 0 0 0 4-5v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-off":{viewBox:"0 0 24 24",path:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rain:{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-rain":{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-drizzle":{viewBox:"0 0 24 24",path:"M8 19v2M8 13v2M16 19v2M16 13v2M12 21v2M12 15v2M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snow:{viewBox:"0 0 24 24",path:"M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25M8 16h.01M8 20h.01M12 18h.01M12 22h.01M16 16h.01M16 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",path:"M12 2v20M17.66 7l-11.32 10M20.54 12H3.46M17.66 17L6.34 7M12 2l3 3M12 2l-3 3M12 22l3-3M12 22l-3-3M2 12l3 3M2 12l3-3M22 12l-3 3M22 12l-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wind:{viewBox:"0 0 24 24",path:"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-lightning":{viewBox:"0 0 24 24",path:"M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9M13 11l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lightning:{viewBox:"0 0 24 24",path:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fog:{viewBox:"0 0 24 24",path:"M20 15h2M2 15h8M6 19h14M4 11h16M8 7h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},haze:{viewBox:"0 0 24 24",path:"M12 3v1M12 20v1M3 12h1M20 12h1M5.6 5.6l.7.7M17.7 17.7l.7.7M5.6 18.4l.7-.7M17.7 6.3l.7-.7M8 12a4 4 0 1 0 8 0 4 4 0 0 0-8 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thermometer:{viewBox:"0 0 24 24",path:"M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-sun":{viewBox:"0 0 24 24",path:"M12 9a4 4 0 0 0-2 7.5M12 3v2M5.6 5.6l1.4 1.4M3 12h2M5.6 18.4l1.4-1.4M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 10V3M16 14.76V8a2 2 0 0 0-4 0v6.76",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"moon-star":{viewBox:"0 0 24 24",path:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9zM19 3v4M17 5h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},umbrella:{viewBox:"0 0 24 24",path:"M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplet:{viewBox:"0 0 24 24",path:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplets:{viewBox:"0 0 24 24",path:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05zM12.56 14.94c1.47 0 2.67-1.25 2.67-2.77 0-.8-.38-1.55-1.14-2.18-.76-.64-1.17-1.32-1.38-2.29-.21.97-.62 1.65-1.38 2.29-.76.63-1.14 1.38-1.14 2.18 0 1.52 1.19 2.77 2.67 2.77zM19.5 17.35c1.1 0 2-.93 2-2.08 0-.6-.29-1.17-.86-1.64-.57-.48-.88-1-.57-1.73-.31.73-.62 1.25-1.19 1.73-.57.47-.86 1.04-.86 1.64 0 1.15.9 2.08 2 2.08z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rainbow:{viewBox:"0 0 24 24",path:"M22 17a10 10 0 0 0-20 0M18 17a6 6 0 0 0-12 0M14 17a2 2 0 0 0-4 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Zl={smartphone:{viewBox:"0 0 24 24",path:"M17 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-call":{viewBox:"0 0 24 24",path:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91M23 1L1 23",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tablet:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tablet-smartphone":{viewBox:"0 0 24 24",path:"M18 2H10a2 2 0 0 0-2 2v4M14 22h4a2 2 0 0 0 2-2V8M8 14H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM7 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laptop:{viewBox:"0 0 24 24",path:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0l1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monitor:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},desktop:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4M2 12h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM17 2l-5 5-5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tv-minimal":{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},watch:{viewBox:"0 0 24 24",path:"M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM12 9v3l1.5 1.5M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},smartwatch:{viewBox:"0 0 24 24",path:"M18 8a6 6 0 0 0-12 0v8a6 6 0 0 0 12 0V8zM12 11v3M18 6l1-3H5l1 3M18 18l1 3H5l1-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},speaker:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM12 6h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0 1 18 0v6M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airpods:{viewBox:"0 0 24 24",path:"M5.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 5.5 4zM18.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 18.5 4zM5.5 14v6M18.5 14v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},webcam:{viewBox:"0 0 24 24",path:"M12 14a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 14v8M8 22h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},keyboard:{viewBox:"0 0 24 24",path:"M20 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zM6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M8 17h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mouse:{viewBox:"0 0 24 24",path:"M6 3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3zM12 3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gamepad:{viewBox:"0 0 24 24",path:"M6 12h4M8 10v4M15 13h.01M18 11h.01M17.32 5H6.68a4 4 0 0 0-3.978 3.59l-.891 9a4 4 0 0 0 6.9 3.31l1.29-1.29 1.29 1.29a4 4 0 0 0 6.9-3.31l-.891-9A4 4 0 0 0 17.32 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joystick:{viewBox:"0 0 24 24",path:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2zM6 15v-2M12 15V5m0 0l4 4m-4-4L8 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 3.582 2 5.5v3C2 10.418 6.477 12 12 12s10-1.582 10-3.5v-3C22 3.582 17.523 2 12 2zM2 8.5v4C2 14.418 6.477 16 12 16s10-1.582 10-3.5v-4M2 12.5v4C2 18.418 6.477 20 12 20s10-1.582 10-3.5v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},usb:{viewBox:"0 0 24 24",path:"M16 4h2a2 2 0 0 1 2 2v1M6 4h2a2 2 0 0 1 2 2v1M10 16v-5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM20 16v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM12 12v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},router:{viewBox:"0 0 24 24",path:"M20 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM6 18h.01M12 7a5 5 0 0 0-5 5M19 7a5 5 0 0 0-5-5M12 7V2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},printer:{viewBox:"0 0 24 24",path:"M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 14h12v8H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cpu:{viewBox:"0 0 24 24",path:"M18 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},battery:{viewBox:"0 0 24 24",path:"M17 6H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM23 13v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"battery-charging":{viewBox:"0 0 24 24",path:"M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19M23 13v-2M11 6l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plug:{viewBox:"0 0 24 24",path:"M12 22v-5M9 8V2M15 8V2M18 8H6a2 2 0 0 0-2 2v1a8 8 0 0 0 16 0v-1a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ql={"chart-line":{viewBox:"0 0 24 24",path:"M3 3v18h18M18 9l-5 5-4-4-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bar-chart":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar-horizontal":{viewBox:"0 0 24 24",path:"M4 12h10M4 6h4M4 18h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-pie":{viewBox:"0 0 24 24",path:"M21.21 15.89A10 10 0 1 1 8 2.83M22 12A10 10 0 0 0 12 2v10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-area":{viewBox:"0 0 24 24",path:"M3 3v18h18M7 12l5-5 4 4 5-5v12H7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-candlestick":{viewBox:"0 0 24 24",path:"M9 5v4M9 11v8M15 5v8M15 17v2M7 9h4v2H7zM13 13h4v4h-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-neutral":{viewBox:"0 0 24 24",path:"M22 12H2M18 8l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1M21 12H17a2 2 0 0 1 0-4h4M17 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M21 4H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM1 10h22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},banknote:{viewBox:"0 0 24 24",path:"M2 8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM6 10h.01M18 14h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},coins:{viewBox:"0 0 24 24",path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 12c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zM16 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM16 8c2.2 0 4 1.8 4 4s-1.8 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"dollar-sign":{viewBox:"0 0 24 24",path:"M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pound-sign":{viewBox:"0 0 24 24",path:"M18 5H9a4 4 0 0 0-4 4v3a4 4 0 0 0 4 4h3M5 12h10M18 19H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"euro-sign":{viewBox:"0 0 24 24",path:"M4 10h12M4 14h12M17 5a8 8 0 0 0-14 5.5 8 8 0 0 0 14 5.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bitcoin:{viewBox:"0 0 24 24",path:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bank:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V10M8 21V10M12 21V10M16 21V10M20 21V10M12 3L2 8h20z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vault:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zM12 12m-3 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0M7 12h2M15 12h2M12 9V7M12 17v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"piggy-bank":{viewBox:"0 0 24 24",path:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2zM2 9v1c0 1.1.9 2 2 2h1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},safe:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM12 12m-2 0a2 2 0 1 0 4 0 2 2 0 1 0-4 0M16 8h.01M16 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M4 2v20l3-2 3 2 3-2 3 2 3-2 3 2V2l-3 2-3-2-3 2-3-2-3 2-3-2zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},invoice:{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M8 13h8M8 17h8M8 9h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},percent:{viewBox:"0 0 24 24",path:"M19 5L5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},growth:{viewBox:"0 0 24 24",path:"M12 20V12M12 12l-4 4M12 12l4 4M8 20h8M3 8l4-4 4 4 5-5 5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},investment:{viewBox:"0 0 24 24",path:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6M2 12h4M18 12h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scale:{viewBox:"0 0 24 24",path:"M12 3v18M3 6l3 10a6 6 0 0 0 6 0L15 6M9 6l6 0M21 6l-3 10a6 6 0 0 1-6 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ec={"heart-pulse":{viewBox:"0 0 24 24",path:"M19.5 12.572l-7.5 7.428-7.5-7.428A5 5 0 1 1 12 5.006a5 5 0 1 1 7.5 7.566zM3 12h4l2-4 4 8 2-4h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M3 12h4l2-7 4 14 2-7h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pill:{viewBox:"0 0 24 24",path:"M10.5 20.5l9-9a4.95 4.95 0 0 0-7-7l-9 9a4.95 4.95 0 0 0 7 7zM8.5 8.5l7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pill-bottle":{viewBox:"0 0 24 24",path:"M6 3h12v5H6zM5 8h14a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1zM10 14h4M12 12v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},capsule:{viewBox:"0 0 24 24",path:"M8 8a4 4 0 0 1 8 0v8a4 4 0 0 1-8 0V8zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},syringe:{viewBox:"0 0 24 24",path:"M18 2l4 4M15 5l6 6M8 6l10 10-4 4L4 10zM2 22l6-6M7 11l2 2M11 7l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vaccine:{viewBox:"0 0 24 24",path:"M14 2l4 4M8 8l8 8M3 17l4 4M6.5 6.5L20 20M12 12l2.5-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stethoscope:{viewBox:"0 0 24 24",path:"M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4M22 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-medical":{viewBox:"0 0 24 24",path:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0zM12 14v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bandage:{viewBox:"0 0 24 24",path:"M18 2l4 4-14 14-4-4zM10.5 7.5l6 6M8.5 9.5l1 1M14.5 15.5l1 1M12.5 11.5l1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hospital:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M10 9h4M12 7v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ambulance:{viewBox:"0 0 24 24",path:"M10 10H6M8 8v4M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM7 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM21 15V8a2 2 0 0 0-2-2h-3l-2-3H6a2 2 0 0 0-2 2v10M21 9h-4a2 2 0 0 0-2 2v4h6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"first-aid":{viewBox:"0 0 24 24",path:"M20 6H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM9 12h6M12 9v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"medical-cross":{viewBox:"0 0 24 24",path:"M8 3h8v6h5v6h-5v6H8v-6H3V9h5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dna:{viewBox:"0 0 24 24",path:"M2 15c6.667-6 13.333 0 20-6M9 22c1.798-1.998 2.518-3.995 2.807-5.993M15 2c-1.798 1.998-2.518 3.995-2.807 5.993M2 9c6.667 6 13.333 0 20 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},microscope:{viewBox:"0 0 24 24",path:"M6 18h8M3 22h18M14 22a7 7 0 1 0 0-14M9 14h.01M9 6v8M6 6h6l-3-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"test-tube":{viewBox:"0 0 24 24",path:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5s-2.5-1.1-2.5-2.5V2M7 2h10M8.5 14h7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},brain:{viewBox:"0 0 24 24",path:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18ZM12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18ZM12 5v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lungs:{viewBox:"0 0 24 24",path:"M6.081 20C2.477 20 2 15.5 2 12.5S4 6 4 6s2-1 2-3M17.92 20c3.603 0 4.08-4.5 4.08-7.5S20 6 20 6s-2-1-2-3M12 3v17M12 12c-4 0-7-2-7-2M12 12c4 0 7-2 7-2M12 16c-4 0-7-2-7-2M12 16c4 0 7-2 7-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bone:{viewBox:"0 0 24 24",path:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tooth:{viewBox:"0 0 24 24",path:"M12 2C7 2 4 5 4 8c0 5 1 8 2 10 .5 1 1 4 2.5 4s1.5-2 3.5-2 2 2 3.5 2 2-3 2.5-4c1-2 2-5 2-10 0-3-3-6-8-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-medical":{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 9v6M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wheelchair:{viewBox:"0 0 24 24",path:"M12 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM15 21a4 4 0 1 0-5-6M12 10v4h4l2 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crutch:{viewBox:"0 0 24 24",path:"M5 5l7 7M7 3l7 7M19 19l-7-7M21 17l-7-7M11 11l-6 6M13 13l-6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"scale-weight":{viewBox:"0 0 24 24",path:"M12 3a9 9 0 0 0-9 9 9 9 0 0 0 9 9 9 9 0 0 0 9-9 9 9 0 0 0-9-9zM12 7v5l3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"blood-drop":{viewBox:"0 0 24 24",path:"M12 2c-4 4-7 7-7 11a7 7 0 0 0 14 0c0-4-3-7-7-11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heartbeat:{viewBox:"0 0 24 24",path:"M3 12h4l3-9 4 18 3-9h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},tc={football:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6l4 4-4 4-4-4zM6 12l4-4v8zM18 12l-4 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},soccer:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 8l2.5 2-1 3h-3l-1-3zM12 2v3M22 12h-3M12 22v-3M2 12h3M4.93 4.93l2.12 2.12M19.07 4.93l-2.12 2.12M4.93 19.07l2.12-2.12M19.07 19.07l-2.12-2.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},basketball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2.05 11h19.9M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tennis:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM3.5 8.5c4-1 8 0 12 4M3.5 15.5c4 1 8 0 12-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},baseball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 5c1.5 2 2.5 4 2.5 7s-1 5-2.5 7M19 5c-1.5 2-2.5 4-2.5 7s1 5 2.5 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volleyball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 2v10M12 12l8.66 5M12 12l-8.66 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},golf:{viewBox:"0 0 24 24",path:"M12 18v4M8 22h8M12 2v16M12 6l6-2-6 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bowling:{viewBox:"0 0 24 24",path:"M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 6V2M10 9h.01M14 9h.01M12 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rugby:{viewBox:"0 0 24 24",path:"M5 5c8-2 16 6 14 14C11 21 3 13 5 5zM9 9l6 6M11 9l-1 1M13 11l-1 1M15 13l-1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cricket:{viewBox:"0 0 24 24",path:"M14 2l8 8-9 9-3-3 9-9M13 3l-9 9M7 17a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hockey:{viewBox:"0 0 24 24",path:"M7 2v11c0 3 2 5 5 5h3a3 3 0 0 0 0-6M19 18.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"table-tennis":{viewBox:"0 0 24 24",path:"M14.5 3.5a7 7 0 0 0-9.9 9.9l-2.3 4.3a1 1 0 0 0 1.3 1.3l4.3-2.3a7 7 0 0 0 6.6-13.2zM17 15.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"world-cup":{viewBox:"0 0 24 24",path:"M12 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM7 7h10M12 2v10M9 3.2c-1.4 2-1.4 5.6 0 7.6M15 3.2c1.4 2 1.4 5.6 0 7.6M10 12l-1 4h6l-1-4M8 16h8M11 16v4M13 16v4M8 20h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},jersey:{viewBox:"0 0 24 24",path:"M9 3L4 6l2.5 3.5L9 8M15 3l5 3-2.5 3.5L15 8M9 3a3 3 0 0 0 6 0M9 8v13h6V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"football-boot":{viewBox:"0 0 24 24",path:"M3 7v5a3 3 0 0 0 3 3h11a4 4 0 0 0 1-7.9L9 7c-1-1-2.2-2-4-2H3zM5 18h2M9 18h2M13 18h2M17 18h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},goal:{viewBox:"0 0 24 24",path:"M2 5h20v11H2zM2 5l3 3v8M22 5l-3 3v8M5 8h14v8M2 11h20M9 8v8M15 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-flag":{viewBox:"0 0 24 24",path:"M6 2v20M6 3h12l-3.5 4L18 11H6M3 22h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"referee-card":{viewBox:"0 0 24 24",path:"M8.5 2.5l9 3a2 2 0 0 1 1.3 2.5l-4.6 13a2 2 0 0 1-2.5 1.3l-9-3a2 2 0 0 1-1.3-2.5l4.6-13a2 2 0 0 1 2.5-1.3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 8c0-2.2 4.5-4 10-4s10 1.8 10 4-4.5 4-10 4-10-1.8-10-4zM2 8v6c0 2.2 4.5 4 10 4s10-1.8 10-4V8M8 12.5V18M16 12.5V18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scoreboard:{viewBox:"0 0 24 24",path:"M3 4h18v12H3zM3 16l3 4M21 16l-3 4M12 6v8M6 8h3v6H6zM15 8h3v6h-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dumbbell:{viewBox:"0 0 24 24",path:"M6.5 6.5h11M17.5 4v5M6.5 4v5M17.5 15v5M6.5 15v5M4 6v3a1 1 0 0 0 1 1h1.5M4 18v-3a1 1 0 0 1 1-1h1.5M20 6v3a1 1 0 0 1-1 1h-1.5M20 18v-3a1 1 0 0 0-1-1h-1.5M6.5 17.5h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barbell:{viewBox:"0 0 24 24",path:"M4 12h16M6 8v8M10 6v12M14 6v12M18 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},kettlebell:{viewBox:"0 0 24 24",path:"M12 6a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 22H7a5 5 0 0 1-1-9.9V10a6 6 0 0 1 12 0v2.1a5 5 0 0 1-1 9.9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},running:{viewBox:"0 0 24 24",path:"M13 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM5 22l3-9 3 3v6M10 6l5 3 4-1M4 13l5 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},swimming:{viewBox:"0 0 24 24",path:"M2 20c.9 0 1.6-.4 2.2-.9.8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 .6.5 1.3.9 2.2.9M8 16l-2-4 4-2 6 4 4-3M15 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cycling:{viewBox:"0 0 24 24",path:"M5 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM19 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 14l4-4 3 3 4-4M12 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},yoga:{viewBox:"0 0 24 24",path:"M12 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM4 17l4-4-2-4 6-3 6 3-2 4 4 4M8 22l4-5 4 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M6 9H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2M18 9h2a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M6 3v6a6 6 0 0 0 12 0V3M12 15v4M8 22h8M8 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},medal:{viewBox:"0 0 24 24",path:"M12 15a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM8 3l4 6 4-6M8 3h8M12 9v6M9 19.5l3 1.5 3-1.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M12 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM8.21 13.89L7 23l5-3 5 3-1.21-9.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crown:{viewBox:"0 0 24 24",path:"M2 17l3-10 5 6 2-8 2 8 5-6 3 10H2zM4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},podium:{viewBox:"0 0 24 24",path:"M5 10h4v12H5zM10 6h4v16h-4zM15 14h4v8h-4zM12 2v4M10 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stopwatch:{viewBox:"0 0 24 24",path:"M12 5a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 9v5l3 3M10 2h4M21 6l-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},whistle:{viewBox:"0 0 24 24",path:"M5 16a4 4 0 1 0 8 0 4 4 0 0 0-8 0zM2 12l7-4h8l3 4-3 4M18 8l4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},target:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"boxing-glove":{viewBox:"0 0 24 24",path:"M5 8c0-3 2-5 5-5h4c3 0 5 2 5 5v5c0 4-3 7-7 7s-7-3-7-7V8zM9 5v4M12 20v2M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},racket:{viewBox:"0 0 24 24",path:"M12 2a6 6 0 0 0-6 6v4a6 6 0 0 0 12 0V8a6 6 0 0 0-6-6zM12 18v4M8 8h8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skate:{viewBox:"0 0 24 24",path:"M4 16V6a2 2 0 0 1 2-2h8l4 4v8M2 16h18v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2zM6 20v2M16 20v2M10 10h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ski:{viewBox:"0 0 24 24",path:"M5 16l14-6M3 21l18-8M12 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 8l-4 8M14 10l2 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surfboard:{viewBox:"0 0 24 24",path:"M21 3L3 21M17 3c3 3 4 8 1 15L3 21c7-3 12-2 15 1M12 12l-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mountain:{viewBox:"0 0 24 24",path:"M8 21l4-10 3 6 2-4 4 8H3l5-10 4 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tent:{viewBox:"0 0 24 24",path:"M12 2L2 20h20L12 2zM12 2v18M7 14l5-6 5 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},compass:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM16.24 7.76l-2.12 6.36-6.36 2.12 2.12-6.36z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fishing:{viewBox:"0 0 24 24",path:"M18 2l-3 3v3l-4 4-5-2-4 4v5h5l4-4-2-5 4-4h3l3-3M12 22c-2 0-3-1-3-3M9 19c-2 0-3-1-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},nc={building:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-4h6v4M9 9h.01M15 9h.01M9 13h.01M15 13h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},house:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9zM9 22V12h6v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cabin:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10l8-8 8 8v10M10 20v-6h4v6M12 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},apartment:{viewBox:"0 0 24 24",path:"M4 21V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v17M8 6h2M14 6h2M8 10h2M14 10h2M8 14h2M14 14h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},office:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 21v-4h6v4M9 7h.01M15 7h.01M9 11h.01M15 11h.01M9 15h.01M15 15h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M4 3h16l1 6H3l1-6zM3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9M10 21v-6h4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},warehouse:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V8l8-5 8 5v13M9 17h6v4H9zM9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},factory:{viewBox:"0 0 24 24",path:"M2 21h20M5 21V11l6 4V9l6 4V5a2 2 0 0 1 2-2h0a2 2 0 0 1 2 2v16M8 21v-3M12 21v-3M16 21v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hotel:{viewBox:"0 0 24 24",path:"M4 21V3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v18M8 5h2M14 5h2M8 9h2M14 9h2M8 13h2M14 13h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},school:{viewBox:"0 0 24 24",path:"M2 22h20M12 2l10 6v14M2 8l10-6M12 8v14M4 10v12M20 10v12M8 14h.01M16 14h.01M10 22v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},university:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},library:{viewBox:"0 0 24 24",path:"M4 21h16M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 7h6M9 11h6M9 15h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},museum:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10M20 20V10M12 2L2 8h20L12 2zM8 20v-6h3v6M13 20v-6h3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},court:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8l8-6 8 6v12M10 20v-6h4v6M6 10h12M12 4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},church:{viewBox:"0 0 24 24",path:"M18 22H6a2 2 0 0 1-2-2V9l8-7 8 7v11a2 2 0 0 1-2 2zM12 2v4M10 4h4M10 22v-5a2 2 0 0 1 4 0v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mosque:{viewBox:"0 0 24 24",path:"M3 21h18M5 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M15 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M12 3a4 4 0 0 1 4 4v14M12 3a4 4 0 0 0-4 4v14M12 1v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},temple:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V12h4v10M16 22V12h4v10M8 22V8h8v14M12 2l6 6H6l6-6M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},castle:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V10h4V6H6V2h3v2h2V2h2v2h2V2h3v4h-2v4h4v12M10 22v-5h4v5M4 6h4M16 6h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fortress:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8h16v12M8 8V4h2v4M14 8V4h2v4M4 4h4M16 4h4M8 20v-4h3v4M13 20v-4h3v4M7 12h2M15 12h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tower:{viewBox:"0 0 24 24",path:"M8 22V4a4 4 0 0 1 8 0v18M8 8h8M8 14h8M10 22v-4h4v4M12 1v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lighthouse:{viewBox:"0 0 24 24",path:"M7 22l2-16h6l2 16M9 6V3a3 3 0 0 1 6 0v3M2 11h5M17 11h5M9 12h6M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bridge:{viewBox:"0 0 24 24",path:"M2 18h20M4 14c0-2 2-4 4-4s4 2 4 4c0-2 2-4 4-4s4 2 4 4M4 18v-4M20 18v-4M12 18v-4M8 10V6M16 10V6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 16c0-3 4.5-5 10-5s10 2 10 5v2c0 3-4.5 5-10 5s-10-2-10-5v-2zM2 12c0-3 4.5-5 10-5s10 2 10 5M12 3v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airport:{viewBox:"0 0 24 24",path:"M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"train-station":{viewBox:"0 0 24 24",path:"M4 21h16M6 17V7a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10M8 21v-4h3v4M13 21v-4h3v4M12 2v3M9 9h6M9 13h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monument:{viewBox:"0 0 24 24",path:"M8 22h8M10 22V10L12 2l2 8v12M6 18h12M8 14h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},obelisk:{viewBox:"0 0 24 24",path:"M7 22l2-18h6l2 18M12 2l-1 2h2l-1-2M9 8h6M9 14h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},arch:{viewBox:"0 0 24 24",path:"M4 22V10a8 8 0 0 1 16 0v12M4 8h16M4 14h16M8 22v-8M16 22v-8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},windmill:{viewBox:"0 0 24 24",path:"M7 22l3-10h4l3 10M12 12V3M12 6l6-3M12 6L6 3M12 6l6 3M12 6L6 9M10 16h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skyscraper:{viewBox:"0 0 24 24",path:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18M2 22h20M10 6h4M10 10h4M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pyramid:{viewBox:"0 0 24 24",path:"M12 2L2 22h20L12 2zM12 2v20M7 12h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dome:{viewBox:"0 0 24 24",path:"M2 22h20M4 22v-6a8 8 0 0 1 16 0v6M12 2v6M12 2a3 3 0 0 1 0 6M10 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barn:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V11l7-8 7 8v10M10 21v-5h4v5M9 11h6M12 3v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},sc={smile:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},grin:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M6 13a6 6 0 0 0 12 0H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laugh:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9c0-.6.4-1 1-1s1 .4 1 1M15 9c0-.6.4-1 1-1s1 .4 1 1M7 13h10a5 5 0 0 1-10 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9l2 1M15 9l2 1M6 13h12a6 6 0 0 1-12 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wink:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M14 9h4M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},blush:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2M5 13h2M17 13h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M6.5 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1zM15 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M8 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1zM16 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sad:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2M8 11v2M16 11v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sob:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9l3 1M18 9l-3 1M16 17s-1.5-2-4-2-4 2-4 2M7 12l1 6M17 12l-1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},disappointed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},angry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rage:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 7l5 3M19 7l-5 3M9 16h6M9 16l1-2M15 16l-1-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},annoyed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M8 9h.01M16 9h.01M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surprised:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v1M16 8v1M12 13a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shocked:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 8l2 1M17 8l-2 1M12 13v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},astonished:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M12 12a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thinking:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M10 15h4c0 1-1 2-2 2s-2-1-2-2zM19 9c1 0 2-1 2-2s-1-2-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},confused:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M9 15c2-2 4 0 6-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},neutral:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},expressionless:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h3M14 9h3M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cool:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 10h5l1-2h2l1 2h5M5 10c0 1 1 2 2.5 2s2.5-1 2.5-2M14 10c0 1 1 2 2.5 2s2.5-1 2.5-2M8 16s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},nerd:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM14 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM10 9h4M8 15s1.5 1 4 1 4-1 4-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tongue:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 13h8M10 13v3c0 1 1 2 2 2s2-1 2-2v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},silly:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h2M17 9l-2-1M7 13c2 0 3 3 5 3s3-3 5-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zany:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v2M15 8l2 2M8 14h8c0 2-2 4-4 4s-4-2-4-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sick:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15c2 1 6-1 8 0M18 5c1.5 1.5 1.5 3.5 0 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sleepy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10c.5-.5 1.5-.5 2 0M15 10c.5-.5 1.5-.5 2 0M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM18 4l2 2M20 4h-2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dead:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 4M10 8l-4 4M14 8l4 4M18 8l-4 4M8 16h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mask:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M4 13h16M5 14c1 2 3 4 7 4s6-2 7-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ic={car:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M7.5 6.5l.5 1h8l.5-1a1 1 0 00-1-1H8.5a1 1 0 00-1 1z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M1 3h15v13H1zM16 8h4l3 3v5h-7V8z M5.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z M18.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},van:{viewBox:"0 0 24 24",path:"M3 6h13v11H3z M16 6h2l3 4v7h-5V6z M7 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M17 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M3 10h13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},motorcycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 4l-3 7h5.5L18 8m-4 3l3 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bicycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 11l2-5h3M12 19v-8m0 0L9 8M12 11l3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bus:{viewBox:"0 0 24 24",path:"M4 6a2 2 0 012-2h12a2 2 0 012 2v11a3 3 0 01-3 3H7a3 3 0 01-3-3V6z M4 10h16M8 20v-2M16 20v-2M8 14h.01M16 14h.01M4 6h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},taxi:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M9 4h6v2H9V4z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},parking:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z M9 8v8M9 8h3.5a2.5 2.5 0 010 5H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fuel:{viewBox:"0 0 24 24",path:"M3 4h10v12H3z M13 7h2a2 2 0 012 2v7a2 2 0 002 2M14 7V4M3 10h10M5 20v-4M11 20v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},garage:{viewBox:"0 0 24 24",path:"M2 9l10-7 10 7v11a2 2 0 01-2 2H4a2 2 0 01-2-2V9z M7 21V13h10v8M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},road:{viewBox:"0 0 24 24",path:"M6 4h2v16H6zM16 4h2v16h-2zM12 4v4M12 12v4M12 20v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rocket:{viewBox:"0 0 24 24",path:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11A22.35 22.35 0 0 1 15 15z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};var oc={code:{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"git-branch":{viewBox:"0 0 24 24",path:"M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 9c-3 0-6 3-6 6v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},terminal:{viewBox:"0 0 24 24",path:"M4 17l6-6-6-6M12 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bold:{viewBox:"0 0 24 24",path:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6V4zm0 8h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6v-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},italic:{viewBox:"0 0 24 24",path:"M19 4h-9M14 20H5M15 4L9 20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},underline:{viewBox:"0 0 24 24",path:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3M4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},strikethrough:{viewBox:"0 0 24 24",path:"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7.1-5.3 1.1-6.6 3.1-.5.8-.7 1.7-.7 2.6 0 1.7.8 3.1 2 4M3 12h18M13 20c2 0 3.5-.5 4.5-1.5 1-.9 1.5-2.2 1.5-3.5 0-1.3-.5-2.5-1.4-3.4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-1":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 6h3m0 0V6m0 6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-2":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 10.5c0-2.5 4-2.5 4 0s-4 2.5-4 5m4 0h-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-3":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 4.5h3a1.5 1.5 0 0 1 0 3 1.5 1.5 0 0 1 0 3h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-bullet":{viewBox:"0 0 24 24",path:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-numbered":{viewBox:"0 0 24 24",path:"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},quote:{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-inline":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-block":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6M14 4l-4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-add":{viewBox:"0 0 24 24",path:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"image-add":{viewBox:"0 0 24 24",path:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M3 17a9 9 0 0 1 9-9 9 9 0 0 1 9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-left":{viewBox:"0 0 24 24",path:"M3 6h18M3 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-center":{viewBox:"0 0 24 24",path:"M3 6h18M6 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-right":{viewBox:"0 0 24 24",path:"M3 6h18M9 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},indent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M3 9l4 3-4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},outdent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M7 9l-4 3 4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},embed:{viewBox:"0 0 24 24",path:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clear-format":{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};const rc=e=>({viewBox:"0 0 24 24",path:e,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),ac={email:rc("M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9h4"),name:rc("M5 5h14a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z M9 9a2 2 0 110 4 2 2 0 010-4z M6 16.5c.6-1.4 1.7-2 3-2s2.4.6 3 2 M15 10h3 M15 14h3"),username:rc("M12 2a10 10 0 110 20 10 10 0 010-20z M12 7a3 3 0 110 6 3 3 0 010-6z M6.2 18.3c1.3-1.9 3.4-3 5.8-3s4.5 1.1 5.8 3"),password:rc("M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2z M7.5 12h.01 M12 12h.01 M16.5 12h.01"),signature:rc("M3 16c2.5-2.5 4.5-7 6.5-7 1.6 0-.6 6 1.2 6 1.4 0 2.6-3.5 4.3-3.5 1.4 0 .8 2.5 2.5 2.5 M3 20h18"),birthday:rc("M4 21h16 M5 21v-6a2 2 0 012-2h10a2 2 0 012 2v6 M5 17c1.2.9 2.3.9 3.5 0s2.3-.9 3.5 0 2.3.9 3.5 0 2.3-.9 3.5 0 M12 13V9 M12 7c-.9-.9-.9-2 0-3.5.9 1.5.9 2.6 0 3.5z"),company:rc("M4 21V5a2 2 0 012-2h8a2 2 0 012 2v16 M16 9h2a2 2 0 012 2v10 M3 21h18 M8 7h4 M8 11h4 M8 15h4"),telephone:rc("M22 16.9v3a2 2 0 01-2.2 2 19.8 19.8 0 01-8.6-3.1 19.5 19.5 0 01-6-6 19.8 19.8 0 01-3.1-8.7A2 2 0 014.1 2h3a2 2 0 012 1.7c.1.9.4 1.9.7 2.8a2 2 0 01-.5 2.1L8 9.9a16 16 0 006 6l1.3-1.3a2 2 0 012.1-.4c.9.3 1.8.6 2.8.7a2 2 0 011.7 2z"),mobile:rc("M8 2h8a2 2 0 012 2v16a2 2 0 01-2 2H8a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2"),address:rc("M3 10.5L12 3l9 7.5 M5 9v12h14V9 M10 21v-6h4v6"),postcode:rc("M4 5h16a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1z M10 9l-1 6 M14 9l-1 6 M7.5 11h8 M7 13h8"),website:rc("M5 4h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z M3 9h18 M6.5 6.5h.01 M9.5 6.5h.01"),pound:rc("M17 7.5a4 4 0 00-7.5-1.5c-.8 1.5-.4 3.3 0 5 .5 2.2.4 4.5-1.5 7H18 M6.5 12.5h8"),dollar:rc("M12 2v20 M17 6.5C16.1 5 14.3 4.3 12 4.3 9 4.3 7 5.8 7 8c0 5 10 2.5 10 8 0 2.2-2 3.7-5 3.7-2.4 0-4.3-.8-5.2-2.3"),euro:rc("M18.5 6.5a7 7 0 100 11 M4 10h9 M4 14h9"),weight:rc("M9 7a3 3 0 116 0 M6.5 9h11l2 12h-15l2-12z M10.5 14.5h3"),ruler:rc("M3 17L17 3l4 4L7 21l-4-4z M7 13l2 2 M10 10l2 2 M13 7l2 2"),quantity:rc("M4 6h16 M4 12h16 M4 18h10 M18 16v4 M16 18h4")},lc={...Fl,...Rl,...Vl,...ql,...Ul,...Kl,...Yl,...Gl,...Jl,...Xl,...Zl,...Ql,...ec,...tc,...nc,...sc,...ic,...oc,...ac},cc={ui:{name:"UI",description:"Core user interface icons",icons:Object.keys(Fl)},communication:{name:"Communication",description:"Messaging and notifications",icons:Object.keys(Rl)},media:{name:"Media",description:"Audio, video, and images",icons:Object.keys(Vl)},files:{name:"Files",description:"Documents and file operations",icons:Object.keys(ql)},social:{name:"Social",description:"Social interactions and sharing",icons:Object.keys(Ul)},commerce:{name:"Commerce",description:"Shopping and payments",icons:Object.keys(Kl)},status:{name:"Status",description:"Indicators and alerts",icons:Object.keys(Yl)},navigation:{name:"Navigation",description:"Directional and navigation",icons:Object.keys(Gl)},seasonal:{name:"Seasonal",description:"Festive and holiday icons",icons:Object.keys(Jl)},weather:{name:"Weather",description:"Weather conditions and meteorology",icons:Object.keys(Xl)},devices:{name:"Devices",description:"Electronic devices and hardware",icons:Object.keys(Zl)},finance:{name:"Finance",description:"Financial and charts",icons:Object.keys(Ql)},health:{name:"Health",description:"Medical and wellness",icons:Object.keys(ec)},sport:{name:"Sport",description:"Sports and fitness",icons:Object.keys(tc)},buildings:{name:"Buildings",description:"Architecture and structures",icons:Object.keys(nc)},emojis:{name:"Emojis",description:"Emoji expressions and faces",icons:Object.keys(sc)},transport:{name:"Transport",description:"Vehicles and transportation",icons:Object.keys(ic)},code:{name:"Code & Editor",description:"Text editing, formatting, and code icons",icons:Object.keys(oc)},forms:{name:"Forms",description:"Beside a form field - email, name, phone, address, money, measurements",icons:[...Object.keys(ac),"at-sign","mail","user","users","phone","smartphone","map-pin","home","calendar","clock","lock","key","globe","link","credit-card","hash","percent","briefcase","building","message-square","tag","search","cake","gift","scale"]}},hc="http://www.w3.org/2000/svg";const dc=new class{constructor(){this._icons={...lc},this._categories={...cc}}render(e,t={}){const n=this._icons[e];if(!n)return console.warn(`Icon "${e}" not found`),null;const{size:s=24,class:i="",colour:o=null,color:r=null,attrs:a={}}=t,l=document.createElementNS(hc,"svg");l.setAttribute("viewBox",n.viewBox||"0 0 24 24"),l.setAttribute("width",s),l.setAttribute("height",s),l.setAttribute("fill",n.fill||"none"),l.setAttribute("aria-hidden","true");const c=["dm-icon"];if(i&&c.push(i),l.setAttribute("class",c.join(" ")),n.stroke&&l.setAttribute("stroke",o||r||n.stroke),n.strokeWidth&&l.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&l.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&l.setAttribute("stroke-linejoin",n.strokeLinejoin),(o||r)&&"currentColor"===n.fill&&l.setAttribute("fill",o||r),Object.entries(a).forEach(([e,t])=>{l.setAttribute(e,t)}),n.path){const e=document.createElementNS(hc,"path");e.setAttribute("d",n.path),"currentColor"===n.fill&&e.setAttribute("fill",o||r||"currentColor"),l.appendChild(e)}return n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(hc,"path");t.setAttribute("d",e),"currentColor"===n.fill&&t.setAttribute("fill",o||r||"currentColor"),l.appendChild(t)}),l}html(e,t={}){const n=this.render(e,t);if(!n)return"";const s=document.createElement("div");return s.appendChild(n),s.innerHTML}inject(e,t,n={}){const{position:s="prepend",...i}=n,o="string"==typeof e?document.querySelector(e):e;if(!o)return console.warn(`Target element not found: ${e}`),null;const r=this.render(t,i);if(!r)return null;switch(s){case"append":o.appendChild(r);break;case"replace":o.innerHTML="",o.appendChild(r);break;default:o.insertBefore(r,o.firstChild)}return r}scan(e=document){const t="string"==typeof e?document.querySelector(e):e;if(!t)return 0;const n=t.querySelectorAll("[data-icon]:not([data-icon-processed]):not([data-icon-processing])");let s=0;return n.forEach(e=>{if("svg"===e.tagName.toLowerCase()||e.hasAttribute("data-icon-processed")||e.querySelector("svg"))return;const t=e.dataset.icon,n=parseInt(e.dataset.iconSize,10)||24,i=e.dataset.iconColour||e.dataset.iconColor||null,o=e.dataset.iconClass||"",r=this.render(t,{size:n,colour:i,class:o});if(r){const n=e.className;n&&r.classList.add(...n.split(" ").filter(e=>e)),r.setAttribute("data-icon",t),r.setAttribute("data-icon-processed","true"),r.setAttribute("data-original-icon",t),r.setAttribute("data-icon-converted",Date.now().toString()),e.replaceWith(r),s++}else e.setAttribute("data-icon-processed","true")}),s}register(e,t){return e&&t?(t.viewBox||(t.viewBox="0 0 24 24"),t.path||t.paths?(this._icons[e]=t,this._categories.custom||(this._categories.custom={name:"Custom",description:"Custom registered icons",icons:[]}),this._categories.custom.icons.push(e),this):(console.warn(`Icon "${e}" must have a path or paths property`),this)):(console.warn("Invalid icon registration: name and definition required"),this)}unregister(e){if(this._icons[e]){if(delete this._icons[e],this._categories.custom){const t=this._categories.custom.icons.indexOf(e);t>-1&&this._categories.custom.icons.splice(t,1)}return!0}return!1}has(e){return!!this._icons[e]}get(e){return this._icons[e]||null}list(e=null){return e&&this._categories[e]?[...this._categories[e].icons]:Object.keys(this._icons)}listCategories(){return{...this._categories}}count(){return Object.keys(this._icons).length}search(e){const t=e.toLowerCase();return Object.keys(this._icons).filter(e=>e.toLowerCase().includes(t))}createSprite(){const e=document.createElementNS(hc,"svg");return e.setAttribute("xmlns",hc),e.style.display="none",Object.entries(this._icons).forEach(([t,n])=>{const s=document.createElementNS(hc,"symbol");if(s.setAttribute("id",`dm-icon-${t}`),s.setAttribute("viewBox",n.viewBox||"0 0 24 24"),n.path){const e=document.createElementNS(hc,"path");e.setAttribute("d",n.path),n.fill&&e.setAttribute("fill",n.fill),n.stroke&&(e.setAttribute("stroke",n.stroke),n.strokeWidth&&e.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&e.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&e.setAttribute("stroke-linejoin",n.strokeLinejoin)),s.appendChild(e)}n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(hc,"path");t.setAttribute("d",e),n.fill&&t.setAttribute("fill",n.fill),n.stroke&&t.setAttribute("stroke",n.stroke),s.appendChild(t)}),e.appendChild(s)}),e}use(e,t={}){if(!this._icons[e])return console.warn(`Icon "${e}" not found`),null;const{size:n=24,class:s=""}=t,i=document.createElementNS(hc,"svg");i.setAttribute("width",n),i.setAttribute("height",n),i.setAttribute("aria-hidden","true");const o=["dm-icon"];s&&o.push(s),i.setAttribute("class",o.join(" "));const r=document.createElementNS(hc,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#dm-icon-${e}`),i.appendChild(r),i}};class uc{static stripeColors={none:"transparent",lighter:"var(--dm-gray-100, #f8f9fa)",light:"var(--dm-gray-200, #e9ecef)",medium:"var(--dm-gray-300, #dee2e6)",dark:"var(--dm-gray-400, #ced4da)","primary-tint":"rgba(100, 149, 237, 0.05)","success-tint":"rgba(40, 167, 69, 0.05)","warning-tint":"rgba(255, 193, 7, 0.05)","danger-tint":"rgba(220, 53, 69, 0.05)","info-tint":"rgba(23, 162, 184, 0.05)",default:"var(--dm-table-stripe-bg, #f9f9f9)"};static hoverColors={none:"transparent",lighter:"var(--dm-gray-200, #e9ecef)",light:"var(--dm-gray-300, #dee2e6)",medium:"var(--dm-gray-400, #ced4da)",dark:"var(--dm-gray-500, #adb5bd)",default:"var(--dm-hover-bg, #f0f0f0)"};constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={data:[],columns:[],rowKey:"id",sortable:!0,multiSort:!1,defaultSort:null,filterable:!0,searchable:!0,searchPlaceholder:"Search...",pagination:!0,pageSize:10,pageSizeOptions:[10,25,50,100],selectable:!1,selectionMode:"single",editable:!1,editMode:"cell",resizable:!0,loadingSkeleton:!1,loadingLabel:"Loading...",striped:!0,hover:!0,bordered:!0,responsive:!0,evenRowColor:null,oddRowColor:null,hoverColor:null,classes:{wrapper:"domma-table-wrapper",table:"domma-table",header:"domma-table-header",body:"domma-table-body",row:"domma-table-row",cell:"domma-table-cell",selected:"domma-table-selected",sorted:"domma-table-sorted",sortAsc:"domma-table-sort-asc",sortDesc:"domma-table-sort-desc",pagination:"domma-table-pagination",search:"domma-table-search"},exportPanel:!1,exportOptions:["copy","csv","excel","json"],columnToggle:!1,regexSearch:!1,persistSettings:!1,storageKey:null,onSort:null,onFilter:null,onPageChange:null,onSelect:null,onEdit:null,onRender:null,onExport:null,...t},this._originalData=[...this.options.data],this._data=[...this.options.data],this._filteredData=[...this._data],this._currentPage=1,this._pageSize=this.options.pageSize,this._sorts=[],this._filters=[],this._searchQuery="",this._selected=new Set,this._editingCell=null,this._eventListeners=new Map,this._columnDropdownOpen=!1,this._searchIsRegex=!1,this._loading=!(!this.options.loadingSkeleton||this.options.data&&this.options.data.length),this._columns=this.options.columns.map(e=>({key:e.key||e,title:e.title||e.key||e,sortable:!1!==e.sortable&&this.options.sortable,filterable:!1!==e.filterable,editable:e.editable||!1,width:e.width||null,render:e.render||null,filterOptions:e.filterOptions||null,visible:!1!==e.visible})),this.options.persistSettings&&this._loadSettings(),this._init()}_init(){this.element&&(this.options.defaultSort&&(this._sorts=[this.options.defaultSort]),this.render())}_resolveColor(e,t,n){return e?t[e]?t[e]:e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("var(")?e:n:n}_getRowColors(e){const t=this.options;if(!t.striped)return{background:"transparent",hover:t.hover?this._resolveColor(t.hoverColor,uc.hoverColors,uc.hoverColors.default):"transparent"};const n=e%2==1,s=this._resolveColor(t.evenRowColor,uc.stripeColors,"transparent"),i=this._resolveColor(t.oddRowColor,uc.stripeColors,uc.stripeColors.default);return{background:n?i:s,hover:t.hover?this._resolveColor(t.hoverColor,uc.hoverColors,uc.hoverColors.default):null}}setData(e){return this._loading=!1,this._originalData=[...e],this._data=[...e],this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}getData(){return[...this._getPageData()]}setLoading(e=!0){return this._loading=!!e,this.render(),this}isLoading(){return this._loading}getFilteredData(){return[...this._filteredData]}getOriginalData(){return[...this._originalData]}addRow(e){return this._loading=!1,this._originalData.push(e),this._data.push(e),this._applyFiltersAndSort(),this.render(),this}updateRow(e,t){const n=this._findRowIndex(e);return-1!==n&&(this._originalData[n]={...this._originalData[n],...t},this._data[n]={...this._data[n],...t},this._applyFiltersAndSort(),this.render()),this}removeRow(e){const t=this._findRowIndex(e);return-1!==t&&(this._originalData.splice(t,1),this._data.splice(t,1),this._applyFiltersAndSort(),this.render()),this}_findRowIndex(e){const t=this.options.rowKey;return"number"==typeof e?e:this._originalData.findIndex(n=>n[t]===e)}sort(e,t="asc"){return this._sorts=[{column:e,direction:t}],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({column:e,direction:t,sorts:this._sorts}),this}sortMultiple(e){return this._sorts=e,this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({sorts:this._sorts}),this}clearSort(){return this._sorts=[],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this}_applySort(e){return 0===this._sorts.length?e:[...e].sort((e,t)=>{for(const n of this._sorts){const{column:s,direction:i}=n,o=e[s],r=t[s];let a=0;if(null==o?a=1:null==r||o<r?a=-1:o>r&&(a=1),0!==a)return"desc"===i?-a:a}return 0})}search(e){return this._searchQuery=this._searchIsRegex?e.trim():e.toLowerCase().trim(),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({query:e,type:"search",isRegex:this._searchIsRegex}),this}setSearchMode(e){return this._searchIsRegex=e,this._searchQuery&&(this._applyFiltersAndSort(),this.render()),this}toggleSearchMode(){return this.setSearchMode(!this._searchIsRegex)}filter(e,t,n="equals"){return this._filters=this._filters.filter(t=>t.column!==e),null!=t&&""!==t&&this._filters.push({column:e,value:t,operator:n}),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({column:e,value:t,operator:n,type:"column"}),this}filterBy(e){return this._customFilter=e,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}clearFilters(){return this._filters=[],this._searchQuery="",this._customFilter=null,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}_applyFilters(e){let t=e;if(this._searchQuery)if(this._searchIsRegex)try{const e=new RegExp(this._searchQuery,"i");t=t.filter(t=>this._columns.some(n=>{const s=t[n.key];return null!=s&&e.test(String(s))}))}catch(e){t=[]}else t=t.filter(e=>this._columns.some(t=>{const n=e[t.key];return null!=n&&String(n).toLowerCase().includes(this._searchQuery)}));for(const e of this._filters)t=t.filter(t=>{const n=t[e.column];return this._matchFilter(n,e.value,e.operator)});return this._customFilter&&(t=t.filter(this._customFilter)),t}_matchFilter(e,t,n){if(null==e)return!1;const s=String(e).toLowerCase(),i=String(t).toLowerCase();switch(n){case"equals":default:return s===i;case"contains":return s.includes(i);case"startsWith":return s.startsWith(i);case"endsWith":return s.endsWith(i);case"gt":return Number(e)>Number(t);case"lt":return Number(e)<Number(t);case"gte":return Number(e)>=Number(t);case"lte":return Number(e)<=Number(t);case"between":const[n,o]=t,r=Number(e);return r>=n&&r<=o;case"in":return t.includes(e)}}_applyFiltersAndSort(){this._filteredData=this._applyFilters(this._data),this._filteredData=this._applySort(this._filteredData)}page(e){const t=this._getTotalPages();return this._currentPage=Math.max(1,Math.min(e,t)),this.render(),this.options.onPageChange&&this.options.onPageChange(this.pageInfo()),this}pageSize(e){return this._pageSize=e,this._currentPage=1,this.render(),this._saveSettings(),this}nextPage(){return this.page(this._currentPage+1)}prevPage(){return this.page(this._currentPage-1)}firstPage(){return this.page(1)}lastPage(){return this.page(this._getTotalPages())}pageInfo(){const e=this._getTotalPages();return{page:this._currentPage,pageSize:this._pageSize,totalPages:e,totalRows:this._filteredData.length,startRow:(this._currentPage-1)*this._pageSize+1,endRow:Math.min(this._currentPage*this._pageSize,this._filteredData.length)}}_getTotalPages(){return this.options.pagination&&Math.ceil(this._filteredData.length/this._pageSize)||1}_getPageData(){if(!this.options.pagination)return this._filteredData;const e=(this._currentPage-1)*this._pageSize,t=e+this._pageSize;return this._filteredData.slice(e,t)}select(e){if(!this.options.selectable)return this;const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return"single"===this.options.selectionMode&&this._selected.clear(),this._selected.add(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.delete(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}toggleSelect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)?this.deselect(e):this.select(e),this}selectAll(){if(!this.options.selectable||"single"===this.options.selectionMode)return this;const e=this.options.rowKey;for(const t of this._filteredData)this._selected.add(t[e]);return this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselectAll(){return this._selected.clear(),this.render(),this.options.onSelect&&this.options.onSelect([]),this}getSelected(){const e=this.options.rowKey;return this._filteredData.filter(t=>this._selected.has(t[e]))}isSelected(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)}_getStorageKey(){return this.options.storageKey||(this.element.id?`domma-table-${this.element.id}`:"domma-table-default")}_loadSettings(){try{const e=this._getStorageKey(),t=me.get(e);t&&t.columns&&t.columns.forEach(e=>{const t=this._columns.find(t=>t.key===e.key);t&&(t.visible=e.visible,e.width&&(t.width=e.width))}),t&&t.pageSize&&this.options.pagination&&(this._pageSize=t.pageSize,this.options.pageSize=t.pageSize),t&&t.sorts&&this.options.sortable&&(this._sorts=t.sorts)}catch(e){console.warn("Failed to load table settings:",e)}}_saveSettings(){if(this.options.persistSettings)try{const e=this._getStorageKey(),t={columns:this._columns.map(e=>({key:e.key,visible:e.visible,width:e.width})),pageSize:this._pageSize,sorts:this._sorts,timestamp:Date.now()};me.set(e,t)}catch(e){console.warn("Failed to save table settings:",e)}}clearSettings(){if(this.options.persistSettings){const e=this._getStorageKey();me.remove(e)}}showColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!0,this.render(),this._saveSettings()),this}hideColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!1,this.render(),this._saveSettings()),this}toggleColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!t.visible,this.render(),this._saveSettings()),this}getVisibleColumns(){return this._columns.filter(e=>e.visible)}getHiddenColumns(){return this._columns.filter(e=>!e.visible)}resizeColumn(e,t){const n=this._columns.find(t=>t.key===e);return n&&(n.width=t,this.render()),this}getColumns(){return[...this._columns]}editCell(e,t){return this.options.editable?(this._editingCell={rowIndex:e,column:t},this.render(),this):this}saveEdits(){return this._editingCell=null,this.render(),this}cancelEdits(){return this._editingCell=null,this.render(),this}toCSV(e={}){const{columns:t=this._columns.filter(e=>e.visible),includeHeaders:n=!0}=e,s=[],i=this._getExportData();n&&s.push(t.map(e=>`"${e.title}"`).join(","));for(const e of i){const n=t.map(t=>{const n=e[t.key];return null==n?'""':`"${String(n).replace(/"/g,'""')}"`});s.push(n.join(","))}return s.join("\n")}_getExportData(){const e=this.getSelected();return e.length>0?e:this._filteredData}toJSON(e={}){const{columns:t=this._columns.filter(e=>e.visible),pretty:n=!1}=e,s=t.map(e=>e.key),i=this._getExportData().map(e=>{const t={};for(const n of s)t[n]=e[n];return t});return n?JSON.stringify(i,null,2):JSON.stringify(i)}download(e,t){let n,s;switch(e){case"csv":n=this.toCSV(),s="text/csv",t=t||"data.csv";break;case"excel":n=this.toExcel(),s="application/vnd.ms-excel",t=t||"data.xls";break;default:n=this.toJSON({pretty:!0}),s="application/json",t=t||"data.json"}const i=new Blob([n],{type:s}),o=URL.createObjectURL(i),r=document.createElement("a");if(r.href=o,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o),this.options.onExport){const n=this._getExportData(),s=this.getSelected();this.options.onExport({format:e,filename:t,rowCount:n.length,selectedOnly:s.length>0})}}toExcel(e={}){const{columns:t=this._columns.filter(e=>e.visible)}=e,n=this._getExportData();let s='\n <html xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <head>\n <meta charset="UTF-8">\n \x3c!--[if gte mso 9]>\n <xml>\n <x:ExcelWorkbook>\n <x:ExcelWorksheets>\n <x:ExcelWorksheet>\n <x:Name>Data</x:Name>\n <x:WorksheetOptions>\n <x:DisplayGridlines/>\n </x:WorksheetOptions>\n </x:ExcelWorksheet>\n </x:ExcelWorksheets>\n </x:ExcelWorkbook>\n </xml>\n <![endif]--\x3e\n <style>\n table { border-collapse: collapse; }\n th, td { border: 1px solid #000; padding: 8px; }\n th { background: #f0f0f0; font-weight: bold; }\n </style>\n </head>\n <body>\n <table>\n <thead>\n <tr>';for(const e of t)s+=`<th>${this._escapeHtml(e.title)}</th>`;s+="</tr></thead><tbody>";for(const e of n){s+="<tr>";for(const n of t){const t=e[n.key];s+=`<td>${null!=t?this._escapeHtml(String(t)):""}</td>`}s+="</tr>"}return s+="</tbody></table></body></html>",s}async copyToClipboard(e="text"){let t;const n=this._getExportData();if("json"===e)t=this.toJSON({pretty:!0});else if("csv"===e)t=this.toCSV();else{const e=this._columns.filter(e=>e.visible),s=[];s.push(e.map(e=>e.title).join("\t"));for(const t of n)s.push(e.map(e=>t[e.key]??"").join("\t"));t=s.join("\n")}return await y.copyToClipboard(t),this.options.onExport&&this.options.onExport({format:"clipboard",rowCount:this._filteredData.length}),this}_escapeHtml(e){return o(e)}render(){if(!this.element)return this;const e=this.options,t=e.classes,n=this._columns.filter(e=>e.visible),s=this._getPageData();this._restoreIconsBeforeRebuild(),this.element.innerHTML="",this._clearEventListeners();const i=document.createElement("div");i.className=t.wrapper;const o=document.createElement("div");if(o.className="domma-table-toolbar",e.searchable){const t=document.createElement("div");t.className="domma-table-search-wrapper";const n=document.createElement("input");if(n.type="text",n.className="domma-table-search-input"+(this._searchIsRegex?" regex-mode":""),n.placeholder=this._searchIsRegex?"Regex pattern...":e.searchPlaceholder,n.value=this._searchQuery,n.setAttribute("aria-label","Search table"),this._addEventHandler(n,"input",y.debounce(e=>{this.search(e.target.value)},300)),t.appendChild(n),e.regexSearch){const e=document.createElement("button");e.type="button",e.className="domma-table-regex-button"+(this._searchIsRegex?" active":""),e.title=this._searchIsRegex?"Regex mode (click for text)":"Text mode (click for regex)",e.setAttribute("aria-label",this._searchIsRegex?"Regex search mode enabled":"Regex search mode disabled"),e.setAttribute("aria-pressed",this._searchIsRegex?"true":"false"),e.innerHTML=".*",this._addEventHandler(e,"click",()=>{this._searchIsRegex=!this._searchIsRegex,this._searchQuery&&(this._searchQuery=this._searchIsRegex?n.value.trim():n.value.toLowerCase().trim(),this._applyFiltersAndSort()),this.render()}),t.appendChild(e)}o.appendChild(t)}if(e.columnToggle){const e=document.createElement("div");e.className="domma-table-column-toggle";const t=document.createElement("button");t.type="button",t.className="domma-table-column-button",t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this._columnDropdownOpen?"true":"false"),t.setAttribute("aria-label","Toggle column visibility"),t.innerHTML=`${dc.html("columns",{size:16})} Columns`;const n=document.createElement("div");n.className="domma-column-dropdown"+(this._columnDropdownOpen?" show":"");for(const e of this._columns){const t=document.createElement("label");t.className="domma-column-toggle-item";const s=document.createElement("span");s.className="domma-column-toggle-label",s.textContent=e.title;const i=document.createElement("div");i.className="domma-toggle-switch";const o=document.createElement("input");o.type="checkbox",o.checked=e.visible,o.style.cssText="opacity: 0; width: 0; height: 0; position: absolute;";const r=document.createElement("span");r.className="domma-toggle-track"+(e.visible?" active":"");const a=document.createElement("span");a.className="domma-toggle-knob"+(e.visible?" active":""),r.appendChild(a),i.appendChild(o),i.appendChild(r),this._addEventHandler(t,"click",t=>{t.preventDefault(),t.stopPropagation(),e.visible=!e.visible,e.visible?(r.classList.add("active"),a.classList.add("active")):(r.classList.remove("active"),a.classList.remove("active")),o.checked=e.visible,this._columnDropdownOpen=!0,this.render(),this._saveSettings()}),t.appendChild(s),t.appendChild(i),n.appendChild(t)}this._addEventHandler(t,"click",e=>{e.stopPropagation(),this._columnDropdownOpen=!this._columnDropdownOpen,this._columnDropdownOpen?n.classList.add("show"):n.classList.remove("show")}),this._addEventHandler(document,"click",()=>{this._columnDropdownOpen&&(this._columnDropdownOpen=!1,n.classList.remove("show"))}),this._addEventHandler(n,"click",e=>{e.stopPropagation()}),e.appendChild(t),e.appendChild(n),o.appendChild(e)}if(e.exportPanel){const t=document.createElement("div");t.className="domma-table-export-wrapper";let n=!1;const s=document.createElement("div");s.className="domma-export-mode-toggle";const i=document.createElement("span");i.className="domma-export-mode-label active",i.textContent="Copy";const r=document.createElement("label");r.className="domma-export-toggle-switch";const a=document.createElement("input");a.type="checkbox",a.className="domma-export-toggle-input";const l=document.createElement("span");l.className="domma-export-toggle-slider";const c=document.createElement("span");c.className="domma-export-toggle-knob",l.appendChild(c),r.appendChild(a),r.appendChild(l);const h=document.createElement("span");h.className="domma-export-mode-label",h.textContent="Download";const d=()=>{n?(l.classList.add("active"),c.classList.add("active"),i.classList.remove("active"),h.classList.add("active")):(l.classList.remove("active"),c.classList.remove("active"),i.classList.add("active"),h.classList.remove("active"))};this._addEventHandler(a,"change",()=>{n=a.checked,d()}),d(),s.appendChild(i),s.appendChild(r),s.appendChild(h),t.appendChild(s);const u=document.createElement("span");u.className="domma-export-separator",t.appendChild(u);const p={text:{label:"Text",icon:dc.html("clipboard",{size:16}),format:"text"},csv:{label:"CSV",icon:dc.html("document",{size:16}),format:"csv"},excel:{label:"Excel",icon:dc.html("grid",{size:16}),format:"excel"},json:{label:"JSON",icon:dc.html("file-code",{size:16}),format:"json"}},m=e.exportOptions.map(e=>"copy"===e?"text":e);for(const e of m){const s=p[e];if(!s)continue;const i=document.createElement("button");i.type="button",i.className="domma-export-button",i.setAttribute("data-export",e),i.innerHTML=`${s.icon} ${s.label}`;const o=(e,t=!0)=>{const n=i.innerHTML;i.innerHTML=e,i.classList.add(t?"success":"error"),setTimeout(()=>{i.innerHTML=n,i.classList.remove("success","error")},1500)};this._addEventHandler(i,"click",()=>{const e=this.getSelected(),t=e.length>0?e.length:this._filteredData.length,i=e.length>0?` (${t} selected)`:` (${t} rows)`;if(n){const e="text"===s.format?"csv":s.format;this.download(e),o("✓ Downloaded!"+i)}else{const e="excel"===s.format?"text":s.format;this.copyToClipboard(e),o("✓ Copied!"+i)}}),t.appendChild(i)}o.appendChild(t)}(e.searchable||e.columnToggle||e.exportPanel)&&i.appendChild(o);const r=document.createElement("table");r.className=t.table,r.style.cssText="width: 100%; border-collapse: collapse;";const a=document.createElement("thead");a.className=t.header;const l=document.createElement("tr");if(e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("th");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); width: 40px;";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label","Select all rows"),t.checked=this._selected.size>0&&this._selected.size===s.length,t.disabled=this._loading,this._addEventHandler(t,"change",()=>{t.checked?this.selectAll():this.deselectAll()}),e.appendChild(t),l.appendChild(e)}for(const e of n){const n=document.createElement("th");n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); text-align: left;",e.width&&(n.style.width="number"==typeof e.width?e.width+"px":e.width);const s=this._sorts.find(t=>t.column===e.key);if(s&&(n.classList.add(t.sorted),n.classList.add("asc"===s.direction?t.sortAsc:t.sortDesc)),e.sortable){n.style.cursor="pointer",n.tabIndex=0,n.setAttribute("aria-sort",s?"asc"===s.direction?"ascending":"descending":"none"),n.innerHTML=`${e.title} <span style="opacity: 0.5" aria-hidden="true">${s?"asc"===s.direction?"▲":"▼":"⇅"}</span>`;const t=()=>{const t=this._sorts.find(t=>t.column===e.key),n="asc"===t?.direction?"desc":"asc";this.sort(e.key,n)};this._addEventHandler(n,"click",t),this._addEventHandler(n,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}else n.textContent=e.title;l.appendChild(n)}a.appendChild(l),r.appendChild(a);const c=document.createElement("tbody");c.className=t.body;const h=e.rowKey;if(this._loading){const s=parseInt(e.loadingSkeleton,10),o=s>0?s:Math.min(this._pageSize||5,5),a=n.length+(e.selectable&&"multiple"===e.selectionMode?1:0);for(let e=0;e<o;e++){const n=document.createElement("tr");n.className=`${t.row} domma-table-skeleton-row`,n.setAttribute("aria-hidden","true");for(let s=0;s<a;s++){const i=document.createElement("td");i.className=t.cell,i.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const o=document.createElement("span");o.className="skeleton skeleton-text",o.style.width=`${[80,60,70,50][(e+s)%4]}%`,i.appendChild(o),n.appendChild(i)}c.appendChild(n)}r.setAttribute("aria-busy","true");const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),i.appendChild(l),setTimeout(()=>{l.isConnected&&(l.textContent=e.loadingLabel)},100)}else e.loadingSkeleton&&r.setAttribute("aria-busy","false");if((this._loading?[]:s).forEach((s,i)=>{const o=document.createElement("tr");o.className=t.row;const r=this._getRowColors(i);if(o.style.background=r.background,e.hover&&r.hover){o.style.transition="background 0.2s";const e=r.background;this._addEventHandler(o,"mouseenter",()=>o.style.background=r.hover),this._addEventHandler(o,"mouseleave",()=>o.style.background=e)}if(this._selected.has(s[h])?(o.classList.add(t.selected),o.style.background="var(--dm-primary-light, #e3f2fd)",o.setAttribute("aria-selected","true")):e.selectable&&o.setAttribute("aria-selected","false"),e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("td");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label",`Select row ${i+1}`),t.checked=this._selected.has(s[h]),this._addEventHandler(t,"change",()=>{this.toggleSelect(s[h])}),e.appendChild(t),o.appendChild(e)}e.selectable&&"single"===e.selectionMode&&(o.style.cursor="pointer",this._addEventHandler(o,"click",()=>{this.toggleSelect(s[h])}));for(const r of n){const n=document.createElement("td");n.className=t.cell,n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";if(this._editingCell&&this._editingCell.rowIndex===i&&this._editingCell.column===r.key&&r.editable){const t=document.createElement("input");t.type="text",t.value=s[r.key]||"",t.style.cssText="width: 100%; padding: 4px; border: 1px solid var(--dm-primary, #007bff);",this._addEventHandler(t,"blur",()=>{this.updateRow(s[h],{[r.key]:t.value}),this.saveEdits(),e.onEdit&&e.onEdit({row:s,column:r.key,oldValue:s[r.key],newValue:t.value})}),this._addEventHandler(t,"keydown",e=>{"Enter"===e.key?t.blur():"Escape"===e.key&&this.cancelEdits()}),n.appendChild(t),setTimeout(()=>t.focus(),0)}else r.render?n.innerHTML=r.render(s[r.key],s,i):n.textContent=s[r.key]??"",r.editable&&e.editable&&(n.style.cursor="pointer",this._addEventHandler(n,"dblclick",()=>{this.editCell(i,r.key)}));o.appendChild(n)}c.appendChild(o)}),r.appendChild(c),i.appendChild(r),e.pagination&&!this._loading){const n=document.createElement("div");n.className=t.pagination,n.setAttribute("role","navigation"),n.setAttribute("aria-label","Table pagination"),n.style.cssText="display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 10px 0;";const s=this.pageInfo(),o=document.createElement("span");o.textContent=`Showing ${s.startRow}-${s.endRow} of ${s.totalRows}`;const r=document.createElement("span");r.innerHTML="Show ";const a=document.createElement("select");a.className="form-select",a.setAttribute("aria-label","Rows per page"),a.style.cssText="width: auto; display: inline-block; margin: 0 5px;";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=t,e.textContent=t,t===this._pageSize&&(e.selected=!0),a.appendChild(e)}this._addEventHandler(a,"change",()=>{this.pageSize(Number(a.value))}),r.appendChild(a),r.appendChild(document.createTextNode(" entries"));const l=document.createElement("span");l.setAttribute("role","group"),l.setAttribute("aria-label","Pagination controls");const c=(e,t,n=!1,s=!1,i="")=>{const o=document.createElement("button");return o.type="button",i&&o.setAttribute("aria-label",i),s?o.innerHTML=e:o.textContent=e,o.disabled=n,n&&o.setAttribute("aria-disabled","true"),o.style.cssText="padding: 6px 12px; margin: 0 2px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-surface, #fff); cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;",n&&(o.style.opacity="0.5"),this._addEventHandler(o,"click",t),o};l.appendChild(c(dc.html("chevrons-left",{size:14}),()=>this.firstPage(),1===this._currentPage,!0,"First page")),l.appendChild(c(dc.html("chevron-left",{size:14}),()=>this.prevPage(),1===this._currentPage,!0,"Previous page"));const h=5;let d=Math.max(1,this._currentPage-Math.floor(h/2)),u=Math.min(s.totalPages,d+h-1);d=Math.max(1,u-h+1);for(let e=d;e<=u;e++){const t=e===this._currentPage,n=c(e,()=>this.page(e),!1,!1,`Page ${e}`);t&&(n.setAttribute("aria-current","page"),n.style.background="var(--dm-primary, #007bff)",n.style.color="var(--dm-primary-text, #fff)",n.style.borderColor="var(--dm-primary, #007bff)"),l.appendChild(n)}l.appendChild(c(dc.html("chevron-right",{size:14}),()=>this.nextPage(),this._currentPage===s.totalPages,!0,"Next page")),l.appendChild(c(dc.html("chevrons-right",{size:14}),()=>this.lastPage(),this._currentPage===s.totalPages,!0,"Last page")),n.appendChild(r),n.appendChild(o),n.appendChild(l),i.appendChild(n)}return this.element.appendChild(i),this._reinitRenderedContent(),e.onRender&&e.onRender(this),this}_reinitRenderedContent(){try{dc.scan(this.element)}catch{}const e="undefined"!=typeof window&&window.Domma&&window.Domma.elements&&window.Domma.elements.tooltip;"function"==typeof e&&this.element.querySelectorAll("[data-tooltip]").forEach(t=>{try{e(t,{position:"top",trigger:"hover",delay:{show:200,hide:0}})}catch{}})}_addEventHandler(e,t,n){e.addEventListener(t,n),this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push({event:t,handler:n})}_clearEventListeners(){for(const[e,t]of this._eventListeners)for(const{event:n,handler:s}of t)e.removeEventListener(n,s);this._eventListeners.clear()}_restoreIconsBeforeRebuild(){this.element.querySelectorAll('svg[data-icon-processed="true"][data-original-icon]').forEach(e=>{const t=e.getAttribute("data-original-icon");if(t){const n=document.createElement("span");n.setAttribute("data-icon",t);const s=e.getAttribute("data-icon-size"),i=e.getAttribute("data-icon-color")||e.getAttribute("data-icon-colour"),o=e.getAttribute("data-icon-class");s&&n.setAttribute("data-icon-size",s),i&&n.setAttribute("data-icon-colour",i),o&&n.setAttribute("data-icon-class",o),e.replaceWith(n)}})}on(e,t){if(["sort","filter","page","select","edit","render"].includes(e)){const n="on"+e.charAt(0).toUpperCase()+e.slice(1);this.options[n]=t}return this}off(e){const t="on"+e.charAt(0).toUpperCase()+e.slice(1);return this.options[t]=null,this}refresh(){return this._applyFiltersAndSort(),this.render(),this}destroy(){this._clearEventListeners(),this.element&&(this.element.innerHTML="")}}const pc={_instances:new Map,create(e,t={}){const n="string"==typeof e?document.querySelector(e):e,s=new uc(n,t);return n&&this._instances.set(n,s),s},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()}},mc=["fontFamily","fontSize","fontWeight","fontStyle","fontVariant","fontStretch","fontFeatureSettings","fontKerning","fontVariationSettings","lineHeight","letterSpacing","wordSpacing","textIndent","textAlign","textTransform","direction","tabSize","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],fc=new WeakMap,_c=new WeakMap,gc=new Set(["text","search","url","tel"]);function vc(e){return!!e&&!e.disabled&&!e.readOnly&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName&&gc.has(e.type)||"true"===e.getAttribute?.("contenteditable")||""===e.getAttribute?.("contenteditable"))}const bc="domma:editor-caret",yc="dm-editor-caret-preference";function kc(e=globalThis.window){try{const t=e.localStorage.getItem(bc);return["smooth","native"].includes(t)?t:"auto"}catch{return"auto"}}function wc(e){if(!vc(e))return{refresh(){},destroy(){}};const t=fc.get(e);if(t)return t;const n=e.ownerDocument,s=n.defaultView,i=e.parentElement,o="INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName,r="INPUT"===e.tagName,a=()=>e.getRootNode().activeElement===e;if(!i||!s?.ResizeObserver||!s.matchMedia)return{refresh(){},destroy(){}};const l=s.matchMedia("(prefers-reduced-motion: reduce)"),c=s.matchMedia("(forced-colors: active)");let h="",d=!1;const u=n.createElement("div");u.setAttribute("aria-hidden","true"),u.style.cssText="position:fixed;left:-100000px;top:0;visibility:hidden;pointer-events:none;box-sizing:border-box;height:auto;min-height:0;border-style:solid;";const p=n.createTextNode(""),m=n.createElement("span");u.append(p,m),o||n.body.appendChild(u);const f=n.createElement("div");f.className="dm-smooth-caret-layer",f.setAttribute("aria-hidden","true"),f.style.cssText="position:absolute;overflow:hidden;pointer-events:none;z-index:3;display:none;";const _=n.createElement("span");_.className="dm-smooth-caret",_.style.cssText="position:absolute;top:0;left:0;width:2px;pointer-events:none;will-change:transform;",f.appendChild(_),i.appendChild(f);let g=null,v=null,b=null,y=!1,k=!1,w=!1,x=null,M=!0,L=null,C=kc(s);const A=[];function E(e,t,n,s){e.addEventListener(t,n,s),A.push(()=>e.removeEventListener(t,n,s))}function S(){f.style.display="none",x=null,clearTimeout(v),b?.cancel(),L&&(L.value?e.style.setProperty("caret-color",L.value,L.priority):e.style.removeProperty("caret-color"),L=null)}function $(){if(g=null,w)return;const t=o?n.getSelection():null,A=o?!t?.isCollapsed||!e.contains(t?.anchorNode):e.selectionStart!==e.selectionEnd,E="native"===C||"auto"===C&&l.matches;if(e.dataset.caretMode=c.matches?"forced-colors":E?"native"===C?"native":"system-reduced-motion":"smooth",!a()||!vc(e)||y||k||E||c.matches||A||!e.getClientRects().length)return void S();d||"static"!==s.getComputedStyle(i).position||(h=i.style.position,i.style.position="relative",d=!0);const $=s.getComputedStyle(e),z=e.getBoundingClientRect(),T=i.getBoundingClientRect();let B,j,O,D;if(o){const i=t.getRangeAt(0).cloneRange();let o=i.startContainer,r=1===o.nodeType?o:o.parentElement;if(1===o.nodeType){const e=o.childNodes[i.startOffset],t=o.childNodes[i.startOffset-1],a=e||t;if(a){const t=n.createTreeWalker(a,s.NodeFilter.SHOW_TEXT),l=[];if(3===a.nodeType&&a.length)l.push(a);else{let e;for(;e=t.nextNode();)e.length&&l.push(e)}const c=e?l[0]:l[l.length-1];c?(i.setStart(c,e?0:c.length),i.collapse(!0),o=c):1===a.nodeType&&"BR"!==a.tagName&&(r=a)}}let a=i.getClientRects()[0],l=!1;if((!a||!a.height)&&3===o.nodeType&&o.length){const e=i.startOffset;i.setStart(o,e>0?e-1:0),i.setEnd(o,e>0?e:1),a=i.getClientRects()[0],l=e>0}const c=1===o.nodeType?r:o.parentElement,h=s.getComputedStyle(c||e);if(D=parseFloat(h.lineHeight)||1.2*parseFloat(h.fontSize),O=a?.height||1.2*parseFloat(h.fontSize),a?.height)B=(l?a.right:a.left)-z.left,j=a.top-z.top;else{const t=(c||e).getBoundingClientRect();B=t.left-z.left+parseFloat(h.paddingLeft),j=t.top-z.top+parseFloat(h.paddingTop)}}else{for(const e of mc)u.style[e]=$[e];u.style.width=e.clientWidth+parseFloat($.borderLeftWidth)+parseFloat($.borderRightWidth)+"px",u.style.whiteSpace=r||"off"===e.wrap?"pre":"pre-wrap",u.style.overflowWrap=r||"off"===e.wrap?"normal":"break-word",p.data=e.value.slice(0,e.selectionStart),m.textContent=e.value.slice(e.selectionStart)||"";const t=m.getClientRects()[0];if(!t)return void S();const n=u.getBoundingClientRect();B=t.left-n.left-e.scrollLeft,D=parseFloat($.lineHeight)||1.2*parseFloat($.fontSize),O=Math.min(D,1.2*parseFloat($.fontSize)),j=r?e.clientTop+(e.clientHeight-O)/2:t.top-n.top-e.scrollTop}if(B<e.clientLeft||B>e.clientLeft+e.clientWidth||j+O<e.clientTop||j>=e.clientTop+e.clientHeight)return void S();const N=L?L.color:$.caretColor;f.style.left=z.left-T.left+i.scrollLeft-i.clientLeft+"px",f.style.top=z.top-T.top+i.scrollTop-i.clientTop+"px",f.style.width=z.width+"px",f.style.height=z.height+"px",_.style.height=O+"px",_.style.background="auto"===N||"transparent"===N?$.color:N,_.style.transition=!M&&x&&Math.abs(j-x.y)<1.5*D?"transform 100ms cubic-bezier(.2,.7,.3,1)":"none",_.style.transform=`translate(${B}px, ${j}px)`,f.style.display="block",L||(L={value:e.style.getPropertyValue("caret-color"),priority:e.style.getPropertyPriority("caret-color"),color:N},e.style.setProperty("caret-color","transparent","important")),b?.cancel(),_.style.opacity="1",clearTimeout(v),v=setTimeout(()=>{!w&&"none"!==f.style.display&&_.animate&&(b=_.animate([{opacity:1},{opacity:0}],{duration:1e3,iterations:1/0,easing:"steps(2, jump-none)"}))},500),x={x:B,y:j},M=!1}function z(e=!1){w||(M||=e,null===g&&(g=s.requestAnimationFrame($)))}for(const t of["input","keyup","select","selectionchange"])E(e,t,()=>z());E(n,"selectionchange",()=>{a()&&z()}),E(e,"focus",()=>z(!0)),E(e,"blur",S),E(s,"blur",S),E(s,"focus",()=>z(!0)),E(e,"scroll",()=>z(!0),{passive:!0}),E(e,"pointerdown",()=>{k=!0,S()}),E(n,"pointerup",()=>{k&&(k=!1,z(!0))}),E(e,"compositionstart",()=>{y=!0,S()}),E(e,"compositionend",()=>{y=!1,z(!0)});const T=e=>{C=e.type===yc?e.detail:kc(s),z(!0)};E(s,yc,T),E(s,"storage",T),E(n,"pointercancel",()=>{k=!1,z(!0)}),E(l,"change",()=>z(!0)),E(c,"change",()=>z(!0));const B=new s.ResizeObserver(()=>z(!0));B.observe(e),z(!0);const j={refresh(){z(!0)},destroy(){if(!w){w=!0,fc.delete(e),S(),null!==g&&s.cancelAnimationFrame(g),B.disconnect();for(const e of A)e();delete e.dataset.caretMode,u.remove(),f.remove(),d&&(i.style.position=h)}}};return fc.set(e,j),j}const xc={attach:wc,install:function(e=globalThis.document){if(!e?.addEventListener)return{destroy(){}};const t=_c.get(e);if(t)return t;const n=e.ownerDocument||e;let s=null;const i=()=>{s?.api.destroy(),s=null,o?.disconnect()},o=n.defaultView?.MutationObserver?new n.defaultView.MutationObserver(()=>{s&&!s.element.isConnected&&i()}):null,r=e=>{const t=(e.composedPath?.()||[e.target]).find(vc);t&&s?.element!==t&&(i(),fc.has(t)||(s={element:t,api:wc(t)},o?.observe(n,{childList:!0,subtree:!0})))},a=e=>{s&&(e.composedPath?.()||[e.target]).includes(s.element)&&i()};e.addEventListener("focusin",r,!0),e.addEventListener("focusout",a,!0);const l=n.activeElement;l&&r({target:l,composedPath:()=>[l]});const c={destroy(){i(),e.removeEventListener("focusin",r,!0),e.removeEventListener("focusout",a,!0),_c.delete(e)}};return _c.set(e,c),c},getPreference:kc,setPreference:function(e,t=globalThis.window){const n=["smooth","native"].includes(e)?e:"auto";try{t.localStorage.setItem(bc,n)}catch{}t.dispatchEvent(new t.CustomEvent(yc,{detail:n}))}},Mc={apiUrl:null,token:null,user:null,config:{},eventHandlers:{},initialized:!1,init(e={}){this.config={apiUrl:e.apiUrl||(()=>{if("undefined"==typeof window)return"http://localhost:3000/api";const{hostname:e,origin:t}=window.location;return"localhost"===e||"127.0.0.1"===e?`http://${e}:3000/api`:`${t}/api`})(),storageKey:e.storageKey||"auth_token",userStorageKey:e.userStorageKey||"auth_user",autoCheck:!1!==e.autoCheck},this.apiUrl=this.config.apiUrl,this.token=me.get(this.config.storageKey),this.user=me.get(this.config.userStorageKey),this.config.autoCheck&&this.token&&this._verifyToken().catch(e=>{this._isTokenRejection(e)&&this.emit("tokenExpired",null)}),this.initialized=!0},async login(e,t){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const n=await b.post(`${this.apiUrl}/auth/login`,{email:e,password:t});if(!n.success||!n.token)throw new Error(n.message||"Login failed");return this.token=n.token,this.user=n.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("login",this.user),this.user}catch(e){throw this.emit("error",e.message||"Login failed"),e}},async register(e,t,n){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const s=await b.post(`${this.apiUrl}/auth/register`,{email:e,password:t,name:n});if(!s.success||!s.token)throw new Error(s.message||"Registration failed");return this.token=s.token,this.user=s.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("register",this.user),this.user}catch(e){throw this.emit("error",e.message||"Registration failed"),e}},logout(){this.token=null,this.user=null,this._clearToken(),this._clearUser(),this.emit("logout",null)},getUser(){return this.user},isAuthenticated(){return!!this.token&&!!this.user},getHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}},getApiUrl(){return this.apiUrl},getRole(){return this.user?.role||null},hasRole(e){return this.user?.role===e},hasAnyRole(e){return e.includes(this.user?.role)},isAdmin(){return"admin"===this.user?.role},isSubscriber(){return"subscriber"===this.user?.role},isGuest(){return"guest"===this.user?.role},async _verifyToken(){if(!this.token)throw new Error("No token to verify");try{const e=await b.get(`${this.apiUrl}/auth/me`,{headers:this.getHeaders(),silent:!0});if(!e||!e.success||!e.user){const e=new Error("Token verification failed");throw e.tokenRejected=!0,e}return this.user=e.user,this._storeUser(this.user),this.user}catch(e){throw this._isTokenRejection(e)&&(e.tokenRejected=!0,this._clearToken(),this._clearUser()),e}},_isTokenRejection:e=>!!e&&(!0===e.tokenRejected||401===e.status||403===e.status),_storeToken(e){me.set(this.config.storageKey,e)},_storeUser(e){me.set(this.config.userStorageKey,e)},_clearToken(){me.remove(this.config.storageKey),this.token=null},_clearUser(){me.remove(this.config.userStorageKey),this.user=null},on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)},off(e,t){this.eventHandlers[e]&&(this.eventHandlers[e]=t?this.eventHandlers[e].filter(e=>e!==t):[])},emit(e,t){this.eventHandlers[e]&&this.eventHandlers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in auth event handler for '${e}':`,t)}})}};class Lc extends C{static componentName="login-form";static defaults={emailPlaceholder:"your@email.com",passwordPlaceholder:"Enter your password",buttonText:"Login",showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-login-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n required>\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="email"]').value,n=e.querySelector('[name="password"]').value;this.options.onSubmit&&this.options.onSubmit(t,n);try{await Mc.login(t,n),this.options.onSuccess&&this.options.onSuccess(Mc.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}}class Cc extends C{static componentName="register-form";static defaults={namePlaceholder:"Your name",emailPlaceholder:"your@email.com",passwordPlaceholder:"Create a password",buttonText:"Register",minPasswordLength:6,showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-register-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Name</label>':""}\n <input\n type="text"\n class="form-input"\n name="name"\n placeholder="${e.namePlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Confirm Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="confirmPassword"\n placeholder="Re-enter your password"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n \x3c!-- Honeypot field - hidden from users, bots will fill it --\x3e\n <div class="form-group" style="position: absolute; left: -9999px; opacity: 0; pointer-events: none;" aria-hidden="true">\n <label for="website">Website</label>\n <input\n type="text"\n class="form-input"\n name="website"\n id="website"\n tabindex="-1"\n autocomplete="off">\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="name"]').value,n=e.querySelector('[name="email"]').value,s=e.querySelector('[name="password"]').value,i=e.querySelector('[name="confirmPassword"]').value;if(e.querySelector('[name="website"]').value)return console.warn("[Auth] Honeypot triggered - possible bot detected"),void(this.options.onError&&this.options.onError(new Error("Registration failed. Please try again.")));if(s===i){this.options.onSubmit&&this.options.onSubmit(n,s,t);try{await Mc.register(n,s,t),this.options.onSuccess&&this.options.onSuccess(Mc.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}else this.options.onError&&this.options.onError(new Error("Passwords do not match. Please try again."))}}class Ac extends C{static componentName="auth-tabs";static defaults={activeTab:"login",loginText:"Login",registerText:"Register",onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();this.element.querySelectorAll("[data-tab]").forEach(e=>{this._addEventListener(e,"click",()=>{this.switchTab(e.getAttribute("data-tab"))})})}render(){const e=this.options,t=`\n <div class="btn-group btn-group-block" style="margin-bottom: 1.5rem;">\n <button class="btn ${"login"===e.activeTab?"active":""}" data-tab="login">\n ${e.loginText}\n </button>\n <button class="btn ${"register"===e.activeTab?"active":""}" data-tab="register">\n ${e.registerText}\n </button>\n </div>\n `;this.element.innerHTML=t}switchTab(e){this.options.activeTab=e;this.element.querySelectorAll("[data-tab]").forEach(t=>{t.getAttribute("data-tab")===e?t.classList.add("active"):t.classList.remove("active")}),this.options.onChange&&this.options.onChange(e)}}class Ec extends C{static componentName="user-info";static defaults={showIcon:!0,showRole:!0,logoutText:"Logout",onLogout:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.render(),this._addEventListener(this.element,"click",e=>{e.target.closest?.(".auth-logout-btn")&&this.handleLogout()}),this._onAuthChange=()=>this.render(),Mc.on("login",this._onAuthChange),Mc.on("logout",this._onAuthChange))}destroy(){Mc.off("login",this._onAuthChange),Mc.off("logout",this._onAuthChange),super.destroy()}render(){const e=this.options,t=Mc.getUser();if(!t)return void(this.element.innerHTML="");this.element.innerHTML="";const n=document.createElement("div");n.className="auth-user-info";const s=document.createElement("span");if(s.className="auth-user-email",e.showIcon){const e=document.createElement("span");e.setAttribute("data-icon","user"),e.setAttribute("data-icon-size","18"),s.appendChild(e)}const i=document.createTextNode(t.email);if(s.appendChild(i),!1!==e.showRole&&t.role){const e={admin:"badge-danger",subscriber:"badge-primary",guest:"badge-secondary"}[t.role]||"badge-secondary",n=document.createElement("span");n.className=`badge ${e}`,n.textContent=t.role.charAt(0).toUpperCase()+t.role.slice(1),s.appendChild(n)}const o=document.createElement("button");o.className="auth-logout-btn",o.textContent=e.logoutText,n.appendChild(s),n.appendChild(o),this.element.appendChild(n)}handleLogout(){Mc.logout(),this.options.onLogout&&this.options.onLogout()}}Mc.LoginForm=Lc,Mc.RegisterForm=Cc,Mc.AuthTabs=Ac,Mc.UserInfo=Ec,Mc.createLoginForm=(e,t)=>new Lc(e,t),Mc.createRegisterForm=(e,t)=>new Cc(e,t),Mc.createAuthTabs=(e,t)=>new Ac(e,t),Mc.createUserInfo=(e,t)=>new Ec(e,t);const Sc={_routes:[],_views:{},_currentRoute:null,_container:null,_defaultRoute:"/",_notFoundView:null,_middleware:[],_transitioning:!1,_routing:!1,_missedChange:!1,_shownPath:null,_transitions:{},_initialised:!1,_templateCache:{},init(e={}){if(this._initialised)return console.warn("[Domma Router] Already initialised"),this;if(this._container=document.querySelector(e.container),!this._container)throw new Error(`[Domma Router] Container "${e.container}" not found`);return this._routes=e.routes||[],this._views=e.views||{},this._defaultRoute=e.default||"/",this._notFoundView=e.notFound||"404",this._transitions=e.transitions||{enter:"fadeIn",leave:"fadeOut",duration:200},this._onHashChange=()=>this._runRouteChange(),window.addEventListener("hashchange",this._onHashChange),this._runRouteChange(),this._initialised=!0,fl.publish("router:ready",{router:this}),this},navigate(e,t={}){this._initialised?t.replace?window.location.replace(`#${e}`):window.location.hash=e:console.error("[Domma Router] Router not initialised. Call R.init() first.")},back(){window.history.back()},forward(){window.history.forward()},current(){return this._currentRoute},view(e,t){return this._views[e]=t,this},route(e){return this._routes.push(e),this},use(e){return this._middleware.push(e),this},destroy(){this._onHashChange&&(window.removeEventListener("hashchange",this._onHashChange),this._onHashChange=null),this._routes=[],this._views={},this._middleware=[],this._currentRoute=null,this._shownPath=null,this._routing=!1,this._missedChange=!1,this._initialised=!1},_runRouteChange(){const e=this._handleRouteChange();return e&&"function"==typeof e.catch&&e.catch(e=>this._reportError(e,window.location.hash.slice(1)||this._defaultRoute)),e},_reportError(e,t,n){console.error(`[Domma Router] Error on ${t}:`,e),fl.publish("router:error",{error:e,route:t,view:n})},async _handleRouteChange(){if(this._routing||this._transitioning)this._missedChange=!0;else{this._routing=!0;try{await this._routeOnce();let e=0;for(;this._missedChange&&e<5;e++){this._missedChange=!1;const e=window.location.hash.slice(1)||this._defaultRoute;if(this._shownPath===e)break;await this._routeOnce()}this._missedChange&&e>=5&&setTimeout(()=>this._handleRouteChange(),0)}finally{this._routing=!1,this._missedChange=!1}}},async _routeOnce(){const e=window.location.hash.slice(1)||this._defaultRoute,{route:t,params:n}=this._matchRoute(e);if(!t){const t=await this._renderNotFound(e);return this._matchRoute(e).route||(this._shownPath=e),t}const s=this._currentRoute,i={...t,params:n,query:this._parseQuery(e),path:e},o=await this._runMiddleware(i,s);if(!0===o){if(s?.onLeave){if(!1===await s.onLeave())return void this._restoreAddress(e)}if(fl.publish("router:beforeChange",{from:s,to:i}),t.onEnter){if(!1===await t.onEnter(n,i))return void this._restoreAddress(e)}t.title&&(document.title=t.title),await this._renderView(t.view,n),this._currentRoute=i,this._shownPath=e,fl.publish("router:afterChange",{from:s,to:i})}else o&&"string"==typeof o.redirect?window.location.replace(`#${o.redirect}`):this._restoreAddress(e)},_restoreAddress(e){const t=this._shownPath;if(null==t||t===e)return;(window.location.hash.slice(1)||this._defaultRoute)===e&&window.history&&"function"==typeof window.history.replaceState&&window.history.replaceState(window.history.state,"",`#${t}`)},_stripQuery(e){const t=String(e),n=t.indexOf("?");return-1===n?t:t.slice(0,n)},_parseQuery(e){const t=String(e),n=t.indexOf("?");if(-1===n)return{};try{return Object.fromEntries(new URLSearchParams(t.slice(n+1)))}catch{return{}}},_decode(e){try{return decodeURIComponent(e)}catch{return e}},_matchRoute(e){e=this._stripQuery(e);for(const t of this._routes){const n=this._extractParams(t.path,e);if(null!==n)return{route:t,params:n}}return{route:null,params:{}}},_extractParams(e,t){const n=e.split("/").filter(Boolean),s=t.split("/").filter(Boolean);if(n.length!==s.length)return null;const i={};for(let e=0;e<n.length;e++)if(n[e].startsWith(":"))i[n[e].slice(1)]=this._decode(s[e]);else if(n[e]!==s[e]&&n[e]!==this._decode(s[e]))return null;return i},async _runMiddleware(e,t){for(const n of this._middleware){let s=!1,i=null;const o=e=>{s=!0,"string"==typeof e&&(i=e)};if(await n(e,t,o),!s)return!1;if(null!==i)return{redirect:i}}return!0},async _renderView(e,t){this._transitioning=!0;try{const n=this._views[e];if(!n)return void console.error(`[Domma Router] View "${e}" not found`);const s=_(this._container);await new Promise(e=>{s.fadeOut(this._transitions.duration,e)}),await this._renderContent(n,t,s),await new Promise(e=>{s.fadeIn(this._transitions.duration,e)})}catch(t){this._showContainer(),this._reportError(t,window.location.hash.slice(1)||this._defaultRoute,e)}finally{this._transitioning=!1}},_showContainer(){const e=this._container&&(this._container[0]||this._container);e&&e.style&&(e.style.display="",e.style.opacity="",e.style.transition="")},async _loadTemplate(e){if(this._templateCache[e])return this._templateCache[e];try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template: ${e} (${t.status})`);const n=await t.text();return this._templateCache[e]=n,n}catch(e){throw console.error("[Domma Router] Template load error:",e),e}},async _renderContent(e,t,n){let s;if("object"==typeof e&&e.component&&!Array.isArray(e)){const s=e.component,i=n[0]||n,o="function"==typeof e.props?e.props(t):e.props||{},r=document.createElement(s);for(const[e,t]of Object.entries(o)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?r.setAttribute(n,""):!1!==t&&null!=t&&r.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;i.firstChild;)i.removeChild(i.firstChild);return i.appendChild(r),void("function"==typeof e.onMount&&e.onMount(n))}if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(s=await e(t),n.html(s,{safe:!1}),dc.scan(this._container)):"string"==typeof e&&(s=this._renderTemplate(e,t),n.html(s,{safe:!1}),dc.scan(this._container));else{let i=e.template;!i&&e.templateUrl&&(i=await this._loadTemplate(e.templateUrl));let o={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));o=Object.fromEntries(n)}"function"==typeof i?s=await i(t):"string"==typeof i&&(s=this._renderTemplate(i,t,o)),n.html(s,{safe:!1}),dc.scan(this._container),e.onMount&&"function"==typeof e.onMount&&e.onMount(n)}},_renderTemplate:(e,t,n={})=>"function"==typeof y.render?y.render(e,t||{},{partials:n}):e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]||""),async _renderNotFound(e){if(this._views[this._notFoundView])await this._renderView(this._notFoundView,{path:e});else{const t=this._container;t.textContent="";const n=document.createElement("div");n.style.cssText="text-align: center; padding: 4rem 1rem;";const s=document.createElement("h1");s.style.cssText="font-size: 4rem; margin-bottom: 1rem;",s.textContent="404";const i=document.createElement("p");i.style.cssText="font-size: 1.25rem; color: #666;",i.textContent=`Page not found: ${e}`;const o=document.createElement("a");o.href="#/",o.style.cssText="color: #3b82f6; text-decoration: underline; margin-top: 1rem; display: inline-block;",o.textContent="Go Home",n.appendChild(s),n.appendChild(i),n.appendChild(o),t.appendChild(n)}}},$c=new Set(["zero","one","two","few","many","other"]),zc=new Set(["ordinal","select"]),Tc=/^=-?\d+(\.\d+)?$/,Bc=/\{([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\}/g,jc=new Set(["ar","arc","ckb","dv","fa","he","iw","ks","ps","sd","syr","ug","ur","yi","ji"]),Oc=new Set(["Arab","Hebr","Thaa","Syrc","Nkoo","Adlm","Rohg","Mand","Samr"]),Dc=new Map,Nc=new Map,Ic=new Map,Hc=new Map,Wc=new Map,Pc=new Set,Fc=new WeakMap;let Rc="en",Vc=[],qc=null,Uc=null;const Kc=e=>null!==e&&"object"==typeof e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e));function Yc(e){return!!Kc(e)&&("string"==typeof e.select||"string"==typeof e.other&&Object.keys(e).every(e=>$c.has(e)||zc.has(e)||Tc.test(e)))}function Gc(e,t,n){for(const s of Object.keys(e)){const i=e[s],o=t?`${t}.${s}`:s;if(null!=i)if("string"==typeof i)n.set(o,i);else if("number"==typeof i||"boolean"==typeof i)n.set(o,String(i));else if(Yc(i)){const e=Object.create(null);for(const t of Object.keys(i))e[t]=i[t];n.set(o,e)}else Kc(i)&&Gc(i,o,n)}return n}function Jc(e){if("string"!=typeof e||!e.trim())throw new RangeError(`Domma i18n: invalid locale "${e}"`);const t=e.trim().replace(/_/g,"-");return"undefined"!=typeof Intl&&"function"==typeof Intl.getCanonicalLocales?Intl.getCanonicalLocales(t)[0]:t}function Xc(e){const t=[],n=e.split("-");for(let e=n.length;e>0;e--)t.push(n.slice(0,e).join("-"));return t}function Zc(e){const t=new Set;for(const n of[e,...Vc])for(const e of Xc(n))t.add(e);return[...t]}function Qc(e,t){for(const n of Zc(t)){const t=Dc.get(n);if(t&&t.has(e))return{message:t.get(e),locale:n}}return null}function eh(e,t){if(!e)return;let n=e;for(const e of t.split(".")){if(null==n||"object"!=typeof n||!Object.prototype.hasOwnProperty.call(n,e))return;n=n[e]}return n}function th(e,t,n){return t&&"string"==typeof e&&-1!==e.indexOf("{")?e.replace(Bc,(e,s)=>{const i=eh(t,s);return void 0===i?e:n(null==i?"":String(i))}):e}function nh(e,t,n,s){if("string"==typeof e.select){const n=eh(t,e.select),s=null!=n&&"select"!==n&&"string"==typeof e[String(n)]?e[String(n)]:e.other;return"string"==typeof s?s:""}const i=Number(eh(t,"count"));if(!Number.isFinite(i))return e.other;if("string"==typeof e[`=${i}`])return e[`=${i}`];if(0===i&&"string"==typeof e.zero)return e.zero;const o=s&&s.ordinal||!0===e.ordinal?"ordinal":"cardinal";let r="other";try{r=function(e,t){return oh("plural",e,{type:t},()=>new Intl.PluralRules(e,{type:t}))}(n,o).select(i)}catch{}return"string"==typeof e[r]?e[r]:e.other}function sh(e,t){const n=Wc.get(e);if(n)for(const s of[...n])try{s(t)}catch(t){console.error(`Domma i18n: error in "${e}" listener`,t)}"undefined"!=typeof document&&"undefined"!=typeof CustomEvent&&document.dispatchEvent(new CustomEvent(`dm:i18n:${e}`,{detail:t}))}function ih(e){if(!e||"object"!=typeof e)return[Rc,void 0];const{locale:t,...n}=e;return[t?Jc(t):Rc,n]}function oh(e,t,n,s){const i=`${e}|${t}|${n?JSON.stringify(n):""}`;let o=Hc.get(i);return o||(o=s(),Hc.set(i,o)),o}const rh={add(e,t){const n=Jc(e);if(!Kc(t))return rh;let s=Dc.get(n);s||(s=new Map,Dc.set(n,s));for(const[e,n]of Gc(t,"",new Map))s.set(e,n);return rh},load(e,t,n={}){const s=Jc(e),i="function"==typeof t;let o=Nc,r=`${s}|${i?"":String(t).replace("{locale}",s)}`;if(i&&(Ic.has(s)||Ic.set(s,new Map),o=Ic.get(s),r=t),o.has(r)&&!n.reload)return o.get(r);const a=(i?Promise.resolve().then(()=>t(s)):b.get(String(t).replace("{locale}",s))).then(e=>{const t=Kc(e)?e:{};return rh.add(s,t),sh("loaded",{locale:s,messages:t}),Zc(Rc).includes(s)&&rh.translate(),t},e=>{throw o.get(r)===a&&o.delete(r),e});return o.set(r,a),a},locale(e){if(void 0===e)return Rc;const t=Jc(e);if(t===Rc)return Rc;const n=Rc;return Rc=t,Uc&&me.set(Uc,t),ch(t),sh("change",{locale:t,previous:n}),rh.translate(),Rc},fallback:e=>(void 0===e||(Vc=(Array.isArray(e)?e:[e]).filter(Boolean).map(Jc)),[...Vc]),has:(e,t={})=>null!==Qc(e,t.locale?Jc(t.locale):Rc),t:(e,t,n={})=>lh(e,t,n,String),html:(e,t,n={})=>lh(e,t,n,o),onMissing:e=>(qc="function"==typeof e?e:null,rh),on:(e,t)=>"function"!=typeof t?()=>{}:(Wc.has(e)||Wc.set(e,new Set),Wc.get(e).add(t),()=>rh.off(e,t)),off:(e,t)=>(t?Wc.get(e)?.delete(t):Wc.delete(e),rh),locales:()=>[...Dc.keys()],dir(e=Rc){const t=Jc(e);try{const e=new Intl.Locale(t),n="function"==typeof e.getTextInfo?e.getTextInfo():e.textInfo;if(n&&n.direction)return"rtl"===n.direction?"rtl":"ltr";if(e.script)return Oc.has(e.script)?"rtl":"ltr"}catch{}const n=t.split("-"),s=n.find(e=>4===e.length);return s?Oc.has(s[0].toUpperCase()+s.slice(1).toLowerCase())?"rtl":"ltr":jc.has(n[0].toLowerCase())?"rtl":"ltr"},translate(e){if("undefined"==typeof document)return 0;const t="[data-i18n],[data-i18n-html],[data-i18n-attr]",n=new Set;for(const s of function(e){return null==e?[document]:"string"==typeof e?[...document.querySelectorAll(e)]:"function"!=typeof e.get||"number"!=typeof e.length||e.nodeType?"number"!=typeof e.length||e.nodeType?[e]:[...e]:e.get()}(e))s&&(1===s.nodeType&&s.matches(t)&&n.add(s),"function"==typeof s.querySelectorAll&&s.querySelectorAll(t).forEach(e=>n.add(e)));for(const e of n)fh(e);return n.size},detect(e={}){const{from:t=["storage","navigator","html"],supported:n,fallback:s,apply:i=!0}=e;e.storageKey&&(Uc=e.storageKey);const o=Array.isArray(n)&&n.length?n.map(Jc):null,r=e=>{let t;try{t=Jc(e)}catch{return null}if(!o)return t;if(o.includes(t))return t;const n=t.split("-")[0];return o.find(e=>e===n)||o.find(e=>e.split("-")[0]===n)||null};let a=null;for(const e of t){let t=[];"storage"===e&&Uc?t=[me.get(Uc)]:"navigator"===e&&"undefined"!=typeof navigator?t=navigator.languages&&navigator.languages.length?[...navigator.languages]:[navigator.language]:"html"===e&&"undefined"!=typeof document&&document.documentElement&&(t=[document.documentElement.getAttribute("lang")]);for(const e of t)if("string"==typeof e&&e&&(a=r(e)))break;if(a)break}const l=a||(s?Jc(s):Rc);return i&&(l===Rc?(Uc&&me.set(Uc,l),ch(l)):rh.locale(l)),l},number(e,t){const[n,s]=ih(t);return oh("number",n,s,()=>new Intl.NumberFormat(n,s)).format(e)},currency(e,t,n){const[s,i]=ih(n),o={...i,style:"currency",currency:t};return oh("number",s,o,()=>new Intl.NumberFormat(s,o)).format(e)},date(e,t){const n=(s=e)instanceof Date?s:s&&"function"==typeof s.toDate?s.toDate():null==s?new Date:new Date(s);var s;if(Number.isNaN(n.getTime()))return"";const[i,o]=ih(t);return oh("date",i,o,()=>new Intl.DateTimeFormat(i,o)).format(n)},relative(e,t,n){const[s,i]=ih(n);return oh("relative",s,i,()=>new Intl.RelativeTimeFormat(s,i)).format(e,t)},list(e,t){const[n,s]=ih(t);return oh("list",n,s,()=>new Intl.ListFormat(n,s)).format([...e].map(String))},reset:()=>(Dc.clear(),Nc.clear(),Ic.clear(),Hc.clear(),Wc.clear(),Pc.clear(),uh.clear(),Rc="en",Vc=[],qc=null,Uc=null,rh)};function ah(e,t,n,i){const o=n&&n.locale?Jc(n.locale):Rc,r=Qc(e,o);let a;if(r)a="string"==typeof r.message?r.message:nh(r.message,t,r.locale,n);else if(a=function(e,t){let n;if(sh("missing",{key:e,locale:t}),qc)try{n=qc(e,t)}catch(e){console.error("Domma i18n: error in onMissing hook",e)}const i=`${t}|${e}`;return Pc.has(i)||!1===s("i18nWarnings",!0)||"undefined"==typeof console||(Pc.add(i),console.warn(`Domma i18n: missing translation "${e}" for locale "${t}" (window.DommaOptions = {i18nWarnings: false} silences this)`)),"string"==typeof n?n:void 0}(e,o),void 0===a)return null;return th(a,t,i)}function lh(e,t,n,s){const i=ah(e,t,n,s);return null!==i?i:n&&"string"==typeof n.default?th(n.default,t,s):s===String?e:o(e)}function ch(e){"undefined"!=typeof document&&document.documentElement&&(document.documentElement.setAttribute("lang",e),document.documentElement.setAttribute("dir",rh.dir(e)))}const hh=/^(on.*|style|srcdoc|formaction)$/i,dh=new Set(["href","xlink:href","src","action","poster","cite","background","data","codebase","longdesc","manifest","ping","usemap","lowsrc","dynsrc"]),uh=new Set;function ph(e,t){uh.has(e)||"undefined"==typeof console||(uh.add(e),console.warn(t))}function mh(e,t,n){const s=e.toLowerCase();if("srcset"===s){if(t.split(",").every(e=>!e.trim()||l(e.trim().split(/\s+/)[0])))return t}else if(!dh.has(s)||l(t))return t;return ph(`url:${s}:${n}`,`Domma i18n: "${n}" is not a safe URL for ${s}; data-i18n-attr only writes http(s), mailto, tel or relative URLs`),null}function fh(e){let t=Fc.get(e);t||(t={text:e.textContent,html:e.innerHTML,attrs:Object.create(null)},Fc.set(e,t));const n=function(e){const t=e.getAttribute("data-i18n-params");if(t)try{const e=JSON.parse(t);return Kc(e)?e:void 0}catch{return void console.warn("Domma i18n: data-i18n-params is not valid JSON",e)}}(e),s=e.getAttribute("data-i18n-html"),i=e.getAttribute("data-i18n");if(s){const i=ah(s,n,null,o);e.innerHTML=null===i?t.html:u(i)}else if(i){const s=ah(i,n,null,String);e.textContent=null===s?t.text:s}const r=e.getAttribute("data-i18n-attr");if(r)for(const[s,i]of function(e){return e.split(";").map(e=>{const t=e.lastIndexOf(":");if(-1===t)return null;const n=e.slice(0,t).trim(),s=e.slice(t+1).trim();return n&&s?[n,s]:null}).filter(Boolean)}(r)){if(hh.test(s)){ph(`attr:${s.toLowerCase()}`,`Domma i18n: data-i18n-attr will not write "${s}" (event handlers, style, srcdoc and formaction are refused)`);continue}s in t.attrs||(t.attrs[s]=e.getAttribute(s));let o=ah(i,n,null,String);null!==o&&(o=mh(s,o,i)),null!==o?e.setAttribute(s,o):null==t.attrs[s]?e.removeAttribute(s):e.setAttribute(s,t.attrs[s])}}const _h=new Map,gh=new Map;function vh(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function bh(e,t={}){if(null==e)return void 0!==t.default?"function"==typeof t.default?t.default():t.default:null;const n=t.type;if(n===fl.types?.number||"number"===n){const t=Number(e);return isNaN(t)?null:t}if(n===fl.types?.boolean||"boolean"===n)return""===e||"true"===e||"false"!==e&&Boolean(e);if(n===fl.types?.array||"array"===n||n===fl.types?.object||"object"===n)try{return JSON.parse(e)}catch{return e}return e}function yh(e,t){if(gh.has(e))return void console.warn(`[Domma Component] "${e}" is already registered.`);const{template:n,templateUrl:s,props:i={},data:o,computed:r={},methods:a={},onBeforeMount:l,onMount:c,onUpdated:h,onBeforeUnmount:d,onUnmount:u,onPropsChanged:p,style:m=""}=t,f=Object.keys(i),_=f.map(vh);class g extends As{static get observedAttributes(){return _}constructor(){super(),this._model=null,this._props={},this._bindings=null,this._template=null,this._contentRoot=null,this._context=null,this._unsubs=[],this._computeds=new Map,this._effects=[],this._updateQueued=!1,this._teardown=!1}connectedCallback(){if(this._initialised)return this._teardown=!1,void c?.call(this._ctx());this._initialised=!0,this._initProps(),this._initModel(),this._initComputeds(),this._injectStyles(),this._contentRoot=document.createElement("div"),this._contentRoot.className="dm-component-root",this.shadowRoot.appendChild(this._contentRoot),l?.call(this._ctx()),this._renderComponent().then(()=>{this._wireBindings(),c?.call(this._ctx())})}disconnectedCallback(){this._teardown=!0,d?.call(this._ctx()),this._cleanup();for(const e of this._unsubs)e();this._unsubs=[];for(const e of this._effects)e.dispose();this._effects=[];for(const e of this._computeds.values())e.dispose();this._computeds.clear(),this._model&&this._model.destroy(),u?.call(this._ctx())}attributeChangedCallback(e,t,n){if(t===n)return;const s=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(this._props[s]=bh(n,i[s]),p?.call(this._ctx(),s,t,n),this._initialised&&this._bindings){for(const e of this._computeds.values())e.invalidate();this._rerenderFull()}}_initProps(){for(const e of f){const t=vh(e),n=this.hasAttribute(t)?this.getAttribute(t):null;this._props[e]=bh(n,i[e])}}_initModel(){const e=o?o():{},t={};for(const n of Object.keys(e))t[n]={};this._model=fl.create(t,e)}_initComputeds(){for(const[e,t]of Object.entries(r))this._computeds.set(e,Si(()=>t.call(this._ctx()),{label:e}))}async _renderComponent(){let e=n;!e&&s&&(e=await async function(e){if(_h.has(e))return _h.get(e);const t=await fetch(e);if(!t.ok)throw new Error(`[Domma Component] Failed to load template: ${e} (${t.status})`);const n=await t.text();return _h.set(e,n),n}(s)),e?(this._template=e,this._bindings=Ja.compile(e,this._mergeData(),this._contentRoot,(e,t)=>y.render(e,t))):this._contentRoot.textContent=""}_rerenderFull(){this._bindings&&(this._bindings.rerenderAll(this._mergeData()),h?.call(this._ctx()))}_wireBindings(){if(this._bindings){for(const e of this._bindings.bindings){const t=[...e.deps].filter(e=>this._computeds.has(e)||!Object.prototype.hasOwnProperty.call(this._props,e));if(0===t.length)continue;let n=!1;const s=$i(()=>{for(const e of t)this._readBound(e);n?zi(()=>{this._bindings.update(e.id,this._mergeData()),this._scheduleUpdate()}):n=!0},{label:`${this.tagName.toLowerCase()}:${e.id}`});this._effects.push(s)}this._wireUpdateWatcher()}}_wireUpdateWatcher(){if(!h||!this._model)return;let e=!1;const t=$i(()=>{this._model.get(),e?zi(()=>this._scheduleUpdate()):e=!0},{label:`${this.tagName.toLowerCase()}:updated`});this._effects.push(t)}_readBound(e){return this._computeds.has(e)?this._computeds.get(e).get():Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._model?this._model.get(e):void 0}_scheduleUpdate(){this._updateQueued||(this._updateQueued=!0,Promise.resolve().then(()=>{this._updateQueued=!1,!this._teardown&&this._initialised&&this._bindings&&h?.call(this._ctx())}))}_getStyles(){return""+(m||"")}_ctx(){if(this._context)return this._context;const e=this,t={get data(){return e._model?e._model.tracked():{}},get props(){return{...e._props}},get root(){return e.shadowRoot},get el(){return e},set(t){e._model&&e._model.set(t)}};for(const[n,s]of Object.entries(r))Object.defineProperty(t,n,{get(){const t=e._computeds.get(n);return t?t.get():s.call(e._ctx())},enumerable:!0,configurable:!0});for(const[e,n]of Object.entries(a))t[e]=n.bind(t);return this._context=t,t}_mergeData(){const e=this._model?this._model.toJSON():{},t={};for(const[e,n]of this._computeds.entries())t[e]=n.get();const n={},s=this._ctx();for(const e of Object.keys(a))n[e]=s[e];const i={...n,...e,...this._props,...t},o=this._model;return ui(i,{onWrite:o?(e,t)=>o.set({[e]:t}):void 0})}}const v=e.includes("-")?e:`domma-${e}`;return customElements.define(v,g),gh.set(e,t),g}const kh={define:(e,t)=>yh(e,t),has:e=>gh.has(e),registry:()=>new Map(gh),get templateCache(){return _h}};let wh=!1!==s("cloak",!0);wh&&"undefined"!=typeof document&&document.body?document.body.classList.add("dm-cloaked"):wh&&"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",()=>{wh&&document.body.classList.add("dm-cloaked")});const xh=(e,t)=>_(e,t);xh.version="0.58.2",xh.buildInfo={version:"0.58.2",built:"25/10/2026 15:30",commit:"e547926"},xh.http=b,xh.utils=y,xh.setup=e=>(!1===e.cloak&&(wh=!1,"undefined"!=typeof document&&document.body&&(document.body.classList.remove("dm-cloaked"),document.body.classList.add("dm-ready"))),e.noStyles?B.init({disabled:!0}):(e.theme||e.autoDetectTheme)&&B.init({theme:e.theme,autoDetect:e.autoDetectTheme,persist:!1!==e.persistTheme}),e.scanIcons&&dc.scan(),$l.process(e)),xh.update=(e,t)=>$l.update(e,t),xh.config=e=>$l.config(e),xh.getComponent=e=>$l.getComponent(e),xh.reset=e=>$l.reset(e),xh.ready=e=>$l.ready(e),xh.models=fl,xh.elements=di,xh.effects=Sl,xh.dates=Pl,xh.tables=pc,xh.forms=gl,xh.smoothCaret=xc,xh.theme=B,xh.icons=dc,xh.storage=me,xh.auth=Mc,xh.router=Sc,xh.sanitize=p,xh.components=kh,xh.i18n=rh,xh.t=(e,t,n)=>rh.t(e,t,n),xh.component=(e,t)=>yh(e,t),xh.DesktopNotification=Fs;const Mh=xh,Lh=y,Ch=fl,Ah=Pl,Eh=me,Sh=Mc,$h=gl,zh=b,Th=di,Bh=dc,jh=pc,Oh=Sc,Dh={extend:fl.extend.bind(fl),pick:fl.pick.bind(fl),omit:fl.omit.bind(fl)};if(xh.M=Ch,xh.D=Ah,xh.S=Eh,xh.A=Sh,xh.F=$h,xh.H=zh,xh.E=Th,xh.I=Bh,xh.T=jh,xh.R=Oh,xh.B=Dh,xh.isDomma=e=>e instanceof f,function(e,i){const o={},r={};if(e.noConflict=(n=!1)=>{if("undefined"==typeof window)return e;const s=n?Object.keys(r).filter(e=>"Domma"!==e):t;for(const e of s)r[e]&&window[e]===r[e]&&(void 0===o[e]?delete window[e]:window[e]=o[e],delete r[e]);return e},"undefined"==typeof window)return e;const a=s("globals",!0),l=(e,t)=>{"safe"===a&&"Domma"!==e&&((e,t)=>void 0!==e&&e!==t&&!n(e))(window[e],t)||(o[e]=n(window[e])?void 0:window[e],r[e]=t,window[e]=t)};if(l("Domma",e),!1!==a)for(const[e,t]of Object.entries(i))l(e,t)}(xh,{$:Mh,_:Lh,M:Ch,D:Ah,S:Eh,A:Sh,F:$h,H:zh,E:Th,I:Bh,T:jh,R:Oh,B:Dh}),"undefined"!=typeof document&&"undefined"!=typeof window){const e=()=>{wh&&document.body.classList.contains("dm-cloaked")&&document.body.classList.add("dm-ready")};"complete"===document.readyState?setTimeout(e,0):window.addEventListener("load",e)}e.$=Mh,e.A=Sh,e.B=Dh,e.D=Ah,e.Domma=xh,e.E=Th,e.F=$h,e.H=zh,e.I=Bh,e.M=Ch,e.R=Oh,e.S=Eh,e.T=jh,e._=Lh,e.components=kh,e.default=xh,e.i18n=rh,e.smoothCaret=xc,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
10
|
//# sourceMappingURL=domma.min.js.map
|