@fluixi/dom 1.0.0-alpha.77 → 1.0.0-alpha.78
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/cdn/dom-client.cjs +1 -0
- package/dist/cdn/dom-client.d.ts +20 -0
- package/dist/cdn/dom-client.d.ts.map +1 -0
- package/dist/cdn/dom-client.global.js +1 -0
- package/dist/cdn/dom-client.js +31 -0
- package/dist/cdn/dom-client.mjs +1 -0
- package/dist/cdn/dom.cjs +1 -1
- package/dist/cdn/dom.d.ts +2 -0
- package/dist/cdn/dom.d.ts.map +1 -1
- package/dist/cdn/dom.global.js +1 -1
- package/dist/cdn/dom.js +8 -0
- package/dist/cdn/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/dom/hydration.cjs +1 -1
- package/dist/lib/dom/hydration.mjs +1 -1
- package/dist/lib/dom/index.cjs +1 -1
- package/dist/lib/dom/index.mjs +1 -1
- package/dist/lib/dom/island.cjs +1 -1
- package/dist/lib/dom/island.mjs +1 -1
- package/dist/lib/dom/runtime.cjs +1 -1
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/dom/versions.cjs +1 -1
- package/dist/lib/dom/versions.js +1 -1
- package/dist/lib/dom/versions.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +1 -1
- package/package.json +3 -3
package/dist/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Oe=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var bn=Object.prototype.hasOwnProperty;var En=(e,t)=>{for(var n in t)Oe(e,n,{get:t[n],enumerable:!0})},wn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!bn.call(e,o)&&o!==n&&Oe(e,o,{get:()=>t[o],enumerable:!(r=xn(t,o))||r.enumerable});return e};var Nn=e=>wn(Oe({},"__esModule",{value:!0}),e);var ao={};En(ao,{ClientOnly:()=>et,Dynamic:()=>Qt,ErrorBoundary:()=>nn,FX_DATA_ID:()=>B,For:()=>Gt,Index:()=>Jt,Island:()=>jt,JSX_PROPERTIES:()=>le,Match:()=>Yt,NoSsr:()=>tn,Portal:()=>en,SVG_ELEMENTS:()=>Mn,SVG_NAMESPACE:()=>F,Show:()=>zt,Switch:()=>Zt,VOID_ELEMENTS:()=>Rn,addClass:()=>kn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>He,appendChildren:()=>Hn,applyElementProp:()=>ae,applyProps:()=>Ue,applyUse:()=>Ve,asComponent:()=>lr,asContext:()=>ar,asOutlet:()=>ir,asProvider:()=>sr,asRoute:()=>or,asRouter:()=>nr,asRoutes:()=>rr,asSuspense:()=>cr,bindPair:()=>_r,captureHydrationCursor:()=>Rt,checkRenderType:()=>ur,classMap:()=>on,cleanChildren:()=>k,cloneTemplate:()=>Ot,closest:()=>Ln,createComponent:()=>ze,createDynamicElement:()=>Xr,createElement:()=>jn,createNativeElement:()=>Fe,createPortal:()=>Lr,createRequestContext:()=>W,createTemplate:()=>kt,delegate:()=>Bn,delegateEvents:()=>je,escapeFxJson:()=>ie,escapeHTML:()=>Or,fnName:()=>Nr,generateID:()=>yr,getAttribute:()=>$n,getGlobal:()=>tr,getLitEventName:()=>An,getLocals:()=>Je,getOffset:()=>Un,getRequestContext:()=>R,getRequestEvent:()=>he,getRequestLocals:()=>xe,getServerData:()=>se,getStableElementId:()=>pr,getStyle:()=>qn,handleRef:()=>oe,hasClass:()=>_n,holeContent:()=>wr,holeEnd:()=>Er,holeScope:()=>br,html:()=>Ht,hydrate:()=>Ne,hydrateAdvancePast:()=>V,hydrateIslands:()=>Ft,indexArray:()=>K.indexArray,initializeIntegration:()=>qr,insert:()=>C,insertExpression:()=>Q,intergartionInitialized:()=>jr,isAccessor:()=>Dr,isComponent:()=>N,isContext:()=>Nt,isCustomElement:()=>ft,isDOMNode:()=>Qn,isDelegatedEvent:()=>hr,isDomElement:()=>ce,isDomNode:()=>$,isDomText:()=>ue,isEventHandler:()=>vn,isFunction:()=>xr,isIntegrationInitialized:()=>Fr,isJSXTemplate:()=>Zn,isLitTemplateResult:()=>pt,isNativeElement:()=>kr,isOutlet:()=>Et,isPromise:()=>Z,isProvider:()=>wt,isReactElement:()=>Jn,isRoute:()=>bt,isRouter:()=>xt,isRoutes:()=>Tt,isSVGElement:()=>Be,isServer:()=>g,isSuspense:()=>St,isTemplateFactory:()=>Yn,isVisible:()=>Vn,iterateFn:()=>Sr,keyArray:()=>K.keyArray,makeArrayFlat:()=>Dt,mapArray:()=>K.mapArray,mergeProps:()=>Mr,observeIntersection:()=>zn,observeResize:()=>Gn,query:()=>De,queryAll:()=>Pn,registerCreateComponent:()=>Ir,registerGlobal:()=>er,removeAttribute:()=>In,removeChildren:()=>Fn,removeClass:()=>On,removeDelegatedEventListener:()=>qe,render:()=>Ke,renderToString:()=>lt,renderToStringAsync:()=>ut,resetIntegration:()=>Hr,runHydrationAt:()=>Y,runWithRequestContext:()=>U,runWithoutHydration:()=>Mt,scrollIntoView:()=>Wn,serializeNode:()=>v,serializeResourceData:()=>Pe,setAttribute:()=>E,setClassList:()=>ne,setClassName:()=>te,setDataRedactor:()=>ct,setDynamicAttribute:()=>pe,setDynamicBoolAttribute:()=>We,setDynamicProperty:()=>ye,setProperty:()=>ee,setRequestStore:()=>Xe,setServerMode:()=>_,setStyle:()=>re,setStyles:()=>dt,shouldSetAsProperty:()=>Cn,splitProps:()=>Pr,spread:()=>Rr,styleMap:()=>an,svg:()=>Vt,templateNode:()=>Tr,toAttributeName:()=>Sn,toggleClass:()=>Dn,waitForElement:()=>Kn});module.exports=Nn(ao);function Sn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function vn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function An(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Cn(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 Rn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mn=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"]),F="http://www.w3.org/2000/svg";function ft(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ft(e)){e[t]=n;return}E(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function De(e,t=document){return t.querySelector(e)}function Pn(e,t=document){return Array.from(t.querySelectorAll(e))}function Ln(e,t){return e.closest(t)}function kn(e,...t){e.classList.add(...t)}function On(e,...t){e.classList.remove(...t)}function Dn(e,...t){t.forEach(n=>e.classList.toggle(n))}function _n(e,t){return e.classList.contains(t)}function E(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 $n(e,t){return e.getAttribute(t)}function In(e,t){e.removeAttribute(t)}function dt(e,t){Object.assign(e.style,t)}function qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function jn(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")dt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else E(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Fn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Hn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Vn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Wn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Un(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Bn(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 Kn(e,t=5e3){return new Promise((n,r)=>{let o=De(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=De(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 zn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Gn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Xn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Jn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xn}function pt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Yn(e){if(typeof e!="function")return!1;try{let t=e();return pt(t)}catch{return!1}}function Zn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Qn(e){return e instanceof Node}function er(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function tr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");var yt="1.0.0-alpha.77";var mt=require("@fluixi/reactive"),w={dom:yt,reactive:mt.VERSION};function gt(e){w.core&&e.setAttribute("fluixi",w.core),e.setAttribute("fx-dom",w.dom),e.setAttribute("fx-reactive",w.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=w)}function ht(){let e=[w.core,w.dom,w.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${w.core??"(absent)"}, dom ${w.dom}, reactive ${w.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 nr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function rr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ir(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function ar(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function lr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Nt(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 St(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ur(e){return xt(e)?{type:"router",value:e}:bt(e)?{type:"route",value:e}:Tt(e)?{type:"routes",value:e}:Et(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:St(e)?{type:"suspense",value:e}:wt(e)?{type:"provider",value:e}:Nt(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 J=Symbol.for("fluixi.server-node"),_e=null;function vt(e){_e=e}function H(){if(!_e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _e}function $(e){return e!=null&&e[J]===!0?!0:typeof Node<"u"&&e instanceof Node}function ce(e){return e!=null&&e[J]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ue(e){return e!=null&&e[J]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},At=null;function Ct(e){At=e}function fe(){return At}function $e(e,t){return u.active&&t.parentNode===e}function Ie(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Y(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 Mt(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 V(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}function fr(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 dr(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 pr(e){return dr(fr(e))}var yr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),mr={};var Pt=new Map,de=new Set,me=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!g)for(let t of e)de.has(t)||me.has(t)||(de.add(t),document.addEventListener(t,gr))}function gr(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 Lt(e,t,n){if(e[`$$${t}`]=n,me.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||je([t])}function qe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function hr(e){return!me.has(e)}function xr(e){return typeof e=="function"}function O(e,t=!1){if(g)return H().createText(e);if(u.active&&!t){let n=fe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(g)return H().createElement(e,t);if(u.active){let n=fe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(F,e):document.createElement(e)}function kt(e,t=!1){let n=Pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Pt.set(e,r),r}function Tr(e,t,n=!1,r=!1){if(g){let o=H();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=fe()?.hydrateStatic(t);if(o)return o}return Ot(kt(e,r),r).firstChild}function br(e,t){if(!u.active)return t();let n=Y(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Y(e.nextSibling,()=>r(...o)):r(...o))}return n}function Er(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 wr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ot(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Dt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Dt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Nr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Sr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var L=0,vr=200;function Ar(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}L++;try{i=Q(t,a,n,i,s),o(i)}finally{L--}})}function C(e,t,n,r){if(L>vr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!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)){L++;try{o=Q(e,t,n,o)}finally{L--}return()=>o}let a=Ar(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Q(e,t,n,r,o){if(t==null||typeof t=="boolean")return k(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return k(e,r,n);if(Z(t)){let s=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),k(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&Q(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=O(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=k(e,r,n)}if(r&&ue(r))return r.data=t,r;let s=O(t);return r&&r.parentNode===e?e.replaceChild(s,r):$e(e,s)||T(e,s,n),s}if($(t))return $e(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),k(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=[];P(t,s,e,n,!0,o,l);let c=Cr(e,a,s,n);for(let f of l){let p=C(e,f.sig,f.marker);(0,d.onCleanup)(()=>{k(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 Q(e,l,n,r)}}}return k(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"&&!Z(l)&&!(0,x.isSignal)(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)&&!(0,x.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Z(c)&&!(0,x.isSignal)(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((0,x.isSignal)(c)){if(s){let p=O("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.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(Z(l)){let c=O("",!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(O(c));continue}t.push(O(String(l)))}}}}function Cr(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;)T(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;T(e,n[l++],t[a++].nextSibling),T(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 Le=t[a];for(;l<p;)T(e,n[l++],Le)}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 k(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 ee(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Ve(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 pe(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function ye(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function We(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function te(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>te(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 ne(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 re(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 Rr(e){let{element:t,props:n,prevProps:r=mr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ce(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===F,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"){oe(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ye(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(pe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>te(t,c()))):te(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&qe(t,y),c&&Lt(t,y,c);continue}let p=le.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ye(t,l,c):pe(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?ee(t,l,n[l]):E(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();qe(t,c)}else le.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ue(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ye(e,r.slice(5),o);continue}if(r.startsWith("attr:")){pe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(me.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,de.has(i)||je([i]);continue}if(r==="class"||r==="className"){te(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ne(e,o())):ne(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(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();ae(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function Mr(...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 Pr(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 oe(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 Lr(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 kr(e){return typeof e=="string"&&e.toLowerCase()===e}function Be(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 Or(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Z(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Dr(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Ke(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=""),gt(t),ht(),C(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function _r(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 $r="__fx_dom_create_component__",I=globalThis[$r]??={fn:null};function Ir(e){I.fn=e}function qr(e={}){let t=e.signalSystem?.createComponent;t&&(I.fn=t)}function ze(e,t){return I.fn?I.fn(e,t):(()=>e(t))}var jr=()=>I.fn!==null,Fr=()=>I.fn!==null;function Hr(){I.fn=null}var ge,$t={getStore:()=>ge,run(e,t){let n=ge;ge=e;try{return t()}finally{ge=n}}},Ge=$t;function Xe(e){Ge=e??$t}function W(e={}){e.locals||(e.locals=e.request?xe(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 U(e,t){return Ge.run(e,t)}function R(){return Ge.getStore()}function he(){return R()?.event}function Je(){let e=he();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function xe(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}var Te=require("@fluixi/reactive/signal");var B="__FX_DATA__";function ie(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ye;function se(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ye!==void 0)return Ye;let t=null;if(typeof document<"u"){let n=document.getElementById(B)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ye=t}function be(){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 Vr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee=typeof process<"u"&&process.env&&!1;function we(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 Wr(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Vr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ee&&t&&we(`<${e}>`,t),null)}function Ur(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`<${e}> (static)`,t),null)}function Br(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}be();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ee&&t&&we(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Kr(e){be();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`marker <!--${e.slice(0,24)}-->`,t),null)}var It=!1;function zr(){It||(It=!0,Ct({hydrateElement:Wr,hydrateText:Br,hydrateMarker:Kr,hydrateStatic:Ur}))}function Ne(e,t,n){zr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=se(),o=n?.resourceNamespace,i=0;(0,Te.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,Te.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Ke(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ze="fluixi-island";function jt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ze),i=r??t.name??"Island";E(o,"name",i),E(o,"props",JSON.stringify(n??{}));let s=g?R():void 0;if(s){let a=s.nextIslandNamespace(i);C(o,()=>s.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var qt=!1;function Gr(){if(qt||typeof document>"u")return;qt=!0;let e=document.createElement("style");e.textContent=`${Ze}{display:contents}`,document.head.appendChild(e)}function Ft(e){if(typeof document>"u")return;Gr();let t=document.querySelectorAll(Ze),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{}Ne(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ht(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Vt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Wt=require("@fluixi/reactive/signal");function Xr(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Be(e);if(g)return H().createElement(e,n);let r=n?document.createElementNS(F,e):document.createElement(e);return Ue(r,t,n),Jr(r,t),r}function Jr(e,t){if(!t||t.children===void 0)return;let n=(0,Wt.readChildren)(()=>t.children),r=o=>{C(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Ut(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Bt(e){return e!=null&&e!==!1}function Kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zt(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"&&!Kt(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 Se=require("@fluixi/reactive/signal");function Gt(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 V(a),a};return e.by?(0,Se.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Se.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Xt=require("@fluixi/reactive/signal");function Jt(e){let t=D(()=>e.each);return(0,Xt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return V(o),o},{fallback:()=>e.fallback??null})}var K=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var Qe=Symbol("match");function Yt(e){return{[Qe]:!0,when:D(()=>e.when),get children(){return e.children}}}function Zt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=s)};return(0,S.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Qe]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Qe]!==!0)continue;let f=l.when();if(Bt(f))return i(s),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function Qt(e){let t=Ut(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 ve=require("@fluixi/reactive/signal");function en(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ve.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&oe(e.ref,r)}),(0,ve.onCleanup)(()=>{n(),r.remove()}),null}var Ae=require("@fluixi/reactive/signal");function et(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,Ae.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ae.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var tn=et;var Ce=require("@fluixi/reactive/signal");function nn(e){let[t,n]=(0,Ce.createSignal)(null),r=()=>n(null);return(0,Ce.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 rn=require("@fluixi/reactive/signal");function on(e){return(0,rn.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 sn=require("@fluixi/reactive/signal");function Yr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e){return(0,sn.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(`${Yr(r)}: ${i}`)}return n.join("; ")})}var Me=1,rt=3,ot=8,ln;ln=J;var z=class{constructor(){this[ln]=!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(){}},q=class e extends z{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)}},Re=class e extends z{constructor(n){super();this.nodeType=Me;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},G=class e extends z{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)}},tt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},nt=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}},j=class e extends z{constructor(n,r=!1){super();this.nodeType=Me;this.attributes=new Map;this.style=new tt;this.classList=new nt(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 q(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 Zr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),un=/&/g,fn=/</g,dn=/>/g,Qr=/"/g;function it(e){return e.replace(un,"&").replace(fn,"<").replace(dn,">")}function cn(e){return e.replace(un,"&").replace(Qr,""").replace(fn,"<").replace(dn,">")}function eo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function to(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(`${eo(n)}: ${r}`)}return t.join("; ")}function no(e){let t="",n=to(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${cn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${cn(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return it(e);if(typeof e=="number")return it(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case rt:return it(e.data??"");case ot:return`<!--${e.data??""}-->`;case Me:{let t=e.localName,n=`<${t}${no(e)}>`;if(Zr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}var at=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oo={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function pn(e){return e.replace(/&(#?\w+);/g,(t,n)=>oo[n]??t)}var A=class extends Error{};function yn(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 A(`unterminated comment at ${c}`);i(new G(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new A(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new A(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new A(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof j))throw new A(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new q(pn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new A(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new j(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 Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let X=e.slice(Le,m);if(X==="")throw new A(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new A(`attribute ${X} must have a double-quoted value`);let ke=e.indexOf('"',m+2);if(ke===-1)throw new A(`unterminated value for ${X}`);y.setAttribute(X,pn(e.slice(m+2,ke))),m=ke+1}else y.setAttribute(X,"")}return i(y),ro.has(p)||o.push(y),m}}var mn=!1;function hn(){mn||(mn=!0,vt({createElement:(e,t)=>new j(e,t),createText:e=>new q(e),createRaw:e=>new Re(e),parseTemplate:(e,t)=>yn(e,t),createComment:e=>new G(e)}))}function lt(e,t={}){let n=g;hn(),_(!0);let r=W(t.event);try{return U(r,()=>(0,at.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return v(i)}finally{o()}}))}finally{_(n)}}var gn=!1;function io(){gn||(gn=!0,(0,b.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var st=null;function ct(e){st=e}function Pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(st)try{i=st(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=ie(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${B}">${n}<\/script>`}var so=50;async function ut(e,t={}){let n=g;hn(),_(!0),io();let r=W(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,at.createRoot)(f=>{s=f,i=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(i,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<so;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(i,()=>v(o))+Pe(r);return s(),c})}finally{_(n)}}
|
|
1
|
+
"use strict";var Oe=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var bn=Object.prototype.hasOwnProperty;var En=(e,t)=>{for(var n in t)Oe(e,n,{get:t[n],enumerable:!0})},wn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!bn.call(e,o)&&o!==n&&Oe(e,o,{get:()=>t[o],enumerable:!(r=xn(t,o))||r.enumerable});return e};var Nn=e=>wn(Oe({},"__esModule",{value:!0}),e);var ao={};En(ao,{ClientOnly:()=>et,Dynamic:()=>Qt,ErrorBoundary:()=>nn,FX_DATA_ID:()=>B,For:()=>Gt,Index:()=>Jt,Island:()=>jt,JSX_PROPERTIES:()=>le,Match:()=>Yt,NoSsr:()=>tn,Portal:()=>en,SVG_ELEMENTS:()=>Mn,SVG_NAMESPACE:()=>F,Show:()=>zt,Switch:()=>Zt,VOID_ELEMENTS:()=>Rn,addClass:()=>kn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>He,appendChildren:()=>Hn,applyElementProp:()=>ae,applyProps:()=>Ue,applyUse:()=>Ve,asComponent:()=>lr,asContext:()=>ar,asOutlet:()=>ir,asProvider:()=>sr,asRoute:()=>or,asRouter:()=>nr,asRoutes:()=>rr,asSuspense:()=>cr,bindPair:()=>_r,captureHydrationCursor:()=>Rt,checkRenderType:()=>ur,classMap:()=>on,cleanChildren:()=>k,cloneTemplate:()=>Ot,closest:()=>Ln,createComponent:()=>ze,createDynamicElement:()=>Xr,createElement:()=>jn,createNativeElement:()=>Fe,createPortal:()=>Lr,createRequestContext:()=>W,createTemplate:()=>kt,delegate:()=>Bn,delegateEvents:()=>je,escapeFxJson:()=>ie,escapeHTML:()=>Or,fnName:()=>Nr,generateID:()=>yr,getAttribute:()=>$n,getGlobal:()=>tr,getLitEventName:()=>An,getLocals:()=>Je,getOffset:()=>Un,getRequestContext:()=>R,getRequestEvent:()=>he,getRequestLocals:()=>xe,getServerData:()=>se,getStableElementId:()=>pr,getStyle:()=>qn,handleRef:()=>oe,hasClass:()=>_n,holeContent:()=>wr,holeEnd:()=>Er,holeScope:()=>br,html:()=>Ht,hydrate:()=>Ne,hydrateAdvancePast:()=>V,hydrateIslands:()=>Ft,indexArray:()=>K.indexArray,initializeIntegration:()=>qr,insert:()=>C,insertExpression:()=>Q,intergartionInitialized:()=>jr,isAccessor:()=>Dr,isComponent:()=>N,isContext:()=>Nt,isCustomElement:()=>ft,isDOMNode:()=>Qn,isDelegatedEvent:()=>hr,isDomElement:()=>ce,isDomNode:()=>$,isDomText:()=>ue,isEventHandler:()=>vn,isFunction:()=>xr,isIntegrationInitialized:()=>Fr,isJSXTemplate:()=>Zn,isLitTemplateResult:()=>pt,isNativeElement:()=>kr,isOutlet:()=>Et,isPromise:()=>Z,isProvider:()=>wt,isReactElement:()=>Jn,isRoute:()=>bt,isRouter:()=>xt,isRoutes:()=>Tt,isSVGElement:()=>Be,isServer:()=>g,isSuspense:()=>St,isTemplateFactory:()=>Yn,isVisible:()=>Vn,iterateFn:()=>Sr,keyArray:()=>K.keyArray,makeArrayFlat:()=>Dt,mapArray:()=>K.mapArray,mergeProps:()=>Mr,observeIntersection:()=>zn,observeResize:()=>Gn,query:()=>De,queryAll:()=>Pn,registerCreateComponent:()=>Ir,registerGlobal:()=>er,removeAttribute:()=>In,removeChildren:()=>Fn,removeClass:()=>On,removeDelegatedEventListener:()=>qe,render:()=>Ke,renderToString:()=>lt,renderToStringAsync:()=>ut,resetIntegration:()=>Hr,runHydrationAt:()=>Y,runWithRequestContext:()=>U,runWithoutHydration:()=>Mt,scrollIntoView:()=>Wn,serializeNode:()=>v,serializeResourceData:()=>Pe,setAttribute:()=>E,setClassList:()=>ne,setClassName:()=>te,setDataRedactor:()=>ct,setDynamicAttribute:()=>pe,setDynamicBoolAttribute:()=>We,setDynamicProperty:()=>ye,setProperty:()=>ee,setRequestStore:()=>Xe,setServerMode:()=>_,setStyle:()=>re,setStyles:()=>dt,shouldSetAsProperty:()=>Cn,splitProps:()=>Pr,spread:()=>Rr,styleMap:()=>an,svg:()=>Vt,templateNode:()=>Tr,toAttributeName:()=>Sn,toggleClass:()=>Dn,waitForElement:()=>Kn});module.exports=Nn(ao);function Sn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function vn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function An(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Cn(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 Rn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mn=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"]),F="http://www.w3.org/2000/svg";function ft(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ft(e)){e[t]=n;return}E(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function De(e,t=document){return t.querySelector(e)}function Pn(e,t=document){return Array.from(t.querySelectorAll(e))}function Ln(e,t){return e.closest(t)}function kn(e,...t){e.classList.add(...t)}function On(e,...t){e.classList.remove(...t)}function Dn(e,...t){t.forEach(n=>e.classList.toggle(n))}function _n(e,t){return e.classList.contains(t)}function E(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 $n(e,t){return e.getAttribute(t)}function In(e,t){e.removeAttribute(t)}function dt(e,t){Object.assign(e.style,t)}function qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function jn(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")dt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else E(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Fn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Hn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Vn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Wn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Un(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Bn(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 Kn(e,t=5e3){return new Promise((n,r)=>{let o=De(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=De(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 zn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Gn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Xn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Jn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xn}function pt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Yn(e){if(typeof e!="function")return!1;try{let t=e();return pt(t)}catch{return!1}}function Zn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Qn(e){return e instanceof Node}function er(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function tr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");var yt="1.0.0-alpha.78";var mt=require("@fluixi/reactive/version"),w={dom:yt,reactive:mt.VERSION};function gt(e){w.core&&e.setAttribute("fluixi",w.core),e.setAttribute("fx-dom",w.dom),e.setAttribute("fx-reactive",w.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=w)}function ht(){let e=[w.core,w.dom,w.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${w.core??"(absent)"}, dom ${w.dom}, reactive ${w.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 nr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function rr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ir(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function ar(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function lr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Nt(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 St(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ur(e){return xt(e)?{type:"router",value:e}:bt(e)?{type:"route",value:e}:Tt(e)?{type:"routes",value:e}:Et(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:St(e)?{type:"suspense",value:e}:wt(e)?{type:"provider",value:e}:Nt(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 J=Symbol.for("fluixi.server-node"),_e=null;function vt(e){_e=e}function H(){if(!_e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _e}function $(e){return e!=null&&e[J]===!0?!0:typeof Node<"u"&&e instanceof Node}function ce(e){return e!=null&&e[J]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ue(e){return e!=null&&e[J]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},At=null;function Ct(e){At=e}function fe(){return At}function $e(e,t){return u.active&&t.parentNode===e}function Ie(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Y(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 Mt(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 V(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}function fr(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 dr(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 pr(e){return dr(fr(e))}var yr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),mr={};var Pt=new Map,de=new Set,me=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!g)for(let t of e)de.has(t)||me.has(t)||(de.add(t),document.addEventListener(t,gr))}function gr(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 Lt(e,t,n){if(e[`$$${t}`]=n,me.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||je([t])}function qe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function hr(e){return!me.has(e)}function xr(e){return typeof e=="function"}function O(e,t=!1){if(g)return H().createText(e);if(u.active&&!t){let n=fe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(g)return H().createElement(e,t);if(u.active){let n=fe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(F,e):document.createElement(e)}function kt(e,t=!1){let n=Pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Pt.set(e,r),r}function Tr(e,t,n=!1,r=!1){if(g){let o=H();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=fe()?.hydrateStatic(t);if(o)return o}return Ot(kt(e,r),r).firstChild}function br(e,t){if(!u.active)return t();let n=Y(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Y(e.nextSibling,()=>r(...o)):r(...o))}return n}function Er(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 wr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ot(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Dt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Dt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Nr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Sr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var L=0,vr=200;function Ar(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;L++;try{let f=c();s.set(c,f)}finally{L--}}a=s.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}L++;try{i=Q(t,a,n,i,s),o(i)}finally{L--}})}function C(e,t,n,r){if(L>vr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!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)){L++;try{o=Q(e,t,n,o)}finally{L--}return()=>o}let a=Ar(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Q(e,t,n,r,o){if(t==null||typeof t=="boolean")return k(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return k(e,r,n);if(Z(t)){let s=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),k(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&Q(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=O(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=k(e,r,n)}if(r&&ue(r))return r.data=t,r;let s=O(t);return r&&r.parentNode===e?e.replaceChild(s,r):$e(e,s)||T(e,s,n),s}if($(t))return $e(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),k(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=[];P(t,s,e,n,!0,o,l);let c=Cr(e,a,s,n);for(let f of l){let p=C(e,f.sig,f.marker);(0,d.onCleanup)(()=>{k(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 Q(e,l,n,r)}}}return k(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"&&!Z(l)&&!(0,x.isSignal)(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)&&!(0,x.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Z(c)&&!(0,x.isSignal)(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((0,x.isSignal)(c)){if(s){let p=O("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.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(Z(l)){let c=O("",!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(O(c));continue}t.push(O(String(l)))}}}}function Cr(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;)T(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;T(e,n[l++],t[a++].nextSibling),T(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 Le=t[a];for(;l<p;)T(e,n[l++],Le)}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 k(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 ee(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Ve(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 pe(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function ye(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function We(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function te(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>te(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 ne(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 re(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 Rr(e){let{element:t,props:n,prevProps:r=mr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ce(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===F,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"){oe(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ye(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(pe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>te(t,c()))):te(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&qe(t,y),c&&Lt(t,y,c);continue}let p=le.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ye(t,l,c):pe(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?ee(t,l,n[l]):E(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();qe(t,c)}else le.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ue(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ye(e,r.slice(5),o);continue}if(r.startsWith("attr:")){pe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(me.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,de.has(i)||je([i]);continue}if(r==="class"||r==="className"){te(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ne(e,o())):ne(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(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();ae(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function Mr(...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 Pr(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 oe(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 Lr(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 kr(e){return typeof e=="string"&&e.toLowerCase()===e}function Be(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 Or(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Z(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Dr(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Ke(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=""),gt(t),ht(),C(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function _r(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 $r="__fx_dom_create_component__",I=globalThis[$r]??={fn:null};function Ir(e){I.fn=e}function qr(e={}){let t=e.signalSystem?.createComponent;t&&(I.fn=t)}function ze(e,t){return I.fn?I.fn(e,t):(()=>e(t))}var jr=()=>I.fn!==null,Fr=()=>I.fn!==null;function Hr(){I.fn=null}var ge,$t={getStore:()=>ge,run(e,t){let n=ge;ge=e;try{return t()}finally{ge=n}}},Ge=$t;function Xe(e){Ge=e??$t}function W(e={}){e.locals||(e.locals=e.request?xe(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 U(e,t){return Ge.run(e,t)}function R(){return Ge.getStore()}function he(){return R()?.event}function Je(){let e=he();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function xe(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}var Te=require("@fluixi/reactive/signal");var B="__FX_DATA__";function ie(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ye;function se(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ye!==void 0)return Ye;let t=null;if(typeof document<"u"){let n=document.getElementById(B)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ye=t}function be(){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 Vr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee=typeof process<"u"&&process.env&&!1;function we(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 Wr(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Vr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ee&&t&&we(`<${e}>`,t),null)}function Ur(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`<${e}> (static)`,t),null)}function Br(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}be();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ee&&t&&we(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Kr(e){be();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`marker <!--${e.slice(0,24)}-->`,t),null)}var It=!1;function zr(){It||(It=!0,Ct({hydrateElement:Wr,hydrateText:Br,hydrateMarker:Kr,hydrateStatic:Ur}))}function Ne(e,t,n){zr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=se(),o=n?.resourceNamespace,i=0;(0,Te.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,Te.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Ke(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ze="fluixi-island";function jt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ze),i=r??t.name??"Island";E(o,"name",i),E(o,"props",JSON.stringify(n??{}));let s=g?R():void 0;if(s){let a=s.nextIslandNamespace(i);C(o,()=>s.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var qt=!1;function Gr(){if(qt||typeof document>"u")return;qt=!0;let e=document.createElement("style");e.textContent=`${Ze}{display:contents}`,document.head.appendChild(e)}function Ft(e){if(typeof document>"u")return;Gr();let t=document.querySelectorAll(Ze),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{}Ne(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ht(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Vt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Wt=require("@fluixi/reactive/signal");function Xr(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Be(e);if(g)return H().createElement(e,n);let r=n?document.createElementNS(F,e):document.createElement(e);return Ue(r,t,n),Jr(r,t),r}function Jr(e,t){if(!t||t.children===void 0)return;let n=(0,Wt.readChildren)(()=>t.children),r=o=>{C(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Ut(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Bt(e){return e!=null&&e!==!1}function Kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zt(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"&&!Kt(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 Se=require("@fluixi/reactive/signal");function Gt(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 V(a),a};return e.by?(0,Se.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Se.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Xt=require("@fluixi/reactive/signal");function Jt(e){let t=D(()=>e.each);return(0,Xt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return V(o),o},{fallback:()=>e.fallback??null})}var K=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var Qe=Symbol("match");function Yt(e){return{[Qe]:!0,when:D(()=>e.when),get children(){return e.children}}}function Zt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=s)};return(0,S.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Qe]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Qe]!==!0)continue;let f=l.when();if(Bt(f))return i(s),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function Qt(e){let t=Ut(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 ve=require("@fluixi/reactive/signal");function en(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ve.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&oe(e.ref,r)}),(0,ve.onCleanup)(()=>{n(),r.remove()}),null}var Ae=require("@fluixi/reactive/signal");function et(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,Ae.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ae.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var tn=et;var Ce=require("@fluixi/reactive/signal");function nn(e){let[t,n]=(0,Ce.createSignal)(null),r=()=>n(null);return(0,Ce.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 rn=require("@fluixi/reactive/signal");function on(e){return(0,rn.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 sn=require("@fluixi/reactive/signal");function Yr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e){return(0,sn.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(`${Yr(r)}: ${i}`)}return n.join("; ")})}var Me=1,rt=3,ot=8,ln;ln=J;var z=class{constructor(){this[ln]=!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(){}},q=class e extends z{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)}},Re=class e extends z{constructor(n){super();this.nodeType=Me;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},G=class e extends z{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)}},tt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},nt=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}},j=class e extends z{constructor(n,r=!1){super();this.nodeType=Me;this.attributes=new Map;this.style=new tt;this.classList=new nt(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 q(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 Zr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),un=/&/g,fn=/</g,dn=/>/g,Qr=/"/g;function it(e){return e.replace(un,"&").replace(fn,"<").replace(dn,">")}function cn(e){return e.replace(un,"&").replace(Qr,""").replace(fn,"<").replace(dn,">")}function eo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function to(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(`${eo(n)}: ${r}`)}return t.join("; ")}function no(e){let t="",n=to(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${cn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${cn(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return it(e);if(typeof e=="number")return it(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case rt:return it(e.data??"");case ot:return`<!--${e.data??""}-->`;case Me:{let t=e.localName,n=`<${t}${no(e)}>`;if(Zr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}var at=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oo={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function pn(e){return e.replace(/&(#?\w+);/g,(t,n)=>oo[n]??t)}var A=class extends Error{};function yn(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 A(`unterminated comment at ${c}`);i(new G(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new A(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new A(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new A(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof j))throw new A(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new q(pn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new A(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new j(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 Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let X=e.slice(Le,m);if(X==="")throw new A(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new A(`attribute ${X} must have a double-quoted value`);let ke=e.indexOf('"',m+2);if(ke===-1)throw new A(`unterminated value for ${X}`);y.setAttribute(X,pn(e.slice(m+2,ke))),m=ke+1}else y.setAttribute(X,"")}return i(y),ro.has(p)||o.push(y),m}}var mn=!1;function hn(){mn||(mn=!0,vt({createElement:(e,t)=>new j(e,t),createText:e=>new q(e),createRaw:e=>new Re(e),parseTemplate:(e,t)=>yn(e,t),createComment:e=>new G(e)}))}function lt(e,t={}){let n=g;hn(),_(!0);let r=W(t.event);try{return U(r,()=>(0,at.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return v(i)}finally{o()}}))}finally{_(n)}}var gn=!1;function io(){gn||(gn=!0,(0,b.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var st=null;function ct(e){st=e}function Pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(st)try{i=st(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=ie(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${B}">${n}<\/script>`}var so=50;async function ut(e,t={}){let n=g;hn(),_(!0),io();let r=W(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,at.createRoot)(f=>{s=f,i=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(i,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<so;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(i,()=>v(o))+Pe(r);return s(),c})}finally{_(n)}}
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function hr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function xr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Tr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function br(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 Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=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"]),H="http://www.w3.org/2000/svg";function Lt(e){return e.localName.includes("-")}function me(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Lt(e)){e[t]=n;return}T(e,t,n,r)}var ge=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function je(e,t=document){return t.querySelector(e)}function Nr(e,t=document){return Array.from(t.querySelectorAll(e))}function Sr(e,t){return e.closest(t)}function vr(e,...t){e.classList.add(...t)}function Ar(e,...t){e.classList.remove(...t)}function Cr(e,...t){t.forEach(n=>e.classList.toggle(n))}function Rr(e,t){return e.classList.contains(t)}function T(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 Mr(e,t){return e.getAttribute(t)}function Pr(e,t){e.removeAttribute(t)}function kt(e,t){Object.assign(e.style,t)}function Lr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function kr(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")kt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else T(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Or(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Dr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function _r(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function $r(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Ir(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 jr(e,t=5e3){return new Promise((n,r)=>{let o=je(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=je(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 Fr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Hr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Ot=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Vr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ot}function Dt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Wr(e){if(typeof e!="function")return!1;try{let t=e();return Dt(t)}catch{return!1}}function Ur(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Br(e){return e instanceof Node}function Kr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function zr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";var Fe="1.0.0-alpha.77";import{VERSION as _t}from"@fluixi/reactive";var b={dom:Fe,reactive:_t};function He(e){b.core&&e.setAttribute("fluixi",b.core),e.setAttribute("fx-dom",b.dom),e.setAttribute("fx-reactive",b.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=b)}function Ve(){let e=[b.core,b.dom,b.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${b.core??"(absent)"}, dom ${b.dom}, reactive ${b.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 Qr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function eo(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function to(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function no(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function ro(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function oo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function io(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function so(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function w(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ao(e){return $t(e)?{type:"router",value:e}:qt(e)?{type:"route",value:e}:It(e)?{type:"routes",value:e}:jt(e)?{type:"outlet",value:e}:w(e)?{type:"component",value:e}:Vt(e)?{type:"suspense",value:e}:Ft(e)?{type:"provider",value:e}:Ht(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ge,createEffect as U,createRenderEffect as m,createRoot as Bt,onCleanup as L,readChildren as Kt}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var V=Symbol.for("fluixi.server-node"),he=null;function We(e){he=e}function $(){if(!he)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return he}function I(e){return e!=null&&e[V]===!0?!0:typeof Node<"u"&&e instanceof Node}function xe(e){return e!=null&&e[V]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Te(e){return e!=null&&e[V]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ue=null;function Be(e){Ue=e}function G(){return Ue}function be(e,t){return u.active&&t.parentNode===e}function Ee(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Wt(){return u.active?u.cursor:null}function X(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 Ut(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 W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ee(t)}function zt(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 Gt(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 bo(e){return Gt(zt(e))}var Eo=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Xt={};var Ke=new Map,Y=new Set,re=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Xe(e){if(!g)for(let t of e)Y.has(t)||re.has(t)||(Y.add(t),document.addEventListener(t,Jt))}function Jt(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 Yt(e,t,n){if(e[`$$${t}`]=n,re.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Y.has(t)||Xe([t])}function ze(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function wo(e){return!re.has(e)}function No(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Je(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Zt(e,t=!1){let n=Ke.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ke.set(e,r),r}function So(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=G()?.hydrateStatic(t);if(o)return o}return Qt(Zt(e,r),r).firstChild}function vo(e,t){if(!u.active)return t();let n=X(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?X(e.nextSibling,()=>r(...o)):r(...o))}return n}function Ao(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 Co(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Qt(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 Ro(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Mo(e){if(x(e)||w(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!w(t);)t=t();return t}var v=0,tn=200;function nn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(w(e)&&!x(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(w(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!w(a))break}v++;try{i=Z(t,a,n,i,s),o(i)}finally{v--}})}function A(e,t,n,r){if(v>tn)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)){v++;try{o=Z(e,t,n,o)}finally{v--}return()=>o}let a=nn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Z(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(J(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&Z(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 h(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&&Te(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):be(e,s)||h(e,s,n),s}if(I(t))return be(e,t)?(Ee(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=rn(e,a,s,n);for(let f of l){let d=A(e,f.sig,f.marker);L(()=>{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 Z(e,l,n,r)}}}return P(e,r,n)}function S(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"&&!J(l)&&!x(l)&&!w(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(w(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!J(c)&&!x(c)&&!w(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(x(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(J(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(S([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)){S(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)?S(f,t,n,r,!1,i):S([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 rn(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;)h(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;h(e,n[l++],t[a++].nextSibling),h(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 pe=t[a];for(;l<d;)h(e,n[l++],pe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(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 h(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 Ye(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 Ze(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 we(e,t,n,r=!1){return typeof n!="function"?(T(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;T(e,t,o,r)})}function Ne(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;Q(e,t,r)})}function Qe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):m(()=>{let r=n();T(e,t,!!r)})}function ee(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>ee(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 te(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 ne(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 Po(e){let{element:t,props:n,prevProps:r=Xt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!xe(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===H,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"){oe(c,t);continue}if(l==="use"){Ze(t,c);continue}if(l.startsWith("on:")){a.push(Ye(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(Ne(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(we(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Qe(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>ee(t,c()))):ee(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>te(t,c()))):te(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ne(t,c()))):ne(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&ze(t,p),c&&Yt(t,p,c);continue}let d=ge.has(l)||!s&&l in t;typeof c=="function"?a.push(d?Ne(t,l,c):we(t,l,c,s)):a.push(m(()=>d?Q(t,l,n[l]):T(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ze(t,c)}else ge.has(l)?Q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function et(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ze(e,o);continue}if(r.startsWith("on:")){Ye(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Ne(e,r.slice(5),o);continue}if(r.startsWith("attr:")){we(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Qe(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(re.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,Y.has(i)||Xe([i]);continue}if(r==="class"||r==="className"){ee(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>te(e,o())):te(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ne(e,o())):ne(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});L(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});L(()=>{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=U(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});L(()=>{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=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();me(e,r,s,n)});L(()=>{i()})}else m(()=>me(e,r,t[r],n))}}}function Lo(...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 ko(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 oe(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 Oo(e,t,n){let r=t||document.body,o=Kt(()=>e),i=[];return Ge(()=>{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),L(()=>{i.forEach(a=>a())})}),null}function Do(e){return typeof e=="string"&&e.toLowerCase()===e}function tt(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 _o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $o(e){return typeof e=="function"&&e.length===0&&x(e)}function nt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Bt(s=>{Ge(()=>{u.active||(t.textContent=""),He(t),Ve(),A(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Io(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 on="__fx_dom_create_component__",k=globalThis[on]??={fn:null};function jo(e){k.fn=e}function Fo(e={}){let t=e.signalSystem?.createComponent;t&&(k.fn=t)}function rt(e,t){return k.fn?k.fn(e,t):(()=>e(t))}var Ho=()=>k.fn!==null,Vo=()=>k.fn!==null;function Wo(){k.fn=null}var ie,it={getStore:()=>ie,run(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}},Se=it;function st(e){Se=e??it}function B(e={}){e.locals||(e.locals=e.request?Ae(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 K(e,t){return Se.run(e,t)}function C(){return Se.getStore()}function ve(){return C()?.event}function at(){let e=ve();return e?(e.locals||(e.locals={}),e.locals):{}}var ot=new WeakMap;function Ae(e){let t=ot.get(e);return t||(t={},ot.set(e,t)),t}import{setResourceIdSource as sn,setServerDataGetter as an}from"@fluixi/reactive/signal";var z="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ce;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ce!==void 0)return Ce;let t=null;if(typeof document<"u"){let n=document.getElementById(z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ce=t}function le(){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 ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ce=typeof process<"u"&&process.env&&!1;function ue(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 cn(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ln.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ce&&t&&ue(`<${e}>`,t),null)}function un(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`<${e}> (static)`,t),null)}function fn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}le();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ce&&t&&ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function dn(e){le();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var lt=!1;function pn(){lt||(lt=!0,Be({hydrateElement:cn,hydrateText:fn,hydrateMarker:dn,hydrateStatic:un}))}function Re(e,t,n){pn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;sn(()=>o?`${o}:r${i++}`:`r${i++}`),an(r?s=>s in r?{value:r[s]}:void 0:null);try{return nt(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function yn(e){let{component:t,props:n={},name:r}=e,o=Je(Me),i=r??t.name??"Island";T(o,"name",i),T(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);A(o,()=>s.withResourceScope(a,()=>t(n)))}else A(o,()=>t(n));return o}var ct=!1;function mn(){if(ct||typeof document>"u")return;ct=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function gn(e){if(typeof document>"u")return;mn();let t=document.querySelectorAll(Me),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{}Re(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function hn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function xn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as Tn}from"@fluixi/reactive/signal";function xi(e,t={}){if(typeof e=="function")return rt(e,t);if(typeof e!="string"||e.length===0)return null;let n=tt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return et(r,t,n),bn(r,t),r}function bn(e,t){if(!t||t.children===void 0)return;let n=Tn(()=>t.children),r=o=>{A(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as En,createMemo as Pe,disposeScope as wn,getOwner as Nn,runWithOwner as Sn,untrack as pt}from"@fluixi/reactive/signal";function ut(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ft(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 vn(e){let t=M(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0),o=Nn(),i=null,s=null,a=l=>{l!==s&&(i&&wn(i),i=En(o),s=l)};return Pe(()=>{let l=r();return a(l?"when":"fallback"),Sn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!dt(c)?typeof n=="function"?pt(()=>pt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as An,keyArray as Cn}from"@fluixi/reactive/signal";function Rn(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 W(a),a};return e.by?Cn(t,e.by,(o,i)=>r(o,i),{fallback:n}):An(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Mn}from"@fluixi/reactive/signal";function Pn(e){let t=M(()=>e.each);return Mn(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}import{mapArray as ys,keyArray as ms,indexArray as gs}from"@fluixi/reactive/signal";import{createMemo as Ln,createChildOwner as kn,disposeScope as On,getOwner as Dn,runWithOwner as yt}from"@fluixi/reactive/signal";var Le=Symbol("match");function _n(e){return{[Le]:!0,when:M(()=>e.when),get children(){return e.children}}}function $n(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Dn(),r=null,o=-1,i=s=>{s!==o&&(r&&On(r),r=kn(n),o=s)};return Ln(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Le]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Le]!==!0)continue;let f=l.when();if(ft(f))return i(s),yt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),yt(r,()=>e.fallback??null)})}import{createMemo as In,createChildOwner as qn,disposeScope as jn,getOwner as Fn,runWithOwner as Hn}from"@fluixi/reactive/signal";function Vn(e){let t=ut(e.component),{component:n,...r}=e,o=Fn(),i=null,s;return In(()=>{let a=t();return a!==s&&(i&&jn(i),i=qn(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Hn(i,()=>a(r))})}import{createRoot as Wn,onCleanup as Un}from"@fluixi/reactive/signal";function Bn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Wn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),A(r,e.children)&&oe(e.ref,r)}),Un(()=>{n(),r.remove()}),null}import{createMemo as Kn,createSignal as zn}from"@fluixi/reactive/signal";function mt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=zn(!t);return t&&queueMicrotask(()=>r(!0)),Kn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Gn=mt;import{createMemo as Xn,createSignal as Jn}from"@fluixi/reactive/signal";function Yn(e){let[t,n]=Jn(null),r=()=>n(null);return Xn(()=>{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 Zn}from"@fluixi/reactive/signal";function Qn(e){return Zn(()=>{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 er}from"@fluixi/reactive/signal";function tr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function nr(e){return er(()=>{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(`${tr(r)}: ${i}`)}return n.join("; ")})}var de=1,De=3,_e=8,gt;gt=V;var q=class{constructor(){this[gt]=!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(){}},O=class e extends q{constructor(n){super();this.nodeType=De;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)}},fe=class e extends q{constructor(n){super();this.nodeType=de;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},j=class e extends q{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ke=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Oe=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 q{constructor(n,r=!1){super();this.nodeType=de;this.attributes=new Map;this.style=new ke;this.classList=new Oe(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 O(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 rr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xt=/&/g,Tt=/</g,bt=/>/g,or=/"/g;function $e(e){return e.replace(xt,"&").replace(Tt,"<").replace(bt,">")}function ht(e){return e.replace(xt,"&").replace(or,""").replace(Tt,"<").replace(bt,">")}function ir(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function sr(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(`${ir(n)}: ${r}`)}return t.join("; ")}function ar(e){let t="",n=sr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${ht(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${ht(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case De:return $e(e.data??"");case _e:return`<!--${e.data??""}-->`;case de:{let t=e.localName,n=`<${t}${ar(e)}>`;if(rr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}import{createRoot as At}from"@fluixi/reactive/signal";import{setResourceTracker as ur,setResourceIdSource as fr,setResourceDataSink as dr,getOwner as pr,runWithOwner as Nt,flush as yr}from"@fluixi/reactive/signal";var lr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Et(e){return e.replace(/&(#?\w+);/g,(t,n)=>cr[n]??t)}var E=class extends Error{};function wt(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 E(`unterminated comment at ${c}`);i(new j(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new E(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new E(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new E(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new E(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new O(Et(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new E(`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 pe=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let F=e.slice(pe,y);if(F==="")throw new E(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new E(`attribute ${F} must have a double-quoted value`);let ye=e.indexOf('"',y+2);if(ye===-1)throw new E(`unterminated value for ${F}`);p.setAttribute(F,Et(e.slice(y+2,ye))),y=ye+1}else p.setAttribute(F,"")}return i(p),lr.has(d)||o.push(p),y}}var St=!1;function Ct(){St||(St=!0,We({createElement:(e,t)=>new D(e,t),createText:e=>new O(e),createRaw:e=>new fe(e),parseTemplate:(e,t)=>wt(e,t),createComment:e=>new j(e)}))}function Rt(e,t={}){let n=g;Ct(),_(!0);let r=B(t.event);try{return K(r,()=>At(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{_(n)}}var vt=!1;function mr(){vt||(vt=!0,ur(e=>{C()?.pending.add(e)}),fr(()=>C()?.nextResourceId()??""),dr((e,t)=>{e&&C()?.data.set(e,t)}))}var Ie=null;function Mt(e){Ie=e}function qe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ie)try{i=Ie(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=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${z}">${n}<\/script>`}var gr=50;async function Pt(e,t={}){let n=g;Ct(),_(!0),mr();let r=B(t.event);try{return await K(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};At(f=>{s=f,i=pr(),o=typeof e=="function"?e():e});let a=()=>{try{Nt(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<gr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await yr(),a()}let c=Nt(i,()=>N(o))+qe(r);return s(),c})}finally{_(n)}}export{mt as ClientOnly,Vn as Dynamic,Yn as ErrorBoundary,z as FX_DATA_ID,Rn as For,Pn as Index,yn as Island,ge as JSX_PROPERTIES,_n as Match,Gn as NoSsr,Bn as Portal,wr as SVG_ELEMENTS,H as SVG_NAMESPACE,vn as Show,$n as Switch,Er as VOID_ELEMENTS,vr as addClass,Yt as addDelegatedEventListener,Ye as addNativeEventListener,Dr as appendChildren,me as applyElementProp,et as applyProps,Ze as applyUse,io as asComponent,oo as asContext,no as asOutlet,ro as asProvider,to as asRoute,Qr as asRouter,eo as asRoutes,so as asSuspense,Io as bindPair,Wt as captureHydrationCursor,ao as checkRenderType,Qn as classMap,P as cleanChildren,Qt as cloneTemplate,Sr as closest,rt as createComponent,xi as createDynamicElement,kr as createElement,Je as createNativeElement,Oo as createPortal,B as createRequestContext,Zt as createTemplate,qr as delegate,Xe as delegateEvents,se as escapeFxJson,_o as escapeHTML,Ro as fnName,Eo as generateID,Mr as getAttribute,zr as getGlobal,Tr as getLitEventName,at as getLocals,Ir as getOffset,C as getRequestContext,ve as getRequestEvent,Ae as getRequestLocals,ae as getServerData,bo as getStableElementId,Lr as getStyle,oe as handleRef,Rr as hasClass,Co as holeContent,Ao as holeEnd,vo as holeScope,hn as html,Re as hydrate,W as hydrateAdvancePast,gn as hydrateIslands,gs as indexArray,Fo as initializeIntegration,A as insert,Z as insertExpression,Ho as intergartionInitialized,$o as isAccessor,w as isComponent,Ht as isContext,Lt as isCustomElement,Br as isDOMNode,wo as isDelegatedEvent,xe as isDomElement,I as isDomNode,Te as isDomText,xr as isEventHandler,No as isFunction,Vo as isIntegrationInitialized,Ur as isJSXTemplate,Dt as isLitTemplateResult,Do as isNativeElement,jt as isOutlet,J as isPromise,Ft as isProvider,Vr as isReactElement,qt as isRoute,$t as isRouter,It as isRoutes,tt as isSVGElement,g as isServer,Vt as isSuspense,Wr as isTemplateFactory,_r as isVisible,Mo as iterateFn,ms as keyArray,en as makeArrayFlat,ys as mapArray,Lo as mergeProps,Fr as observeIntersection,Hr as observeResize,je as query,Nr as queryAll,jo as registerCreateComponent,Kr as registerGlobal,Pr as removeAttribute,Or as removeChildren,Ar as removeClass,ze as removeDelegatedEventListener,nt as render,Rt as renderToString,Pt as renderToStringAsync,Wo as resetIntegration,X as runHydrationAt,K as runWithRequestContext,Ut as runWithoutHydration,$r as scrollIntoView,N as serializeNode,qe as serializeResourceData,T as setAttribute,te as setClassList,ee as setClassName,Mt as setDataRedactor,we as setDynamicAttribute,Qe as setDynamicBoolAttribute,Ne as setDynamicProperty,Q as setProperty,st as setRequestStore,_ as setServerMode,ne as setStyle,kt as setStyles,br as shouldSetAsProperty,ko as splitProps,Po as spread,nr as styleMap,xn as svg,So as templateNode,hr as toAttributeName,Cr as toggleClass,jr as waitForElement};
|
|
1
|
+
function hr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function xr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Tr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function br(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 Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=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"]),H="http://www.w3.org/2000/svg";function Lt(e){return e.localName.includes("-")}function me(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Lt(e)){e[t]=n;return}T(e,t,n,r)}var ge=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function je(e,t=document){return t.querySelector(e)}function Nr(e,t=document){return Array.from(t.querySelectorAll(e))}function Sr(e,t){return e.closest(t)}function vr(e,...t){e.classList.add(...t)}function Ar(e,...t){e.classList.remove(...t)}function Cr(e,...t){t.forEach(n=>e.classList.toggle(n))}function Rr(e,t){return e.classList.contains(t)}function T(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 Mr(e,t){return e.getAttribute(t)}function Pr(e,t){e.removeAttribute(t)}function kt(e,t){Object.assign(e.style,t)}function Lr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function kr(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")kt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else T(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Or(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Dr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function _r(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function $r(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Ir(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 jr(e,t=5e3){return new Promise((n,r)=>{let o=je(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=je(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 Fr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Hr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Ot=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Vr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ot}function Dt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Wr(e){if(typeof e!="function")return!1;try{let t=e();return Dt(t)}catch{return!1}}function Ur(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Br(e){return e instanceof Node}function Kr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function zr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";var Fe="1.0.0-alpha.78";import{VERSION as _t}from"@fluixi/reactive/version";var b={dom:Fe,reactive:_t};function He(e){b.core&&e.setAttribute("fluixi",b.core),e.setAttribute("fx-dom",b.dom),e.setAttribute("fx-reactive",b.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=b)}function Ve(){let e=[b.core,b.dom,b.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${b.core??"(absent)"}, dom ${b.dom}, reactive ${b.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 Qr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function eo(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function to(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function no(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function ro(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function oo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function io(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function so(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function w(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ao(e){return $t(e)?{type:"router",value:e}:qt(e)?{type:"route",value:e}:It(e)?{type:"routes",value:e}:jt(e)?{type:"outlet",value:e}:w(e)?{type:"component",value:e}:Vt(e)?{type:"suspense",value:e}:Ft(e)?{type:"provider",value:e}:Ht(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ge,createEffect as U,createRenderEffect as m,createRoot as Bt,onCleanup as L,readChildren as Kt}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var V=Symbol.for("fluixi.server-node"),he=null;function We(e){he=e}function $(){if(!he)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return he}function I(e){return e!=null&&e[V]===!0?!0:typeof Node<"u"&&e instanceof Node}function xe(e){return e!=null&&e[V]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Te(e){return e!=null&&e[V]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ue=null;function Be(e){Ue=e}function G(){return Ue}function be(e,t){return u.active&&t.parentNode===e}function Ee(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Wt(){return u.active?u.cursor:null}function X(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 Ut(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 W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ee(t)}function zt(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 Gt(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 bo(e){return Gt(zt(e))}var Eo=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Xt={};var Ke=new Map,Y=new Set,re=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Xe(e){if(!g)for(let t of e)Y.has(t)||re.has(t)||(Y.add(t),document.addEventListener(t,Jt))}function Jt(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 Yt(e,t,n){if(e[`$$${t}`]=n,re.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Y.has(t)||Xe([t])}function ze(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function wo(e){return!re.has(e)}function No(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Je(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Zt(e,t=!1){let n=Ke.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ke.set(e,r),r}function So(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=G()?.hydrateStatic(t);if(o)return o}return Qt(Zt(e,r),r).firstChild}function vo(e,t){if(!u.active)return t();let n=X(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?X(e.nextSibling,()=>r(...o)):r(...o))}return n}function Ao(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 Co(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Qt(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 Ro(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Mo(e){if(x(e)||w(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!w(t);)t=t();return t}var v=0,tn=200;function nn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(w(e)&&!x(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(w(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!w(a))break}v++;try{i=Z(t,a,n,i,s),o(i)}finally{v--}})}function A(e,t,n,r){if(v>tn)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)){v++;try{o=Z(e,t,n,o)}finally{v--}return()=>o}let a=nn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Z(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(J(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&Z(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 h(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&&Te(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):be(e,s)||h(e,s,n),s}if(I(t))return be(e,t)?(Ee(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=rn(e,a,s,n);for(let f of l){let d=A(e,f.sig,f.marker);L(()=>{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 Z(e,l,n,r)}}}return P(e,r,n)}function S(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"&&!J(l)&&!x(l)&&!w(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(w(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!J(c)&&!x(c)&&!w(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(x(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(J(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(S([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)){S(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)?S(f,t,n,r,!1,i):S([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 rn(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;)h(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;h(e,n[l++],t[a++].nextSibling),h(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 pe=t[a];for(;l<d;)h(e,n[l++],pe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(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 h(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 Ye(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 Ze(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 we(e,t,n,r=!1){return typeof n!="function"?(T(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;T(e,t,o,r)})}function Ne(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;Q(e,t,r)})}function Qe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):m(()=>{let r=n();T(e,t,!!r)})}function ee(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>ee(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 te(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 ne(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 Po(e){let{element:t,props:n,prevProps:r=Xt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!xe(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===H,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"){oe(c,t);continue}if(l==="use"){Ze(t,c);continue}if(l.startsWith("on:")){a.push(Ye(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(Ne(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(we(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Qe(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>ee(t,c()))):ee(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>te(t,c()))):te(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ne(t,c()))):ne(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&ze(t,p),c&&Yt(t,p,c);continue}let d=ge.has(l)||!s&&l in t;typeof c=="function"?a.push(d?Ne(t,l,c):we(t,l,c,s)):a.push(m(()=>d?Q(t,l,n[l]):T(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ze(t,c)}else ge.has(l)?Q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function et(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ze(e,o);continue}if(r.startsWith("on:")){Ye(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Ne(e,r.slice(5),o);continue}if(r.startsWith("attr:")){we(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Qe(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(re.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,Y.has(i)||Xe([i]);continue}if(r==="class"||r==="className"){ee(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>te(e,o())):te(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ne(e,o())):ne(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});L(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});L(()=>{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=U(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});L(()=>{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=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();me(e,r,s,n)});L(()=>{i()})}else m(()=>me(e,r,t[r],n))}}}function Lo(...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 ko(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 oe(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 Oo(e,t,n){let r=t||document.body,o=Kt(()=>e),i=[];return Ge(()=>{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),L(()=>{i.forEach(a=>a())})}),null}function Do(e){return typeof e=="string"&&e.toLowerCase()===e}function tt(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 _o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function $o(e){return typeof e=="function"&&e.length===0&&x(e)}function nt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Bt(s=>{Ge(()=>{u.active||(t.textContent=""),He(t),Ve(),A(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Io(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 on="__fx_dom_create_component__",k=globalThis[on]??={fn:null};function jo(e){k.fn=e}function Fo(e={}){let t=e.signalSystem?.createComponent;t&&(k.fn=t)}function rt(e,t){return k.fn?k.fn(e,t):(()=>e(t))}var Ho=()=>k.fn!==null,Vo=()=>k.fn!==null;function Wo(){k.fn=null}var ie,it={getStore:()=>ie,run(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}},Se=it;function st(e){Se=e??it}function B(e={}){e.locals||(e.locals=e.request?Ae(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 K(e,t){return Se.run(e,t)}function C(){return Se.getStore()}function ve(){return C()?.event}function at(){let e=ve();return e?(e.locals||(e.locals={}),e.locals):{}}var ot=new WeakMap;function Ae(e){let t=ot.get(e);return t||(t={},ot.set(e,t)),t}import{setResourceIdSource as sn,setServerDataGetter as an}from"@fluixi/reactive/signal";var z="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ce;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ce!==void 0)return Ce;let t=null;if(typeof document<"u"){let n=document.getElementById(z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ce=t}function le(){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 ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ce=typeof process<"u"&&process.env&&!1;function ue(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 cn(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ln.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ce&&t&&ue(`<${e}>`,t),null)}function un(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`<${e}> (static)`,t),null)}function fn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}le();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ce&&t&&ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function dn(e){le();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var lt=!1;function pn(){lt||(lt=!0,Be({hydrateElement:cn,hydrateText:fn,hydrateMarker:dn,hydrateStatic:un}))}function Re(e,t,n){pn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;sn(()=>o?`${o}:r${i++}`:`r${i++}`),an(r?s=>s in r?{value:r[s]}:void 0:null);try{return nt(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function yn(e){let{component:t,props:n={},name:r}=e,o=Je(Me),i=r??t.name??"Island";T(o,"name",i),T(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);A(o,()=>s.withResourceScope(a,()=>t(n)))}else A(o,()=>t(n));return o}var ct=!1;function mn(){if(ct||typeof document>"u")return;ct=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function gn(e){if(typeof document>"u")return;mn();let t=document.querySelectorAll(Me),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{}Re(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function hn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function xn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as Tn}from"@fluixi/reactive/signal";function xi(e,t={}){if(typeof e=="function")return rt(e,t);if(typeof e!="string"||e.length===0)return null;let n=tt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return et(r,t,n),bn(r,t),r}function bn(e,t){if(!t||t.children===void 0)return;let n=Tn(()=>t.children),r=o=>{A(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as En,createMemo as Pe,disposeScope as wn,getOwner as Nn,runWithOwner as Sn,untrack as pt}from"@fluixi/reactive/signal";function ut(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ft(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 vn(e){let t=M(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0),o=Nn(),i=null,s=null,a=l=>{l!==s&&(i&&wn(i),i=En(o),s=l)};return Pe(()=>{let l=r();return a(l?"when":"fallback"),Sn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!dt(c)?typeof n=="function"?pt(()=>pt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as An,keyArray as Cn}from"@fluixi/reactive/signal";function Rn(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 W(a),a};return e.by?Cn(t,e.by,(o,i)=>r(o,i),{fallback:n}):An(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Mn}from"@fluixi/reactive/signal";function Pn(e){let t=M(()=>e.each);return Mn(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}import{mapArray as ys,keyArray as ms,indexArray as gs}from"@fluixi/reactive/signal";import{createMemo as Ln,createChildOwner as kn,disposeScope as On,getOwner as Dn,runWithOwner as yt}from"@fluixi/reactive/signal";var Le=Symbol("match");function _n(e){return{[Le]:!0,when:M(()=>e.when),get children(){return e.children}}}function $n(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Dn(),r=null,o=-1,i=s=>{s!==o&&(r&&On(r),r=kn(n),o=s)};return Ln(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Le]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Le]!==!0)continue;let f=l.when();if(ft(f))return i(s),yt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),yt(r,()=>e.fallback??null)})}import{createMemo as In,createChildOwner as qn,disposeScope as jn,getOwner as Fn,runWithOwner as Hn}from"@fluixi/reactive/signal";function Vn(e){let t=ut(e.component),{component:n,...r}=e,o=Fn(),i=null,s;return In(()=>{let a=t();return a!==s&&(i&&jn(i),i=qn(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Hn(i,()=>a(r))})}import{createRoot as Wn,onCleanup as Un}from"@fluixi/reactive/signal";function Bn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Wn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),A(r,e.children)&&oe(e.ref,r)}),Un(()=>{n(),r.remove()}),null}import{createMemo as Kn,createSignal as zn}from"@fluixi/reactive/signal";function mt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=zn(!t);return t&&queueMicrotask(()=>r(!0)),Kn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Gn=mt;import{createMemo as Xn,createSignal as Jn}from"@fluixi/reactive/signal";function Yn(e){let[t,n]=Jn(null),r=()=>n(null);return Xn(()=>{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 Zn}from"@fluixi/reactive/signal";function Qn(e){return Zn(()=>{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 er}from"@fluixi/reactive/signal";function tr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function nr(e){return er(()=>{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(`${tr(r)}: ${i}`)}return n.join("; ")})}var de=1,De=3,_e=8,gt;gt=V;var q=class{constructor(){this[gt]=!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(){}},O=class e extends q{constructor(n){super();this.nodeType=De;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)}},fe=class e extends q{constructor(n){super();this.nodeType=de;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},j=class e extends q{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ke=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Oe=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 q{constructor(n,r=!1){super();this.nodeType=de;this.attributes=new Map;this.style=new ke;this.classList=new Oe(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 O(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 rr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xt=/&/g,Tt=/</g,bt=/>/g,or=/"/g;function $e(e){return e.replace(xt,"&").replace(Tt,"<").replace(bt,">")}function ht(e){return e.replace(xt,"&").replace(or,""").replace(Tt,"<").replace(bt,">")}function ir(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function sr(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(`${ir(n)}: ${r}`)}return t.join("; ")}function ar(e){let t="",n=sr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${ht(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${ht(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case De:return $e(e.data??"");case _e:return`<!--${e.data??""}-->`;case de:{let t=e.localName,n=`<${t}${ar(e)}>`;if(rr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}import{createRoot as At}from"@fluixi/reactive/signal";import{setResourceTracker as ur,setResourceIdSource as fr,setResourceDataSink as dr,getOwner as pr,runWithOwner as Nt,flush as yr}from"@fluixi/reactive/signal";var lr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Et(e){return e.replace(/&(#?\w+);/g,(t,n)=>cr[n]??t)}var E=class extends Error{};function wt(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 E(`unterminated comment at ${c}`);i(new j(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new E(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new E(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new E(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new E(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new O(Et(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new E(`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 pe=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let F=e.slice(pe,y);if(F==="")throw new E(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new E(`attribute ${F} must have a double-quoted value`);let ye=e.indexOf('"',y+2);if(ye===-1)throw new E(`unterminated value for ${F}`);p.setAttribute(F,Et(e.slice(y+2,ye))),y=ye+1}else p.setAttribute(F,"")}return i(p),lr.has(d)||o.push(p),y}}var St=!1;function Ct(){St||(St=!0,We({createElement:(e,t)=>new D(e,t),createText:e=>new O(e),createRaw:e=>new fe(e),parseTemplate:(e,t)=>wt(e,t),createComment:e=>new j(e)}))}function Rt(e,t={}){let n=g;Ct(),_(!0);let r=B(t.event);try{return K(r,()=>At(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{_(n)}}var vt=!1;function mr(){vt||(vt=!0,ur(e=>{C()?.pending.add(e)}),fr(()=>C()?.nextResourceId()??""),dr((e,t)=>{e&&C()?.data.set(e,t)}))}var Ie=null;function Mt(e){Ie=e}function qe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ie)try{i=Ie(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=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${z}">${n}<\/script>`}var gr=50;async function Pt(e,t={}){let n=g;Ct(),_(!0),mr();let r=B(t.event);try{return await K(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};At(f=>{s=f,i=pr(),o=typeof e=="function"?e():e});let a=()=>{try{Nt(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<gr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await yr(),a()}let c=Nt(i,()=>N(o))+qe(r);return s(),c})}finally{_(n)}}export{mt as ClientOnly,Vn as Dynamic,Yn as ErrorBoundary,z as FX_DATA_ID,Rn as For,Pn as Index,yn as Island,ge as JSX_PROPERTIES,_n as Match,Gn as NoSsr,Bn as Portal,wr as SVG_ELEMENTS,H as SVG_NAMESPACE,vn as Show,$n as Switch,Er as VOID_ELEMENTS,vr as addClass,Yt as addDelegatedEventListener,Ye as addNativeEventListener,Dr as appendChildren,me as applyElementProp,et as applyProps,Ze as applyUse,io as asComponent,oo as asContext,no as asOutlet,ro as asProvider,to as asRoute,Qr as asRouter,eo as asRoutes,so as asSuspense,Io as bindPair,Wt as captureHydrationCursor,ao as checkRenderType,Qn as classMap,P as cleanChildren,Qt as cloneTemplate,Sr as closest,rt as createComponent,xi as createDynamicElement,kr as createElement,Je as createNativeElement,Oo as createPortal,B as createRequestContext,Zt as createTemplate,qr as delegate,Xe as delegateEvents,se as escapeFxJson,_o as escapeHTML,Ro as fnName,Eo as generateID,Mr as getAttribute,zr as getGlobal,Tr as getLitEventName,at as getLocals,Ir as getOffset,C as getRequestContext,ve as getRequestEvent,Ae as getRequestLocals,ae as getServerData,bo as getStableElementId,Lr as getStyle,oe as handleRef,Rr as hasClass,Co as holeContent,Ao as holeEnd,vo as holeScope,hn as html,Re as hydrate,W as hydrateAdvancePast,gn as hydrateIslands,gs as indexArray,Fo as initializeIntegration,A as insert,Z as insertExpression,Ho as intergartionInitialized,$o as isAccessor,w as isComponent,Ht as isContext,Lt as isCustomElement,Br as isDOMNode,wo as isDelegatedEvent,xe as isDomElement,I as isDomNode,Te as isDomText,xr as isEventHandler,No as isFunction,Vo as isIntegrationInitialized,Ur as isJSXTemplate,Dt as isLitTemplateResult,Do as isNativeElement,jt as isOutlet,J as isPromise,Ft as isProvider,Vr as isReactElement,qt as isRoute,$t as isRouter,It as isRoutes,tt as isSVGElement,g as isServer,Vt as isSuspense,Wr as isTemplateFactory,_r as isVisible,Mo as iterateFn,ms as keyArray,en as makeArrayFlat,ys as mapArray,Lo as mergeProps,Fr as observeIntersection,Hr as observeResize,je as query,Nr as queryAll,jo as registerCreateComponent,Kr as registerGlobal,Pr as removeAttribute,Or as removeChildren,Ar as removeClass,ze as removeDelegatedEventListener,nt as render,Rt as renderToString,Pt as renderToStringAsync,Wo as resetIntegration,X as runHydrationAt,K as runWithRequestContext,Ut as runWithoutHydration,$r as scrollIntoView,N as serializeNode,qe as serializeResourceData,T as setAttribute,te as setClassList,ee as setClassName,Mt as setDataRedactor,we as setDynamicAttribute,Qe as setDynamicBoolAttribute,Ne as setDynamicProperty,Q as setProperty,st as setRequestStore,_ as setServerMode,ne as setStyle,kt as setStyles,br as shouldSetAsProperty,ko as splitProps,Po as spread,nr as styleMap,xn as svg,So as templateNode,hr as toAttributeName,Cr as toggleClass,jr as waitForElement};
|