@lytjs/renderer 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +204 -0
- package/dist/dom.cjs +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/miniapp.cjs +21 -5
- package/dist/miniapp.mjs +21 -5
- package/dist/native.cjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.mjs +1 -1
- package/dist/types/dom/dom-ops.d.ts.map +1 -1
- package/dist/types/dom/dom-renderer.d.ts +3 -3
- package/dist/types/dom/dom-renderer.d.ts.map +1 -1
- package/dist/types/dom/patch-props.d.ts +2 -32
- package/dist/types/dom/patch-props.d.ts.map +1 -1
- package/dist/types/miniapp/index.d.ts +8 -0
- package/dist/types/miniapp/index.d.ts.map +1 -1
- package/dist/types/miniapp/miniapp-compiler.d.ts +269 -0
- package/dist/types/miniapp/miniapp-compiler.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-event-bridge.d.ts +255 -0
- package/dist/types/miniapp/miniapp-event-bridge.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-lifecycle.d.ts +224 -0
- package/dist/types/miniapp/miniapp-lifecycle.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-renderer.d.ts.map +1 -1
- package/dist/types/miniapp/miniapp-utils.d.ts +168 -0
- package/dist/types/miniapp/miniapp-utils.d.ts.map +1 -0
- package/dist/types/miniapp/shared-constants.d.ts +28 -0
- package/dist/types/miniapp/shared-constants.d.ts.map +1 -0
- package/dist/types/native/native-renderer.d.ts.map +1 -1
- package/dist/types/renderer-interfaces.d.ts +19 -19
- package/dist/types/renderer-interfaces.d.ts.map +1 -1
- package/dist/types/shared/abstract-renderer.d.ts +74 -0
- package/dist/types/shared/abstract-renderer.d.ts.map +1 -0
- package/dist/types/ssr/hydration.d.ts +1 -16
- package/dist/types/ssr/hydration.d.ts.map +1 -1
- package/dist/types/ssr/ssr-renderer.d.ts +9 -24
- package/dist/types/ssr/ssr-renderer.d.ts.map +1 -1
- package/dist/types/vapor/index.d.ts +1 -1
- package/dist/types/vapor/index.d.ts.map +1 -1
- package/dist/types/vapor/vapor-compiler.d.ts +9 -0
- package/dist/types/vapor/vapor-compiler.d.ts.map +1 -1
- package/dist/types/vapor/vapor-component.d.ts +8 -1
- package/dist/types/vapor/vapor-component.d.ts.map +1 -1
- package/dist/types/vapor/vapor-reactive.d.ts +27 -4
- package/dist/types/vapor/vapor-reactive.d.ts.map +1 -1
- package/dist/types/vapor/vapor-renderer.d.ts +4 -2
- package/dist/types/vapor/vapor-renderer.d.ts.map +1 -1
- package/dist/types/vnode.d.ts +76 -7
- package/dist/types/vnode.d.ts.map +1 -1
- package/dist/vapor.cjs +1 -1
- package/dist/vapor.mjs +1 -1
- package/package.json +4 -3
- package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# @lytjs/renderer
|
|
2
|
+
|
|
3
|
+
Lyt.js 渲染器 - 提供 DOM、SSR、Vapor 等多种渲染模式。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lytjs/renderer
|
|
9
|
+
|
|
10
|
+
# 或使用 pnpm
|
|
11
|
+
pnpm add @lytjs/renderer
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 特性
|
|
15
|
+
|
|
16
|
+
- 🌐 DOM 渲染器
|
|
17
|
+
- 🚀 SSR 渲染器
|
|
18
|
+
- ⚡ Vapor 无虚拟 DOM 渲染器
|
|
19
|
+
- 🔌 可扩展的渲染器架构
|
|
20
|
+
- 🎯 零运行时依赖
|
|
21
|
+
|
|
22
|
+
## 快速开始
|
|
23
|
+
|
|
24
|
+
### DOM 渲染
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
import { createApp, defineComponent } from '@lytjs/core';
|
|
28
|
+
import { render } from '@lytjs/renderer';
|
|
29
|
+
|
|
30
|
+
const App = defineComponent({
|
|
31
|
+
setup() {
|
|
32
|
+
return { count: 0 };
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<div>
|
|
36
|
+
<h1>{{ count }}</h1>
|
|
37
|
+
<button @click="count++">Increment</button>
|
|
38
|
+
</div>
|
|
39
|
+
`
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const app = createApp(App);
|
|
43
|
+
app.mount('#app');
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### SSR 渲染
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import { createSSRApp, defineComponent } from '@lytjs/core';
|
|
50
|
+
import { renderToString } from '@lytjs/renderer/ssr';
|
|
51
|
+
|
|
52
|
+
const App = defineComponent({
|
|
53
|
+
template: '<div>Hello SSR!</div>'
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const app = createSSRApp(App);
|
|
57
|
+
const html = await renderToString(app);
|
|
58
|
+
console.log(html);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Vapor 模式
|
|
62
|
+
|
|
63
|
+
Vapor 是无虚拟 DOM 的编译优化模式,性能更优:
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import { defineVaporComponent } from '@lytjs/renderer/vapor';
|
|
67
|
+
|
|
68
|
+
const App = defineVaporComponent({
|
|
69
|
+
setup() {
|
|
70
|
+
const count = signal(0);
|
|
71
|
+
return { count };
|
|
72
|
+
},
|
|
73
|
+
template: `
|
|
74
|
+
<div>
|
|
75
|
+
<h1><span bind:text="count"></span></h1>
|
|
76
|
+
<button bind:onclick="() => count.set(count() + 1)">
|
|
77
|
+
Increment
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
`
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## API 参考
|
|
85
|
+
|
|
86
|
+
### DOM 渲染器
|
|
87
|
+
|
|
88
|
+
| API | 说明 |
|
|
89
|
+
|------|------|
|
|
90
|
+
| `render(vnode, container)` | 渲染 VNode 到容器 |
|
|
91
|
+
| `hydrate(vnode, container)` | 激活 SSR 渲染的内容 |
|
|
92
|
+
| `createRenderer(options)` | 创建自定义渲染器 |
|
|
93
|
+
|
|
94
|
+
### SSR 渲染器
|
|
95
|
+
|
|
96
|
+
| API | 说明 |
|
|
97
|
+
|------|------|
|
|
98
|
+
| `renderToString(app)` | 渲染应用到字符串 |
|
|
99
|
+
| `renderToNodeStream(app)` | 渲染到 Node.js 流 |
|
|
100
|
+
| `renderToWebStream(app)` | 渲染到 Web Stream |
|
|
101
|
+
|
|
102
|
+
### Vapor 渲染器
|
|
103
|
+
|
|
104
|
+
| API | 说明 |
|
|
105
|
+
|------|------|
|
|
106
|
+
| `defineVaporComponent(options)` | 定义 Vapor 组件 |
|
|
107
|
+
| `createVaporApp(rootComponent)` | 创建 Vapor 应用 |
|
|
108
|
+
|
|
109
|
+
## 渲染器架构
|
|
110
|
+
|
|
111
|
+
### 自定义渲染器
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
import { createRenderer } from '@lytjs/renderer';
|
|
115
|
+
|
|
116
|
+
const { render, createApp } = createRenderer({
|
|
117
|
+
// 节点操作
|
|
118
|
+
insert: (child, parent, anchor) => { /* 自定义 */ },
|
|
119
|
+
remove: (child) => { /* 自定义 */ },
|
|
120
|
+
createElement: (tag) => { /* 自定义 */ },
|
|
121
|
+
createText: (text) => { /* 自定义 */ },
|
|
122
|
+
setElementText: (el, text) => { /* 自定义 */ },
|
|
123
|
+
patchProp: (el, key, prevValue, nextValue) => { /* 自定义 */ },
|
|
124
|
+
// ...其他钩子
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Vapor 模式
|
|
129
|
+
|
|
130
|
+
Vapor 模式通过编译时分析直接生成 DOM 操作代码,绕过虚拟 DOM:
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
133
|
+
// Vapor 编译输出示例
|
|
134
|
+
function render() {
|
|
135
|
+
const el1 = document.createElement('div');
|
|
136
|
+
const el2 = document.createElement('h1');
|
|
137
|
+
const textNode = document.createTextNode(count());
|
|
138
|
+
el2.appendChild(textNode);
|
|
139
|
+
el1.appendChild(el2);
|
|
140
|
+
|
|
141
|
+
// 响应式更新
|
|
142
|
+
effect(() => {
|
|
143
|
+
textNode.data = count();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return el1;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 示例
|
|
151
|
+
|
|
152
|
+
### 自定义渲染器
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
import { createRenderer } from '@lytjs/renderer';
|
|
156
|
+
|
|
157
|
+
// Canvas 渲染器示例
|
|
158
|
+
const canvasRenderer = createRenderer({
|
|
159
|
+
createElement(tag) {
|
|
160
|
+
return { type: tag };
|
|
161
|
+
},
|
|
162
|
+
insert(child, parent) {
|
|
163
|
+
parent.children = parent.children || [];
|
|
164
|
+
parent.children.push(child);
|
|
165
|
+
}
|
|
166
|
+
// ...其他实现
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 流式 SSR
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
import { createSSRApp } from '@lytjs/core';
|
|
174
|
+
import { renderToNodeStream } from '@lytjs/renderer/ssr';
|
|
175
|
+
import { createServer } from 'http';
|
|
176
|
+
|
|
177
|
+
const App = defineComponent({ /* ... */ });
|
|
178
|
+
|
|
179
|
+
createServer(async (req, res) => {
|
|
180
|
+
const app = createSSRApp(App);
|
|
181
|
+
const stream = renderToNodeStream(app);
|
|
182
|
+
res.setHeader('Content-Type', 'text/html');
|
|
183
|
+
stream.pipe(res);
|
|
184
|
+
}).listen(3000);
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 性能
|
|
188
|
+
|
|
189
|
+
- 体积:5.00 KB (ESM gzip)
|
|
190
|
+
- 零运行时依赖
|
|
191
|
+
- Vapor 模式性能接近原生 JS
|
|
192
|
+
- SSR 支持流式渲染
|
|
193
|
+
|
|
194
|
+
## 兼容性
|
|
195
|
+
|
|
196
|
+
- Node.js >= 18.0.0
|
|
197
|
+
- Chrome 64+
|
|
198
|
+
- Firefox 63+
|
|
199
|
+
- Safari 12+
|
|
200
|
+
- Edge 79+
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT
|
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:()=>z,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>X,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=(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 p in t.props){let d=t.props[p];J(n,a,p,d)}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 p=0;p<f.length;p++){let d=f[p],l=s[d],q=a[d];q!==l&&H(n,i,d,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,p=o.children;if(c&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(c&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(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,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){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 X(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 p=X(t);c[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),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 z=(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))(z||{});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],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
|
+
"use strict";var P=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ue(e))!ye.call(n,r)&&r!==t&&P(n,r,{get:()=>e[r],enumerable:!(o=pe(e,r))||o.enumerable});return n};var he=n=>ve(P({},"__esModule",{value:!0}),n);var we={};me(we,{Comment:()=>W,DOMRenderer:()=>T,Fragment:()=>D,PatchFlags:()=>R,PatchPropFlags:()=>u.PatchFlags,ShapeFlags:()=>m,Text:()=>M,createInvoker:()=>Y,createRenderer:()=>ee,domRenderer:()=>de,getEventInvokers:()=>se,getEventKey:()=>B,getSVGPropName:()=>ie,isSVGElement:()=>w,normalizeEventName:()=>_,parseEventModifier:()=>G,patchAllProps:()=>C,patchClass:()=>L,patchDOMProp:()=>z,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>g,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>x,removeAllEventListeners:()=>I,removeDOMProp:()=>N,setDOMProp:()=>h});module.exports=he(we);var Z=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||{}),R=(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))(R||{}),D=Symbol("Fragment"),M=Symbol("Text"),W=Symbol("Comment");function v(n){return n.type===D}function V(n){return n.type===M}function b(n){return n.type===W}function q(n,e){return n.type===e.type&&n.key===e.key}function K(n){return Array.isArray(n.dynamicChildren)}function $(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 j(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 H(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&j(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 F(n,e,t,o,r,i){let{shapeFlag:s}=t;if(v(t)){Ee(n,e,t,o,r,i);return}if(V(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(b(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){ge(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];$(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 Ee(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 J(n,e,t,o){let{shapeFlag:r,children:i}=t;if(v(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 O(n,e){for(let t=0;t<e.length;t++)n(e[t])}var k=require("@lytjs/vdom");function S(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){F(n,U(n,e),o,r,i,s);return}if(K(o)&&K(t)){Te(n,e,t,o,r,s);return}if(!q(t,o)){e(t,r),F(n,U(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(v(o)){xe(n,e,t,o,r,i,s);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(b(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Ce(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function U(n,e){return(t,o,r,i,s)=>{S(n,e,t,o,r,i,s)}}function Ce(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],X=a[p];X!==l&&j(n,i,p,X,l)}c&16&&H(n,i,s,a)}else H(n,i,s,a);(!c||!(c&1))&&Q(n,e,t,o,i,null,r)}function Q(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&&O(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Le(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(U(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&O(e,f))}function Le(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,k.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,k.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function xe(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Q(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?(O(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function Te(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)S(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){J(n,e,r,i)}(0,Z.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){S(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 h(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 N(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"?be(n,a,c):te(s)||h(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)||N(n,s))}}function be(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 w(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 Ae=/^(?:@|on)/;function _(n){return n.replace(Ae,"").toLowerCase()}function B(n){let e=_(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Oe={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function G(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=Oe[i];s&&(o[s]=!0)}return o}function Y(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var E="_vei";function se(n){return n[E]||null}function g(n,e,t,o,r){let i=B(e),s=G(_(e)),a=s.name,c=n[E];c||(c=n[E]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Y(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 I(n){let e=n[E];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[E]={}}}var u=require("@lytjs/vdom");function L(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 x(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){g(n,"",e,t,o)}var ke=new Set(["class","style","key","ref"]);function Se(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function z(n,e,t,o,r){if(!ke.has(e)){if(Se(e)){g(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){z(n,e,t,o,r)}function C(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===u.PatchFlags.HOISTED){C(n,r,i,o);return}if(s===u.PatchFlags.BAIL){C(n,r,i,o);return}if(s&u.PatchFlags.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.PatchFlags.CLASS&&r.class!==i.class&&L(n,i.class,r.class),s&u.PatchFlags.STYLE&&r.style!==i.style&&x(n,i.style,r.style),s&u.PatchFlags.PROPS&&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&u.PatchFlags.FULL_PROPS&&C(n,r,i,o)}var T=class{createElement(e){return w(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){h(e,t,o)}removeAttribute(e,t){N(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){L(e,t,o)}setStyleWithOld(e,t,o){x(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){I(e)}},de=new T;
|
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=(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 p in t.props){let d=t.props[p];G(n,a,p,d)}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){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: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 p=0;p<f.length;p++){let d=f[p],l=s[d],W=a[d];W!==l&&_(n,i,d,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&X(n,e,t,o,i,null,r)}function X(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(c&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(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?(X(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 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,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){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 z(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):z(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="":z(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 p=Q(t);c[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),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],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 v=(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))(v||{}),k=(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))(k||{}),j=Symbol("Fragment"),H=Symbol("Text"),F=Symbol("Comment");function y(n){return n.type===j}function N(n){return n.type===H}function E(n){return n.type===F}function U(n,e){return n.type===e.type&&n.key===e.key}function S(n){return Array.isArray(n.dynamicChildren)}function B(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 w(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 _(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&w(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 I(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(N(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(E(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];B(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&g(e,f,a,null,i),n.insert(o,a,r)}function g(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&&g(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 G(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 C(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function L(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){I(n,P(n,e),o,r,i,s);return}if(S(o)&&S(t)){fe(n,e,t,o,r,s);return}if(!U(t,o)){e(t,r),I(n,P(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(N(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(E(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 P(n,e){return(t,o,r,i,s)=>{L(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],K=a[p];K!==l&&w(n,i,p,K,l)}c&16&&_(n,i,s,a)}else _(n,i,s,a);(!c||!(c&1))&&Y(n,e,t,o,i,null,r)}function Y(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&&C(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=""),g(P(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&C(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?(Y(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?(C(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++)L(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 ue(n){function e(r,i){G(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){L(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 X={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},ye={"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=X[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 T(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=X[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(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):z(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="":z(s)||T(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 D(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 he(n){return ye[n]||n}var Ne=/^(?:@|on)/;function M(n){return n.replace(Ne,"").toLowerCase()}function $(n){let e=M(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Ee={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=Ee[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var h="_vei";function ge(n){return n[h]||null}function R(n,e,t,o,r){let i=$(e),s=J(M(e)),a=s.name,c=n[h];c||(c=n[h]={});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 W(n){let e=n[h];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[h]={}}}import{PatchFlags as u}from"@lytjs/vdom";function b(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 A(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 Ce(n,e,t,o){R(n,"",e,t,o)}var Le=new Set(["class","style","key","ref"]);function xe(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(!Le.has(e)){if(xe(e)){R(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 m(n,e,t,o,r){te(n,e,t,o,r)}function V(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&&m(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&m(n,r,null,e[r],o)}function Te(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.HOISTED){V(n,r,i,o);return}if(s===u.BAIL){V(n,r,i,o);return}if(s&u.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.CLASS&&r.class!==i.class&&b(n,i.class,r.class),s&u.STYLE&&r.style!==i.style&&A(n,i.style,r.style),s&u.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&m(n,f,p,d,o)}s&u.FULL_PROPS&&V(n,r,i,o)}var O=class{createElement(e){return D(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){T(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){b(e,t,o)}setStyleWithOld(e,t,o){A(e,t,o)}setAttributeWithOld(e,t,o,r){m(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){W(e)}},Re=new O;export{F as Comment,O as DOMRenderer,j as Fragment,k as PatchFlags,u as PatchPropFlags,v as ShapeFlags,H as Text,Q as createInvoker,ue as createRenderer,Re as domRenderer,ge as getEventInvokers,$ as getEventKey,he as getSVGPropName,D as isSVGElement,M as normalizeEventName,J as parseEventModifier,V as patchAllProps,b as patchClass,te as patchDOMProp,me as patchDOMProps,Te as patchElementProps,R as patchEvent,Ce as patchEventOnElement,m as patchProp,A as patchStyle,W as removeAllEventListeners,T 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:()=>z,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>X,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=(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 p in t.props){let d=t.props[p];J(n,a,p,d)}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 p=0;p<f.length;p++){let d=f[p],l=s[d],q=a[d];q!==l&&H(n,i,d,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,p=o.children;if(c&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(c&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(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,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){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 X(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 p=X(t);c[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),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 z=(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))(z||{});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],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
|
+
"use strict";var P=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ue(e))!ye.call(n,r)&&r!==t&&P(n,r,{get:()=>e[r],enumerable:!(o=pe(e,r))||o.enumerable});return n};var he=n=>ve(P({},"__esModule",{value:!0}),n);var we={};me(we,{Comment:()=>W,DOMRenderer:()=>T,Fragment:()=>D,PatchFlags:()=>R,PatchPropFlags:()=>u.PatchFlags,ShapeFlags:()=>m,Text:()=>M,createInvoker:()=>Y,createRenderer:()=>ee,domRenderer:()=>de,getEventInvokers:()=>se,getEventKey:()=>B,getSVGPropName:()=>ie,isSVGElement:()=>w,normalizeEventName:()=>_,parseEventModifier:()=>G,patchAllProps:()=>C,patchClass:()=>L,patchDOMProp:()=>z,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>g,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>x,removeAllEventListeners:()=>I,removeDOMProp:()=>N,setDOMProp:()=>h});module.exports=he(we);var Z=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||{}),R=(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))(R||{}),D=Symbol("Fragment"),M=Symbol("Text"),W=Symbol("Comment");function v(n){return n.type===D}function V(n){return n.type===M}function b(n){return n.type===W}function q(n,e){return n.type===e.type&&n.key===e.key}function K(n){return Array.isArray(n.dynamicChildren)}function $(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 j(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 H(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&j(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 F(n,e,t,o,r,i){let{shapeFlag:s}=t;if(v(t)){Ee(n,e,t,o,r,i);return}if(V(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(b(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){ge(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];$(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 Ee(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 J(n,e,t,o){let{shapeFlag:r,children:i}=t;if(v(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 O(n,e){for(let t=0;t<e.length;t++)n(e[t])}var k=require("@lytjs/vdom");function S(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){F(n,U(n,e),o,r,i,s);return}if(K(o)&&K(t)){Te(n,e,t,o,r,s);return}if(!q(t,o)){e(t,r),F(n,U(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(v(o)){xe(n,e,t,o,r,i,s);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(b(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Ce(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function U(n,e){return(t,o,r,i,s)=>{S(n,e,t,o,r,i,s)}}function Ce(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],X=a[p];X!==l&&j(n,i,p,X,l)}c&16&&H(n,i,s,a)}else H(n,i,s,a);(!c||!(c&1))&&Q(n,e,t,o,i,null,r)}function Q(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&&O(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Le(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(U(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&O(e,f))}function Le(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,k.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,k.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function xe(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Q(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?(O(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function Te(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)S(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){J(n,e,r,i)}(0,Z.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){S(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 h(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 N(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"?be(n,a,c):te(s)||h(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)||N(n,s))}}function be(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 w(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 Ae=/^(?:@|on)/;function _(n){return n.replace(Ae,"").toLowerCase()}function B(n){let e=_(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Oe={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function G(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=Oe[i];s&&(o[s]=!0)}return o}function Y(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var E="_vei";function se(n){return n[E]||null}function g(n,e,t,o,r){let i=B(e),s=G(_(e)),a=s.name,c=n[E];c||(c=n[E]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Y(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 I(n){let e=n[E];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[E]={}}}var u=require("@lytjs/vdom");function L(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 x(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){g(n,"",e,t,o)}var ke=new Set(["class","style","key","ref"]);function Se(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function z(n,e,t,o,r){if(!ke.has(e)){if(Se(e)){g(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){z(n,e,t,o,r)}function C(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===u.PatchFlags.HOISTED){C(n,r,i,o);return}if(s===u.PatchFlags.BAIL){C(n,r,i,o);return}if(s&u.PatchFlags.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.PatchFlags.CLASS&&r.class!==i.class&&L(n,i.class,r.class),s&u.PatchFlags.STYLE&&r.style!==i.style&&x(n,i.style,r.style),s&u.PatchFlags.PROPS&&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&u.PatchFlags.FULL_PROPS&&C(n,r,i,o)}var T=class{createElement(e){return w(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){h(e,t,o)}removeAttribute(e,t){N(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){L(e,t,o)}setStyleWithOld(e,t,o){x(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){I(e)}},de=new T;
|
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=(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 p in t.props){let d=t.props[p];G(n,a,p,d)}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){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: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 p=0;p<f.length;p++){let d=f[p],l=s[d],W=a[d];W!==l&&_(n,i,d,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&X(n,e,t,o,i,null,r)}function X(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(c&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(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?(X(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 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,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){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 z(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):z(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="":z(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 p=Q(t);c[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),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],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 v=(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))(v||{}),k=(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))(k||{}),j=Symbol("Fragment"),H=Symbol("Text"),F=Symbol("Comment");function y(n){return n.type===j}function N(n){return n.type===H}function E(n){return n.type===F}function U(n,e){return n.type===e.type&&n.key===e.key}function S(n){return Array.isArray(n.dynamicChildren)}function B(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 w(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 _(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&w(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 I(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(N(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(E(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];B(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&g(e,f,a,null,i),n.insert(o,a,r)}function g(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&&g(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 G(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 C(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function L(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){I(n,P(n,e),o,r,i,s);return}if(S(o)&&S(t)){fe(n,e,t,o,r,s);return}if(!U(t,o)){e(t,r),I(n,P(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(N(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(E(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 P(n,e){return(t,o,r,i,s)=>{L(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],K=a[p];K!==l&&w(n,i,p,K,l)}c&16&&_(n,i,s,a)}else _(n,i,s,a);(!c||!(c&1))&&Y(n,e,t,o,i,null,r)}function Y(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&&C(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=""),g(P(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&C(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?(Y(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?(C(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++)L(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 ue(n){function e(r,i){G(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){L(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 X={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},ye={"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=X[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 T(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=X[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(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):z(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="":z(s)||T(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 D(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 he(n){return ye[n]||n}var Ne=/^(?:@|on)/;function M(n){return n.replace(Ne,"").toLowerCase()}function $(n){let e=M(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Ee={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=Ee[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var h="_vei";function ge(n){return n[h]||null}function R(n,e,t,o,r){let i=$(e),s=J(M(e)),a=s.name,c=n[h];c||(c=n[h]={});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 W(n){let e=n[h];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[h]={}}}import{PatchFlags as u}from"@lytjs/vdom";function b(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 A(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 Ce(n,e,t,o){R(n,"",e,t,o)}var Le=new Set(["class","style","key","ref"]);function xe(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(!Le.has(e)){if(xe(e)){R(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 m(n,e,t,o,r){te(n,e,t,o,r)}function V(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&&m(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&m(n,r,null,e[r],o)}function Te(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.HOISTED){V(n,r,i,o);return}if(s===u.BAIL){V(n,r,i,o);return}if(s&u.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.CLASS&&r.class!==i.class&&b(n,i.class,r.class),s&u.STYLE&&r.style!==i.style&&A(n,i.style,r.style),s&u.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&m(n,f,p,d,o)}s&u.FULL_PROPS&&V(n,r,i,o)}var O=class{createElement(e){return D(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){T(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){b(e,t,o)}setStyleWithOld(e,t,o){A(e,t,o)}setAttributeWithOld(e,t,o,r){m(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){W(e)}},Re=new O;export{F as Comment,O as DOMRenderer,j as Fragment,k as PatchFlags,u as PatchPropFlags,v as ShapeFlags,H as Text,Q as createInvoker,ue as createRenderer,Re as domRenderer,ge as getEventInvokers,$ as getEventKey,he as getSVGPropName,D as isSVGElement,M as normalizeEventName,J as parseEventModifier,V as patchAllProps,b as patchClass,te as patchDOMProp,me as patchDOMProps,Te as patchElementProps,R as patchEvent,Ce as patchEventOnElement,m as patchProp,A as patchStyle,W as removeAllEventListeners,T as removeDOMProp,x as setDOMProp};
|