var $=(...t)=>Object.prototype.hasOwnProperty.call(...t);function g(t){return typeof t>"u"}function h(t,e){return t instanceof e}function H(t,e){return Object.prototype.isPrototypeOf.call(e,t)}function R(t=null,e={}){return Object.create(t,e)}function v(...t){return Object.assign(...t)}function j(t,e){if(!t||!h(t,AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}var a={setDeleteAttr:nt,ssr:"",D:globalThis.document,N:globalThis.Node,F:globalThis.DocumentFragment,H:globalThis.HTMLElement,S:globalThis.SVGElement,M:globalThis.MutationObserver,q:t=>t||Promise.resolve()};function nt(t,e,n){if(Reflect.set(t,e,n),!!g(n)){if(Reflect.deleteProperty(t,e),h(t,a.H)&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var C="__dde_lifecyclesToEvents",x="dde:connected",w="dde:disconnected",z="dde:attributeChanged";var O=a.M?rt():new Proxy({},{get(){return()=>{}}});function rt(){let t=new Map,e=!1,n=s=>function(u){for(let i of u)if(i.type==="childList"){if(l(i.addedNodes,!0)){s();continue}_(i.removedNodes,!0)&&s()}},r=new a.M(n(f));return{observe(s){let u=new a.M(n(()=>{}));return u.observe(s,{childList:!0,subtree:!0}),()=>u.disconnect()},onConnected(s,u){p();let i=c(s);i.connected.has(u)||(i.connected.add(u),i.length_c+=1)},offConnected(s,u){if(!t.has(s))return;let i=t.get(s);i.connected.has(u)&&(i.connected.delete(u),i.length_c-=1,o(s,i))},onDisconnected(s,u){p();let i=c(s);i.disconnected.has(u)||(i.disconnected.add(u),i.length_d+=1)},offDisconnected(s,u){if(!t.has(s))return;let i=t.get(s);i.disconnected.delete(u),i.length_d-=1,o(s,i)}};function o(s,u){u.length_c||u.length_d||(t.delete(s),f())}function c(s){if(t.has(s))return t.get(s);let u={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(s,u),u}function p(){e||(e=!0,r.observe(a.D.body,{childList:!0,subtree:!0}))}function f(){!e||t.size||(e=!1,r.disconnect())}function d(){return new Promise(function(s){(requestIdleCallback||requestAnimationFrame)(s)})}async function m(s){t.size>30&&await d();let u=[];if(!h(s,a.N))return u;for(let i of t.keys())i===s||!h(i,a.N)||s.contains(i)&&u.push(i);return u}function l(s,u){let i=!1;for(let b of s){if(u&&m(b).then(l),!t.has(b))continue;let y=t.get(b);y.length_c&&(b.dispatchEvent(new Event(x)),y.connected=new WeakSet,y.length_c=0,y.length_d||t.delete(b),i=!0)}return i}function _(s,u){let i=!1;for(let b of s)u&&m(b).then(_),!(!t.has(b)||!t.get(b).length_d)&&((globalThis.queueMicrotask||setTimeout)(et(b)),i=!0);return i}function et(s){return()=>{s.isConnected||(s.dispatchEvent(new Event(w)),t.delete(s))}}}function vt(t,e,n){return typeof e=="function"&&(n=e,e=null),e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let p=c.length?new CustomEvent(t,v({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(p)}}function S(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}var B=t=>v({},typeof t=="object"?t:null,{once:!0});S.connected=function(t,e){return e=B(e),function(r){return r.addEventListener(x,t,e),r[C]?r:r.isConnected?(r.dispatchEvent(new Event(x)),r):(j(e.signal,()=>O.offConnected(r,t))&&O.onConnected(r,t),r)}};S.disconnected=function(t,e){return e=B(e),function(r){return r.addEventListener(w,t,e),r[C]||j(e.signal,()=>O.offDisconnected(r,t))&&O.onDisconnected(r,t),r}};var E=[{get scope(){return a.D.body},host:t=>t?t(a.D.body):a.D.body,prevent:!0}],q=new WeakMap,A={get current(){return E[E.length-1]},get host(){return this.current.host},get signal(){let{host:t}=this;if(q.has(t))return q.get(t);let e=new AbortController;return q.set(t,e),t(S.disconnected(()=>e.abort())),e.signal},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...E]},push(t={}){return E.push(v({},this.current,{prevent:!1},t))},pushRoot(){return E.push(E[0])},pop(){if(E.length!==1)return E.pop()}};S.host=(t,e=A.host)=>n=>e(()=>t(n));var D={isSignal(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function ot(t,e=!0){return e?v(D,t):(Object.setPrototypeOf(t,D),t)}function L(t){return H(t,D)&&t!==D?t:D}function Z(t,e,n,r){return t[(g(r)?"remove":"set")+e](n,r)}function G(t,e,n,r,o=null){return t[(g(r)?"remove":"set")+e+"NS"](o,n,r)}function W(t,e,n){if(Reflect.set(t,e,n),!!g(n))return Reflect.deleteProperty(t,e)}function J(t,e,n,r){return h(t,a.H)?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function Tt(t){return a.q(t)}function V(...t){return this.appendOriginal(...t),this}function ct(t){return t.append===V||(t.appendOriginal=t.append,t.append=V),t}var T;function I(t,e,...n){let r=L(this),o=0,c,p;switch((Object(e)!==e||r.isSignal(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1;let f=(...l)=>l.length?(o===1?n.unshift(...l):l.forEach(_=>_(p)),void 0):p;A.push({scope:t,host:f}),c=t(e||void 0);let d=h(c,a.F);if(c.nodeName==="#comment")break;let m=I.mark({type:"component",name:t.name,host:d?"this":"parentElement"});c.prepend(m),d&&(p=m);break}case t==="#text":c=N.call(this,a.D.createTextNode(""),e);break;case(t==="<>"||!t):c=N.call(this,a.D.createDocumentFragment(),e);break;case!!T:c=N.call(this,a.D.createElementNS(T,t),e);break;case!c:c=N.call(this,a.D.createElement(t),e)}return ct(c),p||(p=c),n.forEach(f=>f(p)),o&&A.pop(),o=2,c}I.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=a.D.createComment(``);return e&&(r.end=a.D.createComment("")),r};function Mt(t){let e=this;return function(...r){T=t;let o=I.call(e,...r);return T=void 0,o}}var P=new WeakMap,{setDeleteAttr:K}=a;function N(t,...e){if(!e.length)return t;P.set(t,X(t,this));for(let[n,r]of Object.entries(v({},...e)))Q.call(this,t,n,r);return P.delete(t),t}function Q(t,e,n){let{setRemoveAttr:r,s:o}=X(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(f,d)=>Q.call(c,t,f,d));let[p]=e;if(p==="=")return r(e.slice(1),n);if(p===".")return W(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return K(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return k(o,e,t,n,W.bind(null,t[e]));case"ariaset":return k(o,e,t,n,(f,d)=>r("aria-"+f,d));case"classList":return st.call(c,t,n)}return it(t,e)?K(t,e,n):r(e,n)}function X(t,e){if(P.has(t))return P.get(t);let r=(h(t,a.S)?G:Z).bind(null,t,"Attribute"),o=L(e);return{setRemoveAttr:r,s:o}}function st(t,e){let n=L(this);return k(n,"classList",t,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function it(t,e){if(!(e in t))return!1;let n=Y(t,e);return!g(n.set)}function Y(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||Y(t,e)}function k(t,e,n,r,o){let c=String;if(!(typeof r!="object"||r===null))return Object.entries(r).forEach(function([f,d]){f&&(f=new c(f),f.target=e,d=t.processReactiveAttribute(n,f,d,o),o(f,d))})}function $t(t,e=t){let n="\xB9\u2070",r="\u2713",o=Object.fromEntries(Array.from(e.querySelectorAll("slot")).filter(c=>!c.name.endsWith(n)).map(c=>[c.name+=n,c]));if(t.append=new Proxy(t.append,{apply(c,p,f){if(f[0]===e)return c.apply(t,f);for(let d of f){let m=(d.slot||"")+n;try{J(d,"remove","slot")}catch{}let l=o[m];if(!l)return;l.name.startsWith(r)||(l.childNodes.forEach(_=>_.remove()),l.name=r+m),l.append(d)}return t.append=c,t}}),t!==e){let c=Array.from(t.childNodes);t.append(...c)}return e}function Ht(t,e,n={}){let r=t.host||t;A.push({scope:r,host:(...p)=>p.length?p.forEach(f=>f(r)):r}),typeof n=="function"&&(n=n.call(r,r));let o=r[C];o||ut(r);let c=e.call(r,n);return o||r.dispatchEvent(new Event(x)),t.nodeType===11&&typeof t.mode=="string"&&r.addEventListener(w,O.observe(t),{once:!0}),A.pop(),t.append(c)}function ut(t){return F(t.prototype,"connectedCallback",function(e,n,r){e.apply(n,r),n.dispatchEvent(new Event(x))}),F(t.prototype,"disconnectedCallback",function(e,n,r){e.apply(n,r),(globalThis.queueMicrotask||setTimeout)(()=>!n.isConnected&&n.dispatchEvent(new Event(w)))}),F(t.prototype,"attributeChangedCallback",function(e,n,r){let[o,,c]=r;n.dispatchEvent(new CustomEvent(z,{detail:[o,c]})),e.apply(n,r)}),t.prototype[C]=!0,t}function F(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}var tt="__dde_memo",M=[];function U(t,e){if(!M.length)return e(t);let n=typeof t=="object"?JSON.stringify(t):t,[{cache:r,after:o}]=M;return o(n,$(r,n)?r[n]:e(t))}U.isScope=function(t){return t[tt]};U.scope=function(e,{signal:n,onlyLast:r}={}){let o=R();function c(...p){if(n&&n.aborted)return e.apply(this,p);let f=r?o:R();M.unshift({cache:o,after(m,l){return f[m]=l}});let d=e.apply(this,p);return M.shift(),o=f,d}return c[tt]=!0,c.clear=()=>o=R(),n&&n.addEventListener("abort",c.clear),c};export{N as assign,Q as assignAttribute,ct as chainableAppend,st as classListDeclarative,I as createElement,Mt as createElementNS,Ht as customElementRender,ut as customElementWithDDE,vt as dispatchEvent,I as el,Mt as elNS,ut as lifecyclesToEvents,U as memo,S as on,Tt as queue,ot as registerReactivity,A as scope,$t as simulateSlots};