@lytjs/renderer 3.1.0

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 (48) hide show
  1. package/dist/index.cjs +8 -0
  2. package/dist/index.d.mts +5 -0
  3. package/dist/index.mjs +8 -0
  4. package/dist/types/create-renderer.d.ts +20 -0
  5. package/dist/types/create-renderer.d.ts.map +1 -0
  6. package/dist/types/dom/dom-ops.d.ts +74 -0
  7. package/dist/types/dom/dom-ops.d.ts.map +1 -0
  8. package/dist/types/dom/dom-renderer.d.ts +243 -0
  9. package/dist/types/dom/dom-renderer.d.ts.map +1 -0
  10. package/dist/types/dom/patch-events.d.ts +123 -0
  11. package/dist/types/dom/patch-events.d.ts.map +1 -0
  12. package/dist/types/dom/patch-props.d.ts +148 -0
  13. package/dist/types/dom/patch-props.d.ts.map +1 -0
  14. package/dist/types/index.d.ts +48 -0
  15. package/dist/types/index.d.ts.map +1 -0
  16. package/dist/types/miniapp/index.d.ts +6 -0
  17. package/dist/types/miniapp/index.d.ts.map +1 -0
  18. package/dist/types/miniapp/miniapp-renderer.d.ts +269 -0
  19. package/dist/types/miniapp/miniapp-renderer.d.ts.map +1 -0
  20. package/dist/types/mount.d.ts +32 -0
  21. package/dist/types/mount.d.ts.map +1 -0
  22. package/dist/types/native/index.d.ts +6 -0
  23. package/dist/types/native/index.d.ts.map +1 -0
  24. package/dist/types/native/native-renderer.d.ts +249 -0
  25. package/dist/types/native/native-renderer.d.ts.map +1 -0
  26. package/dist/types/patch.d.ts +23 -0
  27. package/dist/types/patch.d.ts.map +1 -0
  28. package/dist/types/props.d.ts +19 -0
  29. package/dist/types/props.d.ts.map +1 -0
  30. package/dist/types/renderer-interfaces.d.ts +157 -0
  31. package/dist/types/renderer-interfaces.d.ts.map +1 -0
  32. package/dist/types/ssr/hydration.d.ts +282 -0
  33. package/dist/types/ssr/hydration.d.ts.map +1 -0
  34. package/dist/types/ssr/ssr-renderer.d.ts +292 -0
  35. package/dist/types/ssr/ssr-renderer.d.ts.map +1 -0
  36. package/dist/types/unmount.d.ts +16 -0
  37. package/dist/types/unmount.d.ts.map +1 -0
  38. package/dist/types/vapor/vapor-compiler.d.ts +67 -0
  39. package/dist/types/vapor/vapor-compiler.d.ts.map +1 -0
  40. package/dist/types/vapor/vapor-component.d.ts +48 -0
  41. package/dist/types/vapor/vapor-component.d.ts.map +1 -0
  42. package/dist/types/vapor/vapor-reactive.d.ts +109 -0
  43. package/dist/types/vapor/vapor-reactive.d.ts.map +1 -0
  44. package/dist/types/vapor/vapor-renderer.d.ts +133 -0
  45. package/dist/types/vapor/vapor-renderer.d.ts.map +1 -0
  46. package/dist/types/vnode.d.ts +134 -0
  47. package/dist/types/vnode.d.ts.map +1 -0
  48. package/package.json +43 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,8 @@
1
+ var Ne=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Pt=Object.prototype.hasOwnProperty;var Dt=(n,e)=>{for(var t in e)Ne(n,t,{get:e[t],enumerable:!0})},Ft=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jt(e))!Pt.call(n,i)&&i!==t&&Ne(n,i,{get:()=>e[i],enumerable:!(r=It(e,i))||r.enumerable});return n};var Wt=n=>Ft(Ne({},"__esModule",{value:!0}),n);var kn={};Dt(kn,{Comment:()=>Te,DOMRenderer:()=>z,Fragment:()=>ve,MiniAppRenderer:()=>G,NativeRenderer:()=>k,PatchFlags:()=>q,PatchPropFlags:()=>Oe,ShapeFlags:()=>R,StringRenderer:()=>K,Text:()=>xe,bindAttr:()=>fe,bindClass:()=>de,bindEach:()=>ze,bindEvent:()=>ue,bindIf:()=>Be,bindProp:()=>U,bindText:()=>pe,clearIslandRegistry:()=>At,clearMismatchWarnings:()=>Rt,compileToVapor:()=>he,createHydrationIsland:()=>Vt,createInvoker:()=>Le,createRenderer:()=>Je,createVaporApp:()=>Ht,createVaporElement:()=>Ke,defineVaporComponent:()=>wt,domRenderer:()=>lt,getEventInvokers:()=>rt,getEventKey:()=>Ce,getHydrateStats:()=>ht,getIslandRegistry:()=>St,getMismatchWarnings:()=>Ct,getSVGPropName:()=>nt,getVaporDOMFactory:()=>j,hydrate:()=>vt,hydrateAllIslands:()=>Tt,hydrateIsland:()=>De,isHydrating:()=>mt,isSVGElement:()=>re,miniAppRenderer:()=>Ot,nativeRenderer:()=>Lt,normalizeEventName:()=>ie,onHydrated:()=>Nt,parseEventModifier:()=>Re,parseTemplate:()=>ge,patchAllProps:()=>B,patchClass:()=>O,patchDOMProp:()=>_e,patchDOMProps:()=>tt,patchElementProps:()=>at,patchEvent:()=>W,patchEventOnElement:()=>st,patchProp:()=>T,patchStyle:()=>_,registerIslandComponent:()=>bt,removeAllEventListeners:()=>oe,removeDOMProp:()=>D,renderToStream:()=>ft,renderToStreamGenerator:()=>dt,renderToString:()=>pt,renderVaporComponent:()=>$t,renderVaporNode:()=>v,resetHydrateStats:()=>je,setDOMProp:()=>P,setHydrating:()=>gt,setVaporDOMFactory:()=>Mt,ssrRenderer:()=>ut,unmountIsland:()=>Et,vaporMount:()=>me,vaporPatch:()=>ke});module.exports=Wt(kn);var qe=require("@lytjs/vdom");var R=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(R||{}),q=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(q||{}),ve=Symbol("Fragment"),xe=Symbol("Text"),Te=Symbol("Comment");function L(n){return n.type===ve}function J(n){return n.type===xe}function Z(n){return n.type===Te}function Ge(n,e){return n.type===e.type&&n.key===e.key}function be(n){return Array.isArray(n.dynamicChildren)}function Ue(n,e,t,r){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,i,r)}else t==="key"||t==="ref"||n.setAttribute(e,t,r)}function Ee(n,e,t,r,i){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&n.removeEventListener(e,o,i),r&&n.addEventListener(e,o,r)}else n.setAttribute(e,t,r)}function Se(n,e,t,r){for(let i in r){if(i==="key"||i==="ref")continue;let o=t[i],s=r[i];s!==o&&Ee(n,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in r))if(i==="class")n.setClass(e,"");else if(i==="style")n.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();n.removeEventListener(e,o,t[i])}else n.removeAttribute(e,i)}function Ae(n,e,t,r,i,o){let{shapeFlag:s}=t;if(L(t)){zt(n,e,t,r,i,o);return}if(J(t)){let a=n.createText(t.children);t.el=a,n.insert(r,a,i);return}if(Z(t)){let a=n.createComment(t.children);t.el=a,n.insert(r,a,i);return}if(s&1){Bt(n,e,t,r,i,o);return}if(s&6){Kt(e,t,r,i,o);return}}function Bt(n,e,t,r,i,o){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];Ue(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&Q(e,f,a,null,o),n.insert(r,a,i)}function Q(n,e,t,r,i){for(let o=0;o<e.length;o++)n(null,e[o],t,r,i)}function zt(n,e,t,r,i,o){let{children:s}=t,a=n.createComment("");n.insert(r,a,i),Array.isArray(s)&&s.length>0&&Q(e,s,r,a,o),t.el=a,t.anchor=a}function Kt(n,e,t,r,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(n(null,o.subTree,t,r,o),e.el=o.subTree.el)}function Ye(n,e,t,r){let{shapeFlag:i,children:o}=t;if(L(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],r);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,r);return}t.el&&n.remove(t.el)}function ee(n,e){for(let t=0;t<e.length;t++)n(e[t])}var te=require("@lytjs/vdom");function ne(n,e,t,r,i,o=null,s=null){if(r==null){t&&e(t,i);return}if(t===null){Ae(n,Ve(n,e),r,i,o,s);return}if(be(r)&&be(t)){Yt(n,e,t,r,i,s);return}if(!Ge(t,r)){e(t,i),Ae(n,Ve(n,e),r,i,o,s);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(L(r)){Ut(n,e,t,r,i,o,s);return}if(J(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(Z(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){kt(n,e,t,r,s);return}if(a&6){Xt(t,r,s);return}}function Ve(n,e){return(t,r,i,o,s)=>{ne(n,e,t,r,i,o,s)}}function kt(n,e,t,r,i=null){let o=r.el=t.el,s=t.props||{},a=r.props||{},{patchFlag:l,dynamicProps:f}=r;if(l&&l>0){if(l&1&&t.children!==r.children&&(o.textContent=r.children),l&2&&s.class!==a.class&&n.setClass(o,a.class),l&4&&s.style!==a.style&&n.setStyle(o,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],u=a[d];u!==c&&Ee(n,o,d,u,c)}l&16&&Se(n,o,s,a)}else Se(n,o,s,a);(!l||!(l&1))&&Xe(n,e,t,r,o,null,i)}function Xe(n,e,t,r,i,o,s){let a=t.shapeFlag,l=r.shapeFlag,f=t.children,p=r.children;if(l&8){a&16&&ee(e,f),f!==p&&(i.textContent=p);return}if(l&16){a&16?Gt(n,e,f,p,i,o,s):(a&8&&(i.textContent=""),Q(Ve(n,e),p,i,o,s));return}p==null&&(a&8?i.textContent="":a&16&&ee(e,f))}function Gt(n,e,t,r,i,o,s){r.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,te.patchKeyedChildren)(t,r,i,o,s,null,!1):(0,te.patchUnkeyedChildren)(t,r,i,o,s,null,!1)}function Ut(n,e,t,r,i,o,s){let a=t.children,l=r.children;Array.isArray(l)&&l.length>0?(Xe(n,e,t,r,i,o,s),r.el=l[0].el,r.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(ee(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function Yt(n,e,t,r,i,o){let s=t.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)ne(n,e,s[l],a[l],i,null,o)}function Xt(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function Je(n){function e(i,o){Ye(n,e,i,o)}(0,qe.registerDOMOperations)({insert(i,o,s){n.insert(o,i,s)},createElement(i){return n.createElement(i)},createText(i){return n.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){n.remove(i)},createComment(i){return n.createComment(i)},mount(i,o,s,a,l,f,p){r(null,i,o,s,a)},patch(i,o,s,a,l,f,p,d){r(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){n.insert(o,i.el,s)}});function r(i,o,s,a,l){ne(n,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),r(null,i,o,null,null)},patch(i,o,s){var a;r(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var Qe={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},et={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},qt={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function P(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let i in t)n.style[i]=t[i];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(i,t);return}if(e in et){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let r=Qe[e]||e;if(r in n){try{n[r]=t==null?"":t}catch(i){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function D(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),i=n._vei;if(i){let o="on"+r.charAt(0).toUpperCase()+r.slice(1),s=i[o];s&&(n.removeEventListener(r,s),i[o]=void 0)}return}if(e in et){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=Qe[e]||e;if(t in n){try{n[t]=""}catch(r){n.removeAttribute(e)}return}n.removeAttribute(e)}function Ze(n){return n.startsWith("on")||n.startsWith("@")}function tt(n,e,t){let r=e?Object.keys(e):[],i=t?Object.keys(t):[];for(let o=0;o<i.length;o++){let s=i[o],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Jt(n,a,l):Ze(s)||P(n,s,a))}for(let o=0;o<r.length;o++){let s=r[o];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":Ze(s)||D(n,s))}}function Jt(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let r in t)r in e||(n.style[r]="");for(let r in e)n.style[r]=e[r]}function re(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function nt(n){return qt[n]||n}var Zt=/^(?:@|on)/;function ie(n){return n.replace(Zt,"").toLowerCase()}function Ce(n){let e=ie(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Qt={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function Re(n){let e=n.split("."),r={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let i=1;i<e.length;i++){let o=e[i],s=Qt[o];s&&(r[s]=!0)}return r}function Le(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var F="_vei";function rt(n){return n[F]||null}function W(n,e,t,r,i){let o=Ce(e),s=Re(ie(e)),a=s.name,l=n[F];l||(l=n[F]={});let f=l[o];if(t&&f)f.value=t;else if(t&&!f){let p=Le(t);l[o]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[o]=void 0)}function oe(n){let e=n[F];if(e){for(let t in e){let r=e[t];if(r){let i=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(i,r)}}n[F]={}}}var Oe=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(Oe||{});function O(n,e,t){let r=ot(e);r!==t&&(n.className=r)}function ot(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let r=0;r<n.length;r++){let i=ot(n[r]);i&&(t+=(t?" ":"")+i)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function _(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&it(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&it(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let r in t)r in e||(n.style[r]="");for(let r in e){let i=e[r],o=t[r];i!==o&&(n.style[r]=i==null?"":i)}}}function it(n,e){for(let t in e)n.style[t]=e[t]==null?"":e[t]}function st(n,e,t,r){W(n,"",e,t,r)}var en=new Set(["class","style","key","ref"]);function tn(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function _e(n,e,t,r,i){if(!en.has(e)){if(e==="class"){O(n,t,r);return}if(e==="style"){_(n,t,r);return}if(tn(e)){W(n,e,t,r,i);return}if(t===!1||t==null){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(o){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function T(n,e,t,r,i){_e(n,e,t,r,i)}function B(n,e,t,r){if(t)for(let i in t){if(i==="key"||i==="ref")continue;let o=t[i],s=e?e[i]:void 0;o!==s&&T(n,i,o,s,r)}if(e)for(let i in e)i==="key"||i==="ref"||(!t||!(i in t))&&T(n,i,null,e[i],r)}function at(n,e,t,r){let i=e.props||{},o=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){B(n,i,o,r);return}if(s===-2){B(n,i,o,r);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&i.class!==o.class&&O(n,o.class,i.class),s&4&&i.style!==o.style&&_(n,o.style,i.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=i[f],d=o[f];d!==p&&T(n,f,d,p,r)}s&16&&B(n,i,o,r)}var z=class{createElement(e){return re(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,r){P(e,t,r)}removeAttribute(e,t){D(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let r in t)e.style[r]=t[r]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let r="";for(let i in t)t[i]&&(r+=(r?" ":"")+i);e.className=r}else e.className=""}insert(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,r){e.replaceChild(r,t)}addEventListener(e,t,r,i){e.addEventListener(t,r,i)}removeEventListener(e,t,r){e.removeEventListener(t,r)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,r){O(e,t,r)}setStyleWithOld(e,t,r){_(e,t,r)}setAttributeWithOld(e,t,r,i){T(e,t,r,i)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){oe(e)}},lt=new z;var Me=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rn=/[&<>"']/g,x={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},on=0;function y(n){return n.replace(rn,e=>nn[e])}function sn(n,e){return n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref"||n==="__vccOpts"||n.startsWith("__")?"":e===!0?n:e===!1||e==null?"":n==="class"?`class="${y(ct(e))}"`:n==="style"?`style="${y(an(e))}"`:n==="dangerouslySetInnerHTML"||n==="innerHTML"?"":`${n}="${y(String(e))}"`}function ct(n){if(!n)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(ct).filter(Boolean).join(" ");if(typeof n=="object"){let e=[];for(let t in n)n[t]&&e.push(t);return e.join(" ")}return String(n)}function an(n){if(!n)return"";if(typeof n=="string")return n;if(typeof n=="object"){let e=[];for(let t in n)if(n[t]){let r=t.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${n[t]}`)}return e.join("; ")}return String(n)}function we(n){if(!n)return"";let e=[];for(let t in n){let r=n[t],i=sn(t,r);i&&e.push(i)}return e.length>0?" "+e.join(" "):""}var K=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,t,r){e.children.push(t)}renderToString(e){return g(e)}async*renderToStream(e){yield*se(e)}};function g(n){if(n==null)return"";let{type:e,props:t,children:r}=n;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(i=>g(i)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?ln(e,t,r,n):typeof e=="object"&&e!==null||typeof e=="function"?M(n):""}function ln(n,e,t,r){let i=we(e);if(Me.has(n))return`<${n}${i} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${n}${i}>${a}</${n}>`}let o="",s=r.shapeFlag||0;return s&x.TEXT_CHILDREN?o=y(String(t||"")):s&x.ARRAY_CHILDREN&&Array.isArray(t)?o=t.map(a=>g(a)).join(""):s&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null?o=He(t):typeof t=="string"?o=y(t):Array.isArray(t)?o=t.map(a=>g(a)).join(""):typeof t=="number"&&(o=y(String(t))),`<${n}${i}>${o}</${n}>`}function He(n){let e=[];for(let t in n){let r=n[t];if(typeof r=="function"){let i=r();Array.isArray(i)?e.push(i.map(o=>g(o)).join("")):i!=null&&e.push(g(i))}else Array.isArray(r)?e.push(r.map(i=>g(i)).join("")):r!=null&&e.push(g(r))}return e.join("")}function M(n){let e=n.type;if(e&&e.__island)return cn(n,e);if(typeof e=="function"){let t=e(n.props||{},{slots:n.children||{}});return g(t)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let t=e.render(n.props||{},{slots:n.children||{},emit:()=>{}});return g(t)}if(typeof e.setup=="function"){let t=e.setup(n.props||{},{emit:()=>{},slots:n.children||{}});if(typeof t=="function"){let r=t();return g(r)}if(typeof e.render=="function"){let r=e.render(t||{},{slots:n.children||{},emit:()=>{}});return g(r)}}}return n.component&&n.component.subTree?g(n.component.subTree):"<!---->"}function cn(n,e){var u;let t=e.name||((u=n.props)==null?void 0:u["data-island-id"])||"anonymous",r=n.props||{},i=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",s={};for(let m in r)m==="data-hydrate-when"||m==="data-island-id"||(s[m]=r[m]);let a=JSON.stringify(s),l=y(a),f="";if(typeof e.render=="function"){let m=e.render(r,{slots:n.children||{},emit:()=>{}});f=g(m)}else if(typeof e=="function"){let m=e(r,{slots:n.children||{}});f=g(m)}let p=i?` data-hydrate-when="${y(i)}"`:"",d=`<${o} data-hydrate="${y(t)}" data-props="${l}"${p}>${f}</${o}>`,c=`<script type="application/json" data-hydrate-props="${y(t)}">${a}<\/script>`;return d+c}async function*se(n){if(n==null)return;let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let i of r)yield*se(i);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*pn(e,t,r,n);return}if(typeof e=="object"||typeof e=="function"){yield M(n);return}}async function*pn(n,e,t,r){let i=we(e);if(Me.has(n)){yield`<${n}${i} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let s=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${i}>${s}</${n}>`;return}yield`<${n}${i}>`;let o=r.shapeFlag||0;if(o&x.TEXT_CHILDREN)yield y(String(t||""));else if(o&x.ARRAY_CHILDREN&&Array.isArray(t))for(let s of t)yield*se(s);else if(o&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield He(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let s of t)yield*se(s);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}function pt(n){return g(n)}function ft(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=b(n,t);return new ReadableStream({async pull(i){let{value:o,done:s}=await r.next();s?i.close():i.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*dt(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*b(n,t)}async function*b(n,e){if(n==null)return;let{type:t,props:r,children:i}=n;if(typeof t=="symbol"&&String(t)==="Symbol(Fragment)"){if(Array.isArray(i))for(let o of i)yield*b(o,e);return}if(typeof t=="symbol"&&String(t).includes("Text")){yield y(String(i||""));return}if(typeof t=="symbol"&&String(t).includes("Comment")){yield`<!--${String(i||"")}-->`;return}if(typeof t=="string"){yield*fn(t,r,i,n,e);return}if(typeof t=="object"&&t!==null){let o=t;if(o.name==="Suspense"||o._isSuspense){yield*dn(n,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*un(n,e);return}yield M(n);return}if(typeof t=="function"){yield M(n);return}}async function*fn(n,e,t,r,i){let o=we(e);if(Me.has(n)){yield`<${n}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${o}>${a}</${n}>`;return}yield`<${n}${o}>`;let s=r.shapeFlag||0;if(s&x.TEXT_CHILDREN)yield y(String(t||""));else if(s&x.ARRAY_CHILDREN&&Array.isArray(t))for(let a of t)yield*b(a,i);else if(s&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield He(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let a of t)yield*b(a,i);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}async function*dn(n,e){let t=`${e}-${on++}`,r=n.type,o=(n.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=g(o):typeof o=="string"&&(s=o));let a=n.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let d=a.default();Array.isArray(d)?l=d:d!=null&&(l=[d])}}let f=[];function p(d){for(let c of d){if(c==null)continue;let u=c.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||c.__asyncSetup)){let m=c.__asyncPromise||u.__asyncPromise;m&&f.push(m.then(()=>{}))}}}if(p(l),f.length===0){for(let d of l)yield*b(d,e);return}yield`<!--${t}-fallback-->`,yield s,await Promise.all(f),yield`<!--${t}-resolved-->`;for(let d of l)yield*b(d,e);yield`<!--/${t}-->`}async function*un(n,e){let t=n.type,r=n.__asyncPromise||t.__asyncPromise;if(r)try{await r}catch(i){yield"<!--async-component-error-->";return}yield M(n)}var ut=new K;var le={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},N=!1,Ie=[],h={success:!0,mismatches:0,hydratedNodes:0};function mt(){return N}function gt(n){N=n}function ht(){return{...h}}function je(){h={success:!0,mismatches:0,hydratedNodes:0}}function Nt(n){N?Ie.push(n):n()}function vt(n,e,t={}){je(),t.onHydrated&&Ie.push(t.onHydrated),N=!0;try{let r=e.firstElementChild;return r?(n._vnode||n.mount(e),n._vnode&&S(r,n._vnode,t),N=!1,$e(),h):(console.warn("[lyt] \u5BB9\u5668\u4E3A\u7A7A\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3"),N=!1,n.mount(e),h.success=!1,$e(),h)}catch(r){return console.error("[lyt] \u6CE8\u6C34\u5931\u8D25\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3:",r),N=!1,h.success=!1,e.innerHTML="",n.mount(e),$e(),h}}function $e(){let n=Ie.splice(0);for(let e of n)try{e()}catch(t){console.error("[lyt] onHydrated \u56DE\u8C03\u6267\u884C\u5931\u8D25:",t)}}function S(n,e,t){if(Tn(e)){hn(n,e,t);return}if(bn(e)){mn(n,e,t);return}if(En(e)){gn(n,e,t);return}if(Sn(e)){Nn(n,e,t);return}if(typeof e.type=="string"){yn(n,e,t);return}}function yn(n,e,t){let r=n.tagName.toLowerCase(),i=e.type.toLowerCase();if(r!==i){ce(n,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`,t);return}e.el=n,e.props&&Pe(n,e.props),e.ref&&xn(n,e.ref),vn(n,e,t),h.hydratedNodes++}function mn(n,e,t){if(n.nodeType!==3){ce(n,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u6587\u672C\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`)),h.hydratedNodes++}function gn(n,e,t){if(n.nodeType!==8){ce(n,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i),h.hydratedNodes++}function hn(n,e,t){if(!Array.isArray(e.children))return;let r=Array.from(n.childNodes);for(let i=0;i<e.children.length;i++){let o=e.children[i],s=r[i];if(!s){console.warn(`[lyt] Fragment \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\u5B50\u8282\u70B9\uFF0CDOM \u53EA\u6709 ${r.length} \u4E2A`),h.mismatches++;break}S(s,o,t)}}function Nn(n,e,t){if(e.component&&e.component.subTree){S(n,e.component.subTree,t),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let i=r(e.props||{},{slots:e.children||{}});if(i){S(n,i,t),e.el=i.el;return}}catch(i){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let i=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(i){S(n,i,t),e.el=i.el;return}}catch(i){}ce(n,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",t)}function vn(n,e,t){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&le.TEXT_CHILDREN){let i=n.textContent||"",o=String(e.children||"");i!==o&&(n.textContent=o,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u5B50\u8282\u70B9\u6587\u672C\u4E0D\u5339\u914D: DOM "${i}" vs VNode "${o}"`));return}if(Array.isArray(e.children)){let i=Array.from(n.childNodes),o=0;for(let s=0;s<i.length&&o<e.children.length;s++){let a=e.children[o];if(a==null){o++;continue}S(i[s],a,t),o++}o<e.children.length&&(console.warn(`[lyt] \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\uFF0CDOM \u53EA\u6709 ${i.length} \u4E2A`),h.mismatches++)}r&le.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function Pe(n,e){for(let t in e){let r=e[t];if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase();n.addEventListener(i,r)}}}function xn(n,e){typeof e=="function"?e(n):e&&typeof e=="object"&&(e.current=n)}function Tn(n){return typeof n.type=="symbol"&&String(n.type)==="Symbol(Fragment)"}function bn(n){return typeof n.type=="symbol"&&String(n.type).includes("Text")}function En(n){return typeof n.type=="symbol"&&String(n.type).includes("Comment")}function Sn(n){return!!((n.shapeFlag||0)&(le.STATEFUL_COMPONENT|le.FUNCTIONAL_COMPONENT)||typeof n.type=="object"&&n.type!==null||typeof n.type=="function")}function ce(n,e,t,r){let i=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${t}`;if(h.mismatches++,r.strict)throw new Error(i);console.warn(i)}var V=new Map,H=new Map,An={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Vn=/[&<>"']/g;function A(n){return n.replace(Vn,e=>An[e])}function De(n,e,t={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let i=r.querySelector(n);if(!i)return console.warn(`[lyt] hydrateIsland: \u672A\u627E\u5230\u5339\u914D\u5143\u7D20 "${n}"`),{success:!1,mismatches:0,hydratedNodes:0};let o=i.getAttribute("data-hydrate");if(!o)return console.warn("[lyt] hydrateIsland: \u5143\u7D20\u7F3A\u5C11 data-hydrate \u5C5E\u6027"),{success:!1,mismatches:0,hydratedNodes:0};if(i.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let s=Cn(o,r);if(s===null)return console.warn(`[lyt] hydrateIsland: \u65E0\u6CD5\u89E3\u6790 island "${o}" \u7684 props`),{success:!1,mismatches:0,hydratedNodes:0};let a=i.getAttribute("data-hydrate-when");return a||t.lazy?Rn(i,o,e,s,a||"visible",t):E(i,o,e,s,t)}function Cn(n,e){let t=e.querySelector(`script[type="application/json"][data-hydrate-props="${n}"]`);if(!t){let r=e.querySelector(`[data-hydrate="${n}"]`);if(r){let i=r.getAttribute("data-props");if(i)try{return JSON.parse(i)}catch(o){return null}}return{}}try{return JSON.parse(t.textContent||"{}")}catch(r){return null}}function E(n,e,t,r,i){let o={success:!0,mismatches:0,hydratedNodes:0};try{N=!0;let s=null;if(typeof t.render=="function")s=t.render(r,{slots:t.slots||{},emit:()=>{}});else if(typeof t.setup=="function"){let l=t.setup(r,{emit:()=>{},slots:t.slots||{}});typeof l=="function"&&(s=l())}if(!s)return console.warn(`[lyt] island "${e}": \u7EC4\u4EF6\u672A\u8FD4\u56DE VNode`),N=!1,o.success=!1,o;if(i.dev!==!1){let l=On(n,s,e);o.mismatches=l}S(n,s,i),o.hydratedNodes=h.hydratedNodes,s.props&&Pe(n,s.props),ae(n,s),n.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:t,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return V.set(e,a),H.set(e,t),N=!1,i.onHydrated&&i.onHydrated(),o}catch(s){return N=!1,console.error(`[lyt] island "${e}" \u6CE8\u6C34\u5931\u8D25:`,s),o.success=!1,o}}function ae(n,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let t=Array.from(n.children),r=0;for(let i=0;i<t.length&&r<e.children.length;i++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)Pe(t[i],o.props),ae(t[i],o);else if(typeof o.type=="object"||typeof o.type=="function"){let s=o.type;if(typeof s=="function")try{let a=s(o.props||{},{slots:o.children||{}});a&&t[i]&&ae(t[i],a)}catch(a){}else if(s&&typeof s.render=="function")try{let a=s.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&t[i]&&ae(t[i],a)}catch(a){}}r++}}}function Rn(n,e,t,r,i,o){let s={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{xt(n,e),E(n,e,t,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:t,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(V.set(e,l),H.set(e,t),i){case"visible":{if(typeof IntersectionObserver!="undefined"){let f=new IntersectionObserver(p=>{for(let d of p)d.isIntersecting&&(f.unobserve(d.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,E(n,e,t,r,o))},{rootMargin:"200px"});f.observe(n),l.observer=f}else a&&clearTimeout(a),E(n,e,t,r,o);break}case"idle":{(p=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(p,{timeout:o.timeout||2e3}):setTimeout(p,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,n.hasAttribute("data-hydrated")||E(n,e,t,r,o)});break}case"interaction":{let f=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",f),document.removeEventListener("keydown",f),document.removeEventListener("scroll",f),document.removeEventListener("touchstart",f),n.hasAttribute("data-hydrated")||E(n,e,t,r,o)};document.addEventListener("click",f,{once:!1,passive:!0}),document.addEventListener("keydown",f,{once:!1,passive:!0}),document.addEventListener("scroll",f,{once:!1,passive:!0}),document.addEventListener("touchstart",f,{once:!1,passive:!0}),l.interactionHandler=f;break}default:a&&clearTimeout(a),E(n,e,t,r,o)}return s}function xt(n,e){let t=V.get(e);t&&(t.observer&&(t.observer.disconnect(),t.observer=null),t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null),t.interactionHandler&&(document.removeEventListener("click",t.interactionHandler),document.removeEventListener("keydown",t.interactionHandler),document.removeEventListener("scroll",t.interactionHandler),document.removeEventListener("touchstart",t.interactionHandler),t.interactionHandler=null))}function Tt(n={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let t=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return t.forEach(i=>{let o=i.getAttribute("data-hydrate"),s=H.get(o);if(!s){console.warn(`[lyt] hydrateAllIslands: \u672A\u627E\u5230 island "${o}" \u7684\u7EC4\u4EF6\u6CE8\u518C`),r.success=!1;return}let a=De(`[data-hydrate="${o}"]`,s,n);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function bt(n,e){H.set(n,e)}function Et(n){if(!V.get(n))return;let t=typeof document!="undefined"?document.querySelector(`[data-hydrate="${n}"]`):null;t&&(xt(t,n),t.removeAttribute("data-hydrated")),V.delete(n),H.delete(n)}function St(){return V}function At(){V.clear(),H.clear()}function Vt(n,e={},t="div",r){let i=n.name||"anonymous",o=JSON.stringify(e),s=A(o),a="";if(typeof n.render=="function"){let d=n.render(e,{slots:n.slots||{},emit:()=>{}});a=w(d)}let l=r?` data-hydrate-when="${r}"`:"",f=`<${t} data-hydrate="${i}" data-props="${s}"${l}>${a}</${t}>`,p=`<script type="application/json" data-hydrate-props="${i}">${o}<\/script>`;return f+p}function w(n){if(n==null)return"";let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(i=>w(i)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return A(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let i=Ln(t);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${i} />`;let s="";return typeof r=="string"?s=A(r):Array.isArray(r)?s=r.map(a=>w(a)).join(""):typeof r=="number"&&(s=A(String(r))),`<${e}${i}>${s}</${e}>`}if(typeof e=="function"){let i=e(t||{},{slots:r||{}});return w(i)}if(typeof e=="object"&&e!==null){let i=e;if(typeof i.render=="function"){let o=i.render(t||{},{slots:r||{},emit:()=>{}});return w(o)}}return""}function Ln(n){if(!n)return"";let e=[];for(let t in n){let r=n[t];if(!(t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref")&&!(t==="__vccOpts"||t.startsWith("__"))&&!(t==="dangerouslySetInnerHTML"||t==="innerHTML"))if(r===!0)e.push(t);else{if(r===!1||r==null)continue;t==="class"&&typeof r=="string"?e.push(`class="${A(r)}"`):t==="style"&&typeof r=="string"?e.push(`style="${A(r)}"`):e.push(`${t}="${A(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Fe=[];function On(n,e,t){let r=0,i=_n(n),o=w(e);if(i!==o){r++;let s={islandId:t,expected:o,actual:i,suggestion:Mn(i,o,t)};Fe.push(s),console.warn(`[lyt] Hydration mismatch in island "${t}":
2
+ \u670D\u52A1\u7AEF: ${i}
3
+ \u5BA2\u6237\u7AEF: ${o}
4
+ \u5EFA\u8BAE: ${s.suggestion}`)}return r}function _n(n){let e=n.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Mn(n,e,t){if(n.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(n)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":yt(n)===yt(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${t}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function yt(n){return n.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function Ct(){return[...Fe]}function Rt(){Fe.length=0}var wn={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},Hn={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},$n={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},In=0;function We(){return`native_${++In}`}var k=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:We()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:We()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:We()}}setAttribute(e,t,r){if(e){if(t==="style"&&typeof r=="object"&&r!==null){e.props.style={...e.props.style,...this.mapStyle(r)};return}if(t==="className"||t==="class"){e.props.className=r;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=r;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:r};return}if(t==="href"){e.props.href=r;return}if(t==="placeholder"){e.props.placeholder=r;return}e.props[t]=r}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=this.mapEvent(r);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let r=this.mapStyle(t);e.props.style={...e.props.style,...r}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.props.className=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=r}removeEventListener(e,t,r){if(!e)return;let i=this.mapEvent(t);e.props[i]===r&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let r of e.children){let i=this.renderToNativeTree(r);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=r=>{let i={type:r.type,props:{...r.props},children:r.children.map(t)};return r.nativeId&&(i.nativeId=r.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return wn[e]||jn(e)}mapStyle(e){let t={};for(let[r,i]of Object.entries(e)){let o=Hn[r]||r;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return $n[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function jn(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var Lt=new k;var Pn={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},$={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Dn={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},I={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},G=class{createElement(e){return{tag:Dn[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,r){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,r);return}if(t==="v-if"||t==="if"){e.wxIf=String(r);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=$[i]||i;e.bindEvents[o]=r.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(r);return}if(t==="class"||t==="className"){e.attrs.class=String(r);return}if(t==="style"){typeof r=="object"&&r!==null?e.attrs.style=this._styleObjectToString(r):e.attrs.style=String(r);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(r);return}e.attrs[t]=String(r)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=$[r]||r;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let r=this._styleObjectToString(t);e.attrs.style=r}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.attrs.class=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=$[t]||t;e.bindEvents[o]=r.name||"handleEvent"}removeEventListener(e,t,r){if(!e)return;let i=$[t]||t;delete e.bindEvents[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=$[o]||o;e.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(e,t,i)}}querySelector(e){return null}renderToMiniAppTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__fragment__");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,r="wechat"){let i=I[r]||I.wechat,o=Pn[e];if(!o)return"";switch(e){case"if":return`${i.if}="{{${t}}}"`;case"else":return`${i.else}`;case"each":{let s=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],l=s[4]||s[3];return`${i.for}="{{${l}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${o.attr}="${t}"`}}mapEvent(e,t="wechat"){let r=I[t]||I.wechat,i=$[e]||e;return r.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${r.bind}${i}`}_applyDirective(e,t,r){switch(t){case"if":e.wxIf=String(r);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(r);break;default:e.attrs[t]=String(r)}}_styleObjectToString(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${r}`).join("; ")}_serializeToTemplate(e,t,r){let i=" ".repeat(t),o=I[r]||I.wechat;if(e.tag==="__text__")return`${i}${e.text||""}`;if(e.tag==="__comment__")return`${i}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(p=>this._serializeToTemplate(p,t,r)).join(`
5
+ `);let s=[];for(let[p,d]of Object.entries(e.attrs)){if(p==="wx:else"){s.push(o.else);continue}s.push(`${p}="${d}"`)}e.wxIf&&s.unshift(`${o.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${o.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${o.forKey}="{{${e.wxForKey}}}"`));for(let[p,d]of Object.entries(e.bindEvents)){let c=o.bind==="on"?`on${p.charAt(0).toUpperCase()}${p.slice(1)}`:`${o.bind}${p}`;s.push(`${c}="${d}"`)}for(let[p,d]of Object.entries(e.modelBindings))s.push(`model:${p}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",l=new Set(["image","input"]);if(e.children.length===0&&l.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let f=e.children.map(p=>this._serializeToTemplate(p,t+1,r)).join(`
6
+ `);return`${i}<${e.tag}${a}>
7
+ ${f}
8
+ ${i}</${e.tag}>`}};var Ot=new G;var C=require("@lytjs/reactivity/signal");function pe(n,e){return(0,C.effect)(()=>{let r=e();n.textContent=r==null?"":String(r)})}function U(n,e,t){return(0,C.effect)(()=>{let i=t();n[e]=i})}function fe(n,e,t){return(0,C.effect)(()=>{let i=t();i==null||i===!1?n.removeAttribute(e):n.setAttribute(e,i===!0?"":String(i))})}function de(n,e){return(0,C.effect)(()=>{let r=e();if(typeof r=="string")n.className=r;else if(Array.isArray(r))n.className=r.filter(Boolean).join(" ");else if(typeof r=="object"&&r!==null){let i=[];for(let o of Object.keys(r))r[o]&&i.push(o);n.className=i.join(" ")}else n.className=""})}function ue(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}function Be(n,e){return(0,C.effect)(()=>{e()?(n.style=n.style||{},n.style.display==="none"&&(n.style.display=""),n.hidden=!1):(n.style=n.style||{},n.style.display="none",n.hidden=!0)})}function ze(n,e,t,r){let i=[],o=[],s=new Map,a=(0,C.effect)(()=>{let l=e();if(!Array.isArray(l))return;let f=l.map((p,d)=>r?r(p,d):d);if(f.length===o.length){let p=!0;for(let d=0;d<f.length;d++)if(f[d]!==o[d]){p=!1;break}if(p){for(let d=0;d<l.length;d++){let c=t(l[d],d),u=i[d];u&&u.parentNode===n&&n.replaceChild(c,u),i[d]=c}return}}for(let p of i)p.parentNode===n&&n.removeChild(p);s.clear(),i=[],o=[];for(let p=0;p<l.length;p++){let d=t(l[p],p);n.appendChild(d),i.push(d),o.push(f[p]),s.set(f[p],d)}});return()=>{a();for(let l of i)l.parentNode===n&&n.removeChild(l);i=[],o=[],s.clear()}}var ye=n=>{if(typeof document!="undefined")return document.createElement(n);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function Mt(n){ye=n}function j(){return ye}function Ke(n,e,...t){let r={tag:n,children:[],props:{},events:{},bindings:[]};if(e)for(let[i,o]of Object.entries(e))if(i.startsWith("on")&&typeof o=="function"&&!_t(o)){let s=i.slice(2).toLowerCase();r.events[s]=o}else _t(o)?i==="textContent"||i==="text"?r.bindings.push({type:"text",target:"textContent",signal:o}):i==="className"||i==="class"?r.bindings.push({type:"class",target:"className",signal:o}):i==="style"?r.bindings.push({type:"style",target:"style",signal:o}):r.bindings.push({type:"prop",target:i,signal:o}):r.props[i]=o;for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}function _t(n){return typeof n!="function"?!1:!!(n._subscribe||n.set)&&!n.toString().startsWith("class")}function v(n){if(n.tag==="#text"){let t=ye("#text");return t.textContent=n.text||"",t.nodeType=3,t}let e=ye(n.tag);n.el=e;for(let[t,r]of Object.entries(n.props))if(t==="style"&&typeof r=="object")for(let[i,o]of Object.entries(r))e.style[i]=o;else t==="className"||t==="class"?e.className=String(r):e[t]=r;for(let t of n.bindings)t.type==="text"?pe(e,t.signal):t.type==="prop"?U(e,t.target,t.signal):t.type==="attr"?fe(e,t.target,t.signal):t.type==="class"?de(e,t.signal):t.type==="style"&&U(e,"style",t.signal);for(let[t,r]of Object.entries(n.events))ue(e,t,r);for(let t of n.children){let r=v(t);e.appendChild(r)}return e}function ke(n,e,t){if(n.tag!==e.tag){let o=v(e);n.el&&n.el.parentNode===t&&t.removeChild(n.el),t.appendChild(o);return}let r=n.el||v(n);e.el=r;for(let[o,s]of Object.entries(e.props))if(o==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))r.style[a]=l;else o==="className"||o==="class"?r.className=String(s):r[o]=s;e.text!==void 0&&(r.textContent=e.text);for(let[o,s]of Object.entries(n.events))e.events[o]||r.removeEventListener(o,s);for(let[o,s]of Object.entries(e.events))n.events[o]!==s&&(n.events[o]&&r.removeEventListener(o,n.events[o]),r.addEventListener(o,s));let i=Math.max(n.children.length,e.children.length);for(let o=0;o<i;o++){let s=n.children[o],a=e.children[o];if(!s&&a){let l=v(a);r.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===r&&r.removeChild(s.el):s&&a&&ke(s,a,r)}}function me(n,e){let t=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let r;if(e.render){let o=e.render(t,Ke);r=Array.isArray(o)?o:[o]}else r=[];let i=[];for(let o of r){let s=v(o);n.appendChild(s),i.push(s)}return e.mounted&&e.mounted(),()=>{e.beforeUnmount&&e.beforeUnmount();for(let o of i)n.removeChild(o);e.unmounted&&e.unmounted()}}function ge(n){let e={type:"fragment",children:[]},t=n.trim();for(;t.length>0;){let r=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(r){let i=r[1],o=r[2],s=r[3]==="/",{props:a,events:l,directives:f}=Wn(o),p={type:"element",tag:i,props:a,events:l,directives:f,children:[]};if(t=t.slice(r[0].length),s){e.children.push(p);continue}let d=`</${i}>`,c=Fn(t,i);if(c===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${i}>`);let u=t.slice(0,c);t=t.slice(c+d.length);let m=ge(u);p.children=m.children||[],e.children.push(p)}else{let i=t.indexOf("<"),o;if(i===-1?(o=t,t=""):(o=t.slice(0,i),t=t.slice(i)),o.trim())if(o.includes("{{")){let s=Bn(o);for(let a of s)a.type==="text"?e.children.push({type:"text",text:a.value}):e.children.push({type:"interpolation",expression:a.value})}else e.children.push({type:"text",text:o})}}return e}function Fn(n,e){let t=1,r=0,i=`<${e}`,o=`</${e}>`;for(;r<n.length&&t>0;){let s=n.indexOf(i,r),a=n.indexOf(o,r);if(a===-1)return-1;if(s!==-1&&s<a){let l=n[s+i.length];l===">"||l===" "||l==="/"?(t++,r=s+i.length):(r=a+o.length,t--)}else r=a+o.length,t--}return t===0?r-o.length:-1}function Wn(n){let e={},t={},r={},i=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,o;for(;(o=i.exec(n))!==null;){let s=o[1],a=o[2]||o[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);e[l]=a}else if(s==="v-if")r.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(r.each={item:l[1],expression:l[2]})}else e[s]=a}return{props:e,events:t,directives:r}}function Bn(n){let e=[],t=/\{\{([\s\S]*?)\}\}/g,r=0,i;for(;(i=t.exec(n))!==null;)i.index>r&&e.push({type:"text",value:n.slice(r,i.index)}),e.push({type:"interpolation",value:i[1].trim()}),r=i.index+i[0].length;return r<n.length&&e.push({type:"text",value:n.slice(r)}),e}function he(n){let e=ge(n);return{render:zn(e),ast:e}}function zn(n){return function(t){let r=j();return X(n,t,r)}}function X(n,e,t){var r,i;if(n.type==="fragment"){if(n.children&&n.children.length===1)return X(n.children[0],e,t);let o=t("div");if(o.nodeType=11,n.children)for(let s of n.children){let a=X(s,e,t);o.appendChild(a)}return o}if(n.type==="text"){let o=t("#text");return o.textContent=n.text||"",o.nodeType=3,o}if(n.type==="interpolation"){let o=t("span"),s=n.expression||"",a=Y(e,s);return o.textContent=a!=null?String(a):"",o}if(n.type==="element"){if((r=n.directives)!=null&&r.each){let{item:s,expression:a}=n.directives.each,l=Y(e,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let p=0;p<l.length;p++){let d={...e,[s]:l[p],index:p},c=t(n.tag);if(n.props)for(let[u,m]of Object.entries(n.props))u==="class"||u==="className"?c.className=m:c[u]=m;if(n.children)for(let u of n.children){let m=X(u,d,t);c.appendChild(m)}f.appendChild(c)}return f}let o=t(n.tag);if((i=n.directives)!=null&&i.if&&(Y(e,n.directives.if)||(o.style=o.style||{},o.style.display="none",o.hidden=!0)),n.props)for(let[s,a]of Object.entries(n.props))if(s.startsWith(":")){let l=s.slice(1),f=Y(e,a);o[l]=f}else s==="class"||s==="className"?o.className=a:o[s]=a;if(n.events)for(let[s,a]of Object.entries(n.events)){let l=Y(e,a);typeof l=="function"&&o.addEventListener(s,l)}if(n.children)for(let s of n.children){let a=X(s,e,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)o.appendChild(l);else o.appendChild(a)}return o}return t("div")}function Y(n,e){let t=e.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let o=n[t];return typeof o=="function"&&!o.prototype?o():o}let r=t.split("."),i=n;for(let o of r){if(i==null)return;i=i[o],typeof i=="function"&&!i.prototype&&r.indexOf(o)<r.length-1&&(i=i())}return i}function wt(n){return n}function Ht(n){let e=!1,t=null,r=null;return{mount(i){if(e){console.warn("[lyt:vapor] App \u5DF2\u7ECF\u6302\u8F7D\uFF0C\u4E0D\u80FD\u91CD\u590D\u6302\u8F7D");return}if(typeof i=="string")if(typeof document!="undefined"){let o=document.querySelector(i);if(!o)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${i}`);r=o}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else r=i;t=me(r,n),e=!0},unmount(){if(!e){console.warn("[lyt:vapor] App \u672A\u6302\u8F7D\uFF0C\u4E0D\u80FD\u5378\u8F7D");return}t&&(t(),t=null),e=!1,r=null}}}function $t(n){let e=n.setup?n.setup():{};n.beforeMount&&n.beforeMount();let t;if(n.template){let{render:r}=he(n.template);t=r(e)}else if(n.render){let r=n.render(e,Kn),i=Array.isArray(r)?r:[r];if(i.length===1)t=v(i[0]);else{t=j()("div");for(let s of i)t.appendChild(v(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return n.mounted&&n.mounted(),t}function Kn(n,e,...t){let r={tag:n,children:[],props:e||{},events:{},bindings:[]};for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}
@@ -0,0 +1,5 @@
1
+ // Type declarations for @lyt/renderer
2
+ // Auto-generated by bundle.js
3
+
4
+ export type { LytRenderer, RendererInstance, VNode } from './renderer'
5
+ export type { ParsedEvent, EventInvoker } from './dom/patch-events'
package/dist/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import{registerDOMOperations as ut}from"@lytjs/vdom";var H=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(H||{}),se=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(se||{}),Oe=Symbol("Fragment"),_e=Symbol("Text"),Me=Symbol("Comment");function V(n){return n.type===Oe}function W(n){return n.type===_e}function B(n){return n.type===Me}function we(n,e){return n.type===e.type&&n.key===e.key}function ae(n){return Array.isArray(n.dynamicChildren)}function He(n,e,t,r){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,i,r)}else t==="key"||t==="ref"||n.setAttribute(e,t,r)}function le(n,e,t,r,i){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&n.removeEventListener(e,o,i),r&&n.addEventListener(e,o,r)}else n.setAttribute(e,t,r)}function ce(n,e,t,r){for(let i in r){if(i==="key"||i==="ref")continue;let o=t[i],s=r[i];s!==o&&le(n,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in r))if(i==="class")n.setClass(e,"");else if(i==="style")n.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();n.removeEventListener(e,o,t[i])}else n.removeAttribute(e,i)}function pe(n,e,t,r,i,o){let{shapeFlag:s}=t;if(V(t)){it(n,e,t,r,i,o);return}if(W(t)){let a=n.createText(t.children);t.el=a,n.insert(r,a,i);return}if(B(t)){let a=n.createComment(t.children);t.el=a,n.insert(r,a,i);return}if(s&1){rt(n,e,t,r,i,o);return}if(s&6){ot(e,t,r,i,o);return}}function rt(n,e,t,r,i,o){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];He(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&z(e,f,a,null,o),n.insert(r,a,i)}function z(n,e,t,r,i){for(let o=0;o<e.length;o++)n(null,e[o],t,r,i)}function it(n,e,t,r,i,o){let{children:s}=t,a=n.createComment("");n.insert(r,a,i),Array.isArray(s)&&s.length>0&&z(e,s,r,a,o),t.el=a,t.anchor=a}function ot(n,e,t,r,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(n(null,o.subTree,t,r,o),e.el=o.subTree.el)}function $e(n,e,t,r){let{shapeFlag:i,children:o}=t;if(V(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],r);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,r);return}t.el&&n.remove(t.el)}function K(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as st,patchUnkeyedChildren as at}from"@lytjs/vdom";function k(n,e,t,r,i,o=null,s=null){if(r==null){t&&e(t,i);return}if(t===null){pe(n,fe(n,e),r,i,o,s);return}if(ae(r)&&ae(t)){ft(n,e,t,r,i,s);return}if(!we(t,r)){e(t,i),pe(n,fe(n,e),r,i,o,s);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(V(r)){pt(n,e,t,r,i,o,s);return}if(W(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(B(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){lt(n,e,t,r,s);return}if(a&6){dt(t,r,s);return}}function fe(n,e){return(t,r,i,o,s)=>{k(n,e,t,r,i,o,s)}}function lt(n,e,t,r,i=null){let o=r.el=t.el,s=t.props||{},a=r.props||{},{patchFlag:l,dynamicProps:f}=r;if(l&&l>0){if(l&1&&t.children!==r.children&&(o.textContent=r.children),l&2&&s.class!==a.class&&n.setClass(o,a.class),l&4&&s.style!==a.style&&n.setStyle(o,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],u=a[d];u!==c&&le(n,o,d,u,c)}l&16&&ce(n,o,s,a)}else ce(n,o,s,a);(!l||!(l&1))&&Ie(n,e,t,r,o,null,i)}function Ie(n,e,t,r,i,o,s){let a=t.shapeFlag,l=r.shapeFlag,f=t.children,p=r.children;if(l&8){a&16&&K(e,f),f!==p&&(i.textContent=p);return}if(l&16){a&16?ct(n,e,f,p,i,o,s):(a&8&&(i.textContent=""),z(fe(n,e),p,i,o,s));return}p==null&&(a&8?i.textContent="":a&16&&K(e,f))}function ct(n,e,t,r,i,o,s){r.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?st(t,r,i,o,s,null,!1):at(t,r,i,o,s,null,!1)}function pt(n,e,t,r,i,o,s){let a=t.children,l=r.children;Array.isArray(l)&&l.length>0?(Ie(n,e,t,r,i,o,s),r.el=l[0].el,r.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(K(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function ft(n,e,t,r,i,o){let s=t.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)k(n,e,s[l],a[l],i,null,o)}function dt(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function yt(n){function e(i,o){$e(n,e,i,o)}ut({insert(i,o,s){n.insert(o,i,s)},createElement(i){return n.createElement(i)},createText(i){return n.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){n.remove(i)},createComment(i){return n.createComment(i)},mount(i,o,s,a,l,f,p){r(null,i,o,s,a)},patch(i,o,s,a,l,f,p,d){r(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){n.insert(o,i.el,s)}});function r(i,o,s,a,l){k(n,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),r(null,i,o,null,null)},patch(i,o,s){var a;r(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var Pe={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},De={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},mt={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function G(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let i in t)n.style[i]=t[i];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(i,t);return}if(e in De){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let r=Pe[e]||e;if(r in n){try{n[r]=t==null?"":t}catch(i){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function U(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),i=n._vei;if(i){let o="on"+r.charAt(0).toUpperCase()+r.slice(1),s=i[o];s&&(n.removeEventListener(r,s),i[o]=void 0)}return}if(e in De){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=Pe[e]||e;if(t in n){try{n[t]=""}catch(r){n.removeAttribute(e)}return}n.removeAttribute(e)}function je(n){return n.startsWith("on")||n.startsWith("@")}function gt(n,e,t){let r=e?Object.keys(e):[],i=t?Object.keys(t):[];for(let o=0;o<i.length;o++){let s=i[o],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ht(n,a,l):je(s)||G(n,s,a))}for(let o=0;o<r.length;o++){let s=r[o];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":je(s)||U(n,s))}}function ht(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let r in t)r in e||(n.style[r]="");for(let r in e)n.style[r]=e[r]}function de(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Nt(n){return mt[n]||n}var vt=/^(?:@|on)/;function ue(n){return n.replace(vt,"").toLowerCase()}function Fe(n){let e=ue(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var xt={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function We(n){let e=n.split("."),r={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let i=1;i<e.length;i++){let o=e[i],s=xt[o];s&&(r[s]=!0)}return r}function Be(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var $="_vei";function Tt(n){return n[$]||null}function Y(n,e,t,r,i){let o=Fe(e),s=We(ue(e)),a=s.name,l=n[$];l||(l=n[$]={});let f=l[o];if(t&&f)f.value=t;else if(t&&!f){let p=Be(t);l[o]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[o]=void 0)}function ye(n){let e=n[$];if(e){for(let t in e){let r=e[t];if(r){let i=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(i,r)}}n[$]={}}}var Ke=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(Ke||{});function I(n,e,t){let r=ke(e);r!==t&&(n.className=r)}function ke(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let r=0;r<n.length;r++){let i=ke(n[r]);i&&(t+=(t?" ":"")+i)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function j(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ze(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ze(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let r in t)r in e||(n.style[r]="");for(let r in e){let i=e[r],o=t[r];i!==o&&(n.style[r]=i==null?"":i)}}}function ze(n,e){for(let t in e)n.style[t]=e[t]==null?"":e[t]}function bt(n,e,t,r){Y(n,"",e,t,r)}var Et=new Set(["class","style","key","ref"]);function St(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function Ge(n,e,t,r,i){if(!Et.has(e)){if(e==="class"){I(n,t,r);return}if(e==="style"){j(n,t,r);return}if(St(e)){Y(n,e,t,r,i);return}if(t===!1||t==null){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(o){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function C(n,e,t,r,i){Ge(n,e,t,r,i)}function X(n,e,t,r){if(t)for(let i in t){if(i==="key"||i==="ref")continue;let o=t[i],s=e?e[i]:void 0;o!==s&&C(n,i,o,s,r)}if(e)for(let i in e)i==="key"||i==="ref"||(!t||!(i in t))&&C(n,i,null,e[i],r)}function At(n,e,t,r){let i=e.props||{},o=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){X(n,i,o,r);return}if(s===-2){X(n,i,o,r);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&i.class!==o.class&&I(n,o.class,i.class),s&4&&i.style!==o.style&&j(n,o.style,i.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=i[f],d=o[f];d!==p&&C(n,f,d,p,r)}s&16&&X(n,i,o,r)}var q=class{createElement(e){return de(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,r){G(e,t,r)}removeAttribute(e,t){U(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let r in t)e.style[r]=t[r]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let r="";for(let i in t)t[i]&&(r+=(r?" ":"")+i);e.className=r}else e.className=""}insert(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,r){e.replaceChild(r,t)}addEventListener(e,t,r,i){e.addEventListener(t,r,i)}removeEventListener(e,t,r){e.removeEventListener(t,r)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,r){I(e,t,r)}setStyleWithOld(e,t,r){j(e,t,r)}setAttributeWithOld(e,t,r,i){C(e,t,r,i)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){ye(e)}},Vt=new q;var me=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Rt=/[&<>"']/g,v={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},Lt=0;function y(n){return n.replace(Rt,e=>Ct[e])}function Ot(n,e){return n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref"||n==="__vccOpts"||n.startsWith("__")?"":e===!0?n:e===!1||e==null?"":n==="class"?`class="${y(Ue(e))}"`:n==="style"?`style="${y(_t(e))}"`:n==="dangerouslySetInnerHTML"||n==="innerHTML"?"":`${n}="${y(String(e))}"`}function Ue(n){if(!n)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(Ue).filter(Boolean).join(" ");if(typeof n=="object"){let e=[];for(let t in n)n[t]&&e.push(t);return e.join(" ")}return String(n)}function _t(n){if(!n)return"";if(typeof n=="string")return n;if(typeof n=="object"){let e=[];for(let t in n)if(n[t]){let r=t.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${n[t]}`)}return e.join("; ")}return String(n)}function ge(n){if(!n)return"";let e=[];for(let t in n){let r=n[t],i=Ot(t,r);i&&e.push(i)}return e.length>0?" "+e.join(" "):""}var J=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,t,r){e.children.push(t)}renderToString(e){return g(e)}async*renderToStream(e){yield*Z(e)}};function g(n){if(n==null)return"";let{type:e,props:t,children:r}=n;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(i=>g(i)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Mt(e,t,r,n):typeof e=="object"&&e!==null||typeof e=="function"?R(n):""}function Mt(n,e,t,r){let i=ge(e);if(me.has(n))return`<${n}${i} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${n}${i}>${a}</${n}>`}let o="",s=r.shapeFlag||0;return s&v.TEXT_CHILDREN?o=y(String(t||"")):s&v.ARRAY_CHILDREN&&Array.isArray(t)?o=t.map(a=>g(a)).join(""):s&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null?o=he(t):typeof t=="string"?o=y(t):Array.isArray(t)?o=t.map(a=>g(a)).join(""):typeof t=="number"&&(o=y(String(t))),`<${n}${i}>${o}</${n}>`}function he(n){let e=[];for(let t in n){let r=n[t];if(typeof r=="function"){let i=r();Array.isArray(i)?e.push(i.map(o=>g(o)).join("")):i!=null&&e.push(g(i))}else Array.isArray(r)?e.push(r.map(i=>g(i)).join("")):r!=null&&e.push(g(r))}return e.join("")}function R(n){let e=n.type;if(e&&e.__island)return wt(n,e);if(typeof e=="function"){let t=e(n.props||{},{slots:n.children||{}});return g(t)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let t=e.render(n.props||{},{slots:n.children||{},emit:()=>{}});return g(t)}if(typeof e.setup=="function"){let t=e.setup(n.props||{},{emit:()=>{},slots:n.children||{}});if(typeof t=="function"){let r=t();return g(r)}if(typeof e.render=="function"){let r=e.render(t||{},{slots:n.children||{},emit:()=>{}});return g(r)}}}return n.component&&n.component.subTree?g(n.component.subTree):"<!---->"}function wt(n,e){var u;let t=e.name||((u=n.props)==null?void 0:u["data-island-id"])||"anonymous",r=n.props||{},i=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",s={};for(let m in r)m==="data-hydrate-when"||m==="data-island-id"||(s[m]=r[m]);let a=JSON.stringify(s),l=y(a),f="";if(typeof e.render=="function"){let m=e.render(r,{slots:n.children||{},emit:()=>{}});f=g(m)}else if(typeof e=="function"){let m=e(r,{slots:n.children||{}});f=g(m)}let p=i?` data-hydrate-when="${y(i)}"`:"",d=`<${o} data-hydrate="${y(t)}" data-props="${l}"${p}>${f}</${o}>`,c=`<script type="application/json" data-hydrate-props="${y(t)}">${a}<\/script>`;return d+c}async function*Z(n){if(n==null)return;let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let i of r)yield*Z(i);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Ht(e,t,r,n);return}if(typeof e=="object"||typeof e=="function"){yield R(n);return}}async function*Ht(n,e,t,r){let i=ge(e);if(me.has(n)){yield`<${n}${i} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let s=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${i}>${s}</${n}>`;return}yield`<${n}${i}>`;let o=r.shapeFlag||0;if(o&v.TEXT_CHILDREN)yield y(String(t||""));else if(o&v.ARRAY_CHILDREN&&Array.isArray(t))for(let s of t)yield*Z(s);else if(o&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield he(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let s of t)yield*Z(s);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}function $t(n){return g(n)}function It(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=T(n,t);return new ReadableStream({async pull(i){let{value:o,done:s}=await r.next();s?i.close():i.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*jt(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*T(n,t)}async function*T(n,e){if(n==null)return;let{type:t,props:r,children:i}=n;if(typeof t=="symbol"&&String(t)==="Symbol(Fragment)"){if(Array.isArray(i))for(let o of i)yield*T(o,e);return}if(typeof t=="symbol"&&String(t).includes("Text")){yield y(String(i||""));return}if(typeof t=="symbol"&&String(t).includes("Comment")){yield`<!--${String(i||"")}-->`;return}if(typeof t=="string"){yield*Pt(t,r,i,n,e);return}if(typeof t=="object"&&t!==null){let o=t;if(o.name==="Suspense"||o._isSuspense){yield*Dt(n,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*Ft(n,e);return}yield R(n);return}if(typeof t=="function"){yield R(n);return}}async function*Pt(n,e,t,r,i){let o=ge(e);if(me.has(n)){yield`<${n}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${o}>${a}</${n}>`;return}yield`<${n}${o}>`;let s=r.shapeFlag||0;if(s&v.TEXT_CHILDREN)yield y(String(t||""));else if(s&v.ARRAY_CHILDREN&&Array.isArray(t))for(let a of t)yield*T(a,i);else if(s&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield he(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let a of t)yield*T(a,i);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}async function*Dt(n,e){let t=`${e}-${Lt++}`,r=n.type,o=(n.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=g(o):typeof o=="string"&&(s=o));let a=n.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let d=a.default();Array.isArray(d)?l=d:d!=null&&(l=[d])}}let f=[];function p(d){for(let c of d){if(c==null)continue;let u=c.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||c.__asyncSetup)){let m=c.__asyncPromise||u.__asyncPromise;m&&f.push(m.then(()=>{}))}}}if(p(l),f.length===0){for(let d of l)yield*T(d,e);return}yield`<!--${t}-fallback-->`,yield s,await Promise.all(f),yield`<!--${t}-resolved-->`;for(let d of l)yield*T(d,e);yield`<!--/${t}-->`}async function*Ft(n,e){let t=n.type,r=n.__asyncPromise||t.__asyncPromise;if(r)try{await r}catch(i){yield"<!--async-component-error-->";return}yield R(n)}var Wt=new J;var ee={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},N=!1,ve=[],h={success:!0,mismatches:0,hydratedNodes:0};function Bt(){return N}function zt(n){N=n}function Kt(){return{...h}}function Xe(){h={success:!0,mismatches:0,hydratedNodes:0}}function kt(n){N?ve.push(n):n()}function Gt(n,e,t={}){Xe(),t.onHydrated&&ve.push(t.onHydrated),N=!0;try{let r=e.firstElementChild;return r?(n._vnode||n.mount(e),n._vnode&&E(r,n._vnode,t),N=!1,Ne(),h):(console.warn("[lyt] \u5BB9\u5668\u4E3A\u7A7A\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3"),N=!1,n.mount(e),h.success=!1,Ne(),h)}catch(r){return console.error("[lyt] \u6CE8\u6C34\u5931\u8D25\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3:",r),N=!1,h.success=!1,e.innerHTML="",n.mount(e),Ne(),h}}function Ne(){let n=ve.splice(0);for(let e of n)try{e()}catch(t){console.error("[lyt] onHydrated \u56DE\u8C03\u6267\u884C\u5931\u8D25:",t)}}function E(n,e,t){if(en(e)){qt(n,e,t);return}if(tn(e)){Yt(n,e,t);return}if(nn(e)){Xt(n,e,t);return}if(rn(e)){Jt(n,e,t);return}if(typeof e.type=="string"){Ut(n,e,t);return}}function Ut(n,e,t){let r=n.tagName.toLowerCase(),i=e.type.toLowerCase();if(r!==i){te(n,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`,t);return}e.el=n,e.props&&xe(n,e.props),e.ref&&Qt(n,e.ref),Zt(n,e,t),h.hydratedNodes++}function Yt(n,e,t){if(n.nodeType!==3){te(n,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u6587\u672C\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`)),h.hydratedNodes++}function Xt(n,e,t){if(n.nodeType!==8){te(n,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i),h.hydratedNodes++}function qt(n,e,t){if(!Array.isArray(e.children))return;let r=Array.from(n.childNodes);for(let i=0;i<e.children.length;i++){let o=e.children[i],s=r[i];if(!s){console.warn(`[lyt] Fragment \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\u5B50\u8282\u70B9\uFF0CDOM \u53EA\u6709 ${r.length} \u4E2A`),h.mismatches++;break}E(s,o,t)}}function Jt(n,e,t){if(e.component&&e.component.subTree){E(n,e.component.subTree,t),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let i=r(e.props||{},{slots:e.children||{}});if(i){E(n,i,t),e.el=i.el;return}}catch(i){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let i=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(i){E(n,i,t),e.el=i.el;return}}catch(i){}te(n,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",t)}function Zt(n,e,t){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&ee.TEXT_CHILDREN){let i=n.textContent||"",o=String(e.children||"");i!==o&&(n.textContent=o,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u5B50\u8282\u70B9\u6587\u672C\u4E0D\u5339\u914D: DOM "${i}" vs VNode "${o}"`));return}if(Array.isArray(e.children)){let i=Array.from(n.childNodes),o=0;for(let s=0;s<i.length&&o<e.children.length;s++){let a=e.children[o];if(a==null){o++;continue}E(i[s],a,t),o++}o<e.children.length&&(console.warn(`[lyt] \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\uFF0CDOM \u53EA\u6709 ${i.length} \u4E2A`),h.mismatches++)}r&ee.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function xe(n,e){for(let t in e){let r=e[t];if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase();n.addEventListener(i,r)}}}function Qt(n,e){typeof e=="function"?e(n):e&&typeof e=="object"&&(e.current=n)}function en(n){return typeof n.type=="symbol"&&String(n.type)==="Symbol(Fragment)"}function tn(n){return typeof n.type=="symbol"&&String(n.type).includes("Text")}function nn(n){return typeof n.type=="symbol"&&String(n.type).includes("Comment")}function rn(n){return!!((n.shapeFlag||0)&(ee.STATEFUL_COMPONENT|ee.FUNCTIONAL_COMPONENT)||typeof n.type=="object"&&n.type!==null||typeof n.type=="function")}function te(n,e,t,r){let i=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${t}`;if(h.mismatches++,r.strict)throw new Error(i);console.warn(i)}var A=new Map,O=new Map,on={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sn=/[&<>"']/g;function S(n){return n.replace(sn,e=>on[e])}function qe(n,e,t={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let i=r.querySelector(n);if(!i)return console.warn(`[lyt] hydrateIsland: \u672A\u627E\u5230\u5339\u914D\u5143\u7D20 "${n}"`),{success:!1,mismatches:0,hydratedNodes:0};let o=i.getAttribute("data-hydrate");if(!o)return console.warn("[lyt] hydrateIsland: \u5143\u7D20\u7F3A\u5C11 data-hydrate \u5C5E\u6027"),{success:!1,mismatches:0,hydratedNodes:0};if(i.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let s=an(o,r);if(s===null)return console.warn(`[lyt] hydrateIsland: \u65E0\u6CD5\u89E3\u6790 island "${o}" \u7684 props`),{success:!1,mismatches:0,hydratedNodes:0};let a=i.getAttribute("data-hydrate-when");return a||t.lazy?ln(i,o,e,s,a||"visible",t):b(i,o,e,s,t)}function an(n,e){let t=e.querySelector(`script[type="application/json"][data-hydrate-props="${n}"]`);if(!t){let r=e.querySelector(`[data-hydrate="${n}"]`);if(r){let i=r.getAttribute("data-props");if(i)try{return JSON.parse(i)}catch(o){return null}}return{}}try{return JSON.parse(t.textContent||"{}")}catch(r){return null}}function b(n,e,t,r,i){let o={success:!0,mismatches:0,hydratedNodes:0};try{N=!0;let s=null;if(typeof t.render=="function")s=t.render(r,{slots:t.slots||{},emit:()=>{}});else if(typeof t.setup=="function"){let l=t.setup(r,{emit:()=>{},slots:t.slots||{}});typeof l=="function"&&(s=l())}if(!s)return console.warn(`[lyt] island "${e}": \u7EC4\u4EF6\u672A\u8FD4\u56DE VNode`),N=!1,o.success=!1,o;if(i.dev!==!1){let l=gn(n,s,e);o.mismatches=l}E(n,s,i),o.hydratedNodes=h.hydratedNodes,s.props&&xe(n,s.props),Q(n,s),n.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:t,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return A.set(e,a),O.set(e,t),N=!1,i.onHydrated&&i.onHydrated(),o}catch(s){return N=!1,console.error(`[lyt] island "${e}" \u6CE8\u6C34\u5931\u8D25:`,s),o.success=!1,o}}function Q(n,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let t=Array.from(n.children),r=0;for(let i=0;i<t.length&&r<e.children.length;i++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)xe(t[i],o.props),Q(t[i],o);else if(typeof o.type=="object"||typeof o.type=="function"){let s=o.type;if(typeof s=="function")try{let a=s(o.props||{},{slots:o.children||{}});a&&t[i]&&Q(t[i],a)}catch(a){}else if(s&&typeof s.render=="function")try{let a=s.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&t[i]&&Q(t[i],a)}catch(a){}}r++}}}function ln(n,e,t,r,i,o){let s={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{Je(n,e),b(n,e,t,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:t,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(A.set(e,l),O.set(e,t),i){case"visible":{if(typeof IntersectionObserver!="undefined"){let f=new IntersectionObserver(p=>{for(let d of p)d.isIntersecting&&(f.unobserve(d.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,b(n,e,t,r,o))},{rootMargin:"200px"});f.observe(n),l.observer=f}else a&&clearTimeout(a),b(n,e,t,r,o);break}case"idle":{(p=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(p,{timeout:o.timeout||2e3}):setTimeout(p,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,n.hasAttribute("data-hydrated")||b(n,e,t,r,o)});break}case"interaction":{let f=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",f),document.removeEventListener("keydown",f),document.removeEventListener("scroll",f),document.removeEventListener("touchstart",f),n.hasAttribute("data-hydrated")||b(n,e,t,r,o)};document.addEventListener("click",f,{once:!1,passive:!0}),document.addEventListener("keydown",f,{once:!1,passive:!0}),document.addEventListener("scroll",f,{once:!1,passive:!0}),document.addEventListener("touchstart",f,{once:!1,passive:!0}),l.interactionHandler=f;break}default:a&&clearTimeout(a),b(n,e,t,r,o)}return s}function Je(n,e){let t=A.get(e);t&&(t.observer&&(t.observer.disconnect(),t.observer=null),t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null),t.interactionHandler&&(document.removeEventListener("click",t.interactionHandler),document.removeEventListener("keydown",t.interactionHandler),document.removeEventListener("scroll",t.interactionHandler),document.removeEventListener("touchstart",t.interactionHandler),t.interactionHandler=null))}function cn(n={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let t=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return t.forEach(i=>{let o=i.getAttribute("data-hydrate"),s=O.get(o);if(!s){console.warn(`[lyt] hydrateAllIslands: \u672A\u627E\u5230 island "${o}" \u7684\u7EC4\u4EF6\u6CE8\u518C`),r.success=!1;return}let a=qe(`[data-hydrate="${o}"]`,s,n);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function pn(n,e){O.set(n,e)}function fn(n){if(!A.get(n))return;let t=typeof document!="undefined"?document.querySelector(`[data-hydrate="${n}"]`):null;t&&(Je(t,n),t.removeAttribute("data-hydrated")),A.delete(n),O.delete(n)}function dn(){return A}function un(){A.clear(),O.clear()}function yn(n,e={},t="div",r){let i=n.name||"anonymous",o=JSON.stringify(e),s=S(o),a="";if(typeof n.render=="function"){let d=n.render(e,{slots:n.slots||{},emit:()=>{}});a=L(d)}let l=r?` data-hydrate-when="${r}"`:"",f=`<${t} data-hydrate="${i}" data-props="${s}"${l}>${a}</${t}>`,p=`<script type="application/json" data-hydrate-props="${i}">${o}<\/script>`;return f+p}function L(n){if(n==null)return"";let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(i=>L(i)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return S(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let i=mn(t);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${i} />`;let s="";return typeof r=="string"?s=S(r):Array.isArray(r)?s=r.map(a=>L(a)).join(""):typeof r=="number"&&(s=S(String(r))),`<${e}${i}>${s}</${e}>`}if(typeof e=="function"){let i=e(t||{},{slots:r||{}});return L(i)}if(typeof e=="object"&&e!==null){let i=e;if(typeof i.render=="function"){let o=i.render(t||{},{slots:r||{},emit:()=>{}});return L(o)}}return""}function mn(n){if(!n)return"";let e=[];for(let t in n){let r=n[t];if(!(t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref")&&!(t==="__vccOpts"||t.startsWith("__"))&&!(t==="dangerouslySetInnerHTML"||t==="innerHTML"))if(r===!0)e.push(t);else{if(r===!1||r==null)continue;t==="class"&&typeof r=="string"?e.push(`class="${S(r)}"`):t==="style"&&typeof r=="string"?e.push(`style="${S(r)}"`):e.push(`${t}="${S(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Te=[];function gn(n,e,t){let r=0,i=hn(n),o=L(e);if(i!==o){r++;let s={islandId:t,expected:o,actual:i,suggestion:Nn(i,o,t)};Te.push(s),console.warn(`[lyt] Hydration mismatch in island "${t}":
2
+ \u670D\u52A1\u7AEF: ${i}
3
+ \u5BA2\u6237\u7AEF: ${o}
4
+ \u5EFA\u8BAE: ${s.suggestion}`)}return r}function hn(n){let e=n.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Nn(n,e,t){if(n.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(n)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":Ye(n)===Ye(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${t}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function Ye(n){return n.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function vn(){return[...Te]}function xn(){Te.length=0}var Tn={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},bn={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},En={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},Sn=0;function be(){return`native_${++Sn}`}var ne=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:be()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:be()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:be()}}setAttribute(e,t,r){if(e){if(t==="style"&&typeof r=="object"&&r!==null){e.props.style={...e.props.style,...this.mapStyle(r)};return}if(t==="className"||t==="class"){e.props.className=r;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=r;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:r};return}if(t==="href"){e.props.href=r;return}if(t==="placeholder"){e.props.placeholder=r;return}e.props[t]=r}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=this.mapEvent(r);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let r=this.mapStyle(t);e.props.style={...e.props.style,...r}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.props.className=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=r}removeEventListener(e,t,r){if(!e)return;let i=this.mapEvent(t);e.props[i]===r&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let r of e.children){let i=this.renderToNativeTree(r);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=r=>{let i={type:r.type,props:{...r.props},children:r.children.map(t)};return r.nativeId&&(i.nativeId=r.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return Tn[e]||An(e)}mapStyle(e){let t={};for(let[r,i]of Object.entries(e)){let o=bn[r]||r;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return En[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function An(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var Vn=new ne;var Cn={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},_={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Rn={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},M={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},re=class{createElement(e){return{tag:Rn[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,r){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,r);return}if(t==="v-if"||t==="if"){e.wxIf=String(r);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=_[i]||i;e.bindEvents[o]=r.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(r);return}if(t==="class"||t==="className"){e.attrs.class=String(r);return}if(t==="style"){typeof r=="object"&&r!==null?e.attrs.style=this._styleObjectToString(r):e.attrs.style=String(r);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(r);return}e.attrs[t]=String(r)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=_[r]||r;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let r=this._styleObjectToString(t);e.attrs.style=r}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.attrs.class=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=_[t]||t;e.bindEvents[o]=r.name||"handleEvent"}removeEventListener(e,t,r){if(!e)return;let i=_[t]||t;delete e.bindEvents[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=_[o]||o;e.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(e,t,i)}}querySelector(e){return null}renderToMiniAppTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__fragment__");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,r="wechat"){let i=M[r]||M.wechat,o=Cn[e];if(!o)return"";switch(e){case"if":return`${i.if}="{{${t}}}"`;case"else":return`${i.else}`;case"each":{let s=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],l=s[4]||s[3];return`${i.for}="{{${l}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${o.attr}="${t}"`}}mapEvent(e,t="wechat"){let r=M[t]||M.wechat,i=_[e]||e;return r.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${r.bind}${i}`}_applyDirective(e,t,r){switch(t){case"if":e.wxIf=String(r);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(r);break;default:e.attrs[t]=String(r)}}_styleObjectToString(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${r}`).join("; ")}_serializeToTemplate(e,t,r){let i=" ".repeat(t),o=M[r]||M.wechat;if(e.tag==="__text__")return`${i}${e.text||""}`;if(e.tag==="__comment__")return`${i}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(p=>this._serializeToTemplate(p,t,r)).join(`
5
+ `);let s=[];for(let[p,d]of Object.entries(e.attrs)){if(p==="wx:else"){s.push(o.else);continue}s.push(`${p}="${d}"`)}e.wxIf&&s.unshift(`${o.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${o.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${o.forKey}="{{${e.wxForKey}}}"`));for(let[p,d]of Object.entries(e.bindEvents)){let c=o.bind==="on"?`on${p.charAt(0).toUpperCase()}${p.slice(1)}`:`${o.bind}${p}`;s.push(`${c}="${d}"`)}for(let[p,d]of Object.entries(e.modelBindings))s.push(`model:${p}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",l=new Set(["image","input"]);if(e.children.length===0&&l.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let f=e.children.map(p=>this._serializeToTemplate(p,t+1,r)).join(`
6
+ `);return`${i}<${e.tag}${a}>
7
+ ${f}
8
+ ${i}</${e.tag}>`}};var Ln=new re;import{effect as w}from"@lytjs/reactivity/signal";function Ee(n,e){return w(()=>{let r=e();n.textContent=r==null?"":String(r)})}function ie(n,e,t){return w(()=>{let i=t();n[e]=i})}function Se(n,e,t){return w(()=>{let i=t();i==null||i===!1?n.removeAttribute(e):n.setAttribute(e,i===!0?"":String(i))})}function Ae(n,e){return w(()=>{let r=e();if(typeof r=="string")n.className=r;else if(Array.isArray(r))n.className=r.filter(Boolean).join(" ");else if(typeof r=="object"&&r!==null){let i=[];for(let o of Object.keys(r))r[o]&&i.push(o);n.className=i.join(" ")}else n.className=""})}function Ve(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}function Ze(n,e){return w(()=>{e()?(n.style=n.style||{},n.style.display==="none"&&(n.style.display=""),n.hidden=!1):(n.style=n.style||{},n.style.display="none",n.hidden=!0)})}function Qe(n,e,t,r){let i=[],o=[],s=new Map,a=w(()=>{let l=e();if(!Array.isArray(l))return;let f=l.map((p,d)=>r?r(p,d):d);if(f.length===o.length){let p=!0;for(let d=0;d<f.length;d++)if(f[d]!==o[d]){p=!1;break}if(p){for(let d=0;d<l.length;d++){let c=t(l[d],d),u=i[d];u&&u.parentNode===n&&n.replaceChild(c,u),i[d]=c}return}}for(let p of i)p.parentNode===n&&n.removeChild(p);s.clear(),i=[],o=[];for(let p=0;p<l.length;p++){let d=t(l[p],p);n.appendChild(d),i.push(d),o.push(f[p]),s.set(f[p],d)}});return()=>{a();for(let l of i)l.parentNode===n&&n.removeChild(l);i=[],o=[],s.clear()}}var oe=n=>{if(typeof document!="undefined")return document.createElement(n);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function On(n){oe=n}function P(){return oe}function tt(n,e,...t){let r={tag:n,children:[],props:{},events:{},bindings:[]};if(e)for(let[i,o]of Object.entries(e))if(i.startsWith("on")&&typeof o=="function"&&!et(o)){let s=i.slice(2).toLowerCase();r.events[s]=o}else et(o)?i==="textContent"||i==="text"?r.bindings.push({type:"text",target:"textContent",signal:o}):i==="className"||i==="class"?r.bindings.push({type:"class",target:"className",signal:o}):i==="style"?r.bindings.push({type:"style",target:"style",signal:o}):r.bindings.push({type:"prop",target:i,signal:o}):r.props[i]=o;for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}function et(n){return typeof n!="function"?!1:!!(n._subscribe||n.set)&&!n.toString().startsWith("class")}function x(n){if(n.tag==="#text"){let t=oe("#text");return t.textContent=n.text||"",t.nodeType=3,t}let e=oe(n.tag);n.el=e;for(let[t,r]of Object.entries(n.props))if(t==="style"&&typeof r=="object")for(let[i,o]of Object.entries(r))e.style[i]=o;else t==="className"||t==="class"?e.className=String(r):e[t]=r;for(let t of n.bindings)t.type==="text"?Ee(e,t.signal):t.type==="prop"?ie(e,t.target,t.signal):t.type==="attr"?Se(e,t.target,t.signal):t.type==="class"?Ae(e,t.signal):t.type==="style"&&ie(e,"style",t.signal);for(let[t,r]of Object.entries(n.events))Ve(e,t,r);for(let t of n.children){let r=x(t);e.appendChild(r)}return e}function nt(n,e,t){if(n.tag!==e.tag){let o=x(e);n.el&&n.el.parentNode===t&&t.removeChild(n.el),t.appendChild(o);return}let r=n.el||x(n);e.el=r;for(let[o,s]of Object.entries(e.props))if(o==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))r.style[a]=l;else o==="className"||o==="class"?r.className=String(s):r[o]=s;e.text!==void 0&&(r.textContent=e.text);for(let[o,s]of Object.entries(n.events))e.events[o]||r.removeEventListener(o,s);for(let[o,s]of Object.entries(e.events))n.events[o]!==s&&(n.events[o]&&r.removeEventListener(o,n.events[o]),r.addEventListener(o,s));let i=Math.max(n.children.length,e.children.length);for(let o=0;o<i;o++){let s=n.children[o],a=e.children[o];if(!s&&a){let l=x(a);r.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===r&&r.removeChild(s.el):s&&a&&nt(s,a,r)}}function Ce(n,e){let t=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let r;if(e.render){let o=e.render(t,tt);r=Array.isArray(o)?o:[o]}else r=[];let i=[];for(let o of r){let s=x(o);n.appendChild(s),i.push(s)}return e.mounted&&e.mounted(),()=>{e.beforeUnmount&&e.beforeUnmount();for(let o of i)n.removeChild(o);e.unmounted&&e.unmounted()}}function Re(n){let e={type:"fragment",children:[]},t=n.trim();for(;t.length>0;){let r=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(r){let i=r[1],o=r[2],s=r[3]==="/",{props:a,events:l,directives:f}=Mn(o),p={type:"element",tag:i,props:a,events:l,directives:f,children:[]};if(t=t.slice(r[0].length),s){e.children.push(p);continue}let d=`</${i}>`,c=_n(t,i);if(c===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${i}>`);let u=t.slice(0,c);t=t.slice(c+d.length);let m=Re(u);p.children=m.children||[],e.children.push(p)}else{let i=t.indexOf("<"),o;if(i===-1?(o=t,t=""):(o=t.slice(0,i),t=t.slice(i)),o.trim())if(o.includes("{{")){let s=wn(o);for(let a of s)a.type==="text"?e.children.push({type:"text",text:a.value}):e.children.push({type:"interpolation",expression:a.value})}else e.children.push({type:"text",text:o})}}return e}function _n(n,e){let t=1,r=0,i=`<${e}`,o=`</${e}>`;for(;r<n.length&&t>0;){let s=n.indexOf(i,r),a=n.indexOf(o,r);if(a===-1)return-1;if(s!==-1&&s<a){let l=n[s+i.length];l===">"||l===" "||l==="/"?(t++,r=s+i.length):(r=a+o.length,t--)}else r=a+o.length,t--}return t===0?r-o.length:-1}function Mn(n){let e={},t={},r={},i=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,o;for(;(o=i.exec(n))!==null;){let s=o[1],a=o[2]||o[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);e[l]=a}else if(s==="v-if")r.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(r.each={item:l[1],expression:l[2]})}else e[s]=a}return{props:e,events:t,directives:r}}function wn(n){let e=[],t=/\{\{([\s\S]*?)\}\}/g,r=0,i;for(;(i=t.exec(n))!==null;)i.index>r&&e.push({type:"text",value:n.slice(r,i.index)}),e.push({type:"interpolation",value:i[1].trim()}),r=i.index+i[0].length;return r<n.length&&e.push({type:"text",value:n.slice(r)}),e}function Le(n){let e=Re(n);return{render:Hn(e),ast:e}}function Hn(n){return function(t){let r=P();return F(n,t,r)}}function F(n,e,t){var r,i;if(n.type==="fragment"){if(n.children&&n.children.length===1)return F(n.children[0],e,t);let o=t("div");if(o.nodeType=11,n.children)for(let s of n.children){let a=F(s,e,t);o.appendChild(a)}return o}if(n.type==="text"){let o=t("#text");return o.textContent=n.text||"",o.nodeType=3,o}if(n.type==="interpolation"){let o=t("span"),s=n.expression||"",a=D(e,s);return o.textContent=a!=null?String(a):"",o}if(n.type==="element"){if((r=n.directives)!=null&&r.each){let{item:s,expression:a}=n.directives.each,l=D(e,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let p=0;p<l.length;p++){let d={...e,[s]:l[p],index:p},c=t(n.tag);if(n.props)for(let[u,m]of Object.entries(n.props))u==="class"||u==="className"?c.className=m:c[u]=m;if(n.children)for(let u of n.children){let m=F(u,d,t);c.appendChild(m)}f.appendChild(c)}return f}let o=t(n.tag);if((i=n.directives)!=null&&i.if&&(D(e,n.directives.if)||(o.style=o.style||{},o.style.display="none",o.hidden=!0)),n.props)for(let[s,a]of Object.entries(n.props))if(s.startsWith(":")){let l=s.slice(1),f=D(e,a);o[l]=f}else s==="class"||s==="className"?o.className=a:o[s]=a;if(n.events)for(let[s,a]of Object.entries(n.events)){let l=D(e,a);typeof l=="function"&&o.addEventListener(s,l)}if(n.children)for(let s of n.children){let a=F(s,e,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)o.appendChild(l);else o.appendChild(a)}return o}return t("div")}function D(n,e){let t=e.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let o=n[t];return typeof o=="function"&&!o.prototype?o():o}let r=t.split("."),i=n;for(let o of r){if(i==null)return;i=i[o],typeof i=="function"&&!i.prototype&&r.indexOf(o)<r.length-1&&(i=i())}return i}function $n(n){return n}function In(n){let e=!1,t=null,r=null;return{mount(i){if(e){console.warn("[lyt:vapor] App \u5DF2\u7ECF\u6302\u8F7D\uFF0C\u4E0D\u80FD\u91CD\u590D\u6302\u8F7D");return}if(typeof i=="string")if(typeof document!="undefined"){let o=document.querySelector(i);if(!o)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${i}`);r=o}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else r=i;t=Ce(r,n),e=!0},unmount(){if(!e){console.warn("[lyt:vapor] App \u672A\u6302\u8F7D\uFF0C\u4E0D\u80FD\u5378\u8F7D");return}t&&(t(),t=null),e=!1,r=null}}}function jn(n){let e=n.setup?n.setup():{};n.beforeMount&&n.beforeMount();let t;if(n.template){let{render:r}=Le(n.template);t=r(e)}else if(n.render){let r=n.render(e,Pn),i=Array.isArray(r)?r:[r];if(i.length===1)t=x(i[0]);else{t=P()("div");for(let s of i)t.appendChild(x(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return n.mounted&&n.mounted(),t}function Pn(n,e,...t){let r={tag:n,children:[],props:e||{},events:{},bindings:[]};for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}export{Me as Comment,q as DOMRenderer,Oe as Fragment,re as MiniAppRenderer,ne as NativeRenderer,se as PatchFlags,Ke as PatchPropFlags,H as ShapeFlags,J as StringRenderer,_e as Text,Se as bindAttr,Ae as bindClass,Qe as bindEach,Ve as bindEvent,Ze as bindIf,ie as bindProp,Ee as bindText,un as clearIslandRegistry,xn as clearMismatchWarnings,Le as compileToVapor,yn as createHydrationIsland,Be as createInvoker,yt as createRenderer,In as createVaporApp,tt as createVaporElement,$n as defineVaporComponent,Vt as domRenderer,Tt as getEventInvokers,Fe as getEventKey,Kt as getHydrateStats,dn as getIslandRegistry,vn as getMismatchWarnings,Nt as getSVGPropName,P as getVaporDOMFactory,Gt as hydrate,cn as hydrateAllIslands,qe as hydrateIsland,Bt as isHydrating,de as isSVGElement,Ln as miniAppRenderer,Vn as nativeRenderer,ue as normalizeEventName,kt as onHydrated,We as parseEventModifier,Re as parseTemplate,X as patchAllProps,I as patchClass,Ge as patchDOMProp,gt as patchDOMProps,At as patchElementProps,Y as patchEvent,bt as patchEventOnElement,C as patchProp,j as patchStyle,pn as registerIslandComponent,ye as removeAllEventListeners,U as removeDOMProp,It as renderToStream,jt as renderToStreamGenerator,$t as renderToString,jn as renderVaporComponent,x as renderVaporNode,Xe as resetHydrateStats,G as setDOMProp,zt as setHydrating,On as setVaporDOMFactory,Wt as ssrRenderer,fn as unmountIsland,Ce as vaporMount,nt as vaporPatch};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Lyt.js 渲染器 — createRenderer 工厂函数
3
+ *
4
+ * 接收一个 LytRenderer 实现,返回包含 mount/patch/unmount 方法的渲染器实例。
5
+ * 渲染器实例内部实现了完整的 patch 算法,包括:
6
+ * - 元素挂载与更新
7
+ * - 文本节点处理
8
+ * - 注释节点处理
9
+ * - Fragment 多根节点处理
10
+ * - 组件挂载与更新(简化版)
11
+ * - 基于 PatchFlag 的精确更新
12
+ * - Block Tree 优化
13
+ * - 列表 diff(keyed / unkeyed)
14
+ *
15
+ * @param renderer 平台渲染器实现
16
+ * @returns 渲染器实例
17
+ */
18
+ import type { LytRenderer, RendererInstance } from './renderer-interfaces';
19
+ export declare function createRenderer(renderer: LytRenderer): RendererInstance;
20
+ //# sourceMappingURL=create-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-renderer.d.ts","sourceRoot":"","sources":["../../src/create-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAK1E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,gBAAgB,CAwFtE"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Lyt.js 渲染器 — DOM 操作辅助函数
3
+ *
4
+ * 本模块提供 DOM 属性操作的底层辅助函数,包括:
5
+ * 1. 智能属性设置 —— 区分 DOM property 和 HTML attribute
6
+ * 2. 属性移除
7
+ * 3. 属性 Diff 更新 —— 对比新旧 props,只更新变化的部分
8
+ * 4. 事件监听器的缓存管理
9
+ *
10
+ * 核心设计原则:
11
+ * - 优先使用 DOM property(如 el.checked, el.value)
12
+ * - 某些属性只能通过 attribute 设置(如 el.setAttribute('class', ...))
13
+ * - 事件使用 invoker 缓存模式,避免频繁 addEventListener/removeEventListener
14
+ */
15
+ /**
16
+ * 智能设置 DOM 属性
17
+ *
18
+ * 根据属性类型选择最优的设置方式:
19
+ * - class → el.className
20
+ * - style → el.style.cssText(字符串)或逐项设置(对象)
21
+ * - 事件(on* / @*)→ 通过事件系统处理
22
+ * - 布尔属性 → el[key] = value 或 el.removeAttribute(key)
23
+ * - DOM property → el[key] = value
24
+ * - 其他 → el.setAttribute(key, value)
25
+ *
26
+ * @param el DOM 元素
27
+ * @param key 属性名
28
+ * @param value 属性值
29
+ */
30
+ export declare function setDOMProp(el: any, key: string, value: any): void;
31
+ /**
32
+ * 移除 DOM 属性
33
+ *
34
+ * 根据属性类型选择正确的移除方式:
35
+ * - class → el.className = ''
36
+ * - style → el.style.cssText = ''
37
+ * - 事件 → el.removeEventListener
38
+ * - 布尔属性 → el.removeAttribute + el[key] = false
39
+ * - DOM property → el[key] = ''
40
+ * - 其他 → el.removeAttribute
41
+ *
42
+ * @param el DOM 元素
43
+ * @param key 属性名
44
+ */
45
+ export declare function removeDOMProp(el: any, key: string): void;
46
+ /**
47
+ * Diff 更新 DOM 属性
48
+ *
49
+ * 对比新旧 props,只更新变化的部分:
50
+ * 1. 遍历新 props,更新值发生变化的属性
51
+ * 2. 遍历旧 props,移除在新 props 中不存在的属性
52
+ *
53
+ * @param el DOM 元素
54
+ * @param oldProps 旧属性对象
55
+ * @param newProps 新属性对象
56
+ */
57
+ export declare function patchDOMProps(el: any, oldProps: Record<string, any> | null, newProps: Record<string, any> | null): void;
58
+ /**
59
+ * 判断一个标签名是否为 SVG 元素
60
+ *
61
+ * @param tag 标签名
62
+ * @returns 是否为 SVG 元素
63
+ */
64
+ export declare function isSVGElement(tag: string): boolean;
65
+ /**
66
+ * 获取 SVG 属性名
67
+ *
68
+ * 将 kebab-case 的 SVG 属性名转换为 camelCase 的 DOM property 名
69
+ *
70
+ * @param attr kebab-case 属性名
71
+ * @returns camelCase 属性名
72
+ */
73
+ export declare function getSVGPropName(attr: string): string;
74
+ //# sourceMappingURL=dom-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-ops.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkHH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAuEjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAuDxD;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,GAAG,EACP,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GACnC,IAAI,CAyDN;AAwCD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CA6BjD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}