@fluixi/dom 1.0.0-alpha.73 → 1.0.0-alpha.75

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 (39) 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.mjs +1 -1
  6. package/dist/lib/dom/dynamic-element.cjs +1 -1
  7. package/dist/lib/dom/dynamic-element.mjs +1 -1
  8. package/dist/lib/dom/hydration.cjs +1 -1
  9. package/dist/lib/dom/hydration.mjs +1 -1
  10. package/dist/lib/dom/index.cjs +1 -1
  11. package/dist/lib/dom/index.mjs +1 -1
  12. package/dist/lib/dom/island.cjs +1 -1
  13. package/dist/lib/dom/island.mjs +1 -1
  14. package/dist/lib/dom/runtime.cjs +1 -1
  15. package/dist/lib/dom/runtime.d.ts.map +1 -1
  16. package/dist/lib/dom/runtime.js +6 -1
  17. package/dist/lib/dom/runtime.mjs +1 -1
  18. package/dist/lib/dom/server/index.cjs +1 -1
  19. package/dist/lib/dom/server/index.mjs +1 -1
  20. package/dist/lib/dom/server/render.cjs +1 -1
  21. package/dist/lib/dom/server/render.d.ts.map +1 -1
  22. package/dist/lib/dom/server/render.js +12 -0
  23. package/dist/lib/dom/server/render.mjs +1 -1
  24. package/dist/lib/dom/server-renderer.cjs +1 -1
  25. package/dist/lib/dom/server-renderer.mjs +1 -1
  26. package/dist/lib/dom/versions.cjs +1 -1
  27. package/dist/lib/dom/versions.mjs +1 -1
  28. package/dist/lib/flow/index.cjs +1 -1
  29. package/dist/lib/flow/index.mjs +1 -1
  30. package/dist/lib/flow/portal.cjs +1 -1
  31. package/dist/lib/flow/portal.mjs +1 -1
  32. package/dist/lib/index.cjs +1 -1
  33. package/dist/lib/index.mjs +1 -1
  34. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  35. package/dist/version.generated.cjs +1 -1
  36. package/dist/version.generated.d.ts +1 -1
  37. package/dist/version.generated.js +1 -1
  38. package/dist/version.generated.mjs +1 -1
  39. package/package.json +3 -3
@@ -462,7 +462,12 @@ export function insert(parent, accessor, marker, init) {
462
462
  if (typeof accessor !== 'function' && !isReactiveArray(accessor)) {
463
463
  _insertDepth++;
464
464
  try {
465
- current = insertExpression(parent, accessor, marker, null);
465
+ // `current` not null. The caller passes what is already in this slot, and for a
466
+ // hydrating template hole that is the server's own nodes (`holeContent`). Dropping it
467
+ // meant a static value never adopted: insertExpression saw an empty slot and appended
468
+ // a second copy beside the server's, so `{cmd}` rendered the string twice.
469
+ // Without an `init` this is null anyway, so nothing else changes.
470
+ current = insertExpression(parent, accessor, marker, current);
466
471
  }
467
472
  finally {
468
473
  _insertDepth--;
@@ -1 +1 @@
1
- import{isSignal as m}from"@fluixi/reactive/signal";var k="http://www.w3.org/2000/svg";function ue(e){return e.localName.includes("-")}function I(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ue(e)){e[t]=n;return}T(e,t,n,o)}var V=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);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 Ae=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var z="1.0.0-alpha.73";import{VERSION as ce}from"@fluixi/reactive";var x={dom:z,reactive:ce};function X(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function J(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ne,createEffect as C,createRenderEffect as y,createRoot as pe,onCleanup as S,readChildren as ye}from"@fluixi/reactive/signal";var v=typeof document>"u";var W=Symbol.for("fluixi.server-node"),U=null;function L(){if(!U)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return U}function A(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function Y(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Z(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},de=null;function P(){return de}function K(e,t){return d.active&&t.parentNode===e}function Q(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function B(e,t){if(!e||e.parentNode==null)return t();let n=d.active,o=d.cursor,s=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=o,d.parents=s}}function ge(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 o=0,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function me(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 Ke(e){return me(ge(e))}var Be=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var ee=new Map,R=new Set,D=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function oe(e){if(!v)for(let t of e)R.has(t)||D.has(t)||(R.add(t),document.addEventListener(t,he))}function he(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 Ee(e,t,n){if(e[`$$${t}`]=n,D.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}R.has(t)||oe([t])}function te(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function qe(e){return!D.has(e)}function Ge(e){return typeof e=="function"}function N(e,t=!1){if(v)return L().createText(e);if(d.active&&!t){let n=P()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ze(e,t=!1){if(v)return L().createElement(e,t);if(d.active){let n=P()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(k,e):document.createElement(e)}function be(e,t=!1){let n=ee.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ee.set(e,o),o}function Xe(e,t,n=!1,o=!1){if(v){let s=L();return n?s.parseTemplate(e,o):s.createRaw(e)}if(d.active){let s=P()?.hydrateStatic(t);if(s)return s}return Ne(be(e,o),o).firstChild}function Je(e,t){if(!d.active)return t();let n=B(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>d.active?B(e.nextSibling,()=>o(...s)):o(...s))}return n}function Ue(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 Ye(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ne(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Te(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Te(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ze(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Qe(e){if(m(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!h(t);)t=t();return t}var b=0,we=200;function Se(e,t,n,o,s){let a=o,f=new Map;return y(()=>{let r;if(h(e)&&!m(e)){if(!f.has(e)){b++;try{let i=e();f.set(e,i)}finally{b--}}for(r=f.get(e);typeof r=="function"&&m(r);)r=r()}else for(r=e();typeof r=="function"&&m(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!f.has(r)){let l=r;b++;try{let u=l();f.set(l,u)}finally{b--}}r=f.get(r)}else if(m(r))r=r();else if(r=r(),typeof r!="function"||!m(r)&&!h(r))break}b++;try{a=O(t,r,n,a,f),s(a)}finally{b--}})}function ie(e,t,n,o){if(b>we)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){b++;try{s=O(e,t,n,null)}finally{b--}return()=>s}let r=Se(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function O(e,t,n,o,s){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(M(t)){let f=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),w(e,o.slice(1),n)):g(e,f,n):o?e.replaceChild(f,o):g(e,f,n),t.then(r=>{f.parentNode===e&&O(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&Z(o))return o.data=t,o;let f=N(t);return o&&o.parentNode===e?e.replaceChild(f,o):K(e,f)||g(e,f,n),f}if(A(t))return K(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];E(t,f,e,n,!0,s,i);let l=ve(e,r,f,n);for(let u of i){let c=ie(e,u.sig,u.marker);S(()=>{w(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;if("type"in f&&"props"in f){let r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return O(e,i,n,o)}}}return w(e,o,n)}function E(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!M(i)&&!m(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(h(i)&&!m(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!M(l)&&!m(l)&&!h(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(f){let c=N("",!0);t.push(c),f.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)?E(u,t,n,o,s,a):E([u],t,n,o,s,a);continue}continue}Array.isArray(l)?E(l,t,n,o,s,a,f):E([l],t,n,o,s,a,f);continue}if(M(i)){let l=N("",!0);t.push(l),i.then(u=>{if(l.parentNode){let c=[];if(E([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let p=1;p<c.length;p++)l.parentNode?.insertBefore(c[p],c[p-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(i)){E(i,t,n,o,s,a,f);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?E(u,t,n,o,!1,a):E([u],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(N(l));continue}t.push(N(String(i)))}}}}function ve(e,t,n,o){for(let c=0;c<n.length;c++){let p=n[c].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let s=n.length,a=t.length,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let c=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)g(e,n[i++],c)}else if(f===i)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--f],c),t[a]=t[r-1]}else{if(!u){u=new Map;let p=i;for(;p<f;)u.set(n[p],p++)}let c=u.get(t[r]);if(c!=null)if(i<c&&c<f){let p=r,_=1;for(;++p<a&&p<f&&!(!u.has(t[p])||u.get(t[p])!==c+_);)_++;if(_>c-i){let le=t[r];for(;i<c;)g(e,n[i++],le)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function w(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 g(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function H(e,t,n){n==null?delete e[t]:e[t]=n}function re(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 se(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 q(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):y(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function G(e,t,n){return typeof n!="function"?(H(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;H(e,t,o)})}function fe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):y(()=>{let o=n();T(e,t,!!o)})}function $(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>$(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 j(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(y(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function F(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 et(e){let{element:t,props:n,prevProps:o=xe,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!Y(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===k,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],u=o[i];if(l===u)continue;if(i==="ref"){ae(l,t);continue}if(i==="use"){se(t,l);continue}if(i.startsWith("on:")){r.push(re(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(G(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(q(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(fe(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push(y(()=>$(t,l()))):$(t,l);continue}if(i==="classList"){typeof l=="function"?r.push(y(()=>j(t,l()))):j(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push(y(()=>F(t,l()))):F(t,l);continue}if(i.startsWith("on")){let p=i.slice(2).toLowerCase();u&&te(t,p),l&&Ee(t,p,l);continue}let c=V.has(i)||!f&&i in t;typeof l=="function"?r.push(c?G(t,i,l):q(t,i,l,f)):r.push(y(()=>c?H(t,i,n[i]):T(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();te(t,l)}else V.has(i)?H(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function tt(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){ae(s,e);continue}if(o!=="children"){if(o==="use"){se(e,s);continue}if(o.startsWith("on:")){re(e,o.slice(3),s);continue}if(o.startsWith("prop:")){G(e,o.slice(5),s);continue}if(o.startsWith("attr:")){q(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){fe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(D.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,R.has(a)||oe([a]);continue}if(o==="class"||o==="className"){$(e,s);continue}if(o==="classList"){typeof s=="function"?y(()=>j(e,s())):j(e,s);continue}if(o==="style"){typeof s=="function"?y(()=>F(e,s())):F(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});S(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});S(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});S(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=C(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});S(()=>{f()})}else{let a=!0;y(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();I(e,o,f,n)});S(()=>{a()})}else y(()=>I(e,o,t[o],n))}}}function nt(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function ot(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function ae(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 it(e,t,n){let o=t||document.body,s=ye(()=>e),a=[];return ne(()=>{let f=y(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),S(()=>{a.forEach(r=>r())})}),null}function rt(e){return typeof e=="string"&&e.toLowerCase()===e}function st(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 ft(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function at(e){return typeof e=="function"&&e.length===0&&m(e)}function lt(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return pe(f=>{ne(()=>{d.active||(t.textContent=""),X(t),J(),ie(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}export{Ee as addDelegatedEventListener,re as addNativeEventListener,tt as applyProps,se as applyUse,w as cleanChildren,Ne as cloneTemplate,ze as createNativeElement,it as createPortal,be as createTemplate,oe as delegateEvents,ft as escapeHTML,Ze as fnName,Be as generateID,Ke as getStableElementId,ae as handleRef,Ye as holeContent,Ue as holeEnd,Je as holeScope,ie as insert,O as insertExpression,at as isAccessor,qe as isDelegatedEvent,Ge as isFunction,rt as isNativeElement,M as isPromise,st as isSVGElement,Qe as iterateFn,Te as makeArrayFlat,nt as mergeProps,te as removeDelegatedEventListener,lt as render,j as setClassList,$ as setClassName,q as setDynamicAttribute,fe as setDynamicBoolAttribute,G as setDynamicProperty,H as setProperty,F as setStyle,ot as splitProps,et as spread,Xe as templateNode};
1
+ import{isSignal as m}from"@fluixi/reactive/signal";var k="http://www.w3.org/2000/svg";function ue(e){return e.localName.includes("-")}function I(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ue(e)){e[t]=n;return}T(e,t,n,o)}var V=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);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 Ae=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var z="1.0.0-alpha.75";import{VERSION as ce}from"@fluixi/reactive";var x={dom:z,reactive:ce};function X(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function J(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ne,createEffect as C,createRenderEffect as y,createRoot as pe,onCleanup as S,readChildren as ye}from"@fluixi/reactive/signal";var v=typeof document>"u";var W=Symbol.for("fluixi.server-node"),U=null;function L(){if(!U)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return U}function A(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function Y(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Z(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},de=null;function P(){return de}function K(e,t){return d.active&&t.parentNode===e}function Q(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function B(e,t){if(!e||e.parentNode==null)return t();let n=d.active,o=d.cursor,s=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=o,d.parents=s}}function ge(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 o=0,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function me(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 Ke(e){return me(ge(e))}var Be=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var ee=new Map,R=new Set,D=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function oe(e){if(!v)for(let t of e)R.has(t)||D.has(t)||(R.add(t),document.addEventListener(t,he))}function he(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 Ee(e,t,n){if(e[`$$${t}`]=n,D.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}R.has(t)||oe([t])}function te(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function qe(e){return!D.has(e)}function Ge(e){return typeof e=="function"}function N(e,t=!1){if(v)return L().createText(e);if(d.active&&!t){let n=P()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ze(e,t=!1){if(v)return L().createElement(e,t);if(d.active){let n=P()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(k,e):document.createElement(e)}function be(e,t=!1){let n=ee.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ee.set(e,o),o}function Xe(e,t,n=!1,o=!1){if(v){let s=L();return n?s.parseTemplate(e,o):s.createRaw(e)}if(d.active){let s=P()?.hydrateStatic(t);if(s)return s}return Ne(be(e,o),o).firstChild}function Je(e,t){if(!d.active)return t();let n=B(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>d.active?B(e.nextSibling,()=>o(...s)):o(...s))}return n}function Ue(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 Ye(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ne(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Te(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Te(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ze(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Qe(e){if(m(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!h(t);)t=t();return t}var b=0,we=200;function Se(e,t,n,o,s){let a=o,f=new Map;return y(()=>{let r;if(h(e)&&!m(e)){if(!f.has(e)){b++;try{let i=e();f.set(e,i)}finally{b--}}for(r=f.get(e);typeof r=="function"&&m(r);)r=r()}else for(r=e();typeof r=="function"&&m(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!f.has(r)){let l=r;b++;try{let u=l();f.set(l,u)}finally{b--}}r=f.get(r)}else if(m(r))r=r();else if(r=r(),typeof r!="function"||!m(r)&&!h(r))break}b++;try{a=O(t,r,n,a,f),s(a)}finally{b--}})}function ie(e,t,n,o){if(b>we)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){b++;try{s=O(e,t,n,s)}finally{b--}return()=>s}let r=Se(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function O(e,t,n,o,s){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(M(t)){let f=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),w(e,o.slice(1),n)):g(e,f,n):o?e.replaceChild(f,o):g(e,f,n),t.then(r=>{f.parentNode===e&&O(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&Z(o))return o.data=t,o;let f=N(t);return o&&o.parentNode===e?e.replaceChild(f,o):K(e,f)||g(e,f,n),f}if(A(t))return K(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];E(t,f,e,n,!0,s,i);let l=ve(e,r,f,n);for(let u of i){let c=ie(e,u.sig,u.marker);S(()=>{w(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;if("type"in f&&"props"in f){let r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return O(e,i,n,o)}}}return w(e,o,n)}function E(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!M(i)&&!m(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(h(i)&&!m(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!M(l)&&!m(l)&&!h(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(f){let c=N("",!0);t.push(c),f.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)?E(u,t,n,o,s,a):E([u],t,n,o,s,a);continue}continue}Array.isArray(l)?E(l,t,n,o,s,a,f):E([l],t,n,o,s,a,f);continue}if(M(i)){let l=N("",!0);t.push(l),i.then(u=>{if(l.parentNode){let c=[];if(E([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let p=1;p<c.length;p++)l.parentNode?.insertBefore(c[p],c[p-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(i)){E(i,t,n,o,s,a,f);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?E(u,t,n,o,!1,a):E([u],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(N(l));continue}t.push(N(String(i)))}}}}function ve(e,t,n,o){for(let c=0;c<n.length;c++){let p=n[c].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let s=n.length,a=t.length,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let c=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)g(e,n[i++],c)}else if(f===i)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--f],c),t[a]=t[r-1]}else{if(!u){u=new Map;let p=i;for(;p<f;)u.set(n[p],p++)}let c=u.get(t[r]);if(c!=null)if(i<c&&c<f){let p=r,_=1;for(;++p<a&&p<f&&!(!u.has(t[p])||u.get(t[p])!==c+_);)_++;if(_>c-i){let le=t[r];for(;i<c;)g(e,n[i++],le)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function w(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 g(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function H(e,t,n){n==null?delete e[t]:e[t]=n}function re(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 se(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 q(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):y(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function G(e,t,n){return typeof n!="function"?(H(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;H(e,t,o)})}function fe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):y(()=>{let o=n();T(e,t,!!o)})}function $(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>$(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 j(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(y(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function F(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 et(e){let{element:t,props:n,prevProps:o=xe,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!Y(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===k,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],u=o[i];if(l===u)continue;if(i==="ref"){ae(l,t);continue}if(i==="use"){se(t,l);continue}if(i.startsWith("on:")){r.push(re(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(G(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(q(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(fe(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push(y(()=>$(t,l()))):$(t,l);continue}if(i==="classList"){typeof l=="function"?r.push(y(()=>j(t,l()))):j(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push(y(()=>F(t,l()))):F(t,l);continue}if(i.startsWith("on")){let p=i.slice(2).toLowerCase();u&&te(t,p),l&&Ee(t,p,l);continue}let c=V.has(i)||!f&&i in t;typeof l=="function"?r.push(c?G(t,i,l):q(t,i,l,f)):r.push(y(()=>c?H(t,i,n[i]):T(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();te(t,l)}else V.has(i)?H(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function tt(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){ae(s,e);continue}if(o!=="children"){if(o==="use"){se(e,s);continue}if(o.startsWith("on:")){re(e,o.slice(3),s);continue}if(o.startsWith("prop:")){G(e,o.slice(5),s);continue}if(o.startsWith("attr:")){q(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){fe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(D.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,R.has(a)||oe([a]);continue}if(o==="class"||o==="className"){$(e,s);continue}if(o==="classList"){typeof s=="function"?y(()=>j(e,s())):j(e,s);continue}if(o==="style"){typeof s=="function"?y(()=>F(e,s())):F(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});S(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});S(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});S(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=C(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});S(()=>{f()})}else{let a=!0;y(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();I(e,o,f,n)});S(()=>{a()})}else y(()=>I(e,o,t[o],n))}}}function nt(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function ot(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function ae(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 it(e,t,n){let o=t||document.body,s=ye(()=>e),a=[];return ne(()=>{let f=y(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),S(()=>{a.forEach(r=>r())})}),null}function rt(e){return typeof e=="string"&&e.toLowerCase()===e}function st(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 ft(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function at(e){return typeof e=="function"&&e.length===0&&m(e)}function lt(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return pe(f=>{ne(()=>{d.active||(t.textContent=""),X(t),J(),ie(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}export{Ee as addDelegatedEventListener,re as addNativeEventListener,tt as applyProps,se as applyUse,w as cleanChildren,Ne as cloneTemplate,ze as createNativeElement,it as createPortal,be as createTemplate,oe as delegateEvents,ft as escapeHTML,Ze as fnName,Be as generateID,Ke as getStableElementId,ae as handleRef,Ye as holeContent,Ue as holeEnd,Je as holeScope,ie as insert,O as insertExpression,at as isAccessor,qe as isDelegatedEvent,Ge as isFunction,rt as isNativeElement,M as isPromise,st as isSVGElement,Qe as iterateFn,Te as makeArrayFlat,nt as mergeProps,te as removeDelegatedEventListener,lt as render,j as setClassList,$ as setClassName,q as setDynamicAttribute,fe as setDynamicBoolAttribute,G as setDynamicProperty,H as setProperty,F as setStyle,ot as splitProps,et as spread,Xe as templateNode};
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var we=(e,n)=>{for(var t in n)_(e,t,{get:n[t],enumerable:!0})},Se=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ve(n))!Ne.call(e,s)&&s!==t&&_(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var ye=e=>Se(_({},"__esModule",{value:!0}),e);var Me={};we(Me,{FX_DATA_ID:()=>E,ServerComment:()=>v,ServerElement:()=>m,ServerNode:()=>g,ServerText:()=>h,createRequestContext:()=>C,escapeFxJson:()=>O,getLocals:()=>le,getRequestContext:()=>w,getRequestEvent:()=>z,getRequestLocals:()=>X,getServerData:()=>re,isDomElement:()=>B,isDomNode:()=>G,isDomText:()=>K,isServer:()=>S,isServerNodeValue:()=>Y,renderToString:()=>fe,renderToStringAsync:()=>he,runWithRequestContext:()=>q,serializeNode:()=>f,serializeResourceData:()=>J,setDataRedactor:()=>ge,setRequestStore:()=>ue,setServerMode:()=>N});module.exports=ye(Me);var S=typeof document>"u";function N(e){S=e}var b=Symbol.for("fluixi.server-node"),Te=null;function U(e){Te=e}function G(e){return e!=null&&e[b]===!0?!0:typeof Node<"u"&&e instanceof Node}function B(e){return e!=null&&e[b]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function K(e){return e!=null&&e[b]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var k=1,I=3,j=8,Q;Q=b;var g=class{constructor(){this[Q]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=I;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class e extends g{constructor(t){super();this.nodeType=k;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends g{constructor(t){super();this.nodeType=j;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},L=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},$=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=k;this.attributes=new Map;this.style=new L;this.classList=new $(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function Y(e){return e instanceof g}var Re=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ee=/&/g,te=/</g,ne=/>/g,be=/"/g;function H(e){return e.replace(ee,"&amp;").replace(te,"&lt;").replace(ne,"&gt;")}function Z(e){return e.replace(ee,"&amp;").replace(be,"&quot;").replace(te,"&lt;").replace(ne,"&gt;")}function Ee(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function Ce(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${Ee(t)}: ${r}`)}return n.join("; ")}function qe(e){let n="",t=Ce(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${Z(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${Z(s)}"`}return n}function f(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return H(e);if(typeof e=="number")return H(String(e));if(typeof e=="function")return f(e());if(Array.isArray(e))return e.map(f).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case I:return H(e.data??"");case j:return`<!--${e.data??""}-->`;case k:{let n=e.localName,t=`<${n}${qe(e)}>`;if(Re.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(f).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(f).join(""):""}var E="__FX_DATA__";function O(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var F;function re(){let e=globalThis.__FX_DATA__;if(e)return e;if(F!==void 0)return F;let n=null;if(typeof document<"u"){let t=document.getElementById(E)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return F=n}var P=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ke={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function se(e){return e.replace(/&(#?\w+);/g,(n,t)=>ke[t]??n)}var d=class extends Error{};function oe(e,n=!1){let t=0,r=[],s=[],u=o=>{let a=s[s.length-1];a?a.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){p(e.slice(t));break}if(o>t&&p(e.slice(t,o)),e.startsWith("<!--",o)){let a=e.indexOf("-->",o);if(a===-1)throw new d(`unterminated comment at ${o}`);u(new v(e.slice(o+4,a))),t=a+3;continue}if(e[o+1]==="/"){let a=e.indexOf(">",o);if(a===-1)throw new d(`unterminated closing tag at ${o}`);let T=e.slice(o+2,a).trim().toLowerCase(),x=s.pop();if(!x||x.localName!==T)throw new d(`</${T}> does not close <${x?.localName??"nothing"}>`);t=a+1;continue}t=y(o)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function p(o){o!==""&&u(new h(se(o)))}function y(o){let a=/[\s/>]/.exec(e.slice(o+1));if(!a)throw new d(`unterminated tag at ${o}`);let T=e.slice(o+1,o+1+a.index).toLowerCase(),x=new m(T,n),i=o+1+a.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let me=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let R=e.slice(me,i);if(R==="")throw new d(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new d(`attribute ${R} must have a double-quoted value`);let M=e.indexOf('"',i+2);if(M===-1)throw new d(`unterminated value for ${R}`);x.setAttribute(R,se(e.slice(i+2,M))),i=M+1}else x.setAttribute(R,"")}return u(x),Ae.has(T)||s.push(x),i}}var D,ae={getStore:()=>D,run(e,n){let t=D;D=e;try{return n()}finally{D=t}}},V=ae;function ue(e){V=e??ae}function C(e={}){e.locals||(e.locals=e.request?X(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let p=u.get(l)??0;return u.set(l,p+1),`${l}#${p}`},withResourceScope(l,p){let y=r;r=l;try{return p()}finally{r=y}},pending:new Set,data:new Map}}function q(e,n){return V.run(e,n)}function w(){return V.getStore()}function z(){return w()?.event}function le(){let e=z();return e?(e.locals||(e.locals={}),e.locals):{}}var ie=new WeakMap;function X(e){let n=ie.get(e);return n||(n={},ie.set(e,n)),n}var ce=!1;function pe(){ce||(ce=!0,U({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new A(e),parseTemplate:(e,n)=>oe(e,n),createComment:e=>new v(e)}))}function fe(e,n={}){let t=S;pe(),N(!0);let r=C(n.event);try{return q(r,()=>(0,P.createRoot)(s=>{try{let u=typeof e=="function"?e():e;return f(u)}finally{s()}}))}finally{N(t)}}var de=!1;function Oe(){de||(de=!0,(0,c.setResourceTracker)(e=>{w()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>w()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&w()?.data.set(e,n)}))}var W=null;function ge(e){W=e}function J(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if(W)try{u=W(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=O(JSON.stringify(n));return`<script type="application/json" id="${E}">${t}<\/script>`}var De=50;async function he(e,n={}){let t=S;pe(),N(!0),Oe();let r=C(n.event);try{return await q(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};(0,P.createRoot)(a=>{l=a,u=(0,c.getOwner)(),s=typeof e=="function"?e():e});let p=()=>{try{(0,c.runWithOwner)(u,()=>f(s))}catch{}};p();let y=0;for(;r.pending.size>0&&y++<De;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await(0,c.flush)(),p()}let o=(0,c.runWithOwner)(u,()=>f(s))+J(r);return l(),o})}finally{N(t)}}
1
+ "use strict";var _=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var we=(e,n)=>{for(var t in n)_(e,t,{get:n[t],enumerable:!0})},Se=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ve(n))!Ne.call(e,s)&&s!==t&&_(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var ye=e=>Se(_({},"__esModule",{value:!0}),e);var Me={};we(Me,{FX_DATA_ID:()=>E,ServerComment:()=>v,ServerElement:()=>m,ServerNode:()=>g,ServerText:()=>h,createRequestContext:()=>C,escapeFxJson:()=>O,getLocals:()=>le,getRequestContext:()=>w,getRequestEvent:()=>z,getRequestLocals:()=>X,getServerData:()=>re,isDomElement:()=>B,isDomNode:()=>G,isDomText:()=>K,isServer:()=>S,isServerNodeValue:()=>Y,renderToString:()=>fe,renderToStringAsync:()=>he,runWithRequestContext:()=>q,serializeNode:()=>f,serializeResourceData:()=>J,setDataRedactor:()=>ge,setRequestStore:()=>ue,setServerMode:()=>N});module.exports=ye(Me);var S=typeof document>"u";function N(e){S=e}var b=Symbol.for("fluixi.server-node"),Te=null;function U(e){Te=e}function G(e){return e!=null&&e[b]===!0?!0:typeof Node<"u"&&e instanceof Node}function B(e){return e!=null&&e[b]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function K(e){return e!=null&&e[b]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var k=1,I=3,j=8,Q;Q=b;var g=class{constructor(){this[Q]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=I;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class e extends g{constructor(t){super();this.nodeType=k;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends g{constructor(t){super();this.nodeType=j;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},L=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},$=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=k;this.attributes=new Map;this.style=new L;this.classList=new $(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function Y(e){return e instanceof g}var Re=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ee=/&/g,te=/</g,ne=/>/g,be=/"/g;function H(e){return e.replace(ee,"&amp;").replace(te,"&lt;").replace(ne,"&gt;")}function Z(e){return e.replace(ee,"&amp;").replace(be,"&quot;").replace(te,"&lt;").replace(ne,"&gt;")}function Ee(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function Ce(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${Ee(t)}: ${r}`)}return n.join("; ")}function qe(e){let n="",t=Ce(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${Z(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${Z(s)}"`}return n}function f(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return H(e);if(typeof e=="number")return H(String(e));if(typeof e=="function")return f(e());if(Array.isArray(e))return e.map(f).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case I:return H(e.data??"");case j:return`<!--${e.data??""}-->`;case k:{let n=e.localName,t=`<${n}${qe(e)}>`;if(Re.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(f).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(f).join(""):""}var E="__FX_DATA__";function O(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var F;function re(){let e=globalThis.__FX_DATA__;if(e)return e;if(F!==void 0)return F;let n=null;if(typeof document<"u"){let t=document.getElementById(E)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return F=n}var P=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ke={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function se(e){return e.replace(/&(#?\w+);/g,(n,t)=>ke[t]??n)}var d=class extends Error{};function oe(e,n=!1){let t=0,r=[],s=[],a=o=>{let u=s[s.length-1];u?u.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){p(e.slice(t));break}if(o>t&&p(e.slice(t,o)),e.startsWith("<!--",o)){let u=e.indexOf("-->",o);if(u===-1)throw new d(`unterminated comment at ${o}`);a(new v(e.slice(o+4,u))),t=u+3;continue}if(e[o+1]==="/"){let u=e.indexOf(">",o);if(u===-1)throw new d(`unterminated closing tag at ${o}`);let T=e.slice(o+2,u).trim().toLowerCase(),x=s.pop();if(!x||x.localName!==T)throw new d(`</${T}> does not close <${x?.localName??"nothing"}>`);t=u+1;continue}t=y(o)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function p(o){o!==""&&a(new h(se(o)))}function y(o){let u=/[\s/>]/.exec(e.slice(o+1));if(!u)throw new d(`unterminated tag at ${o}`);let T=e.slice(o+1,o+1+u.index).toLowerCase(),x=new m(T,n),i=o+1+u.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let me=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let R=e.slice(me,i);if(R==="")throw new d(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new d(`attribute ${R} must have a double-quoted value`);let M=e.indexOf('"',i+2);if(M===-1)throw new d(`unterminated value for ${R}`);x.setAttribute(R,se(e.slice(i+2,M))),i=M+1}else x.setAttribute(R,"")}return a(x),Ae.has(T)||s.push(x),i}}var D,ae={getStore:()=>D,run(e,n){let t=D;D=e;try{return n()}finally{D=t}}},V=ae;function ue(e){V=e??ae}function C(e={}){e.locals||(e.locals=e.request?X(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let p=a.get(l)??0;return a.set(l,p+1),`${l}#${p}`},withResourceScope(l,p){let y=r;r=l;try{return p()}finally{r=y}},pending:new Set,data:new Map}}function q(e,n){return V.run(e,n)}function w(){return V.getStore()}function z(){return w()?.event}function le(){let e=z();return e?(e.locals||(e.locals={}),e.locals):{}}var ie=new WeakMap;function X(e){let n=ie.get(e);return n||(n={},ie.set(e,n)),n}var ce=!1;function pe(){ce||(ce=!0,U({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new A(e),parseTemplate:(e,n)=>oe(e,n),createComment:e=>new v(e)}))}function fe(e,n={}){let t=S;pe(),N(!0);let r=C(n.event);try{return q(r,()=>(0,P.createRoot)(s=>{try{let a=typeof e=="function"?e():e;return f(a)}finally{s()}}))}finally{N(t)}}var de=!1;function Oe(){de||(de=!0,(0,c.setResourceTracker)(e=>{w()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>w()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&w()?.data.set(e,n)}))}var W=null;function ge(e){W=e}function J(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if(W)try{a=W(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=O(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${E}">${t}<\/script>`}var De=50;async function he(e,n={}){let t=S;pe(),N(!0),Oe();let r=C(n.event);try{return await q(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};(0,P.createRoot)(u=>{l=u,a=(0,c.getOwner)(),s=typeof e=="function"?e():e});let p=()=>{try{(0,c.runWithOwner)(a,()=>f(s))}catch{}};p();let y=0;for(;r.pending.size>0&&y++<De;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await(0,c.flush)(),p()}let o=(0,c.runWithOwner)(a,()=>f(s))+J(r);return l(),o})}finally{N(t)}}
@@ -1 +1 @@
1
- var T=typeof document>"u";function v(e){T=e}var R=Symbol.for("fluixi.server-node"),ie=null;function V(e){ie=e}function ae(e){return e!=null&&e[R]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[R]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function le(e){return e!=null&&e[R]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E=1,_=3,L=8,z;z=R;var g=class{constructor(){this[z]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends g{constructor(t){super();this.nodeType=E;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends g{constructor(t){super();this.nodeType=L;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},D=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},M=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=E;this.attributes=new Map;this.style=new D;this.classList=new M(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function ce(e){return e instanceof g}var de=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=/&/g,P=/</g,J=/>/g,pe=/"/g;function $(e){return e.replace(W,"&amp;").replace(P,"&lt;").replace(J,"&gt;")}function X(e){return e.replace(W,"&amp;").replace(pe,"&quot;").replace(P,"&lt;").replace(J,"&gt;")}function fe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ge(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${fe(t)}: ${r}`)}return n.join("; ")}function he(e){let n="",t=ge(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function p(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $(e);if(typeof e=="number")return $(String(e));if(typeof e=="function")return p(e());if(Array.isArray(e))return e.map(p).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case _:return $(e.data??"");case L:return`<!--${e.data??""}-->`;case E:{let n=e.localName,t=`<${n}${he(e)}>`;if(de.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(p).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(p).join(""):""}var C="__FX_DATA__";function j(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var I;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(I!==void 0)return I;let n=null;if(typeof document<"u"){let t=document.getElementById(C)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return I=n}import{createRoot as ne}from"@fluixi/reactive/signal";import{setResourceTracker as Se,setResourceIdSource as ye,setResourceDataSink as Te,getOwner as Re,runWithOwner as Z,flush as be}from"@fluixi/reactive/signal";var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ve={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>ve[t]??n)}var c=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],u=o=>{let a=s[s.length-1];a?a.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){d(e.slice(t));break}if(o>t&&d(e.slice(t,o)),e.startsWith("<!--",o)){let a=e.indexOf("-->",o);if(a===-1)throw new c(`unterminated comment at ${o}`);u(new x(e.slice(o+4,a))),t=a+3;continue}if(e[o+1]==="/"){let a=e.indexOf(">",o);if(a===-1)throw new c(`unterminated closing tag at ${o}`);let S=e.slice(o+2,a).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==S)throw new c(`</${S}> does not close <${f?.localName??"nothing"}>`);t=a+1;continue}t=w(o)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(o){o!==""&&u(new h(U(o)))}function w(o){let a=/[\s/>]/.exec(e.slice(o+1));if(!a)throw new c(`unterminated tag at ${o}`);let S=e.slice(o+1,o+1+a.index).toLowerCase(),f=new m(S,n),i=o+1+a.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let oe=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let y=e.slice(oe,i);if(y==="")throw new c(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new c(`attribute ${y} must have a double-quoted value`);let O=e.indexOf('"',i+2);if(O===-1)throw new c(`unterminated value for ${y}`);f.setAttribute(y,U(e.slice(i+2,O))),i=O+1}else f.setAttribute(y,"")}return u(f),xe.has(S)||s.push(f),i}}var q,K={getStore:()=>q,run(e,n){let t=q;q=e;try{return n()}finally{q=t}}},H=K;function Ne(e){H=e??K}function A(e={}){e.locals||(e.locals=e.request?Y(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=u.get(l)??0;return u.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let w=r;r=l;try{return d()}finally{r=w}},pending:new Set,data:new Map}}function k(e,n){return H.run(e,n)}function N(){return H.getStore()}function Q(){return N()?.event}function we(){let e=Q();return e?(e.locals||(e.locals={}),e.locals):{}}var B=new WeakMap;function Y(e){let n=B.get(e);return n||(n={},B.set(e,n)),n}var ee=!1;function re(){ee||(ee=!0,V({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new x(e)}))}function Ee(e,n={}){let t=T;re(),v(!0);let r=A(n.event);try{return k(r,()=>ne(s=>{try{let u=typeof e=="function"?e():e;return p(u)}finally{s()}}))}finally{v(t)}}var te=!1;function Ce(){te||(te=!0,Se(e=>{N()?.pending.add(e)}),ye(()=>N()?.nextResourceId()??""),Te((e,n)=>{e&&N()?.data.set(e,n)}))}var F=null;function qe(e){F=e}function se(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if(F)try{u=F(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=j(JSON.stringify(n));return`<script type="application/json" id="${C}">${t}<\/script>`}var Ae=50;async function ke(e,n={}){let t=T;re(),v(!0),Ce();let r=A(n.event);try{return await k(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};ne(a=>{l=a,u=Re(),s=typeof e=="function"?e():e});let d=()=>{try{Z(u,()=>p(s))}catch{}};d();let w=0;for(;r.pending.size>0&&w++<Ae;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await be(),d()}let o=Z(u,()=>p(s))+se(r);return l(),o})}finally{v(t)}}export{C as FX_DATA_ID,x as ServerComment,m as ServerElement,g as ServerNode,h as ServerText,A as createRequestContext,j as escapeFxJson,we as getLocals,N as getRequestContext,Q as getRequestEvent,Y as getRequestLocals,me as getServerData,ue as isDomElement,ae as isDomNode,le as isDomText,T as isServer,ce as isServerNodeValue,Ee as renderToString,ke as renderToStringAsync,k as runWithRequestContext,p as serializeNode,se as serializeResourceData,qe as setDataRedactor,Ne as setRequestStore,v as setServerMode};
1
+ var T=typeof document>"u";function v(e){T=e}var R=Symbol.for("fluixi.server-node"),ie=null;function V(e){ie=e}function ae(e){return e!=null&&e[R]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[R]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function le(e){return e!=null&&e[R]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E=1,_=3,L=8,z;z=R;var g=class{constructor(){this[z]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends g{constructor(t){super();this.nodeType=E;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends g{constructor(t){super();this.nodeType=L;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},D=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},M=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=E;this.attributes=new Map;this.style=new D;this.classList=new M(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function ce(e){return e instanceof g}var de=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=/&/g,P=/</g,J=/>/g,pe=/"/g;function $(e){return e.replace(W,"&amp;").replace(P,"&lt;").replace(J,"&gt;")}function X(e){return e.replace(W,"&amp;").replace(pe,"&quot;").replace(P,"&lt;").replace(J,"&gt;")}function fe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ge(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${fe(t)}: ${r}`)}return n.join("; ")}function he(e){let n="",t=ge(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function p(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $(e);if(typeof e=="number")return $(String(e));if(typeof e=="function")return p(e());if(Array.isArray(e))return e.map(p).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case _:return $(e.data??"");case L:return`<!--${e.data??""}-->`;case E:{let n=e.localName,t=`<${n}${he(e)}>`;if(de.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(p).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(p).join(""):""}var C="__FX_DATA__";function j(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var I;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(I!==void 0)return I;let n=null;if(typeof document<"u"){let t=document.getElementById(C)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return I=n}import{createRoot as ne}from"@fluixi/reactive/signal";import{setResourceTracker as Se,setResourceIdSource as ye,setResourceDataSink as Te,getOwner as Re,runWithOwner as Z,flush as be}from"@fluixi/reactive/signal";var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ve={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>ve[t]??n)}var c=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],a=o=>{let u=s[s.length-1];u?u.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){d(e.slice(t));break}if(o>t&&d(e.slice(t,o)),e.startsWith("<!--",o)){let u=e.indexOf("-->",o);if(u===-1)throw new c(`unterminated comment at ${o}`);a(new x(e.slice(o+4,u))),t=u+3;continue}if(e[o+1]==="/"){let u=e.indexOf(">",o);if(u===-1)throw new c(`unterminated closing tag at ${o}`);let S=e.slice(o+2,u).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==S)throw new c(`</${S}> does not close <${f?.localName??"nothing"}>`);t=u+1;continue}t=w(o)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(o){o!==""&&a(new h(U(o)))}function w(o){let u=/[\s/>]/.exec(e.slice(o+1));if(!u)throw new c(`unterminated tag at ${o}`);let S=e.slice(o+1,o+1+u.index).toLowerCase(),f=new m(S,n),i=o+1+u.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let oe=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let y=e.slice(oe,i);if(y==="")throw new c(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new c(`attribute ${y} must have a double-quoted value`);let O=e.indexOf('"',i+2);if(O===-1)throw new c(`unterminated value for ${y}`);f.setAttribute(y,U(e.slice(i+2,O))),i=O+1}else f.setAttribute(y,"")}return a(f),xe.has(S)||s.push(f),i}}var q,K={getStore:()=>q,run(e,n){let t=q;q=e;try{return n()}finally{q=t}}},H=K;function Ne(e){H=e??K}function A(e={}){e.locals||(e.locals=e.request?Y(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=a.get(l)??0;return a.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let w=r;r=l;try{return d()}finally{r=w}},pending:new Set,data:new Map}}function k(e,n){return H.run(e,n)}function N(){return H.getStore()}function Q(){return N()?.event}function we(){let e=Q();return e?(e.locals||(e.locals={}),e.locals):{}}var B=new WeakMap;function Y(e){let n=B.get(e);return n||(n={},B.set(e,n)),n}var ee=!1;function re(){ee||(ee=!0,V({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new x(e)}))}function Ee(e,n={}){let t=T;re(),v(!0);let r=A(n.event);try{return k(r,()=>ne(s=>{try{let a=typeof e=="function"?e():e;return p(a)}finally{s()}}))}finally{v(t)}}var te=!1;function Ce(){te||(te=!0,Se(e=>{N()?.pending.add(e)}),ye(()=>N()?.nextResourceId()??""),Te((e,n)=>{e&&N()?.data.set(e,n)}))}var F=null;function qe(e){F=e}function se(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if(F)try{a=F(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=j(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${C}">${t}<\/script>`}var Ae=50;async function ke(e,n={}){let t=T;re(),v(!0),Ce();let r=A(n.event);try{return await k(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};ne(u=>{l=u,a=Re(),s=typeof e=="function"?e():e});let d=()=>{try{Z(a,()=>p(s))}catch{}};d();let w=0;for(;r.pending.size>0&&w++<Ae;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await be(),d()}let o=Z(a,()=>p(s))+se(r);return l(),o})}finally{v(t)}}export{C as FX_DATA_ID,x as ServerComment,m as ServerElement,g as ServerNode,h as ServerText,A as createRequestContext,j as escapeFxJson,we as getLocals,N as getRequestContext,Q as getRequestEvent,Y as getRequestLocals,me as getServerData,ue as isDomElement,ae as isDomNode,le as isDomText,T as isServer,ce as isServerNodeValue,Ee as renderToString,ke as renderToStringAsync,k as runWithRequestContext,p as serializeNode,se as serializeResourceData,qe as setDataRedactor,Ne as setRequestStore,v as setServerMode};
@@ -1 +1 @@
1
- "use strict";var k=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var oe=(e,n)=>{for(var t in n)k(e,t,{get:n[t],enumerable:!0})},ae=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of se(n))!ie.call(e,s)&&s!==t&&k(e,s,{get:()=>n[s],enumerable:!(r=re(n,s))||r.enumerable});return e};var ue=e=>ae(k({},"__esModule",{value:!0}),e);var be={};oe(be,{renderToString:()=>we,renderToStringAsync:()=>Te,serializeResourceData:()=>te,setDataRedactor:()=>Se});module.exports=ue(be);var j=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var T=typeof document>"u";function y(e){T=e}var H=Symbol.for("fluixi.server-node"),le=null;function F(e){le=e}var R=1,M=3,_=8,V;V=H;var x=class{constructor(){this[V]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends x{constructor(t){super();this.nodeType=M;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends x{constructor(t){super();this.nodeType=R;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends x{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},q=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},O=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends x{constructor(t,r=!1){super();this.nodeType=R;this.attributes=new Map;this.style=new q;this.classList=new O(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};var ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z=/&/g,P=/</g,W=/>/g,de=/"/g;function L(e){return e.replace(z,"&amp;").replace(P,"&lt;").replace(W,"&gt;")}function X(e){return e.replace(z,"&amp;").replace(de,"&quot;").replace(P,"&lt;").replace(W,"&gt;")}function pe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function fe(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${pe(t)}: ${r}`)}return n.join("; ")}function ge(e){let n="",t=fe(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function g(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return L(e);if(typeof e=="number")return L(String(e));if(typeof e=="function")return g(e());if(Array.isArray(e))return e.map(g).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case M:return L(e.data??"");case _:return`<!--${e.data??""}-->`;case R:{let n=e.localName,t=`<${n}${ge(e)}>`;if(ce.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(g).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(g).join(""):""}var he=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),me={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>me[t]??n)}var d=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],u=i=>{let a=s[s.length-1];a?a.appendChild(i):r.push(i)};for(;t<e.length;){let i=e.indexOf("<",t);if(i===-1){p(e.slice(t));break}if(i>t&&p(e.slice(t,i)),e.startsWith("<!--",i)){let a=e.indexOf("-->",i);if(a===-1)throw new d(`unterminated comment at ${i}`);u(new v(e.slice(i+4,a))),t=a+3;continue}if(e[i+1]==="/"){let a=e.indexOf(">",i);if(a===-1)throw new d(`unterminated closing tag at ${i}`);let N=e.slice(i+2,a).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==N)throw new d(`</${N}> does not close <${f?.localName??"nothing"}>`);t=a+1;continue}t=w(i)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function p(i){i!==""&&u(new h(U(i)))}function w(i){let a=/[\s/>]/.exec(e.slice(i+1));if(!a)throw new d(`unterminated tag at ${i}`);let N=e.slice(i+1,i+1+a.index).toLowerCase(),f=new m(N,n),o=i+1+a.index;for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]===">"){o++;break}if(e[o]==="/"&&e[o+1]===">"){o+=2;break}let ne=o;for(;o<e.length&&!/[\s=/>]/.test(e[o]);)o++;let S=e.slice(ne,o);if(S==="")throw new d(`malformed attribute at ${o}`);if(e[o]==="="){if(e[o+1]!=='"')throw new d(`attribute ${S} must have a double-quoted value`);let A=e.indexOf('"',o+2);if(A===-1)throw new d(`unterminated value for ${S}`);f.setAttribute(S,U(e.slice(o+2,A))),o=A+1}else f.setAttribute(S,"")}return u(f),he.has(N)||s.push(f),o}}var J="__FX_DATA__";function B(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var E,xe={getStore:()=>E,run(e,n){let t=E;E=e;try{return n()}finally{E=t}}},Q=xe;function $(e={}){e.locals||(e.locals=e.request?ve(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let p=u.get(l)??0;return u.set(l,p+1),`${l}#${p}`},withResourceScope(l,p){let w=r;r=l;try{return p()}finally{r=w}},pending:new Set,data:new Map}}function D(e,n){return Q.run(e,n)}function C(){return Q.getStore()}var K=new WeakMap;function ve(e){let n=K.get(e);return n||(n={},K.set(e,n)),n}var Y=!1;function ee(){Y||(Y=!0,F({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new v(e)}))}function we(e,n={}){let t=T;ee(),y(!0);let r=$(n.event);try{return D(r,()=>(0,j.createRoot)(s=>{try{let u=typeof e=="function"?e():e;return g(u)}finally{s()}}))}finally{y(t)}}var Z=!1;function Ne(){Z||(Z=!0,(0,c.setResourceTracker)(e=>{C()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>C()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&C()?.data.set(e,n)}))}var I=null;function Se(e){I=e}function te(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if(I)try{u=I(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=B(JSON.stringify(n));return`<script type="application/json" id="${J}">${t}<\/script>`}var ye=50;async function Te(e,n={}){let t=T;ee(),y(!0),Ne();let r=$(n.event);try{return await D(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};(0,j.createRoot)(a=>{l=a,u=(0,c.getOwner)(),s=typeof e=="function"?e():e});let p=()=>{try{(0,c.runWithOwner)(u,()=>g(s))}catch{}};p();let w=0;for(;r.pending.size>0&&w++<ye;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await(0,c.flush)(),p()}let i=(0,c.runWithOwner)(u,()=>g(s))+te(r);return l(),i})}finally{y(t)}}
1
+ "use strict";var k=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var oe=(e,n)=>{for(var t in n)k(e,t,{get:n[t],enumerable:!0})},ae=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of se(n))!ie.call(e,s)&&s!==t&&k(e,s,{get:()=>n[s],enumerable:!(r=re(n,s))||r.enumerable});return e};var ue=e=>ae(k({},"__esModule",{value:!0}),e);var be={};oe(be,{renderToString:()=>we,renderToStringAsync:()=>Te,serializeResourceData:()=>te,setDataRedactor:()=>ye});module.exports=ue(be);var j=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var T=typeof document>"u";function S(e){T=e}var H=Symbol.for("fluixi.server-node"),le=null;function F(e){le=e}var R=1,M=3,_=8,V;V=H;var x=class{constructor(){this[V]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends x{constructor(t){super();this.nodeType=M;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends x{constructor(t){super();this.nodeType=R;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends x{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},q=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},O=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends x{constructor(t,r=!1){super();this.nodeType=R;this.attributes=new Map;this.style=new q;this.classList=new O(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};var ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z=/&/g,P=/</g,W=/>/g,de=/"/g;function L(e){return e.replace(z,"&amp;").replace(P,"&lt;").replace(W,"&gt;")}function X(e){return e.replace(z,"&amp;").replace(de,"&quot;").replace(P,"&lt;").replace(W,"&gt;")}function fe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function pe(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${fe(t)}: ${r}`)}return n.join("; ")}function ge(e){let n="",t=pe(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function g(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return L(e);if(typeof e=="number")return L(String(e));if(typeof e=="function")return g(e());if(Array.isArray(e))return e.map(g).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case M:return L(e.data??"");case _:return`<!--${e.data??""}-->`;case R:{let n=e.localName,t=`<${n}${ge(e)}>`;if(ce.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(g).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(g).join(""):""}var he=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),me={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>me[t]??n)}var d=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],a=i=>{let u=s[s.length-1];u?u.appendChild(i):r.push(i)};for(;t<e.length;){let i=e.indexOf("<",t);if(i===-1){f(e.slice(t));break}if(i>t&&f(e.slice(t,i)),e.startsWith("<!--",i)){let u=e.indexOf("-->",i);if(u===-1)throw new d(`unterminated comment at ${i}`);a(new v(e.slice(i+4,u))),t=u+3;continue}if(e[i+1]==="/"){let u=e.indexOf(">",i);if(u===-1)throw new d(`unterminated closing tag at ${i}`);let N=e.slice(i+2,u).trim().toLowerCase(),p=s.pop();if(!p||p.localName!==N)throw new d(`</${N}> does not close <${p?.localName??"nothing"}>`);t=u+1;continue}t=w(i)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function f(i){i!==""&&a(new h(U(i)))}function w(i){let u=/[\s/>]/.exec(e.slice(i+1));if(!u)throw new d(`unterminated tag at ${i}`);let N=e.slice(i+1,i+1+u.index).toLowerCase(),p=new m(N,n),o=i+1+u.index;for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]===">"){o++;break}if(e[o]==="/"&&e[o+1]===">"){o+=2;break}let ne=o;for(;o<e.length&&!/[\s=/>]/.test(e[o]);)o++;let y=e.slice(ne,o);if(y==="")throw new d(`malformed attribute at ${o}`);if(e[o]==="="){if(e[o+1]!=='"')throw new d(`attribute ${y} must have a double-quoted value`);let A=e.indexOf('"',o+2);if(A===-1)throw new d(`unterminated value for ${y}`);p.setAttribute(y,U(e.slice(o+2,A))),o=A+1}else p.setAttribute(y,"")}return a(p),he.has(N)||s.push(p),o}}var J="__FX_DATA__";function B(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var E,xe={getStore:()=>E,run(e,n){let t=E;E=e;try{return n()}finally{E=t}}},Q=xe;function $(e={}){e.locals||(e.locals=e.request?ve(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let f=a.get(l)??0;return a.set(l,f+1),`${l}#${f}`},withResourceScope(l,f){let w=r;r=l;try{return f()}finally{r=w}},pending:new Set,data:new Map}}function D(e,n){return Q.run(e,n)}function C(){return Q.getStore()}var K=new WeakMap;function ve(e){let n=K.get(e);return n||(n={},K.set(e,n)),n}var Y=!1;function ee(){Y||(Y=!0,F({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new v(e)}))}function we(e,n={}){let t=T;ee(),S(!0);let r=$(n.event);try{return D(r,()=>(0,j.createRoot)(s=>{try{let a=typeof e=="function"?e():e;return g(a)}finally{s()}}))}finally{S(t)}}var Z=!1;function Ne(){Z||(Z=!0,(0,c.setResourceTracker)(e=>{C()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>C()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&C()?.data.set(e,n)}))}var I=null;function ye(e){I=e}function te(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if(I)try{a=I(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=B(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${J}">${t}<\/script>`}var Se=50;async function Te(e,n={}){let t=T;ee(),S(!0),Ne();let r=$(n.event);try{return await D(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};(0,j.createRoot)(u=>{l=u,a=(0,c.getOwner)(),s=typeof e=="function"?e():e});let f=()=>{try{(0,c.runWithOwner)(a,()=>g(s))}catch{}};f();let w=0;for(;r.pending.size>0&&w++<Se;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await(0,c.flush)(),f()}let i=(0,c.runWithOwner)(a,()=>g(s))+te(r);return l(),i})}finally{S(t)}}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/lib/dom/server/render.ts"],"names":[],"mappings":"AAqCA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAmBlF;AAqBD;;;;;;;;;;;;;;GAcG;AACH,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAsBjE;AAKD,oFAAoF;AAEpF;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,GAAG,EACd,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAyDjB"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/lib/dom/server/render.ts"],"names":[],"mappings":"AAqCA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAmBlF;AAqBD;;;;;;;;;;;;;;GAcG;AACH,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAgCjE;AAKD,oFAAoF;AAEpF;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,GAAG,EACd,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAyDjB"}
@@ -94,6 +94,12 @@ export function serializeResourceData(ctx) {
94
94
  }
95
95
  if (out === undefined)
96
96
  continue; // redacted → omit (client refetches)
97
+ // A value JSON cannot represent is not data the client can be seeded with —
98
+ // JSON.stringify drops the key silently, so keeping it here only produces an
99
+ // entry that disappears later. A lazy route's resolved module is the common
100
+ // case: the resource holds the component function itself.
101
+ if (typeof out === 'function' || typeof out === 'symbol')
102
+ continue;
97
103
  obj[k] = out;
98
104
  }
99
105
  if (Object.keys(obj).length === 0)
@@ -102,6 +108,12 @@ export function serializeResourceData(ctx) {
102
108
  // SSR-JSON set so no value can break out of the <script>. The client reads it via
103
109
  // getServerData() → JSON.parse(textContent).
104
110
  const json = escapeFxJson(JSON.stringify(obj));
111
+ // Decided on the serialized form, not on the map: the checks above catch the
112
+ // values we know about, and this catches the rest (a nested undefined, a class
113
+ // instance with a toJSON returning nothing). An empty payload still costs a
114
+ // script tag in every document that has no data to send.
115
+ if (json === '{}')
116
+ return '';
105
117
  return `<script type="application/json" id="${FX_DATA_ID}">${json}</script>`;
106
118
  }
107
119
  /** Bound on resolve→refetch waterfalls so a buggy loader can't spin forever. */
@@ -1 +1 @@
1
- import{createRoot as Y}from"@fluixi/reactive/signal";import{setResourceTracker as de,setResourceIdSource as pe,setResourceDataSink as fe,getOwner as ge,runWithOwner as B,flush as he}from"@fluixi/reactive/signal";var y=typeof document>"u";function S(e){y=e}var D=Symbol.for("fluixi.server-node"),te=null;function I(e){te=e}var b=1,q=3,O=8,j;j=D;var m=class{constructor(){this[j]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},g=class e extends m{constructor(t){super();this.nodeType=q;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},T=class e extends m{constructor(t){super();this.nodeType=b;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends m{constructor(t){super();this.nodeType=O;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},k=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},h=class e extends m{constructor(t,r=!1){super();this.nodeType=b;this.attributes=new Map;this.style=new A;this.classList=new k(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new g(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};var ne=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/&/g,V=/</g,X=/>/g,re=/"/g;function M(e){return e.replace(F,"&amp;").replace(V,"&lt;").replace(X,"&gt;")}function H(e){return e.replace(F,"&amp;").replace(re,"&quot;").replace(V,"&lt;").replace(X,"&gt;")}function se(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ie(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${se(t)}: ${r}`)}return n.join("; ")}function oe(e){let n="",t=ie(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${H(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${H(s)}"`}return n}function f(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return M(e);if(typeof e=="number")return M(String(e));if(typeof e=="function")return f(e());if(Array.isArray(e))return e.map(f).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case q:return M(e.data??"");case O:return`<!--${e.data??""}-->`;case b:{let n=e.localName,t=`<${n}${oe(e)}>`;if(ne.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(f).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(f).join(""):""}var ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ue={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function z(e){return e.replace(/&(#?\w+);/g,(n,t)=>ue[t]??n)}var c=class extends Error{};function P(e,n=!1){let t=0,r=[],s=[],u=i=>{let a=s[s.length-1];a?a.appendChild(i):r.push(i)};for(;t<e.length;){let i=e.indexOf("<",t);if(i===-1){d(e.slice(t));break}if(i>t&&d(e.slice(t,i)),e.startsWith("<!--",i)){let a=e.indexOf("-->",i);if(a===-1)throw new c(`unterminated comment at ${i}`);u(new x(e.slice(i+4,a))),t=a+3;continue}if(e[i+1]==="/"){let a=e.indexOf(">",i);if(a===-1)throw new c(`unterminated closing tag at ${i}`);let w=e.slice(i+2,a).trim().toLowerCase(),p=s.pop();if(!p||p.localName!==w)throw new c(`</${w}> does not close <${p?.localName??"nothing"}>`);t=a+1;continue}t=v(i)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof h))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(i){i!==""&&u(new g(z(i)))}function v(i){let a=/[\s/>]/.exec(e.slice(i+1));if(!a)throw new c(`unterminated tag at ${i}`);let w=e.slice(i+1,i+1+a.index).toLowerCase(),p=new h(w,n),o=i+1+a.index;for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]===">"){o++;break}if(e[o]==="/"&&e[o+1]===">"){o+=2;break}let ee=o;for(;o<e.length&&!/[\s=/>]/.test(e[o]);)o++;let N=e.slice(ee,o);if(N==="")throw new c(`malformed attribute at ${o}`);if(e[o]==="="){if(e[o+1]!=='"')throw new c(`attribute ${N} must have a double-quoted value`);let C=e.indexOf('"',o+2);if(C===-1)throw new c(`unterminated value for ${N}`);p.setAttribute(N,z(e.slice(o+2,C))),o=C+1}else p.setAttribute(N,"")}return u(p),ae.has(w)||s.push(p),o}}var W="__FX_DATA__";function U(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var R,le={getStore:()=>R,run(e,n){let t=R;R=e;try{return n()}finally{R=t}}},J=le;function _(e={}){e.locals||(e.locals=e.request?ce(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=u.get(l)??0;return u.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let v=r;r=l;try{return d()}finally{r=v}},pending:new Set,data:new Map}}function L(e,n){return J.run(e,n)}function E(){return J.getStore()}var G=new WeakMap;function ce(e){let n=G.get(e);return n||(n={},G.set(e,n)),n}var K=!1;function Z(){K||(K=!0,I({createElement:(e,n)=>new h(e,n),createText:e=>new g(e),createRaw:e=>new T(e),parseTemplate:(e,n)=>P(e,n),createComment:e=>new x(e)}))}function Ie(e,n={}){let t=y;Z(),S(!0);let r=_(n.event);try{return L(r,()=>Y(s=>{try{let u=typeof e=="function"?e():e;return f(u)}finally{s()}}))}finally{S(t)}}var Q=!1;function me(){Q||(Q=!0,de(e=>{E()?.pending.add(e)}),pe(()=>E()?.nextResourceId()??""),fe((e,n)=>{e&&E()?.data.set(e,n)}))}var $=null;function je(e){$=e}function xe(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if($)try{u=$(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=U(JSON.stringify(n));return`<script type="application/json" id="${W}">${t}<\/script>`}var ve=50;async function He(e,n={}){let t=y;Z(),S(!0),me();let r=_(n.event);try{return await L(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};Y(a=>{l=a,u=ge(),s=typeof e=="function"?e():e});let d=()=>{try{B(u,()=>f(s))}catch{}};d();let v=0;for(;r.pending.size>0&&v++<ve;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await he(),d()}let i=B(u,()=>f(s))+xe(r);return l(),i})}finally{S(t)}}export{Ie as renderToString,He as renderToStringAsync,xe as serializeResourceData,je as setDataRedactor};
1
+ import{createRoot as Y}from"@fluixi/reactive/signal";import{setResourceTracker as de,setResourceIdSource as fe,setResourceDataSink as pe,getOwner as ge,runWithOwner as B,flush as he}from"@fluixi/reactive/signal";var S=typeof document>"u";function y(e){S=e}var D=Symbol.for("fluixi.server-node"),te=null;function I(e){te=e}var b=1,q=3,O=8,j;j=D;var m=class{constructor(){this[j]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},g=class e extends m{constructor(t){super();this.nodeType=q;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},T=class e extends m{constructor(t){super();this.nodeType=b;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends m{constructor(t){super();this.nodeType=O;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},k=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},h=class e extends m{constructor(t,r=!1){super();this.nodeType=b;this.attributes=new Map;this.style=new A;this.classList=new k(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new g(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};var ne=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/&/g,V=/</g,X=/>/g,re=/"/g;function M(e){return e.replace(F,"&amp;").replace(V,"&lt;").replace(X,"&gt;")}function H(e){return e.replace(F,"&amp;").replace(re,"&quot;").replace(V,"&lt;").replace(X,"&gt;")}function se(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ie(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${se(t)}: ${r}`)}return n.join("; ")}function oe(e){let n="",t=ie(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${H(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${H(s)}"`}return n}function p(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return M(e);if(typeof e=="number")return M(String(e));if(typeof e=="function")return p(e());if(Array.isArray(e))return e.map(p).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case q:return M(e.data??"");case O:return`<!--${e.data??""}-->`;case b:{let n=e.localName,t=`<${n}${oe(e)}>`;if(ne.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(p).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(p).join(""):""}var ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ue={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function z(e){return e.replace(/&(#?\w+);/g,(n,t)=>ue[t]??n)}var c=class extends Error{};function P(e,n=!1){let t=0,r=[],s=[],a=i=>{let u=s[s.length-1];u?u.appendChild(i):r.push(i)};for(;t<e.length;){let i=e.indexOf("<",t);if(i===-1){d(e.slice(t));break}if(i>t&&d(e.slice(t,i)),e.startsWith("<!--",i)){let u=e.indexOf("-->",i);if(u===-1)throw new c(`unterminated comment at ${i}`);a(new x(e.slice(i+4,u))),t=u+3;continue}if(e[i+1]==="/"){let u=e.indexOf(">",i);if(u===-1)throw new c(`unterminated closing tag at ${i}`);let w=e.slice(i+2,u).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==w)throw new c(`</${w}> does not close <${f?.localName??"nothing"}>`);t=u+1;continue}t=v(i)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof h))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(i){i!==""&&a(new g(z(i)))}function v(i){let u=/[\s/>]/.exec(e.slice(i+1));if(!u)throw new c(`unterminated tag at ${i}`);let w=e.slice(i+1,i+1+u.index).toLowerCase(),f=new h(w,n),o=i+1+u.index;for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]===">"){o++;break}if(e[o]==="/"&&e[o+1]===">"){o+=2;break}let ee=o;for(;o<e.length&&!/[\s=/>]/.test(e[o]);)o++;let N=e.slice(ee,o);if(N==="")throw new c(`malformed attribute at ${o}`);if(e[o]==="="){if(e[o+1]!=='"')throw new c(`attribute ${N} must have a double-quoted value`);let C=e.indexOf('"',o+2);if(C===-1)throw new c(`unterminated value for ${N}`);f.setAttribute(N,z(e.slice(o+2,C))),o=C+1}else f.setAttribute(N,"")}return a(f),ae.has(w)||s.push(f),o}}var W="__FX_DATA__";function U(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var R,le={getStore:()=>R,run(e,n){let t=R;R=e;try{return n()}finally{R=t}}},J=le;function _(e={}){e.locals||(e.locals=e.request?ce(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=a.get(l)??0;return a.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let v=r;r=l;try{return d()}finally{r=v}},pending:new Set,data:new Map}}function L(e,n){return J.run(e,n)}function E(){return J.getStore()}var G=new WeakMap;function ce(e){let n=G.get(e);return n||(n={},G.set(e,n)),n}var K=!1;function Z(){K||(K=!0,I({createElement:(e,n)=>new h(e,n),createText:e=>new g(e),createRaw:e=>new T(e),parseTemplate:(e,n)=>P(e,n),createComment:e=>new x(e)}))}function Ie(e,n={}){let t=S;Z(),y(!0);let r=_(n.event);try{return L(r,()=>Y(s=>{try{let a=typeof e=="function"?e():e;return p(a)}finally{s()}}))}finally{y(t)}}var Q=!1;function me(){Q||(Q=!0,de(e=>{E()?.pending.add(e)}),fe(()=>E()?.nextResourceId()??""),pe((e,n)=>{e&&E()?.data.set(e,n)}))}var $=null;function je(e){$=e}function xe(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if($)try{a=$(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=U(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${W}">${t}<\/script>`}var ve=50;async function He(e,n={}){let t=S;Z(),y(!0),me();let r=_(n.event);try{return await L(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};Y(u=>{l=u,a=ge(),s=typeof e=="function"?e():e});let d=()=>{try{B(a,()=>p(s))}catch{}};d();let v=0;for(;r.pending.size>0&&v++<ve;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await he(),d()}let i=B(a,()=>p(s))+xe(r);return l(),i})}finally{y(t)}}export{Ie as renderToString,He as renderToStringAsync,xe as serializeResourceData,je as setDataRedactor};
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var we=(e,n)=>{for(var t in n)_(e,t,{get:n[t],enumerable:!0})},Se=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ve(n))!Ne.call(e,s)&&s!==t&&_(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var ye=e=>Se(_({},"__esModule",{value:!0}),e);var Me={};we(Me,{FX_DATA_ID:()=>E,ServerComment:()=>v,ServerElement:()=>m,ServerNode:()=>g,ServerText:()=>h,createRequestContext:()=>C,escapeFxJson:()=>O,getLocals:()=>le,getRequestContext:()=>w,getRequestEvent:()=>z,getRequestLocals:()=>X,getServerData:()=>re,isDomElement:()=>B,isDomNode:()=>G,isDomText:()=>K,isServer:()=>S,isServerNodeValue:()=>Y,renderToString:()=>fe,renderToStringAsync:()=>he,runWithRequestContext:()=>q,serializeNode:()=>f,serializeResourceData:()=>J,setDataRedactor:()=>ge,setRequestStore:()=>ue,setServerMode:()=>N});module.exports=ye(Me);var S=typeof document>"u";function N(e){S=e}var b=Symbol.for("fluixi.server-node"),Te=null;function U(e){Te=e}function G(e){return e!=null&&e[b]===!0?!0:typeof Node<"u"&&e instanceof Node}function B(e){return e!=null&&e[b]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function K(e){return e!=null&&e[b]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var k=1,I=3,j=8,Q;Q=b;var g=class{constructor(){this[Q]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=I;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class e extends g{constructor(t){super();this.nodeType=k;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends g{constructor(t){super();this.nodeType=j;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},L=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},$=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=k;this.attributes=new Map;this.style=new L;this.classList=new $(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function Y(e){return e instanceof g}var Re=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ee=/&/g,te=/</g,ne=/>/g,be=/"/g;function H(e){return e.replace(ee,"&amp;").replace(te,"&lt;").replace(ne,"&gt;")}function Z(e){return e.replace(ee,"&amp;").replace(be,"&quot;").replace(te,"&lt;").replace(ne,"&gt;")}function Ee(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function Ce(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${Ee(t)}: ${r}`)}return n.join("; ")}function qe(e){let n="",t=Ce(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${Z(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${Z(s)}"`}return n}function f(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return H(e);if(typeof e=="number")return H(String(e));if(typeof e=="function")return f(e());if(Array.isArray(e))return e.map(f).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case I:return H(e.data??"");case j:return`<!--${e.data??""}-->`;case k:{let n=e.localName,t=`<${n}${qe(e)}>`;if(Re.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(f).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(f).join(""):""}var E="__FX_DATA__";function O(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var F;function re(){let e=globalThis.__FX_DATA__;if(e)return e;if(F!==void 0)return F;let n=null;if(typeof document<"u"){let t=document.getElementById(E)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return F=n}var P=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ke={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function se(e){return e.replace(/&(#?\w+);/g,(n,t)=>ke[t]??n)}var d=class extends Error{};function oe(e,n=!1){let t=0,r=[],s=[],u=o=>{let a=s[s.length-1];a?a.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){p(e.slice(t));break}if(o>t&&p(e.slice(t,o)),e.startsWith("<!--",o)){let a=e.indexOf("-->",o);if(a===-1)throw new d(`unterminated comment at ${o}`);u(new v(e.slice(o+4,a))),t=a+3;continue}if(e[o+1]==="/"){let a=e.indexOf(">",o);if(a===-1)throw new d(`unterminated closing tag at ${o}`);let T=e.slice(o+2,a).trim().toLowerCase(),x=s.pop();if(!x||x.localName!==T)throw new d(`</${T}> does not close <${x?.localName??"nothing"}>`);t=a+1;continue}t=y(o)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function p(o){o!==""&&u(new h(se(o)))}function y(o){let a=/[\s/>]/.exec(e.slice(o+1));if(!a)throw new d(`unterminated tag at ${o}`);let T=e.slice(o+1,o+1+a.index).toLowerCase(),x=new m(T,n),i=o+1+a.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let me=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let R=e.slice(me,i);if(R==="")throw new d(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new d(`attribute ${R} must have a double-quoted value`);let M=e.indexOf('"',i+2);if(M===-1)throw new d(`unterminated value for ${R}`);x.setAttribute(R,se(e.slice(i+2,M))),i=M+1}else x.setAttribute(R,"")}return u(x),Ae.has(T)||s.push(x),i}}var D,ae={getStore:()=>D,run(e,n){let t=D;D=e;try{return n()}finally{D=t}}},V=ae;function ue(e){V=e??ae}function C(e={}){e.locals||(e.locals=e.request?X(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let p=u.get(l)??0;return u.set(l,p+1),`${l}#${p}`},withResourceScope(l,p){let y=r;r=l;try{return p()}finally{r=y}},pending:new Set,data:new Map}}function q(e,n){return V.run(e,n)}function w(){return V.getStore()}function z(){return w()?.event}function le(){let e=z();return e?(e.locals||(e.locals={}),e.locals):{}}var ie=new WeakMap;function X(e){let n=ie.get(e);return n||(n={},ie.set(e,n)),n}var ce=!1;function pe(){ce||(ce=!0,U({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new A(e),parseTemplate:(e,n)=>oe(e,n),createComment:e=>new v(e)}))}function fe(e,n={}){let t=S;pe(),N(!0);let r=C(n.event);try{return q(r,()=>(0,P.createRoot)(s=>{try{let u=typeof e=="function"?e():e;return f(u)}finally{s()}}))}finally{N(t)}}var de=!1;function Oe(){de||(de=!0,(0,c.setResourceTracker)(e=>{w()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>w()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&w()?.data.set(e,n)}))}var W=null;function ge(e){W=e}function J(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if(W)try{u=W(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=O(JSON.stringify(n));return`<script type="application/json" id="${E}">${t}<\/script>`}var De=50;async function he(e,n={}){let t=S;pe(),N(!0),Oe();let r=C(n.event);try{return await q(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};(0,P.createRoot)(a=>{l=a,u=(0,c.getOwner)(),s=typeof e=="function"?e():e});let p=()=>{try{(0,c.runWithOwner)(u,()=>f(s))}catch{}};p();let y=0;for(;r.pending.size>0&&y++<De;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await(0,c.flush)(),p()}let o=(0,c.runWithOwner)(u,()=>f(s))+J(r);return l(),o})}finally{N(t)}}
1
+ "use strict";var _=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var we=(e,n)=>{for(var t in n)_(e,t,{get:n[t],enumerable:!0})},Se=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ve(n))!Ne.call(e,s)&&s!==t&&_(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var ye=e=>Se(_({},"__esModule",{value:!0}),e);var Me={};we(Me,{FX_DATA_ID:()=>E,ServerComment:()=>v,ServerElement:()=>m,ServerNode:()=>g,ServerText:()=>h,createRequestContext:()=>C,escapeFxJson:()=>O,getLocals:()=>le,getRequestContext:()=>w,getRequestEvent:()=>z,getRequestLocals:()=>X,getServerData:()=>re,isDomElement:()=>B,isDomNode:()=>G,isDomText:()=>K,isServer:()=>S,isServerNodeValue:()=>Y,renderToString:()=>fe,renderToStringAsync:()=>he,runWithRequestContext:()=>q,serializeNode:()=>f,serializeResourceData:()=>J,setDataRedactor:()=>ge,setRequestStore:()=>ue,setServerMode:()=>N});module.exports=ye(Me);var S=typeof document>"u";function N(e){S=e}var b=Symbol.for("fluixi.server-node"),Te=null;function U(e){Te=e}function G(e){return e!=null&&e[b]===!0?!0:typeof Node<"u"&&e instanceof Node}function B(e){return e!=null&&e[b]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function K(e){return e!=null&&e[b]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var k=1,I=3,j=8,Q;Q=b;var g=class{constructor(){this[Q]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=I;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},A=class e extends g{constructor(t){super();this.nodeType=k;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},v=class e extends g{constructor(t){super();this.nodeType=j;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},L=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},$=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=k;this.attributes=new Map;this.style=new L;this.classList=new $(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function Y(e){return e instanceof g}var Re=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ee=/&/g,te=/</g,ne=/>/g,be=/"/g;function H(e){return e.replace(ee,"&amp;").replace(te,"&lt;").replace(ne,"&gt;")}function Z(e){return e.replace(ee,"&amp;").replace(be,"&quot;").replace(te,"&lt;").replace(ne,"&gt;")}function Ee(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function Ce(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${Ee(t)}: ${r}`)}return n.join("; ")}function qe(e){let n="",t=Ce(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${Z(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${Z(s)}"`}return n}function f(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return H(e);if(typeof e=="number")return H(String(e));if(typeof e=="function")return f(e());if(Array.isArray(e))return e.map(f).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case I:return H(e.data??"");case j:return`<!--${e.data??""}-->`;case k:{let n=e.localName,t=`<${n}${qe(e)}>`;if(Re.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(f).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(f).join(""):""}var E="__FX_DATA__";function O(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var F;function re(){let e=globalThis.__FX_DATA__;if(e)return e;if(F!==void 0)return F;let n=null;if(typeof document<"u"){let t=document.getElementById(E)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return F=n}var P=require("@fluixi/reactive/signal"),c=require("@fluixi/reactive/signal");var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ke={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function se(e){return e.replace(/&(#?\w+);/g,(n,t)=>ke[t]??n)}var d=class extends Error{};function oe(e,n=!1){let t=0,r=[],s=[],a=o=>{let u=s[s.length-1];u?u.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){p(e.slice(t));break}if(o>t&&p(e.slice(t,o)),e.startsWith("<!--",o)){let u=e.indexOf("-->",o);if(u===-1)throw new d(`unterminated comment at ${o}`);a(new v(e.slice(o+4,u))),t=u+3;continue}if(e[o+1]==="/"){let u=e.indexOf(">",o);if(u===-1)throw new d(`unterminated closing tag at ${o}`);let T=e.slice(o+2,u).trim().toLowerCase(),x=s.pop();if(!x||x.localName!==T)throw new d(`</${T}> does not close <${x?.localName??"nothing"}>`);t=u+1;continue}t=y(o)}if(s.length>0)throw new d(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new d(`expected exactly one root element, got ${r.length}`);return l;function p(o){o!==""&&a(new h(se(o)))}function y(o){let u=/[\s/>]/.exec(e.slice(o+1));if(!u)throw new d(`unterminated tag at ${o}`);let T=e.slice(o+1,o+1+u.index).toLowerCase(),x=new m(T,n),i=o+1+u.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let me=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let R=e.slice(me,i);if(R==="")throw new d(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new d(`attribute ${R} must have a double-quoted value`);let M=e.indexOf('"',i+2);if(M===-1)throw new d(`unterminated value for ${R}`);x.setAttribute(R,se(e.slice(i+2,M))),i=M+1}else x.setAttribute(R,"")}return a(x),Ae.has(T)||s.push(x),i}}var D,ae={getStore:()=>D,run(e,n){let t=D;D=e;try{return n()}finally{D=t}}},V=ae;function ue(e){V=e??ae}function C(e={}){e.locals||(e.locals=e.request?X(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let p=a.get(l)??0;return a.set(l,p+1),`${l}#${p}`},withResourceScope(l,p){let y=r;r=l;try{return p()}finally{r=y}},pending:new Set,data:new Map}}function q(e,n){return V.run(e,n)}function w(){return V.getStore()}function z(){return w()?.event}function le(){let e=z();return e?(e.locals||(e.locals={}),e.locals):{}}var ie=new WeakMap;function X(e){let n=ie.get(e);return n||(n={},ie.set(e,n)),n}var ce=!1;function pe(){ce||(ce=!0,U({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new A(e),parseTemplate:(e,n)=>oe(e,n),createComment:e=>new v(e)}))}function fe(e,n={}){let t=S;pe(),N(!0);let r=C(n.event);try{return q(r,()=>(0,P.createRoot)(s=>{try{let a=typeof e=="function"?e():e;return f(a)}finally{s()}}))}finally{N(t)}}var de=!1;function Oe(){de||(de=!0,(0,c.setResourceTracker)(e=>{w()?.pending.add(e)}),(0,c.setResourceIdSource)(()=>w()?.nextResourceId()??""),(0,c.setResourceDataSink)((e,n)=>{e&&w()?.data.set(e,n)}))}var W=null;function ge(e){W=e}function J(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if(W)try{a=W(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=O(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${E}">${t}<\/script>`}var De=50;async function he(e,n={}){let t=S;pe(),N(!0),Oe();let r=C(n.event);try{return await q(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};(0,P.createRoot)(u=>{l=u,a=(0,c.getOwner)(),s=typeof e=="function"?e():e});let p=()=>{try{(0,c.runWithOwner)(a,()=>f(s))}catch{}};p();let y=0;for(;r.pending.size>0&&y++<De;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await(0,c.flush)(),p()}let o=(0,c.runWithOwner)(a,()=>f(s))+J(r);return l(),o})}finally{N(t)}}
@@ -1 +1 @@
1
- var T=typeof document>"u";function v(e){T=e}var R=Symbol.for("fluixi.server-node"),ie=null;function V(e){ie=e}function ae(e){return e!=null&&e[R]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[R]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function le(e){return e!=null&&e[R]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E=1,_=3,L=8,z;z=R;var g=class{constructor(){this[z]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends g{constructor(t){super();this.nodeType=E;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends g{constructor(t){super();this.nodeType=L;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},D=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},M=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=E;this.attributes=new Map;this.style=new D;this.classList=new M(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function ce(e){return e instanceof g}var de=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=/&/g,P=/</g,J=/>/g,pe=/"/g;function $(e){return e.replace(W,"&amp;").replace(P,"&lt;").replace(J,"&gt;")}function X(e){return e.replace(W,"&amp;").replace(pe,"&quot;").replace(P,"&lt;").replace(J,"&gt;")}function fe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ge(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${fe(t)}: ${r}`)}return n.join("; ")}function he(e){let n="",t=ge(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function p(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $(e);if(typeof e=="number")return $(String(e));if(typeof e=="function")return p(e());if(Array.isArray(e))return e.map(p).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case _:return $(e.data??"");case L:return`<!--${e.data??""}-->`;case E:{let n=e.localName,t=`<${n}${he(e)}>`;if(de.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(p).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(p).join(""):""}var C="__FX_DATA__";function j(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var I;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(I!==void 0)return I;let n=null;if(typeof document<"u"){let t=document.getElementById(C)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return I=n}import{createRoot as ne}from"@fluixi/reactive/signal";import{setResourceTracker as Se,setResourceIdSource as ye,setResourceDataSink as Te,getOwner as Re,runWithOwner as Z,flush as be}from"@fluixi/reactive/signal";var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ve={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>ve[t]??n)}var c=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],u=o=>{let a=s[s.length-1];a?a.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){d(e.slice(t));break}if(o>t&&d(e.slice(t,o)),e.startsWith("<!--",o)){let a=e.indexOf("-->",o);if(a===-1)throw new c(`unterminated comment at ${o}`);u(new x(e.slice(o+4,a))),t=a+3;continue}if(e[o+1]==="/"){let a=e.indexOf(">",o);if(a===-1)throw new c(`unterminated closing tag at ${o}`);let S=e.slice(o+2,a).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==S)throw new c(`</${S}> does not close <${f?.localName??"nothing"}>`);t=a+1;continue}t=w(o)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(o){o!==""&&u(new h(U(o)))}function w(o){let a=/[\s/>]/.exec(e.slice(o+1));if(!a)throw new c(`unterminated tag at ${o}`);let S=e.slice(o+1,o+1+a.index).toLowerCase(),f=new m(S,n),i=o+1+a.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let oe=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let y=e.slice(oe,i);if(y==="")throw new c(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new c(`attribute ${y} must have a double-quoted value`);let O=e.indexOf('"',i+2);if(O===-1)throw new c(`unterminated value for ${y}`);f.setAttribute(y,U(e.slice(i+2,O))),i=O+1}else f.setAttribute(y,"")}return u(f),xe.has(S)||s.push(f),i}}var q,K={getStore:()=>q,run(e,n){let t=q;q=e;try{return n()}finally{q=t}}},H=K;function Ne(e){H=e??K}function A(e={}){e.locals||(e.locals=e.request?Y(e.request):{});let n=0,t=0,r=null,s=new Map,u=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=u.get(l)??0;return u.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let w=r;r=l;try{return d()}finally{r=w}},pending:new Set,data:new Map}}function k(e,n){return H.run(e,n)}function N(){return H.getStore()}function Q(){return N()?.event}function we(){let e=Q();return e?(e.locals||(e.locals={}),e.locals):{}}var B=new WeakMap;function Y(e){let n=B.get(e);return n||(n={},B.set(e,n)),n}var ee=!1;function re(){ee||(ee=!0,V({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new x(e)}))}function Ee(e,n={}){let t=T;re(),v(!0);let r=A(n.event);try{return k(r,()=>ne(s=>{try{let u=typeof e=="function"?e():e;return p(u)}finally{s()}}))}finally{v(t)}}var te=!1;function Ce(){te||(te=!0,Se(e=>{N()?.pending.add(e)}),ye(()=>N()?.nextResourceId()??""),Te((e,n)=>{e&&N()?.data.set(e,n)}))}var F=null;function qe(e){F=e}function se(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let u=s;if(F)try{u=F(s,r)}catch{continue}u!==void 0&&(n[r]=u)}if(Object.keys(n).length===0)return"";let t=j(JSON.stringify(n));return`<script type="application/json" id="${C}">${t}<\/script>`}var Ae=50;async function ke(e,n={}){let t=T;re(),v(!0),Ce();let r=A(n.event);try{return await k(r,async()=>{n.preload&&await n.preload(n.event);let s,u=null,l=()=>{};ne(a=>{l=a,u=Re(),s=typeof e=="function"?e():e});let d=()=>{try{Z(u,()=>p(s))}catch{}};d();let w=0;for(;r.pending.size>0&&w++<Ae;){let a=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(a),await be(),d()}let o=Z(u,()=>p(s))+se(r);return l(),o})}finally{v(t)}}export{C as FX_DATA_ID,x as ServerComment,m as ServerElement,g as ServerNode,h as ServerText,A as createRequestContext,j as escapeFxJson,we as getLocals,N as getRequestContext,Q as getRequestEvent,Y as getRequestLocals,me as getServerData,ue as isDomElement,ae as isDomNode,le as isDomText,T as isServer,ce as isServerNodeValue,Ee as renderToString,ke as renderToStringAsync,k as runWithRequestContext,p as serializeNode,se as serializeResourceData,qe as setDataRedactor,Ne as setRequestStore,v as setServerMode};
1
+ var T=typeof document>"u";function v(e){T=e}var R=Symbol.for("fluixi.server-node"),ie=null;function V(e){ie=e}function ae(e){return e!=null&&e[R]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[R]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function le(e){return e!=null&&e[R]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E=1,_=3,L=8,z;z=R;var g=class{constructor(){this[z]=!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 n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>=0?n.childNodes[t+1]??null:null}get previousSibling(){let n=this.parentNode;if(!n)return null;let t=n.childNodes.indexOf(this);return t>0?n.childNodes[t-1]??null:null}get parentElement(){return this.parentNode}appendChild(n){return n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,t){if(t==null)return this.appendChild(n);n.parentNode&&n.parentNode.removeChild(n);let r=this.childNodes.indexOf(t);return n.parentNode=this,r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),n}removeChild(n){let t=this.childNodes.indexOf(n);return t>=0&&this.childNodes.splice(t,1),n.parentNode=null,n}replaceChild(n,t){let r=this.childNodes.indexOf(t);return r>=0&&(n.parentNode&&n.parentNode.removeChild(n),n.parentNode=this,this.childNodes[r]=n,t.parentNode=null),t}addEventListener(){}removeEventListener(){}},h=class e extends g{constructor(t){super();this.nodeType=_;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}get textContent(){return this.data}set textContent(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},b=class e extends g{constructor(t){super();this.nodeType=E;this.rawOuterHTML=t}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},x=class e extends g{constructor(t){super();this.nodeType=L;this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t==null?"":String(t)}cloneNode(){return new e(this.data)}},D=class{constructor(){this.cssText=""}setProperty(n,t){this[n]=t}removeProperty(n){delete this[n]}},M=class{constructor(n){this.el=n}list(){let n=this.el.getAttribute("class");return n?n.split(/\s+/).filter(Boolean):[]}write(n){n.length?this.el.setAttribute("class",n.join(" ")):this.el.removeAttribute("class")}add(...n){let t=this.list();for(let r of n)t.includes(r)||t.push(r);this.write(t)}remove(...n){this.write(this.list().filter(t=>!n.includes(t)))}contains(n){return this.list().includes(n)}toggle(n,t){let r=this.contains(n),s=t===void 0?!r:t;return s?this.add(n):this.remove(n),s}},m=class e extends g{constructor(t,r=!1){super();this.nodeType=E;this.attributes=new Map;this.style=new D;this.classList=new M(this);this.rawHTML=null;this.localName=t.toLowerCase(),this.tagName=r?t:t.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(t,r){this.attributes.set(t,String(r))}removeAttribute(t){this.attributes.delete(t)}getAttribute(t){return this.attributes.has(t)?this.attributes.get(t):null}hasAttribute(t){return this.attributes.has(t)}get id(){return this.getAttribute("id")??""}set id(t){t==null?this.removeAttribute("id"):this.setAttribute("id",t)}get className(){return this.getAttribute("class")??""}set className(t){t==null?this.removeAttribute("class"):this.setAttribute("class",t)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(t){t==null?this.removeAttribute("for"):this.setAttribute("for",t)}set value(t){t==null?this.removeAttribute("value"):this.setAttribute("value",String(t))}set checked(t){t?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(t){t?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(t){}get textContent(){return this.childNodes.map(t=>t.textContent??"").join("")}set textContent(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,t!=null&&t!==""&&this.appendChild(new h(String(t)))}set innerText(t){this.textContent=t}set innerHTML(t){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=t==null?"":String(t)}cloneNode(t=!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,t)for(let s of this.childNodes)r.appendChild(s.cloneNode(!0));return r}};function ce(e){return e instanceof g}var de=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=/&/g,P=/</g,J=/>/g,pe=/"/g;function $(e){return e.replace(W,"&amp;").replace(P,"&lt;").replace(J,"&gt;")}function X(e){return e.replace(W,"&amp;").replace(pe,"&quot;").replace(P,"&lt;").replace(J,"&gt;")}function fe(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}function ge(e){if(!e)return"";let n=[];e.cssText&&n.push(e.cssText.trim().replace(/;\s*$/,""));for(let t of Object.keys(e)){if(t==="cssText")continue;let r=e[t];r==null||r===""||n.push(`${fe(t)}: ${r}`)}return n.join("; ")}function he(e){let n="",t=ge(e.style);for(let[r,s]of e.attributes)r==="style"&&t||(n+=` ${r}="${X(s)}"`);if(t){let r=e.attributes.get("style"),s=r?`${r.replace(/;\s*$/,"")}; ${t}`:t;n+=` style="${X(s)}"`}return n}function p(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $(e);if(typeof e=="number")return $(String(e));if(typeof e=="function")return p(e());if(Array.isArray(e))return e.map(p).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case _:return $(e.data??"");case L:return`<!--${e.data??""}-->`;case E:{let n=e.localName,t=`<${n}${he(e)}>`;if(de.has(n))return t;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(p).join("");return`${t}${r}</${n}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(p).join(""):""}var C="__FX_DATA__";function j(e){return e.replace(/[<>&\u2028\u2029]/g,n=>"\\u"+n.charCodeAt(0).toString(16).padStart(4,"0"))}var I;function me(){let e=globalThis.__FX_DATA__;if(e)return e;if(I!==void 0)return I;let n=null;if(typeof document<"u"){let t=document.getElementById(C)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return I=n}import{createRoot as ne}from"@fluixi/reactive/signal";import{setResourceTracker as Se,setResourceIdSource as ye,setResourceDataSink as Te,getOwner as Re,runWithOwner as Z,flush as be}from"@fluixi/reactive/signal";var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ve={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function U(e){return e.replace(/&(#?\w+);/g,(n,t)=>ve[t]??n)}var c=class extends Error{};function G(e,n=!1){let t=0,r=[],s=[],a=o=>{let u=s[s.length-1];u?u.appendChild(o):r.push(o)};for(;t<e.length;){let o=e.indexOf("<",t);if(o===-1){d(e.slice(t));break}if(o>t&&d(e.slice(t,o)),e.startsWith("<!--",o)){let u=e.indexOf("-->",o);if(u===-1)throw new c(`unterminated comment at ${o}`);a(new x(e.slice(o+4,u))),t=u+3;continue}if(e[o+1]==="/"){let u=e.indexOf(">",o);if(u===-1)throw new c(`unterminated closing tag at ${o}`);let S=e.slice(o+2,u).trim().toLowerCase(),f=s.pop();if(!f||f.localName!==S)throw new c(`</${S}> does not close <${f?.localName??"nothing"}>`);t=u+1;continue}t=w(o)}if(s.length>0)throw new c(`unclosed <${s[s.length-1].localName}>`);let l=r[0];if(r.length!==1||!(l instanceof m))throw new c(`expected exactly one root element, got ${r.length}`);return l;function d(o){o!==""&&a(new h(U(o)))}function w(o){let u=/[\s/>]/.exec(e.slice(o+1));if(!u)throw new c(`unterminated tag at ${o}`);let S=e.slice(o+1,o+1+u.index).toLowerCase(),f=new m(S,n),i=o+1+u.index;for(;i<e.length;){for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]===">"){i++;break}if(e[i]==="/"&&e[i+1]===">"){i+=2;break}let oe=i;for(;i<e.length&&!/[\s=/>]/.test(e[i]);)i++;let y=e.slice(oe,i);if(y==="")throw new c(`malformed attribute at ${i}`);if(e[i]==="="){if(e[i+1]!=='"')throw new c(`attribute ${y} must have a double-quoted value`);let O=e.indexOf('"',i+2);if(O===-1)throw new c(`unterminated value for ${y}`);f.setAttribute(y,U(e.slice(i+2,O))),i=O+1}else f.setAttribute(y,"")}return a(f),xe.has(S)||s.push(f),i}}var q,K={getStore:()=>q,run(e,n){let t=q;q=e;try{return n()}finally{q=t}}},H=K;function Ne(e){H=e??K}function A(e={}){e.locals||(e.locals=e.request?Y(e.request):{});let n=0,t=0,r=null,s=new Map,a=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${n++}`,nextResourceId:()=>{if(r===null)return`r${t++}`;let l=s.get(r)??0;return s.set(r,l+1),`${r}:r${l}`},nextIslandNamespace:l=>{let d=a.get(l)??0;return a.set(l,d+1),`${l}#${d}`},withResourceScope(l,d){let w=r;r=l;try{return d()}finally{r=w}},pending:new Set,data:new Map}}function k(e,n){return H.run(e,n)}function N(){return H.getStore()}function Q(){return N()?.event}function we(){let e=Q();return e?(e.locals||(e.locals={}),e.locals):{}}var B=new WeakMap;function Y(e){let n=B.get(e);return n||(n={},B.set(e,n)),n}var ee=!1;function re(){ee||(ee=!0,V({createElement:(e,n)=>new m(e,n),createText:e=>new h(e),createRaw:e=>new b(e),parseTemplate:(e,n)=>G(e,n),createComment:e=>new x(e)}))}function Ee(e,n={}){let t=T;re(),v(!0);let r=A(n.event);try{return k(r,()=>ne(s=>{try{let a=typeof e=="function"?e():e;return p(a)}finally{s()}}))}finally{v(t)}}var te=!1;function Ce(){te||(te=!0,Se(e=>{N()?.pending.add(e)}),ye(()=>N()?.nextResourceId()??""),Te((e,n)=>{e&&N()?.data.set(e,n)}))}var F=null;function qe(e){F=e}function se(e){if(e.data.size===0)return"";let n={};for(let[r,s]of e.data){let a=s;if(F)try{a=F(s,r)}catch{continue}a!==void 0&&(typeof a=="function"||typeof a=="symbol"||(n[r]=a))}if(Object.keys(n).length===0)return"";let t=j(JSON.stringify(n));return t==="{}"?"":`<script type="application/json" id="${C}">${t}<\/script>`}var Ae=50;async function ke(e,n={}){let t=T;re(),v(!0),Ce();let r=A(n.event);try{return await k(r,async()=>{n.preload&&await n.preload(n.event);let s,a=null,l=()=>{};ne(u=>{l=u,a=Re(),s=typeof e=="function"?e():e});let d=()=>{try{Z(a,()=>p(s))}catch{}};d();let w=0;for(;r.pending.size>0&&w++<Ae;){let u=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(u),await be(),d()}let o=Z(a,()=>p(s))+se(r);return l(),o})}finally{v(t)}}export{C as FX_DATA_ID,x as ServerComment,m as ServerElement,g as ServerNode,h as ServerText,A as createRequestContext,j as escapeFxJson,we as getLocals,N as getRequestContext,Q as getRequestEvent,Y as getRequestLocals,me as getServerData,ue as isDomElement,ae as isDomNode,le as isDomText,T as isServer,ce as isServerNodeValue,Ee as renderToString,ke as renderToStringAsync,k as runWithRequestContext,p as serializeNode,se as serializeResourceData,qe as setDataRedactor,Ne as setRequestStore,v as setServerMode};
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(e,o)=>{for(var s in o)t(e,s,{get:o[s],enumerable:!0})},m=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!f.call(e,r)&&r!==s&&t(e,r,{get:()=>o[r],enumerable:!(n=c(o,r))||n.enumerable});return e};var p=e=>m(t({},"__esModule",{value:!0}),e);var V={};u(V,{registerCoreVersion:()=>x,stampVersions:()=>v,versions:()=>i,warnOnVersionSkew:()=>g});module.exports=p(V);var a="1.0.0-alpha.73";var l=require("@fluixi/reactive"),i={dom:a,reactive:l.VERSION};function x(e){i.core=e}function v(e){i.core&&e.setAttribute("fluixi",i.core),e.setAttribute("fx-dom",i.dom),e.setAttribute("fx-reactive",i.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=i)}function g(){let e=[i.core,i.dom,i.reactive].filter(o=>o!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${i.core??"(absent)"}, dom ${i.dom}, reactive ${i.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}
1
+ "use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(e,o)=>{for(var s in o)t(e,s,{get:o[s],enumerable:!0})},m=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!f.call(e,r)&&r!==s&&t(e,r,{get:()=>o[r],enumerable:!(n=c(o,r))||n.enumerable});return e};var p=e=>m(t({},"__esModule",{value:!0}),e);var V={};u(V,{registerCoreVersion:()=>x,stampVersions:()=>v,versions:()=>i,warnOnVersionSkew:()=>g});module.exports=p(V);var a="1.0.0-alpha.75";var l=require("@fluixi/reactive"),i={dom:a,reactive:l.VERSION};function x(e){i.core=e}function v(e){i.core&&e.setAttribute("fluixi",i.core),e.setAttribute("fx-dom",i.dom),e.setAttribute("fx-reactive",i.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=i)}function g(){let e=[i.core,i.dom,i.reactive].filter(o=>o!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${i.core??"(absent)"}, dom ${i.dom}, reactive ${i.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}
@@ -1 +1 @@
1
- var o="1.0.0-alpha.73";import{VERSION as s}from"@fluixi/reactive";var e={dom:o,reactive:s};function l(i){e.core=i}function c(i){e.core&&i.setAttribute("fluixi",e.core),i.setAttribute("fx-dom",e.dom),i.setAttribute("fx-reactive",e.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=e)}function d(){let i=[e.core,e.dom,e.reactive].filter(r=>r!==void 0);new Set(i).size<=1||console.warn(`[fluixi] package versions disagree — core ${e.core??"(absent)"}, dom ${e.dom}, reactive ${e.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}export{l as registerCoreVersion,c as stampVersions,e as versions,d as warnOnVersionSkew};
1
+ var o="1.0.0-alpha.75";import{VERSION as s}from"@fluixi/reactive";var e={dom:o,reactive:s};function l(i){e.core=i}function c(i){e.core&&i.setAttribute("fluixi",e.core),i.setAttribute("fx-dom",e.dom),i.setAttribute("fx-reactive",e.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=e)}function d(){let i=[e.core,e.dom,e.reactive].filter(r=>r!==void 0);new Set(i).size<=1||console.warn(`[fluixi] package versions disagree — core ${e.core??"(absent)"}, dom ${e.dom}, reactive ${e.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}export{l as registerCoreVersion,c as stampVersions,e as versions,d as warnOnVersionSkew};