@lytjs/renderer 3.1.0 → 4.0.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.
- package/dist/dom.cjs +1 -0
- package/dist/dom.mjs +1 -0
- package/dist/index.cjs +1 -8
- package/dist/index.mjs +1 -8
- package/dist/miniapp.cjs +5 -0
- package/dist/miniapp.mjs +5 -0
- package/dist/native.cjs +1 -0
- package/dist/native.mjs +1 -0
- package/dist/ssr.cjs +1 -0
- package/dist/ssr.mjs +1 -0
- package/dist/types/dom/index.d.ts +17 -0
- package/dist/types/dom/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -19
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/miniapp/index.d.ts +10 -3
- package/dist/types/miniapp/index.d.ts.map +1 -1
- package/dist/types/native/index.d.ts +10 -3
- package/dist/types/native/index.d.ts.map +1 -1
- package/dist/types/ssr/index.d.ts +15 -0
- package/dist/types/ssr/index.d.ts.map +1 -0
- package/dist/types/vapor/index.d.ts +18 -0
- package/dist/types/vapor/index.d.ts.map +1 -0
- package/dist/vapor.cjs +1 -0
- package/dist/vapor.mjs +1 -0
- package/package.json +43 -17
- package/dist/index.d.mts +0 -5
package/dist/dom.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>X,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>z,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=require("@lytjs/vdom");var u=(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))(u||{}),x=(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))(x||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){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];J(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],q=a[d];q!==c&&H(n,i,d,q,c)}l&16&&j(n,i,s,a)}else j(n,i,s,a);(!l||!(l&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(Z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)O(n,e,s[l],a[l],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){O(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={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},Ve={"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 E(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 r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],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"?Ae(n,a,l):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(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 o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(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 ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function z(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,l=n[g];l||(l=n[g]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=z(t);l[i]=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[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var X=(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))(X||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(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,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}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,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
|
package/dist/dom.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerDOMOperations as de}from"@lytjs/vdom";var m=(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))(m||{}),S=(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))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){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];G(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],W=a[d];W!==c&&_(n,i,d,W,c)}l&16&&I(n,i,s,a)}else I(n,i,s,a);(!l||!(l&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)C(n,e,s[l],a[l],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){C(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={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},ue={"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 x(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 r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function X(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],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"?ve(n,a,l):X(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":X(s)||R(n,s))}}function ve(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 o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(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 Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,l=n[v];l||(l=n[v]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);l[i]=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[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(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))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(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,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}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,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
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={"&":"&","<":"<",">":">",'"':""","'":"'"},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={"&":"&","<":"<",">":">",'"':""","'":"'"},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}
|
|
1
|
+
var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>X,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>z,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=require("@lytjs/vdom");var u=(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))(u||{}),x=(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))(x||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){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];J(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],q=a[d];q!==c&&H(n,i,d,q,c)}l&16&&j(n,i,s,a)}else j(n,i,s,a);(!l||!(l&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(Z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)O(n,e,s[l],a[l],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){O(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={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},Ve={"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 E(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 r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],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"?Ae(n,a,l):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(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 o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(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 ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function z(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,l=n[g];l||(l=n[g]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=z(t);l[i]=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[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var X=(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))(X||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(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,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}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,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
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={"&":"&","<":"<",">":">",'"':""","'":"'"},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={"&":"&","<":"<",">":">",'"':""","'":"'"},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};
|
|
1
|
+
import{registerDOMOperations as de}from"@lytjs/vdom";var m=(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))(m||{}),S=(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))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){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];G(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],W=a[d];W!==c&&_(n,i,d,W,c)}l&16&&I(n,i,s,a)}else I(n,i,s,a);(!l||!(l&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)C(n,e,s[l],a[l],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){C(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={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},ue={"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 x(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 r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function X(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],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"?ve(n,a,l):X(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":X(s)||R(n,s))}}function ve(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 o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(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 Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,l=n[v];l||(l=n[v]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);l[i]=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[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(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))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(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,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}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,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
|
package/dist/miniapp.cjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var C=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(o,t)=>{for(var e in t)C(o,e,{get:t[e],enumerable:!0})},X=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of W(t))!z.call(o,n)&&n!==e&&C(o,n,{get:()=>t[n],enumerable:!(i=H(t,n))||i.enumerable});return o};var Y=o=>X(C({},"__esModule",{value:!0}),o);var rt={};B(rt,{Comment:()=>V,Fragment:()=>R,MiniAppRenderer:()=>N,PatchFlags:()=>g,ShapeFlags:()=>m,Text:()=>v,createRenderer:()=>j,miniAppRenderer:()=>U});module.exports=Y(rt);var K=require("@lytjs/vdom");var m=(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))(m||{}),g=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(g||{}),R=Symbol("Fragment"),v=Symbol("Text"),V=Symbol("Comment");function u(o){return o.type===R}function x(o){return o.type===v}function T(o){return o.type===V}function I(o,t){return o.type===t.type&&o.key===t.key}function L(o){return Array.isArray(o.dynamicChildren)}function P(o,t,e,i){if(e==="class")o.setClass(t,i);else if(e==="style")o.setStyle(t,i);else if(e.startsWith("on")||e.startsWith("@")){let n=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();o.addEventListener(t,n,i)}else e==="key"||e==="ref"||o.setAttribute(t,e,i)}function w(o,t,e,i,n){if(e==="class")o.setClass(t,i);else if(e==="style")o.setStyle(t,i||{});else if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();n&&o.removeEventListener(t,r,n),i&&o.addEventListener(t,r,i)}else o.setAttribute(t,e,i)}function M(o,t,e,i){for(let n in i){if(n==="key"||n==="ref")continue;let r=e[n],s=i[n];s!==r&&w(o,t,n,s,r)}for(let n in e)if(!(n==="key"||n==="ref")&&!(n in i))if(n==="class")o.setClass(t,"");else if(n==="style")o.setStyle(t,{});else if(n.startsWith("on")||n.startsWith("@")){let r=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();o.removeEventListener(t,r,e[n])}else o.removeAttribute(t,n)}function S(o,t,e,i,n,r){let{shapeFlag:s}=e;if(u(e)){q(o,t,e,i,n,r);return}if(x(e)){let a=o.createText(e.children);e.el=a,o.insert(i,a,n);return}if(T(e)){let a=o.createComment(e.children);e.el=a,o.insert(i,a,n);return}if(s&1){G(o,t,e,i,n,r);return}if(s&6){Z(t,e,i,n,r);return}}function G(o,t,e,i,n,r){let s=e.type,a=o.createElement(s);if(e.el=a,e.props)for(let l in e.props){let d=e.props[l];P(o,a,l,d)}let{shapeFlag:c,children:f}=e;c&8?a.textContent=f:c&16&&A(t,f,a,null,r),o.insert(i,a,n)}function A(o,t,e,i,n){for(let r=0;r<t.length;r++)o(null,t[r],e,i,n)}function q(o,t,e,i,n,r){let{children:s}=e,a=o.createComment("");o.insert(i,a,n),Array.isArray(s)&&s.length>0&&A(t,s,i,a,r),e.el=a,e.anchor=a}function Z(o,t,e,i,n){let r=t.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,e,i,r),t.el=r.subTree.el)}function D(o,t,e,i){let{shapeFlag:n,children:r}=e;if(u(e)){if(Array.isArray(r))for(let s=0;s<r.length;s++)t(r[s],i);e.anchor&&e.anchor.parentNode&&o.remove(e.anchor);return}if(n&6){e.component&&e.component.subTree&&t(e.component.subTree,i);return}e.el&&o.remove(e.el)}function E(o,t){for(let e=0;e<t.length;e++)o(t[e])}var _=require("@lytjs/vdom");function b(o,t,e,i,n,r=null,s=null){if(i==null){e&&t(e,n);return}if(e===null){S(o,O(o,t),i,n,r,s);return}if(L(i)&&L(e)){tt(o,t,e,i,n,s);return}if(!I(e,i)){t(e,n),S(o,O(o,t),i,n,r,s);return}i.el=e.el,i.anchor=e.anchor;let{shapeFlag:a}=i;if(u(i)){k(o,t,e,i,n,r,s);return}if(x(i)){i.children!==e.children&&(i.el.nodeValue=i.children);return}if(T(i)){i.children!==e.children&&(i.el.nodeValue=i.children);return}if(a&1){J(o,t,e,i,s);return}if(a&6){et(e,i,s);return}}function O(o,t){return(e,i,n,r,s)=>{b(o,t,e,i,n,r,s)}}function J(o,t,e,i,n=null){let r=i.el=e.el,s=e.props||{},a=i.props||{},{patchFlag:c,dynamicProps:f}=i;if(c&&c>0){if(c&1&&e.children!==i.children&&(r.textContent=i.children),c&2&&s.class!==a.class&&o.setClass(r,a.class),c&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),c&8&&f)for(let l=0;l<f.length;l++){let d=f[l],p=s[d],$=a[d];$!==p&&w(o,r,d,$,p)}c&16&&M(o,r,s,a)}else M(o,r,s,a);(!c||!(c&1))&&F(o,t,e,i,r,null,n)}function F(o,t,e,i,n,r,s){let a=e.shapeFlag,c=i.shapeFlag,f=e.children,l=i.children;if(c&8){a&16&&E(t,f),f!==l&&(n.textContent=l);return}if(c&16){a&16?Q(o,t,f,l,n,r,s):(a&8&&(n.textContent=""),A(O(o,t),l,n,r,s));return}l==null&&(a&8?n.textContent="":a&16&&E(t,f))}function Q(o,t,e,i,n,r,s){i.every(c=>c.key!=null)&&e.every(c=>c.key!=null)?(0,_.patchKeyedChildren)(e,i,n,r,s,null,!1):(0,_.patchUnkeyedChildren)(e,i,n,r,s,null,!1)}function k(o,t,e,i,n,r,s){let a=e.children,c=i.children;Array.isArray(c)&&c.length>0?(F(o,t,e,i,n,r,s),i.el=c[0].el,i.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(E(t,a),i.el=e.el,i.anchor=e.anchor):(i.el=e.el,i.anchor=e.anchor)}function tt(o,t,e,i,n,r){let s=e.dynamicChildren,a=i.dynamicChildren;for(let c=0;c<a.length;c++)b(o,t,s[c],a[c],n,null,r)}function et(o,t,e){t.component=o.component,t.el=o.el,t.component&&t.component.update&&t.component.update()}function j(o){function t(n,r){D(o,t,n,r)}(0,K.registerDOMOperations)({insert(n,r,s){o.insert(r,n,s)},createElement(n){return o.createElement(n)},createText(n){return o.createText(n)},setText(n,r){n.nodeValue=r},setElementText(n,r){n.textContent=r},remove(n){o.remove(n)},createComment(n){return o.createComment(n)},mount(n,r,s,a,c,f,l){i(null,n,r,s,a)},patch(n,r,s,a,c,f,l,d){i(n,r,s,a,c)},unmount(n,r,s,a){t(n)},move(n,r,s){o.insert(r,n.el,s)}});function i(n,r,s,a,c){b(o,t,n,r,s,a,c)}return{mount(n,r){r.nodeType===1&&(r.textContent=""),i(null,n,r,null,null)},patch(n,r,s){var a;i(n,r,s||((a=n.el)==null?void 0:a.parentNode),null,null)},unmount(n,r){t(n,r)}}}var nt={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"}},y={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},it={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"},h={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"}},N=class{createElement(t){return{tag:it[t]||t,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(t){return{tag:"__text__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}createComment(t){return{tag:"__comment__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}setAttribute(t,e,i){if(t){if(e.startsWith("lyt:")){let n=e.slice(4);this._applyDirective(t,n,i);return}if(e==="v-if"||e==="if"){t.wxIf=String(i);return}if(e==="v-else"||e==="else"){t.attrs["wx:else"]="";return}if(e==="v-for"||e==="each"){let n=String(i),r=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=n;return}if(e.startsWith("on")&&typeof i=="function"){let n=e.slice(2).toLowerCase(),r=y[n]||n;t.bindEvents[r]=i.name||"handleEvent";return}if(e==="v-model"||e==="model"){t.modelBindings.value=String(i);return}if(e==="class"||e==="className"){t.attrs.class=String(i);return}if(e==="style"){typeof i=="object"&&i!==null?t.attrs.style=this._styleObjectToString(i):t.attrs.style=String(i);return}if(e==="href"&&t.tag==="navigator"){t.attrs.url=String(i);return}t.attrs[e]=String(i)}}removeAttribute(t,e){if(t)if(e==="v-if"||e==="if")delete t.wxIf;else if(e==="v-for"||e==="each")delete t.wxFor,delete t.wxForKey;else if(e.startsWith("on")){let i=e.slice(2).toLowerCase(),n=y[i]||i;delete t.bindEvents[n]}else delete t.attrs[e]}setStyle(t,e){if(!t)return;let i=this._styleObjectToString(e);t.attrs.style=i}setClass(t,e){if(t){if(typeof e=="string")t.attrs.class=e;else if(typeof e=="object"&&e!==null){let i=[];for(let[n,r]of Object.entries(e))r&&i.push(n);t.attrs.class=i.join(" ")}}}insert(t,e,i){if(!(!t||!e)){if(e._parent){let n=e._parent,r=n.children.indexOf(e);r!==-1&&n.children.splice(r,1)}if(e._parent=t,i){let n=t.children.indexOf(i);n!==-1?t.children.splice(n,0,e):t.children.push(e)}else t.children.push(e)}}remove(t){if(!t||!t._parent)return;let e=t._parent,i=e.children.indexOf(t);i!==-1&&e.children.splice(i,1),t._parent=void 0}replace(t,e,i){if(!t||!e||!i)return;let n=t.children.indexOf(e);n!==-1&&(e._parent=void 0,i._parent=t,t.children[n]=i)}addEventListener(t,e,i,n){if(!t)return;let r=y[e]||e;t.bindEvents[r]=i.name||"handleEvent"}removeEventListener(t,e,i){if(!t)return;let n=y[e]||e;delete t.bindEvents[n]}nextTick(t){Promise.resolve().then(()=>t())}parentNode(t){var e;return(e=t==null?void 0:t._parent)!=null?e:null}nextSibling(t){if(!t||!t._parent)return null;let e=t._parent.children,i=e.indexOf(t);return i!==-1&&i+1<e.length?e[i+1]:null}setText(t,e){t&&t.tag==="__text__"&&(t.text=e)}patchProp(t,e,i,n){if(t){if(n==null){this.removeAttribute(t,e);return}if(e==="style")this.setStyle(t,n);else if(e==="class"||e==="className")this.setClass(t,n);else if(e.startsWith("on")&&typeof n=="function"){let r=e.slice(2).toLowerCase(),s=y[r]||r;t.bindEvents[s]=n.name||"handleEvent"}else this.setAttribute(t,e,n)}}querySelector(t){return null}renderToMiniAppTree(t){if(!t)return this.createComment("empty vnode");if(typeof t=="string")return this.createText(t);if(t.type===Symbol.for("lyt.comment")||t.type==="comment")return this.createComment(t.children||"");if(t.type===Symbol.for("lyt.text")||t.type==="text")return this.createText(t.children||"");if(t.type===Symbol.for("lyt.fragment")||t.type==="fragment"){let e=this.createElement("__fragment__");if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i));return e}if(typeof t.type=="string"){let e=this.createElement(t.type);if(t.props)for(let[i,n]of Object.entries(t.props))i==="key"||i==="ref"||this.setAttribute(e,i,n);if(t.children){if(typeof t.children=="string")this.insert(e,this.createText(t.children));else if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i))}return e}if(typeof t.type=="object"||typeof t.type=="function"){let e=this.createElement("div");if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i));return e}return this.createComment("unknown vnode type")}serializeToWXML(t,e=0){return this._serializeToTemplate(t,e,"wechat")}serializeToAXML(t,e=0){return this._serializeToTemplate(t,e,"alipay")}serializeToTTML(t,e=0){return this._serializeToTemplate(t,e,"bytedance")}getPlatformTemplate(t,e){return this._serializeToTemplate(t,0,e)}mapDirective(t,e,i="wechat"){let n=h[i]||h.wechat,r=nt[t];if(!r)return"";switch(t){case"if":return`${n.if}="{{${e}}}"`;case"else":return`${n.else}`;case"each":{let s=e.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],c=s[4]||s[3];return`${n.for}="{{${c}}}" ${n.forKey}="{{${a}}}"`}return`${n.for}="{{${e}}}"`}case"show":return`hidden="{{!${e}}}"`;default:return`${r.attr}="${e}"`}}mapEvent(t,e="wechat"){let i=h[e]||h.wechat,n=y[t]||t;return i.bind==="on"?`on${n.charAt(0).toUpperCase()}${n.slice(1)}`:`${i.bind}${n}`}_applyDirective(t,e,i){switch(e){case"if":t.wxIf=String(i);break;case"else":t.attrs["wx:else"]="";break;case"each":{let n=String(i),r=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=n;break}case"show":t.attrs.hidden=String(i);break;default:t.attrs[e]=String(i)}}_styleObjectToString(t){return Object.entries(t).map(([e,i])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${i}`).join("; ")}_serializeToTemplate(t,e,i){let n=" ".repeat(e),r=h[i]||h.wechat;if(t.tag==="__text__")return`${n}${t.text||""}`;if(t.tag==="__comment__")return`${n}<!-- ${t.text||""} -->`;if(t.tag==="__fragment__")return t.children.map(l=>this._serializeToTemplate(l,e,i)).join(`
|
|
2
|
+
`);let s=[];for(let[l,d]of Object.entries(t.attrs)){if(l==="wx:else"){s.push(r.else);continue}s.push(`${l}="${d}"`)}t.wxIf&&s.unshift(`${r.if}="{{${t.wxIf}}}"`),t.wxFor&&(s.unshift(`${r.for}="{{${t.wxFor}}}"`),t.wxForKey&&s.unshift(`${r.forKey}="{{${t.wxForKey}}}"`));for(let[l,d]of Object.entries(t.bindEvents)){let p=r.bind==="on"?`on${l.charAt(0).toUpperCase()}${l.slice(1)}`:`${r.bind}${l}`;s.push(`${p}="${d}"`)}for(let[l,d]of Object.entries(t.modelBindings))s.push(`model:${l}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(t.children.length===0&&c.has(t.tag))return`${n}<${t.tag}${a} />`;if(t.children.length===0)return`${n}<${t.tag}${a}></${t.tag}>`;let f=t.children.map(l=>this._serializeToTemplate(l,e+1,i)).join(`
|
|
3
|
+
`);return`${n}<${t.tag}${a}>
|
|
4
|
+
${f}
|
|
5
|
+
${n}</${t.tag}>`}};var U=new N;
|