@fluixi/dom 1.0.0-alpha.68 → 1.0.0-alpha.70

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.
Files changed (70) hide show
  1. package/dist/cdn/dom.cjs +1 -1
  2. package/dist/cdn/dom.global.js +1 -1
  3. package/dist/cdn/dom.mjs +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.ts +6 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/lib/dom/dynamic-element.cjs +1 -1
  10. package/dist/lib/dom/dynamic-element.mjs +1 -1
  11. package/dist/lib/dom/hydration-state.cjs +1 -1
  12. package/dist/lib/dom/hydration-state.d.ts +2 -0
  13. package/dist/lib/dom/hydration-state.d.ts.map +1 -1
  14. package/dist/lib/dom/hydration-state.mjs +1 -1
  15. package/dist/lib/dom/hydration.cjs +1 -1
  16. package/dist/lib/dom/hydration.d.ts.map +1 -1
  17. package/dist/lib/dom/hydration.js +20 -1
  18. package/dist/lib/dom/hydration.mjs +1 -1
  19. package/dist/lib/dom/index.cjs +1 -1
  20. package/dist/lib/dom/index.mjs +1 -1
  21. package/dist/lib/dom/island.cjs +1 -1
  22. package/dist/lib/dom/island.mjs +1 -1
  23. package/dist/lib/dom/runtime.cjs +1 -1
  24. package/dist/lib/dom/runtime.d.ts +48 -0
  25. package/dist/lib/dom/runtime.d.ts.map +1 -1
  26. package/dist/lib/dom/runtime.js +95 -1
  27. package/dist/lib/dom/runtime.mjs +1 -1
  28. package/dist/lib/dom/server/host.cjs +1 -1
  29. package/dist/lib/dom/server/host.d.ts +4 -0
  30. package/dist/lib/dom/server/host.d.ts.map +1 -1
  31. package/dist/lib/dom/server/host.mjs +1 -1
  32. package/dist/lib/dom/server/index.cjs +1 -1
  33. package/dist/lib/dom/server/index.mjs +1 -1
  34. package/dist/lib/dom/server/nodes.cjs +1 -1
  35. package/dist/lib/dom/server/nodes.d.ts +15 -0
  36. package/dist/lib/dom/server/nodes.d.ts.map +1 -1
  37. package/dist/lib/dom/server/nodes.js +23 -0
  38. package/dist/lib/dom/server/nodes.mjs +1 -1
  39. package/dist/lib/dom/server/parse-template.cjs +1 -0
  40. package/dist/lib/dom/server/parse-template.d.ts +26 -0
  41. package/dist/lib/dom/server/parse-template.d.ts.map +1 -0
  42. package/dist/lib/dom/server/parse-template.js +154 -0
  43. package/dist/lib/dom/server/parse-template.mjs +1 -0
  44. package/dist/lib/dom/server/render.cjs +1 -1
  45. package/dist/lib/dom/server/render.d.ts.map +1 -1
  46. package/dist/lib/dom/server/render.js +4 -1
  47. package/dist/lib/dom/server/render.mjs +1 -1
  48. package/dist/lib/dom/server/serialize.cjs +1 -1
  49. package/dist/lib/dom/server/serialize.d.ts.map +1 -1
  50. package/dist/lib/dom/server/serialize.js +11 -1
  51. package/dist/lib/dom/server/serialize.mjs +1 -1
  52. package/dist/lib/dom/server-renderer.cjs +1 -1
  53. package/dist/lib/dom/server-renderer.mjs +1 -1
  54. package/dist/lib/flow/client-only.cjs +1 -1
  55. package/dist/lib/flow/client-only.mjs +1 -1
  56. package/dist/lib/flow/index-flow.cjs +1 -1
  57. package/dist/lib/flow/index-flow.mjs +1 -1
  58. package/dist/lib/flow/index.cjs +1 -1
  59. package/dist/lib/flow/index.mjs +1 -1
  60. package/dist/lib/flow/portal.cjs +1 -1
  61. package/dist/lib/flow/portal.mjs +1 -1
  62. package/dist/lib/index.cjs +1 -1
  63. package/dist/lib/index.mjs +1 -1
  64. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  65. package/dist/version.generated.cjs +1 -0
  66. package/dist/version.generated.d.ts +3 -0
  67. package/dist/version.generated.d.ts.map +1 -0
  68. package/dist/version.generated.js +3 -0
  69. package/dist/version.generated.mjs +1 -0
  70. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function gr(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"]),Nr=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"]),_="http://www.w3.org/2000/svg";function _t(e){return e.localName.includes("-")}function de(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(_t(e)){e[t]=n;return}h(e,t,n,r)}var pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Fe(e,t=document){return t.querySelector(e)}function Sr(e,t=document){return Array.from(t.querySelectorAll(e))}function vr(e,t){return e.closest(t)}function He(e,...t){e.classList.add(...t)}function Ve(e,...t){e.classList.remove(...t)}function We(e,...t){t.forEach(n=>e.classList.toggle(n))}function wr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ue(e,t){return e.getAttribute(t)}function Be(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function Ar(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Ke(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")ye(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else h(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ge(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Cr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Rr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Mr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Pr(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Lr(e,t=5e3){return new Promise((n,r)=>{let o=Fe(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Fe(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Or(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Dr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var It=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function kr(e){return typeof e=="object"&&e!==null&&e.$$typeof===It}function $t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function _r(e){if(typeof e!="function")return!1;try{let t=e();return $t(t)}catch{return!1}}function Ir(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function $r(e){return e instanceof Node}function qr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jr(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";function Hr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Vr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Wr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Ur(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Br(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Kr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function zr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Gr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Xr(e){return qt(e)?{type:"router",value:e}:Ft(e)?{type:"route",value:e}:jt(e)?{type:"routes",value:e}:Ht(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:Ut(e)?{type:"suspense",value:e}:Vt(e)?{type:"provider",value:e}:Wt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Qe,createEffect as j,createRenderEffect as p,createRoot as Gt,onCleanup as R,readChildren as Xt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var I=Symbol.for("fluixi.server-node"),me=null;function Xe(e){me=e}function $(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function L(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function he(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ge(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Je=null;function Ye(e){Je=e}function xe(){return Je}function Te(e,t){return u.active&&t.parentNode===e}function be(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Bt(){return u.active?u.cursor:null}function Kt(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 zt(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 q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&be(t)}function Jt(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 Yt(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 so(e){return Yt(Jt(e))}var ao=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Zt={};var Ze=new Map,X=new Set,ee=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!m)for(let t of e)X.has(t)||ee.has(t)||(X.add(t),document.addEventListener(t,Qt))}function Qt(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 Ee(e,t,n){if(e[`$$${t}`]=n,ee.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}X.has(t)||te([t])}function J(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function lo(e){return!ee.has(e)}function co(e){return typeof e=="function"}function w(e,t=!1){if(m)return $().createText(e);if(u.active&&!t){let n=xe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ne(e,t=!1){if(m)return $().createElement(e,t);if(u.active){let n=xe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function et(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function tt(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 uo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function fo(e){if(x(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!b(t);)t=t();return t}var S=0,tn=200;function nn(e,t,n,r,o){let s=r,i=new Map;return p(()=>{let a;if(b(e)&&!x(e)){if(!i.has(e)){S++;try{let l=e();i.set(e,l)}finally{S--}}for(a=i.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(b(a)){if(!i.has(a)){let c=a;S++;try{let f=c();i.set(c,f)}finally{S--}}a=i.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!b(a))break}S++;try{s=Y(t,a,n,s,i),o(s)}finally{S--}})}function T(e,t,n,r){if(S>tn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){S++;try{o=Y(e,t,n,null)}finally{S--}return()=>o}let a=nn(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Y(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(G(t)){let i=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),C(e,r.slice(1),n)):g(e,i,n):r?e.replaceChild(i,r):g(e,i,n),t.then(a=>{i.parentNode===e&&Y(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return g(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&ge(r))return r.data=t,r;let i=w(t);return r&&r.parentNode===e?e.replaceChild(i,r):Te(e,i)||g(e,i,n),i}if(L(t))return Te(e,t)?(be(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):g(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,i,e,n,!0,o,l);let c=rn(e,a,i,n);for(let f of l){let d=T(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return Y(e,l,n,r)}}}return C(e,r,n)}function N(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!G(l)&&!x(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!x(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!G(c)&&!x(c)&&!b(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(i){let d=w("",!0);t.push(d),i.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)?N(f,t,n,r,o,s):N([f],t,n,r,o,s);continue}continue}Array.isArray(c)?N(c,t,n,r,o,s,i):N([c],t,n,r,o,s,i);continue}if(G(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,s),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(l,t,n,r,o,s,i);continue}if(L(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)?N(f,t,n,r,!1,s):N([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function rn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let d=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)g(e,n[l++],d)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let d=t[--s].nextSibling;g(e,n[l++],t[a++].nextSibling),g(e,n[--i],d),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<i){let y=a,fe=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==d+fe);)fe++;if(fe>d-l){let kt=t[a];for(;l<d;)g(e,n[l++],kt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(g(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(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 g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function O(e,t,n){n==null?delete e[t]:e[t]=n}function nt(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 rt(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 F(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function H(e,t,n){return typeof n!="function"?(O(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;O(e,t,r)})}function ot(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):p(()=>{let r=n();h(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>D(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 Z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function Q(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 it(e){let{element:t,props:n,prevProps:r=Zt,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!he(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===_,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){k(c,t);continue}if(l==="use"){rt(t,c);continue}if(l.startsWith("on:")){a.push(nt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(H(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(F(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(ot(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>Z(t,c()))):Z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Q(t,c()))):Q(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&J(t,y),c&&Ee(t,y,c);continue}let d=pe.has(l)||!i&&l in t;typeof c=="function"?a.push(d?H(t,l,c):F(t,l,c,i)):a.push(p(()=>d?O(t,l,n[l]):h(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();J(t,c)}else pe.has(l)?O(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function re(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){k(o,e);continue}if(r!=="children"){if(r==="use"){rt(e,o);continue}if(r.startsWith("on:")){nt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){H(e,r.slice(5),o);continue}if(r.startsWith("attr:")){F(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ot(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(ee.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,X.has(s)||te([s]);continue}if(r==="class"||r==="className"){D(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>Z(e,o())):Z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Q(e,o())):Q(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});R(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=j(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{i()})}else{let s=!0;p(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();de(e,r,i,n)});R(()=>{s()})}else p(()=>de(e,r,t[r],n))}}}function st(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[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 s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function po(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);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})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function k(e,t){if(e){if(L(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 at(e,t,n){let r=t||document.body,o=Xt(()=>e),s=[];return Qe(()=>{let i=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),R(()=>{s.forEach(a=>a())})}),null}function yo(e){return typeof e=="string"&&e.toLowerCase()===e}function lt(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 mo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function G(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ho(e){return typeof e=="function"&&e.length===0&&x(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return Gt(i=>{Qe(()=>{u.active||(t.textContent=""),T(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var on="__fx_dom_create_component__",M=globalThis[on]??={fn:null};function xo(e){M.fn=e}function To(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ie(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var bo=()=>M.fn!==null,ct=()=>M.fn!==null;function ut(){M.fn=null}var se,dt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},Ne=dt;function pt(e){Ne=e??dt}function V(e={}){e.locals||(e.locals=e.request?ve(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function W(e,t){return Ne.run(e,t)}function v(){return Ne.getStore()}function Se(){return v()?.event}function yt(){let e=Se();return e?(e.locals||(e.locals={}),e.locals):{}}var ft=new WeakMap;function ve(e){let t=ft.get(e);return t||(t={},ft.set(e,t)),t}import{setResourceIdSource as sn,setServerDataGetter as an}from"@fluixi/reactive/signal";var U="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var we;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(we!==void 0)return we;let t=null;if(typeof document<"u"){let n=document.getElementById(U)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return we=t}function Ae(){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 Re(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){Ae();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&&Re(`<${e}>`,t),null)}function un(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ae();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ce&&t&&Re(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function fn(e){Ae();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ce&&t&&Re(`marker <!--${e.slice(0,24)}-->`,t),null)}var mt=!1;function dn(){mt||(mt=!0,Ye({hydrateElement:cn,hydrateText:un,hydrateMarker:fn}))}function B(e,t,n){dn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,s=0;sn(()=>o?`${o}:r${s++}`:`r${s++}`),an(r?i=>i in r?{value:r[i]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function pn(e){let{component:t,props:n={},name:r}=e,o=ne(Me),s=r??t.name??"Island";h(o,"name",s),h(o,"props",JSON.stringify(n??{}));let i=m?v():void 0;if(i){let a=i.nextIslandNamespace(s);T(o,()=>i.withResourceScope(a,()=>t(n)))}else T(o,()=>t(n));return o}var ht=!1;function yn(){if(ht||typeof document>"u")return;ht=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function mn(e){if(typeof document>"u")return;yn();let t=document.querySelectorAll(Me),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){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{}B(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function hn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function gn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as xn}from"@fluixi/reactive/signal";function Xo(e,t={}){if(typeof e=="function")return ie(e,t);if(typeof e!="string"||e.length===0)return null;let n=lt(e);if(m)return $().createElement(e,n);let r=n?document.createElementNS(_,e):document.createElement(e);return re(r,t,n),Tn(r,t),r}function Tn(e,t){if(!t||t.children===void 0)return;let n=xn(()=>t.children),r=o=>{T(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as bn,createMemo as Pe,disposeScope as En,getOwner as Nn,runWithOwner as Sn,untrack as bt}from"@fluixi/reactive/signal";function gt(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function xt(e){return e!=null&&e!==!1}function Tt(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=A(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0),o=Nn(),s=null,i=null,a=l=>{l!==i&&(s&&En(s),s=bn(o),i=l)};return Pe(()=>{let l=r();return a(l?"when":"fallback"),Sn(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Tt(c)?typeof n=="function"?bt(()=>bt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as wn,keyArray as An}from"@fluixi/reactive/signal";function Cn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return q(a),a};return e.by?An(t,e.by,(o,s)=>r(o,s),{fallback:n}):wn(t,(o,s)=>r(o,s),{fallback:n})}import{indexArray as Rn}from"@fluixi/reactive/signal";function Mn(e){let t=A(()=>e.each);return Rn(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Bi,keyArray as Ki,indexArray as zi}from"@fluixi/reactive/signal";import{createMemo as Pn,createChildOwner as Ln,disposeScope as On,getOwner as Dn,runWithOwner as Et}from"@fluixi/reactive/signal";var Le=Symbol("match");function kn(e){return{[Le]:!0,when:A(()=>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,s=i=>{i!==o&&(r&&On(r),r=Ln(n),o=i)};return Pn(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],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(xt(f))return s(i),Et(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),Et(r,()=>e.fallback??null)})}import{createMemo as In,createChildOwner as $n,disposeScope as qn,getOwner as jn,runWithOwner as Fn}from"@fluixi/reactive/signal";function Hn(e){let t=gt(e.component),{component:n,...r}=e,o=jn(),s=null,i;return In(()=>{let a=t();return a!==i&&(s&&qn(s),s=$n(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Fn(s,()=>a(r))})}import{createRoot as Vn,onCleanup as Wn}from"@fluixi/reactive/signal";function Un(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Vn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),T(r,e.children)&&k(e.ref,r)}),Wn(()=>{n(),r.remove()}),null}import{createMemo as Bn,createSignal as Kn}from"@fluixi/reactive/signal";function Nt(e){if(m)return e.fallback??null;let t=u.active,[n,r]=Kn(!t);return t&&queueMicrotask(()=>r(!0)),Bn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var zn=Nt;import{createMemo as Gn,createSignal as Xn}from"@fluixi/reactive/signal";function Jn(e){let[t,n]=Xn(null),r=()=>n(null);return Gn(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}import{createMemo as Yn}from"@fluixi/reactive/signal";function Zn(e){return Yn(()=>{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 Qn}from"@fluixi/reactive/signal";function er(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function tr(e){return Qn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${er(r)}: ${s}`)}return n.join("; ")})}var ke=1,_e=3,Ie=8,St;St=I;var K=class{constructor(){this[St]=!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(){}},z=class e extends K{constructor(n){super();this.nodeType=_e;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)}},ce=class e extends K{constructor(n){super();this.nodeType=Ie;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Oe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},De=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}},ue=class e extends K{constructor(n,r=!1){super();this.nodeType=ke;this.attributes=new Map;this.style=new Oe;this.classList=new De(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 z(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 nr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wt=/&/g,rr=/</g,or=/>/g,ir=/"/g;function $e(e){return e.replace(wt,"&amp;").replace(rr,"&lt;").replace(or,"&gt;")}function vt(e){return e.replace(wt,"&amp;").replace(ir,"&quot;")}function sr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ar(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${sr(n)}: ${r}`)}return t.join("; ")}function lr(e){let t="",n=ar(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${vt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${vt(o)}"`}return t}function E(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 E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case _e:return $e(e.data??"");case Ie:return`<!--${e.data??""}-->`;case ke:{let t=e.localName,n=`<${t}${lr(e)}>`;if(nr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(E).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(E).join(""):""}import{createRoot as Mt}from"@fluixi/reactive/signal";import{setResourceTracker as cr,setResourceIdSource as ur,setResourceDataSink as fr,getOwner as dr,runWithOwner as At,flush as pr}from"@fluixi/reactive/signal";var Ct=!1;function Pt(){Ct||(Ct=!0,Xe({createElement:(e,t)=>new ue(e,t),createText:e=>new z(e),createComment:e=>new ce(e)}))}function Lt(e,t={}){let n=m;Pt(),P(!0);let r=V(t.event);try{return W(r,()=>Mt(o=>{try{let s=typeof e=="function"?e():e;return E(s)}finally{o()}}))}finally{P(n)}}var Rt=!1;function yr(){Rt||(Rt=!0,cr(e=>{v()?.pending.add(e)}),ur(()=>v()?.nextResourceId()??""),fr((e,t)=>{e&&v()?.data.set(e,t)}))}var qe=null;function Ot(e){qe=e}function je(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(qe)try{s=qe(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return`<script type="application/json" id="${U}">${n}<\/script>`}var mr=50;async function Dt(e,t={}){let n=m;Pt(),P(!0),yr();let r=V(t.event);try{return await W(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};Mt(f=>{i=f,s=dr(),o=typeof e=="function"?e():e});let a=()=>{try{At(s,()=>E(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<mr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await pr(),a()}let c=At(s,()=>E(o))+je(r);return i(),c})}finally{P(n)}}var hr={createComponent:ie,createElement:Ke,createNativeElement:ne,createTemplate:et,cloneTemplate:tt,createPortal:at,render:oe,hydrate:B,insert:T,appendChildren:Ge,removeChildren:ze,spread:it,applyProps:re,mergeProps:st,setProperty:O,setDynamicProperty:H,setAttribute:h,setDynamicAttribute:F,removeAttribute:Be,getAttribute:Ue,setClassName:D,addClass:He,removeClass:Ve,toggleClass:We,setStyles:ye,delegateEvents:te,addDelegatedEventListener:Ee,removeDelegatedEventListener:J,handleRef:k,resetIntegration:ut,isIntegrationInitialized:ct},Ms=hr;export{Nt as ClientOnly,Hn as Dynamic,Jn as ErrorBoundary,U as FX_DATA_ID,Cn as For,Mn as Index,pn as Island,pe as JSX_PROPERTIES,kn as Match,zn as NoSsr,Un as Portal,Nr as SVG_ELEMENTS,_ as SVG_NAMESPACE,vn as Show,_n as Switch,Er as VOID_ELEMENTS,He as addClass,Ee as addDelegatedEventListener,nt as addNativeEventListener,Ge as appendChildren,de as applyElementProp,re as applyProps,rt as applyUse,zr as asComponent,Kr as asContext,Ur as asOutlet,Br as asProvider,Wr as asRoute,Hr as asRouter,Vr as asRoutes,Gr as asSuspense,Bt as captureHydrationCursor,Xr as checkRenderType,Zn as classMap,C as cleanChildren,tt as cloneTemplate,vr as closest,ie as createComponent,Xo as createDynamicElement,Ke as createElement,ne as createNativeElement,at as createPortal,V as createRequestContext,et as createTemplate,Ms as default,Pr as delegate,te as delegateEvents,ae as escapeFxJson,mo as escapeHTML,uo as fnName,ao as generateID,Ue as getAttribute,jr as getGlobal,Tr as getLitEventName,yt as getLocals,Mr as getOffset,v as getRequestContext,Se as getRequestEvent,ve as getRequestLocals,le as getServerData,so as getStableElementId,Ar as getStyle,k as handleRef,wr as hasClass,hn as html,B as hydrate,q as hydrateAdvancePast,mn as hydrateIslands,zi as indexArray,To as initializeIntegration,T as insert,Y as insertExpression,bo as intergartionInitialized,ho as isAccessor,b as isComponent,Wt as isContext,_t as isCustomElement,$r as isDOMNode,lo as isDelegatedEvent,he as isDomElement,L as isDomNode,ge as isDomText,xr as isEventHandler,co as isFunction,ct as isIntegrationInitialized,Ir as isJSXTemplate,$t as isLitTemplateResult,yo as isNativeElement,Ht as isOutlet,G as isPromise,Vt as isProvider,kr as isReactElement,Ft as isRoute,qt as isRouter,jt as isRoutes,lt as isSVGElement,m as isServer,Ut as isSuspense,_r as isTemplateFactory,Cr as isVisible,fo as iterateFn,Ki as keyArray,en as makeArrayFlat,Bi as mapArray,st as mergeProps,Or as observeIntersection,Dr as observeResize,Fe as query,Sr as queryAll,xo as registerCreateComponent,qr as registerGlobal,Be as removeAttribute,ze as removeChildren,Ve as removeClass,J as removeDelegatedEventListener,oe as render,Lt as renderToString,Dt as renderToStringAsync,ut as resetIntegration,Kt as runHydrationAt,W as runWithRequestContext,zt as runWithoutHydration,Rr as scrollIntoView,E as serializeNode,je as serializeResourceData,h as setAttribute,Z as setClassList,D as setClassName,Ot as setDataRedactor,F as setDynamicAttribute,ot as setDynamicBoolAttribute,H as setDynamicProperty,O as setProperty,pt as setRequestStore,P as setServerMode,Q as setStyle,ye as setStyles,br as shouldSetAsProperty,po as splitProps,it as spread,tr as styleMap,gn as svg,gr as toAttributeName,We as toggleClass,Lr as waitForElement};
1
+ function Lr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Or(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function kr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Dr(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 _r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$r=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),W="http://www.w3.org/2000/svg";function Gt(e){return e.localName.includes("-")}function we(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Gt(e)){e[t]=n;return}h(e,t,n,r)}var Se=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ge(e,t=document){return t.querySelector(e)}function Ir(e,t=document){return Array.from(t.querySelectorAll(e))}function qr(e,t){return e.closest(t)}function Xe(e,...t){e.classList.add(...t)}function Je(e,...t){e.classList.remove(...t)}function Ye(e,...t){t.forEach(n=>e.classList.toggle(n))}function jr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ze(e,t){return e.getAttribute(t)}function Qe(e,t){e.removeAttribute(t)}function ve(e,t){Object.assign(e.style,t)}function Hr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function et(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")ve(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else h(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Fr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Vr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Wr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Ur(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Br(e,t=5e3){return new Promise((n,r)=>{let o=Ge(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Ge(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Kr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function zr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Gr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xt}function Jt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Xr(e){if(typeof e!="function")return!1;try{let t=e();return Jt(t)}catch{return!1}}function Jr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Yr(e){return e instanceof Node}function Zr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Qr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as T}from"@fluixi/reactive/signal";function to(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function no(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function ro(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function oo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function io(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function so(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ao(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function lo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Zt(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 en(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function tn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function nn(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 rn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function co(e){return Yt(e)?{type:"router",value:e}:Qt(e)?{type:"route",value:e}:Zt(e)?{type:"routes",value:e}:en(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:rn(e)?{type:"suspense",value:e}:tn(e)?{type:"provider",value:e}:nn(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as at,createEffect as K,createRenderEffect as m,createRoot as an,onCleanup as P,readChildren as ln}from"@fluixi/reactive/signal";var g=typeof document>"u";function D(e){g=e}var U=Symbol.for("fluixi.server-node"),Ae=null;function rt(e){Ae=e}function _(){if(!Ae)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ae}function $(e){return e!=null&&e[U]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ce(e){return e!=null&&e[U]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Re(e){return e!=null&&e[U]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ot=null;function it(e){ot=e}function Q(){return ot}function Me(e,t){return u.active&&t.parentNode===e}function Pe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function on(){return u.active?u.cursor:null}function ee(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 sn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function B(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Pe(t)}function cn(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 un(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 Eo(e){return un(cn(e))}var No=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),fn={};var st=new Map,ne=new Set,ae=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!g)for(let t of e)ne.has(t)||ae.has(t)||(ne.add(t),document.addEventListener(t,dn))}function dn(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 Le(e,t,n){if(e[`$$${t}`]=n,ae.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}ne.has(t)||le([t])}function re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function wo(e){return!ae.has(e)}function So(e){return typeof e=="function"}function C(e,t=!1){if(g)return _().createText(e);if(u.active&&!t){let n=Q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(g)return _().createElement(e,t);if(u.active){let n=Q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(W,e):document.createElement(e)}function Oe(e,t=!1){let n=st.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,st.set(e,r),r}function lt(e,t,n=!1,r=!1){if(g){let o=_();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=Q()?.hydrateStatic(t);if(o)return o}return ke(Oe(e,r),r).firstChild}function ct(e,t){if(!u.active)return t();let n=ee(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?ee(e.nextSibling,()=>r(...o)):r(...o))}return n}function ut(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 ft(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function ke(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function pn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?pn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function vo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ao(e){if(T(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!T(t)&&!N(t);)t=t();return t}var v=0,yn=200;function mn(e,t,n,r,o){let s=r,i=new Map;return m(()=>{let a;if(N(e)&&!T(e)){if(!i.has(e)){v++;try{let l=e();i.set(e,l)}finally{v--}}for(a=i.get(e);typeof a=="function"&&T(a);)a=a()}else for(a=e();typeof a=="function"&&T(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!i.has(a)){let c=a;v++;try{let f=c();i.set(c,f)}finally{v--}}a=i.get(a)}else if(T(a))a=a();else if(a=a(),typeof a!="function"||!T(a)&&!N(a))break}v++;try{s=oe(t,a,n,s,i),o(s)}finally{v--}})}function b(e,t,n,r){if(v>yn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=C("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){v++;try{o=oe(e,t,n,null)}finally{v--}return()=>o}let a=mn(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function oe(e,t,n,r,o){if(t==null||typeof t=="boolean")return M(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return M(e,r,n);if(te(t)){let i=C("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),M(e,r.slice(1),n)):x(e,i,n):r?e.replaceChild(i,r):x(e,i,n),t.then(a=>{i.parentNode===e&&oe(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=C(t);return x(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=M(e,r,n)}if(r&&Re(r))return r.data=t,r;let i=C(t);return r&&r.parentNode===e?e.replaceChild(i,r):Me(e,i)||x(e,i,n),i}if($(t))return Me(e,t)?(Pe(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),M(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,i,e,n,!0,o,l);let c=gn(e,a,i,n);for(let f of l){let d=b(e,f.sig,f.marker);P(()=>{M(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return oe(e,l,n,r)}}}return M(e,r,n)}function S(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!te(l)&&!T(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)&&!T(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!te(c)&&!T(c)&&!N(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(T(c)){if(i){let d=C("",!0);t.push(d),i.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&T(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,s):S([f],t,n,r,o,s);continue}continue}Array.isArray(c)?S(c,t,n,r,o,s,i):S([c],t,n,r,o,s,i);continue}if(te(l)){let c=C("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(S([f],d,c.parentNode,void 0,!1,s),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,s,i);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)?S(f,t,n,r,!1,s):S([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(C(c));continue}t.push(C(String(l)))}}}}function gn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let d=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)x(e,n[l++],d)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let d=t[--s].nextSibling;x(e,n[l++],t[a++].nextSibling),x(e,n[--i],d),t[s]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<i;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<i){let p=a,y=1;for(;++p<s&&p<i&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let Ee=t[a];for(;l<d;)x(e,n[l++],Ee)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(x(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function M(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 x(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function I(e,t,n){n==null?delete e[t]:e[t]=n}function dt(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 pt(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 z(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function G(e,t,n){return typeof n!="function"?(I(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;I(e,t,r)})}function yt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{let r=n();h(e,t,!!r)})}function q(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>q(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ie(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function se(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 mt(e){let{element:t,props:n,prevProps:r=fn,isSVG:o=!1,skipChildren:s=!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 i=o||t.namespaceURI===W,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){j(c,t);continue}if(l==="use"){pt(t,c);continue}if(l.startsWith("on:")){a.push(dt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(G(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(z(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(yt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>q(t,c()))):q(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>ie(t,c()))):ie(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>se(t,c()))):se(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&re(t,p),c&&Le(t,p,c);continue}let d=Se.has(l)||!i&&l in t;typeof c=="function"?a.push(d?G(t,l,c):z(t,l,c,i)):a.push(m(()=>d?I(t,l,n[l]):h(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();re(t,c)}else Se.has(l)?I(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"){j(o,e);continue}if(r!=="children"){if(r==="use"){pt(e,o);continue}if(r.startsWith("on:")){dt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){G(e,r.slice(5),o);continue}if(r.startsWith("attr:")){z(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){yt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(ae.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,ne.has(s)||le([s]);continue}if(r==="class"||r==="className"){q(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>ie(e,o())):ie(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>se(e,o())):se(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=K(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});P(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=K(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});P(()=>{s()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=K(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});P(()=>{s()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=K(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});P(()=>{i()})}else{let s=!0;m(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=K(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();we(e,r,i,n)});P(()=>{s()})}else m(()=>we(e,r,t[r],n))}}}function gt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[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 s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Co(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);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})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function j(e,t){if(e){if($(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function ht(e,t,n){let r=t||document.body,o=ln(()=>e),s=[];return at(()=>{let i=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),P(()=>{s.forEach(a=>a())})}),null}function Ro(e){return typeof e=="string"&&e.toLowerCase()===e}function xt(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 Mo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function te(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Po(e){return typeof e=="function"&&e.length===0&&T(e)}function fe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return an(i=>{at(()=>{u.active||(t.textContent=""),b(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var hn="__fx_dom_create_component__",L=globalThis[hn]??={fn:null};function Oo(e){L.fn=e}function ko(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function de(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var Do=()=>L.fn!==null,Tt=()=>L.fn!==null;function bt(){L.fn=null}var pe,Nt={getStore:()=>pe,run(e,t){let n=pe;pe=e;try{return t()}finally{pe=n}}},De=Nt;function wt(e){De=e??Nt}function X(e={}){e.locals||(e.locals=e.request?$e(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function J(e,t){return De.run(e,t)}function A(){return De.getStore()}function _e(){return A()?.event}function St(){let e=_e();return e?(e.locals||(e.locals={}),e.locals):{}}var Et=new WeakMap;function $e(e){let t=Et.get(e);return t||(t={},Et.set(e,t)),t}import{setResourceIdSource as xn,setServerDataGetter as Tn}from"@fluixi/reactive/signal";var Y="__FX_DATA__";function ye(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ie;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ie!==void 0)return Ie;let t=null;if(typeof document<"u"){let n=document.getElementById(Y)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ie=t}function ge(){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 bn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),he=typeof process<"u"&&process.env&&!1;function xe(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 En(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(bn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(he&&t&&xe(`<${e}>`,t),null)}function Nn(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(he&&t&&xe(`<${e}> (static)`,t),null)}function wn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ge();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(he&&t&&xe(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sn(e){ge();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(he&&t&&xe(`marker <!--${e.slice(0,24)}-->`,t),null)}var vt=!1;function vn(){vt||(vt=!0,it({hydrateElement:En,hydrateText:wn,hydrateMarker:Sn,hydrateStatic:Nn}))}function Z(e,t,n){vn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=me(),o=n?.resourceNamespace,s=0;xn(()=>o?`${o}:r${s++}`:`r${s++}`),Tn(r?i=>i in r?{value:r[i]}:void 0:null);try{return fe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var qe="fluixi-island";function An(e){let{component:t,props:n={},name:r}=e,o=ce(qe),s=r??t.name??"Island";h(o,"name",s),h(o,"props",JSON.stringify(n??{}));let i=g?A():void 0;if(i){let a=i.nextIslandNamespace(s);b(o,()=>i.withResourceScope(a,()=>t(n)))}else b(o,()=>t(n));return o}var At=!1;function Cn(){if(At||typeof document>"u")return;At=!0;let e=document.createElement("style");e.textContent=`${qe}{display:contents}`,document.head.appendChild(e)}function Rn(e){if(typeof document>"u")return;Cn();let t=document.querySelectorAll(qe),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){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{}Z(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Mn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Pn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as Ln}from"@fluixi/reactive/signal";function ci(e,t={}){if(typeof e=="function")return de(e,t);if(typeof e!="string"||e.length===0)return null;let n=xt(e);if(g)return _().createElement(e,n);let r=n?document.createElementNS(W,e):document.createElement(e);return ue(r,t,n),On(r,t),r}function On(e,t){if(!t||t.children===void 0)return;let n=Ln(()=>t.children),r=o=>{b(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as kn,createMemo as je,disposeScope as Dn,getOwner as _n,runWithOwner as $n,untrack as Pt}from"@fluixi/reactive/signal";function Ct(e){return typeof e=="function"?e:(()=>e)}function R(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Rt(e){return e!=null&&e!==!1}function Mt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function In(e){let t=R(()=>e.when),n=je(t,void 0),r=je(n,void 0),o=_n(),s=null,i=null,a=l=>{l!==i&&(s&&Dn(s),s=kn(o),i=l)};return je(()=>{let l=r();return a(l?"when":"fallback"),$n(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Mt(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 qn,keyArray as jn}from"@fluixi/reactive/signal";function Hn(e){let t=R(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return B(a),a};return e.by?jn(t,e.by,(o,s)=>r(o,s),{fallback:n}):qn(t,(o,s)=>r(o,s),{fallback:n})}import{indexArray as Fn}from"@fluixi/reactive/signal";function Vn(e){let t=R(()=>e.each);return Fn(t,(n,r)=>{let o=e.children(n,r);return B(o),o},{fallback:()=>e.fallback??null})}import{mapArray as is,keyArray as ss,indexArray as as}from"@fluixi/reactive/signal";import{createMemo as Wn,createChildOwner as Un,disposeScope as Bn,getOwner as Kn,runWithOwner as Lt}from"@fluixi/reactive/signal";var He=Symbol("match");function zn(e){return{[He]:!0,when:R(()=>e.when),get children(){return e.children}}}function Gn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Kn(),r=null,o=-1,s=i=>{i!==o&&(r&&Bn(r),r=Un(n),o=i)};return Wn(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[He]&&c++<10;)l=l();if(!l||typeof l!="object"||l[He]!==!0)continue;let f=l.when();if(Rt(f))return s(i),Lt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),Lt(r,()=>e.fallback??null)})}import{createMemo as Xn,createChildOwner as Jn,disposeScope as Yn,getOwner as Zn,runWithOwner as Qn}from"@fluixi/reactive/signal";function er(e){let t=Ct(e.component),{component:n,...r}=e,o=Zn(),s=null,i;return Xn(()=>{let a=t();return a!==i&&(s&&Yn(s),s=Jn(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Qn(s,()=>a(r))})}import{createRoot as tr,onCleanup as nr}from"@fluixi/reactive/signal";function rr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return tr(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),b(r,e.children)&&j(e.ref,r)}),nr(()=>{n(),r.remove()}),null}import{createMemo as or,createSignal as ir}from"@fluixi/reactive/signal";function Ot(e){if(g)return e.fallback??null;let t=u.active,[n,r]=ir(!t);return t&&queueMicrotask(()=>r(!0)),or(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var sr=Ot;import{createMemo as ar,createSignal as lr}from"@fluixi/reactive/signal";function cr(e){let[t,n]=lr(null),r=()=>n(null);return ar(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}import{createMemo as ur}from"@fluixi/reactive/signal";function fr(e){return ur(()=>{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 dr}from"@fluixi/reactive/signal";function pr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function yr(e){return dr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${pr(r)}: ${s}`)}return n.join("; ")})}var be=1,We=3,Ue=8,kt;kt=U;var H=class{constructor(){this[kt]=!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 H{constructor(n){super();this.nodeType=We;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)}},Te=class e extends H{constructor(n){super();this.nodeType=be;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},F=class e extends H{constructor(n){super();this.nodeType=Ue;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Fe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ve=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}},k=class e extends H{constructor(n,r=!1){super();this.nodeType=be;this.attributes=new Map;this.style=new Fe;this.classList=new Ve(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 mr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_t=/&/g,$t=/</g,It=/>/g,gr=/"/g;function Be(e){return e.replace(_t,"&amp;").replace($t,"&lt;").replace(It,"&gt;")}function Dt(e){return e.replace(_t,"&amp;").replace(gr,"&quot;").replace($t,"&lt;").replace(It,"&gt;")}function hr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function xr(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(`${hr(n)}: ${r}`)}return t.join("; ")}function Tr(e){let t="",n=xr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Dt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Dt(o)}"`}return t}function w(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Be(e);if(typeof e=="number")return Be(String(e));if(typeof e=="function")return w(e());if(Array.isArray(e))return e.map(w).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case We:return Be(e.data??"");case Ue:return`<!--${e.data??""}-->`;case be:{let t=e.localName,n=`<${t}${Tr(e)}>`;if(mr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(w).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(w).join(""):""}import{createRoot as Wt}from"@fluixi/reactive/signal";import{setResourceTracker as Nr,setResourceIdSource as wr,setResourceDataSink as Sr,getOwner as vr,runWithOwner as Ht,flush as Ar}from"@fluixi/reactive/signal";var br=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Er={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function qt(e){return e.replace(/&(#?\w+);/g,(t,n)=>Er[n]??t)}var E=class extends Error{};function jt(e,t=!1){let n=0,r=[],o=[],s=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}`);s(new F(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 i=r[0];if(r.length!==1||!(i instanceof k))throw new E(`expected exactly one root element, got ${r.length}`);return i;function a(c){c!==""&&s(new O(qt(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 k(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 Ee=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let V=e.slice(Ee,y);if(V==="")throw new E(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new E(`attribute ${V} must have a double-quoted value`);let Ne=e.indexOf('"',y+2);if(Ne===-1)throw new E(`unterminated value for ${V}`);p.setAttribute(V,qt(e.slice(y+2,Ne))),y=Ne+1}else p.setAttribute(V,"")}return s(p),br.has(d)||o.push(p),y}}var Ft=!1;function Ut(){Ft||(Ft=!0,rt({createElement:(e,t)=>new k(e,t),createText:e=>new O(e),createRaw:e=>new Te(e),parseTemplate:(e,t)=>jt(e,t),createComment:e=>new F(e)}))}function Bt(e,t={}){let n=g;Ut(),D(!0);let r=X(t.event);try{return J(r,()=>Wt(o=>{try{let s=typeof e=="function"?e():e;return w(s)}finally{o()}}))}finally{D(n)}}var Vt=!1;function Cr(){Vt||(Vt=!0,Nr(e=>{A()?.pending.add(e)}),wr(()=>A()?.nextResourceId()??""),Sr((e,t)=>{e&&A()?.data.set(e,t)}))}var Ke=null;function Kt(e){Ke=e}function ze(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(Ke)try{s=Ke(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=ye(JSON.stringify(t));return`<script type="application/json" id="${Y}">${n}<\/script>`}var Rr=50;async function zt(e,t={}){let n=g;Ut(),D(!0),Cr();let r=X(t.event);try{return await J(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};Wt(f=>{i=f,s=vr(),o=typeof e=="function"?e():e});let a=()=>{try{Ht(s,()=>w(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Rr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Ar(),a()}let c=Ht(s,()=>w(o))+ze(r);return i(),c})}finally{D(n)}}var Mr="1.0.0-alpha.70";var Pr={createComponent:de,createElement:et,createNativeElement:ce,createTemplate:Oe,cloneTemplate:ke,templateNode:lt,holeContent:ft,holeEnd:ut,holeScope:ct,createPortal:ht,render:fe,hydrate:Z,insert:b,appendChildren:nt,removeChildren:tt,spread:mt,applyProps:ue,mergeProps:gt,setProperty:I,setDynamicProperty:G,setAttribute:h,setDynamicAttribute:z,removeAttribute:Qe,getAttribute:Ze,setClassName:q,addClass:Xe,removeClass:Je,toggleClass:Ye,setStyles:ve,delegateEvents:le,addDelegatedEventListener:Le,removeDelegatedEventListener:re,handleRef:j,resetIntegration:bt,isIntegrationInitialized:Tt},zs=Pr;export{Ot as ClientOnly,er as Dynamic,cr as ErrorBoundary,Y as FX_DATA_ID,Hn as For,Vn as Index,An as Island,Se as JSX_PROPERTIES,zn as Match,sr as NoSsr,rr as Portal,$r as SVG_ELEMENTS,W as SVG_NAMESPACE,In as Show,Gn as Switch,Mr as VERSION,_r as VOID_ELEMENTS,Xe as addClass,Le as addDelegatedEventListener,dt as addNativeEventListener,nt as appendChildren,we as applyElementProp,ue as applyProps,pt as applyUse,ao as asComponent,so as asContext,oo as asOutlet,io as asProvider,ro as asRoute,to as asRouter,no as asRoutes,lo as asSuspense,on as captureHydrationCursor,co as checkRenderType,fr as classMap,M as cleanChildren,ke as cloneTemplate,qr as closest,de as createComponent,ci as createDynamicElement,et as createElement,ce as createNativeElement,ht as createPortal,X as createRequestContext,Oe as createTemplate,zs as default,Ur as delegate,le as delegateEvents,ye as escapeFxJson,Mo as escapeHTML,vo as fnName,No as generateID,Ze as getAttribute,Qr as getGlobal,kr as getLitEventName,St as getLocals,Wr as getOffset,A as getRequestContext,_e as getRequestEvent,$e as getRequestLocals,me as getServerData,Eo as getStableElementId,Hr as getStyle,j as handleRef,jr as hasClass,ft as holeContent,ut as holeEnd,ct as holeScope,Mn as html,Z as hydrate,B as hydrateAdvancePast,Rn as hydrateIslands,as as indexArray,ko as initializeIntegration,b as insert,oe as insertExpression,Do as intergartionInitialized,Po as isAccessor,N as isComponent,nn as isContext,Gt as isCustomElement,Yr as isDOMNode,wo as isDelegatedEvent,Ce as isDomElement,$ as isDomNode,Re as isDomText,Or as isEventHandler,So as isFunction,Tt as isIntegrationInitialized,Jr as isJSXTemplate,Jt as isLitTemplateResult,Ro as isNativeElement,en as isOutlet,te as isPromise,tn as isProvider,Gr as isReactElement,Qt as isRoute,Yt as isRouter,Zt as isRoutes,xt as isSVGElement,g as isServer,rn as isSuspense,Xr as isTemplateFactory,Fr as isVisible,Ao as iterateFn,ss as keyArray,pn as makeArrayFlat,is as mapArray,gt as mergeProps,Kr as observeIntersection,zr as observeResize,Ge as query,Ir as queryAll,Oo as registerCreateComponent,Zr as registerGlobal,Qe as removeAttribute,tt as removeChildren,Je as removeClass,re as removeDelegatedEventListener,fe as render,Bt as renderToString,zt as renderToStringAsync,bt as resetIntegration,ee as runHydrationAt,J as runWithRequestContext,sn as runWithoutHydration,Vr as scrollIntoView,w as serializeNode,ze as serializeResourceData,h as setAttribute,ie as setClassList,q as setClassName,Kt as setDataRedactor,z as setDynamicAttribute,yt as setDynamicBoolAttribute,G as setDynamicProperty,I as setProperty,wt as setRequestStore,D as setServerMode,se as setStyle,ve as setStyles,Dr as shouldSetAsProperty,Co as splitProps,mt as spread,yr as styleMap,Pn as svg,lt as templateNode,Lr as toAttributeName,Ye as toggleClass,Br as waitForElement};
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&M(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(M({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>xe});module.exports=ne(Ee);var m=require("@fluixi/reactive/signal");var R="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function P(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Te=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var S=typeof document>"u";var j=Symbol.for("fluixi.server-node"),_=null;function w(){if(!_)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _}function A(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},re=null;function $(){return re}function O(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var H=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!S)for(let t of e)H.has(t)||q.has(t)||(H.add(t),document.addEventListener(t,se))}function se(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=$()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,fe=200;function ae(e,t,n,o,s){let a=o,r=new Map;return(0,d.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function D(e,t,n,o){if(x>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,null)}finally{x--}return()=>s}let i=ae(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&F(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):O(e,r)||p(e,r,n),r}if(A(t))return O(e,t)?(I(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=le(e,i,r,n);for(let u of f){let c=D(e,u.sig,u.marker);(0,d.onCleanup)(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let f=i.type(i.props||{});return C(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,m.isSignal)(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let y=1;y<c.length;y++)l.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function le(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],c)}else if(r===f)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[f]===t[a-1]){let c=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let c=u.get(t[i]);if(c!=null)if(f<c&&c<r){let y=i,L=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==c+L);)L++;if(L>c-f){let J=t[i];for(;f<c;)p(e,n[f++],J)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function W(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;N(e,t,s,o)})}function ye(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function pe(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();N(e,t,!!o)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function V(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function k(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){me(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){ye(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){pe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(q.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,H.has(a)||ie([a]);continue}if(o==="class"||o==="className"){K(e,s);continue}if(o==="classList"){typeof s=="function"?(0,d.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="style"){typeof s=="function"?(0,d.createRenderEffect)(()=>k(e,s())):k(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,d.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,d.onCleanup)(()=>{r()})}else{let a=!0;(0,d.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();P(e,o,r,n)});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>P(e,o,t[o],n))}}}function me(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function G(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ge="__fx_dom_create_component__",z=globalThis[ge]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function xe(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=G(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(R,e):document.createElement(e);return B(o,t,n),he(o,t),o}function he(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{D(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
1
+ "use strict";var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)R(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&R(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(R({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>xe});module.exports=ne(Ee);var m=require("@fluixi/reactive/signal");var M="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function P(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Ne=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var S=typeof document>"u";var j=Symbol.for("fluixi.server-node"),_=null;function w(){if(!_)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _}function A(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},re=null;function $(){return re}function H(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var O=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!S)for(let t of e)O.has(t)||q.has(t)||(O.add(t),document.addEventListener(t,se))}function se(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=$()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,fe=200;function ae(e,t,n,o,s){let a=o,r=new Map;return(0,d.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function D(e,t,n,o){if(x>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,null)}finally{x--}return()=>s}let i=ae(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),N(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&F(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||p(e,r,n),r}if(A(t))return H(e,t)?(I(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=le(e,i,r,n);for(let u of f){let c=D(e,u.sig,u.marker);(0,d.onCleanup)(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let f=i.type(i.props||{});return C(e,f,n,o)}}}return N(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,m.isSignal)(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let y=1;y<c.length;y++)l.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function le(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],c)}else if(r===f)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[f]===t[a-1]){let c=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let c=u.get(t[i]);if(c!=null)if(f<c&&c<r){let y=i,L=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==c+L);)L++;if(L>c-f){let J=t[i];for(;f<c;)p(e,n[f++],J)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function ye(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function pe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function W(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function V(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){me(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){ye(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){pe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(q.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,O.has(a)||ie([a]);continue}if(o==="class"||o==="className"){K(e,s);continue}if(o==="classList"){typeof s=="function"?(0,d.createRenderEffect)(()=>W(e,s())):W(e,s);continue}if(o==="style"){typeof s=="function"?(0,d.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,d.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,d.onCleanup)(()=>{r()})}else{let a=!0;(0,d.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();P(e,o,r,n)});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>P(e,o,t[o],n))}}}function me(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function G(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ge="__fx_dom_create_component__",z=globalThis[ge]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function xe(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=G(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(M,e):document.createElement(e);return B(o,t,n),he(o,t),o}function he(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{D(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
@@ -1 +1 @@
1
- import{isSignal as m}from"@fluixi/reactive/signal";var P="http://www.w3.org/2000/svg";function Y(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Y(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as we,createEffect as A,createRenderEffect as p,createRoot as Ae,onCleanup as S,readChildren as ve}from"@fluixi/reactive/signal";var w=typeof document>"u";var F=Symbol.for("fluixi.server-node"),j=null;function v(){if(!j)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return j}function C(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function $(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Z=null;function I(){return Z}function H(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!w)for(let t of e)D.has(t)||K.has(t)||(D.add(t),document.addEventListener(t,ee))}function ee(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(w)return v().createText(e);if(b.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,te=200;function ne(e,t,n,o,f){let a=o,r=new Map;return p(()=>{let i;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let s=e();r.set(e,s)}finally{x--}}for(i=r.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let s=0;for(;typeof i=="function"&&s++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!E(i))break}x++;try{a=M(t,i,n,a,r),f(a)}finally{x--}})}function _(e,t,n,o){if(x>te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),r=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){x++;try{f=M(e,t,n,null)}finally{x--}return()=>f}let i=ne(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function M(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):y(e,r,n):o?e.replaceChild(r,o):y(e,r,n),t.then(i=>{r.parentNode===e&&M(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return y(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&$(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||y(e,r,n),r}if(C(t))return H(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],s=[];g(t,r,e,n,!0,f,s);let l=oe(e,i,r,n);for(let u of s){let c=_(e,u.sig,u.marker);S(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let s=i.type(i.props||{});return M(e,s,n,o)}}}return T(e,o,n)}function g(e,t,n,o,f=!0,a,r){for(let i=0;i<e.length;i++){let s=e[i];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!m(s)&&!E(s)&&(s=s(),!(s==null||typeof s=="boolean")););if(!(s==null||typeof s=="boolean")){if(typeof s=="function"){let l;for(E(s)&&!m(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!m(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,f,a):g([u],t,n,o,f,a);continue}continue}Array.isArray(l)?g(l,t,n,o,f,a,r):g([l],t,n,o,f,a,r);continue}if(L(s)){let l=h("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(s)){g(s,t,n,o,f,a,r);continue}if(C(s)){t.push(s);continue}if(typeof s=="object"&&s!==null&&"type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof s=="string"||typeof s=="number"){let l=String(s);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(s)))}}}}function oe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,r=f,i=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||s<r;){if(t[i]===n[s]){i++,s++;continue}for(;a>i&&r>s&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<f?s?n[s-1].nextSibling??void 0:n[r-s]:l;for(;s<r;)y(e,n[s++],c)}else if(r===s)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let d=s;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(s<c&&c<r){let d=i,R=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+R);)R++;if(R>c-s){let J=t[i];for(;s<c;)y(e,n[s++],J)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(y(e,n[s++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function re(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function ie(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function se(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function fe(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):p(()=>{let o=n();N(e,t,!!o)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function k(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let r=!!f();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof f=="function"?f():f);for(let i of a)e.classList.toggle(i,r)}}}function q(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function G(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){le(f,e);continue}if(o!=="children"){if(o==="use"){ie(e,f);continue}if(o.startsWith("on:")){re(e,o.slice(3),f);continue}if(o.startsWith("prop:")){fe(e,o.slice(5),f);continue}if(o.startsWith("attr:")){se(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ae(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(K.has(a)){e[`$$${a}`]=f;let r=`__fx_${a}`;if(!e[r]){let i=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=f,D.has(a)||Q([a]);continue}if(o==="class"||o==="className"){B(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>k(e,f())):k(e,f);continue}if(o==="style"){typeof f=="function"?p(()=>q(e,f())):q(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function";)r=r();e.innerHTML=r});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,r=A(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{r()})}else{let a=!0;p(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});S(()=>{a()})}else p(()=>O(e,o,t[o],n))}}}function le(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ue="__fx_dom_create_component__",U=globalThis[ue]??={fn:null};function X(e,t){return U.fn?U.fn(e,t):(()=>e(t))}import{readChildren as ce}from"@fluixi/reactive/signal";function Fe(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return v().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return G(o,t,n),de(o,t),o}function de(e,t){if(!t||t.children===void 0)return;let n=ce(()=>t.children),o=f=>{_(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{Fe as createDynamicElement};
1
+ import{isSignal as m}from"@fluixi/reactive/signal";var P="http://www.w3.org/2000/svg";function Y(e){return e.localName.includes("-")}function H(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Y(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Ae,createEffect as A,createRenderEffect as p,createRoot as ve,onCleanup as S,readChildren as Ce}from"@fluixi/reactive/signal";var w=typeof document>"u";var F=Symbol.for("fluixi.server-node"),j=null;function v(){if(!j)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return j}function C(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function $(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Z=null;function I(){return Z}function O(e,t){return b.active&&t.parentNode===e}function k(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!w)for(let t of e)D.has(t)||K.has(t)||(D.add(t),document.addEventListener(t,ee))}function ee(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(w)return v().createText(e);if(b.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,te=200;function ne(e,t,n,o,f){let a=o,r=new Map;return p(()=>{let i;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let s=e();r.set(e,s)}finally{x--}}for(i=r.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let s=0;for(;typeof i=="function"&&s++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!E(i))break}x++;try{a=R(t,i,n,a,r),f(a)}finally{x--}})}function _(e,t,n,o){if(x>te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),r=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){x++;try{f=R(e,t,n,null)}finally{x--}return()=>f}let i=ne(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function R(e,t,n,o,f){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(L(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),N(e,o.slice(1),n)):y(e,r,n):o?e.replaceChild(r,o):y(e,r,n),t.then(i=>{r.parentNode===e&&R(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return y(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&$(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):O(e,r)||y(e,r,n),r}if(C(t))return O(e,t)?(k(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],s=[];g(t,r,e,n,!0,f,s);let l=oe(e,i,r,n);for(let u of s){let c=_(e,u.sig,u.marker);S(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let s=i.type(i.props||{});return R(e,s,n,o)}}}return N(e,o,n)}function g(e,t,n,o,f=!0,a,r){for(let i=0;i<e.length;i++){let s=e[i];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!m(s)&&!E(s)&&(s=s(),!(s==null||typeof s=="boolean")););if(!(s==null||typeof s=="boolean")){if(typeof s=="function"){let l;for(E(s)&&!m(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!m(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,f,a):g([u],t,n,o,f,a);continue}continue}Array.isArray(l)?g(l,t,n,o,f,a,r):g([l],t,n,o,f,a,r);continue}if(L(s)){let l=h("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(s)){g(s,t,n,o,f,a,r);continue}if(C(s)){t.push(s);continue}if(typeof s=="object"&&s!==null&&"type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof s=="string"||typeof s=="number"){let l=String(s);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(s)))}}}}function oe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,r=f,i=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||s<r;){if(t[i]===n[s]){i++,s++;continue}for(;a>i&&r>s&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<f?s?n[s-1].nextSibling??void 0:n[r-s]:l;for(;s<r;)y(e,n[s++],c)}else if(r===s)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let d=s;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(s<c&&c<r){let d=i,M=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+M);)M++;if(M>c-s){let J=t[i];for(;s<c;)y(e,n[s++],J)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(y(e,n[s++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function W(e,t,n){n==null?delete e[t]:e[t]=n}function re(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function ie(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function se(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function fe(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):p(()=>{let o=n();T(e,t,!!o)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function V(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let r=!!f();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof f=="function"?f():f);for(let i of a)e.classList.toggle(i,r)}}}function q(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function G(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){le(f,e);continue}if(o!=="children"){if(o==="use"){ie(e,f);continue}if(o.startsWith("on:")){re(e,o.slice(3),f);continue}if(o.startsWith("prop:")){fe(e,o.slice(5),f);continue}if(o.startsWith("attr:")){se(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ae(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(K.has(a)){e[`$$${a}`]=f;let r=`__fx_${a}`;if(!e[r]){let i=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=f,D.has(a)||Q([a]);continue}if(o==="class"||o==="className"){B(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>V(e,f())):V(e,f);continue}if(o==="style"){typeof f=="function"?p(()=>q(e,f())):q(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function";)r=r();e.innerHTML=r});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,r=A(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{r()})}else{let a=!0;p(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();H(e,o,r,n)});S(()=>{a()})}else p(()=>H(e,o,t[o],n))}}}function le(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ue="__fx_dom_create_component__",U=globalThis[ue]??={fn:null};function X(e,t){return U.fn?U.fn(e,t):(()=>e(t))}import{readChildren as ce}from"@fluixi/reactive/signal";function $e(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return v().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return G(o,t,n),de(o,t),o}function de(e,t){if(!t||t.children===void 0)return;let n=ce(()=>t.children),o=f=>{_(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{$e as createDynamicElement};
@@ -1 +1 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},v=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!p.call(t,a)&&a!==n&&i(t,a,{get:()=>e[a],enumerable:!(o=s(e,a))||o.enumerable});return t};var y=t=>v(i({},"__esModule",{value:!0}),t);var h={};d(h,{ascendPast:()=>u,captureHydrationCursor:()=>g,getHydrationWalker:()=>x,hydrateAdvancePast:()=>T,hydration:()=>r,isAdopted:()=>N,registerHydrationWalker:()=>f,runHydrationAt:()=>k,runWithoutHydration:()=>H});module.exports=y(h);var r={active:!1,cursor:null,parents:[]},l=null;function f(t){l=t}function x(){return l}function N(t,e){return r.active&&e.parentNode===t}function u(t){let e=r.parents.lastIndexOf(t);e!==-1&&(r.parents.length=e),r.cursor=t.nextSibling}function g(){return r.active?r.cursor:null}function k(t,e){if(!t||t.parentNode==null)return e();let n=r.active,o=r.cursor,a=r.parents;r.active=!0,r.cursor=t,r.parents=[];try{return e()}finally{r.active=n,r.cursor=o,r.parents=a}}function H(t){if(!r.active)return t();let e=r.cursor,n=r.parents;r.active=!1,r.parents=[];try{return t()}finally{r.active=!0,r.cursor=e,r.parents=n}}function T(t){if(!r.active||t==null)return;let e=Array.isArray(t)?t[t.length-1]:t;e&&typeof e.nodeType=="number"&&u(e)}
1
+ "use strict";var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!p.call(t,a)&&a!==n&&l(t,a,{get:()=>e[a],enumerable:!(o=s(e,a))||o.enumerable});return t};var v=t=>y(l({},"__esModule",{value:!0}),t);var T={};d(T,{ascendPast:()=>u,captureHydrationCursor:()=>N,getHydrationWalker:()=>x,hydrateAdvancePast:()=>H,hydration:()=>r,isAdopted:()=>g,registerHydrationWalker:()=>f,runHydrationAt:()=>h,runWithoutHydration:()=>k});module.exports=v(T);var r={active:!1,cursor:null,parents:[]},i=null;function f(t){i=t}function x(){return i}function g(t,e){return r.active&&e.parentNode===t}function u(t){let e=r.parents.lastIndexOf(t);e!==-1&&(r.parents.length=e),r.cursor=t.nextSibling}function N(){return r.active?r.cursor:null}function h(t,e){if(!t||t.parentNode==null)return e();let n=r.active,o=r.cursor,a=r.parents;r.active=!0,r.cursor=t,r.parents=[];try{return e()}finally{r.active=n,r.cursor=o,r.parents=a}}function k(t){if(!r.active)return t();let e=r.cursor,n=r.parents;r.active=!1,r.parents=[];try{return t()}finally{r.active=!0,r.cursor=e,r.parents=n}}function H(t){if(!r.active||t==null)return;let e=Array.isArray(t)?t[t.length-1]:t;e&&typeof e.nodeType=="number"&&u(e)}
@@ -14,6 +14,8 @@ export interface HydrationWalker {
14
14
  hydrateElement(tag: string): Element | null;
15
15
  hydrateText(value: string): Text | null;
16
16
  hydrateMarker(value: string): Comment | null;
17
+ /** Adopt a static subtree whole, without descending into it. */
18
+ hydrateStatic(tag: string): Element | null;
17
19
  }
18
20
  export declare function registerHydrationWalker(walker: HydrationWalker): void;
19
21
  export declare function getHydrationWalker(): HydrationWalker | null;
@@ -1 +1 @@
1
- {"version":3,"file":"hydration-state.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,EAAE,CAAA;CAI9E,CAAC;AAGF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC9C;AAID,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,GAAG,IAAI,CAEpD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAerE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAarD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAM1D"}
1
+ {"version":3,"file":"hydration-state.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,EAAE,CAAA;CAI9E,CAAC;AAGF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC7C,gEAAgE;IAChE,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC5C;AAID,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,GAAG,IAAI,CAEpD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAerE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAarD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAM1D"}
@@ -1 +1 @@
1
- var t={active:!1,cursor:null,parents:[]},a=null;function u(r){a=r}function s(){return a}function c(r,e){return t.active&&e.parentNode===r}function l(r){let e=t.parents.lastIndexOf(r);e!==-1&&(t.parents.length=e),t.cursor=r.nextSibling}function p(){return t.active?t.cursor:null}function d(r,e){if(!r||r.parentNode==null)return e();let n=t.active,o=t.cursor,i=t.parents;t.active=!0,t.cursor=r,t.parents=[];try{return e()}finally{t.active=n,t.cursor=o,t.parents=i}}function v(r){if(!t.active)return r();let e=t.cursor,n=t.parents;t.active=!1,t.parents=[];try{return r()}finally{t.active=!0,t.cursor=e,t.parents=n}}function y(r){if(!t.active||r==null)return;let e=Array.isArray(r)?r[r.length-1]:r;e&&typeof e.nodeType=="number"&&l(e)}export{l as ascendPast,p as captureHydrationCursor,s as getHydrationWalker,y as hydrateAdvancePast,t as hydration,c as isAdopted,u as registerHydrationWalker,d as runHydrationAt,v as runWithoutHydration};
1
+ var t={active:!1,cursor:null,parents:[]},a=null;function u(r){a=r}function s(){return a}function c(r,e){return t.active&&e.parentNode===r}function i(r){let e=t.parents.lastIndexOf(r);e!==-1&&(t.parents.length=e),t.cursor=r.nextSibling}function p(){return t.active?t.cursor:null}function d(r,e){if(!r||r.parentNode==null)return e();let n=t.active,o=t.cursor,l=t.parents;t.active=!0,t.cursor=r,t.parents=[];try{return e()}finally{t.active=n,t.cursor=o,t.parents=l}}function y(r){if(!t.active)return r();let e=t.cursor,n=t.parents;t.active=!1,t.parents=[];try{return r()}finally{t.active=!0,t.cursor=e,t.parents=n}}function v(r){if(!t.active||r==null)return;let e=Array.isArray(r)?r[r.length-1]:r;e&&typeof e.nodeType=="number"&&i(e)}export{i as ascendPast,p as captureHydrationCursor,s as getHydrationWalker,v as hydrateAdvancePast,t as hydration,c as isAdopted,u as registerHydrationWalker,d as runHydrationAt,y as runWithoutHydration};
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var z=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},Y=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of G(e))!U.call(n,c)&&c!==t&&v(n,c,{get:()=>e[c],enumerable:!(i=J(e,c))||i.enumerable});return n};var Q=n=>Y(v({},"__esModule",{value:!0}),n);var ae={};z(ae,{hydrate:()=>ue});module.exports=Q(ae);var h=require("@fluixi/reactive/signal");function E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var R=typeof document>"u";var $=Symbol.for("fluixi.server-node"),D=null;function O(){if(!D)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return D}function C(n){return n!=null&&n[$]===!0?!0:typeof Node<"u"&&n instanceof Node}function F(n){return n!=null&&n[$]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},H=null;function j(n){H=n}function W(){return H}function P(n,e){return a.active&&e.parentNode===n}function I(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function N(n,e=!1){if(R)return O().createText(n);if(a.active&&!e){let t=W()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,i,c){let f=i,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(E(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&(0,h.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,h.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let u=r;m++;try{let l=u();s.set(u,l)}finally{m--}}r=s.get(r)}else if((0,h.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,h.isSignal)(r)&&!E(r))break}m++;try{f=S(e,r,t,f,s),c(f)}finally{m--}})}function K(n,e,t,i){if(m>Z)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let c=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{c=S(n,e,t,null)}finally{m--}return()=>c}let r=ee(s(e),n,t,c,o=>{c=o});return()=>(r?.(),c)}function S(n,e,t,i,c){if(e==null||typeof e=="boolean")return b(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(n,i,t);if(T(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),b(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&S(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=N(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(n,i,t)}if(i&&F(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):P(n,s)||p(n,s,t),s}if(C(e))return P(n,e)?(I(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),b(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];g(e,s,n,t,!0,c,o);let u=ne(n,r,s,t);for(let l of o){let d=K(n,l.sig,l.marker);(0,x.onCleanup)(()=>{b(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(n,o,t,i)}}}return b(n,i,t)}function g(n,e,t,i,c=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!(0,h.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(E(o)&&!(0,h.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!T(u)&&!(0,h.isSignal)(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,h.isSignal)(u)){if(s){let d=N("",!0);e.push(d),s.push({marker:d,sig:u});continue}let l=u();for(;typeof l=="function"&&(0,h.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,i,c,f):g([l],e,t,i,c,f);continue}continue}Array.isArray(u)?g(u,e,t,i,c,f,s):g([u],e,t,i,c,f,s);continue}if(T(o)){let u=N("",!0);e.push(u),o.then(l=>{if(u.parentNode){let d=[];if(g([l],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){g(o,e,t,i,c,f,s);continue}if(C(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?g(l,e,t,i,!1,f):g([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(o)))}}}}function ne(n,e,t,i){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,r=0,o=0,u=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(o<d&&d<s){let y=r,A=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+A);)A++;if(A>d-o){let q=e[r];for(;o<d;)p(n,t[o++],q)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function b(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function V(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{a.active||(e.textContent=""),K(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var w=require("@fluixi/reactive/signal");var te="__FX_DATA__";var _;function B(){let n=globalThis.__FX_DATA__;if(n)return n;if(_!==void 0)return _;let e=null;if(typeof document<"u"){let t=document.getElementById(te)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return _=e}function L(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var oe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),M=typeof process<"u"&&process.env&&!1;function k(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 re(n){L();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(oe.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(M&&e&&k(`<${n}>`,e),null)}function ie(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}L();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(M&&e&&k(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function se(n){L();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(M&&e&&k(`marker <!--${n.slice(0,24)}-->`,e),null)}var X=!1;function fe(){X||(X=!0,j({hydrateElement:re,hydrateText:ie,hydrateMarker:se}))}function ue(n,e,t){fe(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=B(),c=t?.resourceNamespace,f=0;(0,w.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,w.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return V(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}
1
+ "use strict";var _=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var z=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},Y=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of U(e))!G.call(n,c)&&c!==t&&_(n,c,{get:()=>e[c],enumerable:!(i=J(e,c))||i.enumerable});return n};var Q=n=>Y(_({},"__esModule",{value:!0}),n);var le={};z(le,{hydrate:()=>ae});module.exports=Q(le);var h=require("@fluixi/reactive/signal");function E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var D=typeof document>"u";var $=Symbol.for("fluixi.server-node"),R=null;function H(){if(!R)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return R}function L(n){return n!=null&&n[$]===!0?!0:typeof Node<"u"&&n instanceof Node}function O(n){return n!=null&&n[$]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},F=null;function j(n){F=n}function W(){return F}function k(n,e){return a.active&&e.parentNode===n}function I(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function N(n,e=!1){if(D)return H().createText(n);if(a.active&&!e){let t=W()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,i,c){let f=i,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(E(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&(0,h.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,h.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let u=r;m++;try{let l=u();s.set(u,l)}finally{m--}}r=s.get(r)}else if((0,h.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,h.isSignal)(r)&&!E(r))break}m++;try{f=w(e,r,t,f,s),c(f)}finally{m--}})}function K(n,e,t,i){if(m>Z)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let c=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{c=w(n,e,t,null)}finally{m--}return()=>c}let r=ee(s(e),n,t,c,o=>{c=o});return()=>(r?.(),c)}function w(n,e,t,i,c){if(e==null||typeof e=="boolean")return b(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(n,i,t);if(T(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),b(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&w(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=N(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(n,i,t)}if(i&&O(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):k(n,s)||p(n,s,t),s}if(L(e))return k(n,e)?(I(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),b(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];g(e,s,n,t,!0,c,o);let u=ne(n,r,s,t);for(let l of o){let d=K(n,l.sig,l.marker);(0,x.onCleanup)(()=>{b(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return w(n,o,t,i)}}}return b(n,i,t)}function g(n,e,t,i,c=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!(0,h.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(E(o)&&!(0,h.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!T(u)&&!(0,h.isSignal)(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,h.isSignal)(u)){if(s){let d=N("",!0);e.push(d),s.push({marker:d,sig:u});continue}let l=u();for(;typeof l=="function"&&(0,h.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,i,c,f):g([l],e,t,i,c,f);continue}continue}Array.isArray(u)?g(u,e,t,i,c,f,s):g([u],e,t,i,c,f,s);continue}if(T(o)){let u=N("",!0);e.push(u),o.then(l=>{if(u.parentNode){let d=[];if(g([l],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){g(o,e,t,i,c,f,s);continue}if(L(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?g(l,e,t,i,!1,f):g([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(o)))}}}}function ne(n,e,t,i){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,r=0,o=0,u=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(o<d&&d<s){let y=r,P=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+P);)P++;if(P>d-o){let q=e[r];for(;o<d;)p(n,t[o++],q)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function b(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function V(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{a.active||(e.textContent=""),K(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var S=require("@fluixi/reactive/signal");var te="__FX_DATA__";var M;function B(){let n=globalThis.__FX_DATA__;if(n)return n;if(M!==void 0)return M;let e=null;if(typeof document<"u"){let t=document.getElementById(te)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return M=e}function A(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var oe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),v=typeof process<"u"&&process.env&&!1;function C(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 re(n){A();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(oe.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(v&&e&&C(`<${n}>`,e),null)}function ie(n){A();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(a.cursor=e.nextSibling,e):(v&&e&&C(`<${n}> (static)`,e),null)}function se(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}A();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(v&&e&&C(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function fe(n){A();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(v&&e&&C(`marker <!--${n.slice(0,24)}-->`,e),null)}var X=!1;function ue(){X||(X=!0,j({hydrateElement:re,hydrateText:se,hydrateMarker:fe,hydrateStatic:ie}))}function ae(n,e,t){ue(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=B(),c=t?.resourceNamespace,f=0;(0,S.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,S.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return V(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}
@@ -1 +1 @@
1
- {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAmIA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
1
+ {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAsJA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
@@ -71,6 +71,25 @@ function hydrateElement(tag) {
71
71
  warnMismatch(`<${tag}>`, c);
72
72
  return null;
73
73
  }
74
+ /**
75
+ * Adopt a whole static subtree at the cursor without descending into it.
76
+ *
77
+ * A compiler-emitted template is inert by construction — the analysis only marks a
78
+ * subtree static when nothing inside it can change — so the server's markup for it is
79
+ * exactly the template. There is nothing in there to hydrate, and stepping through it
80
+ * element by element would only give the cursor more chances to desynchronise.
81
+ */
82
+ function hydrateStatic(tag) {
83
+ recoverCursor();
84
+ const c = hydration.cursor;
85
+ if (c && c.nodeType === 1 && c.tagName.toLowerCase() === tag.toLowerCase()) {
86
+ hydration.cursor = c.nextSibling;
87
+ return c;
88
+ }
89
+ if (DEV && c)
90
+ warnMismatch(`<${tag}> (static)`, c);
91
+ return null;
92
+ }
74
93
  /** Reuse the text node at the cursor (syncing its value) and advance. */
75
94
  function hydrateText(value) {
76
95
  if (value === '') {
@@ -119,7 +138,7 @@ function ensureWalker() {
119
138
  if (_walkerRegistered)
120
139
  return;
121
140
  _walkerRegistered = true;
122
- registerHydrationWalker({ hydrateElement, hydrateText, hydrateMarker });
141
+ registerHydrationWalker({ hydrateElement, hydrateText, hydrateMarker, hydrateStatic });
123
142
  }
124
143
  /**
125
144
  * Hydrate `element` over the server-rendered markup already in `container`: reuse the
@@ -1 +1 @@
1
- import{isSignal as h}from"@fluixi/reactive/signal";function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as B,createEffect as de,createRenderEffect as X,createRoot as q,onCleanup as J,readChildren as ye}from"@fluixi/reactive/signal";var M=typeof document>"u";var k=Symbol.for("fluixi.server-node"),L=null;function D(){if(!L)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return L}function w(n){return n!=null&&n[k]===!0?!0:typeof Node<"u"&&n instanceof Node}function R(n){return n!=null&&n[k]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},$=null;function O(n){$=n}function F(){return $}function A(n,e){return a.active&&e.parentNode===n}function H(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function m(n,e=!1){if(M)return D().createText(n);if(a.active&&!e){let t=F()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var g=0,G=200;function U(n,e,t,i,d){let f=i,s=new Map;return X(()=>{let r;if(N(n)&&!h(n)){if(!s.has(n)){g++;try{let o=n();s.set(n,o)}finally{g--}}for(r=s.get(n);typeof r=="function"&&h(r);)r=r()}else for(r=n();typeof r=="function"&&h(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let u=r;g++;try{let l=u();s.set(u,l)}finally{g--}}r=s.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!N(r))break}g++;try{f=T(e,r,t,f,s),d(f)}finally{g--}})}function j(n,e,t,i){if(g>G)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=m("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){g++;try{d=T(n,e,t,null)}finally{g--}return()=>d}let r=U(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function T(n,e,t,i,d){if(e==null||typeof e=="boolean")return E(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,i,t);if(b(e)){let s=m("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),E(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&T(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=m(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=E(n,i,t)}if(i&&R(i))return i.data=e,i;let s=m(e);return i&&i.parentNode===n?n.replaceChild(s,i):A(n,s)||p(n,s,t),s}if(w(e))return A(n,e)?(H(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),E(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];x(e,s,n,t,!0,d,o);let u=z(n,r,s,t);for(let l of o){let c=j(n,l.sig,l.marker);J(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return T(n,o,t,i)}}}return E(n,i,t)}function x(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!b(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(N(o)&&!h(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!b(u)&&!h(u)&&!N(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(h(u)){if(s){let c=m("",!0);e.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?x(l,e,t,i,d,f):x([l],e,t,i,d,f);continue}continue}Array.isArray(u)?x(u,e,t,i,d,f,s):x([u],e,t,i,d,f,s);continue}if(b(o)){let u=m("",!0);e.push(u),o.then(l=>{if(u.parentNode){let c=[];if(x([l],c,u.parentNode,void 0,!1,f),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){x(o,e,t,i,d,f,s);continue}if(w(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?x(l,e,t,i,!1,f):x([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(m(u));continue}e.push(m(String(o)))}}}}function z(n,e,t,i){for(let c=0;c<t.length;c++)t[c].parentNode!==null&&t[c].parentNode!==n&&(t=t.slice(),t[c]=t[c].cloneNode(!0));let d=t.length,f=e.length,s=d,r=0,o=0,u=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,S=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+S);)S++;if(S>c-o){let V=e[r];for(;o<c;)p(n,t[o++],V)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function b(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function W(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return q(s=>{B(()=>{a.active||(e.textContent=""),j(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as Q,setServerDataGetter as Z}from"@fluixi/reactive/signal";var Y="__FX_DATA__";var v;function I(){let n=globalThis.__FX_DATA__;if(n)return n;if(v!==void 0)return v;let e=null;if(typeof document<"u"){let t=document.getElementById(Y)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return v=e}function C(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),P=typeof process<"u"&&process.env&&!1;function _(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 ne(n){C();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ee.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(P&&e&&_(`<${n}>`,e),null)}function te(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}C();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(P&&e&&_(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function oe(n){C();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(P&&e&&_(`marker <!--${n.slice(0,24)}-->`,e),null)}var K=!1;function re(){K||(K=!0,O({hydrateElement:ne,hydrateText:te,hydrateMarker:oe}))}function Se(n,e,t){re(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=I(),d=t?.resourceNamespace,f=0;Q(()=>d?`${d}:r${f++}`:`r${f++}`),Z(i?s=>s in i?{value:i[s]}:void 0:null);try{return W(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}export{Se as hydrate};
1
+ import{isSignal as h}from"@fluixi/reactive/signal";function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as B,createEffect as pe,createRenderEffect as X,createRoot as q,onCleanup as J,readChildren as he}from"@fluixi/reactive/signal";var k=typeof document>"u";var M=Symbol.for("fluixi.server-node"),L=null;function R(){if(!L)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return L}function C(n){return n!=null&&n[M]===!0?!0:typeof Node<"u"&&n instanceof Node}function D(n){return n!=null&&n[M]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},$=null;function H(n){$=n}function O(){return $}function P(n,e){return a.active&&e.parentNode===n}function F(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function m(n,e=!1){if(k)return R().createText(n);if(a.active&&!e){let t=O()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var g=0,U=200;function G(n,e,t,i,d){let f=i,s=new Map;return X(()=>{let r;if(N(n)&&!h(n)){if(!s.has(n)){g++;try{let o=n();s.set(n,o)}finally{g--}}for(r=s.get(n);typeof r=="function"&&h(r);)r=r()}else for(r=n();typeof r=="function"&&h(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let u=r;g++;try{let l=u();s.set(u,l)}finally{g--}}r=s.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!N(r))break}g++;try{f=T(e,r,t,f,s),d(f)}finally{g--}})}function j(n,e,t,i){if(g>U)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=m("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){g++;try{d=T(n,e,t,null)}finally{g--}return()=>d}let r=G(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function T(n,e,t,i,d){if(e==null||typeof e=="boolean")return E(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,i,t);if(b(e)){let s=m("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),E(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&T(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=m(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=E(n,i,t)}if(i&&D(i))return i.data=e,i;let s=m(e);return i&&i.parentNode===n?n.replaceChild(s,i):P(n,s)||p(n,s,t),s}if(C(e))return P(n,e)?(F(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),E(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];x(e,s,n,t,!0,d,o);let u=z(n,r,s,t);for(let l of o){let c=j(n,l.sig,l.marker);J(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return T(n,o,t,i)}}}return E(n,i,t)}function x(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!b(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(N(o)&&!h(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!b(u)&&!h(u)&&!N(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(h(u)){if(s){let c=m("",!0);e.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?x(l,e,t,i,d,f):x([l],e,t,i,d,f);continue}continue}Array.isArray(u)?x(u,e,t,i,d,f,s):x([u],e,t,i,d,f,s);continue}if(b(o)){let u=m("",!0);e.push(u),o.then(l=>{if(u.parentNode){let c=[];if(x([l],c,u.parentNode,void 0,!1,f),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){x(o,e,t,i,d,f,s);continue}if(C(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?x(l,e,t,i,!1,f):x([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(m(u));continue}e.push(m(String(o)))}}}}function z(n,e,t,i){for(let c=0;c<t.length;c++)t[c].parentNode!==null&&t[c].parentNode!==n&&(t=t.slice(),t[c]=t[c].cloneNode(!0));let d=t.length,f=e.length,s=d,r=0,o=0,u=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,v=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+v);)v++;if(v>c-o){let V=e[r];for(;o<c;)p(n,t[o++],V)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function b(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function W(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return q(s=>{B(()=>{a.active||(e.textContent=""),j(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as Q,setServerDataGetter as Z}from"@fluixi/reactive/signal";var Y="__FX_DATA__";var _;function I(){let n=globalThis.__FX_DATA__;if(n)return n;if(_!==void 0)return _;let e=null;if(typeof document<"u"){let t=document.getElementById(Y)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return _=e}function w(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),S=typeof process<"u"&&process.env&&!1;function A(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 ne(n){w();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ee.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(S&&e&&A(`<${n}>`,e),null)}function te(n){w();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(a.cursor=e.nextSibling,e):(S&&e&&A(`<${n}> (static)`,e),null)}function oe(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}w();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(S&&e&&A(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function re(n){w();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(S&&e&&A(`marker <!--${n.slice(0,24)}-->`,e),null)}var K=!1;function ie(){K||(K=!0,H({hydrateElement:ne,hydrateText:oe,hydrateMarker:re,hydrateStatic:te}))}function Ae(n,e,t){ie(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=I(),d=t?.resourceNamespace,f=0;Q(()=>d?`${d}:r${f++}`:`r${f++}`),Z(i?s=>s in i?{value:i[s]}:void 0:null);try{return W(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}export{Ae as hydrate};