@fluixi/dom 1.0.0-alpha.78 → 1.0.0-alpha.80

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Ke=Object.defineProperty;var In=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var jn=Object.prototype.hasOwnProperty;var Fn=(e,t)=>{for(var n in t)Ke(e,n,{get:t[n],enumerable:!0})},Hn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qn(t))!jn.call(e,o)&&o!==n&&Ke(e,o,{get:()=>t[o],enumerable:!(r=In(t,o))||r.enumerable});return e};var Vn=e=>Hn(Ke({},"__esModule",{value:!0}),e);var uo={};Fn(uo,{ClientOnly:()=>vt,Dynamic:()=>Tn,ErrorBoundary:()=>wn,FX_DATA_ID:()=>J,For:()=>yn,Index:()=>gn,Island:()=>on,JSX_PROPERTIES:()=>he,Match:()=>hn,NoSsr:()=>En,Portal:()=>bn,SVG_ELEMENTS:()=>Gn,SVG_NAMESPACE:()=>W,Show:()=>pn,Switch:()=>xn,VERSION:()=>Te,VOID_ELEMENTS:()=>zn,addClass:()=>Ge,addDelegatedEventListener:()=>Ce,addNativeEventListener:()=>ct,appendChildren:()=>tt,applyElementProp:()=>ge,applyProps:()=>fe,applyUse:()=>ut,asComponent:()=>Tr,asContext:()=>xr,asOutlet:()=>gr,asProvider:()=>hr,asRoute:()=>mr,asRouter:()=>pr,asRoutes:()=>yr,asSuspense:()=>br,bindPair:()=>gt,captureHydrationCursor:()=>Jt,checkRenderType:()=>Er,classMap:()=>Sn,cleanChildren:()=>L,cloneTemplate:()=>Me,closest:()=>Jn,createComponent:()=>pe,createDynamicElement:()=>Jr,createElement:()=>Qe,createNativeElement:()=>ue,createPortal:()=>yt,createRequestContext:()=>G,createTemplate:()=>Re,default:()=>co,delegate:()=>nr,delegateEvents:()=>ce,escapeFxJson:()=>ye,escapeHTML:()=>Ir,fnName:()=>Pr,generateID:()=>vr,getAttribute:()=>Ye,getGlobal:()=>dr,getLitEventName:()=>Bn,getLocals:()=>Et,getOffset:()=>tr,getRequestContext:()=>R,getRequestEvent:()=>Oe,getRequestLocals:()=>Le,getServerData:()=>me,getStableElementId:()=>Sr,getStyle:()=>Zn,handleRef:()=>j,hasClass:()=>Yn,holeContent:()=>lt,holeEnd:()=>at,holeScope:()=>st,html:()=>an,hydrate:()=>Y,hydrateAdvancePast:()=>B,hydrateIslands:()=>sn,indexArray:()=>Z.indexArray,initializeIntegration:()=>Hr,insert:()=>N,insertExpression:()=>se,intergartionInitialized:()=>Vr,isAccessor:()=>qr,isComponent:()=>S,isContext:()=>Bt,isCustomElement:()=>$t,isDOMNode:()=>ur,isDelegatedEvent:()=>Rr,isDomElement:()=>we,isDomNode:()=>$,isDomText:()=>Ne,isEventHandler:()=>Un,isFunction:()=>Mr,isIntegrationInitialized:()=>ht,isJSXTemplate:()=>cr,isLitTemplateResult:()=>It,isNativeElement:()=>$r,isOutlet:()=>Wt,isPromise:()=>oe,isProvider:()=>Ut,isReactElement:()=>ar,isRoute:()=>Vt,isRouter:()=>Ft,isRoutes:()=>Ht,isSVGElement:()=>mt,isServer:()=>g,isSuspense:()=>Kt,isTemplateFactory:()=>lr,isVisible:()=>Qn,iterateFn:()=>Or,keyArray:()=>Z.keyArray,makeArrayFlat:()=>Qt,mapArray:()=>Z.mapArray,mergeProps:()=>pt,observeIntersection:()=>or,observeResize:()=>ir,query:()=>ze,queryAll:()=>Xn,registerCoreVersion:()=>jt,registerCreateComponent:()=>Fr,registerGlobal:()=>fr,removeAttribute:()=>Ze,removeChildren:()=>et,removeClass:()=>Xe,removeDelegatedEventListener:()=>ie,render:()=>de,renderToString:()=>kt,renderToStringAsync:()=>_t,resetIntegration:()=>xt,runHydrationAt:()=>re,runWithRequestContext:()=>X,runWithoutHydration:()=>Yt,scrollIntoView:()=>er,serializeNode:()=>A,serializeResourceData:()=>We,setAttribute:()=>x,setClassList:()=>ae,setClassName:()=>q,setDataRedactor:()=>Dt,setDynamicAttribute:()=>K,setDynamicBoolAttribute:()=>ft,setDynamicProperty:()=>z,setProperty:()=>I,setRequestStore:()=>bt,setServerMode:()=>_,setStyle:()=>le,setStyles:()=>xe,shouldSetAsProperty:()=>Kn,splitProps:()=>_r,spread:()=>dt,stampVersions:()=>be,styleMap:()=>An,svg:()=>ln,templateNode:()=>it,toAttributeName:()=>Wn,toggleClass:()=>Je,versions:()=>T,waitForElement:()=>rr,warnOnVersionSkew:()=>Ee});module.exports=Vn(uo);function Wn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Un(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Bn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Kn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var zn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Gn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),W="http://www.w3.org/2000/svg";function $t(e){return e.localName.includes("-")}function ge(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if($t(e)){e[t]=n;return}x(e,t,n,r)}var he=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ze(e,t=document){return t.querySelector(e)}function Xn(e,t=document){return Array.from(t.querySelectorAll(e))}function Jn(e,t){return e.closest(t)}function Ge(e,...t){e.classList.add(...t)}function Xe(e,...t){e.classList.remove(...t)}function Je(e,...t){t.forEach(n=>e.classList.toggle(n))}function Yn(e,t){return e.classList.contains(t)}function x(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ye(e,t){return e.getAttribute(t)}function Ze(e,t){e.removeAttribute(t)}function xe(e,t){Object.assign(e.style,t)}function Zn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Qe(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")xe(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function et(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function tt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Qn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function er(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function tr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function nr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function rr(e,t=5e3){return new Promise((n,r)=>{let o=ze(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=ze(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function or(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function ir(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var sr=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ar(e){return typeof e=="object"&&e!==null&&e.$$typeof===sr}function It(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function lr(e){if(typeof e!="function")return!1;try{let t=e();return It(t)}catch{return!1}}function cr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ur(e){return e instanceof Node}function fr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function dr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var b=require("@fluixi/reactive/signal");var Te="1.0.0-alpha.78";var qt=require("@fluixi/reactive/version"),T={dom:Te,reactive:qt.VERSION};function jt(e){T.core=e}function be(e){T.core&&e.setAttribute("fluixi",T.core),e.setAttribute("fx-dom",T.dom),e.setAttribute("fx-reactive",T.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=T)}function Ee(){let e=[T.core,T.dom,T.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${T.core??"(absent)"}, dom ${T.dom}, reactive ${T.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function pr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function yr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function mr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function gr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function hr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function xr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Tr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function br(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Kt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Er(e){return Ft(e)?{type:"router",value:e}:Vt(e)?{type:"route",value:e}:Ht(e)?{type:"routes",value:e}:Wt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:Kt(e)?{type:"suspense",value:e}:Ut(e)?{type:"provider",value:e}:Bt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function _(e){g=e}var ne=Symbol.for("fluixi.server-node"),nt=null;function zt(e){nt=e}function U(){if(!nt)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return nt}function $(e){return e!=null&&e[ne]===!0?!0:typeof Node<"u"&&e instanceof Node}function we(e){return e!=null&&e[ne]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ne(e){return e!=null&&e[ne]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Gt=null;function Xt(e){Gt=e}function Se(){return Gt}function rt(e,t){return u.active&&t.parentNode===e}function ot(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Jt(){return u.active?u.cursor:null}function re(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Yt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function B(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ot(t)}function wr(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Nr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Sr(e){return Nr(wr(e))}var vr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ar={};var Zt=new Map,ve=new Set,Ae=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)ve.has(t)||Ae.has(t)||(ve.add(t),document.addEventListener(t,Cr))}function Cr(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ce(e,t,n){if(e[`$$${t}`]=n,Ae.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}ve.has(t)||ce([t])}function ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Rr(e){return!Ae.has(e)}function Mr(e){return typeof e=="function"}function k(e,t=!1){if(g)return U().createText(e);if(u.active&&!t){let n=Se()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return U().createElement(e,t);if(u.active){let n=Se()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(W,e):document.createElement(e)}function Re(e,t=!1){let n=Zt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Zt.set(e,r),r}function it(e,t,n=!1,r=!1){if(g){let o=U();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=Se()?.hydrateStatic(t);if(o)return o}return Me(Re(e,r),r).firstChild}function st(e,t){if(!u.active)return t();let n=re(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?re(e.nextSibling,()=>r(...o)):r(...o))}return n}function at(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function lt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Me(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Qt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Qt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Pr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Or(e){if((0,b.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,b.isSignal)(t)&&!S(t);)t=t();return t}var O=0,Lr=200;function kr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,b.isSignal)(e)){if(!s.has(e)){O++;try{let l=e();s.set(e,l)}finally{O--}}for(a=s.get(e);typeof a=="function"&&(0,b.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,b.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;O++;try{let f=c();s.set(c,f)}finally{O--}}a=s.get(a)}else if((0,b.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,b.isSignal)(a)&&!S(a))break}O++;try{i=se(t,a,n,i,s),o(i)}finally{O--}})}function N(e,t,n,r){if(O>Lr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=k("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){O++;try{o=se(e,t,n,o)}finally{O--}return()=>o}let a=kr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function se(e,t,n,r,o){if(t==null||typeof t=="boolean")return L(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return L(e,r,n);if(oe(t)){let s=k("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),L(e,r.slice(1),n)):E(e,s,n):r?e.replaceChild(s,r):E(e,s,n),t.then(a=>{s.parentNode===e&&se(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=k(t);return E(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=L(e,r,n)}if(r&&Ne(r))return r.data=t,r;let s=k(t);return r&&r.parentNode===e?e.replaceChild(s,r):rt(e,s)||E(e,s,n),s}if($(t))return rt(e,t)?(ot(t),t):Array.isArray(r)?(r.length===0?E(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),L(e,r.slice(1),n)):E(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):E(e,t,n)):E(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];P(t,s,e,n,!0,o,l);let c=Dr(e,a,s,n);for(let f of l){let p=N(e,f.sig,f.marker);(0,d.onCleanup)(()=>{L(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return se(e,l,n,r)}}}return L(e,r,n)}function P(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!oe(l)&&!(0,b.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,b.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!oe(c)&&!(0,b.isSignal)(c)&&!S(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,b.isSignal)(c)){if(s){let p=k("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,b.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?P(f,t,n,r,o,i):P([f],t,n,r,o,i);continue}continue}Array.isArray(c)?P(c,t,n,r,o,i,s):P([c],t,n,r,o,i,s);continue}if(oe(l)){let c=k("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(P([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){P(l,t,n,r,o,i,s);continue}if($(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?P(f,t,n,r,!1,i):P([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(k(c));continue}t.push(k(String(l)))}}}}function Dr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)E(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;E(e,n[l++],t[a++].nextSibling),E(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Ue=t[a];for(;l<p;)E(e,n[l++],Ue)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(E(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function L(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function E(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function I(e,t,n){n==null?delete e[t]:e[t]=n}function ct(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function ut(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function K(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function z(e,t,n){return typeof n!="function"?(I(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;I(e,t,r)})}function ft(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();x(e,t,!!r)})}function q(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>q(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ae(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function le(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function dt(e){let{element:t,props:n,prevProps:r=Ar,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!we(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===W,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){j(c,t);continue}if(l==="use"){ut(t,c);continue}if(l.startsWith("on:")){a.push(ct(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(z(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(K(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(ft(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>q(t,c()))):q(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ae(t,c()))):ae(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>le(t,c()))):le(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&ie(t,y),c&&Ce(t,y,c);continue}let p=he.has(l)||!s&&l in t;typeof c=="function"?a.push(p?z(t,l,c):K(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?I(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ie(t,c)}else he.has(l)?I(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){j(o,e);continue}if(r!=="children"){if(r==="use"){ut(e,o);continue}if(r.startsWith("on:")){ct(e,r.slice(3),o);continue}if(r.startsWith("prop:")){z(e,r.slice(5),o);continue}if(r.startsWith("attr:")){K(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ft(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Ae.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,ve.has(i)||ce([i]);continue}if(r==="class"||r==="className"){q(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ae(e,o())):ae(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>le(e,o())):le(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ge(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ge(e,r,t[r],n))}}}function pt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function _r(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function j(e,t){if(e){if($(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function yt(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function $r(e){return typeof e=="string"&&e.toLowerCase()===e}function mt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ir(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function oe(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function qr(e){return typeof e=="function"&&e.length===0&&(0,b.isSignal)(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),be(t),Ee(),N(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function gt(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var jr="__fx_dom_create_component__",F=globalThis[jr]??={fn:null};function Fr(e){F.fn=e}function Hr(e={}){let t=e.signalSystem?.createComponent;t&&(F.fn=t)}function pe(e,t){return F.fn?F.fn(e,t):(()=>e(t))}var Vr=()=>F.fn!==null,ht=()=>F.fn!==null;function xt(){F.fn=null}var Pe,tn={getStore:()=>Pe,run(e,t){let n=Pe;Pe=e;try{return t()}finally{Pe=n}}},Tt=tn;function bt(e){Tt=e??tn}function G(e={}){e.locals||(e.locals=e.request?Le(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function X(e,t){return Tt.run(e,t)}function R(){return Tt.getStore()}function Oe(){return R()?.event}function Et(){let e=Oe();return e?(e.locals||(e.locals={}),e.locals):{}}var en=new WeakMap;function Le(e){let t=en.get(e);return t||(t={},en.set(e,t)),t}var ke=require("@fluixi/reactive/signal");var J="__FX_DATA__";function ye(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var wt;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(wt!==void 0)return wt;let t=null;if(typeof document<"u"){let n=document.getElementById(J)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return wt=t}function De(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_e=typeof process<"u"&&process.env&&!1;function $e(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ur(e){De();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(_e&&t&&$e(`<${e}>`,t),null)}function Br(e){De();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(_e&&t&&$e(`<${e}> (static)`,t),null)}function Kr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}De();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(_e&&t&&$e(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function zr(e){De();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(_e&&t&&$e(`marker <!--${e.slice(0,24)}-->`,t),null)}var nn=!1;function Gr(){nn||(nn=!0,Xt({hydrateElement:Ur,hydrateText:Kr,hydrateMarker:zr,hydrateStatic:Br}))}function Y(e,t,n){Gr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=me(),o=n?.resourceNamespace,i=0;(0,ke.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,ke.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Nt="fluixi-island";function on(e){let{component:t,props:n={},name:r}=e,o=ue(Nt),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=g?R():void 0;if(s){let a=s.nextIslandNamespace(i);N(o,()=>s.withResourceScope(a,()=>t(n)))}else N(o,()=>t(n));return o}var rn=!1;function Xr(){if(rn||typeof document>"u")return;rn=!0;let e=document.createElement("style");e.textContent=`${Nt}{display:contents}`,document.head.appendChild(e)}function sn(e){if(typeof document>"u")return;Xr();let t=document.querySelectorAll(Nt),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Y(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function an(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function ln(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var cn=require("@fluixi/reactive/signal");function Jr(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=mt(e);if(g)return U().createElement(e,n);let r=n?document.createElementNS(W,e):document.createElement(e);return fe(r,t,n),Yr(r,t),r}function Yr(e,t){if(!t||t.children===void 0)return;let n=(0,cn.readChildren)(()=>t.children),r=o=>{N(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function un(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function fn(e){return e!=null&&e!==!1}function dn(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function pn(e){let t=D(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,h.disposeScope)(i),i=(0,h.createChildOwner)(o),s=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!dn(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var Ie=require("@fluixi/reactive/signal");function yn(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return B(a),a};return e.by?(0,Ie.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Ie.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var mn=require("@fluixi/reactive/signal");function gn(e){let t=D(()=>e.each);return(0,mn.indexArray)(t,(n,r)=>{let o=e.children(n,r);return B(o),o},{fallback:()=>e.fallback??null})}var Z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var St=Symbol("match");function hn(e){return{[St]:!0,when:D(()=>e.when),get children(){return e.children}}}function xn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[St]&&c++<10;)l=l();if(!l||typeof l!="object"||l[St]!==!0)continue;let f=l.when();if(fn(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function Tn(e){let t=un(e.component),{component:n,...r}=e,o=(0,M.getOwner)(),i=null,s;return(0,M.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,M.disposeScope)(i),i=(0,M.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,M.runWithOwner)(i,()=>a(r))})}var qe=require("@fluixi/reactive/signal");function bn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,qe.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),N(r,e.children)&&j(e.ref,r)}),(0,qe.onCleanup)(()=>{n(),r.remove()}),null}var je=require("@fluixi/reactive/signal");function vt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,je.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,je.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var En=vt;var Fe=require("@fluixi/reactive/signal");function wn(e){let[t,n]=(0,Fe.createSignal)(null),r=()=>n(null);return(0,Fe.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var Nn=require("@fluixi/reactive/signal");function Sn(e){return(0,Nn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var vn=require("@fluixi/reactive/signal");function Zr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function An(e){return(0,vn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Zr(r)}: ${i}`)}return n.join("; ")})}var Ve=1,Rt=3,Mt=8,Cn;Cn=ne;var Q=class{constructor(){this[Cn]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},H=class e extends Q{constructor(n){super();this.nodeType=Rt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},He=class e extends Q{constructor(n){super();this.nodeType=Ve;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},ee=class e extends Q{constructor(n){super();this.nodeType=Mt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},At=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ct=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},V=class e extends Q{constructor(n,r=!1){super();this.nodeType=Ve;this.attributes=new Map;this.style=new At;this.classList=new Ct(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new H(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Qr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mn=/&/g,Pn=/</g,On=/>/g,eo=/"/g;function Pt(e){return e.replace(Mn,"&amp;").replace(Pn,"&lt;").replace(On,"&gt;")}function Rn(e){return e.replace(Mn,"&amp;").replace(eo,"&quot;").replace(Pn,"&lt;").replace(On,"&gt;")}function to(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function no(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${to(n)}: ${r}`)}return t.join("; ")}function ro(e){let t="",n=no(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Rn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Rn(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Pt(e);if(typeof e=="number")return Pt(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case Rt:return Pt(e.data??"");case Mt:return`<!--${e.data??""}-->`;case Ve:{let t=e.localName,n=`<${t}${ro(e)}>`;if(Qr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var Lt=require("@fluixi/reactive/signal"),w=require("@fluixi/reactive/signal");var oo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),io={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Ln(e){return e.replace(/&(#?\w+);/g,(t,n)=>io[n]??t)}var C=class extends Error{};function kn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new ee(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof V))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new H(Ln(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new V(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Ue=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let te=e.slice(Ue,m);if(te==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${te} must have a double-quoted value`);let Be=e.indexOf('"',m+2);if(Be===-1)throw new C(`unterminated value for ${te}`);y.setAttribute(te,Ln(e.slice(m+2,Be))),m=Be+1}else y.setAttribute(te,"")}return i(y),oo.has(p)||o.push(y),m}}var Dn=!1;function $n(){Dn||(Dn=!0,zt({createElement:(e,t)=>new V(e,t),createText:e=>new H(e),createRaw:e=>new He(e),parseTemplate:(e,t)=>kn(e,t),createComment:e=>new ee(e)}))}function kt(e,t={}){let n=g;$n(),_(!0);let r=G(t.event);try{return X(r,()=>(0,Lt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{_(n)}}var _n=!1;function so(){_n||(_n=!0,(0,w.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,w.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,w.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var Ot=null;function Dt(e){Ot=e}function We(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ot)try{i=Ot(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=ye(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${J}">${n}<\/script>`}var ao=50;async function _t(e,t={}){let n=g;$n(),_(!0),so();let r=G(t.event);try{return await X(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Lt.createRoot)(f=>{s=f,i=(0,w.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,w.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<ao;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,w.flush)(),a()}let c=(0,w.runWithOwner)(i,()=>A(o))+We(r);return s(),c})}finally{_(n)}}var lo={createComponent:pe,createElement:Qe,createNativeElement:ue,createTemplate:Re,cloneTemplate:Me,templateNode:it,holeContent:lt,holeEnd:at,holeScope:st,createPortal:yt,render:de,hydrate:Y,insert:N,appendChildren:tt,removeChildren:et,spread:dt,applyProps:fe,mergeProps:pt,bindPair:gt,setProperty:I,setDynamicProperty:z,setAttribute:x,setDynamicAttribute:K,removeAttribute:Ze,getAttribute:Ye,setClassName:q,addClass:Ge,removeClass:Xe,toggleClass:Je,setStyles:xe,delegateEvents:ce,addDelegatedEventListener:Ce,removeDelegatedEventListener:ie,handleRef:j,resetIntegration:xt,isIntegrationInitialized:ht},co=lo;
1
+ "use strict";var ze=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames;var Hn=Object.prototype.hasOwnProperty;var Vn=(e,t)=>{for(var n in t)ze(e,n,{get:t[n],enumerable:!0})},Wn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fn(t))!Hn.call(e,o)&&o!==n&&ze(e,o,{get:()=>t[o],enumerable:!(r=jn(t,o))||r.enumerable});return e};var Un=e=>Wn(ze({},"__esModule",{value:!0}),e);var fo={};Vn(fo,{ClientOnly:()=>Ct,Dynamic:()=>En,ErrorBoundary:()=>Sn,FX_DATA_ID:()=>J,For:()=>gn,Index:()=>xn,Island:()=>an,JSX_PROPERTIES:()=>he,Match:()=>Tn,NoSsr:()=>Nn,Portal:()=>wn,SVG_ELEMENTS:()=>Jn,SVG_NAMESPACE:()=>W,Show:()=>mn,Switch:()=>bn,VERSION:()=>Te,VOID_ELEMENTS:()=>Xn,addClass:()=>Xe,addDelegatedEventListener:()=>Ce,addNativeEventListener:()=>ft,appendChildren:()=>nt,applyElementProp:()=>ge,applyProps:()=>fe,applyUse:()=>dt,asComponent:()=>rt,asContext:()=>br,asOutlet:()=>xr,asProvider:()=>Tr,asRoute:()=>hr,asRouter:()=>mr,asRoutes:()=>gr,asSuspense:()=>Er,bindPair:()=>xt,captureHydrationCursor:()=>Zt,checkRenderType:()=>wr,classMap:()=>An,cleanChildren:()=>L,cloneTemplate:()=>Me,closest:()=>Zn,createComponent:()=>pe,createDynamicElement:()=>Yr,createElement:()=>et,createNativeElement:()=>ue,createPortal:()=>gt,createRequestContext:()=>G,createTemplate:()=>Re,default:()=>uo,delegate:()=>or,delegateEvents:()=>ce,escapeFxJson:()=>ye,escapeHTML:()=>qr,fnName:()=>Or,generateID:()=>Ar,getAttribute:()=>Ze,getGlobal:()=>yr,getLitEventName:()=>zn,getLocals:()=>Nt,getOffset:()=>rr,getRequestContext:()=>R,getRequestEvent:()=>Le,getRequestLocals:()=>ke,getServerData:()=>me,getStableElementId:()=>vr,getStyle:()=>er,handleRef:()=>j,hasClass:()=>Qn,holeContent:()=>ut,holeEnd:()=>ct,holeScope:()=>lt,html:()=>cn,hydrate:()=>Y,hydrateAdvancePast:()=>B,hydrateIslands:()=>ln,indexArray:()=>Z.indexArray,initializeIntegration:()=>Vr,insert:()=>N,insertExpression:()=>se,intergartionInitialized:()=>Wr,isAccessor:()=>jr,isComponent:()=>S,isContext:()=>zt,isCustomElement:()=>qt,isDOMNode:()=>dr,isDelegatedEvent:()=>Mr,isDomElement:()=>we,isDomNode:()=>$,isDomText:()=>Ne,isEventHandler:()=>Kn,isFunction:()=>Pr,isIntegrationInitialized:()=>Tt,isJSXTemplate:()=>fr,isLitTemplateResult:()=>jt,isNativeElement:()=>Ir,isOutlet:()=>Bt,isPromise:()=>oe,isProvider:()=>Kt,isReactElement:()=>cr,isRoute:()=>Ut,isRouter:()=>Vt,isRoutes:()=>Wt,isSVGElement:()=>ht,isServer:()=>g,isSuspense:()=>Gt,isTemplateFactory:()=>ur,isVisible:()=>tr,iterateFn:()=>Lr,keyArray:()=>Z.keyArray,makeArrayFlat:()=>tn,mapArray:()=>Z.mapArray,mergeProps:()=>mt,observeIntersection:()=>sr,observeResize:()=>ar,query:()=>Ge,queryAll:()=>Yn,registerCoreVersion:()=>Ht,registerCreateComponent:()=>Hr,registerGlobal:()=>pr,removeAttribute:()=>Qe,removeChildren:()=>tt,removeClass:()=>Je,removeDelegatedEventListener:()=>ie,render:()=>de,renderToString:()=>_t,renderToStringAsync:()=>It,resetIntegration:()=>bt,runHydrationAt:()=>re,runWithRequestContext:()=>X,runWithoutHydration:()=>Qt,scrollIntoView:()=>nr,serializeNode:()=>A,serializeResourceData:()=>Ue,setAttribute:()=>x,setClassList:()=>ae,setClassName:()=>q,setDataRedactor:()=>$t,setDynamicAttribute:()=>K,setDynamicBoolAttribute:()=>pt,setDynamicProperty:()=>z,setProperty:()=>I,setRequestStore:()=>wt,setServerMode:()=>_,setStyle:()=>le,setStyles:()=>xe,shouldSetAsProperty:()=>Gn,splitProps:()=>$r,spread:()=>yt,stampVersions:()=>be,styleMap:()=>Rn,svg:()=>un,templateNode:()=>at,toAttributeName:()=>Bn,toggleClass:()=>Ye,versions:()=>T,waitForElement:()=>ir,warnOnVersionSkew:()=>Ee});module.exports=Un(fo);function Bn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Kn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function zn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Gn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Xn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Jn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),W="http://www.w3.org/2000/svg";function qt(e){return e.localName.includes("-")}function ge(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(qt(e)){e[t]=n;return}x(e,t,n,r)}var he=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ge(e,t=document){return t.querySelector(e)}function Yn(e,t=document){return Array.from(t.querySelectorAll(e))}function Zn(e,t){return e.closest(t)}function Xe(e,...t){e.classList.add(...t)}function Je(e,...t){e.classList.remove(...t)}function Ye(e,...t){t.forEach(n=>e.classList.toggle(n))}function Qn(e,t){return e.classList.contains(t)}function x(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ze(e,t){return e.getAttribute(t)}function Qe(e,t){e.removeAttribute(t)}function xe(e,t){Object.assign(e.style,t)}function er(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function et(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")xe(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function tr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function nr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function rr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function or(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function ir(e,t=5e3){return new Promise((n,r)=>{let o=Ge(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ge(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function sr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function ar(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var lr=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function cr(e){return typeof e=="object"&&e!==null&&e.$$typeof===lr}function jt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function ur(e){if(typeof e!="function")return!1;try{let t=e();return jt(t)}catch{return!1}}function fr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function dr(e){return e instanceof Node}function pr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function yr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var b=require("@fluixi/reactive/signal");var Te="1.0.0-alpha.80";var Ft=require("@fluixi/reactive/version"),T={dom:Te,reactive:Ft.VERSION};function Ht(e){T.core=e}function be(e){T.core&&e.setAttribute("fluixi",T.core),e.setAttribute("fx-dom",T.dom),e.setAttribute("fx-reactive",T.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=T)}function Ee(){let e=[T.core,T.dom,T.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${T.core??"(absent)"}, dom ${T.dom}, reactive ${T.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function mr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function gr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function hr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function xr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Tr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function br(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function rt(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Er(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Kt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function zt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Gt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function wr(e){return Vt(e)?{type:"router",value:e}:Ut(e)?{type:"route",value:e}:Wt(e)?{type:"routes",value:e}:Bt(e)?{type:"outlet",value:e}:S(e)?{type:"component",value:e}:Gt(e)?{type:"suspense",value:e}:Kt(e)?{type:"provider",value:e}:zt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function _(e){g=e}var ne=Symbol.for("fluixi.server-node"),ot=null;function Xt(e){ot=e}function U(){if(!ot)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ot}function $(e){return e!=null&&e[ne]===!0?!0:typeof Node<"u"&&e instanceof Node}function we(e){return e!=null&&e[ne]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ne(e){return e!=null&&e[ne]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Jt=null;function Yt(e){Jt=e}function Se(){return Jt}function it(e,t){return u.active&&t.parentNode===e}function st(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Zt(){return u.active?u.cursor:null}function re(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Qt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function B(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&st(t)}function Nr(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Sr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function vr(e){return Sr(Nr(e))}var Ar=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Cr={};var en=new Map,ve=new Set,Ae=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)ve.has(t)||Ae.has(t)||(ve.add(t),document.addEventListener(t,Rr))}function Rr(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ce(e,t,n){if(e[`$$${t}`]=n,Ae.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}ve.has(t)||ce([t])}function ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Mr(e){return!Ae.has(e)}function Pr(e){return typeof e=="function"}function k(e,t=!1){if(g)return U().createText(e);if(u.active&&!t){let n=Se()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return U().createElement(e,t);if(u.active){let n=Se()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(W,e):document.createElement(e)}function Re(e,t=!1){let n=en.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,en.set(e,r),r}function at(e,t,n=!1,r=!1){if(g){let o=U();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=Se()?.hydrateStatic(t);if(o)return o}return Me(Re(e,r),r).firstChild}function lt(e,t){if(!u.active)return t();let n=re(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?re(e.nextSibling,()=>r(...o)):r(...o))}return n}function ct(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function ut(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Me(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function tn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?tn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Or(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Lr(e){if((0,b.isSignal)(e)||S(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,b.isSignal)(t)&&!S(t);)t=t();return t}var O=0,kr=200;function Dr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(S(e)&&!(0,b.isSignal)(e)){if(!s.has(e)){O++;try{let l=e();s.set(e,l)}finally{O--}}for(a=s.get(e);typeof a=="function"&&(0,b.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,b.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(S(a)){if(!s.has(a)){let c=a;O++;try{let f=c();s.set(c,f)}finally{O--}}a=s.get(a)}else if((0,b.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,b.isSignal)(a)&&!S(a))break}O++;try{i=se(t,a,n,i,s),o(i)}finally{O--}})}function N(e,t,n,r){if(O>kr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=k("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){O++;try{o=se(e,t,n,o)}finally{O--}return()=>o}let a=Dr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function se(e,t,n,r,o){if(t==null||typeof t=="boolean")return L(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return L(e,r,n);if(oe(t)){let s=k("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),L(e,r.slice(1),n)):E(e,s,n):r?e.replaceChild(s,r):E(e,s,n),t.then(a=>{s.parentNode===e&&se(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=k(t);return E(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=L(e,r,n)}if(r&&Ne(r))return r.data=t,r;let s=k(t);return r&&r.parentNode===e?e.replaceChild(s,r):it(e,s)||E(e,s,n),s}if($(t))return it(e,t)?(st(t),t):Array.isArray(r)?(r.length===0?E(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),L(e,r.slice(1),n)):E(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):E(e,t,n)):E(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];P(t,s,e,n,!0,o,l);let c=_r(e,a,s,n);for(let f of l){let p=N(e,f.sig,f.marker);(0,d.onCleanup)(()=>{L(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return se(e,l,n,r)}}}return L(e,r,n)}function P(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!oe(l)&&!(0,b.isSignal)(l)&&!S(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(S(l)&&!(0,b.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!oe(c)&&!(0,b.isSignal)(c)&&!S(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,b.isSignal)(c)){if(s){let p=k("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,b.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?P(f,t,n,r,o,i):P([f],t,n,r,o,i);continue}continue}Array.isArray(c)?P(c,t,n,r,o,i,s):P([c],t,n,r,o,i,s);continue}if(oe(l)){let c=k("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(P([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){P(l,t,n,r,o,i,s);continue}if($(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?P(f,t,n,r,!1,i):P([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(k(c));continue}t.push(k(String(l)))}}}}function _r(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)E(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;E(e,n[l++],t[a++].nextSibling),E(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Be=t[a];for(;l<p;)E(e,n[l++],Be)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(E(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function L(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function E(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function I(e,t,n){n==null?delete e[t]:e[t]=n}function ft(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function dt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function K(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function z(e,t,n){return typeof n!="function"?(I(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;I(e,t,r)})}function pt(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();x(e,t,!!r)})}function q(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>q(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ae(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function le(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function yt(e){let{element:t,props:n,prevProps:r=Cr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!we(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===W,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){j(c,t);continue}if(l==="use"){dt(t,c);continue}if(l.startsWith("on:")){a.push(ft(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(z(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(K(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(pt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>q(t,c()))):q(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ae(t,c()))):ae(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>le(t,c()))):le(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&ie(t,y),c&&Ce(t,y,c);continue}let p=he.has(l)||!s&&l in t;typeof c=="function"?a.push(p?z(t,l,c):K(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?I(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ie(t,c)}else he.has(l)?I(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){j(o,e);continue}if(r!=="children"){if(r==="use"){dt(e,o);continue}if(r.startsWith("on:")){ft(e,r.slice(3),o);continue}if(r.startsWith("prop:")){z(e,r.slice(5),o);continue}if(r.startsWith("attr:")){K(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){pt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Ae.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,ve.has(i)||ce([i]);continue}if(r==="class"||r==="className"){q(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ae(e,o())):ae(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>le(e,o())):le(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ge(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ge(e,r,t[r],n))}}}function mt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function $r(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function j(e,t){if(e){if($(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function gt(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Ir(e){return typeof e=="string"&&e.toLowerCase()===e}function ht(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function qr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function oe(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function jr(e){return typeof e=="function"&&e.length===0&&(0,b.isSignal)(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),be(t),Ee(),N(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function xt(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var Pe=require("@fluixi/reactive");var Fr="__fx_dom_create_component__",F=globalThis[Fr]??={fn:null};function Hr(e){F.fn=e}function Vr(e={}){let t=e.signalSystem?.createComponent;t&&(F.fn=t)}function pe(e,t){if(F.fn)return F.fn(e,t);let n=typeof e=="function"?(0,Pe.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,Pe.isSignal)(n)){try{n.$name=e?.name}catch{}return rt(n)}return n}var Wr=()=>F.fn!==null,Tt=()=>F.fn!==null;function bt(){F.fn=null}var Oe,rn={getStore:()=>Oe,run(e,t){let n=Oe;Oe=e;try{return t()}finally{Oe=n}}},Et=rn;function wt(e){Et=e??rn}function G(e={}){e.locals||(e.locals=e.request?ke(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function X(e,t){return Et.run(e,t)}function R(){return Et.getStore()}function Le(){return R()?.event}function Nt(){let e=Le();return e?(e.locals||(e.locals={}),e.locals):{}}var nn=new WeakMap;function ke(e){let t=nn.get(e);return t||(t={},nn.set(e,t)),t}var De=require("@fluixi/reactive/signal");var J="__FX_DATA__";function ye(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var St;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(St!==void 0)return St;let t=null;if(typeof document<"u"){let n=document.getElementById(J)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return St=t}function _e(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$e=typeof process<"u"&&process.env&&!1;function Ie(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Br(e){_e();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ur.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):($e&&t&&Ie(`<${e}>`,t),null)}function Kr(e){_e();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):($e&&t&&Ie(`<${e}> (static)`,t),null)}function zr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}_e();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):($e&&t&&Ie(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Gr(e){_e();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):($e&&t&&Ie(`marker <!--${e.slice(0,24)}-->`,t),null)}var on=!1;function Xr(){on||(on=!0,Yt({hydrateElement:Br,hydrateText:zr,hydrateMarker:Gr,hydrateStatic:Kr}))}function Y(e,t,n){Xr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=me(),o=n?.resourceNamespace,i=0;(0,De.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,De.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var vt="fluixi-island";function an(e){let{component:t,props:n={},name:r}=e,o=ue(vt),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=g?R():void 0;if(s){let a=s.nextIslandNamespace(i);N(o,()=>s.withResourceScope(a,()=>t(n)))}else N(o,()=>t(n));return o}var sn=!1;function Jr(){if(sn||typeof document>"u")return;sn=!0;let e=document.createElement("style");e.textContent=`${vt}{display:contents}`,document.head.appendChild(e)}function ln(e){if(typeof document>"u")return;Jr();let t=document.querySelectorAll(vt),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Y(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function cn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function un(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var fn=require("@fluixi/reactive/signal");function Yr(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=ht(e);if(g)return U().createElement(e,n);let r=n?document.createElementNS(W,e):document.createElement(e);return fe(r,t,n),Zr(r,t),r}function Zr(e,t){if(!t||t.children===void 0)return;let n=(0,fn.readChildren)(()=>t.children),r=o=>{N(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function dn(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function pn(e){return e!=null&&e!==!1}function yn(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function mn(e){let t=D(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,h.disposeScope)(i),i=(0,h.createChildOwner)(o),s=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!yn(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var qe=require("@fluixi/reactive/signal");function gn(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return B(a),a};return e.by?(0,qe.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,qe.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var hn=require("@fluixi/reactive/signal");function xn(e){let t=D(()=>e.each);return(0,hn.indexArray)(t,(n,r)=>{let o=e.children(n,r);return B(o),o},{fallback:()=>e.fallback??null})}var Z=require("@fluixi/reactive/signal");var v=require("@fluixi/reactive/signal");var At=Symbol("match");function Tn(e){return{[At]:!0,when:D(()=>e.when),get children(){return e.children}}}function bn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,v.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,v.disposeScope)(r),r=(0,v.createChildOwner)(n),o=s)};return(0,v.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[At]&&c++<10;)l=l();if(!l||typeof l!="object"||l[At]!==!0)continue;let f=l.when();if(pn(f))return i(s),(0,v.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,v.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function En(e){let t=dn(e.component),{component:n,...r}=e,o=(0,M.getOwner)(),i=null,s;return(0,M.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,M.disposeScope)(i),i=(0,M.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,M.runWithOwner)(i,()=>a(r))})}var je=require("@fluixi/reactive/signal");function wn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,je.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),N(r,e.children)&&j(e.ref,r)}),(0,je.onCleanup)(()=>{n(),r.remove()}),null}var Fe=require("@fluixi/reactive/signal");function Ct(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,Fe.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Fe.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Nn=Ct;var He=require("@fluixi/reactive/signal");function Sn(e){let[t,n]=(0,He.createSignal)(null),r=()=>n(null);return(0,He.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var vn=require("@fluixi/reactive/signal");function An(e){return(0,vn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var Cn=require("@fluixi/reactive/signal");function Qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Rn(e){return(0,Cn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Qr(r)}: ${i}`)}return n.join("; ")})}var We=1,Pt=3,Ot=8,Mn;Mn=ne;var Q=class{constructor(){this[Mn]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},H=class e extends Q{constructor(n){super();this.nodeType=Pt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Ve=class e extends Q{constructor(n){super();this.nodeType=We;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},ee=class e extends Q{constructor(n){super();this.nodeType=Ot;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Rt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Mt=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},V=class e extends Q{constructor(n,r=!1){super();this.nodeType=We;this.attributes=new Map;this.style=new Rt;this.classList=new Mt(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new H(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var eo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),On=/&/g,Ln=/</g,kn=/>/g,to=/"/g;function Lt(e){return e.replace(On,"&amp;").replace(Ln,"&lt;").replace(kn,"&gt;")}function Pn(e){return e.replace(On,"&amp;").replace(to,"&quot;").replace(Ln,"&lt;").replace(kn,"&gt;")}function no(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ro(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${no(n)}: ${r}`)}return t.join("; ")}function oo(e){let t="",n=ro(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Pn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Pn(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Lt(e);if(typeof e=="number")return Lt(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case Pt:return Lt(e.data??"");case Ot:return`<!--${e.data??""}-->`;case We:{let t=e.localName,n=`<${t}${oo(e)}>`;if(eo.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}var Dt=require("@fluixi/reactive/signal"),w=require("@fluixi/reactive/signal");var io=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),so={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Dn(e){return e.replace(/&(#?\w+);/g,(t,n)=>so[n]??t)}var C=class extends Error{};function _n(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new C(`unterminated comment at ${c}`);i(new ee(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new C(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new C(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new C(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof V))throw new C(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new H(Dn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new C(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new V(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Be=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let te=e.slice(Be,m);if(te==="")throw new C(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new C(`attribute ${te} must have a double-quoted value`);let Ke=e.indexOf('"',m+2);if(Ke===-1)throw new C(`unterminated value for ${te}`);y.setAttribute(te,Dn(e.slice(m+2,Ke))),m=Ke+1}else y.setAttribute(te,"")}return i(y),io.has(p)||o.push(y),m}}var $n=!1;function qn(){$n||($n=!0,Xt({createElement:(e,t)=>new V(e,t),createText:e=>new H(e),createRaw:e=>new Ve(e),parseTemplate:(e,t)=>_n(e,t),createComment:e=>new ee(e)}))}function _t(e,t={}){let n=g;qn(),_(!0);let r=G(t.event);try{return X(r,()=>(0,Dt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{_(n)}}var In=!1;function ao(){In||(In=!0,(0,w.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,w.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,w.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var kt=null;function $t(e){kt=e}function Ue(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(kt)try{i=kt(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=ye(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${J}">${n}<\/script>`}var lo=50;async function It(e,t={}){let n=g;qn(),_(!0),ao();let r=G(t.event);try{return await X(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Dt.createRoot)(f=>{s=f,i=(0,w.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,w.runWithOwner)(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<lo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,w.flush)(),a()}let c=(0,w.runWithOwner)(i,()=>A(o))+Ue(r);return s(),c})}finally{_(n)}}var co={createComponent:pe,createElement:et,createNativeElement:ue,createTemplate:Re,cloneTemplate:Me,templateNode:at,holeContent:ut,holeEnd:ct,holeScope:lt,createPortal:gt,render:de,hydrate:Y,insert:N,appendChildren:nt,removeChildren:tt,spread:yt,applyProps:fe,mergeProps:mt,bindPair:xt,setProperty:I,setDynamicProperty:z,setAttribute:x,setDynamicAttribute:K,removeAttribute:Qe,getAttribute:Ze,setClassName:q,addClass:Xe,removeClass:Je,toggleClass:Ye,setStyles:xe,delegateEvents:ce,addDelegatedEventListener:Ce,removeDelegatedEventListener:ie,handleRef:j,resetIntegration:bt,isIntegrationInitialized:Tt},uo=co;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function Ir(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function qr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function jr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Fr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Hr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Vr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),U="http://www.w3.org/2000/svg";function Qt(e){return e.localName.includes("-")}function Se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Qt(e)){e[t]=n;return}h(e,t,n,r)}var ve=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ze(e,t=document){return t.querySelector(e)}function Wr(e,t=document){return Array.from(t.querySelectorAll(e))}function Ur(e,t){return e.closest(t)}function Qe(e,...t){e.classList.add(...t)}function et(e,...t){e.classList.remove(...t)}function tt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Br(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function nt(e,t){return e.getAttribute(t)}function rt(e,t){e.removeAttribute(t)}function Ae(e,t){Object.assign(e.style,t)}function Kr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ot(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Ae(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function it(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function st(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function zr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Gr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Xr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Jr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Yr(e,t=5e3){return new Promise((n,r)=>{let o=Ze(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ze(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Zr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Qr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var en=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function eo(e){return typeof e=="object"&&e!==null&&e.$$typeof===en}function tn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function to(e){if(typeof e!="function")return!1;try{let t=e();return tn(t)}catch{return!1}}function no(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ro(e){return e instanceof Node}function oo(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function io(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as b}from"@fluixi/reactive/signal";var Ce="1.0.0-alpha.78";import{VERSION as nn}from"@fluixi/reactive/version";var x={dom:Ce,reactive:nn};function rn(e){x.core=e}function Re(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function Me(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function fo(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function po(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function yo(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function mo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function ho(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function xo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function To(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function on(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function sn(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function an(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function cn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function un(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function bo(e){return on(e)?{type:"router",value:e}:an(e)?{type:"route",value:e}:sn(e)?{type:"routes",value:e}:ln(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:fn(e)?{type:"suspense",value:e}:cn(e)?{type:"provider",value:e}:un(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as ft,createEffect as z,createRenderEffect as m,createRoot as yn,onCleanup as O,readChildren as mn}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var B=Symbol.for("fluixi.server-node"),Pe=null;function at(e){Pe=e}function $(){if(!Pe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Pe}function I(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function Oe(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Le(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},lt=null;function ct(e){lt=e}function ee(){return lt}function ke(e,t){return u.active&&t.parentNode===e}function De(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function dn(){return u.active?u.cursor:null}function te(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function pn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function K(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&De(t)}function gn(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function hn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Lo(e){return hn(gn(e))}var ko=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xn={};var ut=new Map,re=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)re.has(t)||le.has(t)||(re.add(t),document.addEventListener(t,Tn))}function Tn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function _e(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}re.has(t)||ce([t])}function oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Do(e){return!le.has(e)}function _o(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=ee()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=ee()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(U,e):document.createElement(e)}function $e(e,t=!1){let n=ut.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ut.set(e,r),r}function dt(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=ee()?.hydrateStatic(t);if(o)return o}return Ie($e(e,r),r).firstChild}function pt(e,t){if(!u.active)return t();let n=te(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?te(e.nextSibling,()=>r(...o)):r(...o))}return n}function yt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function mt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ie(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function bn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?bn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function $o(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Io(e){if(b(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!N(t);)t=t();return t}var A=0,En=200;function wn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(N(e)&&!b(e)){if(!s.has(e)){A++;try{let l=e();s.set(e,l)}finally{A--}}for(a=s.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;A++;try{let f=c();s.set(c,f)}finally{A--}}a=s.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!N(a))break}A++;try{i=ie(t,a,n,i,s),o(i)}finally{A--}})}function E(e,t,n,r){if(A>En)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){A++;try{o=ie(e,t,n,o)}finally{A--}return()=>o}let a=wn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ie(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(ne(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&ie(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=R(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&Le(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):ke(e,s)||T(e,s,n),s}if(I(t))return ke(e,t)?(De(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,s,e,n,!0,o,l);let c=Nn(e,a,s,n);for(let f of l){let d=E(e,f.sig,f.marker);O(()=>{P(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ie(e,l,n,r)}}}return P(e,r,n)}function v(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ne(l)&&!b(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!b(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ne(c)&&!b(c)&&!N(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(b(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,i):v([f],t,n,r,o,i);continue}continue}Array.isArray(c)?v(c,t,n,r,o,i,s):v([c],t,n,r,o,i,s);continue}if(ne(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?v(f,t,n,r,!1,i):v([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(R(c));continue}t.push(R(String(l)))}}}}function Nn(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)T(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let we=t[a];for(;l<d;)T(e,n[l++],we)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function gt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function ht(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function G(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function X(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function xt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{let r=n();h(e,t,!!r)})}function j(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>j(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function se(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ae(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Tt(e){let{element:t,props:n,prevProps:r=xn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Oe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===U,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){F(c,t);continue}if(l==="use"){ht(t,c);continue}if(l.startsWith("on:")){a.push(gt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(X(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(G(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(xt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>j(t,c()))):j(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>se(t,c()))):se(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ae(t,c()))):ae(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&oe(t,p),c&&_e(t,p,c);continue}let d=ve.has(l)||!s&&l in t;typeof c=="function"?a.push(d?X(t,l,c):G(t,l,c,s)):a.push(m(()=>d?q(t,l,n[l]):h(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();oe(t,c)}else ve.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){F(o,e);continue}if(r!=="children"){if(r==="use"){ht(e,o);continue}if(r.startsWith("on:")){gt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){X(e,r.slice(5),o);continue}if(r.startsWith("attr:")){G(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){xt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(le.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,re.has(i)||ce([i]);continue}if(r==="class"||r==="className"){j(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>se(e,o())):se(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ae(e,o())):ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});O(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=z(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});O(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Se(e,r,s,n)});O(()=>{i()})}else m(()=>Se(e,r,t[r],n))}}}function bt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function qo(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function F(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Et(e,t,n){let r=t||document.body,o=mn(()=>e),i=[];return ft(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),O(()=>{i.forEach(a=>a())})}),null}function jo(e){return typeof e=="string"&&e.toLowerCase()===e}function wt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Fo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ne(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ho(e){return typeof e=="function"&&e.length===0&&b(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return yn(s=>{ft(()=>{u.active||(t.textContent=""),Re(t),Me(),E(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Nt(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var Sn="__fx_dom_create_component__",L=globalThis[Sn]??={fn:null};function Wo(e){L.fn=e}function Uo(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function pe(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var Bo=()=>L.fn!==null,St=()=>L.fn!==null;function vt(){L.fn=null}var ye,Ct={getStore:()=>ye,run(e,t){let n=ye;ye=e;try{return t()}finally{ye=n}}},qe=Ct;function Rt(e){qe=e??Ct}function J(e={}){e.locals||(e.locals=e.request?Fe(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function Y(e,t){return qe.run(e,t)}function C(){return qe.getStore()}function je(){return C()?.event}function Mt(){let e=je();return e?(e.locals||(e.locals={}),e.locals):{}}var At=new WeakMap;function Fe(e){let t=At.get(e);return t||(t={},At.set(e,t)),t}import{setResourceIdSource as vn,setServerDataGetter as An}from"@fluixi/reactive/signal";var Z="__FX_DATA__";function me(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var He;function ge(){let e=globalThis.__FX_DATA__;if(e)return e;if(He!==void 0)return He;let t=null;if(typeof document<"u"){let n=document.getElementById(Z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return He=t}function he(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Cn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Rn(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Cn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Mn(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`<${e}> (static)`,t),null)}function Pn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function On(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Pt=!1;function Ln(){Pt||(Pt=!0,ct({hydrateElement:Rn,hydrateText:Pn,hydrateMarker:On,hydrateStatic:Mn}))}function Q(e,t,n){Ln(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ge(),o=n?.resourceNamespace,i=0;vn(()=>o?`${o}:r${i++}`:`r${i++}`),An(r?s=>s in r?{value:r[s]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ve="fluixi-island";function kn(e){let{component:t,props:n={},name:r}=e,o=ue(Ve),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);E(o,()=>s.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var Ot=!1;function Dn(){if(Ot||typeof document>"u")return;Ot=!0;let e=document.createElement("style");e.textContent=`${Ve}{display:contents}`,document.head.appendChild(e)}function _n(e){if(typeof document>"u")return;Dn();let t=document.querySelectorAll(Ve),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Q(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function $n(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function In(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as qn}from"@fluixi/reactive/signal";function bi(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=wt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(U,e):document.createElement(e);return fe(r,t,n),jn(r,t),r}function jn(e,t){if(!t||t.children===void 0)return;let n=qn(()=>t.children),r=o=>{E(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as Fn,createMemo as We,disposeScope as Hn,getOwner as Vn,runWithOwner as Wn,untrack as _t}from"@fluixi/reactive/signal";function Lt(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function kt(e){return e!=null&&e!==!1}function Dt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Un(e){let t=M(()=>e.when),n=We(t,void 0),r=We(n,void 0),o=Vn(),i=null,s=null,a=l=>{l!==s&&(i&&Hn(i),i=Fn(o),s=l)};return We(()=>{let l=r();return a(l?"when":"fallback"),Wn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!Dt(c)?typeof n=="function"?_t(()=>_t(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as Bn,keyArray as Kn}from"@fluixi/reactive/signal";function zn(e){let t=M(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return K(a),a};return e.by?Kn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Bn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Gn}from"@fluixi/reactive/signal";function Xn(e){let t=M(()=>e.each);return Gn(t,(n,r)=>{let o=e.children(n,r);return K(o),o},{fallback:()=>e.fallback??null})}import{mapArray as gs,keyArray as hs,indexArray as xs}from"@fluixi/reactive/signal";import{createMemo as Jn,createChildOwner as Yn,disposeScope as Zn,getOwner as Qn,runWithOwner as $t}from"@fluixi/reactive/signal";var Ue=Symbol("match");function er(e){return{[Ue]:!0,when:M(()=>e.when),get children(){return e.children}}}function tr(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Qn(),r=null,o=-1,i=s=>{s!==o&&(r&&Zn(r),r=Yn(n),o=s)};return Jn(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Ue]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ue]!==!0)continue;let f=l.when();if(kt(f))return i(s),$t(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),$t(r,()=>e.fallback??null)})}import{createMemo as nr,createChildOwner as rr,disposeScope as or,getOwner as ir,runWithOwner as sr}from"@fluixi/reactive/signal";function ar(e){let t=Lt(e.component),{component:n,...r}=e,o=ir(),i=null,s;return nr(()=>{let a=t();return a!==s&&(i&&or(i),i=rr(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:sr(i,()=>a(r))})}import{createRoot as lr,onCleanup as cr}from"@fluixi/reactive/signal";function ur(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return lr(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&F(e.ref,r)}),cr(()=>{n(),r.remove()}),null}import{createMemo as fr,createSignal as dr}from"@fluixi/reactive/signal";function It(e){if(g)return e.fallback??null;let t=u.active,[n,r]=dr(!t);return t&&queueMicrotask(()=>r(!0)),fr(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var pr=It;import{createMemo as yr,createSignal as mr}from"@fluixi/reactive/signal";function gr(e){let[t,n]=mr(null),r=()=>n(null);return yr(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as hr}from"@fluixi/reactive/signal";function xr(e){return hr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as Tr}from"@fluixi/reactive/signal";function br(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Er(e){return Tr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${br(r)}: ${i}`)}return n.join("; ")})}var Ee=1,ze=3,Ge=8,qt;qt=B;var H=class{constructor(){this[qt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},k=class e extends H{constructor(n){super();this.nodeType=ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},be=class e extends H{constructor(n){super();this.nodeType=Ee;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},V=class e extends H{constructor(n){super();this.nodeType=Ge;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Be=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},D=class e extends H{constructor(n,r=!1){super();this.nodeType=Ee;this.attributes=new Map;this.style=new Be;this.classList=new Ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new k(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ft=/&/g,Ht=/</g,Vt=/>/g,Nr=/"/g;function Xe(e){return e.replace(Ft,"&amp;").replace(Ht,"&lt;").replace(Vt,"&gt;")}function jt(e){return e.replace(Ft,"&amp;").replace(Nr,"&quot;").replace(Ht,"&lt;").replace(Vt,"&gt;")}function Sr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function vr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Sr(n)}: ${r}`)}return t.join("; ")}function Ar(e){let t="",n=vr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${jt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${jt(o)}"`}return t}function S(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Xe(e);if(typeof e=="number")return Xe(String(e));if(typeof e=="function")return S(e());if(Array.isArray(e))return e.map(S).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ze:return Xe(e.data??"");case Ge:return`<!--${e.data??""}-->`;case Ee:{let t=e.localName,n=`<${t}${Ar(e)}>`;if(wr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}import{createRoot as Gt}from"@fluixi/reactive/signal";import{setResourceTracker as Mr,setResourceIdSource as Pr,setResourceDataSink as Or,getOwner as Lr,runWithOwner as Bt,flush as kr}from"@fluixi/reactive/signal";var Cr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Rr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Wt(e){return e.replace(/&(#?\w+);/g,(t,n)=>Rr[n]??t)}var w=class extends Error{};function Ut(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new w(`unterminated comment at ${c}`);i(new V(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new w(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new w(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new w(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new w(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new k(Wt(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new w(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new D(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let we=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let W=e.slice(we,y);if(W==="")throw new w(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new w(`attribute ${W} must have a double-quoted value`);let Ne=e.indexOf('"',y+2);if(Ne===-1)throw new w(`unterminated value for ${W}`);p.setAttribute(W,Wt(e.slice(y+2,Ne))),y=Ne+1}else p.setAttribute(W,"")}return i(p),Cr.has(d)||o.push(p),y}}var Kt=!1;function Xt(){Kt||(Kt=!0,at({createElement:(e,t)=>new D(e,t),createText:e=>new k(e),createRaw:e=>new be(e),parseTemplate:(e,t)=>Ut(e,t),createComment:e=>new V(e)}))}function Jt(e,t={}){let n=g;Xt(),_(!0);let r=J(t.event);try{return Y(r,()=>Gt(o=>{try{let i=typeof e=="function"?e():e;return S(i)}finally{o()}}))}finally{_(n)}}var zt=!1;function Dr(){zt||(zt=!0,Mr(e=>{C()?.pending.add(e)}),Pr(()=>C()?.nextResourceId()??""),Or((e,t)=>{e&&C()?.data.set(e,t)}))}var Je=null;function Yt(e){Je=e}function Ye(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Je)try{i=Je(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=me(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${Z}">${n}<\/script>`}var _r=50;async function Zt(e,t={}){let n=g;Xt(),_(!0),Dr();let r=J(t.event);try{return await Y(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Gt(f=>{s=f,i=Lr(),o=typeof e=="function"?e():e});let a=()=>{try{Bt(i,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<_r;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await kr(),a()}let c=Bt(i,()=>S(o))+Ye(r);return s(),c})}finally{_(n)}}var $r={createComponent:pe,createElement:ot,createNativeElement:ue,createTemplate:$e,cloneTemplate:Ie,templateNode:dt,holeContent:mt,holeEnd:yt,holeScope:pt,createPortal:Et,render:de,hydrate:Q,insert:E,appendChildren:st,removeChildren:it,spread:Tt,applyProps:fe,mergeProps:bt,bindPair:Nt,setProperty:q,setDynamicProperty:X,setAttribute:h,setDynamicAttribute:G,removeAttribute:rt,getAttribute:nt,setClassName:j,addClass:Qe,removeClass:et,toggleClass:tt,setStyles:Ae,delegateEvents:ce,addDelegatedEventListener:_e,removeDelegatedEventListener:oe,handleRef:F,resetIntegration:vt,isIntegrationInitialized:St},ra=$r;export{It as ClientOnly,ar as Dynamic,gr as ErrorBoundary,Z as FX_DATA_ID,zn as For,Xn as Index,kn as Island,ve as JSX_PROPERTIES,er as Match,pr as NoSsr,ur as Portal,Vr as SVG_ELEMENTS,U as SVG_NAMESPACE,Un as Show,tr as Switch,Ce as VERSION,Hr as VOID_ELEMENTS,Qe as addClass,_e as addDelegatedEventListener,gt as addNativeEventListener,st as appendChildren,Se as applyElementProp,fe as applyProps,ht as applyUse,xo as asComponent,ho as asContext,mo as asOutlet,go as asProvider,yo as asRoute,fo as asRouter,po as asRoutes,To as asSuspense,Nt as bindPair,dn as captureHydrationCursor,bo as checkRenderType,xr as classMap,P as cleanChildren,Ie as cloneTemplate,Ur as closest,pe as createComponent,bi as createDynamicElement,ot as createElement,ue as createNativeElement,Et as createPortal,J as createRequestContext,$e as createTemplate,ra as default,Jr as delegate,ce as delegateEvents,me as escapeFxJson,Fo as escapeHTML,$o as fnName,ko as generateID,nt as getAttribute,io as getGlobal,jr as getLitEventName,Mt as getLocals,Xr as getOffset,C as getRequestContext,je as getRequestEvent,Fe as getRequestLocals,ge as getServerData,Lo as getStableElementId,Kr as getStyle,F as handleRef,Br as hasClass,mt as holeContent,yt as holeEnd,pt as holeScope,$n as html,Q as hydrate,K as hydrateAdvancePast,_n as hydrateIslands,xs as indexArray,Uo as initializeIntegration,E as insert,ie as insertExpression,Bo as intergartionInitialized,Ho as isAccessor,N as isComponent,un as isContext,Qt as isCustomElement,ro as isDOMNode,Do as isDelegatedEvent,Oe as isDomElement,I as isDomNode,Le as isDomText,qr as isEventHandler,_o as isFunction,St as isIntegrationInitialized,no as isJSXTemplate,tn as isLitTemplateResult,jo as isNativeElement,ln as isOutlet,ne as isPromise,cn as isProvider,eo as isReactElement,an as isRoute,on as isRouter,sn as isRoutes,wt as isSVGElement,g as isServer,fn as isSuspense,to as isTemplateFactory,zr as isVisible,Io as iterateFn,hs as keyArray,bn as makeArrayFlat,gs as mapArray,bt as mergeProps,Zr as observeIntersection,Qr as observeResize,Ze as query,Wr as queryAll,rn as registerCoreVersion,Wo as registerCreateComponent,oo as registerGlobal,rt as removeAttribute,it as removeChildren,et as removeClass,oe as removeDelegatedEventListener,de as render,Jt as renderToString,Zt as renderToStringAsync,vt as resetIntegration,te as runHydrationAt,Y as runWithRequestContext,pn as runWithoutHydration,Gr as scrollIntoView,S as serializeNode,Ye as serializeResourceData,h as setAttribute,se as setClassList,j as setClassName,Yt as setDataRedactor,G as setDynamicAttribute,xt as setDynamicBoolAttribute,X as setDynamicProperty,q as setProperty,Rt as setRequestStore,_ as setServerMode,ae as setStyle,Ae as setStyles,Fr as shouldSetAsProperty,qo as splitProps,Tt as spread,Re as stampVersions,Er as styleMap,In as svg,dt as templateNode,Ir as toAttributeName,tt as toggleClass,x as versions,Yr as waitForElement,Me as warnOnVersionSkew};
1
+ function Fr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Hr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Vr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Wr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Br=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),U="http://www.w3.org/2000/svg";function en(e){return e.localName.includes("-")}function Se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(en(e)){e[t]=n;return}h(e,t,n,r)}var ve=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ze(e,t=document){return t.querySelector(e)}function Kr(e,t=document){return Array.from(t.querySelectorAll(e))}function zr(e,t){return e.closest(t)}function Qe(e,...t){e.classList.add(...t)}function et(e,...t){e.classList.remove(...t)}function tt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Gr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function nt(e,t){return e.getAttribute(t)}function rt(e,t){e.removeAttribute(t)}function Ae(e,t){Object.assign(e.style,t)}function Xr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ot(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Ae(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function it(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function st(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Jr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Yr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Zr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Qr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function eo(e,t=5e3){return new Promise((n,r)=>{let o=Ze(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ze(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function to(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function no(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var tn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ro(e){return typeof e=="object"&&e!==null&&e.$$typeof===tn}function nn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function oo(e){if(typeof e!="function")return!1;try{let t=e();return nn(t)}catch{return!1}}function io(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function so(e){return e instanceof Node}function ao(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function lo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as b}from"@fluixi/reactive/signal";var Ce="1.0.0-alpha.80";import{VERSION as rn}from"@fluixi/reactive/version";var x={dom:Ce,reactive:rn};function on(e){x.core=e}function Re(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function Me(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function mo(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function ho(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function xo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function To(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function bo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function at(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Eo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function sn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function an(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function cn(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function un(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function wo(e){return sn(e)?{type:"router",value:e}:ln(e)?{type:"route",value:e}:an(e)?{type:"routes",value:e}:cn(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:dn(e)?{type:"suspense",value:e}:un(e)?{type:"provider",value:e}:fn(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as dt,createEffect as z,createRenderEffect as m,createRoot as mn,onCleanup as O,readChildren as gn}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var B=Symbol.for("fluixi.server-node"),Pe=null;function lt(e){Pe=e}function $(){if(!Pe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Pe}function I(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function Oe(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Le(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ct=null;function ut(e){ct=e}function ee(){return ct}function ke(e,t){return u.active&&t.parentNode===e}function De(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function pn(){return u.active?u.cursor:null}function te(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function yn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function K(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&De(t)}function hn(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function xn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Do(e){return xn(hn(e))}var _o=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Tn={};var ft=new Map,re=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)re.has(t)||le.has(t)||(re.add(t),document.addEventListener(t,bn))}function bn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function _e(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}re.has(t)||ce([t])}function oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function $o(e){return!le.has(e)}function Io(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=ee()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=ee()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(U,e):document.createElement(e)}function $e(e,t=!1){let n=ft.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ft.set(e,r),r}function pt(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=ee()?.hydrateStatic(t);if(o)return o}return Ie($e(e,r),r).firstChild}function yt(e,t){if(!u.active)return t();let n=te(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?te(e.nextSibling,()=>r(...o)):r(...o))}return n}function mt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function gt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ie(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function En(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?En(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function qo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function jo(e){if(b(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!N(t);)t=t();return t}var A=0,wn=200;function Nn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(N(e)&&!b(e)){if(!s.has(e)){A++;try{let l=e();s.set(e,l)}finally{A--}}for(a=s.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;A++;try{let f=c();s.set(c,f)}finally{A--}}a=s.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!N(a))break}A++;try{i=ie(t,a,n,i,s),o(i)}finally{A--}})}function E(e,t,n,r){if(A>wn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){A++;try{o=ie(e,t,n,o)}finally{A--}return()=>o}let a=Nn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ie(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(ne(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&ie(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=R(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&Le(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):ke(e,s)||T(e,s,n),s}if(I(t))return ke(e,t)?(De(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,s,e,n,!0,o,l);let c=Sn(e,a,s,n);for(let f of l){let d=E(e,f.sig,f.marker);O(()=>{P(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ie(e,l,n,r)}}}return P(e,r,n)}function v(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ne(l)&&!b(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!b(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ne(c)&&!b(c)&&!N(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(b(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,i):v([f],t,n,r,o,i);continue}continue}Array.isArray(c)?v(c,t,n,r,o,i,s):v([c],t,n,r,o,i,s);continue}if(ne(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?v(f,t,n,r,!1,i):v([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(R(c));continue}t.push(R(String(l)))}}}}function Sn(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)T(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let we=t[a];for(;l<d;)T(e,n[l++],we)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function ht(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function xt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function G(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function X(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function Tt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{let r=n();h(e,t,!!r)})}function j(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>j(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function se(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ae(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function bt(e){let{element:t,props:n,prevProps:r=Tn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Oe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===U,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){F(c,t);continue}if(l==="use"){xt(t,c);continue}if(l.startsWith("on:")){a.push(ht(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(X(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(G(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Tt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>j(t,c()))):j(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>se(t,c()))):se(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ae(t,c()))):ae(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&oe(t,p),c&&_e(t,p,c);continue}let d=ve.has(l)||!s&&l in t;typeof c=="function"?a.push(d?X(t,l,c):G(t,l,c,s)):a.push(m(()=>d?q(t,l,n[l]):h(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();oe(t,c)}else ve.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){F(o,e);continue}if(r!=="children"){if(r==="use"){xt(e,o);continue}if(r.startsWith("on:")){ht(e,r.slice(3),o);continue}if(r.startsWith("prop:")){X(e,r.slice(5),o);continue}if(r.startsWith("attr:")){G(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Tt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(le.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,re.has(i)||ce([i]);continue}if(r==="class"||r==="className"){j(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>se(e,o())):se(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ae(e,o())):ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});O(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=z(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});O(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Se(e,r,s,n)});O(()=>{i()})}else m(()=>Se(e,r,t[r],n))}}}function Et(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Fo(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function F(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function wt(e,t,n){let r=t||document.body,o=gn(()=>e),i=[];return dt(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),O(()=>{i.forEach(a=>a())})}),null}function Ho(e){return typeof e=="string"&&e.toLowerCase()===e}function Nt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Vo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ne(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Wo(e){return typeof e=="function"&&e.length===0&&b(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return mn(s=>{dt(()=>{u.active||(t.textContent=""),Re(t),Me(),E(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function St(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as vn,isSignal as An}from"@fluixi/reactive";var Cn="__fx_dom_create_component__",L=globalThis[Cn]??={fn:null};function zo(e){L.fn=e}function Go(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function pe(e,t){if(L.fn)return L.fn(e,t);let n=typeof e=="function"?vn(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!An(n)){try{n.$name=e?.name}catch{}return at(n)}return n}var Xo=()=>L.fn!==null,vt=()=>L.fn!==null;function At(){L.fn=null}var ye,Rt={getStore:()=>ye,run(e,t){let n=ye;ye=e;try{return t()}finally{ye=n}}},qe=Rt;function Mt(e){qe=e??Rt}function J(e={}){e.locals||(e.locals=e.request?Fe(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function Y(e,t){return qe.run(e,t)}function C(){return qe.getStore()}function je(){return C()?.event}function Pt(){let e=je();return e?(e.locals||(e.locals={}),e.locals):{}}var Ct=new WeakMap;function Fe(e){let t=Ct.get(e);return t||(t={},Ct.set(e,t)),t}import{setResourceIdSource as Rn,setServerDataGetter as Mn}from"@fluixi/reactive/signal";var Z="__FX_DATA__";function me(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var He;function ge(){let e=globalThis.__FX_DATA__;if(e)return e;if(He!==void 0)return He;let t=null;if(typeof document<"u"){let n=document.getElementById(Z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return He=t}function he(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function On(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Pn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Ln(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`<${e}> (static)`,t),null)}function kn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Dn(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ot=!1;function _n(){Ot||(Ot=!0,ut({hydrateElement:On,hydrateText:kn,hydrateMarker:Dn,hydrateStatic:Ln}))}function Q(e,t,n){_n(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ge(),o=n?.resourceNamespace,i=0;Rn(()=>o?`${o}:r${i++}`:`r${i++}`),Mn(r?s=>s in r?{value:r[s]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ve="fluixi-island";function $n(e){let{component:t,props:n={},name:r}=e,o=ue(Ve),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);E(o,()=>s.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var Lt=!1;function In(){if(Lt||typeof document>"u")return;Lt=!0;let e=document.createElement("style");e.textContent=`${Ve}{display:contents}`,document.head.appendChild(e)}function qn(e){if(typeof document>"u")return;In();let t=document.querySelectorAll(Ve),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Q(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function jn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Fn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as Hn}from"@fluixi/reactive/signal";function Si(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=Nt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(U,e):document.createElement(e);return fe(r,t,n),Vn(r,t),r}function Vn(e,t){if(!t||t.children===void 0)return;let n=Hn(()=>t.children),r=o=>{E(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as Wn,createMemo as We,disposeScope as Un,getOwner as Bn,runWithOwner as Kn,untrack as $t}from"@fluixi/reactive/signal";function kt(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Dt(e){return e!=null&&e!==!1}function _t(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zn(e){let t=M(()=>e.when),n=We(t,void 0),r=We(n,void 0),o=Bn(),i=null,s=null,a=l=>{l!==s&&(i&&Un(i),i=Wn(o),s=l)};return We(()=>{let l=r();return a(l?"when":"fallback"),Kn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!_t(c)?typeof n=="function"?$t(()=>$t(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as Gn,keyArray as Xn}from"@fluixi/reactive/signal";function Jn(e){let t=M(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return K(a),a};return e.by?Xn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Gn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Yn}from"@fluixi/reactive/signal";function Zn(e){let t=M(()=>e.each);return Yn(t,(n,r)=>{let o=e.children(n,r);return K(o),o},{fallback:()=>e.fallback??null})}import{mapArray as bs,keyArray as Es,indexArray as ws}from"@fluixi/reactive/signal";import{createMemo as Qn,createChildOwner as er,disposeScope as tr,getOwner as nr,runWithOwner as It}from"@fluixi/reactive/signal";var Ue=Symbol("match");function rr(e){return{[Ue]:!0,when:M(()=>e.when),get children(){return e.children}}}function or(e){let t=Array.isArray(e.children)?e.children:[e.children],n=nr(),r=null,o=-1,i=s=>{s!==o&&(r&&tr(r),r=er(n),o=s)};return Qn(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Ue]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ue]!==!0)continue;let f=l.when();if(Dt(f))return i(s),It(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),It(r,()=>e.fallback??null)})}import{createMemo as ir,createChildOwner as sr,disposeScope as ar,getOwner as lr,runWithOwner as cr}from"@fluixi/reactive/signal";function ur(e){let t=kt(e.component),{component:n,...r}=e,o=lr(),i=null,s;return ir(()=>{let a=t();return a!==s&&(i&&ar(i),i=sr(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:cr(i,()=>a(r))})}import{createRoot as fr,onCleanup as dr}from"@fluixi/reactive/signal";function pr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return fr(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&F(e.ref,r)}),dr(()=>{n(),r.remove()}),null}import{createMemo as yr,createSignal as mr}from"@fluixi/reactive/signal";function qt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=mr(!t);return t&&queueMicrotask(()=>r(!0)),yr(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var gr=qt;import{createMemo as hr,createSignal as xr}from"@fluixi/reactive/signal";function Tr(e){let[t,n]=xr(null),r=()=>n(null);return hr(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as br}from"@fluixi/reactive/signal";function Er(e){return br(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as wr}from"@fluixi/reactive/signal";function Nr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Sr(e){return wr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Nr(r)}: ${i}`)}return n.join("; ")})}var Ee=1,ze=3,Ge=8,jt;jt=B;var H=class{constructor(){this[jt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},k=class e extends H{constructor(n){super();this.nodeType=ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},be=class e extends H{constructor(n){super();this.nodeType=Ee;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},V=class e extends H{constructor(n){super();this.nodeType=Ge;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Be=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},D=class e extends H{constructor(n,r=!1){super();this.nodeType=Ee;this.attributes=new Map;this.style=new Be;this.classList=new Ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new k(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var vr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ht=/&/g,Vt=/</g,Wt=/>/g,Ar=/"/g;function Xe(e){return e.replace(Ht,"&amp;").replace(Vt,"&lt;").replace(Wt,"&gt;")}function Ft(e){return e.replace(Ht,"&amp;").replace(Ar,"&quot;").replace(Vt,"&lt;").replace(Wt,"&gt;")}function Cr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Rr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Cr(n)}: ${r}`)}return t.join("; ")}function Mr(e){let t="",n=Rr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ft(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ft(o)}"`}return t}function S(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Xe(e);if(typeof e=="number")return Xe(String(e));if(typeof e=="function")return S(e());if(Array.isArray(e))return e.map(S).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ze:return Xe(e.data??"");case Ge:return`<!--${e.data??""}-->`;case Ee:{let t=e.localName,n=`<${t}${Mr(e)}>`;if(vr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}import{createRoot as Xt}from"@fluixi/reactive/signal";import{setResourceTracker as Lr,setResourceIdSource as kr,setResourceDataSink as Dr,getOwner as _r,runWithOwner as Kt,flush as $r}from"@fluixi/reactive/signal";var Pr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Or={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Ut(e){return e.replace(/&(#?\w+);/g,(t,n)=>Or[n]??t)}var w=class extends Error{};function Bt(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new w(`unterminated comment at ${c}`);i(new V(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new w(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new w(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new w(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new w(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new k(Ut(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new w(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new D(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let we=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let W=e.slice(we,y);if(W==="")throw new w(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new w(`attribute ${W} must have a double-quoted value`);let Ne=e.indexOf('"',y+2);if(Ne===-1)throw new w(`unterminated value for ${W}`);p.setAttribute(W,Ut(e.slice(y+2,Ne))),y=Ne+1}else p.setAttribute(W,"")}return i(p),Pr.has(d)||o.push(p),y}}var zt=!1;function Jt(){zt||(zt=!0,lt({createElement:(e,t)=>new D(e,t),createText:e=>new k(e),createRaw:e=>new be(e),parseTemplate:(e,t)=>Bt(e,t),createComment:e=>new V(e)}))}function Yt(e,t={}){let n=g;Jt(),_(!0);let r=J(t.event);try{return Y(r,()=>Xt(o=>{try{let i=typeof e=="function"?e():e;return S(i)}finally{o()}}))}finally{_(n)}}var Gt=!1;function Ir(){Gt||(Gt=!0,Lr(e=>{C()?.pending.add(e)}),kr(()=>C()?.nextResourceId()??""),Dr((e,t)=>{e&&C()?.data.set(e,t)}))}var Je=null;function Zt(e){Je=e}function Ye(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Je)try{i=Je(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=me(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${Z}">${n}<\/script>`}var qr=50;async function Qt(e,t={}){let n=g;Jt(),_(!0),Ir();let r=J(t.event);try{return await Y(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Xt(f=>{s=f,i=_r(),o=typeof e=="function"?e():e});let a=()=>{try{Kt(i,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await $r(),a()}let c=Kt(i,()=>S(o))+Ye(r);return s(),c})}finally{_(n)}}var jr={createComponent:pe,createElement:ot,createNativeElement:ue,createTemplate:$e,cloneTemplate:Ie,templateNode:pt,holeContent:gt,holeEnd:mt,holeScope:yt,createPortal:wt,render:de,hydrate:Q,insert:E,appendChildren:st,removeChildren:it,spread:bt,applyProps:fe,mergeProps:Et,bindPair:St,setProperty:q,setDynamicProperty:X,setAttribute:h,setDynamicAttribute:G,removeAttribute:rt,getAttribute:nt,setClassName:j,addClass:Qe,removeClass:et,toggleClass:tt,setStyles:Ae,delegateEvents:ce,addDelegatedEventListener:_e,removeDelegatedEventListener:oe,handleRef:F,resetIntegration:At,isIntegrationInitialized:vt},aa=jr;export{qt as ClientOnly,ur as Dynamic,Tr as ErrorBoundary,Z as FX_DATA_ID,Jn as For,Zn as Index,$n as Island,ve as JSX_PROPERTIES,rr as Match,gr as NoSsr,pr as Portal,Br as SVG_ELEMENTS,U as SVG_NAMESPACE,zn as Show,or as Switch,Ce as VERSION,Ur as VOID_ELEMENTS,Qe as addClass,_e as addDelegatedEventListener,ht as addNativeEventListener,st as appendChildren,Se as applyElementProp,fe as applyProps,xt as applyUse,at as asComponent,bo as asContext,xo as asOutlet,To as asProvider,ho as asRoute,mo as asRouter,go as asRoutes,Eo as asSuspense,St as bindPair,pn as captureHydrationCursor,wo as checkRenderType,Er as classMap,P as cleanChildren,Ie as cloneTemplate,zr as closest,pe as createComponent,Si as createDynamicElement,ot as createElement,ue as createNativeElement,wt as createPortal,J as createRequestContext,$e as createTemplate,aa as default,Qr as delegate,ce as delegateEvents,me as escapeFxJson,Vo as escapeHTML,qo as fnName,_o as generateID,nt as getAttribute,lo as getGlobal,Vr as getLitEventName,Pt as getLocals,Zr as getOffset,C as getRequestContext,je as getRequestEvent,Fe as getRequestLocals,ge as getServerData,Do as getStableElementId,Xr as getStyle,F as handleRef,Gr as hasClass,gt as holeContent,mt as holeEnd,yt as holeScope,jn as html,Q as hydrate,K as hydrateAdvancePast,qn as hydrateIslands,ws as indexArray,Go as initializeIntegration,E as insert,ie as insertExpression,Xo as intergartionInitialized,Wo as isAccessor,N as isComponent,fn as isContext,en as isCustomElement,so as isDOMNode,$o as isDelegatedEvent,Oe as isDomElement,I as isDomNode,Le as isDomText,Hr as isEventHandler,Io as isFunction,vt as isIntegrationInitialized,io as isJSXTemplate,nn as isLitTemplateResult,Ho as isNativeElement,cn as isOutlet,ne as isPromise,un as isProvider,ro as isReactElement,ln as isRoute,sn as isRouter,an as isRoutes,Nt as isSVGElement,g as isServer,dn as isSuspense,oo as isTemplateFactory,Jr as isVisible,jo as iterateFn,Es as keyArray,En as makeArrayFlat,bs as mapArray,Et as mergeProps,to as observeIntersection,no as observeResize,Ze as query,Kr as queryAll,on as registerCoreVersion,zo as registerCreateComponent,ao as registerGlobal,rt as removeAttribute,it as removeChildren,et as removeClass,oe as removeDelegatedEventListener,de as render,Yt as renderToString,Qt as renderToStringAsync,At as resetIntegration,te as runHydrationAt,Y as runWithRequestContext,yn as runWithoutHydration,Yr as scrollIntoView,S as serializeNode,Ye as serializeResourceData,h as setAttribute,se as setClassList,j as setClassName,Zt as setDataRedactor,G as setDynamicAttribute,Tt as setDynamicBoolAttribute,X as setDynamicProperty,q as setProperty,Mt as setRequestStore,_ as setServerMode,ae as setStyle,Ae as setStyles,Wr as shouldSetAsProperty,Fo as splitProps,bt as spread,Re as stampVersions,Sr as styleMap,Fn as svg,pt as templateNode,Fr as toAttributeName,tt as toggleClass,x as versions,eo as waitForElement,Me as warnOnVersionSkew};
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)R(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&R(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(R({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>xe});module.exports=ne(Ee);var m=require("@fluixi/reactive/signal");var M="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function P(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Ne=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var S=typeof document>"u";var j=Symbol.for("fluixi.server-node"),_=null;function w(){if(!_)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _}function A(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},re=null;function $(){return re}function O(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var H=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!S)for(let t of e)H.has(t)||q.has(t)||(H.add(t),document.addEventListener(t,se))}function se(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=$()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,fe=200;function ae(e,t,n,o,s){let a=o,r=new Map;return(0,c.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function D(e,t,n,o){if(x>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,s)}finally{x--}return()=>s}let i=ae(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),N(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&F(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):O(e,r)||p(e,r,n),r}if(A(t))return O(e,t)?(I(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=le(e,i,r,n);for(let u of f){let d=D(e,u.sig,u.marker);(0,c.onCleanup)(()=>{N(e,d()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let f=i.type(i.props||{});return C(e,f,n,o)}}}return N(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,m.isSignal)(l)){if(r){let d=h("",!0);t.push(d),r.push({marker:d,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let d=[];if(g([u],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function le(e,t,n,o){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let d=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],d)}else if(r===f)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[f]===t[a-1]){let d=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],d),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let d=u.get(t[i]);if(d!=null)if(f<d&&d<r){let y=i,L=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==d+L);)L++;if(L>d-f){let J=t[i];for(;f<d;)p(e,n[f++],J)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function ye(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function pe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>K(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function W(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function V(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){me(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){ye(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){pe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(q.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,H.has(a)||ie([a]);continue}if(o==="class"||o==="className"){K(e,s);continue}if(o==="classList"){typeof s=="function"?(0,c.createRenderEffect)(()=>W(e,s())):W(e,s);continue}if(o==="style"){typeof s=="function"?(0,c.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,c.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,c.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{r()})}else{let a=!0;(0,c.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();P(e,o,r,n)});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>P(e,o,t[o],n))}}}function me(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function G(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ge="__fx_dom_create_component__",z=globalThis[ge]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function xe(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=G(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(M,e):document.createElement(e);return B(o,t,n),he(o,t),o}function he(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{D(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
1
+ "use strict";var M=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var ne=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},oe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ee(t))!te.call(e,s)&&s!==n&&M(e,s,{get:()=>t[s],enumerable:!(o=Q(t,s))||o.enumerable});return e};var re=e=>oe(M({},"__esModule",{value:!0}),e);var Te={};ne(Te,{createDynamicElement:()=>Ee});module.exports=re(Te);var m=require("@fluixi/reactive/signal");var P="http://www.w3.org/2000/svg";function ie(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ie(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function j(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var S=typeof document>"u";var F=Symbol.for("fluixi.server-node"),$=null;function w(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function A(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},se=null;function k(){return se}function H(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function fe(e){if(!S)for(let t of e)D.has(t)||B.has(t)||(D.add(t),document.addEventListener(t,ae))}function ae(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,le=200;function ue(e,t,n,o,s){let a=o,r=new Map;return(0,c.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function _(e,t,n,o){if(x>le)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,s)}finally{x--}return()=>s}let i=ue(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&I(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||p(e,r,n),r}if(A(t))return H(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=ce(e,i,r,n);for(let u of f){let d=_(e,u.sig,u.marker);(0,c.onCleanup)(()=>{T(e,d()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let f=i.type(i.props||{});return C(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,m.isSignal)(l)){if(r){let d=h("",!0);t.push(d),r.push({marker:d,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let d=[];if(g([u],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function ce(e,t,n,o){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let d=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],d)}else if(r===f)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[f]===t[a-1]){let d=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],d),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let d=u.get(t[i]);if(d!=null)if(f<d&&d<r){let y=i,R=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==d+R);)R++;if(R>d-f){let Z=t[i];for(;f<d;)p(e,n[f++],Z)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ye(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function pe(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;N(e,t,s,o)})}function me(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function ge(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();N(e,t,!!o)})}function G(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>G(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function q(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function K(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function U(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){xe(s,e);continue}if(o!=="children"){if(o==="use"){ye(e,s);continue}if(o.startsWith("on:")){de(e,o.slice(3),s);continue}if(o.startsWith("prop:")){me(e,o.slice(5),s);continue}if(o.startsWith("attr:")){pe(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){ge(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(B.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,D.has(a)||fe([a]);continue}if(o==="class"||o==="className"){G(e,s);continue}if(o==="classList"){typeof s=="function"?(0,c.createRenderEffect)(()=>q(e,s())):q(e,s);continue}if(o==="style"){typeof s=="function"?(0,c.createRenderEffect)(()=>K(e,s())):K(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,c.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,c.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{r()})}else{let a=!0;(0,c.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>O(e,o,t[o],n))}}}function xe(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var L=require("@fluixi/reactive");var he="__fx_dom_create_component__",X=globalThis[he]??={fn:null};function J(e,t){if(X.fn)return X.fn(e,t);let n=typeof e=="function"?(0,L.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,L.isSignal)(n)){try{n.$name=e?.name}catch{}return j(n)}return n}var Y=require("@fluixi/reactive/signal");function Ee(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return U(o,t,n),be(o,t),o}function be(e,t){if(!t||t.children===void 0)return;let n=(0,Y.readChildren)(()=>t.children),o=s=>{_(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}