@ryupold/vode 1.8.7 → 1.8.10

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 CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ---
7
7
 
8
- A compact web framework for minimalist developers. Zero dependencies, no build step except for typescript compilation, and a simple virtual DOM implementation that is easy to understand and use. Autocompletion out of the box thanks to `lib.dom.d.ts`.
8
+ A compact web framework for minimalist developers. Zero dependencies, no build step except for TypeScript compilation, and a simple virtual DOM implementation that is easy to understand and use. Autocompletion out of the box thanks to `lib.dom.d.ts`.
9
9
 
10
10
  It brings a primitive building block to the table that gives flexibility in composition and makes refactoring easy.
11
11
  The use cases can be single page applications or isolated components with complex state.
@@ -128,7 +128,7 @@ app<State>(appNode, state,
128
128
 
129
129
  ## `[V,{},d,e]`
130
130
 
131
- Lets describe UI as data structures that map 1:1 to DOM elements.
131
+ Let's describe UI as data structures that map 1:1 to DOM elements.
132
132
 
133
133
  A `vode` is a representation of a virtual DOM node, which is a tree structure of HTML elements. It is written as tuple:
134
134
 
@@ -217,8 +217,8 @@ expressed as *vode* structure it would look like this:
217
217
  ]
218
218
  ```
219
219
 
220
- Viewed in isolation, it does not provide an obvious benefit (apart from looking better imho),
221
- but as the result of a function of state, it can become very useful to express conditional UI this way.
220
+ Viewed in isolation, it does not provide an obvious benefit (apart from looking better IMHO),
221
+ but as a function of state, it can become very useful to express conditional UI this way.
222
222
 
223
223
  ### app
224
224
 
@@ -419,7 +419,7 @@ const ComponentEwww = (s) => {
419
419
  // patch with a render via view transition
420
420
  s.patch([{}, (s) => {/*...*/}]); //all given patches will be part of a view transition
421
421
 
422
- // empty array patches command to skip the current view transition
422
+ // an empty array tells vode to skip the current view transition
423
423
  // and set the queued animated patches until now as current state with a sync patch
424
424
  s.patch([]);
425
425
 
@@ -428,46 +428,44 @@ s.patch([[], { loading: true }]);
428
428
  ```
429
429
 
430
430
  ### memoization
431
- To optimize performance, you can use `memo(depsArray, Component | PropsFactory)` to cache the result of a component function. If the array of dependencies does not change (shallow compare), the component function is not called again, indicating for the render to skip this node and all its children.
431
+ To optimize performance, you can use `memo(depsArray, Component)` to cache the result of a component function. If the array of dependencies does not change (shallow compare), the component function is not called again, indicating for the render to skip this node and all its children.
432
432
  This is useful when the creation of the vode is expensive or the rendering of it takes a significant amount of time.
433
433
 
434
434
 
435
435
  ```typescript
436
- const CompMemoList = (s) =>
437
- [DIV, { class: "container" },
438
- [H1, "Hello World"],
439
- [BR],
436
+ const state = createState({ title: "hello", body: "world" });
437
+ type State = typeof state;
438
+
439
+ const CompMemoList: Component<State> = (s) =>
440
+ [DIV, { class: "container" },
441
+ [H1, "Hello World"],
442
+ [BR],
440
443
  [P, "This is a paragraph."],
441
444
 
442
445
  // expensive component to render
443
446
  memo(
444
- // dependency array is shallow compared (using === operator) to the previous renders' memo dependencies
445
- [s.title, s.body],
447
+ // this array is used to determine when to re-render the component, it is shallow compared with the array of the previous render
448
+ [s.title, s.body],
449
+
446
450
  // this is the component function that will be
447
451
  // called only when the array changes
448
452
  (s) => {
449
453
  const list = [UL];
450
- for (let i = 0; i < 1000; i++) {
451
- list.push([LI, `Item ${i}`]);
454
+ for (let i = 0; i < 10000; i++) {
455
+ list.push(LI, `Item ${i}`);
452
456
  }
453
457
  return list;
454
458
  },
455
459
  )
456
460
  ];
457
- ```
458
- Passing an empty dependency array means the component is only rendered once and then ignored.
459
461
 
460
- You can also pass a function that returns the Props object to memoize the attributes.
461
-
462
- ```typescript
463
- const CompMemoProps = (s) => [DIV,
464
- memo([s.isActive], (s) => ({
465
- class: s.isActive ? 'active' : 'inactive'
466
- })),
467
- "Content"
468
- ];
462
+ app<State>(container, state, (s) => [DIV,
463
+ CompMemoList,
464
+ ]);
469
465
  ```
470
466
 
467
+ Passing an empty dependency array means the component is only rendered once and then ignored.
468
+
471
469
  ### error handling
472
470
 
473
471
  You can catch errors during rendering by providing a `catch` property in the vode props.
@@ -479,7 +477,7 @@ const CompWithError: ChildVode = () =>
479
477
  catch: (s: Patchable, err: Error) => [SPAN, { style: { color: 'red' } }, `An error occurred: ${err.message}`],
480
478
  },
481
479
 
482
- [P, "Below error is intentional for testing error boundaries:"],
480
+ [P, "The error below is intentional for testing error boundaries:"],
483
481
 
484
482
  [DIV, {
485
483
  // catch: [SPAN, { style: { color: 'red' } }, `An error occurred!`], // uncomment to catch child error directly here
@@ -625,7 +623,7 @@ const CompMathML = (s) =>
625
623
 
626
624
  #### state context
627
625
 
628
- The state context utilities can help creating shareable type safe components.
626
+ The state context utilities can help create shareable, type-safe components.
629
627
  These do not need to know the 'full' state of the app, but only the part they are interested in. This can be especially useful for differently deep nested components that need access to the same part of the state.
630
628
 
631
629
  ```typescript
@@ -686,44 +684,24 @@ function SettingsForm(ctx: SubContext<Settings>) {
686
684
  }
687
685
  ```
688
686
 
687
+ When you have deeply nested state, context gives you a way to access and patch that slice without manually writing the full path every time.
688
+
689
689
  #### isolated state
690
690
  You can have multiple isolated vode app instances on a page, each with its own state and render function.
691
691
  The returned patch function from `app` can be used to synchronize the state between them.
692
692
 
693
- #### nested vode-app
694
- It is possible to nest vode-apps inside vode-apps, but the library is not opinionated on how you do that.
695
- One can imagine this type of component:
696
-
697
- ```typescript
698
- export function IsolatedVodeApp<OuterState, InnerState>(
699
- tag: Tag,
700
- state: InnerState,
701
- View: (ins: InnerState) => Vode<InnerState>,
702
- ): ChildVode<OuterState> {
703
- return memo<OuterState>([],
704
- () => [tag,
705
- {
706
- onMount: (s: OuterState, container: Element) => {
707
- app<InnerState>(container, state, View);
708
- }
709
- }
710
- ]
711
- );
712
- }
713
- ```
693
+ #### advances examples
714
694
 
715
- The memo with empty dependency array prevents further render calls from the outer app
716
- so rendering of the subtree inside is controlled by the inner app.
717
- Take note of the fact that the top-level element of the inner app refers to the surrounding element and will change its state accordingly.
695
+ See [test/tests-examples.ts](./test/tests-examples.ts) for more advanced examples of the features described here.
718
696
 
719
697
  #### view transitions
720
- The library has experimental support for [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API).
698
+ The library has experimental support for the [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API).
721
699
  You can pass an array of patches to the `patch` function where each patch will be applied with the next available view transition.
722
700
 
723
701
  Patching an empty array `[]` will skip the current view transition and set the queued animated patches until now as current state with a sync patch.
724
702
  > Keep in mind that view transitions are not supported in all browsers yet and only one active transition can happen at a time. This feature may change significantly in the future, so do not rely on it heavily.
725
703
 
726
- Scheduling behaviour can in theory be overridden with `containerNode._vode.asyncRenderer`.
704
+ Scheduling behavior can be overridden with `containerNode._vode.asyncRenderer`.
727
705
 
728
706
  ```javascript
729
707
  // or globally disable view transitions for the vode framework
@@ -771,13 +749,13 @@ The library is optimized for small to medium sized applications. In my own tests
771
749
  This being said, the library does not focus on performance.
772
750
  It is designed to feel nice while coding, by providing a primitive that is simple to bend & form.
773
751
  I want the mental model to be easy to grasp and the API surface to be small
774
- so that a developer can focus on building a web application instead of learning the framework and get to a flow state as quick as possible.
752
+ so that a developer can focus on building a web application instead of learning the framework and get to a flow state as quickly as possible.
775
753
 
776
754
  ## Thanks
777
755
 
778
- The simplicity of [hyperapp](https://github.com/jorgebucaran/hyperapp) demonstrated that powerful frameworks don't require complexity, which inspired this library's design philosophy.
756
+ The simplicity of [Hyperapp](https://github.com/jorgebucaran/hyperapp) demonstrated that powerful frameworks don't require complexity, which inspired this library's design philosophy.
779
757
 
780
- Not planning to add more features, just keeping it simple and easy (and hopefully bug free).
758
+ I'm not planning to add more features, just keeping it simple and easy (and hopefully bug free).
781
759
 
782
760
  But if you find bugs or have suggestions,
783
761
  feel free to open an [issue](https://github.com/ryupold/vode/issues) or a pull request.
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LINK=exports.LINEARGRADIENT=exports.LINE=exports.LI=exports.LEGEND=exports.LABEL=exports.KBD=exports.INS=exports.INPUT=exports.IMG=exports.IMAGE=exports.IFRAME=exports.I=exports.HTML=exports.HR=exports.HGROUP=exports.HEADER=exports.HEAD=exports.H6=exports.H5=exports.H4=exports.H3=exports.H2=exports.H1=exports.G=exports.FORM=exports.FOREIGNOBJECT=exports.FOOTER=exports.FILTER=exports.FIGURE=exports.FIGCAPTION=exports.FIELDSET=exports.FETURBULENCE=exports.FETILE=exports.FESPOTLIGHT=exports.FESPECULARLIGHTING=exports.FEPOINTLIGHT=exports.FEOFFSET=exports.FEMORPHOLOGY=exports.FEMERGENODE=exports.FEMERGE=exports.FEIMAGE=exports.FEGAUSSIANBLUR=exports.FEFUNCR=exports.FEFUNCG=exports.FEFUNCB=exports.FEFUNCA=exports.FEFLOOD=exports.FEDROPSHADOW=exports.FEDISTANTLIGHT=exports.FEDISPLACEMENTMAP=exports.FEDIFFUSELIGHTING=exports.FECONVOLVEMATRIX=exports.FECOMPOSITE=exports.FECOMPONENTTRANSFER=exports.FECOLORMATRIX=exports.FEBLEND=exports.EMBED=exports.EM=exports.ELLIPSE=exports.DT=exports.DL=exports.DIV=exports.DIALOG=exports.DFN=exports.DETAILS=exports.DESC=exports.DEL=exports.DEFS=exports.DD=exports.DATALIST=exports.DATA=exports.COLGROUP=exports.COL=exports.CODE=exports.CLIPPATH=exports.CITE=exports.CIRCLE=exports.CAPTION=exports.CANVAS=exports.BUTTON=exports.BR=exports.BODY=exports.BLOCKQUOTE=exports.BDO=exports.BDI=exports.BASE=exports.B=exports.AUDIO=exports.ASIDE=exports.ARTICLE=exports.AREA=exports.ANNOTATION_XML=exports.ANNOTATION=exports.ANIMATETRANSFORM=exports.ANIMATEMOTION=exports.ANIMATE=exports.ADDRESS=exports.ABBR=exports.A=void 0,exports.VIEW=exports.VIDEO=exports.VAR=exports.USE=exports.UL=exports.U=exports.TSPAN=exports.TRACK=exports.TR=exports.TITLE=exports.TIME=exports.THEAD=exports.TH=exports.TFOOT=exports.TEXTPATH=exports.TEXTAREA=exports.TEXT=exports.TEMPLATE=exports.TD=exports.TBODY=exports.TABLE=exports.SYMBOL=exports.SWITCH=exports.SVG=exports.SUP=exports.SUMMARY=exports.SUB=exports.STYLE=exports.STRONG=exports.STOP=exports.SPAN=exports.SOURCE=exports.SMALL=exports.SLOT=exports.SET=exports.SEMANTICS=exports.SELECT=exports.SECTION=exports.SEARCH=exports.SCRIPT=exports.SAMP=exports.S=exports.RUBY=exports.RT=exports.RP=exports.RECT=exports.RADIALGRADIENT=exports.Q=exports.PROGRESS=exports.PRE=exports.POLYLINE=exports.POLYGON=exports.PICTURE=exports.PATTERN=exports.PATH=exports.P=exports.OUTPUT=exports.OPTION=exports.OPTGROUP=exports.OL=exports.OBJECT=exports.NOSCRIPT=exports.NAV=exports.MUNDEROVER=exports.MUNDER=exports.MTR=exports.MTEXT=exports.MTD=exports.MTABLE=exports.MSUP=exports.MSUBSUP=exports.MSUB=exports.MSTYLE=exports.MSQRT=exports.MSPACE=exports.MS=exports.MROW=exports.MROOT=exports.MPRESCRIPTS=exports.MPHANTOM=exports.MPATH=exports.MPADDED=exports.MOVER=exports.MO=exports.MN=exports.MMULTISCRIPTS=exports.MI=exports.MFRAC=exports.METER=exports.METADATA=exports.META=exports.MERROR=exports.MENU=exports.MATH=exports.MASK=exports.MARKER=exports.MARK=exports.MAP=exports.MAIN=exports.MACTION=void 0,exports.WBR=void 0,exports.app=app,exports.child=child,exports.childCount=childCount,exports.children=children,exports.childrenStart=childrenStart,exports.context=context,exports.createPatch=createPatch,exports.createState=createState,exports.defuse=defuse,exports.globals=void 0,exports.hydrate=hydrate,exports.memo=memo,exports.mergeClass=mergeClass,exports.mergeProps=mergeProps,exports.mergeStyle=mergeStyle,exports.props=props,exports.tag=tag,exports.vode=vode;function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k["return"])&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function a(){};return{s:f,n:function a(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function b(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function a(){d=d.call(b)},n:function a(){var b=d.next();return h=b.done,b},e:function b(a){i=!0,g=a},f:function a(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}// src/vode.ts
2
- var globals=exports.globals={currentViewTransition:void 0,requestAnimationFrame:"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){return a()},startViewTransition:"undefined"!=typeof document&&"function"==typeof document.startViewTransition?document.startViewTransition.bind(document):null};function vode(a,b){if(!a)throw new Error("first argument to vode() must be a tag name or a vode");for(var c=arguments.length,d=Array(2<c?c-2:0),e=2;e<c;e++)d[e-2]=arguments[e];return Array.isArray(a)?a:"object"===_typeof(b)?[a,b].concat(d):[a].concat(d)}function app(a,b,c){function d(b){var d=Date.now(),e=c(i.state);i.vode=render(i.state,a.parentElement,0,0,i.vode,e),a.tagName.toUpperCase()!==e[0].toUpperCase()&&(a=i.vode.node,a._vode=i),b||(i.stats.lastSyncRenderTime=Date.now()-d,i.stats.syncRenderCount++,i.isRendering=!1,i.qSync&&i.renderSync())}for(var e,f=arguments.length,g=Array(3<f?f-3:0),h=3;h<f;h++)g[h-3]=arguments[h];if(!(null!==(e=a)&&void 0!==e&&e.parentElement))throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!b||"object"!==_typeof(b))throw new Error("second argument to app() must be a state object");if("function"!=typeof c)throw new Error("third argument to app() must be a function that returns a vode");var i={syncRenderer:globals.requestAnimationFrame,asyncRenderer:globals.startViewTransition,qSync:null,qAsync:null,stats:{lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0}},j=b;"patch"in b&&"function"==typeof b.patch&&Array.isArray(b.patch.initialPatches)&&(g=[].concat(_toConsumableArray(b.patch.initialPatches),_toConsumableArray(g))),Object.defineProperty(b,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(a,c){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d,e,f,g,h,k,l;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:if(a&&("function"==typeof a||"object"===_typeof(a))){c.n=1;break}return c.a(2);case 1:if(i.stats.patchCount++,!(null!==a&&void 0!==a&&a.next)){c.n=12;break}return d=a,i.stats.liveEffectCount++,c.p=2,c.n=3,d.next();case 3:e=c.v;case 4:if(!1!==e.done){c.n=9;break}return i.stats.liveEffectCount++,c.p=5,j.patch(e.value,b),c.n=6,d.next();case 6:e=c.v;case 7:return c.p=7,i.stats.liveEffectCount--,c.f(7);case 8:c.n=4;break;case 9:j.patch(e.value,b);case 10:return c.p=10,i.stats.liveEffectCount--,c.f(10);case 11:c.n=22;break;case 12:if(!a.then){c.n=17;break}return i.stats.liveEffectCount++,c.p=13,c.n=14,a;case 14:f=c.v,j.patch(f,b);case 15:return c.p=15,i.stats.liveEffectCount--,c.f(15);case 16:c.n=22;break;case 17:if(!Array.isArray(a)){c.n=18;break}if(0<a.length){g=_createForOfIteratorHelper(a);try{for(g.s();!(h=g.n()).done;)k=h.value,j.patch(k,!document.hidden&&!!i.asyncRenderer)}catch(a){g.e(a)}finally{g.f()}}else{i.qSync=mergeState(i.qSync||{},i.qAsync,!1),i.qAsync=null;try{null===(l=globals.currentViewTransition)||void 0===l||l.skipTransition()}catch(a){}i.stats.syncRenderPatchCount++,i.renderSync()}c.n=22;break;case 18:if("function"!=typeof a){c.n=19;break}j.patch(a(i.state),b),c.n=22;break;case 19:if(!b){c.n=21;break}return i.stats.asyncRenderPatchCount++,i.qAsync=mergeState(i.qAsync||{},a,!1),c.n=20,i.renderAsync();case 20:c.n=22;break;case 21:i.stats.syncRenderPatchCount++,i.qSync=mergeState(i.qSync||{},a,!1),i.renderSync();case 22:return c.a(2)}},c,null,[[13,,15,16],[5,,7,8],[2,,10,11]])}));return a}()});var k=d.bind(null,!1),l=d.bind(null,!0);Object.defineProperty(i,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:function a(){i.isRendering||!i.qSync||(i.isRendering=!0,i.state=mergeState(i.state,i.qSync,!0),i.qSync=null,i.syncRenderer(k))}}),Object.defineProperty(i,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(!i.isAnimating&&i.qAsync){a.n=1;break}return a.a(2);case 1:return a.n=2,null===(b=globals.currentViewTransition)||void 0===b?void 0:b.updateCallbackDone;case 2:if(!(i.isAnimating||!i.qAsync||document.hidden)){a.n=3;break}return a.a(2);case 3:return i.isAnimating=!0,c=Date.now(),a.p=4,i.state=mergeState(i.state,i.qAsync,!0),i.qAsync=null,globals.currentViewTransition=i.asyncRenderer(l),a.n=5,null===(d=globals.currentViewTransition)||void 0===d?void 0:d.updateCallbackDone;case 5:return a.p=5,i.stats.lastAsyncRenderTime=Date.now()-c,i.stats.asyncRenderCount++,i.isAnimating=!1,a.f(5);case 6:i.qAsync&&i.renderAsync();case 7:return a.a(2)}},a,null,[[4,,5,6]])}));return a}()}),i.state=j;var m=a;m._vode=i;var n=Array.from(a.parentElement.children).indexOf(a);i.isRendering=!0,i.vode=render(b,a.parentElement,n,n,hydrate(a,!0),c(b)),i.isRendering=!1,i.qSync&&i.renderSync();var o,p=_createForOfIteratorHelper(g);try{for(p.s();!(o=p.n()).done;){var q=o.value;j.patch(q)}}catch(a){p.e(a)}finally{p.f()}return function(a){return j.patch(a)}}function defuse(a){if(null!==a&&void 0!==a&&a._vode){var b=function c(a){if(null!==a&&void 0!==a&&a.node){var d=props(a);if(d){for(var e in d)"o"===e[0]&&"n"===e[1]&&(a.node[e]=null);a.node["catch"]=null}if(a.node._vode)defuse(a.node);else{var f=children(a);if(f){var g,h=_createForOfIteratorHelper(f);try{for(h.s();!(g=h.n()).done;){var i=g.value;b(i)}}catch(a){h.e(a)}finally{h.f()}}}}},c=b,d=a._vode;delete a._vode,Object.defineProperty(d.state,"patch",{value:void 0}),Object.defineProperty(d,"renderSync",{value:function a(){}}),Object.defineProperty(d,"renderAsync",{value:function a(){}}),b(d.vode)}else{var e,f=_createForOfIteratorHelper(a.children);try{for(f.s();!(e=f.n()).done;){var g=e.value;defuse(g)}}catch(a){f.e(a)}finally{f.f()}}}function hydrate(b,c){if((null===b||void 0===b?void 0:b.nodeType)===Node.TEXT_NODE){var d;return""===(null===(d=b.nodeValue)||void 0===d?void 0:d.trim())?void 0:c?b:b.nodeValue}if(b.nodeType===Node.ELEMENT_NODE){var e=b.tagName.toLowerCase(),f=[e];if(c&&(f.node=b),null!==b&&void 0!==b&&b.hasAttributes()){var g,h={},i=b.attributes,j=_createForOfIteratorHelper(i);try{for(j.s();!(g=j.n()).done;){var k=g.value;h[k.name]=k.value}}catch(a){j.e(a)}finally{j.f()}f.push(h)}if(b.hasChildNodes()){var l,m=[],n=_createForOfIteratorHelper(b.childNodes);try{for(n.s();!(l=n.n()).done;){var o=l.value,p=o&&hydrate(o,c);p?f.push(p):o&&c&&m.push(o)}}catch(a){n.e(a)}finally{n.f()}for(var q,r=0,s=m;r<s.length;r++)q=s[r],q.remove()}return f}}function memo(a,b){if(!a||!Array.isArray(a))throw new Error("first argument to memo() must be an array of values to compare");if("function"!=typeof b)throw new Error("second argument to memo() must be a function that returns a vode or props object");return b.__memo=a,b}function createState(a){if(!a||"object"!==_typeof(a))throw new Error("createState() must be called with a state object");return"patch"in a||Object.defineProperty(a,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(b){var d=a;Array.isArray(d.patch.initialPatches)||(d.patch.initialPatches=[]),d.patch.initialPatches.push(b)}}),a}function createPatch(a){return a}function tag(a){return!a?void 0:Array.isArray(a)?a[0]:"string"==typeof a||a.nodeType===Node.TEXT_NODE?"#text":void 0}function props(a){return Array.isArray(a)&&1<a.length&&a[1]&&!Array.isArray(a[1])&&"object"===_typeof(a[1])&&a[1].nodeType!==Node.TEXT_NODE?a[1]:void 0}function children(a){var b=childrenStart(a);return 0<b?a.slice(b):null}function childCount(a){var b=childrenStart(a);return 0>b?0:a.length-b}function child(a,b){var c=childrenStart(a);return 0<c?a[b+c]:void 0}function childrenStart(a){return props(a)?2<a.length?2:-1:Array.isArray(a)&&1<a.length?1:-1}function mergeState(a,b,c){if(!b)return a;for(var d in b){var e=b[d];if(e&&"object"===_typeof(e)){var f=a[d];f?Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date&&f!==e?a[d]=new Date(e):Array.isArray(f)?a[d]=mergeState({},e,c):"object"===_typeof(f)?mergeState(a[d],e,c):a[d]=mergeState({},e,c):Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date?a[d]=new Date(e):a[d]=mergeState({},e,c)}else void 0===e&&c?delete a[d]:a[d]=e}return a}function render(a,b,c,d,e,f,g){try{var h,j;f=remember(a,f,e);var k=!f||"number"==typeof f||"boolean"==typeof f;if(f===e||!e&&k)return e;var l=(null===e||void 0===e?void 0:e.nodeType)===Node.TEXT_NODE,m=l?e:null===e||void 0===e?void 0:e.node;if(k)return unmountTree(a,e),void(null===m||void 0===m||m.remove());var n=!k&&isTextVode(f),o=!k&&isNaturalVode(f),p=!!f&&"string"!=typeof f&&!!(null!==(h=f)&&void 0!==h&&h.node||(null===(j=f)||void 0===j?void 0:j.nodeType)===Node.TEXT_NODE);if(!n&&!o&&!p&&!e)throw new Error("Invalid vode: "+_typeof(f)+" "+JSON.stringify(f));else p&&n?f=f.wholeText:p&&o&&(f=_toConsumableArray(f));if(l&&n)return m.nodeValue!==f&&(m.nodeValue=f),e;if(n&&(!m||!l)){var q=document.createTextNode(f);if(m)unmountTree(a,e),m.replaceWith(q);else{for(var r,s=!1,t=d;t<b.childNodes.length;t++)if(r=b.childNodes[t],r){r.before(q,r),s=!0;break}s||b.appendChild(q)}return q}if(o&&(!m||l||e[0]!==f[0])){var u=f;1 in u&&(u[1]=remember(a,u[1],void 0));var v=props(f);void 0!==(null===v||void 0===v?void 0:v.xmlns)&&(g=v.xmlns);var w=g?document.createElementNS(g,f[0]):document.createElement(f[0]);if(f.node=w,patchProperties(a,w,void 0,v,null!==g&&void 0!==g?g:null),!!v&&"catch"in v&&(f.node["catch"]=null,f.node.removeAttribute("catch")),m)unmountTree(a,e),m.replaceWith(w);else{for(var x,y=!1,z=d;z<b.childNodes.length;z++)if(x=b.childNodes[z],x){x.before(w,x),y=!0;break}y||b.appendChild(w)}var A=children(f);if(A)for(var B=v?2:1,C=0,D=0;D<A.length;D++){var E=A[D],F=render(a,w,D,C,void 0,E,null!==g&&void 0!==g?g:null);f[D+B]=F,F&&C++}return f._unmountCount=(null!==v&&void 0!==v&&v.onUnmount?1:0)+sumChildUnmountCounts(f),"function"==typeof(null===v||void 0===v?void 0:v.onMount)&&a.patch(v.onMount(a,w)),f}if(!l&&o&&e[0]===f[0]){var G;f.node=m;var H=f,I=e,J=props(f),K=props(e);if(void 0!==(null===J||void 0===J?void 0:J.xmlns)&&(g=J.xmlns),null!==(G=H[1])&&void 0!==G&&G.__memo){var L=H[1];H[1]=remember(a,H[1],I[1]),L!==H[1]&&patchProperties(a,m,K,J,g)}else patchProperties(a,m,K,J,g);!(null!==J&&void 0!==J&&J["catch"])||(null===K||void 0===K?void 0:K["catch"])===J["catch"]||(f.node["catch"]=null,f.node.removeAttribute("catch"));var M=children(f),N=children(e);if(M)for(var O=J?2:1,P=0,Q=0;Q<M.length;Q++){var R=M[Q],S=N&&N[Q],T=render(a,m,Q,P,S,R,g);f[Q+O]=T,T&&P++}if(N)for(var U=M?M.length:0,V=N.length-1;V>=U;V--)render(a,m,V,V,N[V],void 0,g);return f._unmountCount=(null!==J&&void 0!==J&&J.onUnmount?1:0)+sumChildUnmountCounts(f),f}}catch(h){var W,X=null===(W=props(f))||void 0===W?void 0:W["catch"];if(X){var Y,Z="function"==typeof X?X(a,h):X;return render(a,b,c,d,hydrate((null===(Y=f)||void 0===Y?void 0:Y.node)||(null===e||void 0===e?void 0:e.node),!0),Z,g)}throw h}}function unmountTree(a,b){if(b&&Array.isArray(b)&&0!=(0|b._unmountCount)){var c=children(b);if(c)for(var d=c.length-1;0<=d;d--)unmountTree(a,c[d]);var e=props(b);"function"==typeof(null===e||void 0===e?void 0:e.onUnmount)&&a.patch(e.onUnmount(a,b.node))}}function sumChildUnmountCounts(a){var b=children(a);if(!b)return 0;var c,d=0,e=_createForOfIteratorHelper(b);try{for(e.s();!(c=e.n()).done;){var f=c.value;f&&Array.isArray(f)&&(d+=0|f._unmountCount)}}catch(a){e.e(a)}finally{e.f()}return d}function isNaturalVode(a){return Array.isArray(a)&&0<a.length&&"string"==typeof a[0]}function isTextVode(a){return"string"==typeof a||(null===a||void 0===a?void 0:a.nodeType)===Node.TEXT_NODE}function remember(a,b,c){if("function"!=typeof b)return b;var d=null===b||void 0===b?void 0:b.__memo,e=null===c||void 0===c?void 0:c.__memo;if(Array.isArray(d)&&Array.isArray(e)&&d.length===e.length){for(var f=!0,g=0;g<d.length;g++)if(d[g]!==e[g]){f=!1;break}if(f)return c}var h=b(a);if("function"==typeof h&&null!==h&&void 0!==h&&h.__memo){var j=h.__memo;if(Array.isArray(j)&&Array.isArray(e)&&j.length===e.length){for(var k=!0,l=0;l<j.length;l++)if(j[l]!==e[l]){k=!1;break}if(k)return c}var m=h(a);return"object"===_typeof(m)&&(m.__memo=j),m}var n="function"==typeof h?unwrap(h,a):h;return"object"===_typeof(n)&&(n.__memo=(null===h||void 0===h?void 0:h.__memo)||(null===b||void 0===b?void 0:b.__memo)),n}function unwrap(a,b){return"function"==typeof a?unwrap(a(b),b):a}function patchProperties(a,b,c,d,e){if(d||c){var f=void 0!==e;if(c)for(var g in c){var h=c[g],i=null===d||void 0===d?void 0:d[g];h!==i&&(d?d[g]=patchProperty(a,b,g,h,i,f):patchProperty(a,b,g,h,void 0,f))}if(d&&c){for(var j in d)if(!(j in c)){var k=d[j];d[j]=patchProperty(a,b,j,void 0,k,f)}}else if(d)for(var l in d){var m=d[l];d[l]=patchProperty(a,b,l,void 0,m,f)}}}function patchProperty(a,b,c,d,e,f){if("style"===c){if(!e)b.style.cssText="";else if("string"==typeof e)d!==e&&(b.style.cssText=e);else if(d&&"object"===_typeof(d)){for(var g in d){var h=e[g];h||(b.style[g]=null)}for(var i in e){var j=d[i],l=e[i];j!==l&&(b.style[i]=l)}}else for(var m in e)b.style[m]=e[m];}else if("class"===c)e?b.setAttribute("class",classString(e)):b.removeAttribute("class");else if(!("o"===c[0]&&"n"===c[1]))f||(b[c]=e),void 0===e||null===e||!1===e?b.removeAttribute(c):b.setAttribute(c,e);else if(e){var n=null;if("function"==typeof e){var o=e;n=function c(b){return a.patch(o(a,b))}}else"object"===_typeof(e)&&(n=function b(){return a.patch(e)});b[c]=n}else b[c]=null;return e}function classString(a){return"string"==typeof a?a:Array.isArray(a)?a.map(classString).join(" "):"object"===_typeof(a)?Object.keys(a).filter(function(b){return a[b]}).join(" "):""}// src/vode-tags.ts
2
+ var globals=exports.globals={currentViewTransition:void 0,requestAnimationFrame:"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){return a()},startViewTransition:"undefined"!=typeof document&&"function"==typeof document.startViewTransition?document.startViewTransition.bind(document):null};function vode(a,b){if(!a)throw new Error("first argument to vode() must be a tag name or a vode");for(var c=arguments.length,d=Array(2<c?c-2:0),e=2;e<c;e++)d[e-2]=arguments[e];return Array.isArray(a)?a:"object"===_typeof(b)?[a,b].concat(d):[a].concat(d)}function app(a,b,c){function d(a,b){return e.apply(this,arguments)}function e(){return e=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return m.stats.liveEffectCount++,c.p=1,c.n=2,a;case 2:d=c.v,n.patch(d,b);case 3:return c.p=3,m.stats.liveEffectCount--,c.f(3);case 4:return c.a(2)}},c,null,[[1,,3,4]])})),e.apply(this,arguments)}function f(a,b){return g.apply(this,arguments)}function g(){return g=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d,e;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return d=a,m.stats.liveEffectCount++,c.p=1,c.n=2,d.next();case 2:e=c.v;case 3:if(!1!==e.done){c.n=8;break}return m.stats.liveEffectCount++,c.p=4,n.patch(e.value,b),c.n=5,d.next();case 5:e=c.v;case 6:return c.p=6,m.stats.liveEffectCount--,c.f(6);case 7:c.n=3;break;case 8:n.patch(e.value,b);case 9:return c.p=9,m.stats.liveEffectCount--,c.f(9);case 10:return c.a(2)}},c,null,[[4,,6,7],[1,,9,10]])})),g.apply(this,arguments)}function h(b){var d=performance.now(),e=c(m.state);if(m.vode=render(m.state,a.parentElement,0,0,m.vode,e),a.tagName.toUpperCase()!==e[0].toUpperCase()&&(a=m.vode.node,a._vode=m),!b){m.stats.lastSyncRenderTime=performance.now()-d;var f=m.isRendering!==m.stats.syncRenderPatchCount;m.stats.syncRenderCount++,m.isRendering=0,f&&m.renderSync()}}for(var i,j=arguments.length,k=Array(3<j?j-3:0),l=3;l<j;l++)k[l-3]=arguments[l];if(!(null!==(i=a)&&void 0!==i&&i.parentElement))throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!b||"object"!==_typeof(b))throw new Error("second argument to app() must be a state object");if("function"!=typeof c)throw new Error("third argument to app() must be a function that returns a vode");var m={syncRenderer:globals.requestAnimationFrame,asyncRenderer:globals.startViewTransition,isRendering:0,qAsync:null,stats:{lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0}},n=b;"patch"in b&&"function"==typeof b.patch&&Array.isArray(b.patch.initialPatches)&&(k=[].concat(_toConsumableArray(b.patch.initialPatches),_toConsumableArray(k))),Object.defineProperty(b,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(a,b){for(var e;"function"==typeof a;)a=a(m.state);if(a&&"object"===_typeof(a))if(m.stats.patchCount++,null!==(e=a)&&void 0!==e&&e.next)f(a,b);else if(a.then)d(a,b);else if(!Array.isArray(a))b?(m.stats.asyncRenderPatchCount++,m.qAsync=mergeState(m.qAsync||{},a,!1),m.renderAsync()):(m.stats.syncRenderPatchCount++,mergeState(m.state,a,!0),m.renderSync());else if(0<a.length){var g,h=_createForOfIteratorHelper(a);try{for(h.s();!(g=h.n()).done;){var i=g.value;n.patch(i,!document.hidden&&!!m.asyncRenderer)}}catch(a){h.e(a)}finally{h.f()}}else{mergeState(m.state,m.qAsync,!0),m.qAsync=null;try{var j;null===(j=globals.currentViewTransition)||void 0===j||j.skipTransition()}catch(a){}m.stats.syncRenderPatchCount++,m.renderSync()}}});var o=h.bind(null,!1),p=h.bind(null,!0);Object.defineProperty(m,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:function a(){m.isRendering||(m.isRendering=m.stats.syncRenderPatchCount,m.syncRenderer(o))}}),Object.defineProperty(m,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(!m.isAnimating&&m.qAsync){a.n=1;break}return a.a(2);case 1:return a.n=2,null===(b=globals.currentViewTransition)||void 0===b?void 0:b.updateCallbackDone;case 2:if(!(m.isAnimating||!m.qAsync||document.hidden)){a.n=3;break}return a.a(2);case 3:return m.isAnimating=!0,c=performance.now(),a.p=4,m.state=mergeState(m.state,m.qAsync,!0),m.qAsync=null,globals.currentViewTransition=m.asyncRenderer(p),a.n=5,null===(d=globals.currentViewTransition)||void 0===d?void 0:d.updateCallbackDone;case 5:return a.p=5,m.stats.lastAsyncRenderTime=performance.now()-c,m.stats.asyncRenderCount++,m.isAnimating=!1,a.f(5);case 6:m.qAsync&&m.renderAsync();case 7:return a.a(2)}},a,null,[[4,,5,6]])}));return a}()}),m.state=n;var q=a;q._vode=m;var r=Array.from(a.parentElement.children).indexOf(a),s=m.stats.syncRenderPatchCount;m.isRendering=m.stats.syncRenderPatchCount,m.vode=render(b,a.parentElement,r,r,hydrate(a,!0),c(b));var t=m.stats.syncRenderPatchCount!==s;m.isRendering=0,m.stats.syncRenderCount++,t&&m.renderSync();var u,v=_createForOfIteratorHelper(k);try{for(v.s();!(u=v.n()).done;){var w=u.value;n.patch(w)}}catch(a){v.e(a)}finally{v.f()}return function(a){return n.patch(a)}}function defuse(a){if(null!==a&&void 0!==a&&a._vode){var b=function c(a){if(null!==a&&void 0!==a&&a.node){var d=props(a);if(d){for(var e in d)"o"===e[0]&&"n"===e[1]&&(a.node[e]=null);a.node["catch"]=null}if(a.node._vode)defuse(a.node);else{var f=children(a);if(f){var g,h=_createForOfIteratorHelper(f);try{for(h.s();!(g=h.n()).done;){var i=g.value;b(i)}}catch(a){h.e(a)}finally{h.f()}}}}},c=b,d=a._vode;delete a._vode,Object.defineProperty(d.state,"patch",{value:void 0}),Object.defineProperty(d,"renderSync",{value:function a(){}}),Object.defineProperty(d,"renderAsync",{value:function a(){}}),b(d.vode)}else{var e,f=_createForOfIteratorHelper(a.children);try{for(f.s();!(e=f.n()).done;){var g=e.value;defuse(g)}}catch(a){f.e(a)}finally{f.f()}}}function hydrate(b,c){if((null===b||void 0===b?void 0:b.nodeType)===Node.TEXT_NODE){var d;return""===(null===(d=b.nodeValue)||void 0===d?void 0:d.trim())?void 0:c?b:b.nodeValue}if(b.nodeType===Node.ELEMENT_NODE){var e=b.tagName.toLowerCase(),f=[e];if(c&&(f.node=b),null!==b&&void 0!==b&&b.hasAttributes()){var g,h={},i=b.attributes,j=_createForOfIteratorHelper(i);try{for(j.s();!(g=j.n()).done;){var k=g.value;h[k.name]=k.value}}catch(a){j.e(a)}finally{j.f()}f.push(h)}if(b.hasChildNodes()){var l,m=[],n=_createForOfIteratorHelper(b.childNodes);try{for(n.s();!(l=n.n()).done;){var o=l.value,p=o&&hydrate(o,c);p?f.push(p):o&&c&&m.push(o)}}catch(a){n.e(a)}finally{n.f()}for(var q,r=0,s=m;r<s.length;r++)q=s[r],q.remove()}return f}}function memo(a,b){if(!a||!Array.isArray(a))throw new Error("first argument to memo() must be an array of values to compare");if("function"!=typeof b)throw new Error("second argument to memo() must be a function that returns a child vode");if(b.__memo){var c=b;b=function b(a){return c(a)}}return b.__memo=a,b}function createState(a){if(!a||"object"!==_typeof(a))throw new Error("createState() must be called with a state object");return"patch"in a||Object.defineProperty(a,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(b){var d=a;Array.isArray(d.patch.initialPatches)||(d.patch.initialPatches=[]),d.patch.initialPatches.push(b)}}),a}function createPatch(a){return a}function tag(a){return!a?void 0:Array.isArray(a)?a[0]:"string"==typeof a||a.nodeType===Node.TEXT_NODE?"#text":void 0}function props(a){return Array.isArray(a)&&1<a.length&&a[1]&&!Array.isArray(a[1])&&"object"===_typeof(a[1])&&a[1].nodeType!==Node.TEXT_NODE?a[1]:void 0}function children(a){var b=childrenStart(a);return 0<b?a.slice(b):null}function childCount(a){var b=childrenStart(a);return 0>b?0:a.length-b}function child(a,b){var c=childrenStart(a);return 0<c?a[b+c]:void 0}function childrenStart(a){return props(a)?2<a.length?2:-1:Array.isArray(a)&&1<a.length?1:-1}function mergeState(a,b,c){if(!b)return a;for(var d in b){var e=b[d];if(e&&"object"===_typeof(e)){var f=a[d];f?Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date&&f!==e?a[d]=new Date(e):Array.isArray(f)?a[d]=mergeState({},e,c):"object"===_typeof(f)?mergeState(a[d],e,c):a[d]=mergeState({},e,c):Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date?a[d]=new Date(e):a[d]=mergeState({},e,c)}else void 0===e&&c?delete a[d]:a[d]=e}return a}function render(a,b,c,d,e,f,g){try{var h,j;f=remember(a,f,e);var k=!f||"number"==typeof f||"boolean"==typeof f;if(f===e||!e&&k)return e;var l=(null===e||void 0===e?void 0:e.nodeType)===Node.TEXT_NODE,m=l?e:null===e||void 0===e?void 0:e.node;if(k)return unmountTree(a,e),void(null===m||void 0===m||m.remove());var n=!k&&isTextVode(f),o=!k&&isNaturalVode(f),p=!!f&&"string"!=typeof f&&!!(null!==(h=f)&&void 0!==h&&h.node||(null===(j=f)||void 0===j?void 0:j.nodeType)===Node.TEXT_NODE);if(!n&&!o&&!p&&!e)throw new Error("Invalid vode: "+_typeof(f)+" "+JSON.stringify(f));else p&&n?f=f.wholeText:p&&o&&(f=_toConsumableArray(f));if(l&&n)return m.nodeValue!==f&&(m.nodeValue=f),e;if(n&&(!m||!l)){var q=document.createTextNode(f);if(m)unmountTree(a,e),m.replaceWith(q);else{for(var r,s=!1,t=d;t<b.childNodes.length;t++)if(r=b.childNodes[t],r){r.before(q),s=!0;break}s||b.appendChild(q)}return q}if(o&&(!m||l||e[0]!==f[0])){var u=f;1 in u&&(u[1]=remember(a,u[1],void 0));var v=props(f);void 0!==(null===v||void 0===v?void 0:v.xmlns)&&(g=v.xmlns);var w=g?document.createElementNS(g,f[0]):document.createElement(f[0]);if(f.node=w,patchProperties(a,w,void 0,v,null!==g&&void 0!==g?g:null),!!v&&"catch"in v&&(f.node["catch"]=null,f.node.removeAttribute("catch")),m)unmountTree(a,e),m.replaceWith(w);else{for(var x,y=!1,z=d;z<b.childNodes.length;z++)if(x=b.childNodes[z],x){x.before(w),y=!0;break}y||b.appendChild(w)}var A=childrenStart(f);if(0<A)for(var B=v?2:1,C=0,D=0;D<f.length-A;D++){var E=f[D+A],F=render(a,w,D,C,void 0,E,null!==g&&void 0!==g?g:null);f[D+B]=F,F&&C++}return f._unmountCount=(null!==v&&void 0!==v&&v.onUnmount?1:0)+sumChildUnmountCounts(f),"function"==typeof(null===v||void 0===v?void 0:v.onMount)&&a.patch(v.onMount(a,w)),f}if(!l&&o&&e[0]===f[0]){f.node=m;var G=props(f),H=props(e);void 0!==(null===G||void 0===G?void 0:G.xmlns)&&(g=G.xmlns),patchProperties(a,m,H,G,g),!(null!==G&&void 0!==G&&G["catch"])||(null===H||void 0===H?void 0:H["catch"])===G["catch"]||(f.node["catch"]=null,f.node.removeAttribute("catch"));var I=childrenStart(f),J=childrenStart(e);if(0<I)for(var K=0,L=0;L<f.length-I;L++){var M=f[L+I],N=0<J?e[L+J]:void 0,O=render(a,m,L,K,N,M,g);f[L+I]=O,O&&K++}if(0<J)for(var P=0<I?f.length-I:0,Q=e.length-1-J;Q>=P;Q--)render(a,m,Q,Q,e[Q+J],void 0,g);return f._unmountCount=(null!==G&&void 0!==G&&G.onUnmount?1:0)+sumChildUnmountCounts(f),f}}catch(h){var R,S=null===(R=props(f))||void 0===R?void 0:R["catch"];if(S){var T,U="function"==typeof S?S(a,h):S;return render(a,b,c,d,hydrate((null===(T=f)||void 0===T?void 0:T.node)||(null===e||void 0===e?void 0:e.node),!0),U,g)}throw h}}function unmountTree(a,b){if(b&&Array.isArray(b)&&0!=(0|b._unmountCount)){var c=children(b);if(c)for(var d=c.length-1;0<=d;d--)unmountTree(a,c[d]);var e=props(b);"function"==typeof(null===e||void 0===e?void 0:e.onUnmount)&&a.patch(e.onUnmount(a,b.node))}}function sumChildUnmountCounts(a){var b=children(a);if(!b)return 0;var c,d=0,e=_createForOfIteratorHelper(b);try{for(e.s();!(c=e.n()).done;){var f=c.value;f&&Array.isArray(f)&&(d+=0|f._unmountCount)}}catch(a){e.e(a)}finally{e.f()}return d}function isNaturalVode(a){return Array.isArray(a)&&0<a.length&&"string"==typeof a[0]}function isTextVode(a){return"string"==typeof a||(null===a||void 0===a?void 0:a.nodeType)===Node.TEXT_NODE}function remember(a,b,c){for(var d;"function"==typeof b&&!b.__memo;)b=b(a);if("function"!=typeof b)return b;var e=null===(d=b)||void 0===d?void 0:d.__memo,f=null===c||void 0===c?void 0:c.__memo;if(Array.isArray(e)&&Array.isArray(f)&&e.length===f.length){for(var g=!0,h=0;h<e.length;h++)if(e[h]!==f[h]){g=!1;break}if(g)return c}for(;"function"==typeof b;)b=b(a);return"object"===_typeof(b)&&(b.__memo=e),b}function patchProperties(a,b,c,d,e){if(d||c){var f=void 0!==e;if(c)for(var g in c){var h=c[g],i=null===d||void 0===d?void 0:d[g];h!==i&&(d?d[g]=patchProperty(a,b,g,h,i,f):patchProperty(a,b,g,h,void 0,f))}if(d&&c){for(var j in d)if(!(j in c)){var k=d[j];d[j]=patchProperty(a,b,j,void 0,k,f)}}else if(d)for(var l in d){var m=d[l];d[l]=patchProperty(a,b,l,void 0,m,f)}}}function patchProperty(a,b,c,d,e,f){if("style"===c){if(!e)b.style.cssText="";else if("string"==typeof e)d!==e&&(b.style.cssText=e);else if(d&&"object"===_typeof(d)){for(var g in d){var h=e[g];h||(b.style[g]=null)}for(var i in e){var j=d[i],l=e[i];j!==l&&(b.style[i]=l)}}else for(var m in e)b.style[m]=e[m];}else if("class"===c)e?b.setAttribute("class",classString(e)):b.removeAttribute("class");else if(!("o"===c[0]&&"n"===c[1]))f||(b[c]=e),void 0===e||null===e||!1===e?b.removeAttribute(c):b.setAttribute(c,e);else if(e){var n=null;if("function"==typeof e){var o=e;n=function c(b){return a.patch(o(a,b))}}else"object"===_typeof(e)&&(n=function b(){return a.patch(e)});b[c]=n}else b[c]=null;return e}function classString(a){return"string"==typeof a?a:Array.isArray(a)?a.map(classString).join(" "):"object"===_typeof(a)?Object.keys(a).filter(function(b){return a[b]}).join(" "):""}// src/vode-tags.ts
3
3
  var A=exports.A="a",ABBR=exports.ABBR="abbr",ADDRESS=exports.ADDRESS="address",AREA=exports.AREA="area",ARTICLE=exports.ARTICLE="article",ASIDE=exports.ASIDE="aside",AUDIO=exports.AUDIO="audio",B=exports.B="b",BASE=exports.BASE="base",BDI=exports.BDI="bdi",BDO=exports.BDO="bdo",BLOCKQUOTE=exports.BLOCKQUOTE="blockquote",BODY=exports.BODY="body",BR=exports.BR="br",BUTTON=exports.BUTTON="button",CANVAS=exports.CANVAS="canvas",CAPTION=exports.CAPTION="caption",CITE=exports.CITE="cite",CODE=exports.CODE="code",COL=exports.COL="col",COLGROUP=exports.COLGROUP="colgroup",DATA=exports.DATA="data",DATALIST=exports.DATALIST="datalist",DD=exports.DD="dd",DEL=exports.DEL="del",DETAILS=exports.DETAILS="details",DFN=exports.DFN="dfn",DIALOG=exports.DIALOG="dialog",DIV=exports.DIV="div",DL=exports.DL="dl",DT=exports.DT="dt",EM=exports.EM="em",EMBED=exports.EMBED="embed",FIELDSET=exports.FIELDSET="fieldset",FIGCAPTION=exports.FIGCAPTION="figcaption",FIGURE=exports.FIGURE="figure",FOOTER=exports.FOOTER="footer",FORM=exports.FORM="form",H1=exports.H1="h1",H2=exports.H2="h2",H3=exports.H3="h3",H4=exports.H4="h4",H5=exports.H5="h5",H6=exports.H6="h6",HEAD=exports.HEAD="head",HEADER=exports.HEADER="header",HGROUP=exports.HGROUP="hgroup",HR=exports.HR="hr",HTML=exports.HTML="html",I=exports.I="i",IFRAME=exports.IFRAME="iframe",IMG=exports.IMG="img",INPUT=exports.INPUT="input",INS=exports.INS="ins",KBD=exports.KBD="kbd",LABEL=exports.LABEL="label",LEGEND=exports.LEGEND="legend",LI=exports.LI="li",LINK=exports.LINK="link",MAIN=exports.MAIN="main",MAP=exports.MAP="map",MARK=exports.MARK="mark",MENU=exports.MENU="menu",META=exports.META="meta",METER=exports.METER="meter",NAV=exports.NAV="nav",NOSCRIPT=exports.NOSCRIPT="noscript",OBJECT=exports.OBJECT="object",OL=exports.OL="ol",OPTGROUP=exports.OPTGROUP="optgroup",OPTION=exports.OPTION="option",OUTPUT=exports.OUTPUT="output",P=exports.P="p",PICTURE=exports.PICTURE="picture",PRE=exports.PRE="pre",PROGRESS=exports.PROGRESS="progress",Q=exports.Q="q",RP=exports.RP="rp",RT=exports.RT="rt",RUBY=exports.RUBY="ruby",S=exports.S="s",SAMP=exports.SAMP="samp",SCRIPT=exports.SCRIPT="script",SEARCH=exports.SEARCH="search",SECTION=exports.SECTION="section",SELECT=exports.SELECT="select",SLOT=exports.SLOT="slot",SMALL=exports.SMALL="small",SOURCE=exports.SOURCE="source",SPAN=exports.SPAN="span",STRONG=exports.STRONG="strong",STYLE=exports.STYLE="style",SUB=exports.SUB="sub",SUMMARY=exports.SUMMARY="summary",SUP=exports.SUP="sup",TABLE=exports.TABLE="table",TBODY=exports.TBODY="tbody",TD=exports.TD="td",TEMPLATE=exports.TEMPLATE="template",TEXTAREA=exports.TEXTAREA="textarea",TFOOT=exports.TFOOT="tfoot",TH=exports.TH="th",THEAD=exports.THEAD="thead",TIME=exports.TIME="time",TITLE=exports.TITLE="title",TR=exports.TR="tr",TRACK=exports.TRACK="track",U=exports.U="u",UL=exports.UL="ul",VAR=exports.VAR="var",VIDEO=exports.VIDEO="video",WBR=exports.WBR="wbr",ANIMATE=exports.ANIMATE="animate",ANIMATEMOTION=exports.ANIMATEMOTION="animateMotion",ANIMATETRANSFORM=exports.ANIMATETRANSFORM="animateTransform",CIRCLE=exports.CIRCLE="circle",CLIPPATH=exports.CLIPPATH="clipPath",DEFS=exports.DEFS="defs",DESC=exports.DESC="desc",ELLIPSE=exports.ELLIPSE="ellipse",FEBLEND=exports.FEBLEND="feBlend",FECOLORMATRIX=exports.FECOLORMATRIX="feColorMatrix",FECOMPONENTTRANSFER=exports.FECOMPONENTTRANSFER="feComponentTransfer",FECOMPOSITE=exports.FECOMPOSITE="feComposite",FECONVOLVEMATRIX=exports.FECONVOLVEMATRIX="feConvolveMatrix",FEDIFFUSELIGHTING=exports.FEDIFFUSELIGHTING="feDiffuseLighting",FEDISPLACEMENTMAP=exports.FEDISPLACEMENTMAP="feDisplacementMap",FEDISTANTLIGHT=exports.FEDISTANTLIGHT="feDistantLight",FEDROPSHADOW=exports.FEDROPSHADOW="feDropShadow",FEFLOOD=exports.FEFLOOD="feFlood",FEFUNCA=exports.FEFUNCA="feFuncA",FEFUNCB=exports.FEFUNCB="feFuncB",FEFUNCG=exports.FEFUNCG="feFuncG",FEFUNCR=exports.FEFUNCR="feFuncR",FEGAUSSIANBLUR=exports.FEGAUSSIANBLUR="feGaussianBlur",FEIMAGE=exports.FEIMAGE="feImage",FEMERGE=exports.FEMERGE="feMerge",FEMERGENODE=exports.FEMERGENODE="feMergeNode",FEMORPHOLOGY=exports.FEMORPHOLOGY="feMorphology",FEOFFSET=exports.FEOFFSET="feOffset",FEPOINTLIGHT=exports.FEPOINTLIGHT="fePointLight",FESPECULARLIGHTING=exports.FESPECULARLIGHTING="feSpecularLighting",FESPOTLIGHT=exports.FESPOTLIGHT="feSpotLight",FETILE=exports.FETILE="feTile",FETURBULENCE=exports.FETURBULENCE="feTurbulence",FILTER=exports.FILTER="filter",FOREIGNOBJECT=exports.FOREIGNOBJECT="foreignObject",G=exports.G="g",IMAGE=exports.IMAGE="image",LINE=exports.LINE="line",LINEARGRADIENT=exports.LINEARGRADIENT="linearGradient",MARKER=exports.MARKER="marker",MASK=exports.MASK="mask",METADATA=exports.METADATA="metadata",MPATH=exports.MPATH="mpath",PATH=exports.PATH="path",PATTERN=exports.PATTERN="pattern",POLYGON=exports.POLYGON="polygon",POLYLINE=exports.POLYLINE="polyline",RADIALGRADIENT=exports.RADIALGRADIENT="radialGradient",RECT=exports.RECT="rect",SET=exports.SET="set",STOP=exports.STOP="stop",SVG=exports.SVG="svg",SWITCH=exports.SWITCH="switch",SYMBOL=exports.SYMBOL="symbol",TEXT=exports.TEXT="text",TEXTPATH=exports.TEXTPATH="textPath",TSPAN=exports.TSPAN="tspan",USE=exports.USE="use",VIEW=exports.VIEW="view",ANNOTATION=exports.ANNOTATION="annotation",ANNOTATION_XML=exports.ANNOTATION_XML="annotation-xml",MACTION=exports.MACTION="maction",MATH=exports.MATH="math",MERROR=exports.MERROR="merror",MFRAC=exports.MFRAC="mfrac",MI=exports.MI="mi",MMULTISCRIPTS=exports.MMULTISCRIPTS="mmultiscripts",MN=exports.MN="mn",MO=exports.MO="mo",MOVER=exports.MOVER="mover",MPADDED=exports.MPADDED="mpadded",MPHANTOM=exports.MPHANTOM="mphantom",MPRESCRIPTS=exports.MPRESCRIPTS="mprescripts",MROOT=exports.MROOT="mroot",MROW=exports.MROW="mrow",MS=exports.MS="ms",MSPACE=exports.MSPACE="mspace",MSQRT=exports.MSQRT="msqrt",MSTYLE=exports.MSTYLE="mstyle",MSUB=exports.MSUB="msub",MSUBSUP=exports.MSUBSUP="msubsup",MSUP=exports.MSUP="msup",MTABLE=exports.MTABLE="mtable",MTD=exports.MTD="mtd",MTEXT=exports.MTEXT="mtext",MTR=exports.MTR="mtr",MUNDER=exports.MUNDER="munder",MUNDEROVER=exports.MUNDEROVER="munderover",SEMANTICS=exports.SEMANTICS="semantics";// src/merge-class.ts
4
4
  function mergeClass(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];if(!d||0===d.length)return null;if(1===d.length)return d[0];for(var f=d[0],g=1;g<d.length;g++){var h=f,i=d[g];if(!h)f=i;else if(!i)continue;else if("string"==typeof h&&"string"==typeof i){var j=h.split(" "),k=i.split(" "),l=/* @__PURE__ */new Set([].concat(_toConsumableArray(j),_toConsumableArray(k)));f=Array.from(l).join(" ").trim()}else if("string"==typeof h&&Array.isArray(i)){var m=/* @__PURE__ */new Set([].concat(_toConsumableArray(i),_toConsumableArray(h.split(" "))));f=Array.from(m).join(" ").trim()}else if(Array.isArray(h)&&"string"==typeof i){var n=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i.split(" "))));f=Array.from(n).join(" ").trim()}else if(Array.isArray(h)&&Array.isArray(i)){var o=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i)));f=Array.from(o).join(" ").trim()}else if("string"==typeof h&&"object"===_typeof(i))f=_objectSpread(_defineProperty({},h,!0),i);else if("object"===_typeof(h)&&"string"==typeof i)f=_objectSpread(_objectSpread({},h),{},_defineProperty({},i,!0));else if("object"===_typeof(h)&&"object"===_typeof(i))f=_objectSpread(_objectSpread({},h),i);else if("object"===_typeof(h)&&Array.isArray(i)){var p,q=_objectSpread({},h),r=_createForOfIteratorHelper(i);try{for(r.s();!(p=r.n()).done;){var s=p.value;q[s]=!0}}catch(a){r.e(a)}finally{r.f()}f=q}else if(Array.isArray(h)&&"object"===_typeof(i)){var t,u={},v=_createForOfIteratorHelper(h);try{for(v.s();!(t=v.n()).done;){var w=t.value;u[w]=!0}}catch(a){v.e(a)}finally{v.f()}for(var x,y=0,z=Object.keys(i);y<z.length;y++)x=z[y],u[x]=i[x];f=u}else throw new Error("cannot merge classes of ".concat(h," (").concat(_typeof(h),") and ").concat(i," (").concat(_typeof(i),")"))}return f}// src/merge-style.ts
5
5
  var tempDivForStyling;function mergeStyle(){tempDivForStyling||(tempDivForStyling=document.createElement("div"));try{for(var a=tempDivForStyling.style,b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];for(var e,f=0,g=c;f<g.length;f++)if(e=g[f],"object"===_typeof(e)&&null!==e)for(var h in e)a[h]=e[h];else"string"==typeof e&&(a.cssText+=";"+e);return a.cssText}finally{tempDivForStyling.style.cssText=""}}// src/merge-props.ts
6
6
  function mergeProps(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];if(0!==b.length){if(1===b.length)return b[0]||void 0;for(var d,e,f=0,g=b;f<(void 0).length;f++)if(e=(void 0)[f],"object"===_typeof(e)&&null!==e)for(var h in d||(d={}),e)"style"===h?d.style=mergeStyle(d.style,e.style):"class"===h?d["class"]=mergeClass(d["class"],e["class"]):d[h]=e[h];return d}}// src/state-context.ts
7
- function context(a){return new ProxyStateContextImpl(a,[])}var ProxyStateContextImpl=/*#__PURE__*/function(){function a(b,c){function d(a,b){if(1<c.length){var d=0,e=b[c[d]];for(("object"!==_typeof(e)||null===e)&&(b[c[d]]=e={}),d=1;d<c.length-1;d++){var f=e;e=e[c[d]],("object"!==_typeof(e)||null===e)&&(f[c[d]]=e={})}e[c[d]]=a}else 1===c.length?"object"===_typeof(b[c[0]])&&"object"===_typeof(a)?Object.assign(b[c[0]],a):b[c[0]]=a:Object.assign(b,a)}function e(a){var b={};return d(a,b),b}function f(){if(0===c.length)return b;for(var a=b?b[c[0]]:void 0,d=1;d<c.length&&!!a;d++)a=a[c[d]];return a}function g(a){d(a,b)}function h(a,c){c?b.patch([e(a)]):b.patch(e(a))}return _classCallCheck(this,a),_defineProperty(this,"state",void 0),_defineProperty(this,"keys",void 0),this.state=b,this.keys=c,new Proxy(this,{get:function i(c,d,e){if("state"===d)return b;if("get"===d)return f;if("put"===d)return g;if("patch"===d)return h;var j=[].concat(_toConsumableArray(c.keys),[d+""]);return new a(c.state,j)}})}return _createClass(a,[{key:"get",value:function a(){}},{key:"put",value:function b(a){}},{key:"patch",value:function b(a){}}])}();
7
+ function context(a){return new ProxyStateContextImpl(a,[])}var ProxyStateContextImpl=/*#__PURE__*/function(){function a(b,c){function d(a,b){if(1<c.length){var d=0,e=b[c[d]];for(("object"!==_typeof(e)||null===e)&&(b[c[d]]=e={}),d=1;d<c.length-1;d++){var f=e;e=e[c[d]],("object"!==_typeof(e)||null===e)&&(f[c[d]]=e={})}e[c[d]]=a}else 1===c.length?"object"===_typeof(b[c[0]])&&"object"===_typeof(a)&&null!==a?Object.assign(b[c[0]],a):b[c[0]]=a:Object.assign(b,a)}function e(a){var b={};return d(a,b),b}function f(){if(0===c.length)return b;for(var a=b?b[c[0]]:void 0,d=1;d<c.length&&!!a;d++)a=a[c[d]];return a}function g(a){d(a,b)}function h(a,c){c?b.patch([e(a)]):b.patch(e(a))}return _classCallCheck(this,a),_defineProperty(this,"state",void 0),_defineProperty(this,"keys",void 0),this.state=b,this.keys=c,new Proxy(this,{get:function i(c,d,e){if("state"===d)return b;if("get"===d)return f;if("put"===d)return g;if("patch"===d)return h;var j=[].concat(_toConsumableArray(c.keys),[d+""]);return new a(c.state,j)}})}return _createClass(a,[{key:"get",value:function a(){}},{key:"put",value:function b(a){}},{key:"patch",value:function b(a){}}])}();
package/dist/vode.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  export type Vode<S = PatchableState> = FullVode<S> | JustTagVode | NoPropsVode<S>;
4
4
  export type FullVode<S = PatchableState> = [
5
5
  tag: Tag,
6
- props: Props<S>,
6
+ props: Props<S> | ChildVode<S>,
7
7
  ...children: ChildVode<S>[]
8
8
  ];
9
9
  export type NoPropsVode<S = PatchableState> = [
@@ -22,7 +22,7 @@ export type AttachedVode<S> = Vode<S> & {
22
22
  node?: never;
23
23
  };
24
24
  export type Tag = keyof (HTMLElementTagNameMap & SVGElementTagNameMap & MathMLElementTagNameMap) | (string & {});
25
- export type Component<S> = (s: S) => ChildVode<S>;
25
+ export type Component<S = PatchableState> = (s: S) => ChildVode<S>;
26
26
  export type Patch<S> = IgnoredPatch | RenderPatch<S> | Promise<Patch<S>> | Effect<S>;
27
27
  export type IgnoredPatch = undefined | null | number | boolean | bigint | string | symbol | void;
28
28
  export type RenderPatch<S> = {} | DeepPartial<S>;
@@ -40,9 +40,9 @@ export interface Props<S = PatchableState> extends Partial<Omit<HTMLElement, key
40
40
  class?: ClassProp;
41
41
  style?: StyleProp;
42
42
  /** called after the element was attached */
43
- onMount?: MountFunction<S>;
43
+ onMount?: MountFunction<S> | null | false;
44
44
  /** called before the element is detached */
45
- onUnmount?: MountFunction<S>;
45
+ onUnmount?: MountFunction<S> | null | false;
46
46
  /** used instead of original vode when an error occurs during rendering */
47
47
  catch?: ((s: S, error: Error) => ChildVode<S>) | ChildVode<S>;
48
48
  }
@@ -82,9 +82,8 @@ export interface ContainerNode<S = PatchableState> extends HTMLElement {
82
82
  renderAsync: () => Promise<unknown>;
83
83
  syncRenderer: (cb: () => void) => void;
84
84
  asyncRenderer: ((cb: () => void) => ViewTransition) | null | undefined;
85
- qSync: {} | undefined | null;
86
85
  qAsync: {} | undefined | null;
87
- isRendering: boolean;
86
+ isRendering: number;
88
87
  isAnimating: boolean;
89
88
  /** stats about the overall patches & last render time */
90
89
  stats: {
@@ -125,8 +124,9 @@ export declare function defuse(container: ContainerNode<any>): void;
125
124
  /** return vode representation of given DOM node */
126
125
  export declare function hydrate<S = PatchableState>(element: Element | Text, prepareForRender?: boolean): Vode<S> | string | AttachedVode<S> | undefined;
127
126
  /** memoizes the resulting component or props by comparing element by element (===) with the
128
- * `compare` of the previous render. otherwise skips the render step (not calling `componentOrProps`)*/
129
- export declare function memo<S = PatchableState>(compare: any[], componentOrProps: Component<S> | ((s: S) => Props<S>)): typeof componentOrProps extends ((s: S) => Props<S>) ? ((s: S) => Props<S>) : Component<S>;
127
+ * `compare` of the previous render. otherwise skips the render step (not calling `componentOrProps`)
128
+ */
129
+ export declare function memo<S = PatchableState>(compare: any[], component: Component<S>): Component<S>;
130
130
  /**
131
131
  * create a patchable state object for a vode-app.
132
132
  * calls to `patch()` prior to `app()` initialization will queue the patches and apply them before the initial patches.
@@ -393,10 +393,10 @@ export interface SubContext<SubState> {
393
393
  patch(value: SubState | Partial<SubState> | DeepPartial<SubState> | Array<DeepPartial<SubState>>, isAsync?: boolean): void;
394
394
  }
395
395
  export type ProxyStateContext<S extends PatchableState, SubState> = StateContext<S, SubState> & {
396
- [K in keyof SubState]-?: SubState[K] extends object ? ProxyStateContext<S, SubState[K]> : StateContext<S, SubState[K]>;
396
+ [K in keyof SubState]-?: SubState[K] extends object | null ? ProxyStateContext<S, SubState[K]> : StateContext<S, SubState[K]>;
397
397
  };
398
398
  export type ProxySubContext<SubState> = SubContext<SubState> & {
399
- [K in keyof SubState]-?: SubState[K] extends object ? ProxySubContext<SubState[K]> : SubContext<SubState[K]>;
399
+ [K in keyof SubState]-?: SubState[K] extends object | null ? ProxySubContext<SubState[K]> : SubContext<SubState[K]>;
400
400
  };
401
401
  /**
402
402
  * create a ProxyStateContext for type-safe dynamic access to nested state
@@ -1,8 +1,8 @@
1
- "use strict";function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k["return"])&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function a(){};return{s:f,n:function a(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function b(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function a(){d=d.call(b)},n:function a(){var b=d.next();return h=b.done,b},e:function b(a){i=!0,g=a},f:function a(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var V=function(){function a(a,b){if(!a)throw new Error("first argument to vode() must be a tag name or a vode");for(var c=arguments.length,d=Array(2<c?c-2:0),e=2;e<c;e++)d[e-2]=arguments[e];return Array.isArray(a)?a:"object"===_typeof(b)?[a,b].concat(d):[a].concat(d)}function b(a,b,c){function e(b){var d=Date.now(),e=c(j.state);j.vode=r(j.state,a.parentElement,0,0,j.vode,e),a.tagName.toUpperCase()!==e[0].toUpperCase()&&(a=j.vode.node,a._vode=j),b||(j.stats.lastSyncRenderTime=Date.now()-d,j.stats.syncRenderCount++,j.isRendering=!1,j.qSync&&j.renderSync())}for(var f,g=arguments.length,h=Array(3<g?g-3:0),i=3;i<g;i++)h[i-3]=arguments[i];if(!(null!==(f=a)&&void 0!==f&&f.parentElement))throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!b||"object"!==_typeof(b))throw new Error("second argument to app() must be a state object");if("function"!=typeof c)throw new Error("third argument to app() must be a function that returns a vode");var j={syncRenderer:O.requestAnimationFrame,asyncRenderer:O.startViewTransition,qSync:null,qAsync:null,stats:{lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0}},k=b;"patch"in b&&"function"==typeof b.patch&&Array.isArray(b.patch.initialPatches)&&(h=[].concat(_toConsumableArray(b.patch.initialPatches),_toConsumableArray(h))),Object.defineProperty(b,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(a,c){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d,e,f,g,h,i,l;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:if(a&&("function"==typeof a||"object"===_typeof(a))){c.n=1;break}return c.a(2);case 1:if(j.stats.patchCount++,!(null!==a&&void 0!==a&&a.next)){c.n=12;break}return d=a,j.stats.liveEffectCount++,c.p=2,c.n=3,d.next();case 3:e=c.v;case 4:if(!1!==e.done){c.n=9;break}return j.stats.liveEffectCount++,c.p=5,k.patch(e.value,b),c.n=6,d.next();case 6:e=c.v;case 7:return c.p=7,j.stats.liveEffectCount--,c.f(7);case 8:c.n=4;break;case 9:k.patch(e.value,b);case 10:return c.p=10,j.stats.liveEffectCount--,c.f(10);case 11:c.n=22;break;case 12:if(!a.then){c.n=17;break}return j.stats.liveEffectCount++,c.p=13,c.n=14,a;case 14:f=c.v,k.patch(f,b);case 15:return c.p=15,j.stats.liveEffectCount--,c.f(15);case 16:c.n=22;break;case 17:if(!Array.isArray(a)){c.n=18;break}if(0<a.length){g=_createForOfIteratorHelper(a);try{for(g.s();!(h=g.n()).done;)i=h.value,k.patch(i,!document.hidden&&!!j.asyncRenderer)}catch(a){g.e(a)}finally{g.f()}}else{j.qSync=q(j.qSync||{},j.qAsync,!1),j.qAsync=null;try{null===(l=O.currentViewTransition)||void 0===l||l.skipTransition()}catch(a){}j.stats.syncRenderPatchCount++,j.renderSync()}c.n=22;break;case 18:if("function"!=typeof a){c.n=19;break}k.patch(a(j.state),b),c.n=22;break;case 19:if(!b){c.n=21;break}return j.stats.asyncRenderPatchCount++,j.qAsync=q(j.qAsync||{},a,!1),c.n=20,j.renderAsync();case 20:c.n=22;break;case 21:j.stats.syncRenderPatchCount++,j.qSync=q(j.qSync||{},a,!1),j.renderSync();case 22:return c.a(2)}},c,null,[[13,,15,16],[5,,7,8],[2,,10,11]])}));return a}()});var l=e.bind(null,!1),m=e.bind(null,!0);Object.defineProperty(j,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:function a(){j.isRendering||!j.qSync||(j.isRendering=!0,j.state=q(j.state,j.qSync,!0),j.qSync=null,j.syncRenderer(l))}}),Object.defineProperty(j,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(!j.isAnimating&&j.qAsync){a.n=1;break}return a.a(2);case 1:return a.n=2,null===(b=O.currentViewTransition)||void 0===b?void 0:b.updateCallbackDone;case 2:if(!(j.isAnimating||!j.qAsync||document.hidden)){a.n=3;break}return a.a(2);case 3:return j.isAnimating=!0,c=Date.now(),a.p=4,j.state=q(j.state,j.qAsync,!0),j.qAsync=null,O.currentViewTransition=j.asyncRenderer(m),a.n=5,null===(d=O.currentViewTransition)||void 0===d?void 0:d.updateCallbackDone;case 5:return a.p=5,j.stats.lastAsyncRenderTime=Date.now()-c,j.stats.asyncRenderCount++,j.isAnimating=!1,a.f(5);case 6:j.qAsync&&j.renderAsync();case 7:return a.a(2)}},a,null,[[4,,5,6]])}));return a}()}),j.state=k;var n=a;n._vode=j;var o=Array.from(a.parentElement.children).indexOf(a);j.isRendering=!0,j.vode=r(b,a.parentElement,o,o,d(a,!0),c(b)),j.isRendering=!1,j.qSync&&j.renderSync();var p,s=_createForOfIteratorHelper(h);try{for(s.s();!(p=s.n()).done;){var t=p.value;k.patch(t)}}catch(a){s.e(a)}finally{s.f()}return function(a){return k.patch(a)}}function c(a){if(null!==a&&void 0!==a&&a._vode){var b=function d(a){if(null!==a&&void 0!==a&&a.node){var e=j(a);if(e){for(var f in e)"o"===f[0]&&"n"===f[1]&&(a.node[f]=null);a.node["catch"]=null}if(a.node._vode)c(a.node);else{var g=l(a);if(g){var h,i=_createForOfIteratorHelper(g);try{for(i.s();!(h=i.n()).done;){var k=h.value;b(k)}}catch(a){i.e(a)}finally{i.f()}}}}},d=b,e=a._vode;delete a._vode,Object.defineProperty(e.state,"patch",{value:void 0}),Object.defineProperty(e,"renderSync",{value:function a(){}}),Object.defineProperty(e,"renderAsync",{value:function a(){}}),b(e.vode)}else{var f,g=_createForOfIteratorHelper(a.children);try{for(g.s();!(f=g.n()).done;){var h=f.value;c(h)}}catch(a){g.e(a)}finally{g.f()}}}function d(b,c){if((null===b||void 0===b?void 0:b.nodeType)===Node.TEXT_NODE){var e;return""===(null===(e=b.nodeValue)||void 0===e?void 0:e.trim())?void 0:c?b:b.nodeValue}if(b.nodeType===Node.ELEMENT_NODE){var f=b.tagName.toLowerCase(),g=[f];if(c&&(g.node=b),null!==b&&void 0!==b&&b.hasAttributes()){var h,i={},j=b.attributes,k=_createForOfIteratorHelper(j);try{for(k.s();!(h=k.n()).done;){var l=h.value;i[l.name]=l.value}}catch(a){k.e(a)}finally{k.f()}g.push(i)}if(b.hasChildNodes()){var m,n=[],o=_createForOfIteratorHelper(b.childNodes);try{for(o.s();!(m=o.n()).done;){var p=m.value,q=p&&d(p,c);q?g.push(q):p&&c&&n.push(p)}}catch(a){o.e(a)}finally{o.f()}for(var r,s=0,t=n;s<t.length;s++)r=t[s],r.remove()}return g}}function e(a,b){if(!a||!Array.isArray(a))throw new Error("first argument to memo() must be an array of values to compare");if("function"!=typeof b)throw new Error("second argument to memo() must be a function that returns a vode or props object");return b.__memo=a,b}function f(a){if(!a||"object"!==_typeof(a))throw new Error("createState() must be called with a state object");return"patch"in a||Object.defineProperty(a,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(b){var d=a;Array.isArray(d.patch.initialPatches)||(d.patch.initialPatches=[]),d.patch.initialPatches.push(b)}}),a}function g(a){return a}function h(a){return!a?void 0:Array.isArray(a)?a[0]:"string"==typeof a||a.nodeType===Node.TEXT_NODE?"#text":void 0}function j(a){return Array.isArray(a)&&1<a.length&&a[1]&&!Array.isArray(a[1])&&"object"===_typeof(a[1])&&a[1].nodeType!==Node.TEXT_NODE?a[1]:void 0}function l(a){var b=o(a);return 0<b?a.slice(b):null}function m(a){var b=o(a);return 0>b?0:a.length-b}function n(a,b){var c=o(a);return 0<c?a[b+c]:void 0}function o(a){return j(a)?2<a.length?2:-1:Array.isArray(a)&&1<a.length?1:-1}function q(a,b,c){if(!b)return a;for(var d in b){var e=b[d];if(e&&"object"===_typeof(e)){var f=a[d];f?Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date&&f!==e?a[d]=new Date(e):Array.isArray(f)?a[d]=q({},e,c):"object"===_typeof(f)?q(a[d],e,c):a[d]=q({},e,c):Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date?a[d]=new Date(e):a[d]=q({},e,c)}else void 0===e&&c?delete a[d]:a[d]=e}return a}function r(a,b,c,e,f,g,h){try{var k,m;g=w(a,g,f);var n=!g||"number"==typeof g||"boolean"==typeof g;if(g===f||!f&&n)return f;var o=(null===f||void 0===f?void 0:f.nodeType)===Node.TEXT_NODE,p=o?f:null===f||void 0===f?void 0:f.node;if(n)return s(a,f),void(null===p||void 0===p||p.remove());var q=!n&&v(g),x=!n&&u(g),z=!!g&&"string"!=typeof g&&!!(null!==(k=g)&&void 0!==k&&k.node||(null===(m=g)||void 0===m?void 0:m.nodeType)===Node.TEXT_NODE);if(!q&&!x&&!z&&!f)throw new Error("Invalid vode: "+_typeof(g)+" "+JSON.stringify(g));else z&&q?g=g.wholeText:z&&x&&(g=_toConsumableArray(g));if(o&&q)return p.nodeValue!==g&&(p.nodeValue=g),f;if(q&&(!p||!o)){var A=document.createTextNode(g);if(p)s(a,f),p.replaceWith(A);else{for(var B,C=!1,D=e;D<b.childNodes.length;D++)if(B=b.childNodes[D],B){B.before(A,B),C=!0;break}C||b.appendChild(A)}return A}if(x&&(!p||o||f[0]!==g[0])){var E=g;1 in E&&(E[1]=w(a,E[1],void 0));var F=j(g);void 0!==(null===F||void 0===F?void 0:F.xmlns)&&(h=F.xmlns);var G=h?document.createElementNS(h,g[0]):document.createElement(g[0]);if(g.node=G,y(a,G,void 0,F,null!==h&&void 0!==h?h:null),!!F&&"catch"in F&&(g.node["catch"]=null,g.node.removeAttribute("catch")),p)s(a,f),p.replaceWith(G);else{for(var H,I=!1,J=e;J<b.childNodes.length;J++)if(H=b.childNodes[J],H){H.before(G,H),I=!0;break}I||b.appendChild(G)}var K=l(g);if(K)for(var L=F?2:1,M=0,N=0;N<K.length;N++){var O=K[N],P=r(a,G,N,M,void 0,O,null!==h&&void 0!==h?h:null);g[N+L]=P,P&&M++}return g._unmountCount=(null!==F&&void 0!==F&&F.onUnmount?1:0)+t(g),"function"==typeof(null===F||void 0===F?void 0:F.onMount)&&a.patch(F.onMount(a,G)),g}if(!o&&x&&f[0]===g[0]){var Q;g.node=p;var R=g,S=f,T=j(g),U=j(f);if(void 0!==(null===T||void 0===T?void 0:T.xmlns)&&(h=T.xmlns),null!==(Q=R[1])&&void 0!==Q&&Q.__memo){var V=R[1];R[1]=w(a,R[1],S[1]),V!==R[1]&&y(a,p,U,T,h)}else y(a,p,U,T,h);!(null!==T&&void 0!==T&&T["catch"])||(null===U||void 0===U?void 0:U["catch"])===T["catch"]||(g.node["catch"]=null,g.node.removeAttribute("catch"));var W=l(g),X=l(f);if(W)for(var Y=T?2:1,Z=0,$=0;$<W.length;$++){var _=W[$],aa=X&&X[$],ba=r(a,p,$,Z,aa,_,h);g[$+Y]=ba,ba&&Z++}if(X)for(var ca=W?W.length:0,da=X.length-1;da>=ca;da--)r(a,p,da,da,X[da],void 0,h);return g._unmountCount=(null!==T&&void 0!==T&&T.onUnmount?1:0)+t(g),g}}catch(i){var ea,fa=null===(ea=j(g))||void 0===ea?void 0:ea["catch"];if(fa){var ga,ha="function"==typeof fa?fa(a,i):fa;return r(a,b,c,e,d((null===(ga=g)||void 0===ga?void 0:ga.node)||(null===f||void 0===f?void 0:f.node),!0),ha,h)}throw i}}function s(a,b){if(b&&Array.isArray(b)&&0!=(0|b._unmountCount)){var c=l(b);if(c)for(var d=c.length-1;0<=d;d--)s(a,c[d]);var e=j(b);"function"==typeof(null===e||void 0===e?void 0:e.onUnmount)&&a.patch(e.onUnmount(a,b.node))}}function t(a){var b=l(a);if(!b)return 0;var c,d=0,e=_createForOfIteratorHelper(b);try{for(e.s();!(c=e.n()).done;){var f=c.value;f&&Array.isArray(f)&&(d+=0|f._unmountCount)}}catch(a){e.e(a)}finally{e.f()}return d}function u(a){return Array.isArray(a)&&0<a.length&&"string"==typeof a[0]}function v(a){return"string"==typeof a||(null===a||void 0===a?void 0:a.nodeType)===Node.TEXT_NODE}function w(a,b,c){if("function"!=typeof b)return b;var d=null===b||void 0===b?void 0:b.__memo,e=null===c||void 0===c?void 0:c.__memo;if(Array.isArray(d)&&Array.isArray(e)&&d.length===e.length){for(var f=!0,g=0;g<d.length;g++)if(d[g]!==e[g]){f=!1;break}if(f)return c}var h=b(a);if("function"==typeof h&&null!==h&&void 0!==h&&h.__memo){var j=h.__memo;if(Array.isArray(j)&&Array.isArray(e)&&j.length===e.length){for(var k=!0,l=0;l<j.length;l++)if(j[l]!==e[l]){k=!1;break}if(k)return c}var m=h(a);return"object"===_typeof(m)&&(m.__memo=j),m}var n="function"==typeof h?x(h,a):h;return"object"===_typeof(n)&&(n.__memo=(null===h||void 0===h?void 0:h.__memo)||(null===b||void 0===b?void 0:b.__memo)),n}function x(a,b){return"function"==typeof a?x(a(b),b):a}function y(a,b,c,d,e){if(d||c){var f=void 0!==e;if(c)for(var g in c){var h=c[g],i=null===d||void 0===d?void 0:d[g];h!==i&&(d?d[g]=z(a,b,g,h,i,f):z(a,b,g,h,void 0,f))}if(d&&c){for(var j in d)if(!(j in c)){var k=d[j];d[j]=z(a,b,j,void 0,k,f)}}else if(d)for(var l in d){var m=d[l];d[l]=z(a,b,l,void 0,m,f)}}}function z(a,b,c,d,e,f){if("style"===c){if(!e)b.style.cssText="";else if("string"==typeof e)d!==e&&(b.style.cssText=e);else if(d&&"object"===_typeof(d)){for(var g in d){var h=e[g];h||(b.style[g]=null)}for(var i in e){var j=d[i],l=e[i];j!==l&&(b.style[i]=l)}}else for(var m in e)b.style[m]=e[m];}else if("class"===c)e?b.setAttribute("class",A(e)):b.removeAttribute("class");else if(!("o"===c[0]&&"n"===c[1]))f||(b[c]=e),void 0===e||null===e||!1===e?b.removeAttribute(c):b.setAttribute(c,e);else if(e){var n=null;if("function"==typeof e){var o=e;n=function c(b){return a.patch(o(a,b))}}else"object"===_typeof(e)&&(n=function b(){return a.patch(e)});b[c]=n}else b[c]=null;return e}function A(a){return"string"==typeof a?a:Array.isArray(a)?a.map(A).join(" "):"object"===_typeof(a)?Object.keys(a).filter(function(b){return a[b]}).join(" "):""}// src/vode-tags.ts
1
+ "use strict";function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _regenerator(){function b(a,b,f,g){var h=b&&b.prototype instanceof d?b:d,c=Object.create(h.prototype);return _regeneratorDefine2(c,"_invoke",function(a,b,g){function h(a,b){for(q=a,s=b,e=0;!w&&t&&!c&&e<v.length;e++){var c,f=v[e],g=p.p,h=f[2];3<a?(c=h===b)&&(s=f[(q=f[4])?5:(q=3,3)],f[4]=f[5]=j):f[0]<=g&&((c=2>a&&g<f[1])?(q=0,p.v=b,p.n=f[1]):g<h&&(c=3>a||f[0]>b||b>h)&&(f[4]=a,f[5]=b,p.n=h,q=0))}if(c||1<a)return m;throw w=!0,b}var k,q,s,t=0,v=g||[],w=!1,p={p:0,n:0,v:j,a:h,f:h.bind(j,4),d:function c(a,b){return k=a,q=0,s=j,p.n=b,m}};return function(c,d,f){if(1<t)throw TypeError("Generator is already running");for(w&&1===d&&h(d,f),q=d,s=f;(e=2>q?j:s)||!w;){k||(q?3>q?(1<q&&(p.n=-1),h(q,s)):p.n=s:p.v=s);try{if(t=2,k){if(q||(c="next"),e=k[c]){if(!(e=e.call(k,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,2>q&&(q=0)}else 1===q&&(e=k["return"])&&e.call(k),2>q&&(s=TypeError("The iterator does not provide a '"+c+"' method"),q=1);k=j}else if((e=(w=0>p.n)?s:a.call(b,p))!==m)break}catch(a){k=j,q=1,s=a}finally{t=1}}return{value:e,done:w}}}(a,f,g),!0),c}function d(){}function g(){}function h(){}function i(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,h):(a.__proto__=h,_regeneratorDefine2(a,l,"GeneratorFunction")),a.prototype=Object.create(c),a}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var j,e,f="function"==typeof Symbol?Symbol:{},k=f.iterator||"@@iterator",l=f.toStringTag||"@@toStringTag",m={};e=Object.getPrototypeOf;var a=[][k]?e(e([][k]())):(_regeneratorDefine2(e={},k,function(){return this}),e),c=h.prototype=d.prototype=Object.create(a);return g.prototype=h,_regeneratorDefine2(c,"constructor",h),_regeneratorDefine2(h,"constructor",g),g.displayName="GeneratorFunction",_regeneratorDefine2(h,l,"GeneratorFunction"),_regeneratorDefine2(c),_regeneratorDefine2(c,l,"Generator"),_regeneratorDefine2(c,k,function(){return this}),_regeneratorDefine2(c,"toString",function(){return"[object Generator]"}),(_regenerator=function a(){return{w:b,m:i}})()}function _regeneratorDefine2(a,b,c,d){var f=Object.defineProperty;try{f({},"",{})}catch(a){f=0}_regeneratorDefine2=function e(a,b,c,d){function g(b,c){_regeneratorDefine2(a,b,function(a){return this._invoke(b,c,a)})}b?f?f(a,b,{value:c,enumerable:!d,configurable:!d,writable:!d}):a[b]=c:(g("next",0),g("throw",1),g("return",2))},_regeneratorDefine2(a,b,c,d)}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function a(){};return{s:f,n:function a(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function b(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function a(){d=d.call(b)},n:function a(){var b=d.next();return h=b.done,b},e:function b(a){i=!0,g=a},f:function a(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var V=function(){function a(a,b){if(!a)throw new Error("first argument to vode() must be a tag name or a vode");for(var c=arguments.length,d=Array(2<c?c-2:0),e=2;e<c;e++)d[e-2]=arguments[e];return Array.isArray(a)?a:"object"===_typeof(b)?[a,b].concat(d):[a].concat(d)}function b(a,b,c){function e(a,b){return f.apply(this,arguments)}function f(){return f=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return n.stats.liveEffectCount++,c.p=1,c.n=2,a;case 2:d=c.v,o.patch(d,b);case 3:return c.p=3,n.stats.liveEffectCount--,c.f(3);case 4:return c.a(2)}},c,null,[[1,,3,4]])})),f.apply(this,arguments)}function g(a,b){return h.apply(this,arguments)}function h(){return h=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function c(a,b){var d,e;return _regenerator().w(function(c){for(;1;)switch(c.p=c.n){case 0:return d=a,n.stats.liveEffectCount++,c.p=1,c.n=2,d.next();case 2:e=c.v;case 3:if(!1!==e.done){c.n=8;break}return n.stats.liveEffectCount++,c.p=4,o.patch(e.value,b),c.n=5,d.next();case 5:e=c.v;case 6:return c.p=6,n.stats.liveEffectCount--,c.f(6);case 7:c.n=3;break;case 8:o.patch(e.value,b);case 9:return c.p=9,n.stats.liveEffectCount--,c.f(9);case 10:return c.a(2)}},c,null,[[4,,6,7],[1,,9,10]])})),h.apply(this,arguments)}function i(b){var d=performance.now(),e=c(n.state);if(n.vode=r(n.state,a.parentElement,0,0,n.vode,e),a.tagName.toUpperCase()!==e[0].toUpperCase()&&(a=n.vode.node,a._vode=n),!b){n.stats.lastSyncRenderTime=performance.now()-d;var f=n.isRendering!==n.stats.syncRenderPatchCount;n.stats.syncRenderCount++,n.isRendering=0,f&&n.renderSync()}}for(var j,k=arguments.length,l=Array(3<k?k-3:0),m=3;m<k;m++)l[m-3]=arguments[m];if(!(null!==(j=a)&&void 0!==j&&j.parentElement))throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!b||"object"!==_typeof(b))throw new Error("second argument to app() must be a state object");if("function"!=typeof c)throw new Error("third argument to app() must be a function that returns a vode");var n={syncRenderer:N.requestAnimationFrame,asyncRenderer:N.startViewTransition,isRendering:0,qAsync:null,stats:{lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0}},o=b;"patch"in b&&"function"==typeof b.patch&&Array.isArray(b.patch.initialPatches)&&(l=[].concat(_toConsumableArray(b.patch.initialPatches),_toConsumableArray(l))),Object.defineProperty(b,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(a,b){for(var d;"function"==typeof a;)a=a(n.state);if(a&&"object"===_typeof(a))if(n.stats.patchCount++,null!==(d=a)&&void 0!==d&&d.next)g(a,b);else if(a.then)e(a,b);else if(!Array.isArray(a))b?(n.stats.asyncRenderPatchCount++,n.qAsync=q(n.qAsync||{},a,!1),n.renderAsync()):(n.stats.syncRenderPatchCount++,q(n.state,a,!0),n.renderSync());else if(0<a.length){var f,h=_createForOfIteratorHelper(a);try{for(h.s();!(f=h.n()).done;){var i=f.value;o.patch(i,!document.hidden&&!!n.asyncRenderer)}}catch(a){h.e(a)}finally{h.f()}}else{q(n.state,n.qAsync,!0),n.qAsync=null;try{var j;null===(j=N.currentViewTransition)||void 0===j||j.skipTransition()}catch(a){}n.stats.syncRenderPatchCount++,n.renderSync()}}});var p=i.bind(null,!1),s=i.bind(null,!0);Object.defineProperty(n,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:function a(){n.isRendering||(n.isRendering=n.stats.syncRenderPatchCount,n.syncRenderer(p))}}),Object.defineProperty(n,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function a(){var b,c,d;return _regenerator().w(function(a){for(;1;)switch(a.p=a.n){case 0:if(!n.isAnimating&&n.qAsync){a.n=1;break}return a.a(2);case 1:return a.n=2,null===(b=N.currentViewTransition)||void 0===b?void 0:b.updateCallbackDone;case 2:if(!(n.isAnimating||!n.qAsync||document.hidden)){a.n=3;break}return a.a(2);case 3:return n.isAnimating=!0,c=performance.now(),a.p=4,n.state=q(n.state,n.qAsync,!0),n.qAsync=null,N.currentViewTransition=n.asyncRenderer(s),a.n=5,null===(d=N.currentViewTransition)||void 0===d?void 0:d.updateCallbackDone;case 5:return a.p=5,n.stats.lastAsyncRenderTime=performance.now()-c,n.stats.asyncRenderCount++,n.isAnimating=!1,a.f(5);case 6:n.qAsync&&n.renderAsync();case 7:return a.a(2)}},a,null,[[4,,5,6]])}));return a}()}),n.state=o;var t=a;t._vode=n;var u=Array.from(a.parentElement.children).indexOf(a),v=n.stats.syncRenderPatchCount;n.isRendering=n.stats.syncRenderPatchCount,n.vode=r(b,a.parentElement,u,u,d(a,!0),c(b));var w=n.stats.syncRenderPatchCount!==v;n.isRendering=0,n.stats.syncRenderCount++,w&&n.renderSync();var x,y=_createForOfIteratorHelper(l);try{for(y.s();!(x=y.n()).done;){var z=x.value;o.patch(z)}}catch(a){y.e(a)}finally{y.f()}return function(a){return o.patch(a)}}function c(a){if(null!==a&&void 0!==a&&a._vode){var b=function d(a){if(null!==a&&void 0!==a&&a.node){var e=j(a);if(e){for(var f in e)"o"===f[0]&&"n"===f[1]&&(a.node[f]=null);a.node["catch"]=null}if(a.node._vode)c(a.node);else{var g=l(a);if(g){var h,i=_createForOfIteratorHelper(g);try{for(i.s();!(h=i.n()).done;){var k=h.value;b(k)}}catch(a){i.e(a)}finally{i.f()}}}}},d=b,e=a._vode;delete a._vode,Object.defineProperty(e.state,"patch",{value:void 0}),Object.defineProperty(e,"renderSync",{value:function a(){}}),Object.defineProperty(e,"renderAsync",{value:function a(){}}),b(e.vode)}else{var f,g=_createForOfIteratorHelper(a.children);try{for(g.s();!(f=g.n()).done;){var h=f.value;c(h)}}catch(a){g.e(a)}finally{g.f()}}}function d(b,c){if((null===b||void 0===b?void 0:b.nodeType)===Node.TEXT_NODE){var e;return""===(null===(e=b.nodeValue)||void 0===e?void 0:e.trim())?void 0:c?b:b.nodeValue}if(b.nodeType===Node.ELEMENT_NODE){var f=b.tagName.toLowerCase(),g=[f];if(c&&(g.node=b),null!==b&&void 0!==b&&b.hasAttributes()){var h,i={},j=b.attributes,k=_createForOfIteratorHelper(j);try{for(k.s();!(h=k.n()).done;){var l=h.value;i[l.name]=l.value}}catch(a){k.e(a)}finally{k.f()}g.push(i)}if(b.hasChildNodes()){var m,n=[],o=_createForOfIteratorHelper(b.childNodes);try{for(o.s();!(m=o.n()).done;){var p=m.value,q=p&&d(p,c);q?g.push(q):p&&c&&n.push(p)}}catch(a){o.e(a)}finally{o.f()}for(var r,s=0,t=n;s<t.length;s++)r=t[s],r.remove()}return g}}function e(a,b){if(!a||!Array.isArray(a))throw new Error("first argument to memo() must be an array of values to compare");if("function"!=typeof b)throw new Error("second argument to memo() must be a function that returns a child vode");if(b.__memo){var c=b;b=function b(a){return c(a)}}return b.__memo=a,b}function f(a){if(!a||"object"!==_typeof(a))throw new Error("createState() must be called with a state object");return"patch"in a||Object.defineProperty(a,"patch",{enumerable:!1,configurable:!0,writable:!1,value:function c(b){var d=a;Array.isArray(d.patch.initialPatches)||(d.patch.initialPatches=[]),d.patch.initialPatches.push(b)}}),a}function g(a){return a}function h(a){return!a?void 0:Array.isArray(a)?a[0]:"string"==typeof a||a.nodeType===Node.TEXT_NODE?"#text":void 0}function j(a){return Array.isArray(a)&&1<a.length&&a[1]&&!Array.isArray(a[1])&&"object"===_typeof(a[1])&&a[1].nodeType!==Node.TEXT_NODE?a[1]:void 0}function l(a){var b=o(a);return 0<b?a.slice(b):null}function m(a){var b=o(a);return 0>b?0:a.length-b}function n(a,b){var c=o(a);return 0<c?a[b+c]:void 0}function o(a){return j(a)?2<a.length?2:-1:Array.isArray(a)&&1<a.length?1:-1}function q(a,b,c){if(!b)return a;for(var d in b){var e=b[d];if(e&&"object"===_typeof(e)){var f=a[d];f?Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date&&f!==e?a[d]=new Date(e):Array.isArray(f)?a[d]=q({},e,c):"object"===_typeof(f)?q(a[d],e,c):a[d]=q({},e,c):Array.isArray(e)?a[d]=_toConsumableArray(e):e instanceof Date?a[d]=new Date(e):a[d]=q({},e,c)}else void 0===e&&c?delete a[d]:a[d]=e}return a}function r(a,b,c,e,f,g,h){try{var k,l;g=w(a,g,f);var m=!g||"number"==typeof g||"boolean"==typeof g;if(g===f||!f&&m)return f;var n=(null===f||void 0===f?void 0:f.nodeType)===Node.TEXT_NODE,p=n?f:null===f||void 0===f?void 0:f.node;if(m)return s(a,f),void(null===p||void 0===p||p.remove());var q=!m&&v(g),y=!m&&u(g),z=!!g&&"string"!=typeof g&&!!(null!==(k=g)&&void 0!==k&&k.node||(null===(l=g)||void 0===l?void 0:l.nodeType)===Node.TEXT_NODE);if(!q&&!y&&!z&&!f)throw new Error("Invalid vode: "+_typeof(g)+" "+JSON.stringify(g));else z&&q?g=g.wholeText:z&&y&&(g=_toConsumableArray(g));if(n&&q)return p.nodeValue!==g&&(p.nodeValue=g),f;if(q&&(!p||!n)){var A=document.createTextNode(g);if(p)s(a,f),p.replaceWith(A);else{for(var B,C=!1,D=e;D<b.childNodes.length;D++)if(B=b.childNodes[D],B){B.before(A),C=!0;break}C||b.appendChild(A)}return A}if(y&&(!p||n||f[0]!==g[0])){var E=g;1 in E&&(E[1]=w(a,E[1],void 0));var F=j(g);void 0!==(null===F||void 0===F?void 0:F.xmlns)&&(h=F.xmlns);var G=h?document.createElementNS(h,g[0]):document.createElement(g[0]);if(g.node=G,x(a,G,void 0,F,null!==h&&void 0!==h?h:null),!!F&&"catch"in F&&(g.node["catch"]=null,g.node.removeAttribute("catch")),p)s(a,f),p.replaceWith(G);else{for(var H,I=!1,J=e;J<b.childNodes.length;J++)if(H=b.childNodes[J],H){H.before(G),I=!0;break}I||b.appendChild(G)}var K=o(g);if(0<K)for(var L=F?2:1,M=0,N=0;N<g.length-K;N++){var O=g[N+K],P=r(a,G,N,M,void 0,O,null!==h&&void 0!==h?h:null);g[N+L]=P,P&&M++}return g._unmountCount=(null!==F&&void 0!==F&&F.onUnmount?1:0)+t(g),"function"==typeof(null===F||void 0===F?void 0:F.onMount)&&a.patch(F.onMount(a,G)),g}if(!n&&y&&f[0]===g[0]){g.node=p;var Q=j(g),R=j(f);void 0!==(null===Q||void 0===Q?void 0:Q.xmlns)&&(h=Q.xmlns),x(a,p,R,Q,h),!(null!==Q&&void 0!==Q&&Q["catch"])||(null===R||void 0===R?void 0:R["catch"])===Q["catch"]||(g.node["catch"]=null,g.node.removeAttribute("catch"));var S=o(g),T=o(f);if(0<S)for(var U=0,V=0;V<g.length-S;V++){var W=g[V+S],X=0<T?f[V+T]:void 0,Y=r(a,p,V,U,X,W,h);g[V+S]=Y,Y&&U++}if(0<T)for(var Z=0<S?g.length-S:0,$=f.length-1-T;$>=Z;$--)r(a,p,$,$,f[$+T],void 0,h);return g._unmountCount=(null!==Q&&void 0!==Q&&Q.onUnmount?1:0)+t(g),g}}catch(i){var _,aa=null===(_=j(g))||void 0===_?void 0:_["catch"];if(aa){var ba,ca="function"==typeof aa?aa(a,i):aa;return r(a,b,c,e,d((null===(ba=g)||void 0===ba?void 0:ba.node)||(null===f||void 0===f?void 0:f.node),!0),ca,h)}throw i}}function s(a,b){if(b&&Array.isArray(b)&&0!=(0|b._unmountCount)){var c=l(b);if(c)for(var d=c.length-1;0<=d;d--)s(a,c[d]);var e=j(b);"function"==typeof(null===e||void 0===e?void 0:e.onUnmount)&&a.patch(e.onUnmount(a,b.node))}}function t(a){var b=l(a);if(!b)return 0;var c,d=0,e=_createForOfIteratorHelper(b);try{for(e.s();!(c=e.n()).done;){var f=c.value;f&&Array.isArray(f)&&(d+=0|f._unmountCount)}}catch(a){e.e(a)}finally{e.f()}return d}function u(a){return Array.isArray(a)&&0<a.length&&"string"==typeof a[0]}function v(a){return"string"==typeof a||(null===a||void 0===a?void 0:a.nodeType)===Node.TEXT_NODE}function w(a,b,c){for(var d;"function"==typeof b&&!b.__memo;)b=b(a);if("function"!=typeof b)return b;var e=null===(d=b)||void 0===d?void 0:d.__memo,f=null===c||void 0===c?void 0:c.__memo;if(Array.isArray(e)&&Array.isArray(f)&&e.length===f.length){for(var g=!0,h=0;h<e.length;h++)if(e[h]!==f[h]){g=!1;break}if(g)return c}for(;"function"==typeof b;)b=b(a);return"object"===_typeof(b)&&(b.__memo=e),b}function x(a,b,c,d,e){if(d||c){var f=void 0!==e;if(c)for(var g in c){var h=c[g],i=null===d||void 0===d?void 0:d[g];h!==i&&(d?d[g]=y(a,b,g,h,i,f):y(a,b,g,h,void 0,f))}if(d&&c){for(var j in d)if(!(j in c)){var k=d[j];d[j]=y(a,b,j,void 0,k,f)}}else if(d)for(var l in d){var m=d[l];d[l]=y(a,b,l,void 0,m,f)}}}function y(a,b,c,d,e,f){if("style"===c){if(!e)b.style.cssText="";else if("string"==typeof e)d!==e&&(b.style.cssText=e);else if(d&&"object"===_typeof(d)){for(var g in d){var h=e[g];h||(b.style[g]=null)}for(var i in e){var j=d[i],l=e[i];j!==l&&(b.style[i]=l)}}else for(var m in e)b.style[m]=e[m];}else if("class"===c)e?b.setAttribute("class",z(e)):b.removeAttribute("class");else if(!("o"===c[0]&&"n"===c[1]))f||(b[c]=e),void 0===e||null===e||!1===e?b.removeAttribute(c):b.setAttribute(c,e);else if(e){var n=null;if("function"==typeof e){var o=e;n=function c(b){return a.patch(o(a,b))}}else"object"===_typeof(e)&&(n=function b(){return a.patch(e)});b[c]=n}else b[c]=null;return e}function z(a){return"string"==typeof a?a:Array.isArray(a)?a.map(z).join(" "):"object"===_typeof(a)?Object.keys(a).filter(function(b){return a[b]}).join(" "):""}// src/vode-tags.ts
2
2
  // src/merge-class.ts
3
- function B(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];if(!d||0===d.length)return null;if(1===d.length)return d[0];for(var f=d[0],g=1;g<d.length;g++){var h=f,i=d[g];if(!h)f=i;else if(!i)continue;else if("string"==typeof h&&"string"==typeof i){var j=h.split(" "),k=i.split(" "),l=/* @__PURE__ */new Set([].concat(_toConsumableArray(j),_toConsumableArray(k)));f=Array.from(l).join(" ").trim()}else if("string"==typeof h&&Array.isArray(i)){var m=/* @__PURE__ */new Set([].concat(_toConsumableArray(i),_toConsumableArray(h.split(" "))));f=Array.from(m).join(" ").trim()}else if(Array.isArray(h)&&"string"==typeof i){var n=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i.split(" "))));f=Array.from(n).join(" ").trim()}else if(Array.isArray(h)&&Array.isArray(i)){var o=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i)));f=Array.from(o).join(" ").trim()}else if("string"==typeof h&&"object"===_typeof(i))f=_objectSpread(_defineProperty({},h,!0),i);else if("object"===_typeof(h)&&"string"==typeof i)f=_objectSpread(_objectSpread({},h),{},_defineProperty({},i,!0));else if("object"===_typeof(h)&&"object"===_typeof(i))f=_objectSpread(_objectSpread({},h),i);else if("object"===_typeof(h)&&Array.isArray(i)){var p,q=_objectSpread({},h),r=_createForOfIteratorHelper(i);try{for(r.s();!(p=r.n()).done;){var s=p.value;q[s]=!0}}catch(a){r.e(a)}finally{r.f()}f=q}else if(Array.isArray(h)&&"object"===_typeof(i)){var t,u={},v=_createForOfIteratorHelper(h);try{for(v.s();!(t=v.n()).done;){var w=t.value;u[w]=!0}}catch(a){v.e(a)}finally{v.f()}for(var x,y=0,z=Object.keys(i);y<z.length;y++)x=z[y],u[x]=i[x];f=u}else throw new Error("cannot merge classes of ".concat(h," (").concat(_typeof(h),") and ").concat(i," (").concat(_typeof(i),")"))}return f}// src/merge-style.ts
4
- function C(){N||(N=document.createElement("div"));try{for(var a=N.style,b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];for(var e,f=0,g=c;f<g.length;f++)if(e=g[f],"object"===_typeof(e)&&null!==e)for(var h in e)a[h]=e[h];else"string"==typeof e&&(a.cssText+=";"+e);return a.cssText}finally{N.style.cssText=""}}// src/merge-props.ts
5
- function D(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];if(0!==b.length){if(1===b.length)return b[0]||void 0;for(var d,e,f=0,g=b;f<(void 0).length;f++)if(e=(void 0)[f],"object"===_typeof(e)&&null!==e)for(var h in d||(d={}),e)"style"===h?d.style=C(d.style,e.style):"class"===h?d["class"]=B(d["class"],e["class"]):d[h]=e[h];return d}}// src/state-context.ts
6
- function E(a){return new xd(a,[])}var F=Object.defineProperty,G=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyNames,I=Object.prototype.hasOwnProperty,J=function c(a,b){for(var d in b)F(a,d,{get:b[d],enumerable:!0})},K=function e(a,b,c,d){if(b&&"object"===_typeof(b)||"function"==typeof b){var f,g=_createForOfIteratorHelper(H(b));try{var h=function e(){var g=f.value;I.call(a,g)||g===c||F(a,g,{get:function a(){return b[g]},enumerable:!(d=G(b,g))||d.enumerable})};for(g.s();!(f=g.n()).done;)h()}catch(a){g.e(a)}finally{g.f()}}return a},L=function b(a){return K(F({},"__esModule",{value:!0}),a)},M={};// index.ts
7
- J(M,{A:function a(){return P},ABBR:function a(){return i},ADDRESS:function a(){return k},ANIMATE:function a(){return Qb},ANIMATEMOTION:function a(){return Rb},ANIMATETRANSFORM:function a(){return Sb},ANNOTATION:function a(){return Vc},ANNOTATION_XML:function a(){return Wc},AREA:function a(){return p},ARTICLE:function a(){return Q},ASIDE:function a(){return R},AUDIO:function a(){return S},B:function a(){return T},BASE:function a(){return U},BDI:function a(){return V},BDO:function a(){return W},BLOCKQUOTE:function a(){return X},BODY:function a(){return Y},BR:function a(){return Z},BUTTON:function a(){return $},CANVAS:function a(){return _},CAPTION:function a(){return aa},CIRCLE:function a(){return Tb},CITE:function a(){return ba},CLIPPATH:function a(){return Ub},CODE:function a(){return ca},COL:function a(){return da},COLGROUP:function a(){return ea},DATA:function a(){return fa},DATALIST:function a(){return ga},DD:function a(){return ha},DEFS:function a(){return Vb},DEL:function a(){return ia},DESC:function a(){return Wb},DETAILS:function a(){return ja},DFN:function a(){return ka},DIALOG:function a(){return la},DIV:function a(){return ma},DL:function a(){return na},DT:function a(){return oa},ELLIPSE:function a(){return Xb},EM:function a(){return pa},EMBED:function a(){return qa},FEBLEND:function a(){return Yb},FECOLORMATRIX:function a(){return Zb},FECOMPONENTTRANSFER:function a(){return $b},FECOMPOSITE:function a(){return _b},FECONVOLVEMATRIX:function a(){return ac},FEDIFFUSELIGHTING:function a(){return bc},FEDISPLACEMENTMAP:function a(){return cc},FEDISTANTLIGHT:function a(){return dc},FEDROPSHADOW:function a(){return ec},FEFLOOD:function a(){return fc},FEFUNCA:function a(){return gc},FEFUNCB:function a(){return hc},FEFUNCG:function a(){return ic},FEFUNCR:function a(){return jc},FEGAUSSIANBLUR:function a(){return kc},FEIMAGE:function a(){return lc},FEMERGE:function a(){return mc},FEMERGENODE:function a(){return nc},FEMORPHOLOGY:function a(){return oc},FEOFFSET:function a(){return pc},FEPOINTLIGHT:function a(){return qc},FESPECULARLIGHTING:function a(){return rc},FESPOTLIGHT:function a(){return sc},FETILE:function a(){return tc},FETURBULENCE:function a(){return uc},FIELDSET:function a(){return ra},FIGCAPTION:function a(){return sa},FIGURE:function a(){return ta},FILTER:function a(){return vc},FOOTER:function a(){return ua},FOREIGNOBJECT:function a(){return wc},FORM:function a(){return va},G:function a(){return xc},H1:function a(){return wa},H2:function a(){return xa},H3:function a(){return ya},H4:function a(){return za},H5:function a(){return Aa},H6:function a(){return Ba},HEAD:function a(){return Ca},HEADER:function a(){return Da},HGROUP:function a(){return Ea},HR:function a(){return Fa},HTML:function a(){return Ga},I:function a(){return Ha},IFRAME:function a(){return Ia},IMAGE:function a(){return yc},IMG:function a(){return Ja},INPUT:function a(){return Ka},INS:function a(){return La},KBD:function a(){return Ma},LABEL:function a(){return Na},LEGEND:function a(){return Oa},LI:function a(){return Pa},LINE:function a(){return zc},LINEARGRADIENT:function a(){return Ac},LINK:function a(){return Qa},MACTION:function a(){return Xc},MAIN:function a(){return Ra},MAP:function a(){return Sa},MARK:function a(){return Ta},MARKER:function a(){return Bc},MASK:function a(){return Cc},MATH:function a(){return Yc},MENU:function a(){return Ua},MERROR:function a(){return Zc},META:function a(){return Va},METADATA:function a(){return Dc},METER:function a(){return Wa},MFRAC:function a(){return $c},MI:function a(){return _c},MMULTISCRIPTS:function a(){return ad},MN:function a(){return bd},MO:function a(){return cd},MOVER:function a(){return dd},MPADDED:function a(){return ed},MPATH:function a(){return Ec},MPHANTOM:function a(){return fd},MPRESCRIPTS:function a(){return gd},MROOT:function a(){return hd},MROW:function a(){return id},MS:function a(){return jd},MSPACE:function a(){return kd},MSQRT:function a(){return ld},MSTYLE:function a(){return md},MSUB:function a(){return nd},MSUBSUP:function a(){return od},MSUP:function a(){return pd},MTABLE:function a(){return qd},MTD:function a(){return rd},MTEXT:function a(){return sd},MTR:function a(){return td},MUNDER:function a(){return ud},MUNDEROVER:function a(){return vd},NAV:function a(){return Xa},NOSCRIPT:function a(){return Ya},OBJECT:function a(){return Za},OL:function a(){return $a},OPTGROUP:function a(){return _a},OPTION:function a(){return ab},OUTPUT:function a(){return bb},P:function a(){return cb},PATH:function a(){return Fc},PATTERN:function a(){return Gc},PICTURE:function a(){return db},POLYGON:function a(){return Hc},POLYLINE:function a(){return Ic},PRE:function a(){return eb},PROGRESS:function a(){return fb},Q:function a(){return gb},RADIALGRADIENT:function a(){return Jc},RECT:function a(){return Kc},RP:function a(){return hb},RT:function a(){return ib},RUBY:function a(){return jb},S:function a(){return kb},SAMP:function a(){return lb},SCRIPT:function a(){return mb},SEARCH:function a(){return nb},SECTION:function a(){return ob},SELECT:function a(){return pb},SEMANTICS:function a(){return wd},SET:function a(){return Lc},SLOT:function a(){return qb},SMALL:function a(){return rb},SOURCE:function a(){return sb},SPAN:function a(){return tb},STOP:function a(){return Mc},STRONG:function a(){return ub},STYLE:function a(){return vb},SUB:function a(){return wb},SUMMARY:function a(){return xb},SUP:function a(){return yb},SVG:function a(){return Nc},SWITCH:function a(){return Oc},SYMBOL:function a(){return Pc},TABLE:function a(){return zb},TBODY:function a(){return Ab},TD:function a(){return Bb},TEMPLATE:function a(){return Cb},TEXT:function a(){return Qc},TEXTAREA:function a(){return Db},TEXTPATH:function a(){return Rc},TFOOT:function a(){return Eb},TH:function a(){return Fb},THEAD:function a(){return Gb},TIME:function a(){return Hb},TITLE:function a(){return Ib},TR:function a(){return Jb},TRACK:function a(){return Kb},TSPAN:function a(){return Sc},U:function a(){return Lb},UL:function a(){return Mb},USE:function a(){return Tc},VAR:function a(){return Nb},VIDEO:function a(){return Ob},VIEW:function a(){return Uc},WBR:function a(){return Pb},app:function a(){return b},child:function a(){return n},childCount:function a(){return m},children:function a(){return l},childrenStart:function a(){return o},context:function a(){return E},createPatch:function a(){return g},createState:function a(){return f},defuse:function a(){return c},globals:function a(){return O},hydrate:function a(){return d},memo:function a(){return e},mergeClass:function a(){return B},mergeProps:function a(){return D},mergeStyle:function a(){return C},props:function a(){return j},tag:function a(){return h},vode:function b(){return a}});// src/vode.ts
8
- var N,O={currentViewTransition:void 0,requestAnimationFrame:"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){return a()},startViewTransition:"undefined"!=typeof document&&"function"==typeof document.startViewTransition?document.startViewTransition.bind(document):null},P="a",i="abbr",k="address",p="area",Q="article",R="aside",S="audio",T="b",U="base",V="bdi",W="bdo",X="blockquote",Y="body",Z="br",$="button",_="canvas",aa="caption",ba="cite",ca="code",da="col",ea="colgroup",fa="data",ga="datalist",ha="dd",ia="del",ja="details",ka="dfn",la="dialog",ma="div",na="dl",oa="dt",pa="em",qa="embed",ra="fieldset",sa="figcaption",ta="figure",ua="footer",va="form",wa="h1",xa="h2",ya="h3",za="h4",Aa="h5",Ba="h6",Ca="head",Da="header",Ea="hgroup",Fa="hr",Ga="html",Ha="i",Ia="iframe",Ja="img",Ka="input",La="ins",Ma="kbd",Na="label",Oa="legend",Pa="li",Qa="link",Ra="main",Sa="map",Ta="mark",Ua="menu",Va="meta",Wa="meter",Xa="nav",Ya="noscript",Za="object",$a="ol",_a="optgroup",ab="option",bb="output",cb="p",db="picture",eb="pre",fb="progress",gb="q",hb="rp",ib="rt",jb="ruby",kb="s",lb="samp",mb="script",nb="search",ob="section",pb="select",qb="slot",rb="small",sb="source",tb="span",ub="strong",vb="style",wb="sub",xb="summary",yb="sup",zb="table",Ab="tbody",Bb="td",Cb="template",Db="textarea",Eb="tfoot",Fb="th",Gb="thead",Hb="time",Ib="title",Jb="tr",Kb="track",Lb="u",Mb="ul",Nb="var",Ob="video",Pb="wbr",Qb="animate",Rb="animateMotion",Sb="animateTransform",Tb="circle",Ub="clipPath",Vb="defs",Wb="desc",Xb="ellipse",Yb="feBlend",Zb="feColorMatrix",$b="feComponentTransfer",_b="feComposite",ac="feConvolveMatrix",bc="feDiffuseLighting",cc="feDisplacementMap",dc="feDistantLight",ec="feDropShadow",fc="feFlood",gc="feFuncA",hc="feFuncB",ic="feFuncG",jc="feFuncR",kc="feGaussianBlur",lc="feImage",mc="feMerge",nc="feMergeNode",oc="feMorphology",pc="feOffset",qc="fePointLight",rc="feSpecularLighting",sc="feSpotLight",tc="feTile",uc="feTurbulence",vc="filter",wc="foreignObject",xc="g",yc="image",zc="line",Ac="linearGradient",Bc="marker",Cc="mask",Dc="metadata",Ec="mpath",Fc="path",Gc="pattern",Hc="polygon",Ic="polyline",Jc="radialGradient",Kc="rect",Lc="set",Mc="stop",Nc="svg",Oc="switch",Pc="symbol",Qc="text",Rc="textPath",Sc="tspan",Tc="use",Uc="view",Vc="annotation",Wc="annotation-xml",Xc="maction",Yc="math",Zc="merror",$c="mfrac",_c="mi",ad="mmultiscripts",bd="mn",cd="mo",dd="mover",ed="mpadded",fd="mphantom",gd="mprescripts",hd="mroot",id="mrow",jd="ms",kd="mspace",ld="msqrt",md="mstyle",nd="msub",od="msubsup",pd="msup",qd="mtable",rd="mtd",sd="mtext",td="mtr",ud="munder",vd="munderover",wd="semantics",xd=/*#__PURE__*/function(){function a(b,c){function d(a,b){if(1<c.length){var d=0,e=b[c[d]];for(("object"!==_typeof(e)||null===e)&&(b[c[d]]=e={}),d=1;d<c.length-1;d++){var f=e;e=e[c[d]],("object"!==_typeof(e)||null===e)&&(f[c[d]]=e={})}e[c[d]]=a}else 1===c.length?"object"===_typeof(b[c[0]])&&"object"===_typeof(a)?Object.assign(b[c[0]],a):b[c[0]]=a:Object.assign(b,a)}function e(a){var b={};return d(a,b),b}function f(){if(0===c.length)return b;for(var a=b?b[c[0]]:void 0,d=1;d<c.length&&!!a;d++)a=a[c[d]];return a}function g(a){d(a,b)}function h(a,c){c?b.patch([e(a)]):b.patch(e(a))}return _classCallCheck(this,a),_defineProperty(this,"state",void 0),_defineProperty(this,"keys",void 0),this.state=b,this.keys=c,new Proxy(this,{get:function i(c,d,e){if("state"===d)return b;if("get"===d)return f;if("put"===d)return g;if("patch"===d)return h;var j=[].concat(_toConsumableArray(c.keys),[d+""]);return new a(c.state,j)}})}return _createClass(a,[{key:"get",value:function a(){}},{key:"put",value:function b(a){}},{key:"patch",value:function b(a){}}])}();return L(M)}();
3
+ function A(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];if(!d||0===d.length)return null;if(1===d.length)return d[0];for(var f=d[0],g=1;g<d.length;g++){var h=f,i=d[g];if(!h)f=i;else if(!i)continue;else if("string"==typeof h&&"string"==typeof i){var j=h.split(" "),k=i.split(" "),l=/* @__PURE__ */new Set([].concat(_toConsumableArray(j),_toConsumableArray(k)));f=Array.from(l).join(" ").trim()}else if("string"==typeof h&&Array.isArray(i)){var m=/* @__PURE__ */new Set([].concat(_toConsumableArray(i),_toConsumableArray(h.split(" "))));f=Array.from(m).join(" ").trim()}else if(Array.isArray(h)&&"string"==typeof i){var n=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i.split(" "))));f=Array.from(n).join(" ").trim()}else if(Array.isArray(h)&&Array.isArray(i)){var o=/* @__PURE__ */new Set([].concat(_toConsumableArray(h),_toConsumableArray(i)));f=Array.from(o).join(" ").trim()}else if("string"==typeof h&&"object"===_typeof(i))f=_objectSpread(_defineProperty({},h,!0),i);else if("object"===_typeof(h)&&"string"==typeof i)f=_objectSpread(_objectSpread({},h),{},_defineProperty({},i,!0));else if("object"===_typeof(h)&&"object"===_typeof(i))f=_objectSpread(_objectSpread({},h),i);else if("object"===_typeof(h)&&Array.isArray(i)){var p,q=_objectSpread({},h),r=_createForOfIteratorHelper(i);try{for(r.s();!(p=r.n()).done;){var s=p.value;q[s]=!0}}catch(a){r.e(a)}finally{r.f()}f=q}else if(Array.isArray(h)&&"object"===_typeof(i)){var t,u={},v=_createForOfIteratorHelper(h);try{for(v.s();!(t=v.n()).done;){var w=t.value;u[w]=!0}}catch(a){v.e(a)}finally{v.f()}for(var x,y=0,z=Object.keys(i);y<z.length;y++)x=z[y],u[x]=i[x];f=u}else throw new Error("cannot merge classes of ".concat(h," (").concat(_typeof(h),") and ").concat(i," (").concat(_typeof(i),")"))}return f}// src/merge-style.ts
4
+ function B(){M||(M=document.createElement("div"));try{for(var a=M.style,b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];for(var e,f=0,g=c;f<g.length;f++)if(e=g[f],"object"===_typeof(e)&&null!==e)for(var h in e)a[h]=e[h];else"string"==typeof e&&(a.cssText+=";"+e);return a.cssText}finally{M.style.cssText=""}}// src/merge-props.ts
5
+ function C(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];if(0!==b.length){if(1===b.length)return b[0]||void 0;for(var d,e,f=0,g=b;f<(void 0).length;f++)if(e=(void 0)[f],"object"===_typeof(e)&&null!==e)for(var h in d||(d={}),e)"style"===h?d.style=B(d.style,e.style):"class"===h?d["class"]=A(d["class"],e["class"]):d[h]=e[h];return d}}// src/state-context.ts
6
+ function D(a){return new wd(a,[])}var E=Object.defineProperty,F=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,H=Object.prototype.hasOwnProperty,I=function c(a,b){for(var d in b)E(a,d,{get:b[d],enumerable:!0})},J=function e(a,b,c,d){if(b&&"object"===_typeof(b)||"function"==typeof b){var f,g=_createForOfIteratorHelper(G(b));try{var h=function e(){var g=f.value;H.call(a,g)||g===c||E(a,g,{get:function a(){return b[g]},enumerable:!(d=F(b,g))||d.enumerable})};for(g.s();!(f=g.n()).done;)h()}catch(a){g.e(a)}finally{g.f()}}return a},K=function b(a){return J(E({},"__esModule",{value:!0}),a)},L={};// index.ts
7
+ I(L,{A:function a(){return O},ABBR:function a(){return i},ADDRESS:function a(){return k},ANIMATE:function a(){return Pb},ANIMATEMOTION:function a(){return Qb},ANIMATETRANSFORM:function a(){return Rb},ANNOTATION:function a(){return Uc},ANNOTATION_XML:function a(){return Vc},AREA:function a(){return p},ARTICLE:function a(){return P},ASIDE:function a(){return Q},AUDIO:function a(){return R},B:function a(){return S},BASE:function a(){return T},BDI:function a(){return U},BDO:function a(){return V},BLOCKQUOTE:function a(){return W},BODY:function a(){return X},BR:function a(){return Y},BUTTON:function a(){return Z},CANVAS:function a(){return $},CAPTION:function a(){return _},CIRCLE:function a(){return Sb},CITE:function a(){return aa},CLIPPATH:function a(){return Tb},CODE:function a(){return ba},COL:function a(){return ca},COLGROUP:function a(){return da},DATA:function a(){return ea},DATALIST:function a(){return fa},DD:function a(){return ga},DEFS:function a(){return Ub},DEL:function a(){return ha},DESC:function a(){return Vb},DETAILS:function a(){return ia},DFN:function a(){return ja},DIALOG:function a(){return ka},DIV:function a(){return la},DL:function a(){return ma},DT:function a(){return na},ELLIPSE:function a(){return Wb},EM:function a(){return oa},EMBED:function a(){return pa},FEBLEND:function a(){return Xb},FECOLORMATRIX:function a(){return Yb},FECOMPONENTTRANSFER:function a(){return Zb},FECOMPOSITE:function a(){return $b},FECONVOLVEMATRIX:function a(){return _b},FEDIFFUSELIGHTING:function a(){return ac},FEDISPLACEMENTMAP:function a(){return bc},FEDISTANTLIGHT:function a(){return cc},FEDROPSHADOW:function a(){return dc},FEFLOOD:function a(){return ec},FEFUNCA:function a(){return fc},FEFUNCB:function a(){return gc},FEFUNCG:function a(){return hc},FEFUNCR:function a(){return ic},FEGAUSSIANBLUR:function a(){return jc},FEIMAGE:function a(){return kc},FEMERGE:function a(){return lc},FEMERGENODE:function a(){return mc},FEMORPHOLOGY:function a(){return nc},FEOFFSET:function a(){return oc},FEPOINTLIGHT:function a(){return pc},FESPECULARLIGHTING:function a(){return qc},FESPOTLIGHT:function a(){return rc},FETILE:function a(){return sc},FETURBULENCE:function a(){return tc},FIELDSET:function a(){return qa},FIGCAPTION:function a(){return ra},FIGURE:function a(){return sa},FILTER:function a(){return uc},FOOTER:function a(){return ta},FOREIGNOBJECT:function a(){return vc},FORM:function a(){return ua},G:function a(){return wc},H1:function a(){return va},H2:function a(){return wa},H3:function a(){return xa},H4:function a(){return ya},H5:function a(){return za},H6:function a(){return Aa},HEAD:function a(){return Ba},HEADER:function a(){return Ca},HGROUP:function a(){return Da},HR:function a(){return Ea},HTML:function a(){return Fa},I:function a(){return Ga},IFRAME:function a(){return Ha},IMAGE:function a(){return xc},IMG:function a(){return Ia},INPUT:function a(){return Ja},INS:function a(){return Ka},KBD:function a(){return La},LABEL:function a(){return Ma},LEGEND:function a(){return Na},LI:function a(){return Oa},LINE:function a(){return yc},LINEARGRADIENT:function a(){return zc},LINK:function a(){return Pa},MACTION:function a(){return Wc},MAIN:function a(){return Qa},MAP:function a(){return Ra},MARK:function a(){return Sa},MARKER:function a(){return Ac},MASK:function a(){return Bc},MATH:function a(){return Xc},MENU:function a(){return Ta},MERROR:function a(){return Yc},META:function a(){return Ua},METADATA:function a(){return Cc},METER:function a(){return Va},MFRAC:function a(){return Zc},MI:function a(){return $c},MMULTISCRIPTS:function a(){return _c},MN:function a(){return ad},MO:function a(){return bd},MOVER:function a(){return cd},MPADDED:function a(){return dd},MPATH:function a(){return Dc},MPHANTOM:function a(){return ed},MPRESCRIPTS:function a(){return fd},MROOT:function a(){return gd},MROW:function a(){return hd},MS:function a(){return id},MSPACE:function a(){return jd},MSQRT:function a(){return kd},MSTYLE:function a(){return ld},MSUB:function a(){return md},MSUBSUP:function a(){return nd},MSUP:function a(){return od},MTABLE:function a(){return pd},MTD:function a(){return qd},MTEXT:function a(){return rd},MTR:function a(){return sd},MUNDER:function a(){return td},MUNDEROVER:function a(){return ud},NAV:function a(){return Wa},NOSCRIPT:function a(){return Xa},OBJECT:function a(){return Ya},OL:function a(){return Za},OPTGROUP:function a(){return $a},OPTION:function a(){return _a},OUTPUT:function a(){return ab},P:function a(){return bb},PATH:function a(){return Ec},PATTERN:function a(){return Fc},PICTURE:function a(){return cb},POLYGON:function a(){return Gc},POLYLINE:function a(){return Hc},PRE:function a(){return db},PROGRESS:function a(){return eb},Q:function a(){return fb},RADIALGRADIENT:function a(){return Ic},RECT:function a(){return Jc},RP:function a(){return gb},RT:function a(){return hb},RUBY:function a(){return ib},S:function a(){return jb},SAMP:function a(){return kb},SCRIPT:function a(){return lb},SEARCH:function a(){return mb},SECTION:function a(){return nb},SELECT:function a(){return ob},SEMANTICS:function a(){return vd},SET:function a(){return Kc},SLOT:function a(){return pb},SMALL:function a(){return qb},SOURCE:function a(){return rb},SPAN:function a(){return sb},STOP:function a(){return Lc},STRONG:function a(){return tb},STYLE:function a(){return ub},SUB:function a(){return vb},SUMMARY:function a(){return wb},SUP:function a(){return xb},SVG:function a(){return Mc},SWITCH:function a(){return Nc},SYMBOL:function a(){return Oc},TABLE:function a(){return yb},TBODY:function a(){return zb},TD:function a(){return Ab},TEMPLATE:function a(){return Bb},TEXT:function a(){return Pc},TEXTAREA:function a(){return Cb},TEXTPATH:function a(){return Qc},TFOOT:function a(){return Db},TH:function a(){return Eb},THEAD:function a(){return Fb},TIME:function a(){return Gb},TITLE:function a(){return Hb},TR:function a(){return Ib},TRACK:function a(){return Jb},TSPAN:function a(){return Rc},U:function a(){return Kb},UL:function a(){return Lb},USE:function a(){return Sc},VAR:function a(){return Mb},VIDEO:function a(){return Nb},VIEW:function a(){return Tc},WBR:function a(){return Ob},app:function a(){return b},child:function a(){return n},childCount:function a(){return m},children:function a(){return l},childrenStart:function a(){return o},context:function a(){return D},createPatch:function a(){return g},createState:function a(){return f},defuse:function a(){return c},globals:function a(){return N},hydrate:function a(){return d},memo:function a(){return e},mergeClass:function a(){return A},mergeProps:function a(){return C},mergeStyle:function a(){return B},props:function a(){return j},tag:function a(){return h},vode:function b(){return a}});// src/vode.ts
8
+ var M,N={currentViewTransition:void 0,requestAnimationFrame:"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){return a()},startViewTransition:"undefined"!=typeof document&&"function"==typeof document.startViewTransition?document.startViewTransition.bind(document):null},O="a",i="abbr",k="address",p="area",P="article",Q="aside",R="audio",S="b",T="base",U="bdi",V="bdo",W="blockquote",X="body",Y="br",Z="button",$="canvas",_="caption",aa="cite",ba="code",ca="col",da="colgroup",ea="data",fa="datalist",ga="dd",ha="del",ia="details",ja="dfn",ka="dialog",la="div",ma="dl",na="dt",oa="em",pa="embed",qa="fieldset",ra="figcaption",sa="figure",ta="footer",ua="form",va="h1",wa="h2",xa="h3",ya="h4",za="h5",Aa="h6",Ba="head",Ca="header",Da="hgroup",Ea="hr",Fa="html",Ga="i",Ha="iframe",Ia="img",Ja="input",Ka="ins",La="kbd",Ma="label",Na="legend",Oa="li",Pa="link",Qa="main",Ra="map",Sa="mark",Ta="menu",Ua="meta",Va="meter",Wa="nav",Xa="noscript",Ya="object",Za="ol",$a="optgroup",_a="option",ab="output",bb="p",cb="picture",db="pre",eb="progress",fb="q",gb="rp",hb="rt",ib="ruby",jb="s",kb="samp",lb="script",mb="search",nb="section",ob="select",pb="slot",qb="small",rb="source",sb="span",tb="strong",ub="style",vb="sub",wb="summary",xb="sup",yb="table",zb="tbody",Ab="td",Bb="template",Cb="textarea",Db="tfoot",Eb="th",Fb="thead",Gb="time",Hb="title",Ib="tr",Jb="track",Kb="u",Lb="ul",Mb="var",Nb="video",Ob="wbr",Pb="animate",Qb="animateMotion",Rb="animateTransform",Sb="circle",Tb="clipPath",Ub="defs",Vb="desc",Wb="ellipse",Xb="feBlend",Yb="feColorMatrix",Zb="feComponentTransfer",$b="feComposite",_b="feConvolveMatrix",ac="feDiffuseLighting",bc="feDisplacementMap",cc="feDistantLight",dc="feDropShadow",ec="feFlood",fc="feFuncA",gc="feFuncB",hc="feFuncG",ic="feFuncR",jc="feGaussianBlur",kc="feImage",lc="feMerge",mc="feMergeNode",nc="feMorphology",oc="feOffset",pc="fePointLight",qc="feSpecularLighting",rc="feSpotLight",sc="feTile",tc="feTurbulence",uc="filter",vc="foreignObject",wc="g",xc="image",yc="line",zc="linearGradient",Ac="marker",Bc="mask",Cc="metadata",Dc="mpath",Ec="path",Fc="pattern",Gc="polygon",Hc="polyline",Ic="radialGradient",Jc="rect",Kc="set",Lc="stop",Mc="svg",Nc="switch",Oc="symbol",Pc="text",Qc="textPath",Rc="tspan",Sc="use",Tc="view",Uc="annotation",Vc="annotation-xml",Wc="maction",Xc="math",Yc="merror",Zc="mfrac",$c="mi",_c="mmultiscripts",ad="mn",bd="mo",cd="mover",dd="mpadded",ed="mphantom",fd="mprescripts",gd="mroot",hd="mrow",id="ms",jd="mspace",kd="msqrt",ld="mstyle",md="msub",nd="msubsup",od="msup",pd="mtable",qd="mtd",rd="mtext",sd="mtr",td="munder",ud="munderover",vd="semantics",wd=/*#__PURE__*/function(){function a(b,c){function d(a,b){if(1<c.length){var d=0,e=b[c[d]];for(("object"!==_typeof(e)||null===e)&&(b[c[d]]=e={}),d=1;d<c.length-1;d++){var f=e;e=e[c[d]],("object"!==_typeof(e)||null===e)&&(f[c[d]]=e={})}e[c[d]]=a}else 1===c.length?"object"===_typeof(b[c[0]])&&"object"===_typeof(a)&&null!==a?Object.assign(b[c[0]],a):b[c[0]]=a:Object.assign(b,a)}function e(a){var b={};return d(a,b),b}function f(){if(0===c.length)return b;for(var a=b?b[c[0]]:void 0,d=1;d<c.length&&!!a;d++)a=a[c[d]];return a}function g(a){d(a,b)}function h(a,c){c?b.patch([e(a)]):b.patch(e(a))}return _classCallCheck(this,a),_defineProperty(this,"state",void 0),_defineProperty(this,"keys",void 0),this.state=b,this.keys=c,new Proxy(this,{get:function i(c,d,e){if("state"===d)return b;if("get"===d)return f;if("put"===d)return g;if("patch"===d)return h;var j=[].concat(_toConsumableArray(c.keys),[d+""]);return new a(c.state,j)}})}return _createClass(a,[{key:"get",value:function a(){}},{key:"put",value:function b(a){}},{key:"patch",value:function b(a){}}])}();return K(L)}();