@lytjs/renderer 4.0.1 → 4.0.4

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 CHANGED
@@ -1 +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;
1
+ var M=Object.defineProperty;var pe=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=pe(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:()=>de,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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 d in t.props){let p=t.props[d];J(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&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:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],q=a[p];q!==l&&H(n,i,p,q,l)}c&16&&j(n,i,s,a)}else j(n,i,s,a);(!c||!(c&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&b(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Te(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(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,c=o.children;Array.isArray(c)&&c.length>0?(Z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===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 c=0;c<a.length;c++)O(n,e,s[c],a[c],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,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){O(n,e,r,i,s,a,c)}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],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,c):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,c=n[g];c||(c=n[g]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=z(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&y(n,f,p,d,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)}},de=new C;
package/dist/dom.mjs CHANGED
@@ -1 +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};
1
+ import{registerDOMOperations as pe}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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 d in t.props){let p=t.props[d];G(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&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){de(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:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],W=a[p];W!==l&&_(n,i,p,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&T(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?ce(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?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,c=o.children;Array.isArray(c)&&c.length>0?(z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===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 c=0;c<a.length;c++)C(n,e,s[c],a[c],r,null,i)}function de(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)}pe({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,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){C(n,e,r,i,s,a,c)}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],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):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,c=n[v];c||(c=n[v]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Q(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[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 $=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))($||{});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 c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&u(n,f,p,d,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 +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;
1
+ var M=Object.defineProperty;var pe=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=pe(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:()=>de,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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 d in t.props){let p=t.props[d];J(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&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:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],q=a[p];q!==l&&H(n,i,p,q,l)}c&16&&j(n,i,s,a)}else j(n,i,s,a);(!c||!(c&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&b(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Te(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(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,c=o.children;Array.isArray(c)&&c.length>0?(Z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===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 c=0;c<a.length;c++)O(n,e,s[c],a[c],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,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){O(n,e,r,i,s,a,c)}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],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,c):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,c=n[g];c||(c=n[g]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=z(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&y(n,f,p,d,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)}},de=new C;
package/dist/index.mjs CHANGED
@@ -1 +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};
1
+ import{registerDOMOperations as pe}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=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(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 d in t.props){let p=t.props[d];G(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&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){de(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:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],W=a[p];W!==l&&_(n,i,p,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&T(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?ce(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?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,c=o.children;Array.isArray(c)&&c.length>0?(z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===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 c=0;c<a.length;c++)C(n,e,s[c],a[c],r,null,i)}function de(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)}pe({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,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){C(n,e,r,i,s,a,c)}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],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):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,c=n[v];c||(c=n[v]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Q(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[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 $=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))($||{});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 c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&u(n,f,p,d,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 CHANGED
@@ -1,5 +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;
1
+ var C=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(o,e)=>{for(var t in e)C(o,t,{get:e[t],enumerable:!0})},X=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W(e))!z.call(o,i)&&i!==t&&C(o,i,{get:()=>e[i],enumerable:!(n=H(e,i))||n.enumerable});return o};var Y=o=>X(C({},"__esModule",{value:!0}),o);var re={};B(re,{Comment:()=>V,Fragment:()=>R,MiniAppRenderer:()=>N,PatchFlags:()=>g,ShapeFlags:()=>m,Text:()=>v,createRenderer:()=>j,miniAppRenderer:()=>U});module.exports=Y(re);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,e){return o.type===e.type&&o.key===e.key}function L(o){return Array.isArray(o.dynamicChildren)}function P(o,e,t,n){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o.addEventListener(e,i,n)}else t==="key"||t==="ref"||o.setAttribute(e,t,n)}function w(o,e,t,n,i){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&o.removeEventListener(e,r,i),n&&o.addEventListener(e,r,n)}else o.setAttribute(e,t,n)}function M(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&w(o,e,i,s,r)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(e,"");else if(i==="style")o.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(e,r,t[i])}else o.removeAttribute(e,i)}function S(o,e,t,n,i,r){let{shapeFlag:s}=t;if(u(t)){q(o,e,t,n,i,r);return}if(x(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(T(t)){let a=o.createComment(t.children);t.el=a,o.insert(n,a,i);return}if(s&1){G(o,e,t,n,i,r);return}if(s&6){Z(e,t,n,i,r);return}}function G(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let f in t.props){let d=t.props[f];P(o,a,f,d)}let{shapeFlag:c,children:l}=t;c&8?a.textContent=l:c&16&&A(e,l,a,null,r),o.insert(n,a,i)}function A(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function q(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&A(e,s,n,a,r),t.el=a,t.anchor=a}function Z(o,e,t,n,i){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,t,n,r),e.el=r.subTree.el)}function D(o,e,t,n){let{shapeFlag:i,children:r}=t;if(u(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&o.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&o.remove(t.el)}function E(o,e){for(let t=0;t<e.length;t++)o(e[t])}var _=require("@lytjs/vdom");function b(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){S(o,O(o,e),n,i,r,s);return}if(L(n)&&L(t)){ee(o,e,t,n,i,s);return}if(!I(t,n)){e(t,i),S(o,O(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(u(n)){k(o,e,t,n,i,r,s);return}if(x(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(T(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){J(o,e,t,n,s);return}if(a&6){te(t,n,s);return}}function O(o,e){return(t,n,i,r,s)=>{b(o,e,t,n,i,r,s)}}function J(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:c,dynamicProps:l}=n;if(c&&c>0){if(c&1&&t.children!==n.children&&(r.textContent=n.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&&l)for(let f=0;f<l.length;f++){let d=l[f],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,e,t,n,r,null,i)}function F(o,e,t,n,i,r,s){let a=t.shapeFlag,c=n.shapeFlag,l=t.children,f=n.children;if(c&8){a&16&&E(e,l),l!==f&&(i.textContent=f);return}if(c&16){a&16?Q(o,e,l,f,i,r,s):(a&8&&(i.textContent=""),A(O(o,e),f,i,r,s));return}f==null&&(a&8?i.textContent="":a&16&&E(e,l))}function Q(o,e,t,n,i,r,s){n.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(0,_.patchKeyedChildren)(t,n,i,r,s,null,!1):(0,_.patchUnkeyedChildren)(t,n,i,r,s,null,!1)}function k(o,e,t,n,i,r,s){let a=t.children,c=n.children;Array.isArray(c)&&c.length>0?(F(o,e,t,n,i,r,s),n.el=c[0].el,n.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(E(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function ee(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)b(o,e,s[c],a[c],i,null,r)}function te(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function j(o){function e(i,r){D(o,e,i,r)}(0,K.registerDOMOperations)({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,c,l,f){n(null,i,r,s,a)},patch(i,r,s,a,c,l,f,d){n(i,r,s,a,c)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,c){b(o,e,i,r,s,a,c)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){e(i,r)}}}var ne={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"},ie={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(e){return{tag:ie[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,n){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,n);return}if(t==="v-if"||t==="if"){e.wxIf=String(n);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=y[i]||i;e.bindEvents[r]=n.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(n);return}if(t==="class"||t==="className"){e.attrs.class=String(n);return}if(t==="style"){typeof n=="object"&&n!==null?e.attrs.style=this._styleObjectToString(n):e.attrs.style=String(n);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(n);return}e.attrs[t]=String(n)}}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 n=t.slice(2).toLowerCase(),i=y[n]||n;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let n=this._styleObjectToString(t);e.attrs.style=n}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.attrs.class=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,r=i.children.indexOf(t);r!==-1&&i.children.splice(r,1)}if(t._parent=e,n){let i=e.children.indexOf(n);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,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let r=y[t]||t;e.bindEvents[r]=n.name||"handleEvent"}removeEventListener(e,t,n){if(!e)return;let i=y[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,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,n,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 r=t.slice(2).toLowerCase(),s=y[r]||r;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 n of e.children)this.insert(t,this.renderToMiniAppTree(n));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToMiniAppTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToMiniAppTree(n));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,n="wechat"){let i=h[n]||h.wechat,r=ne[e];if(!r)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],c=s[4]||s[3];return`${i.for}="{{${c}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${r.attr}="${t}"`}}mapEvent(e,t="wechat"){let n=h[t]||h.wechat,i=y[e]||e;return n.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${n.bind}${i}`}_applyDirective(e,t,n){switch(t){case"if":e.wxIf=String(n);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(n);break;default:e.attrs[t]=String(n)}}_styleObjectToString(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")}_serializeToTemplate(e,t,n){let i=" ".repeat(t),r=h[n]||h.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(f=>this._serializeToTemplate(f,t,n)).join(`
2
+ `);let s=[];for(let[f,d]of Object.entries(e.attrs)){if(f==="wx:else"){s.push(r.else);continue}s.push(`${f}="${d}"`)}e.wxIf&&s.unshift(`${r.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${r.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${r.forKey}="{{${e.wxForKey}}}"`));for(let[f,d]of Object.entries(e.bindEvents)){let p=r.bind==="on"?`on${f.charAt(0).toUpperCase()}${f.slice(1)}`:`${r.bind}${f}`;s.push(`${p}="${d}"`)}for(let[f,d]of Object.entries(e.modelBindings))s.push(`model:${f}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(e.children.length===0&&c.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let l=e.children.map(f=>this._serializeToTemplate(f,t+1,n)).join(`
3
+ `);return`${i}<${e.tag}${a}>
4
+ ${l}
5
+ ${i}</${e.tag}>`}};var U=new N;
package/dist/miniapp.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import{registerDOMOperations as Y}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||{}),_=(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))(_||{}),w=Symbol("Fragment"),M=Symbol("Text"),S=Symbol("Comment");function m(o){return o.type===w}function N(o){return o.type===M}function g(o){return o.type===S}function O(o,t){return o.type===t.type&&o.key===t.key}function b(o){return Array.isArray(o.dynamicChildren)}function $(o,t,e,n){if(e==="class")o.setClass(t,n);else if(e==="style")o.setStyle(t,n);else if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();o.addEventListener(t,i,n)}else e==="key"||e==="ref"||o.setAttribute(t,e,n)}function C(o,t,e,n,i){if(e==="class")o.setClass(t,n);else if(e==="style")o.setStyle(t,n||{});else if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();i&&o.removeEventListener(t,r,i),n&&o.addEventListener(t,r,n)}else o.setAttribute(t,e,n)}function R(o,t,e,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=e[i],s=n[i];s!==r&&C(o,t,i,s,r)}for(let i in e)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(t,"");else if(i==="style")o.setStyle(t,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(t,r,e[i])}else o.removeAttribute(t,i)}function v(o,t,e,n,i,r){let{shapeFlag:s}=e;if(m(e)){F(o,t,e,n,i,r);return}if(N(e)){let a=o.createText(e.children);e.el=a,o.insert(n,a,i);return}if(g(e)){let a=o.createComment(e.children);e.el=a,o.insert(n,a,i);return}if(s&1){D(o,t,e,n,i,r);return}if(s&6){K(t,e,n,i,r);return}}function D(o,t,e,n,i,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];$(o,a,l,d)}let{shapeFlag:c,children:f}=e;c&8?a.textContent=f:c&16&&x(t,f,a,null,r),o.insert(n,a,i)}function x(o,t,e,n,i){for(let r=0;r<t.length;r++)o(null,t[r],e,n,i)}function F(o,t,e,n,i,r){let{children:s}=e,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&x(t,s,n,a,r),e.el=a,e.anchor=a}function K(o,t,e,n,i){let r=t.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,e,n,r),t.el=r.subTree.el)}function I(o,t,e,n){let{shapeFlag:i,children:r}=e;if(m(e)){if(Array.isArray(r))for(let s=0;s<r.length;s++)t(r[s],n);e.anchor&&e.anchor.parentNode&&o.remove(e.anchor);return}if(i&6){e.component&&e.component.subTree&&t(e.component.subTree,n);return}e.el&&o.remove(e.el)}function T(o,t){for(let e=0;e<t.length;e++)o(t[e])}import{patchKeyedChildren as j,patchUnkeyedChildren as U}from"@lytjs/vdom";function A(o,t,e,n,i,r=null,s=null){if(n==null){e&&t(e,i);return}if(e===null){v(o,V(o,t),n,i,r,s);return}if(b(n)&&b(e)){B(o,t,e,n,i,s);return}if(!O(e,n)){t(e,i),v(o,V(o,t),n,i,r,s);return}n.el=e.el,n.anchor=e.anchor;let{shapeFlag:a}=n;if(m(n)){z(o,t,e,n,i,r,s);return}if(N(n)){n.children!==e.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==e.children&&(n.el.nodeValue=n.children);return}if(a&1){H(o,t,e,n,s);return}if(a&6){X(e,n,s);return}}function V(o,t){return(e,n,i,r,s)=>{A(o,t,e,n,i,r,s)}}function H(o,t,e,n,i=null){let r=n.el=e.el,s=e.props||{},a=n.props||{},{patchFlag:c,dynamicProps:f}=n;if(c&&c>0){if(c&1&&e.children!==n.children&&(r.textContent=n.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],L=a[d];L!==p&&C(o,r,d,L,p)}c&16&&R(o,r,s,a)}else R(o,r,s,a);(!c||!(c&1))&&P(o,t,e,n,r,null,i)}function P(o,t,e,n,i,r,s){let a=e.shapeFlag,c=n.shapeFlag,f=e.children,l=n.children;if(c&8){a&16&&T(t,f),f!==l&&(i.textContent=l);return}if(c&16){a&16?W(o,t,f,l,i,r,s):(a&8&&(i.textContent=""),x(V(o,t),l,i,r,s));return}l==null&&(a&8?i.textContent="":a&16&&T(t,f))}function W(o,t,e,n,i,r,s){n.every(c=>c.key!=null)&&e.every(c=>c.key!=null)?j(e,n,i,r,s,null,!1):U(e,n,i,r,s,null,!1)}function z(o,t,e,n,i,r,s){let a=e.children,c=n.children;Array.isArray(c)&&c.length>0?(P(o,t,e,n,i,r,s),n.el=c[0].el,n.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(T(t,a),n.el=e.el,n.anchor=e.anchor):(n.el=e.el,n.anchor=e.anchor)}function B(o,t,e,n,i,r){let s=e.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)A(o,t,s[c],a[c],i,null,r)}function X(o,t,e){t.component=o.component,t.el=o.el,t.component&&t.component.update&&t.component.update()}function G(o){function t(i,r){I(o,t,i,r)}Y({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,c,f,l){n(null,i,r,s,a)},patch(i,r,s,a,c,f,l,d){n(i,r,s,a,c)},unmount(i,r,s,a){t(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,c){A(o,t,i,r,s,a,c)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){t(i,r)}}}var q={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"}},u={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Z={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"},y={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"}},E=class{createElement(t){return{tag:Z[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,n){if(t){if(e.startsWith("lyt:")){let i=e.slice(4);this._applyDirective(t,i,n);return}if(e==="v-if"||e==="if"){t.wxIf=String(n);return}if(e==="v-else"||e==="else"){t.attrs["wx:else"]="";return}if(e==="v-for"||e==="each"){let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=i;return}if(e.startsWith("on")&&typeof n=="function"){let i=e.slice(2).toLowerCase(),r=u[i]||i;t.bindEvents[r]=n.name||"handleEvent";return}if(e==="v-model"||e==="model"){t.modelBindings.value=String(n);return}if(e==="class"||e==="className"){t.attrs.class=String(n);return}if(e==="style"){typeof n=="object"&&n!==null?t.attrs.style=this._styleObjectToString(n):t.attrs.style=String(n);return}if(e==="href"&&t.tag==="navigator"){t.attrs.url=String(n);return}t.attrs[e]=String(n)}}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 n=e.slice(2).toLowerCase(),i=u[n]||n;delete t.bindEvents[i]}else delete t.attrs[e]}setStyle(t,e){if(!t)return;let n=this._styleObjectToString(e);t.attrs.style=n}setClass(t,e){if(t){if(typeof e=="string")t.attrs.class=e;else if(typeof e=="object"&&e!==null){let n=[];for(let[i,r]of Object.entries(e))r&&n.push(i);t.attrs.class=n.join(" ")}}}insert(t,e,n){if(!(!t||!e)){if(e._parent){let i=e._parent,r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)}if(e._parent=t,n){let i=t.children.indexOf(n);i!==-1?t.children.splice(i,0,e):t.children.push(e)}else t.children.push(e)}}remove(t){if(!t||!t._parent)return;let e=t._parent,n=e.children.indexOf(t);n!==-1&&e.children.splice(n,1),t._parent=void 0}replace(t,e,n){if(!t||!e||!n)return;let i=t.children.indexOf(e);i!==-1&&(e._parent=void 0,n._parent=t,t.children[i]=n)}addEventListener(t,e,n,i){if(!t)return;let r=u[e]||e;t.bindEvents[r]=n.name||"handleEvent"}removeEventListener(t,e,n){if(!t)return;let i=u[e]||e;delete t.bindEvents[i]}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,n=e.indexOf(t);return n!==-1&&n+1<e.length?e[n+1]:null}setText(t,e){t&&t.tag==="__text__"&&(t.text=e)}patchProp(t,e,n,i){if(t){if(i==null){this.removeAttribute(t,e);return}if(e==="style")this.setStyle(t,i);else if(e==="class"||e==="className")this.setClass(t,i);else if(e.startsWith("on")&&typeof i=="function"){let r=e.slice(2).toLowerCase(),s=u[r]||r;t.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(t,e,i)}}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 n of t.children)this.insert(e,this.renderToMiniAppTree(n));return e}if(typeof t.type=="string"){let e=this.createElement(t.type);if(t.props)for(let[n,i]of Object.entries(t.props))n==="key"||n==="ref"||this.setAttribute(e,n,i);if(t.children){if(typeof t.children=="string")this.insert(e,this.createText(t.children));else if(Array.isArray(t.children))for(let n of t.children)this.insert(e,this.renderToMiniAppTree(n))}return e}if(typeof t.type=="object"||typeof t.type=="function"){let e=this.createElement("div");if(Array.isArray(t.children))for(let n of t.children)this.insert(e,this.renderToMiniAppTree(n));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,n="wechat"){let i=y[n]||y.wechat,r=q[t];if(!r)return"";switch(t){case"if":return`${i.if}="{{${e}}}"`;case"else":return`${i.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`${i.for}="{{${c}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${e}}}"`}case"show":return`hidden="{{!${e}}}"`;default:return`${r.attr}="${e}"`}}mapEvent(t,e="wechat"){let n=y[e]||y.wechat,i=u[t]||t;return n.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${n.bind}${i}`}_applyDirective(t,e,n){switch(e){case"if":t.wxIf=String(n);break;case"else":t.attrs["wx:else"]="";break;case"each":{let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=i;break}case"show":t.attrs.hidden=String(n);break;default:t.attrs[e]=String(n)}}_styleObjectToString(t){return Object.entries(t).map(([e,n])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")}_serializeToTemplate(t,e,n){let i=" ".repeat(e),r=y[n]||y.wechat;if(t.tag==="__text__")return`${i}${t.text||""}`;if(t.tag==="__comment__")return`${i}<!-- ${t.text||""} -->`;if(t.tag==="__fragment__")return t.children.map(l=>this._serializeToTemplate(l,e,n)).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`${i}<${t.tag}${a} />`;if(t.children.length===0)return`${i}<${t.tag}${a}></${t.tag}>`;let f=t.children.map(l=>this._serializeToTemplate(l,e+1,n)).join(`
3
- `);return`${i}<${t.tag}${a}>
4
- ${f}
5
- ${i}</${t.tag}>`}};var J=new E;export{S as Comment,w as Fragment,E as MiniAppRenderer,_ as PatchFlags,h as ShapeFlags,M as Text,G as createRenderer,J as miniAppRenderer};
1
+ import{registerDOMOperations as Y}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||{}),_=(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))(_||{}),w=Symbol("Fragment"),M=Symbol("Text"),S=Symbol("Comment");function m(o){return o.type===w}function N(o){return o.type===M}function g(o){return o.type===S}function O(o,e){return o.type===e.type&&o.key===e.key}function b(o){return Array.isArray(o.dynamicChildren)}function $(o,e,t,n){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o.addEventListener(e,i,n)}else t==="key"||t==="ref"||o.setAttribute(e,t,n)}function C(o,e,t,n,i){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&o.removeEventListener(e,r,i),n&&o.addEventListener(e,r,n)}else o.setAttribute(e,t,n)}function R(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&C(o,e,i,s,r)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(e,"");else if(i==="style")o.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(e,r,t[i])}else o.removeAttribute(e,i)}function v(o,e,t,n,i,r){let{shapeFlag:s}=t;if(m(t)){F(o,e,t,n,i,r);return}if(N(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(g(t)){let a=o.createComment(t.children);t.el=a,o.insert(n,a,i);return}if(s&1){D(o,e,t,n,i,r);return}if(s&6){K(e,t,n,i,r);return}}function D(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let f in t.props){let d=t.props[f];$(o,a,f,d)}let{shapeFlag:c,children:l}=t;c&8?a.textContent=l:c&16&&x(e,l,a,null,r),o.insert(n,a,i)}function x(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function F(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&x(e,s,n,a,r),t.el=a,t.anchor=a}function K(o,e,t,n,i){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,t,n,r),e.el=r.subTree.el)}function I(o,e,t,n){let{shapeFlag:i,children:r}=t;if(m(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&o.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&o.remove(t.el)}function T(o,e){for(let t=0;t<e.length;t++)o(e[t])}import{patchKeyedChildren as j,patchUnkeyedChildren as U}from"@lytjs/vdom";function A(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){v(o,V(o,e),n,i,r,s);return}if(b(n)&&b(t)){B(o,e,t,n,i,s);return}if(!O(t,n)){e(t,i),v(o,V(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(m(n)){z(o,e,t,n,i,r,s);return}if(N(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){H(o,e,t,n,s);return}if(a&6){X(t,n,s);return}}function V(o,e){return(t,n,i,r,s)=>{A(o,e,t,n,i,r,s)}}function H(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:c,dynamicProps:l}=n;if(c&&c>0){if(c&1&&t.children!==n.children&&(r.textContent=n.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&&l)for(let f=0;f<l.length;f++){let d=l[f],p=s[d],L=a[d];L!==p&&C(o,r,d,L,p)}c&16&&R(o,r,s,a)}else R(o,r,s,a);(!c||!(c&1))&&P(o,e,t,n,r,null,i)}function P(o,e,t,n,i,r,s){let a=t.shapeFlag,c=n.shapeFlag,l=t.children,f=n.children;if(c&8){a&16&&T(e,l),l!==f&&(i.textContent=f);return}if(c&16){a&16?W(o,e,l,f,i,r,s):(a&8&&(i.textContent=""),x(V(o,e),f,i,r,s));return}f==null&&(a&8?i.textContent="":a&16&&T(e,l))}function W(o,e,t,n,i,r,s){n.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?j(t,n,i,r,s,null,!1):U(t,n,i,r,s,null,!1)}function z(o,e,t,n,i,r,s){let a=t.children,c=n.children;Array.isArray(c)&&c.length>0?(P(o,e,t,n,i,r,s),n.el=c[0].el,n.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(T(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function B(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)A(o,e,s[c],a[c],i,null,r)}function X(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function G(o){function e(i,r){I(o,e,i,r)}Y({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,c,l,f){n(null,i,r,s,a)},patch(i,r,s,a,c,l,f,d){n(i,r,s,a,c)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,c){A(o,e,i,r,s,a,c)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){e(i,r)}}}var q={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"}},u={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Z={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"},y={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"}},E=class{createElement(e){return{tag:Z[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,n){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,n);return}if(t==="v-if"||t==="if"){e.wxIf=String(n);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=u[i]||i;e.bindEvents[r]=n.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(n);return}if(t==="class"||t==="className"){e.attrs.class=String(n);return}if(t==="style"){typeof n=="object"&&n!==null?e.attrs.style=this._styleObjectToString(n):e.attrs.style=String(n);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(n);return}e.attrs[t]=String(n)}}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 n=t.slice(2).toLowerCase(),i=u[n]||n;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let n=this._styleObjectToString(t);e.attrs.style=n}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.attrs.class=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,r=i.children.indexOf(t);r!==-1&&i.children.splice(r,1)}if(t._parent=e,n){let i=e.children.indexOf(n);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,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let r=u[t]||t;e.bindEvents[r]=n.name||"handleEvent"}removeEventListener(e,t,n){if(!e)return;let i=u[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,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,n,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 r=t.slice(2).toLowerCase(),s=u[r]||r;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 n of e.children)this.insert(t,this.renderToMiniAppTree(n));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToMiniAppTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToMiniAppTree(n));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,n="wechat"){let i=y[n]||y.wechat,r=q[e];if(!r)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],c=s[4]||s[3];return`${i.for}="{{${c}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${r.attr}="${t}"`}}mapEvent(e,t="wechat"){let n=y[t]||y.wechat,i=u[e]||e;return n.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${n.bind}${i}`}_applyDirective(e,t,n){switch(t){case"if":e.wxIf=String(n);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(n);break;default:e.attrs[t]=String(n)}}_styleObjectToString(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")}_serializeToTemplate(e,t,n){let i=" ".repeat(t),r=y[n]||y.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(f=>this._serializeToTemplate(f,t,n)).join(`
2
+ `);let s=[];for(let[f,d]of Object.entries(e.attrs)){if(f==="wx:else"){s.push(r.else);continue}s.push(`${f}="${d}"`)}e.wxIf&&s.unshift(`${r.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${r.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${r.forKey}="{{${e.wxForKey}}}"`));for(let[f,d]of Object.entries(e.bindEvents)){let p=r.bind==="on"?`on${f.charAt(0).toUpperCase()}${f.slice(1)}`:`${r.bind}${f}`;s.push(`${p}="${d}"`)}for(let[f,d]of Object.entries(e.modelBindings))s.push(`model:${f}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(e.children.length===0&&c.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let l=e.children.map(f=>this._serializeToTemplate(f,t+1,n)).join(`
3
+ `);return`${i}<${e.tag}${a}>
4
+ ${l}
5
+ ${i}</${e.tag}>`}};var J=new E;export{S as Comment,w as Fragment,E as MiniAppRenderer,_ as PatchFlags,h as ShapeFlags,M as Text,G as createRenderer,J as miniAppRenderer};