/*! * Creaton.js v2.8.2 * (c) 2022-2023 | github.com/reacton-js * Released under the MIT License. */ "use strict";!function(){const a=/[A-Z]/g,u=new WeakMap,h=document.implementation.createHTMLDocument(),m={get(e,t){return e.hasOwnProperty(t)?e[t].value:e[t]},set(e,t,n){return e[t].value=n,!0}},p=new Set,g=new f,o=new CustomEvent("init-event",{bubbles:!0,composed:!0});async function w(e,t){var n=Date.now(),{root:a,template:o,state:r}=u.get(this);return e&&Object.assign(r,e),await(!t.before||t.before.call(r)),o.innerHTML=await(t.render?t.render.call(r):""),new s(a,o.content||o,a),o.innerHTML="",await(!t.after||t.after.call(r)),Date.now()-n+" ms"}function s(t,n,a,o=0){if(a){if(!n)return!t.removeChild(t.childNodes[o]);if(n.nodeType!==a.nodeType||n.nodeName!==a.nodeName)t.replaceChild(n.cloneNode(!0),t.childNodes[o]);else if(n.nodeValue!==a.nodeValue)a.nodeValue=n.nodeValue;else{if(!new.target&&(n.attributes&&e(n.attributes,a),a.$light))return!0;for(let e=0;e`(?<${t}>\\w+)`)}/?$`),document.addEventListener.call(this,...e)}getEventRegs(){return a}}}i.has(t)||(i.add(t),window.addEventListener("popstate",e=>{l(t,location.href.replace(location.origin,""),e.state)})),e&&(e=e.replace(location.origin,""),history.pushState(n,"",e),l(t,e,n))}function l(e,t,n){var a=e.getEventRegs();for(const s in a){var o,r=a[s].exec(t);r&&((o=new CustomEvent(s)).url=new URL(location.href),o.params=r.groups,e.dispatchEvent(o,n))}}function c(e,n,a=0){if(c.clean&&("STYLE"===e.nodeName||"SCRIPT"===e.nodeName||"TEMPLATE"===e.nodeName||8===e.nodeType))return!1;let t,o;if(e.$state){t=h.createElement(e.nodeName);for(const r of e.attributes)t.setAttribute(r.name,r.value)}else t=e.cloneNode(!1);n.append(t),"SLOT"===t.nodeName?(o=e.assignedNodes({flatten:!0}),c.slots.push(t)):o=(e.$shadow||e).childNodes;for(let e=0,t=0;ee.forEach(e=>"function"!=typeof e||function(c){const d=(c.mode||"").toLowerCase();var e=(c.extends||"").toLowerCase(),t=c.name.replace(a,(e,t)=>(0w.call(this,e,c),s=e=>t.querySelector(e),i=e=>t.querySelectorAll(e);var n=new c(a);const l=new Proxy(n,{get:(e,t,n)=>{switch(t){case"$state":return l;case"$props":return a;case"$host":return o;case"$update":return r;case"$":return s;case"$$":return i}return"symbol"==typeof t||t in e?Reflect.get(e,t,n):this[t]}});Object.defineProperties(this,{$state:{get(){if("closed"!==d)return l}},$props:{get(){if("closed"!==d)return a}},$host:{get(){if("closed"!==d)return o}},$update:{get(){if("closed"!==d)return r}},$:{get(){if("closed"!==d)return s}},$$:{get(){if("closed"!==d)return i}},$light:{value:t===this||!1},$shadow:{value:this.shadowRoot},$event:{value:f},$route:{value:v}}),u.set(this,{root:t,template:e,state:l}),this.addEventListener("init-event",e=>{p.delete(e.detail),0===p.size&&(e.stopPropagation(),f(g,"ok"))})}async connectedCallback(){await w.call(this,void 0,c),await(!c.connected||c.connected.call(u.get(this).state)),setTimeout(()=>{(o.detail=this).dispatchEvent(o)},0)}async disconnectedCallback(){await(!c.disconnected||c.disconnected.call(u.get(this).state))}async adoptedCallback(){await(!c.adopted||c.adopted.call(u.get(this).state))}attributeChangedCallback(...e){setTimeout(()=>!c.changed||c.changed.apply(u.get(this).state,e),0)}static get observedAttributes(){if(Array.isArray(c.attributes))return c.attributes}$entities(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}$tag(t,...n){let a="";for(let e=0;eg.addEventListener("ok",()=>{var e=document.createElement("template");c.clean=o,c.slots=[],c(n||document.children[0],e.content),a||c.slots.forEach(e=>e.replaceWith(...e.childNodes)),t(n?e.innerHTML:` `+e.innerHTML)}))}}();