sygnal 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astro/client.cjs.js +7 -3
- package/dist/astro/client.mjs +7 -3
- package/dist/index.cjs.js +7 -3
- package/dist/index.esm.js +7 -3
- package/dist/sygnal.min.js +1 -1
- package/package.json +1 -1
- package/src/component.js +7 -3
- package/src/index.d.ts +1 -1
package/dist/astro/client.cjs.js
CHANGED
|
@@ -3848,7 +3848,7 @@ class Component {
|
|
|
3848
3848
|
const isParentSink = (sink === PARENT_SINK_NAME);
|
|
3849
3849
|
|
|
3850
3850
|
const on = isStateSink ? onState() : onNormal();
|
|
3851
|
-
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, value })) : on(action, reducer);
|
|
3851
|
+
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, component: this.view, value })) : on(action, reducer);
|
|
3852
3852
|
|
|
3853
3853
|
const wrapped$ = on$
|
|
3854
3854
|
.compose(this.log(data => {
|
|
@@ -3914,9 +3914,13 @@ class Component {
|
|
|
3914
3914
|
}).map(sources => xs$1.merge(...sources)).flatten();
|
|
3915
3915
|
|
|
3916
3916
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
3917
|
-
select: (
|
|
3917
|
+
select: (nameOrComponent) => {
|
|
3918
3918
|
const all$ = childSources$;
|
|
3919
|
-
const filtered$ =
|
|
3919
|
+
const filtered$ = typeof nameOrComponent === 'function'
|
|
3920
|
+
? all$.filter(entry => entry.component === nameOrComponent)
|
|
3921
|
+
: nameOrComponent
|
|
3922
|
+
? all$.filter(entry => entry.name === nameOrComponent)
|
|
3923
|
+
: all$;
|
|
3920
3924
|
const unwrapped$ = filtered$.map(entry => entry.value);
|
|
3921
3925
|
return unwrapped$
|
|
3922
3926
|
}
|
package/dist/astro/client.mjs
CHANGED
|
@@ -3827,7 +3827,7 @@ class Component {
|
|
|
3827
3827
|
const isParentSink = (sink === PARENT_SINK_NAME);
|
|
3828
3828
|
|
|
3829
3829
|
const on = isStateSink ? onState() : onNormal();
|
|
3830
|
-
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, value })) : on(action, reducer);
|
|
3830
|
+
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, component: this.view, value })) : on(action, reducer);
|
|
3831
3831
|
|
|
3832
3832
|
const wrapped$ = on$
|
|
3833
3833
|
.compose(this.log(data => {
|
|
@@ -3893,9 +3893,13 @@ class Component {
|
|
|
3893
3893
|
}).map(sources => xs$1.merge(...sources)).flatten();
|
|
3894
3894
|
|
|
3895
3895
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
3896
|
-
select: (
|
|
3896
|
+
select: (nameOrComponent) => {
|
|
3897
3897
|
const all$ = childSources$;
|
|
3898
|
-
const filtered$ =
|
|
3898
|
+
const filtered$ = typeof nameOrComponent === 'function'
|
|
3899
|
+
? all$.filter(entry => entry.component === nameOrComponent)
|
|
3900
|
+
: nameOrComponent
|
|
3901
|
+
? all$.filter(entry => entry.name === nameOrComponent)
|
|
3902
|
+
: all$;
|
|
3899
3903
|
const unwrapped$ = filtered$.map(entry => entry.value);
|
|
3900
3904
|
return unwrapped$
|
|
3901
3905
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -3794,7 +3794,7 @@ class Component {
|
|
|
3794
3794
|
const isParentSink = (sink === PARENT_SINK_NAME);
|
|
3795
3795
|
|
|
3796
3796
|
const on = isStateSink ? onState() : onNormal();
|
|
3797
|
-
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, value })) : on(action, reducer);
|
|
3797
|
+
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, component: this.view, value })) : on(action, reducer);
|
|
3798
3798
|
|
|
3799
3799
|
const wrapped$ = on$
|
|
3800
3800
|
.compose(this.log(data => {
|
|
@@ -3860,9 +3860,13 @@ class Component {
|
|
|
3860
3860
|
}).map(sources => xs$1.merge(...sources)).flatten();
|
|
3861
3861
|
|
|
3862
3862
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
3863
|
-
select: (
|
|
3863
|
+
select: (nameOrComponent) => {
|
|
3864
3864
|
const all$ = childSources$;
|
|
3865
|
-
const filtered$ =
|
|
3865
|
+
const filtered$ = typeof nameOrComponent === 'function'
|
|
3866
|
+
? all$.filter(entry => entry.component === nameOrComponent)
|
|
3867
|
+
: nameOrComponent
|
|
3868
|
+
? all$.filter(entry => entry.name === nameOrComponent)
|
|
3869
|
+
: all$;
|
|
3866
3870
|
const unwrapped$ = filtered$.map(entry => entry.value);
|
|
3867
3871
|
return unwrapped$
|
|
3868
3872
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -3774,7 +3774,7 @@ class Component {
|
|
|
3774
3774
|
const isParentSink = (sink === PARENT_SINK_NAME);
|
|
3775
3775
|
|
|
3776
3776
|
const on = isStateSink ? onState() : onNormal();
|
|
3777
|
-
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, value })) : on(action, reducer);
|
|
3777
|
+
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, component: this.view, value })) : on(action, reducer);
|
|
3778
3778
|
|
|
3779
3779
|
const wrapped$ = on$
|
|
3780
3780
|
.compose(this.log(data => {
|
|
@@ -3840,9 +3840,13 @@ class Component {
|
|
|
3840
3840
|
}).map(sources => xs$1.merge(...sources)).flatten();
|
|
3841
3841
|
|
|
3842
3842
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
3843
|
-
select: (
|
|
3843
|
+
select: (nameOrComponent) => {
|
|
3844
3844
|
const all$ = childSources$;
|
|
3845
|
-
const filtered$ =
|
|
3845
|
+
const filtered$ = typeof nameOrComponent === 'function'
|
|
3846
|
+
? all$.filter(entry => entry.component === nameOrComponent)
|
|
3847
|
+
: nameOrComponent
|
|
3848
|
+
? all$.filter(entry => entry.name === nameOrComponent)
|
|
3849
|
+
: all$;
|
|
3846
3850
|
const unwrapped$ = filtered$.map(entry => entry.value);
|
|
3847
3851
|
return unwrapped$
|
|
3848
3852
|
}
|
package/dist/sygnal.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Sygnal={})}(this,(function(t){"use strict";function e(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o={},r={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e,n=t.Symbol;if("function"==typeof n)if(n.observable)e=n.observable;else{e=n.for("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch(t){}}else e="@@observable";return e}}(r);var i,s,a=r,c=Object.prototype.toString,u=function(t){var e=c.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===c.call(t.callee)),n};var l=Array.prototype.slice,p=u,f=Object.keys,h=f?function(t){return f(t)}:function(){if(s)return i;var t;if(s=1,!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=u,r=Object.prototype.propertyIsEnumerable,a=!r.call({toString:null},"toString"),c=r.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{p(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();t=function(t){var r=null!==t&&"object"==typeof t,i="[object Function]"===n.call(t),s=o(t),u=r&&"[object String]"===n.call(t),f=[];if(!r&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var d=c&&i;if(u&&t.length>0&&!e.call(t,0))for(var m=0;m<t.length;++m)f.push(String(m));if(s&&t.length>0)for(var y=0;y<t.length;++y)f.push(String(y));else for(var v in t)d&&"prototype"===v||!e.call(t,v)||f.push(String(v));if(a)for(var _=function(t){if("undefined"==typeof window||!h)return p(t);try{return p(t)}catch(t){return!1}}(t),g=0;g<l.length;++g)_&&"constructor"===l[g]||!e.call(t,l[g])||f.push(l[g]);return f}}return i=t}(),d=Object.keys;h.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return p(t)?d(l.call(t)):d(t)})}else Object.keys=h;return Object.keys||h};var m,y=h,v="undefined"!=typeof Symbol&&Symbol,_=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0},g={foo:{}},b=Object,w=Array.prototype.slice,S=Object.prototype.toString,A=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==S.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,o=w.call(arguments,1),r=Math.max(0,e.length-o.length),i=[],s=0;s<r;s++)i.push("$"+s);if(n=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var r=e.apply(this,o.concat(w.call(arguments)));return Object(r)===r?r:this}return e.apply(t,o.concat(w.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,n.prototype=new a,a.prototype=null}return n},E=Function.prototype.bind||A,O=E.call(Function.call,Object.prototype.hasOwnProperty),N=SyntaxError,C=Function,T=TypeError,$=function(t){try{return C('"use strict"; return ('+t+").constructor;")()}catch(t){}},x=Object.getOwnPropertyDescriptor;if(x)try{x({},"")}catch(t){x=null}var D=function(){throw new T},j=x?function(){try{return D}catch(t){try{return x(arguments,"callee").get}catch(t){return D}}}():D,k="function"==typeof v&&"function"==typeof Symbol&&"symbol"==typeof v("foo")&&"symbol"==typeof Symbol("bar")&&_(),L={__proto__:g}.foo===g.foo&&!({__proto__:null}instanceof b),I=Object.getPrototypeOf||(L?function(t){return t.__proto__}:null),M={},P="undefined"!=typeof Uint8Array&&I?I(Uint8Array):m,R={"%AggregateError%":"undefined"==typeof AggregateError?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?m:ArrayBuffer,"%ArrayIteratorPrototype%":k&&I?I([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"undefined"==typeof Atomics?m:Atomics,"%BigInt%":"undefined"==typeof BigInt?m:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?m:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?m:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?m:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?m:FinalizationRegistry,"%Function%":C,"%GeneratorFunction%":M,"%Int8Array%":"undefined"==typeof Int8Array?m:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?m:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&I?I(I([][Symbol.iterator]())):m,"%JSON%":"object"==typeof JSON?JSON:m,"%Map%":"undefined"==typeof Map?m:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&I?I((new Map)[Symbol.iterator]()):m,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?m:Promise,"%Proxy%":"undefined"==typeof Proxy?m:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?m:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?m:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&I?I((new Set)[Symbol.iterator]()):m,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&I?I(""[Symbol.iterator]()):m,"%Symbol%":k?Symbol:m,"%SyntaxError%":N,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":T,"%Uint8Array%":"undefined"==typeof Uint8Array?m:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?m:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?m:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?m:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?m:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?m:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?m:WeakSet};if(I)try{null.error}catch(t){var F=I(I(t));R["%Error.prototype%"]=F}var G=function t(e){var n;if("%AsyncFunction%"===e)n=$("async function () {}");else if("%GeneratorFunction%"===e)n=$("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=$("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&I&&(n=I(r.prototype))}return R[e]=n,n},B={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=E,H=O,V=U.call(Function.call,Array.prototype.concat),Y=U.call(Function.apply,Array.prototype.splice),W=U.call(Function.call,String.prototype.replace),q=U.call(Function.call,String.prototype.slice),z=U.call(Function.call,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,X=function(t,e){var n,o=t;if(H(B,o)&&(o="%"+(n=B[o])[0]+"%"),H(R,o)){var r=R[o];if(r===M&&(r=G(o)),void 0===r&&!e)throw new T("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:r}}throw new N("intrinsic "+t+" does not exist!")},K=function(t,e){if("string"!=typeof t||0===t.length)throw new T("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new T('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new N("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=q(t,0,1),n=q(t,-1);if("%"===e&&"%"!==n)throw new N("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new N("invalid intrinsic syntax, expected opening `%`");var o=[];return W(t,J,(function(t,e,n,r){o[o.length]=n?W(r,Z,"$1"):e||t})),o}(t),o=n.length>0?n[0]:"",r=X("%"+o+"%",e),i=r.name,s=r.value,a=!1,c=r.alias;c&&(o=c[0],Y(n,V([0,1],c)));for(var u=1,l=!0;u<n.length;u+=1){var p=n[u],f=q(p,0,1),h=q(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===h||"'"===h||"`"===h)&&f!==h)throw new N("property names with quotes must have matching quotes");if("constructor"!==p&&l||(a=!0),H(R,i="%"+(o+="."+p)+"%"))s=R[i];else if(null!=s){if(!(p in s)){if(!e)throw new T("base intrinsic for "+t+" exists, but the property is not available.");return}if(x&&u+1>=n.length){var d=x(s,p);s=(l=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:s[p]}else l=H(s,p),s=s[p];l&&!a&&(R[i]=s)}}return s},Q=K("%Object.defineProperty%",!0),tt=function(){if(Q)try{return Q({},"a",{value:1}),!0}catch(t){return!1}return!1};tt.hasArrayLengthDefineBug=function(){if(!tt())return null;try{return 1!==Q([],"length",{value:1}).length}catch(t){return!0}};var et=tt,nt=y,ot="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),rt=Object.prototype.toString,it=Array.prototype.concat,st=Object.defineProperty,at=et(),ct=st&&at,ut=function(t,e,n,o){if(e in t)if(!0===o){if(t[e]===n)return}else if("function"!=typeof(r=o)||"[object Function]"!==rt.call(r)||!o())return;var r;ct?st(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n},lt=function(t,e){var n=arguments.length>2?arguments[2]:{},o=nt(e);ot&&(o=it.call(o,Object.getOwnPropertySymbols(e)));for(var r=0;r<o.length;r+=1)ut(t,o[r],e[o[r]],n[o[r]])};lt.supportsDescriptors=!!ct;var pt=n,ft=function(){return"object"==typeof n&&n&&n.Math===Math&&n.Array===Array?n:pt},ht=lt,dt=ft,mt=lt,yt=n,vt=ft,_t=function(){var t=dt();if(ht.supportsDescriptors){var e=Object.getOwnPropertyDescriptor(t,"globalThis");e&&(!e.configurable||!e.enumerable&&e.writable&&globalThis===t)||Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else"object"==typeof globalThis&&globalThis===t||(t.globalThis=t);return t},gt=vt(),bt=function(){return gt};mt(bt,{getPolyfill:vt,implementation:yt,shim:_t});var wt,St=bt,At=n&&n.__extends||(wt=function(t,e){return wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},wt(t,e)},function(t,e){function n(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(o,"__esModule",{value:!0});var Et=o.NO_IL=o.NO=o.MemoryStream=oe=o.Stream=void 0,Ot=a.default(St.getPolyfill()),Nt={},Ct=o.NO=Nt;function Tt(){}function $t(t){for(var e=t.length,n=Array(e),o=0;o<e;++o)n[o]=t[o];return n}function xt(t,e,n){try{return t.f(e)}catch(t){return n._e(t),Nt}}var Dt={_n:Tt,_e:Tt,_c:Tt};function jt(t){t._start=function(t){t.next=t._n,t.error=t._e,t.complete=t._c,this.start(t)},t._stop=t.stop}Et=o.NO_IL=Dt;var kt=function(){function t(t,e){this._stream=t,this._listener=e}return t.prototype.unsubscribe=function(){this._stream._remove(this._listener)},t}(),Lt=function(){function t(t){this._listener=t}return t.prototype.next=function(t){this._listener._n(t)},t.prototype.error=function(t){this._listener._e(t)},t.prototype.complete=function(){this._listener._c()},t}(),It=function(){function t(t){this.type="fromObservable",this.ins=t,this.active=!1}return t.prototype._start=function(t){this.out=t,this.active=!0,this._sub=this.ins.subscribe(new Lt(t)),this.active||this._sub.unsubscribe()},t.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},t}(),Mt=function(){function t(t){this.type="merge",this.insArr=t,this.out=Nt,this.ac=0}return t.prototype._start=function(t){this.out=t;var e=this.insArr,n=e.length;this.ac=n;for(var o=0;o<n;o++)e[o]._add(this)},t.prototype._stop=function(){for(var t=this.insArr,e=t.length,n=0;n<e;n++)t[n]._remove(this);this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){if(--this.ac<=0){var t=this.out;if(t===Nt)return;t._c()}},t}(),Pt=function(){function t(t,e,n){this.i=t,this.out=e,this.p=n,n.ils.push(this)}return t.prototype._n=function(t){var e=this.p,n=this.out;if(n!==Nt&&e.up(t,this.i)){var o=$t(e.vals);n._n(o)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.p;t.out!==Nt&&0==--t.Nc&&t.out._c()},t}(),Rt=function(){function t(t){this.type="combine",this.insArr=t,this.out=Nt,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return t.prototype.up=function(t,e){var n=this.vals[e],o=this.Nn?n===Nt?--this.Nn:this.Nn:0;return this.vals[e]=t,0===o},t.prototype._start=function(t){this.out=t;var e=this.insArr,n=this.Nc=this.Nn=e.length,o=this.vals=new Array(n);if(0===n)t._n([]),t._c();else for(var r=0;r<n;r++)o[r]=Nt,e[r]._add(new Pt(r,t,this))},t.prototype._stop=function(){for(var t=this.insArr,e=t.length,n=this.ils,o=0;o<e;o++)t[o]._remove(n[o]);this.out=Nt,this.ils=[],this.vals=[]},t}(),Ft=function(){function t(t){this.type="fromArray",this.a=t}return t.prototype._start=function(t){for(var e=this.a,n=0,o=e.length;n<o;n++)t._n(e[n]);t._c()},t.prototype._stop=function(){},t}(),Gt=function(){function t(t){this.type="fromPromise",this.on=!1,this.p=t}return t.prototype._start=function(t){var e=this;this.on=!0,this.p.then((function(n){e.on&&(t._n(n),t._c())}),(function(e){t._e(e)})).then(Tt,(function(t){setTimeout((function(){throw t}))}))},t.prototype._stop=function(){this.on=!1},t}(),Bt=function(){function t(t){this.type="periodic",this.period=t,this.intervalID=-1,this.i=0}return t.prototype._start=function(t){var e=this;this.intervalID=setInterval((function(){t._n(e.i++)}),this.period)},t.prototype._stop=function(){-1!==this.intervalID&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},t}(),Ut=function(){function t(t,e){this.type="debug",this.ins=t,this.out=Nt,this.s=Tt,this.l="","string"==typeof e?this.l=e:"function"==typeof e&&(this.s=e)}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=this.s,o=this.l;if(n!==Tt)try{n(t)}catch(t){e._e(t)}else o?console.log(o+":",t):console.log(t);e._n(t)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Ht=function(){function t(t,e){this.type="drop",this.ins=e,this.out=Nt,this.max=t,this.dropped=0}return t.prototype._start=function(t){this.out=t,this.dropped=0,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&this.dropped++>=this.max&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Vt=function(){function t(t,e){this.out=t,this.op=e}return t.prototype._n=function(){this.op.end()},t.prototype._e=function(t){this.out._e(t)},t.prototype._c=function(){this.op.end()},t}(),Yt=function(){function t(t,e){this.type="endWhen",this.ins=e,this.out=Nt,this.o=t,this.oil=Dt}return t.prototype._start=function(t){this.out=t,this.o._add(this.oil=new Vt(t,this)),this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=Nt,this.oil=Dt},t.prototype.end=function(){var t=this.out;t!==Nt&&t._c()},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){this.end()},t}(),Wt=function(){function t(t,e){this.type="filter",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&n&&e._n(t)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),qt=function(){function t(t,e){this.out=t,this.op=e}return t.prototype._n=function(t){this.out._n(t)},t.prototype._e=function(t){this.out._e(t)},t.prototype._c=function(){this.op.inner=Nt,this.op.less()},t}(),zt=function(){function t(t){this.type="flatten",this.ins=t,this.out=Nt,this.open=!0,this.inner=Nt,this.il=Dt}return t.prototype._start=function(t){this.out=t,this.open=!0,this.inner=Nt,this.il=Dt,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.inner!==Nt&&this.inner._remove(this.il),this.out=Nt,this.open=!0,this.inner=Nt,this.il=Dt},t.prototype.less=function(){var t=this.out;t!==Nt&&(this.open||this.inner!==Nt||t._c())},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=this.inner,o=this.il;n!==Nt&&o!==Dt&&n._remove(o),(this.inner=t)._add(this.il=new qt(e,this))}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){this.open=!1,this.less()},t}(),Jt=function(){function t(t,e,n){var o=this;this.type="fold",this.ins=n,this.out=Nt,this.f=function(e){return t(o.acc,e)},this.acc=this.seed=e}return t.prototype._start=function(t){this.out=t,this.acc=this.seed,t._n(this.acc),this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt,this.acc=this.seed},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&e._n(this.acc=n)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Zt=function(){function t(t){this.type="last",this.ins=t,this.out=Nt,this.has=!1,this.val=Nt}return t.prototype._start=function(t){this.out=t,this.has=!1,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt,this.val=Nt},t.prototype._n=function(t){this.has=!0,this.val=t},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&(this.has?(t._n(this.val),t._c()):t._e(new Error("last() failed because input stream completed")))},t}(),Xt=function(){function t(t,e){this.type="map",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&e._n(n)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Kt=function(){function t(t){this.type="remember",this.ins=t,this.out=Nt}return t.prototype._start=function(t){this.out=t,this.ins._add(t)},t.prototype._stop=function(){this.ins._remove(this.out),this.out=Nt},t}(),Qt=function(){function t(t,e){this.type="replaceError",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;if(e!==Nt)try{this.ins._remove(this),(this.ins=this.f(t))._add(this)}catch(t){e._e(t)}},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),te=function(){function t(t,e){this.type="startWith",this.ins=t,this.out=Nt,this.val=e}return t.prototype._start=function(t){this.out=t,this.out._n(this.val),this.ins._add(t)},t.prototype._stop=function(){this.ins._remove(this.out),this.out=Nt},t}(),ee=function(){function t(t,e){this.type="take",this.ins=e,this.out=Nt,this.max=t,this.taken=0}return t.prototype._start=function(t){this.out=t,this.taken=0,this.max<=0?t._c():this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=++this.taken;n<this.max?e._n(t):n===this.max&&(e._n(t),e._c())}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),ne=function(){function t(t){this._prod=t||Nt,this._ils=[],this._stopID=Nt,this._dl=Nt,this._d=!1,this._target=null,this._err=Nt}return t.prototype._n=function(t){var e=this._ils,n=e.length;if(this._d&&this._dl._n(t),1==n)e[0]._n(t);else{if(0==n)return;for(var o=$t(e),r=0;r<n;r++)o[r]._n(t)}},t.prototype._e=function(t){if(this._err===Nt){this._err=t;var e=this._ils,n=e.length;if(this._x(),this._d&&this._dl._e(t),1==n)e[0]._e(t);else{if(0==n)return;for(var o=$t(e),r=0;r<n;r++)o[r]._e(t)}if(!this._d&&0==n)throw this._err}},t.prototype._c=function(){var t=this._ils,e=t.length;if(this._x(),this._d&&this._dl._c(),1==e)t[0]._c();else{if(0==e)return;for(var n=$t(t),o=0;o<e;o++)n[o]._c()}},t.prototype._x=function(){0!==this._ils.length&&(this._prod!==Nt&&this._prod._stop(),this._err=Nt,this._ils=[])},t.prototype._stopNow=function(){this._prod._stop(),this._err=Nt,this._stopID=Nt},t.prototype._add=function(t){var e=this._target;if(e)return e._add(t);var n=this._ils;if(n.push(t),!(n.length>1))if(this._stopID!==Nt)clearTimeout(this._stopID),this._stopID=Nt;else{var o=this._prod;o!==Nt&&o._start(this)}},t.prototype._remove=function(t){var e=this,n=this._target;if(n)return n._remove(t);var o=this._ils,r=o.indexOf(t);r>-1&&(o.splice(r,1),this._prod!==Nt&&o.length<=0?(this._err=Nt,this._stopID=setTimeout((function(){return e._stopNow()}))):1===o.length&&this._pruneCycles())},t.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},t.prototype._hasNoSinks=function(t,e){if(-1!==e.indexOf(t))return!0;if(t.out===this)return!0;if(t.out&&t.out!==Nt)return this._hasNoSinks(t.out,e.concat(t));if(t._ils){for(var n=0,o=t._ils.length;n<o;n++)if(!this._hasNoSinks(t._ils[n],e.concat(t)))return!1;return!0}return!1},t.prototype.ctor=function(){return this instanceof re?re:t},t.prototype.addListener=function(t){t._n=t.next||Tt,t._e=t.error||Tt,t._c=t.complete||Tt,this._add(t)},t.prototype.removeListener=function(t){this._remove(t)},t.prototype.subscribe=function(t){return this.addListener(t),new kt(this,t)},t.prototype[Ot]=function(){return this},t.create=function(e){if(e){if("function"!=typeof e.start||"function"!=typeof e.stop)throw new Error("producer requires both start and stop functions");jt(e)}return new t(e)},t.createWithMemory=function(t){return t&&jt(t),new re(t)},t.never=function(){return new t({_start:Tt,_stop:Tt})},t.empty=function(){return new t({_start:function(t){t._c()},_stop:Tt})},t.throw=function(e){return new t({_start:function(t){t._e(e)},_stop:Tt})},t.from=function(e){if("function"==typeof e[Ot])return t.fromObservable(e);if("function"==typeof e.then)return t.fromPromise(e);if(Array.isArray(e))return t.fromArray(e);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},t.of=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.fromArray(e)},t.fromArray=function(e){return new t(new Ft(e))},t.fromPromise=function(e){return new t(new Gt(e))},t.fromObservable=function(e){if(void 0!==e.endWhen)return e;var n="function"==typeof e[Ot]?e[Ot]():e;return new t(new It(n))},t.periodic=function(e){return new t(new Bt(e))},t.prototype._map=function(t){return new(this.ctor())(new Xt(t,this))},t.prototype.map=function(t){return this._map(t)},t.prototype.mapTo=function(t){var e=this.map((function(){return t}));return e._prod.type="mapTo",e},t.prototype.filter=function(e){var n,o,r=this._prod;return new t(r instanceof Wt?new Wt((n=r.f,o=e,function(t){return n(t)&&o(t)}),r.ins):new Wt(e,this))},t.prototype.take=function(t){return new(this.ctor())(new ee(t,this))},t.prototype.drop=function(e){return new t(new Ht(e,this))},t.prototype.last=function(){return new t(new Zt(this))},t.prototype.startWith=function(t){return new re(new te(this,t))},t.prototype.endWhen=function(t){return new(this.ctor())(new Yt(t,this))},t.prototype.fold=function(t,e){return new re(new Jt(t,e,this))},t.prototype.replaceError=function(t){return new(this.ctor())(new Qt(t,this))},t.prototype.flatten=function(){return new t(new zt(this))},t.prototype.compose=function(t){return t(this)},t.prototype.remember=function(){return new re(new Kt(this))},t.prototype.debug=function(t){return new(this.ctor())(new Ut(this,t))},t.prototype.imitate=function(t){if(t instanceof re)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=t;for(var e=this._ils,n=e.length,o=0;o<n;o++)t._add(e[o]);this._ils=[]},t.prototype.shamefullySendNext=function(t){this._n(t)},t.prototype.shamefullySendError=function(t){this._e(t)},t.prototype.shamefullySendComplete=function(){this._c()},t.prototype.setDebugListener=function(t){t?(this._d=!0,t._n=t.next||Tt,t._e=t.error||Tt,t._c=t.complete||Tt,this._dl=t):(this._d=!1,this._dl=Nt)},t.merge=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new Mt(e))},t.combine=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new Rt(e))},t}(),oe=o.Stream=ne,re=function(t){function e(e){var n=t.call(this,e)||this;return n._has=!1,n}return At(e,t),e.prototype._n=function(e){this._v=e,this._has=!0,t.prototype._n.call(this,e)},e.prototype._add=function(t){var e=this._target;if(e)return e._add(t);var n=this._ils;if(n.push(t),n.length>1)this._has&&t._n(this._v);else if(this._stopID!==Nt)this._has&&t._n(this._v),clearTimeout(this._stopID),this._stopID=Nt;else if(this._has)t._n(this._v);else{var o=this._prod;o!==Nt&&o._start(this)}},e.prototype._stopNow=function(){this._has=!1,t.prototype._stopNow.call(this)},e.prototype._x=function(){this._has=!1,t.prototype._x.call(this)},e.prototype.map=function(t){return this._map(t)},e.prototype.mapTo=function(e){return t.prototype.mapTo.call(this,e)},e.prototype.take=function(e){return t.prototype.take.call(this,e)},e.prototype.endWhen=function(e){return t.prototype.endWhen.call(this,e)},e.prototype.replaceError=function(e){return t.prototype.replaceError.call(this,e)},e.prototype.remember=function(){return this},e.prototype.debug=function(e){return t.prototype.debug.call(this,e)},e}(ne),ie=o.MemoryStream=re,se=ne,ae=o.default=se,ce=e({__proto__:null,get MemoryStream(){return ie},get NO(){return Ct},get NO_IL(){return Et},get Stream(){return oe},default:ae},[o]),ue={};function le(){var t;return(t="undefined"!=typeof window?window:void 0!==n?n:this).Cyclejs=t.Cyclejs||{},(t=t.Cyclejs).adaptStream=t.adaptStream||function(t){return t},t}Object.defineProperty(ue,"__esModule",{value:!0}),ue.setAdapt=function(t){le().adaptStream=t};var pe=ue.adapt=function(t){return le().adaptStream(t)};var fe=0;function he(){return"cycle"+ ++fe}function de(t,e){void 0===e&&(e=he()),function(t,e){if("function"!=typeof t)throw new Error("First argument given to isolate() must be a 'dataflowComponent' function");if(null===e)throw new Error("Second argument given to isolate() must not be null")}(t,e);var n="object"==typeof e?he():"",o="string"==typeof e||"object"==typeof e?e:e.toString();return function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=function(t,e,n){var o={};return Object.keys(t).forEach((function(t){if("string"!=typeof e){var r=e[t];if(void 0===r){var i=e["*"];o[t]=void 0===i?n:i}else o[t]=r}else o[t]=e})),o}(e,o,n),a=function(t,e){var n={};for(var o in t){var r=t[o];t.hasOwnProperty(o)&&r&&null!==e[o]&&"function"==typeof r.isolateSource?n[o]=r.isolateSource(r,e[o]):t.hasOwnProperty(o)&&(n[o]=t[o])}return n}(e,s),c=function(t,e,n){var o={};for(var r in e){var i=t[r],s=e[r];e.hasOwnProperty(r)&&i&&null!==n[r]&&"function"==typeof i.isolateSink?o[r]=pe(i.isolateSink(ae.fromObservable(s),n[r])):e.hasOwnProperty(r)&&(o[r]=e[r])}return o}(e,t.apply(void 0,[a].concat(r)),s);return c}}de.reset=function(){return fe=0};var me={};Object.defineProperty(me,"__esModule",{value:!0});var ye=me.DropRepeatsOperator=void 0,ve=o,_e={},ge=function(){function t(t,e){this.ins=t,this.type="dropRepeats",this.out=null,this.v=_e,this.isEq=e||function(t,e){return t===e}}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.v=_e},t.prototype._n=function(t){var e=this.out;if(e){var n=this.v;n!==_e&&this.isEq(t,n)||(this.v=t,e._n(t))}},t.prototype._e=function(t){var e=this.out;e&&e._e(t)},t.prototype._c=function(){var t=this.out;t&&t._c()},t}();ye=me.DropRepeatsOperator=ge;var be=me.default=function(t){return void 0===t&&(t=void 0),function(e){return new ve.Stream(new ge(e,t))}},we=e({__proto__:null,get DropRepeatsOperator(){return ye},default:be},[me]),Se=function(){return Se=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Se.apply(this,arguments)};function Ae(t){return"string"==typeof t||"number"==typeof t?function(e){return void 0===e?void 0:e[t]}:t.get}function Ee(t){return"string"==typeof t||"number"==typeof t?function(e,n){var o,r;return Array.isArray(e)?function(t,e,n){if(n===t[e])return t;var o=parseInt(e);return void 0===n?t.filter((function(t,e){return e!==o})):t.map((function(t,e){return e===o?n:t}))}(e,t,n):void 0===e?((o={})[t]=n,o):Se({},e,((r={})[t]=n,r))}:t.set}function Oe(t,e){return t.select(e)}function Ne(t,e){var n=Ae(e),o=Ee(e);return t.map((function(t){return function(e){var r=n(e),i=t(r);return r===i?e:o(e,i)}}))}var Ce=function(){function t(t,e){this.isolateSource=Oe,this.isolateSink=Ne,this._stream=t.filter((function(t){return void 0!==t})).compose(be()).remember(),this._name=e,this.stream=pe(this._stream),this._stream._isCycleSource=e}return t.prototype.select=function(e){var n=Ae(e);return new t(this._stream.map(n),this._name)},t}(),Te=function(){function t(t,e,n){this.ins=n,this.out=t,this.p=e}return t.prototype._n=function(t){this.p;var e=this.out;null!==e&&e._n(t)},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){},t}(),$e=function(){function t(t,e){this.type="pickMerge",this.ins=e,this.out=null,this.sel=t,this.ils=new Map,this.inst=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this);var t=this.ils;t.forEach((function(e,n){e.ins._remove(e),e.ins=null,e.out=null,t.delete(n)})),t.clear(),this.out=null,this.ils=new Map,this.inst=null},t.prototype._n=function(t){this.inst=t;for(var e=t.arr,n=this.ils,o=this.out,r=this.sel,i=e.length,s=0;s<i;++s){var a=e[s],c=a._key,u=ae.fromObservable(a[r]||ae.never());n.has(c)||(n.set(c,new Te(o,this,u)),u._add(n.get(c)))}n.forEach((function(e,o){t.dict.has(o)&&t.dict.get(o)||(e.ins._remove(e),e.ins=null,e.out=null,n.delete(o))}))},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){var t=this.out;null!==t&&t._c()},t}();var xe=function(){function t(t,e,n,o){this.key=t,this.out=e,this.p=n,this.val=Ct,this.ins=o}return t.prototype._n=function(t){this.p;var e=this.out;this.val=t,null!==e&&this.p.up()},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){},t}(),De=function(){function t(t,e){this.type="combine",this.ins=e,this.sel=t,this.out=null,this.ils=new Map,this.inst=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this);var t=this.ils;t.forEach((function(t){t.ins._remove(t),t.ins=null,t.out=null,t.val=null})),t.clear(),this.out=null,this.ils=new Map,this.inst=null},t.prototype.up=function(){for(var t=this.inst.arr,e=t.length,n=this.ils,o=Array(e),r=0;r<e;++r){var i=t[r]._key;if(!n.has(i))return;var s=n.get(i).val;if(s===Ct)return;o[r]=s}this.out._n(o)},t.prototype._n=function(t){this.inst=t;var e=t.arr,n=this.ils,o=this.out,r=this.sel,i=t.dict,s=e.length,a=!1;if(n.forEach((function(t,e){i.has(e)||(t.ins._remove(t),t.ins=null,t.out=null,t.val=null,n.delete(e),a=!0)})),0!==s){for(var c=0;c<s;++c){var u=e[c],l=u._key;if(!u[r])throw new Error("pickCombine found an undefined child sink stream");var p=ae.fromObservable(u[r]);n.has(l)||(n.set(l,new xe(l,o,this,p)),p._add(n.get(l)))}a&&this.up()}else o._n([])},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){var t=this.out;null!==t&&t._c()},t}();var je=function(){return je=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},je.apply(this,arguments)},ke=function(){function t(t){this._instances$=t}return t.prototype.pickMerge=function(t){return pe(this._instances$.compose(function(t){return function(e){return new oe(new $e(t,e))}}(t)))},t.prototype.pickCombine=function(t){return pe(this._instances$.compose(function(t){return function(e){return new oe(new De(t,e))}}(t)))},t}();function Le(t){return{"*":null}}function Ie(t,e){return{get:function(n){if(void 0!==n)for(var o=0,r=n.length;o<r;++o)if(""+t(n[o],o)===e)return n[o]},set:function(n,o){return void 0===n?[o]:void 0===o?n.filter((function(n,o){return""+t(n,o)!==e})):n.map((function(n,r){return""+t(n,r)===e?o:n}))}}}var Me={get:function(t){return t},set:function(t,e){return e}};var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});var Re=o,Fe=function(){function t(t){this.streams=t,this.type="concat",this.out=null,this.i=0}return t.prototype._start=function(t){this.out=t,this.streams[this.i]._add(this)},t.prototype._stop=function(){var t=this.streams;this.i<t.length&&t[this.i]._remove(this),this.i=0,this.out=null},t.prototype._n=function(t){var e=this.out;e&&e._n(t)},t.prototype._e=function(t){var e=this.out;e&&e._e(t)},t.prototype._c=function(){var t=this.out;if(t){var e=this.streams;e[this.i]._remove(this),++this.i<e.length?e[this.i]._add(this):t._c()}},t}();var Ge=Pe.default=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Re.Stream(new Fe(t))},Be=e({__proto__:null,default:Ge},[Pe]),Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});var He=Ue.default=function(){return"undefined"!=typeof queueMicrotask?queueMicrotask:"undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof process?process.nextTick:setTimeout},Ve=He();function Ye(t){if(We(t)){for(;t&&We(t);){t=qe(t).parent}return null!=t?t:null}return t.parentNode}function We(t){return 11===t.nodeType}function qe(t,e){var n,o,r;const i=t;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=e?e:null),null!==(o=i.firstChildNode)&&void 0!==o||(i.firstChildNode=t.firstChild),null!==(r=i.lastChildNode)&&void 0!==r||(i.lastChildNode=t.lastChild),i}const ze={createElement:function(t,e){return document.createElement(t,e)},createElementNS:function(t,e,n){return document.createElementNS(t,e,n)},createTextNode:function(t){return document.createTextNode(t)},createDocumentFragment:function(){return qe(document.createDocumentFragment())},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){if(We(t)){let e=t;for(;e&&We(e);){e=qe(e).parent}t=null!=e?e:t}We(e)&&(e=qe(e,t)),n&&We(n)&&(n=qe(n).firstChildNode),t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){We(e)&&(e=qe(e,t)),t.appendChild(e)},parentNode:Ye,nextSibling:function(t){var e;if(We(t)){const n=qe(t),o=Ye(n);if(o&&n.lastChildNode){const t=Array.from(o.childNodes),r=t.indexOf(n.lastChildNode);return null!==(e=t[r+1])&&void 0!==e?e:null}return null}return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},getTextContent:function(t){return t.textContent},isElement:function(t){return 1===t.nodeType},isText:function(t){return 3===t.nodeType},isComment:function(t){return 8===t.nodeType},isDocumentFragment:We};function Je(t,e,n,o,r){return{sel:t,data:e,children:n,text:o,elm:r,key:void 0===e?void 0:e.key}}const Ze=Array.isArray;function Xe(t){return"string"==typeof t||"number"==typeof t||t instanceof String||t instanceof Number}function Ke(t){return void 0===t}function Qe(t){return void 0!==t}const tn=Je("",{},[],void 0,void 0);function en(t,e){var n,o;const r=t.key===e.key,i=(null===(n=t.data)||void 0===n?void 0:n.is)===(null===(o=e.data)||void 0===o?void 0:o.is),s=t.sel===e.sel,a=!(!t.sel&&t.sel===e.sel)||typeof t.text==typeof e.text;return s&&r&&i&&a}function nn(){throw new Error("The document fragment is not supported on this platform.")}function on(t,e,n){var o;const r={};for(let i=e;i<=n;++i){const e=null===(o=t[i])||void 0===o?void 0:o.key;void 0!==e&&(r[e]=i)}return r}const rn=["create","update","remove","destroy","pre","post"];function sn(t,e,n){const o={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=void 0!==e?e:ze;for(const e of rn)for(const n of t){const t=n[e];void 0!==t&&o[e].push(t)}function i(t){const e=t.id?"#"+t.id:"",n=t.getAttribute("class"),o=n?"."+n.split(" ").join("."):"";return Je(r.tagName(t).toLowerCase()+e+o,{},[],void 0,t)}function s(t){return Je(void 0,{},[],void 0,t)}function a(t,e){return function(){if(0==--e){const e=r.parentNode(t);r.removeChild(e,t)}}}function c(t,e){var i,s,a,u;let l,p=t.data;if(void 0!==p){const e=null===(i=p.hook)||void 0===i?void 0:i.init;Qe(e)&&(e(t),p=t.data)}const f=t.children,h=t.sel;if("!"===h)Ke(t.text)&&(t.text=""),t.elm=r.createComment(t.text);else if(void 0!==h){const n=h.indexOf("#"),i=h.indexOf(".",n),a=n>0?n:h.length,u=i>0?i:h.length,d=-1!==n||-1!==i?h.slice(0,Math.min(a,u)):h,m=t.elm=Qe(p)&&Qe(l=p.ns)?r.createElementNS(l,d,p):r.createElement(d,p);for(a<u&&m.setAttribute("id",h.slice(a+1,u)),i>0&&m.setAttribute("class",h.slice(u+1).replace(/\./g," ")),l=0;l<o.create.length;++l)o.create[l](tn,t);if(Ze(f))for(l=0;l<f.length;++l){const t=f[l];null!=t&&r.appendChild(m,c(t,e))}else Xe(t.text)&&r.appendChild(m,r.createTextNode(t.text));const y=t.data.hook;Qe(y)&&(null===(s=y.create)||void 0===s||s.call(y,tn,t),y.insert&&e.push(t))}else if((null===(a=null==n?void 0:n.experimental)||void 0===a?void 0:a.fragments)&&t.children){for(t.elm=(null!==(u=r.createDocumentFragment)&&void 0!==u?u:nn)(),l=0;l<o.create.length;++l)o.create[l](tn,t);for(l=0;l<t.children.length;++l){const n=t.children[l];null!=n&&r.appendChild(t.elm,c(n,e))}}else t.elm=r.createTextNode(t.text);return t.elm}function u(t,e,n,o,i,s){for(;o<=i;++o){const i=n[o];null!=i&&r.insertBefore(t,c(i,s),e)}}function l(t){var e,n;const r=t.data;if(void 0!==r){null===(n=null===(e=null==r?void 0:r.hook)||void 0===e?void 0:e.destroy)||void 0===n||n.call(e,t);for(let e=0;e<o.destroy.length;++e)o.destroy[e](t);if(void 0!==t.children)for(let e=0;e<t.children.length;++e){const n=t.children[e];null!=n&&"string"!=typeof n&&l(n)}}}function p(t,e,n,i){for(var s,c;n<=i;++n){let i,u;const f=e[n];if(null!=f)if(Qe(f.sel)){l(f),i=o.remove.length+1,u=a(f.elm,i);for(let t=0;t<o.remove.length;++t)o.remove[t](f,u);const t=null===(c=null===(s=null==f?void 0:f.data)||void 0===s?void 0:s.hook)||void 0===c?void 0:c.remove;Qe(t)?t(f,u):u()}else f.children?(l(f),p(t,f.children,0,f.children.length-1)):r.removeChild(t,f.elm)}}function f(t,e,n){var i,s,a,l,h,d,m,y;const v=null===(i=e.data)||void 0===i?void 0:i.hook;null===(s=null==v?void 0:v.prepatch)||void 0===s||s.call(v,t,e);const _=e.elm=t.elm;if(t===e)return;if(void 0!==e.data||Qe(e.text)&&e.text!==t.text){null!==(a=e.data)&&void 0!==a||(e.data={}),null!==(l=t.data)&&void 0!==l||(t.data={});for(let n=0;n<o.update.length;++n)o.update[n](t,e);null===(m=null===(d=null===(h=e.data)||void 0===h?void 0:h.hook)||void 0===d?void 0:d.update)||void 0===m||m.call(d,t,e)}const g=t.children,b=e.children;Ke(e.text)?Qe(g)&&Qe(b)?g!==b&&function(t,e,n,o){let i,s,a,l,h=0,d=0,m=e.length-1,y=e[0],v=e[m],_=n.length-1,g=n[0],b=n[_];for(;h<=m&&d<=_;)null==y?y=e[++h]:null==v?v=e[--m]:null==g?g=n[++d]:null==b?b=n[--_]:en(y,g)?(f(y,g,o),y=e[++h],g=n[++d]):en(v,b)?(f(v,b,o),v=e[--m],b=n[--_]):en(y,b)?(f(y,b,o),r.insertBefore(t,y.elm,r.nextSibling(v.elm)),y=e[++h],b=n[--_]):en(v,g)?(f(v,g,o),r.insertBefore(t,v.elm,y.elm),v=e[--m],g=n[++d]):(void 0===i&&(i=on(e,h,m)),s=i[g.key],Ke(s)?r.insertBefore(t,c(g,o),y.elm):(a=e[s],a.sel!==g.sel?r.insertBefore(t,c(g,o),y.elm):(f(a,g,o),e[s]=void 0,r.insertBefore(t,a.elm,y.elm))),g=n[++d]);d<=_&&(l=null==n[_+1]?null:n[_+1].elm,u(t,l,n,d,_,o)),h<=m&&p(t,e,h,m)}(_,g,b,n):Qe(b)?(Qe(t.text)&&r.setTextContent(_,""),u(_,null,b,0,b.length-1,n)):Qe(g)?p(_,g,0,g.length-1):Qe(t.text)&&r.setTextContent(_,""):t.text!==e.text&&(Qe(g)&&p(_,g,0,g.length-1),r.setTextContent(_,e.text)),null===(y=null==v?void 0:v.postpatch)||void 0===y||y.call(v,t,e)}return function(t,e){let n,a,u;const l=[];for(n=0;n<o.pre.length;++n)o.pre[n]();for(!function(t,e){return t.isElement(e)}(r,t)?function(t,e){return t.isDocumentFragment(e)}(r,t)&&(t=s(t)):t=i(t),en(t,e)?f(t,e,l):(a=t.elm,u=r.parentNode(a),c(e,l),null!==u&&(r.insertBefore(u,e.elm,r.nextSibling(a)),p(u,[t],0,0))),n=0;n<l.length;++n)l[n].data.hook.insert(l[n]);for(n=0;n<o.post.length;++n)o.post[n]();return e}}function an(t,e,n){if(t.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==e)for(let t=0;t<e.length;++t){const n=e[t];if("string"==typeof n)continue;const o=n.data;void 0!==o&&an(o,n.children,n.sel)}}function cn(t,e,n){let o,r,i,s={};if(void 0!==n?(null!==e&&(s=e),Ze(n)?o=n:Xe(n)?r=n.toString():n&&n.sel&&(o=[n])):null!=e&&(Ze(e)?o=e:Xe(e)?r=e.toString():e&&e.sel?o=[e]:s=e),void 0!==o)for(i=0;i<o.length;++i)Xe(o[i])&&(o[i]=Je(void 0,void 0,void 0,o[i],void 0));return"s"!==t[0]||"v"!==t[1]||"g"!==t[2]||3!==t.length&&"."!==t[3]&&"#"!==t[3]||an(s,o,t),Je(t,s,o,r,void 0)}function un(t,e){const n=void 0!==e?e:ze;let o;if(n.isElement(t)){const o=t.id?"#"+t.id:"",r=t.getAttribute("class"),i=r?"."+r.split(" ").join("."):"",s=n.tagName(t).toLowerCase()+o+i,a={},c={},u={},l=[];let p,f,h;const d=t.attributes,m=t.childNodes;for(f=0,h=d.length;f<h;f++)p=d[f].nodeName,"d"===p[0]&&"a"===p[1]&&"t"===p[2]&&"a"===p[3]&&"-"===p[4]?c[p.slice(5)]=d[f].nodeValue||"":"id"!==p&&"class"!==p&&(a[p]=d[f].nodeValue);for(f=0,h=m.length;f<h;f++)l.push(un(m[f],e));return Object.keys(a).length>0&&(u.attrs=a),Object.keys(c).length>0&&(u.dataset=c),"s"!==s[0]||"v"!==s[1]||"g"!==s[2]||3!==s.length&&"."!==s[3]&&"#"!==s[3]||an(u,l,s),Je(s,u,l,void 0,t)}return n.isText(t)?(o=n.getTextContent(t),Je(void 0,void 0,void 0,o,t)):n.isComment(t)?(o=n.getTextContent(t),Je("!",{},[],o,t)):Je("",{},[],void 0,t)}function ln(t,e){let n;const o=e.elm;let r=t.data.attrs,i=e.data.attrs;if((r||i)&&r!==i){for(n in r=r||{},i=i||{},i){const t=i[n];r[n]!==t&&(!0===t?o.setAttribute(n,""):!1===t?o.removeAttribute(n):120!==n.charCodeAt(0)?o.setAttribute(n,t):58===n.charCodeAt(3)?o.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,t):58===n.charCodeAt(5)?o.setAttributeNS("http://www.w3.org/1999/xlink",n,t):o.setAttribute(n,t))}for(n in r)n in i||o.removeAttribute(n)}}const pn={create:ln,update:ln};function fn(t,e){let n,o;const r=e.elm;let i=t.data.class,s=e.data.class;if((i||s)&&i!==s){for(o in i=i||{},s=s||{},i)i[o]&&!Object.prototype.hasOwnProperty.call(s,o)&&r.classList.remove(o);for(o in s)n=s[o],n!==i[o]&&r.classList[n?"add":"remove"](o)}}const hn={create:fn,update:fn},dn=/[A-Z]/g;function mn(t,e){const n=e.elm;let o,r=t.data.dataset,i=e.data.dataset;if(!r&&!i)return;if(r===i)return;r=r||{},i=i||{};const s=n.dataset;for(o in r)i[o]||(s?o in s&&delete s[o]:n.removeAttribute("data-"+o.replace(dn,"-$&").toLowerCase()));for(o in i)r[o]!==i[o]&&(s?s[o]=i[o]:n.setAttribute("data-"+o.replace(dn,"-$&").toLowerCase(),i[o]))}const yn={create:mn,update:mn};function vn(t,e){let n,o,r;const i=e.elm;let s=t.data.props,a=e.data.props;if((s||a)&&s!==a)for(n in s=s||{},a=a||{},a)o=a[n],r=s[n],r===o||"value"===n&&i[n]===o||(i[n]=o)}const _n={create:vn,update:vn},gn="undefined"!=typeof window&&window.requestAnimationFrame.bind(window)||setTimeout,bn=function(t){gn((function(){gn(t)}))};let wn=!1;function Sn(t,e,n){bn((function(){t[e]=n}))}function An(t,e){let n,o;const r=e.elm;let i=t.data.style,s=e.data.style;if(!i&&!s)return;if(i===s)return;i=i||{},s=s||{};const a="delayed"in i;for(o in i)s[o]||("-"===o[0]&&"-"===o[1]?r.style.removeProperty(o):r.style[o]="");for(o in s)if(n=s[o],"delayed"===o&&s.delayed)for(const t in s.delayed)n=s.delayed[t],a&&n===i.delayed[t]||Sn(r.style,t,n);else"remove"!==o&&n!==i[o]&&("-"===o[0]&&"-"===o[1]?r.style.setProperty(o,n):r.style[o]=n)}const En={pre:function(){wn=!1},create:An,update:An,destroy:function(t){let e,n;const o=t.elm,r=t.data.style;if(r&&(e=r.destroy))for(n in e)o.style[n]=e[n]},remove:function(t,e){const n=t.data.style;if(!n||!n.remove)return void e();let o;wn||(t.elm.offsetLeft,wn=!0);const r=t.elm;let i=0;const s=n.remove;let a=0;const c=[];for(o in s)c.push(o),r.style[o]=s[o];const u=getComputedStyle(r)["transition-property"].split(", ");for(;i<u.length;++i)-1!==c.indexOf(u[i])&&a++;r.addEventListener("transitionend",(function(t){t.target===r&&--a,0===a&&e()}))}};function On(t,e){e.elm=t.elm,t.data.fn=e.data.fn,t.data.args=e.data.args,t.data.isolate=e.data.isolate,e.data=t.data,e.children=t.children,e.text=t.text,e.elm=t.elm}function Nn(t){var e=t.data;On(e.fn.apply(void 0,e.args),t)}function Cn(t,e){var n,o=t.data,r=e.data,i=o.args,s=r.args;for(o.fn===r.fn&&i.length===s.length||On(r.fn.apply(void 0,s),e),n=0;n<s.length;++n)if(i[n]!==s[n])return void On(r.fn.apply(void 0,s),e);On(t,e)}function Tn(t,e,n,o,r){void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r=!1);var i=null;return oe.create({start:function(s){i=o?function(t){xn(t,o),s.next(t)}:function(t){s.next(t)},t.addEventListener(e,i,{capture:n,passive:r})},stop:function(){t.removeEventListener(e,i,n),i=null}})}function $n(t,e){for(var n=Object.keys(t),o=n.length,r=0;r<o;r++){var i=n[r];if("object"==typeof t[i]&&"object"==typeof e[i]){if(!$n(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1}return!0}function xn(t,e){if(e)if("boolean"==typeof e)t.preventDefault();else if("function"==typeof e)e(t)&&t.preventDefault();else{if("object"!=typeof e)throw new Error("preventDefault has to be either a boolean, predicate function or object");$n(e,t)&&t.preventDefault()}}var Dn=function(){function t(t){this._name=t}return t.prototype.select=function(t){return this},t.prototype.elements=function(){var t=pe(ae.of([document]));return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(ae.of(document));return t._isCycleSource=this._name,t},t.prototype.events=function(t,e,n){var o;void 0===e&&(e={}),o=Tn(document,t,e.useCapture,e.preventDefault);var r=pe(o);return r._isCycleSource=this._name,r},t}(),jn=function(){function t(t){this._name=t}return t.prototype.select=function(t){return this},t.prototype.elements=function(){var t=pe(ae.of([document.body]));return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(ae.of(document.body));return t._isCycleSource=this._name,t},t.prototype.events=function(t,e,n){var o;void 0===e&&(e={}),o=Tn(document.body,t,e.useCapture,e.preventDefault);var r=pe(o);return r._isCycleSource=this._name,r},t}();function kn(t){if("string"!=typeof t&&(e=t,!("object"==typeof HTMLElement?e instanceof HTMLElement||e instanceof DocumentFragment:e&&"object"==typeof e&&null!==e&&(1===e.nodeType||11===e.nodeType)&&"string"==typeof e.nodeName)))throw new Error("Given container is not a DOM element neither a selector string.");var e}function Ln(t){for(var e="",n=t.length-1;n>=0&&"selector"===t[n].type;n--)e=t[n].scope+" "+e;return e.trim()}function In(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].type!==e[n].type||t[n].scope!==e[n].scope)return!1;return!0}var Mn=function(){function t(t,e){this.namespace=t,this.isolateModule=e,this._namespace=t.filter((function(t){return"selector"!==t.type}))}return t.prototype.isDirectlyInScope=function(t){var e=this.isolateModule.getNamespace(t);if(!e)return!1;if(this._namespace.length>e.length||!In(this._namespace,e.slice(0,this._namespace.length)))return!1;for(var n=this._namespace.length;n<e.length;n++)if("total"===e[n].type)return!1;return!0},t}();var Pn=function(){function t(t,e){this.namespace=t,this.isolateModule=e}return t.prototype.call=function(){var t=this.namespace,e=Ln(t),n=new Mn(t,this.isolateModule),o=this.isolateModule.getElement(t.filter((function(t){return"selector"!==t.type})));return void 0===o?[]:""===e?[o]:function(t){return Array.prototype.slice.call(t)}(o.querySelectorAll(e)).filter(n.isDirectlyInScope,n).concat(o.matches(e)?[o]:[])},t}(),Rn=function(){return Rn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Rn.apply(this,arguments)};function Fn(t){return{type:(e=t,e.length>1&&("."===e[0]||"#"===e[0])?"sibling":"total"),scope:t};var e}var Gn=function(){function t(e,n,o,r,i,s){var a;void 0===o&&(o=[]),this._rootElement$=e,this._sanitation$=n,this._namespace=o,this._isolateModule=r,this._eventDelegator=i,this._name=s,this.isolateSource=function(e,n){return new t(e._rootElement$,e._sanitation$,e._namespace.concat(Fn(n)),e._isolateModule,e._eventDelegator,e._name)},this.isolateSink=(a=this._namespace,function(t,e){return":root"===e?t:t.map((function(t){if(!t)return t;var n=Fn(e),o=Rn({},t,{data:Rn({},t.data,{isolate:t.data&&Array.isArray(t.data.isolate)?t.data.isolate:a.concat([n])})});return Rn({},o,{key:void 0!==o.key?o.key:JSON.stringify(o.data.isolate)})}))})}return t.prototype._elements=function(){if(0===this._namespace.length)return this._rootElement$.map((function(t){return[t]}));var t=new Pn(this._namespace,this._isolateModule);return this._rootElement$.map((function(){return t.call()}))},t.prototype.elements=function(){var t=pe(this._elements().remember());return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(this._elements().filter((function(t){return t.length>0})).map((function(t){return t[0]})).remember());return t._isCycleSource=this._name,t},Object.defineProperty(t.prototype,"namespace",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),t.prototype.select=function(e){if("string"!=typeof e)throw new Error("DOM driver's select() expects the argument to be a string as a CSS selector");if("document"===e)return new Dn(this._name);if("body"===e)return new jn(this._name);var n=":root"===e?[]:this._namespace.concat({type:"selector",scope:e.trim()});return new t(this._rootElement$,this._sanitation$,n,this._isolateModule,this._eventDelegator,this._name)},t.prototype.events=function(t,e,n){if(void 0===e&&(e={}),"string"!=typeof t)throw new Error("DOM driver's events() expects argument to be a string representing the event type to listen for.");var o=this._eventDelegator.addEventListener(t,this._namespace,e,n),r=pe(o);return r._isCycleSource=this._name,r},t.prototype.dispose=function(){this._sanitation$.shamefullySendNext(null)},t}(),Bn={},Un=n&&n.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,r++)o[r]=i[s];return o};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.SampleCombineOperator=Bn.SampleCombineListener=void 0;var Hn=o,Vn={},Yn=function(){function t(t,e){this.i=t,this.p=e,e.ils[t]=this}return t.prototype._n=function(t){var e=this.p;e.out!==Vn&&e.up(t,this.i)},t.prototype._e=function(t){this.p._e(t)},t.prototype._c=function(){this.p.down(this.i,this)},t}();Bn.SampleCombineListener=Yn;var Wn,qn=function(){function t(t,e){this.type="sampleCombine",this.ins=t,this.others=e,this.out=Vn,this.ils=[],this.Nn=0,this.vals=[]}return t.prototype._start=function(t){this.out=t;for(var e=this.others,n=this.Nn=e.length,o=this.vals=new Array(n),r=0;r<n;r++)o[r]=Vn,e[r]._add(new Yn(r,this));this.ins._add(this)},t.prototype._stop=function(){var t=this.others,e=t.length,n=this.ils;this.ins._remove(this);for(var o=0;o<e;o++)t[o]._remove(n[o]);this.out=Vn,this.vals=[],this.ils=[]},t.prototype._n=function(t){var e=this.out;e!==Vn&&(this.Nn>0||e._n(Un([t],this.vals)))},t.prototype._e=function(t){var e=this.out;e!==Vn&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Vn&&t._c()},t.prototype.up=function(t,e){var n=this.vals[e];this.Nn>0&&n===Vn&&this.Nn--,this.vals[e]=t},t.prototype.down=function(t,e){this.others[t]._remove(e)},t}();Bn.SampleCombineOperator=qn,Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return new Hn.Stream(new qn(e,t))}};var zn=Bn.default=Wn;function Jn(t){if(!t.sel)return{tagName:"",id:"",className:""};var e=t.sel,n=e.indexOf("#"),o=e.indexOf(".",n),r=n>0?n:e.length,i=o>0?o:e.length;return{tagName:-1!==n||-1!==o?e.slice(0,Math.min(r,i)):e,id:r<i?e.slice(r+1,i):void 0,className:o>0?e.slice(i+1).replace(/\./g," "):void 0}}Object.assign;var Zn=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()).Symbol;"function"==typeof Zn&&Zn("parent");var Xn=function(){function t(t){this.rootElement=t}return t.prototype.call=function(t){if(11===this.rootElement.nodeType)return this.wrapDocFrag(null===t?[]:[t]);if(null===t)return this.wrap([]);var e=Jn(t),n=e.tagName,o=e.id,r=function(t){var e=Jn(t).className,n=void 0===e?"":e;if(!t.data)return n;var o=t.data,r=o.class,i=o.props;return r&&(n+=" "+Object.keys(r).filter((function(t){return r[t]})).join(" ")),i&&i.className&&(n+=" "+i.className),n&&n.trim()}(t),i=((t.data||{}).props||{}).id,s=void 0===i?o:i;return"string"==typeof s&&s.toUpperCase()===this.rootElement.id.toUpperCase()&&n.toUpperCase()===this.rootElement.tagName.toUpperCase()&&r.toUpperCase()===this.rootElement.className.toUpperCase()?t:this.wrap([t])},t.prototype.wrapDocFrag=function(t){return Je("",{isolate:[]},t,void 0,this.rootElement)},t.prototype.wrap=function(t){var e=this.rootElement,n=e.tagName,o=e.id,r=e.className,i=o?"#"+o:"",s=r?"."+r.split(" ").join("."):"",a=cn(""+n.toLowerCase()+i+s,{},t);return a.data=a.data||{},a.data.isolate=a.data.isolate||[],a},t}(),Kn=[En,hn,_n,pn,yn],Qn=function(){function t(t){this.mapper=t,this.tree=[void 0,{}]}return t.prototype.set=function(t,e,n){for(var o=this.tree,r=void 0!==n?n:t.length,i=0;i<r;i++){var s=this.mapper(t[i]),a=o[1][s];a||(a=[void 0,{}],o[1][s]=a),o=a}o[0]=e},t.prototype.getDefault=function(t,e,n){return this.get(t,e,n)},t.prototype.get=function(t,e,n){for(var o=this.tree,r=void 0!==n?n:t.length,i=0;i<r;i++){var s=this.mapper(t[i]),a=o[1][s];if(!a){if(!e)return;a=[void 0,{}],o[1][s]=a}o=a}return e&&!o[0]&&(o[0]=e()),o[0]},t.prototype.delete=function(t){for(var e=this.tree,n=0;n<t.length-1;n++){var o=e[1][this.mapper(t[n])];if(!o)return;e=o}delete e[1][this.mapper(t[t.length-1])]},t}(),to=function(){function t(){this.namespaceTree=new Qn((function(t){return t.scope})),this.namespaceByElement=new Map,this.vnodesBeingRemoved=[]}return t.prototype.setEventDelegator=function(t){this.eventDelegator=t},t.prototype.insertElement=function(t,e){this.namespaceByElement.set(e,t),this.namespaceTree.set(t,e)},t.prototype.removeElement=function(t){this.namespaceByElement.delete(t);var e=this.getNamespace(t);e&&this.namespaceTree.delete(e)},t.prototype.getElement=function(t,e){return this.namespaceTree.get(t,void 0,e)},t.prototype.getRootElement=function(t){if(this.namespaceByElement.has(t))return t;for(var e=t;!this.namespaceByElement.has(e);){if(!(e=e.parentNode))return;if("HTML"===e.tagName)throw new Error("No root element found, this should not happen at all")}return e},t.prototype.getNamespace=function(t){var e=this.getRootElement(t);if(e)return this.namespaceByElement.get(e)},t.prototype.createModule=function(){var t=this;return{create:function(e,n){var o=n.elm,r=n.data,i=(void 0===r?{}:r).isolate;Array.isArray(i)&&t.insertElement(i,o)},update:function(e,n){var o=e.elm,r=e.data,i=void 0===r?{}:r,s=n.elm,a=n.data,c=void 0===a?{}:a,u=i.isolate,l=c.isolate;In(u,l)||Array.isArray(u)&&t.removeElement(o),Array.isArray(l)&&t.insertElement(l,s)},destroy:function(e){t.vnodesBeingRemoved.push(e)},remove:function(e,n){t.vnodesBeingRemoved.push(e),n()},post:function(){for(var e=t.vnodesBeingRemoved,n=e.length-1;n>=0;n--){var o=e[n],r=void 0!==o.data?o.data.isolation:void 0;void 0!==r&&t.removeElement(r),t.eventDelegator.removeElement(o.elm,r)}t.vnodesBeingRemoved=[]}}},t}(),eo=function(){function t(){this.arr=[],this.prios=[]}return t.prototype.add=function(t,e){for(var n=0;n<this.arr.length;n++)if(this.prios[n]<e)return this.arr.splice(n,0,t),void this.prios.splice(n,0,e);this.arr.push(t),this.prios.push(e)},t.prototype.forEach=function(t){for(var e=0;e<this.arr.length;e++)t(this.arr[e],e,this.arr)},t.prototype.delete=function(t){for(var e=0;e<this.arr.length;e++)if(this.arr[e]===t)return this.arr.splice(e,1),void this.prios.splice(e,1)},t}(),no=function(){return no=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},no.apply(this,arguments)},oo=["blur","canplay","canplaythrough","durationchange","emptied","ended","focus","load","loadeddata","loadedmetadata","mouseenter","mouseleave","pause","play","playing","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","unload","volumechange","waiting"],ro=function(){function t(t,e){var n=this;this.rootElement$=t,this.isolateModule=e,this.virtualListeners=new Qn((function(t){return t.scope})),this.nonBubblingListenersToAdd=new Set,this.virtualNonBubblingListener=[],this.isolateModule.setEventDelegator(this),this.domListeners=new Map,this.domListenersToAdd=new Map,this.nonBubblingListeners=new Map,t.addListener({next:function(t){n.origin!==t&&(n.origin=t,n.resetEventListeners(),n.domListenersToAdd.forEach((function(t,e){return n.setupDOMListener(e,t)})),n.domListenersToAdd.clear()),n.nonBubblingListenersToAdd.forEach((function(t){n.setupNonBubblingListener(t)}))}})}return t.prototype.addEventListener=function(t,e,n,o){var r,i=ae.never(),s=new Mn(e,this.isolateModule);if(void 0===o?-1===oo.indexOf(t):o)return this.domListeners.has(t)||this.setupDOMListener(t,!!n.passive),r=this.insertListener(i,s,t,n),i;var a=[];this.nonBubblingListenersToAdd.forEach((function(t){return a.push(t)}));for(var c=void 0,u=0,l=a.length,p=function(n){n[0];var o=n[1],r=n[2];return n[3],t===o&&In(r.namespace,e)};!c&&u<l;){var f=a[u];c=p(f)?f:c,u++}var h,d=c;if(d){var m=d[0];h=m}else{var y=new Pn(e,this.isolateModule);r=this.insertListener(i,s,t,n),d=[i,t,y,r],h=i,this.nonBubblingListenersToAdd.add(d),this.setupNonBubblingListener(d)}var v=this,_=null;return ae.create({start:function(t){_=h.subscribe(t)},stop:function(){d[0];var t=d[1],e=d[2];d[3],e.call().forEach((function(e){var n=e.subs;n&&n[t]&&(n[t].unsubscribe(),delete n[t])})),v.nonBubblingListenersToAdd.delete(d),_.unsubscribe()}})},t.prototype.removeElement=function(t,e){void 0!==e&&this.virtualListeners.delete(e);var n=[];this.nonBubblingListeners.forEach((function(e,o){if(e.has(t)){n.push([o,t]);var r=t.subs;r&&Object.keys(r).forEach((function(t){r[t].unsubscribe()}))}}));for(var o=0;o<n.length;o++){var r=this.nonBubblingListeners.get(n[o][0]);r&&(r.delete(n[o][1]),0===r.size?this.nonBubblingListeners.delete(n[o][0]):this.nonBubblingListeners.set(n[o][0],r))}},t.prototype.insertListener=function(t,e,n,o){var r=[],i=e._namespace,s=i.length;do{r.push(this.getVirtualListeners(n,i,!0,s)),s--}while(s>=0&&"total"!==i[s].type);for(var a=no({},o,{scopeChecker:e,subject:t,bubbles:!!o.bubbles,useCapture:!!o.useCapture,passive:!!o.passive}),c=0;c<r.length;c++)r[c].add(a,i.length);return a},t.prototype.getVirtualListeners=function(t,e,n,o){void 0===n&&(n=!1);var r=void 0!==o?o:e.length;if(!n)for(var i=r-1;i>=0;i--){if("total"===e[i].type){r=i+1;break}r=i}var s=this.virtualListeners.getDefault(e,(function(){return new Map}),r);return s.has(t)||s.set(t,new eo),s.get(t)},t.prototype.setupDOMListener=function(t,e){var n=this;if(this.origin){var o=Tn(this.origin,t,!1,!1,e).subscribe({next:function(o){return n.onEvent(t,o,e)},error:function(){},complete:function(){}});this.domListeners.set(t,{sub:o,passive:e})}else this.domListenersToAdd.set(t,e)},t.prototype.setupNonBubblingListener=function(t){t[0];var e=t[1],n=t[2],o=t[3];if(this.origin){var r=n.call();if(r.length){var i=this;r.forEach((function(t){var n,r=t.subs;if(!r||!r[e]){var s=Tn(t,e,!1,!1,o.passive).subscribe({next:function(t){return i.onEvent(e,t,!!o.passive,!1)},error:function(){},complete:function(){}});i.nonBubblingListeners.has(e)||i.nonBubblingListeners.set(e,new Map);var a=i.nonBubblingListeners.get(e);if(!a)return;a.set(t,{sub:s,destination:o}),t.subs=no({},r,((n={})[e]=s,n))}}))}}},t.prototype.resetEventListeners=function(){for(var t=this.domListeners.entries(),e=t.next();!e.done;){var n=e.value,o=n[0],r=n[1],i=r.sub,s=r.passive;i.unsubscribe(),this.setupDOMListener(o,s),e=t.next()}},t.prototype.putNonBubblingListener=function(t,e,n,o){var r=this.nonBubblingListeners.get(t);if(r){var i=r.get(e);i&&i.destination.passive===o&&i.destination.useCapture===n&&(this.virtualNonBubblingListener[0]=i.destination)}},t.prototype.onEvent=function(t,e,n,o){void 0===o&&(o=!0);var r=this.patchEvent(e),i=this.isolateModule.getRootElement(e.target);if(o){var s=this.isolateModule.getNamespace(e.target);if(!s)return;var a=this.getVirtualListeners(t,s);this.bubble(t,e.target,i,r,a,s,s.length-1,!0,n),this.bubble(t,e.target,i,r,a,s,s.length-1,!1,n)}else this.putNonBubblingListener(t,e.target,!0,n),this.doBubbleStep(t,e.target,i,r,this.virtualNonBubblingListener,!0,n),this.putNonBubblingListener(t,e.target,!1,n),this.doBubbleStep(t,e.target,i,r,this.virtualNonBubblingListener,!1,n),e.stopPropagation()},t.prototype.bubble=function(t,e,n,o,r,i,s,a,c){a||o.propagationHasBeenStopped||this.doBubbleStep(t,e,n,o,r,a,c);var u=n,l=s;if(e===n){if(!(s>=0&&"sibling"===i[s].type))return;u=this.isolateModule.getElement(i,s),l--}e.parentNode&&u&&this.bubble(t,e.parentNode,u,o,r,i,l,a,c),a&&!o.propagationHasBeenStopped&&this.doBubbleStep(t,e,n,o,r,a,c)},t.prototype.doBubbleStep=function(t,e,n,o,r,i,s){n&&(this.mutateEventCurrentTarget(o,e),r.forEach((function(t){if(t.passive===s&&t.useCapture===i){var r=Ln(t.scopeChecker.namespace);!o.propagationHasBeenStopped&&t.scopeChecker.isDirectlyInScope(e)&&(""!==r&&e.matches(r)||""===r&&e===n)&&(xn(o,t.preventDefault),t.subject.shamefullySendNext(o))}})))},t.prototype.patchEvent=function(t){var e=t;e.propagationHasBeenStopped=!1;var n=e.stopPropagation;return e.stopPropagation=function(){n.call(this),this.propagationHasBeenStopped=!0},e},t.prototype.mutateEventCurrentTarget=function(t,e){try{Object.defineProperty(t,"currentTarget",{value:e,configurable:!0})}catch(t){console.log("please use event.ownerTarget")}t.ownerTarget=e},t}();function io(t){return ae.merge(t,ae.never())}function so(t){return t.elm}function ao(t){(console.error||console.log)(t)}function co(t,e){void 0===e&&(e={}),kn(t);var n=e.modules||Kn;!function(t){if(!Array.isArray(t))throw new Error("Optional modules option must be an array for snabbdom modules")}(n);var o,r,i=new to,s=e&&e.snabbdomOptions||void 0,a=sn([i.createModule()].concat(n),void 0,s),c=ae.create({start:function(t){"loading"===document.readyState?document.addEventListener("readystatechange",(function(){var e=document.readyState;"interactive"!==e&&"complete"!==e||(t.next(null),t.complete())})):(t.next(null),t.complete())},stop:function(){}}),u=ae.create({start:function(t){r=new MutationObserver((function(){return t.next(null)}))},stop:function(){r.disconnect()}});return function(n,s){void 0===s&&(s="DOM"),function(t){if(!t||"function"!=typeof t.addListener||"function"!=typeof t.fold)throw new Error("The DOM driver function expects as input a Stream of virtual DOM elements")}(n);var l=ae.create(),p=c.map((function(){var e=function(t){var e="string"==typeof t?document.querySelector(t):t;if("string"==typeof t&&null===e)throw new Error("Cannot render into unknown element `"+t+"`");return e}(t)||document.body;return o=new Xn(e),e})),f=n.remember();f.addListener({}),u.addListener({});var h=p.map((function(t){return ae.merge(f.endWhen(l),l).map((function(t){return o.call(t)})).startWith(function(t){return t.data=t.data||{},t.data.isolate=[],t}(un(t))).fold(a,un(t)).drop(1).map(so).startWith(t).map((function(t){return r.observe(t,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!0,characterDataOldValue:!0}),t})).compose(io)})).flatten(),d=Ge(c,u).endWhen(l).compose(zn(h)).map((function(t){return t[1]})).remember();d.addListener({error:e.reportSnabbdomError||ao});var m=new ro(d,i);return new Gn(d,l,[],i,m,s)}}var uo="___",lo=function(){function t(t){this._mockConfig=t,t.elements?this._elements=t.elements:this._elements=pe(ae.empty())}return t.prototype.elements=function(){var t=this._elements;return t._isCycleSource="MockedDOM",t},t.prototype.element=function(){var t=this.elements().filter((function(t){return t.length>0})).map((function(t){return t[0]})).remember(),e=pe(t);return e._isCycleSource="MockedDOM",e},t.prototype.events=function(t,e,n){var o=this._mockConfig[t],r=pe(o||ae.empty());return r._isCycleSource="MockedDOM",r},t.prototype.select=function(e){return new t(this._mockConfig[e]||{})},t.prototype.isolateSource=function(t,e){return t.select("."+uo+e)},t.prototype.isolateSink=function(t,e){return pe(ae.fromObservable(t).map((function(t){return t.sel&&-1!==t.sel.indexOf(uo+e)||(t.sel+="."+uo+e),t})))},t}();function po(t){return function(t){return"string"==typeof t&&t.length>0}(t)&&("."===t[0]||"#"===t[0])}function fo(t){return function(e,n,o){var r=void 0!==e,i=void 0!==n,s=void 0!==o;return po(e)?i&&s?cn(t+e,n,o):cn(t+e,i?n:{}):s?cn(t+e,n,o):i?cn(t,e,n):cn(t,r?e:{})}}var ho=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","colorProfile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotlight","feTile","feTurbulence","filter","font","fontFace","fontFaceFormat","fontFaceName","fontFaceSrc","fontFaceUri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missingGlyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],mo=fo("svg");ho.forEach((function(t){mo[t]=fo(t)}));var yo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","meta","nav","noscript","object","ol","optgroup","option","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","u","ul","video"],vo={SVG_TAG_NAMES:ho,TAG_NAMES:yo,svg:mo,isSelector:po,createTagFunction:fo};yo.forEach((function(t){vo[t]=fo(t)}));var _o=vo.svg,go=vo.a,bo=vo.abbr,wo=vo.address,So=vo.area,Ao=vo.article,Eo=vo.aside,Oo=vo.audio,No=vo.b,Co=vo.base,To=vo.bdi,$o=vo.bdo,xo=vo.blockquote,Do=vo.body,jo=vo.br,ko=vo.button,Lo=vo.canvas,Io=vo.caption,Mo=vo.cite,Po=vo.code,Ro=vo.col,Fo=vo.colgroup,Go=vo.dd,Bo=vo.del,Uo=vo.dfn,Ho=vo.dir,Vo=vo.div,Yo=vo.dl,Wo=vo.dt,qo=vo.em,zo=vo.embed,Jo=vo.fieldset,Zo=vo.figcaption,Xo=vo.figure,Ko=vo.footer,Qo=vo.form,tr=vo.h1,er=vo.h2,nr=vo.h3,or=vo.h4,rr=vo.h5,ir=vo.h6,sr=vo.head,ar=vo.header,cr=vo.hgroup,ur=vo.hr,lr=vo.html,pr=vo.i,fr=vo.iframe,hr=vo.img,dr=vo.input,mr=vo.ins,yr=vo.kbd,vr=vo.keygen,_r=vo.label,gr=vo.legend,br=vo.li,wr=vo.link,Sr=vo.main,Ar=vo.map,Er=vo.mark,Or=vo.menu,Nr=vo.meta,Cr=vo.nav,Tr=vo.noscript,$r=vo.object,xr=vo.ol,Dr=vo.optgroup,jr=vo.option,kr=vo.p,Lr=vo.param,Ir=vo.pre,Mr=vo.progress,Pr=vo.q,Rr=vo.rp,Fr=vo.rt,Gr=vo.ruby,Br=vo.s,Ur=vo.samp,Hr=vo.script,Vr=vo.section,Yr=vo.select,Wr=vo.small,qr=vo.source,zr=vo.span,Jr=vo.strong,Zr=vo.style,Xr=vo.sub,Kr=vo.sup,Qr=vo.table,ti=vo.tbody,ei=vo.td,ni=vo.textarea,oi=vo.tfoot,ri=vo.th,ii=vo.thead,si=vo.title,ai=vo.tr,ci=vo.u,ui=vo.ul,li=vo.video;let pi=0;function fi(t,e,n={}){if("function"!=typeof t)throw new Error("collection: first argument (component) must be a function");const{combineList:o=["DOM"],globalList:r=["EVENTS"],stateSourceName:i="STATE",domSourceName:s="DOM",container:a="div",containerClass:c}=n;return n=>{const u="sygnal-collection-"+pi++,l={item:t,itemKey:(t,e)=>void 0!==t.id?t.id:e,itemScope:t=>t,channel:i,collectSinks:t=>Object.entries(n).reduce(((e,[n,r])=>{if(o.includes(n)){const o=t.pickCombine(n);n===s&&a?e[s]=o.map((t=>({sel:a,data:c?{props:{className:c}}:{},children:t,key:u,text:void 0,elm:void 0}))):e[n]=o}else e[n]=t.pickMerge(n);return e}),{})},p={[i]:e};return r.forEach((t=>p[t]=null)),o.forEach((t=>p[t]=null)),function(t,e,n){return de(function(t){return function(e){var n=t.channel||"state",o=t.itemKey,r=t.itemScope||Le,i=ae.fromObservable(e[n].stream).fold((function(i,s){var a,c,u,l,p,f=i.dict;if(Array.isArray(s)){for(var h=Array(s.length),d=new Set,m=0,y=s.length;m<y;++m){var v=""+(o?o(s[m],m):m);if(d.add(v),f.has(v))h[m]=f.get(v);else{var _=o?Ie(o,v):""+m,g="string"==typeof(p=r(v))?((a={"*":p})[n]=_,a):je({},p,((c={})[n]=_,c)),b=de(t.itemFactory?t.itemFactory(s[m],m):t.item,g)(e);f.set(v,b),h[m]=b}h[m]._key=v}return f.forEach((function(t,e){d.has(e)||f.delete(e)})),d.clear(),{dict:f,arr:h}}return f.clear(),v=""+(o?o(s,0):"this"),_=Me,g="string"==typeof(p=r(v))?((u={"*":p})[n]=_,u):je({},p,((l={})[n]=_,l)),b=de(t.itemFactory?t.itemFactory(s,0):t.item,g)(e),f.set(v,b),{dict:f,arr:[b]}}),{dict:new Map,arr:[]});return t.collectSinks(new ke(i))}}(t),e)(n)}(l,p,n)}}const hi=t=>{const{children:e,...n}=t;return cn("collection",{props:n},e)};function di(t){return t&&t.default&&t.default.default&&"function"==typeof t.default.default?t.default.default:t&&t.default?t.default:t}hi.label="collection",hi.preventInstantiation=!0;const mi=function(t){const e=di(t);return e&&e.default&&"function"==typeof e.default.create?e.default:e}(ce),yi=oe||ae&&ae.Stream||mi&&mi.Stream,vi=di(we);function _i(t,e,n,o={}){const{switched:r=["DOM"],stateSourceName:i="STATE"}=o,s=typeof e;if(!e)throw new Error("Missing 'name$' parameter for switchable()");if(!("string"===s||"function"===s||e instanceof yi))throw new Error("Invalid 'name$' parameter for switchable(): expects Stream, String, or Function");if(e instanceof yi){const o=e.compose(vi()).startWith(n).remember();return e=>gi(t,e,o,r)}{const o="function"===s&&e||(t=>t[e]);return e=>{const s=e&&("string"==typeof i&&e[i]||e.STATE||e.state).stream;if(!(s instanceof yi))throw new Error(`Could not find the state source: ${i}`);const a=s.map(o).filter((t=>"string"==typeof t)).compose(vi()).startWith(n).remember();return gi(t,e,a,r,i)}}}function gi(t,e,n,o=["DOM"],r="STATE"){"string"==typeof o&&(o=[o]);const i=Object.entries(t).map((([t,o])=>{if(e[r]){const i=e[r].stream,s=mi.combine(n,i).filter((([e,n])=>e==t)).map((([t,e])=>e)).remember(),a=new e[r].constructor(s,e[r]._name);return[t,o({...e,state:a})]}return[t,o(e)]}));return Object.keys(e).reduce(((t,e)=>{if(o.includes(e))t[e]=n.map((t=>{const n=i.find((([e,n])=>e===t));return n&&n[1][e]||mi.never()})).flatten().remember().startWith(void 0);else{const n=i.filter((([t,n])=>void 0!==n[e])).map((([t,n])=>n[e]));t[e]=mi.merge(...n)}return t}),{})}const bi=t=>{const{children:e,...n}=t;return cn("switchable",{props:n},e)};bi.label="switchable",bi.preventInstantiation=!0;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});var Si=o,Ai=function(){function t(t,e){this.dt=t,this.ins=e,this.type="delay",this.out=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null},t.prototype._n=function(t){var e=this.out;if(e)var n=setInterval((function(){e._n(t),clearInterval(n)}),this.dt)},t.prototype._e=function(t){var e=this.out;if(e)var n=setInterval((function(){e._e(t),clearInterval(n)}),this.dt)},t.prototype._c=function(){var t=this.out;if(t)var e=setInterval((function(){t._c(),clearInterval(e)}),this.dt)},t}();var Ei=wi.default=function(t){return function(e){return new Si.Stream(new Ai(t,e))}},Oi=e({__proto__:null,default:Ei},[wi]),Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});var Ci=o,Ti=function(){function t(t,e){this.dt=t,this.ins=e,this.type="debounce",this.out=null,this.id=null,this.t=Ci.NO}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.clearInterval()},t.prototype.clearInterval=function(){var t=this.id;null!==t&&clearInterval(t),this.id=null},t.prototype._n=function(t){var e=this,n=this.out;n&&(this.clearInterval(),this.t=t,this.id=setInterval((function(){e.clearInterval(),n._n(t),e.t=Ci.NO}),this.dt))},t.prototype._e=function(t){var e=this.out;e&&(this.clearInterval(),e._e(t))},t.prototype._c=function(){var t=this.out;t&&(this.clearInterval(),this.t!=Ci.NO&&t._n(this.t),this.t=Ci.NO,t._c())},t}();var $i=Ni.default=function(t){return function(e){return new Ci.Stream(new Ti(t,e))}},xi=e({__proto__:null,default:$i},[Ni]);const Di=di(Oi),ji=di(Be),ki=di(xi),Li=di(we),Ii="undefined"!=typeof window&&window||process&&process.env||{},Mi="BOOTSTRAP",Pi="INITIALIZE",Ri="PARENT";let Fi=0;const Gi=Symbol("ABORT");function Bi(t,e){if("function"==typeof e)return{fn:e,deps:null};if(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&"function"==typeof e[1])return{fn:e[1],deps:e[0]};throw new Error(`Invalid calculated field '${t}': expected a function or [depsArray, function]`)}function Ui(t){const{name:e,sources:n,isolateOpts:o,stateSourceName:r="STATE"}=t;if(n&&!Zi(n))throw new Error(`[${e}] Sources must be a Cycle.js sources object`);let i;i="string"==typeof o?{[r]:o}:!0===o?{}:o;const s=void 0===n;let a;if(Zi(i)){const e=e=>{const n={...t,sources:e};return new Hi(n).sinks};a=s?de(e,i):de(e,i)(n)}else a=s?e=>new Hi({...t,sources:e}).sinks:new Hi(t).sinks;return a.componentName=e,a.isSygnalComponent=!0,a}class Hi{constructor({name:t="NO NAME",sources:e,intent:n,model:o,hmrActions:r,context:i,response:s,view:a,peers:c={},components:u={},initialState:l,calculated:p,storeCalculatedInState:f=!0,DOMSourceName:h="DOM",stateSourceName:d="STATE",requestSourceName:m="HTTP",debug:y=!1}){if(!e||!Zi(e))throw new Error(`[${t}] Missing or invalid sources`);if(this._componentNumber=Fi++,this.name=t,this.sources=e,this.intent=n,this.model=o,this.hmrActions=r,this.context=i,this.response=s,this.view=a,this.peers=c,this.components=u,this.initialState=l,this.calculated=p,this.storeCalculatedInState=f,this.DOMSourceName=h,this.stateSourceName=d,this.requestSourceName=m,this.sourceNames=Object.keys(e),this._debug=y,this.calculated&&this.initialState&&Zi(this.calculated)&&Zi(this.initialState))for(const e of Object.keys(this.calculated))e in this.initialState&&console.warn(`[${t}] Calculated field '${e}' shadows a key in initialState. The initialState value will be overwritten on every state update.`);if(this.calculated&&Zi(this.calculated)){const e=Object.entries(this.calculated);this._calculatedNormalized={};for(const[t,n]of e)this._calculatedNormalized[t]=Bi(t,n);this._calculatedFieldNames=new Set(Object.keys(this._calculatedNormalized));for(const[e,{deps:n}]of Object.entries(this._calculatedNormalized))if(null!==n)for(const o of n)this._calculatedFieldNames.has(o)||!this.initialState||o in this.initialState||console.warn(`[${t}] Calculated field '${e}' declares dependency '${o}' which is not in initialState or calculated fields`);const n={};for(const[t,{deps:e}]of Object.entries(this._calculatedNormalized))n[t]=null===e?[]:e.filter((t=>this._calculatedFieldNames.has(t)));const o={},r={};for(const t of this._calculatedFieldNames)o[t]=0,r[t]=[];for(const[t,e]of Object.entries(n)){o[t]=e.length;for(const n of e)r[n].push(t)}const i=[];for(const[t,e]of Object.entries(o))0===e&&i.push(t);const s=[];for(;i.length>0;){const t=i.shift();s.push(t);for(const e of r[t])o[e]--,0===o[e]&&i.push(e)}if(s.length!==this._calculatedFieldNames.size){const t=[...this._calculatedFieldNames].filter((t=>!s.includes(t))),e=new Set,o=[],r=i=>{if(e.has(i))return o.push(i),!0;e.add(i),o.push(i);for(const e of n[i])if(t.includes(e)&&r(e))return!0;return o.pop(),e.delete(i),!1};r(t[0]);const i=o[o.length-1],a=o.slice(o.indexOf(i));throw new Error(`Circular calculated dependency: ${a.join(" → ")}`)}this._calculatedOrder=s.map((t=>[t,this._calculatedNormalized[t]])),this._calculatedFieldCache={};for(const[t,{deps:e}]of this._calculatedOrder)null!==e&&(this._calculatedFieldCache[t]={lastDepValues:void 0,lastResult:void 0})}else this._calculatedOrder=null,this._calculatedNormalized=null,this._calculatedFieldNames=null,this._calculatedFieldCache=null;this.isSubComponent=this.sourceNames.includes("props$");const v=e[d]&&e[d].stream;v&&(this.currentState=l||{},this.sources[d]=new Ce(v.map((t=>(this.currentState=t,"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onStateChanged(this._componentNumber,this.name,t),t)))));const _=e.props$;_&&(this.sources.props$=_.map((t=>{const{sygnalFactory:e,sygnalOptions:n,...o}=t;return this.currentProps=o,t})));const g=e.children$;var b;if(g&&(this.sources.children$=g.map((t=>(this.currentChildren=t,t)))),this.sources[h]&&(this.sources[h]=(b=this.sources[h],new Proxy(b,{get:(t,e,n)=>"symbol"==typeof e||e in t?Reflect.get(t,e,n):n=>t.select(n).events(e)}))),this.isSubComponent||void 0!==this.intent||void 0!==this.model||(this.initialState=l||!0,this.intent=t=>({__NOOP_ACTION__:mi.never()}),this.model={__NOOP_ACTION__:t=>t}),this.addCalculated=this.createMemoizedAddCalculated(),this.log=function(t){return function(e,n=!1){const o="function"==typeof e?e:t=>e;if(!n)return e=>e.debug((e=>{if(this.debug){const n=`[${t}] ${o(e)}`;console.log(n),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onDebugLog(this._componentNumber,n)}}));if(this.debug){const n=`[${t}] ${o(e)}`;console.log(n),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onDebugLog(this._componentNumber,n)}}}(`${this._componentNumber} | ${t}`),this.initChildSources$(),this.initIntent$(),this.initHmrActions(),this.initAction$(),this.initState(),this.initContext(),this.initModel$(),this.initPeers$(),this.initSubComponentSink$(),this.initSubComponentsRendered$(),this.initVdom$(),this.initSinks(),this.sinks.__index=this._componentNumber,this.log("Instantiated",!0),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__){window.__SYGNAL_DEVTOOLS__.onComponentCreated(this._componentNumber,t,this);const n=e?.__parentComponentNumber;"number"==typeof n&&window.__SYGNAL_DEVTOOLS__.onSubComponentRegistered(n,this._componentNumber)}}get debug(){return this._debug||"true"===Ii.SYGNAL_DEBUG||!0===Ii.SYGNAL_DEBUG}initIntent$(){if(this.intent){if("function"!=typeof this.intent)throw new Error(`[${this.name}] Intent must be a function`);if(this.intent$=this.intent(this.sources),!(this.intent$ instanceof yi||Zi(this.intent$)))throw new Error(`[${this.name}] Intent must return either an action$ stream or map of event streams`)}}initHmrActions(){if(void 0!==this.hmrActions){if("string"==typeof this.hmrActions&&(this.hmrActions=[this.hmrActions]),!Array.isArray(this.hmrActions))throw new Error(`[${this.name}] hmrActions must be the name of an action or an array of names of actions to run when a component is hot-reloaded`);if(this.hmrActions.some((t=>"string"!=typeof t)))throw new Error(`[${this.name}] hmrActions must be the name of an action or an array of names of actions to run when a component is hot-reloaded`);this.hmrAction$=mi.fromArray(this.hmrActions.map((t=>({type:t}))))}else this.hmrAction$=mi.of().filter((t=>!1))}initAction$(){const t=this.sources&&this.sources[this.requestSourceName]||null;if(!this.intent$)return void(this.action$=mi.never());let e;if(this.intent$ instanceof yi)e=this.intent$;else{const t=Object.entries(this.intent$).map((([t,e])=>e.map((e=>({type:t,data:e})))));e=mi.merge(mi.never(),...t)}const n=e instanceof yi?e:e.apply&&e(this.sources)||mi.never(),o=mi.of({type:Mi}).compose(Di(10)),r=!0===window?.__SYGNAL_HMR_UPDATING?this.hmrAction$:mi.of().filter((t=>!1)),i=this.model[Mi]&&!0!==window?.__SYGNAL_HMR_UPDATING?ji(o,n):ji(mi.of().compose(Di(1)).filter((t=>!1)),r,n);let s;s=!0!==window?.__SYGNAL_HMR_UPDATING&&t&&"function"==typeof t.select?t.select("initial").flatten():mi.never();const a=s.map((t=>({type:"HYDRATE",data:t})));this.action$=mi.merge(i,a).compose(this.log((({type:t})=>`<${t}> Action triggered`))).map((t=>("undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onActionDispatched(this._componentNumber,this.name,t.type,t.data),t)))}initState(){void 0!==this.model&&(void 0===this.model[Pi]?this.model[Pi]={[this.stateSourceName]:(t,e)=>({...this.addCalculated(e)})}:Zi(this.model[Pi])&&Object.keys(this.model[Pi]).forEach((t=>{t!==this.stateSourceName&&(console.warn(`${Pi} can only be used with the ${this.stateSourceName} source... disregarding ${t}`),delete this.model[Pi][t])})))}initContext(){if(!this.context&&!this.sources.__parentContext$)return void(this.context$=mi.of({}));const t=this.sources[this.stateSourceName]?.stream.startWith({}).compose(Li(Ji))||mi.never(),e=this.sources.__parentContext$?.startWith({}).compose(Li(Ji))||mi.of({});this.context&&!Zi(this.context)&&console.error(`[${this.name}] Context must be an object mapping names to values of functions: ignoring provided ${typeof this.context}`),this.context$=mi.combine(t,e).map((([t,e])=>{const n=Zi(e)?e:{},o=Zi(this.context)?this.context:{},r=this.currentState,i={...n,...Object.entries(o).reduce(((t,e)=>{const[n,o]=e;let i;const s=typeof o;if("string"===s)i=r[o];else if("boolean"===s)i=r[n];else{if("function"!==s)return console.error(`[${this.name}] Invalid context entry '${n}': must be the name of a state property or a function returning a value to use`),t;i=o(r)}return t[n]=i,t}),{})};return this.currentContext=i,"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onContextChanged(this._componentNumber,this.name,i),i})).compose(Li(Ji)).startWith({}),this.context$.subscribe({next:t=>t,error:t=>console.error(`[${this.name}] Error in context stream:`,t)})}initModel$(){if(void 0===this.model)return void(this.model$=this.sourceNames.reduce(((t,e)=>(t[e]=mi.never(),t)),{}));const t=Ii?.__SYGNAL_HMR_STATE,e=void 0!==t?t:this.initialState,n={type:Pi,data:e};this.isSubComponent&&this.initialState&&console.warn(`[${this.name}] Initial state provided to sub-component. This will overwrite any state provided by the parent component.`);const o=void 0!==e&&(!0!==Ii?.__SYGNAL_HMR_UPDATING||void 0!==t)?ji(mi.of(n),this.action$).compose(Di(0)):this.action$,r=()=>this.makeOnAction(o,!0,this.action$),i=()=>this.makeOnAction(this.action$,!1,this.action$),s=Object.entries(this.model),a={};s.forEach((t=>{let[e,n]=t;if("function"==typeof n&&(n={[this.stateSourceName]:n}),!Zi(n))throw new Error(`[${this.name}] Entry for each action must be an object: ${e}`);Object.entries(n).forEach((t=>{const[n,o]=t,s=n===this.stateSourceName,c=n===Ri,u=s?r():i(),l=(c?u(e,o).map((t=>({name:this.name,value:t}))):u(e,o)).compose(this.log((t=>{if(s)return`<${e}> State reducer added`;if(c)return`<${e}> Data sent to parent component: ${JSON.stringify(t.value).replaceAll('"',"")}`;{const o=t&&(t.type||t.command||t.name||t.key||Array.isArray(t)&&"Array"||t);return`<${e}> Data sent to [${n}]: ${JSON.stringify(o).replaceAll('"',"")}`}})));Array.isArray(a[n])?a[n].push(l):a[n]=[l]}))}));const c=Object.entries(a).reduce(((t,e)=>{const[n,o]=e;return t[n]=mi.merge(mi.never(),...o),t}),{});this.model$=c}initPeers$(){const t=this.sourceNames.reduce(((t,e)=>(e==this.DOMSourceName?t[e]={}:t[e]=[],t)),{});this.peers$=Object.entries(this.peers).reduce(((t,[e,n])=>{const o=n(this.sources);return this.sourceNames.forEach((n=>{n==this.DOMSourceName?t[n][e]=o[n]:t[n].push(o[n])})),t}),t)}initChildSources$(){let t;const e=mi.create({start:e=>{t=e.next.bind(e)},stop:t=>{}}).map((t=>mi.merge(...t))).flatten();this.sources.CHILD={select:t=>{const n=e;return(t?n.filter((e=>e.name===t)):n).map((t=>t.value))}},this.newChildSources=e=>{"function"==typeof t&&t(e)}}initSubComponentSink$(){const t=mi.create({start:t=>{this.newSubComponentSinks=t.next.bind(t)},stop:t=>{}});t.subscribe({next:t=>t,error:t=>console.error(`[${this.name}] Error in sub-component sink stream:`,t)}),this.subComponentSink$=t.filter((t=>Object.keys(t).length>0))}initSubComponentsRendered$(){const t=mi.create({start:t=>{this.triggerSubComponentsRendered=t.next.bind(t)},stop:t=>{}});this.subComponentsRendered$=t.startWith(null)}initVdom$(){if("function"!=typeof this.view)return void(this.vdom$=mi.of(null));const t=this.collectRenderParameters();this.vdom$=t.map((t=>{const{props:e,state:n,children:o,context:r,...i}=t,{sygnalFactory:s,sygnalOptions:a,...c}=e||{};return this.view({...c,state:n,children:o,context:r,peers:i},n,r,i)})).compose(this.log("View rendered")).map((t=>t||{sel:"div",data:{},children:[]})).compose(this.instantiateSubComponents.bind(this)).filter((t=>void 0!==t)).compose(this.renderVdom.bind(this))}initSinks(){this.sinks=this.sourceNames.reduce(((t,e)=>{if(e==this.DOMSourceName)return t;const n=this.subComponentSink$&&e!==Ri?this.subComponentSink$.map((t=>t[e])).filter((t=>!!t)).flatten():mi.never();return e===this.stateSourceName?t[e]=mi.merge(this.model$[e]||mi.never(),n,this.sources[this.stateSourceName].stream.filter((t=>!1)),...this.peers$[e]||[]):t[e]=mi.merge(this.model$[e]||mi.never(),n,...this.peers$[e]||[]),t}),{}),this.sinks[this.DOMSourceName]=this.vdom$,this.sinks[Ri]=this.model$[Ri]||mi.never()}makeOnAction(t,e=!0,n){return n=n||t,(o,r)=>{const i=t.filter((({type:t})=>t==o));let s;if("function"==typeof r)s=i.map((t=>{const i=(t,e,r=10)=>{if("number"!=typeof r)throw new Error(`[${this.name}] Invalid delay value provided to next() function in model action '${o}'. Must be a number in ms.`);setTimeout((()=>{n.shamefullySendNext({type:t,data:e})}),r),this.log(`<${o}> Triggered a next() action: <${t}> ${r}ms delay`,!0)},s={...this.currentProps,children:this.currentChildren,context:this.currentContext};let a=t.data;if(e)return t=>{const e=this.isSubComponent?this.currentState:t,n=this.addCalculated(e);s.state=n;const o=r(n,a,i,s);return o===Gi?e:this.cleanupCalculated(o)};{const t=this.addCalculated(this.currentState);s.state=t;const e=r(t,a,i,s),n=typeof e;if(Zi(e)||["string","number","boolean","function"].includes(n))return e;if("undefined"===n)return console.warn(`[${this.name}] 'undefined' value sent to ${o}`),e;throw new Error(`[${this.name}] Invalid reducer type for action '${o}': ${n}`)}})).filter((t=>t!==Gi));else if(void 0===r||!0===r)s=i.map((({data:t})=>t));else{const t=r;s=i.mapTo(t)}return s}}createMemoizedAddCalculated(){let t,e;return function(n){if(!this.calculated||!Zi(n)||Array.isArray(n))return n;if(n===t)return e;if(!Zi(this.calculated))throw new Error(`[${this.name}] 'calculated' parameter must be an object mapping calculated state field names to functions`);const o=this.getCalculatedValues(n);if(!o)return t=n,e=n,n;const r={...n,...o};return t=n,e=r,r}}getCalculatedValues(t){if(!this._calculatedOrder||0===this._calculatedOrder.length)return;const e={...t},n={};for(const[t,{fn:o,deps:r}]of this._calculatedOrder)if(null!==r&&this._calculatedFieldCache){const i=this._calculatedFieldCache[t],s=r.map((t=>e[t]));if(void 0!==i.lastDepValues){let o=!0;for(let t=0;t<s.length;t++)if(s[t]!==i.lastDepValues[t]){o=!1;break}if(o){n[t]=i.lastResult,e[t]=i.lastResult;continue}}try{const r=o(e);i.lastDepValues=s,i.lastResult=r,n[t]=r,e[t]=r}catch(e){console.warn(`Calculated field '${t}' threw an error during calculation: ${e.message}`)}}else try{const r=o(e);n[t]=r,e[t]=r}catch(e){console.warn(`Calculated field '${t}' threw an error during calculation: ${e.message}`)}return n}cleanupCalculated(t){if(!t||!Zi(t)||Array.isArray(t))return t;const e={...this.storeCalculatedInState?this.addCalculated(t):t};if(!this.calculated||this.storeCalculatedInState)return e;return Object.keys(this.calculated).forEach((t=>{this.initialState&&void 0!==this.initialState[t]?e[t]=this.initialState[t]:delete e[t]})),e}collectRenderParameters(){const t=this.sources[this.stateSourceName],e={...this.peers$[this.DOMSourceName]},n=t&&t.isolateSource(t,{get:t=>this.addCalculated(t)}),o=n&&n.stream||mi.never();e.state=o.compose(Li(Ji)),this.sources.props$&&(e.props=this.sources.props$.compose(Li(zi))),this.sources.children$&&(e.children=this.sources.children$.compose(Li(Ji))),this.context$&&(e.context=this.context$.compose(Li(Ji)));const r=[],i=[];Object.entries(e).forEach((([t,e])=>{r.push(t),i.push(e)}));return mi.combine(...i).compose(ki(1)).map((t=>r.reduce(((e,n,o)=>(e[n]=t[o],"state"===n&&(e[this.stateSourceName]=t[o],e.calculated=t[o]&&this.getCalculatedValues(t[o])||{}),e)),{})))}instantiateSubComponents(t){return t.fold(((t,e)=>{const n=Vi(e,Object.keys(this.components)),o=Object.entries(n),r={"::ROOT::":e};if(0===o.length)return r;const i={},s=[];let a=0;const c=o.reduce(((e,[n,o])=>{const r=o.data,c=r.props||{},u=o.children||[],l=r.isCollection||!1,p=r.isSwitchable||!1,f=t=>{Object.entries(t).forEach((([t,e])=>{i[t]||=[],t===Ri?s.push(e):t!==this.DOMSourceName&&i[t].push(e)}))};if(t[n]){const o=t[n];return e[n]=o,o.props$.shamefullySendNext(c),o.children$.shamefullySendNext(u),f(o.sink$),e}const h=mi.create().startWith(c),d=mi.create().startWith(u);let m;m=l?this.instantiateCollection.bind(this):p?this.instantiateSwitchable.bind(this):this.instantiateCustomComponent.bind(this),a++;const y=m(o,h,d);return y[this.DOMSourceName]=y[this.DOMSourceName]?this.makeCoordinatedSubComponentDomSink(y[this.DOMSourceName]):mi.never(),e[n]={sink$:y,props$:h,children$:d},f(y),e}),r),u=Object.entries(i).reduce(((t,[e,n])=>(0===n.length||(t[e]=1===n.length?n[0]:mi.merge(...n)),t)),{});return this.newSubComponentSinks(u),this.newChildSources(s),a>0&&this.log(`New sub components instantiated: ${a}`,!0),c}),{})}makeCoordinatedSubComponentDomSink(t){const e=t.remember();return this.sources[this.stateSourceName].stream.compose(Li(Ji)).map((t=>e)).flatten().debug((t=>this.triggerSubComponentsRendered())).remember()}instantiateCollection(t,e,n){const o=t.data.props||{};const r={filter:"function"==typeof o.filter?o.filter:void 0,sort:Qi(o.sort)},i=mi.combine(this.sources[this.stateSourceName].stream.startWith(this.currentState),e.startWith(o)).compose(ki(1)).map((([t,e])=>(e.filter!==r.filter&&(r.filter="function"==typeof e.filter?e.filter:void 0),e.sort!==r.sort&&(r.sort=Qi(e.sort)),Zi(t)?this.addCalculated(t):t))),s=new Ce(i),a=o.from,c=o.of,u=o.idfield||"id";let l,p;if("function"==typeof c)if(c.isSygnalComponent)p=c;else{const t=c.componentName||c.label||c.name||"FUNCTION_COMPONENT",e=c,{model:n,intent:o,hmrActions:r,context:i,peers:s,components:a,initialState:u,calculated:l,storeCalculatedInState:f,DOMSourceName:h,stateSourceName:d,debug:m}=c;p=Ui({name:t,view:e,model:n,intent:o,hmrActions:r,context:i,peers:s,components:a,initialState:u,calculated:l,storeCalculatedInState:f,DOMSourceName:h,stateSourceName:d,debug:m})}else{if(!this.components[c])throw new Error(`[${this.name}] Invalid 'of' property in collection: ${c}`);p=this.components[c]}const f={get:t=>{if(!Array.isArray(t[a]))return[];const e=t[a],n="function"==typeof r.filter?e.filter(r.filter):e;return("function"==typeof r.sort?n.sort(r.sort):n).map(((t,e)=>Zi(t)?{...t,[u]:t[u]||e}:{value:t,[u]:e}))},set:(t,e)=>{if(this.calculated&&a in this.calculated)return console.warn(`Collection sub-component of ${this.name} attempted to update state on a calculated field '${a}': Update ignored`),t;const n=[];for(const o of t[a].map(((t,e)=>Zi(t)?{...t,[u]:t[u]||e}:{__primitive:!0,value:t,[u]:e})))if("function"!=typeof r.filter||r.filter(o)){const t=e.find((t=>t[u]===o[u]));void 0!==t&&n.push(o.__primitive?t.value:t)}else n.push(o.__primitive?o.value:o);return{...t,[a]:n}}};void 0===a?l={get:t=>!(t instanceof Array)&&t.value&&t.value instanceof Array?t.value:t,set:(t,e)=>e}:"string"==typeof a?Zi(this.currentState)?this.currentState&&a in this.currentState||this.calculated&&a in this.calculated?(Array.isArray(this.currentState[a])||console.warn(`[${this.name}] State property '${a}' in collection component is not an array: No components will be instantiated in the collection.`),l=f):(console.error(`Collection component in ${this.name} is attempting to use non-existent state property '${a}': To fix this error, specify a valid array property on the state. Attempting to use parent component state.`),l=void 0):(Array.isArray(this.currentState[a])||console.warn(`[${this.name}] State property '${a}' in collection component is not an array: No components will be instantiated in the collection.`),l=f):Zi(a)?"function"!=typeof a.get?(console.error(`Collection component in ${this.name} has an invalid 'from' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting child state from the current state. Attempting to use parent component state.`),l=void 0):l={get:t=>{const e=a.get(t);return Array.isArray(e)?e:(console.warn(`State getter function in collection component of ${this.name} did not return an array: No components will be instantiated in the collection. Returned value:`,e),[])},set:a.set}:(console.error(`Collection component in ${this.name} has an invalid 'from' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting child state from the current state. Attempting to use parent component state.`),l=void 0);const h={...this.sources,[this.stateSourceName]:s,props$:e,children$:n,__parentContext$:this.context$,PARENT:null,__parentComponentNumber:this._componentNumber},d=fi(p,l,{container:null})(h);if(!Zi(d))throw new Error(`[${this.name}] Invalid sinks returned from component factory of collection element`);return d}instantiateSwitchable(t,e,n){const o=t.data.props||{},r=this.sources[this.stateSourceName].stream.startWith(this.currentState).map((t=>Zi(t)?this.addCalculated(t):t)),i=new Ce(r),s=o.state;let a;const c={get:t=>t,set:(t,e)=>e};void 0===s?a=c:"string"==typeof s?a={get:t=>t[s],set:(t,e)=>this.calculated&&s in this.calculated?(console.warn(`Switchable sub-component of ${this.name} attempted to update state on a calculated field '${s}': Update ignored`),t):!Zi(e)||Array.isArray(e)?{...t,[s]:e}:{...t,[s]:e}}:Zi(s)?"function"!=typeof s.get?(console.error(`Switchable component in ${this.name} has an invalid 'state' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting sub-component state from the current state. Attempting to use parent component state.`),a=c):a={get:s.get,set:s.set}:(console.error(`Invalid state provided to switchable sub-component of ${this.name}: Expecting string, object, or undefined, but found ${typeof s}. Attempting to use parent component state.`),a=c);const u=o.of;Object.keys(u).forEach((t=>{const e=u[t];if(!e.isSygnalComponent){const n=e.componentName||e.label||e.name||"FUNCTION_COMPONENT",o=e,{model:r,intent:i,hmrActions:s,context:a,peers:c,components:l,initialState:p,calculated:f,storeCalculatedInState:h,DOMSourceName:d,stateSourceName:m,debug:y}=e,v={name:n,view:o,model:r,intent:i,hmrActions:s,context:a,peers:c,components:l,initialState:p,calculated:f,storeCalculatedInState:h,DOMSourceName:d,stateSourceName:m,debug:y};u[t]=Ui(v)}}));const l={...this.sources,[this.stateSourceName]:i,props$:e,children$:n,__parentContext$:this.context$,__parentComponentNumber:this._componentNumber},p=de(_i(u,e.map((t=>t.current))),{[this.stateSourceName]:a})(l);if(!Zi(p))throw new Error(`[${this.name}] Invalid sinks returned from component factory of switchable element`);return p}instantiateCustomComponent(t,e,n){const o=t.sel,r=t.data.props||{},i=this.sources[this.stateSourceName].stream.startWith(this.currentState).map((t=>Zi(t)?this.addCalculated(t):t)),s=new Ce(i),a=r.state;"function"!=typeof r.sygnalFactory&&Zi(r.sygnalOptions)&&(r.sygnalFactory=Ui(r.sygnalOptions));const c="sygnal-factory"===o?r.sygnalFactory:this.components[o]||r.sygnalFactory;if(!c){if("sygnal-factory"===o)throw new Error("Component not found on element with Capitalized selector and nameless function: JSX transpilation replaces selectors starting with upper case letters with functions in-scope with the same name, Sygnal cannot see the name of the resulting component.");throw new Error(`Component not found: ${o}`)}let u;const l={get:t=>t,set:(t,e)=>e};void 0===a?u=l:"string"==typeof a?u={get:t=>t[a],set:(t,e)=>this.calculated&&a in this.calculated?(console.warn(`Sub-component of ${this.name} attempted to update state on a calculated field '${a}': Update ignored`),t):{...t,[a]:e}}:Zi(a)?"function"!=typeof a.get?(console.error(`Sub-component in ${this.name} has an invalid 'state' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting sub-component state from the current state. Attempting to use parent component state.`),u=l):u={get:a.get,set:a.set}:(console.error(`Invalid state provided to sub-component of ${this.name}: Expecting string, object, or undefined, but found ${typeof a}. Attempting to use parent component state.`),u=l);const p={...this.sources,[this.stateSourceName]:s,props$:e,children$:n,__parentContext$:this.context$,__parentComponentNumber:this._componentNumber},f=de(c,{[this.stateSourceName]:u})(p);if(!Zi(f)){throw new Error("Invalid sinks returned from component factory:","sygnal-factory"===o?"custom element":o)}return f}renderVdom(t){return mi.combine(this.subComponentsRendered$,t).compose(ki(1)).map((([t,e])=>{const n=Object.keys(this.components),o=e["::ROOT::"],r=Object.entries(e).filter((([t])=>"::ROOT::"!==t));if(0===r.length)return mi.of(o);const i=[],s=r.map((([t,e])=>(i.push(t),e.sink$[this.DOMSourceName].startWith(void 0))));return 0===s.length?mi.of(o):mi.combine(...s).compose(ki(1)).map((t=>{const e=t.reduce(((t,e,n)=>(t[i[n]]=e,t)),{});return Yi(qi(o),e,n)}))})).flatten().filter((t=>!!t)).remember()}}function Vi(t,e,n="r",o){if(!t)return{};if(t.data?.componentsProcessed)return{};"r"===n&&(t.data.componentsProcessed=!0);const r=t.sel,i=r&&"collection"===r.toLowerCase(),s=r&&"switchable"===r.toLowerCase(),a=r&&["collection","switchable","sygnal-factory",...e].includes(r)||"function"==typeof t.data?.props?.sygnalFactory||Zi(t.data?.props?.sygnalOptions),c=t.data&&t.data.props||{};t.data&&t.data.attrs;const u=t.children||[];let l={},p=o;if(a){if(p=Wi(t,n,o),i){if(!c.of)throw new Error("Collection element missing required 'component' property");if("string"!=typeof c.of&&"function"!=typeof c.of)throw new Error(`Invalid 'component' property of collection element: found ${typeof c.of} requires string or component factory function`);if("function"!=typeof c.of&&!e.includes(c.of))throw new Error(`Specified component for collection not found: ${c.of}`);void 0===c.from||"string"==typeof c.from||Array.isArray(c.from)||"function"==typeof c.from.get||console.warn(`No valid array found for collection ${"string"==typeof c.of?c.of:"function component"}: no collection components will be created`,c.from),t.data.isCollection=!0,t.data.props||={}}else if(s){if(!c.of)throw new Error("Switchable element missing required 'of' property");if(!Zi(c.of))throw new Error(`Invalid 'of' property of switchable element: found ${typeof c.of} requires object mapping names to component factories`);if(!Object.values(c.of).every((t=>"function"==typeof t)))throw new Error("One or more components provided to switchable element is not a valid component factory");if(!c.current||"string"!=typeof c.current&&"function"!=typeof c.current)throw new Error(`Missing or invalid 'current' property for switchable element: found '${typeof c.current}' requires string or function`);if(!Object.keys(c.of).includes(c.current))throw new Error(`Component '${c.current}' not found in switchable element`);t.data.isSwitchable=!0}void 0===c.key&&(t.data.props.key=p),l[p]=t}return u.length>0&&u.map(((t,o)=>Vi(t,e,`${n}.${o}`,p))).forEach((t=>{Object.entries(t).forEach((([t,e])=>l[t]=e))})),l}function Yi(t,e,n,o="r",r){if(!t)return;if(t.data?.componentsInjected)return t;"r"===o&&t.data&&(t.data.componentsInjected=!0);const i=t.sel||"NO SELECTOR",s=["collection","switchable","sygnal-factory",...n].includes(i)||"function"==typeof t.data?.props?.sygnalFactory||Zi(t.data?.props?.sygnalOptions),a=t?.data?.isCollection;t.data&&t.data.props;const c=t.children||[];let u=r;if(s){u=Wi(t,o,r);const n=e[u];return a?(t.sel="div",t.children=Array.isArray(n)?n:[n],t):n}return c.length>0?(t.children=c.map(((t,r)=>Yi(t,e,n,`${o}.${r}`,u))).flat(),t):t}function Wi(t,e,n){const o=t.sel,r="string"==typeof o?o:"functionComponent",i=t.data?.props||{};return`${n?`${n}|`:""}${r}::${i.id&&JSON.stringify(i.id).replaceAll('"',"")||e}`}function qi(t){return void 0===t?t:{...t,children:Array.isArray(t.children)?t.children.map(qi):void 0,data:t.data&&{...t.data,componentsInjected:!1}}}function zi(t,e){return Ji(function(t){if(!Zi(t))return t;const{state:e,of:n,from:o,filter:r,...i}=t;return i}(t))}function Ji(t,e,n=5,o=0){if(o>n)return!1;if(t===e)return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Ji(t[r],e[r],n,o+1))return!1;return!0}const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const s of r){if(!i.includes(s))return!1;if(!Ji(t[s],e[s],n,o+1))return!1}return!0}function Zi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Xi(t,e,n=!0){const o=n?1:-1;switch(!0){case t>e:return 1*o;case t<e:return-1*o;default:return 0}}function Ki(t){const e=Object.entries(t);if(e.length>1)return void console.error("Sort objects can only have one key:",t);const n=e[0],[o,r]=n;if(!["string","number"].includes(typeof r))return void console.error("Sort object properties must be a string or number:",t);let i=!0;if("string"==typeof r){if(!["asc","dec"].includes(r.toLowerCase()))return void console.error("Sort object string values must be asc or dec:",t);i="asc"===r.toLowerCase()}if("number"==typeof r){if(1!==r&&-1!==r)return void console.error("Sort object number values must be 1 or -1:",t);i=1===r}return(t,e)=>Xi(t[o],e[o],i)}function Qi(t){if(!t)return;const e=typeof t;if("function"===e)return t;if("string"===e){if("asc"===t.toLowerCase()||"dec"===t.toLowerCase()){const e="asc"===t.toLowerCase();return(t,n)=>Xi(t,n,e)}const e=t;return(t,n)=>Xi(t[e],n[e],!0)}if(Array.isArray(t)){const e=t.map((t=>"function"==typeof t?t:"string"!=typeof t||["asc","dec"].includes(t.toLowerCase())?Zi(t)?Ki(t):void 0:(e,n)=>Xi(e[t],n[t],!0)));return(t,n)=>e.filter((t=>"function"==typeof t)).reduce(((e,o)=>0!==e?e:o(t,n)),0)}return Zi(t)?Ki(t):void console.error("Invalid sort option (ignoring):",t)}function ts(t){return function(){var t;return(t="undefined"!=typeof window?window:"undefined"!=typeof global?global:this).Cyclejs=t.Cyclejs||{},(t=t.Cyclejs).adaptStream=t.adaptStream||function(t){return t},t}().adaptStream(t)}function es(t){return 0===Object.keys(t).length}function ns(t,e){if("function"!=typeof t)throw new Error("First argument given to Cycle must be the 'main' function.");if("object"!=typeof e||null===e)throw new Error("Second argument given to Cycle must be an object with driver functions as properties.");if(es(e))throw new Error("Second argument given to Cycle must be an object with at least one driver function declared as a property.");var n=function(t){if("object"!=typeof t||null===t)throw new Error("Argument given to setupReusable must be an object with driver functions as properties.");if(es(t))throw new Error("Argument given to setupReusable must be an object with at least one driver function declared as a property.");var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=ae.create());return e}(t),n=function(t,e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o](e[o],o),n[o]&&"object"==typeof n[o]&&(n[o]._isCycleSource=o));return n}(t,e),o=function(t){for(var e in t)t.hasOwnProperty(e)&&t[e]&&"function"==typeof t[e].shamefullySendNext&&(t[e]=ts(t[e]));return t}(n);function r(t){return function(t,e){var n=He(),o=Object.keys(t).filter((function(t){return!!e[t]})),r={},i={};o.forEach((function(t){r[t]={_n:[],_e:[]},i[t]={next:function(e){return r[t]._n.push(e)},error:function(e){return r[t]._e.push(e)},complete:function(){}}}));var s=o.map((function(e){return ae.fromObservable(t[e]).subscribe(i[e])}));return o.forEach((function(t){var o=e[t],s=function(t){n((function(){return o._n(t)}))},a=function(t){n((function(){(console.error||console.log)(t),o._e(t)}))};r[t]._n.forEach(s),r[t]._e.forEach(a),i[t].next=s,i[t].error=a,i[t]._n=s,i[t]._e=a})),r=null,function(){s.forEach((function(t){return t.unsubscribe()}))}}(t,e)}function i(){!function(t){for(var e in t)t.hasOwnProperty(e)&&t[e]&&t[e].dispose&&t[e].dispose()}(o),function(t){Object.keys(t).forEach((function(e){return t[e]._c()}))}(e)}return{sources:o,run:r,dispose:i}}(e),o=t(n.sources);return"undefined"!=typeof window&&(window.Cyclejs=window.Cyclejs||{},window.Cyclejs.sinks=o),{sinks:o,sources:n.sources,run:function(){var t=n.run(o);return function(){t(),n.dispose()}}}}function os(t){const e=new EventTarget;return t.subscribe({next:t=>e.dispatchEvent(new CustomEvent("data",{detail:t})),error:t=>console.error("[EVENTS driver] Error in sink stream:",t)}),{select:t=>{const n=!t,o=Array.isArray(t)?t:[t];let r;const i=mi.create({start:t=>{r=({detail:e})=>{const r=e&&e.data||null;(n||o.includes(e.type))&&t.next(r)},e.addEventListener("data",r)},stop:t=>e.removeEventListener("data",r)});return pe(i)}}}function rs(t){t.addListener({next:t=>{console.log(t)},error:t=>{console.error("[LOG driver] Error in sink stream:",t)}})}class is{constructor(){this._connected=!1,this._components=new Map,this._stateHistory=[],this._maxHistory=200}get connected(){return this._connected&&"undefined"!=typeof window}init(){"undefined"!=typeof window&&(window.__SYGNAL_DEVTOOLS__=this,window.addEventListener("message",(t=>{t.source===window&&"__SYGNAL_DEVTOOLS_EXTENSION__"===t.data?.source&&this._handleExtensionMessage(t.data)})))}_handleExtensionMessage(t){switch(t.type){case"CONNECT":this._connected=!0,t.payload?.maxHistory&&(this._maxHistory=t.payload.maxHistory),this._sendFullTree();break;case"DISCONNECT":this._connected=!1;break;case"SET_DEBUG":this._setDebug(t.payload);break;case"TIME_TRAVEL":this._timeTravel(t.payload);break;case"GET_STATE":this._sendComponentState(t.payload.componentId)}}onComponentCreated(t,e,n){const o={id:t,name:e,isSubComponent:n.isSubComponent,hasModel:!!n.model,hasIntent:!!n.intent,hasContext:!!n.context,hasCalculated:!!n.calculated,components:Object.keys(n.components||{}),parentId:null,children:[],debug:n._debug,createdAt:Date.now(),_instanceRef:new WeakRef(n)};this._components.set(t,o),this.connected&&this._post("COMPONENT_CREATED",this._serializeMeta(o))}onStateChanged(t,e,n){if(!this.connected)return;const o={componentId:t,componentName:e,timestamp:Date.now(),state:this._safeClone(n)};this._stateHistory.push(o),this._stateHistory.length>this._maxHistory&&this._stateHistory.shift(),this._post("STATE_CHANGED",{componentId:t,componentName:e,state:o.state,historyIndex:this._stateHistory.length-1})}onActionDispatched(t,e,n,o){this.connected&&this._post("ACTION_DISPATCHED",{componentId:t,componentName:e,actionType:n,data:this._safeClone(o),timestamp:Date.now()})}onSubComponentRegistered(t,e){const n=this._components.get(t),o=this._components.get(e);n&&o&&(o.parentId=t,n.children.includes(e)||n.children.push(e)),this.connected&&this._post("TREE_UPDATED",{parentId:t,childId:e})}onContextChanged(t,e,n){this.connected&&this._post("CONTEXT_CHANGED",{componentId:t,componentName:e,context:this._safeClone(n)})}onDebugLog(t,e){this.connected&&this._post("DEBUG_LOG",{componentId:t,message:e,timestamp:Date.now()})}_setDebug({componentId:t,enabled:e}){if(null==t)return"undefined"!=typeof window&&(window.SYGNAL_DEBUG=!!e&&"true"),void this._post("DEBUG_TOGGLED",{global:!0,enabled:e});const n=this._components.get(t);if(n&&n._instanceRef){const o=n._instanceRef.deref();o&&(o._debug=e,n.debug=e,this._post("DEBUG_TOGGLED",{componentId:t,enabled:e}))}}_timeTravel({historyIndex:t}){const e=this._stateHistory[t];if(!e)return;const n="undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS_APP__;n?.sinks?.STATE?.shamefullySendNext&&(n.sinks.STATE.shamefullySendNext((()=>({...e.state}))),this._post("TIME_TRAVEL_APPLIED",{historyIndex:t,state:e.state}))}_sendComponentState(t){const e=this._components.get(t);if(e&&e._instanceRef){const n=e._instanceRef.deref();n&&this._post("COMPONENT_STATE",{componentId:t,state:this._safeClone(n.currentState),context:this._safeClone(n.currentContext),props:this._safeClone(n.currentProps)})}}_sendFullTree(){const t=[];for(const[e,n]of this._components){const e=n._instanceRef?.deref();t.push({...this._serializeMeta(n),state:e?this._safeClone(e.currentState):null,context:e?this._safeClone(e.currentContext):null})}this._post("FULL_TREE",{components:t,history:this._stateHistory})}_post(t,e){"undefined"!=typeof window&&window.postMessage({source:"__SYGNAL_DEVTOOLS_PAGE__",type:t,payload:e},"*")}_safeClone(t){if(null==t)return t;try{return JSON.parse(JSON.stringify(t))}catch(t){return"[unserializable]"}}_serializeMeta(t){const{_instanceRef:e,...n}=t;return n}}let ss=null;function as(){return ss||(ss=new is),ss}function cs(t){if(!t)return null;const e=t.default||t;return"function"!=typeof e?null:t.default?t:{default:e}}function us(t){return/^[a-zA-Z0-9-_]+$/.test(t)}function ls(t){if("string"!=typeof t)throw new Error("Class name must be a string");return t.trim().split(" ").reduce(((t,e)=>{if(0===e.trim().length)return t;if(!us(e))throw new Error(`${e} is not a valid CSS class name`);return t.push(e),t}),[])}var ps={};Object.defineProperty(ps,"__esModule",{value:!0});var fs=o,hs=function(){function t(t,e){this.dt=t,this.ins=e,this.type="throttle",this.out=null,this.id=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.id=null},t.prototype.clearInterval=function(){var t=this.id;null!==t&&clearInterval(t),this.id=null},t.prototype._n=function(t){var e=this,n=this.out;n&&(this.id||(n._n(t),this.id=setInterval((function(){e.clearInterval()}),this.dt)))},t.prototype._e=function(t){var e=this.out;e&&(this.clearInterval(),e._e(t))},t.prototype._c=function(){var t=this.out;t&&(this.clearInterval(),t._c())},t}();var ds=ps.default=function(t){return function(e){return new fs.Stream(new hs(t,e))}};t.ABORT=Gi,t.Collection=hi,t.MainDOMSource=Gn,t.MockedDOMSource=lo,t.Switchable=bi,t.a=go,t.abbr=bo,t.address=wo,t.area=So,t.article=Ao,t.aside=Eo,t.audio=Oo,t.b=No,t.base=Co,t.bdi=To,t.bdo=$o,t.blockquote=xo,t.body=Do,t.br=jo,t.button=ko,t.canvas=Lo,t.caption=Io,t.cite=Mo,t.classes=function(...t){return t.reduce(((t,e)=>{var n,o;return"string"!=typeof e||t.includes(e)?Array.isArray(e)?t.push(...(o=e,o.map(ls).flat())):"object"==typeof e&&t.push(...(n=e,Object.entries(n).filter((([t,e])=>"function"==typeof e?e():!!e)).map((([t,e])=>{const n=t.trim();if(!us(n))throw new Error(`${n} is not a valid CSS class name`);return n})))):t.push(...ls(e)),t}),[]).join(" ")},t.code=Po,t.col=Ro,t.colgroup=Fo,t.collection=fi,t.component=Ui,t.dd=Go,t.debounce=$i,t.del=Bo,t.delay=Ei,t.dfn=Uo,t.dir=Ho,t.div=Vo,t.dl=Yo,t.driverFromAsync=function(t,e={}){const{selector:n="category",args:o="value",return:r="value",pre:i=(t=>t),post:s=(t=>t)}=e,a=t.name||"[anonymous function]",c=typeof o;if(!("string"===c||"function"===c||Array.isArray(o)&&o.every((t=>"string"==typeof t))))throw new Error(`The 'args' option for driverFromAsync(${a}) must be a string, array of strings, or a function. Received ${c}`);if("string"!=typeof n)throw new Error(`The 'selector' option for driverFromAsync(${a}) must be a string. Received ${typeof n}`);return e=>{let c=null;const u=mi.create({start:t=>{c=t.next.bind(t)},stop:()=>{}});return e.addListener({next:e=>{const u=i(e);let l=[];if("object"==typeof u&&null!==u){if("function"==typeof o){const t=o(u);l=Array.isArray(t)?t:[t]}"string"==typeof o&&(l=[u[o]]),Array.isArray(o)&&(l=o.map((t=>u[t])))}const p=`Error in driver created using driverFromAsync(${a})`;t(...l).then((t=>{const o=t=>{let o;if(void 0===r)o=t,"object"==typeof o&&null!==o?o[n]=e[n]:console.warn(`The 'return' option for driverFromAsync(${a}) was not set, but the promise returned an non-object. The result will be returned as-is, but the '${n}' property will not be set, so will not be filtered by the 'select' method of the driver.`);else{if("string"!=typeof r)throw new Error(`The 'return' option for driverFromAsync(${a}) must be a string. Received ${typeof r}`);o={[r]:t,[n]:e[n]}}return o};if("function"==typeof t.then)t.then((t=>{const n=s(t,e);"function"==typeof n.then?n.then((t=>{c(o(t))})).catch((t=>console.error(`${p}: ${t}`))):c(o(n))})).catch((t=>console.error(`${p}: ${t}`)));else{const n=s(t,e);"function"==typeof n.then?n.then((t=>{c(o(t))})).catch((t=>console.error(`${p}: ${t}`))):c(o(n))}})).catch((t=>console.error(`${p}: ${t}`)))},error:t=>{console.error(`Error received from sink stream in driver created using driverFromAsync(${a}):`,t)},complete:()=>{console.warn(`Unexpected completion of sink stream to driver created using driverFromAsync(${a})`)}}),{select:t=>void 0===t?u:"function"==typeof t?u.filter(t):u.filter((e=>e?.[n]===t))}}},t.dropRepeats=be,t.dt=Wo,t.em=qo,t.embed=zo,t.enableHMR=function(t,e,n,o){if(!t||"function"!=typeof t.hmr)return t;if(!e||"function"!=typeof e.accept)return t;let r=!1;const i=e=>{Promise.resolve((async e=>{if(r)return;r=!0;const o=Array.isArray(e)?e.find(Boolean):e;try{let e=cs(o);if(e||"function"!=typeof n||(e=cs(await n())),e){const n=t?.sources?.STATE?.stream?._v;t.hmr(e,n)}}finally{r=!1}})(e)).catch((()=>{}))};return void 0!==o&&e.accept(o,i),e.accept(i),"function"==typeof e.dispose&&"function"==typeof t.dispose&&e.dispose((()=>t.dispose())),t},t.exactState=function(){return t=>t},t.fieldset=Jo,t.figcaption=Zo,t.figure=Xo,t.footer=Ko,t.form=Qo,t.getDevTools=as,t.h=cn,t.h1=tr,t.h2=er,t.h3=nr,t.h4=or,t.h5=rr,t.h6=ir,t.head=sr,t.header=ar,t.hgroup=cr,t.hr=ur,t.html=lr,t.i=pr,t.iframe=fr,t.img=hr,t.input=dr,t.ins=mr,t.kbd=yr,t.keygen=vr,t.label=_r,t.legend=gr,t.li=br,t.link=wr,t.main=Sr,t.makeDOMDriver=co,t.makeDragDriver=function(){return function(t){const e=new Map,n=new EventTarget,o=[];let r=null;const i=t=>{if(!t?.category)return;const n=e.get(t.category)??{};e.set(t.category,{...n,...t})};t.subscribe({next(t){(t?.configs??(Array.isArray(t)?t:[t])).forEach(i)},error(){},complete(){}});const s=(t,e)=>n.dispatchEvent(new CustomEvent(t,{detail:e})),a=(t,e)=>{document.addEventListener(t,e),o.push([t,e])};a("dragstart",(t=>{for(const[n,o]of e){if(!o.draggable)continue;const e=t.target.closest(o.draggable);if(e){if(r=n,t.dataTransfer.effectAllowed="move",o.dragImage){const n=e.closest(o.dragImage);if(n){const e=n.getBoundingClientRect();t.dataTransfer.setDragImage(n,t.clientX-e.left,t.clientY-e.top)}}return void s(`${n}:dragstart`,{element:e,dataset:{...e.dataset}})}}})),a("dragend",(()=>{r&&(s(`${r}:dragend`,null),r=null)})),a("dragover",(t=>{for(const[,n]of e)if(n.dropZone&&(!r||!n.accepts||n.accepts===r)&&t.target.closest(n.dropZone))return void t.preventDefault()})),a("drop",(t=>{for(const[n,o]of e){if(!o.dropZone)continue;if(r&&o.accepts&&o.accepts!==r)continue;const i=t.target.closest(o.dropZone);if(!i)continue;t.preventDefault();let a=null;const c=r?e.get(r):null;return c?.draggable&&(a=t.target.closest(c.draggable)??null),void s(`${n}:drop`,{dropZone:i,insertBefore:a})}}));const c={select:t=>({events(e){const o=`${t}:${e}`;let r;return mi.create({start(t){r=({detail:e})=>t.next(e),n.addEventListener(o,r)},stop(){r&&n.removeEventListener(o,r)}})}}),dragstart:t=>c.select(t).events("dragstart"),dragend:t=>c.select(t).events("dragend"),drop:t=>c.select(t).events("drop"),dragover:t=>c.select(t).events("dragover"),dispose(){o.forEach((([t,e])=>document.removeEventListener(t,e)))}};return c}},t.map=Ar,t.mark=Er,t.menu=Or,t.meta=Nr,t.mockDOMSource=function(t){return new lo(t)},t.nav=Cr,t.noscript=Tr,t.object=$r,t.ol=xr,t.optgroup=Dr,t.option=jr,t.p=kr,t.param=Lr,t.pre=Ir,t.processDrag=function({draggable:t,dropZone:e}={},n={}){if(t&&"function"!=typeof t.events)throw new Error("processDrag: draggable must have an .events() method (e.g. DOM.select(...))");if(e&&"function"!=typeof e.events)throw new Error("processDrag: dropZone must have an .events() method (e.g. DOM.select(...))");const{effectAllowed:o="move"}=n;return{dragStart$:t?t.events("dragstart").map((t=>(t.dataTransfer.effectAllowed=o,t))):mi.never(),dragEnd$:t?t.events("dragend").mapTo(null):mi.never(),dragOver$:e?e.events("dragover").map((t=>(t.preventDefault(),null))):mi.never(),drop$:e?e.events("drop").map((t=>(t.preventDefault(),t))):mi.never()}},t.processForm=function(t,e={}){if(!t||"function"!=typeof t.events)throw new Error("processForm: first argument must have an .events() method (e.g. DOM.select(...))");let{events:n=["input","submit"],preventDefault:o=!0}=e;"string"==typeof n&&(n=[n]);const r=n.map((e=>t.events(e)));return mi.merge(...r).map((t=>{o&&t.preventDefault();const e="submit"===t.type?t.srcElement:t.currentTarget,n=new FormData(e);let r={};r.event=t,r.eventType=t.type;const i=e.querySelector("input[type=submit]:focus");if(i){const{name:t,value:e}=i;r[t||"submit"]=e}for(let[t,e]of n.entries())r[t]=e;return r}))},t.progress=Mr,t.q=Pr,t.rp=Rr,t.rt=Fr,t.ruby=Gr,t.run=function t(e,n={},o={}){if("undefined"!=typeof window){as().init()}const{mountPoint:r="#root",fragments:i=!0,useDefaultDrivers:s=!0}=o;if(!e.isSygnalComponent){const t=e.name||e.componentName||e.label||"FUNCTIONAL_COMPONENT",n=e,{model:o,intent:r,hmrActions:i,context:s,peers:a,components:c,initialState:u,calculated:l,storeCalculatedInState:p,DOMSourceName:f,stateSourceName:h,debug:d}=e;e=Ui({name:t,view:n,model:o,intent:r,hmrActions:i,context:s,peers:a,components:c,initialState:u,calculated:l,storeCalculatedInState:p,DOMSourceName:f,stateSourceName:h,debug:d})}"undefined"!=typeof window&&!0===window.__SYGNAL_HMR_UPDATING&&void 0!==window.__SYGNAL_HMR_PERSISTED_STATE&&(e.initialState=window.__SYGNAL_HMR_PERSISTED_STATE);const a=function(t,e){return void 0===e&&(e="state"),function(n){var o=ae.create(),r=o.fold((function(t,e){return e(t)}),void 0).drop(1),i=n;i[e]=new Ce(r,e);var s=t(i);return s[e]&&Ge(ae.fromObservable(s[e]),ae.never()).subscribe({next:function(t){return Ve((function(){return o._n(t)}))},error:function(t){return Ve((function(){return o._e(t)}))},complete:function(){return Ve((function(){return o._c()}))}}),s}}(e,"STATE"),c={...s?{EVENTS:os,DOM:co(r,{snabbdomOptions:{experimental:{fragments:i}}}),LOG:rs}:{},...n},{sources:u,sinks:l,run:p}=ns(a,c),f=p();let h=null;"undefined"!=typeof window&&u?.STATE?.stream&&"function"==typeof u.STATE.stream.addListener&&(h={next:t=>{window.__SYGNAL_HMR_PERSISTED_STATE=t},error:()=>{},complete:()=>{}},u.STATE.stream.addListener(h));const d={sources:u,sinks:l,dispose:()=>{h&&u?.STATE?.stream&&"function"==typeof u.STATE.stream.removeListener&&(u.STATE.stream.removeListener(h),h=null),f()}};"undefined"!=typeof window&&(window.__SYGNAL_DEVTOOLS_APP__=d);const m=(r,i)=>{const s="undefined"!=typeof window?window.__SYGNAL_HMR_PERSISTED_STATE:void 0,a=void 0!==s?s:e.initialState,c=void 0===i?a:i;"undefined"!=typeof window&&(window.__SYGNAL_HMR_UPDATING=!0,window.__SYGNAL_HMR_STATE=c,window.__SYGNAL_HMR_PERSISTED_STATE=c),d.dispose();const u=r.default||r;u.initialState=c;const l=t(u,n,o);if(d.sources=l.sources,d.sinks=l.sinks,d.dispose=l.dispose,void 0!==c&&l?.sinks?.STATE&&"function"==typeof l.sinks.STATE.shamefullySendNext){const t=()=>l.sinks.STATE.shamefullySendNext((()=>({...c})));setTimeout(t,0),setTimeout(t,20)}"undefined"!=typeof window&&l?.sources?.STATE?.stream&&"function"==typeof l.sources.STATE.stream.setDebugListener?l.sources.STATE.stream.setDebugListener({next:()=>{l.sources.STATE.stream.setDebugListener(null),window.__SYGNAL_HMR_STATE=void 0,setTimeout((()=>{window.__SYGNAL_HMR_UPDATING=!1}),100)}}):"undefined"!=typeof window&&(window.__SYGNAL_HMR_STATE=void 0,window.__SYGNAL_HMR_UPDATING=!1)},y=t=>t?Array.isArray(t)?y(t.find(Boolean)):t.default&&"function"==typeof t.default?t:"function"==typeof t?{default:t}:null:null;return d.hmr=(t,n)=>{const o=y(t)||{default:e};if(void 0!==n)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=n),void m(o,n);const r="undefined"!=typeof window?window.__SYGNAL_HMR_PERSISTED_STATE:void 0;if(void 0!==r)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=r),void m(o,r);const i=d?.sources?.STATE?.stream?._v;if(void 0!==i)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=i),void m(o,i);d?.sinks?.STATE&&"function"==typeof d.sinks.STATE.shamefullySendNext?d.sinks.STATE.shamefullySendNext((t=>("undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=t),m(o,t),Gi))):m(o)},d},t.s=Br,t.samp=Ur,t.sampleCombine=zn,t.script=Hr,t.section=Vr,t.select=Yr,t.small=Wr,t.source=qr,t.span=zr,t.strong=Jr,t.style=Zr,t.sub=Xr,t.sup=Kr,t.svg=_o,t.switchable=_i,t.table=Qr,t.tbody=ti,t.td=ei,t.textarea=ni,t.tfoot=oi,t.th=ri,t.thead=ii,t.throttle=ds,t.thunk=function(t,e,n,o){return void 0===o&&(o=n,n=e,e=void 0),cn(t,{key:e,hook:{init:Nn,prepatch:Cn},fn:n,args:o})},t.title=si,t.tr=ai,t.u=ci,t.ul=ui,t.video=li,t.xs=mi}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Sygnal={})}(this,(function(t){"use strict";function e(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o={},r={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e,n=t.Symbol;if("function"==typeof n)if(n.observable)e=n.observable;else{e=n.for("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch(t){}}else e="@@observable";return e}}(r);var i,s,a=r,c=Object.prototype.toString,u=function(t){var e=c.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===c.call(t.callee)),n};var l=Array.prototype.slice,p=u,f=Object.keys,h=f?function(t){return f(t)}:function(){if(s)return i;var t;if(s=1,!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=u,r=Object.prototype.propertyIsEnumerable,a=!r.call({toString:null},"toString"),c=r.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{p(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();t=function(t){var r=null!==t&&"object"==typeof t,i="[object Function]"===n.call(t),s=o(t),u=r&&"[object String]"===n.call(t),f=[];if(!r&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var d=c&&i;if(u&&t.length>0&&!e.call(t,0))for(var m=0;m<t.length;++m)f.push(String(m));if(s&&t.length>0)for(var y=0;y<t.length;++y)f.push(String(y));else for(var v in t)d&&"prototype"===v||!e.call(t,v)||f.push(String(v));if(a)for(var _=function(t){if("undefined"==typeof window||!h)return p(t);try{return p(t)}catch(t){return!1}}(t),g=0;g<l.length;++g)_&&"constructor"===l[g]||!e.call(t,l[g])||f.push(l[g]);return f}}return i=t}(),d=Object.keys;h.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return p(t)?d(l.call(t)):d(t)})}else Object.keys=h;return Object.keys||h};var m,y=h,v="undefined"!=typeof Symbol&&Symbol,_=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0},g={foo:{}},b=Object,w=Array.prototype.slice,S=Object.prototype.toString,A=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==S.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,o=w.call(arguments,1),r=Math.max(0,e.length-o.length),i=[],s=0;s<r;s++)i.push("$"+s);if(n=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var r=e.apply(this,o.concat(w.call(arguments)));return Object(r)===r?r:this}return e.apply(t,o.concat(w.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,n.prototype=new a,a.prototype=null}return n},E=Function.prototype.bind||A,O=E.call(Function.call,Object.prototype.hasOwnProperty),N=SyntaxError,C=Function,T=TypeError,$=function(t){try{return C('"use strict"; return ('+t+").constructor;")()}catch(t){}},x=Object.getOwnPropertyDescriptor;if(x)try{x({},"")}catch(t){x=null}var D=function(){throw new T},j=x?function(){try{return D}catch(t){try{return x(arguments,"callee").get}catch(t){return D}}}():D,k="function"==typeof v&&"function"==typeof Symbol&&"symbol"==typeof v("foo")&&"symbol"==typeof Symbol("bar")&&_(),L={__proto__:g}.foo===g.foo&&!({__proto__:null}instanceof b),I=Object.getPrototypeOf||(L?function(t){return t.__proto__}:null),M={},P="undefined"!=typeof Uint8Array&&I?I(Uint8Array):m,R={"%AggregateError%":"undefined"==typeof AggregateError?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?m:ArrayBuffer,"%ArrayIteratorPrototype%":k&&I?I([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"undefined"==typeof Atomics?m:Atomics,"%BigInt%":"undefined"==typeof BigInt?m:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?m:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?m:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?m:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?m:FinalizationRegistry,"%Function%":C,"%GeneratorFunction%":M,"%Int8Array%":"undefined"==typeof Int8Array?m:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?m:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&I?I(I([][Symbol.iterator]())):m,"%JSON%":"object"==typeof JSON?JSON:m,"%Map%":"undefined"==typeof Map?m:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&I?I((new Map)[Symbol.iterator]()):m,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?m:Promise,"%Proxy%":"undefined"==typeof Proxy?m:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?m:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?m:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&I?I((new Set)[Symbol.iterator]()):m,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&I?I(""[Symbol.iterator]()):m,"%Symbol%":k?Symbol:m,"%SyntaxError%":N,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":T,"%Uint8Array%":"undefined"==typeof Uint8Array?m:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?m:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?m:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?m:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?m:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?m:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?m:WeakSet};if(I)try{null.error}catch(t){var F=I(I(t));R["%Error.prototype%"]=F}var G=function t(e){var n;if("%AsyncFunction%"===e)n=$("async function () {}");else if("%GeneratorFunction%"===e)n=$("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=$("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&I&&(n=I(r.prototype))}return R[e]=n,n},B={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=E,H=O,V=U.call(Function.call,Array.prototype.concat),Y=U.call(Function.apply,Array.prototype.splice),W=U.call(Function.call,String.prototype.replace),q=U.call(Function.call,String.prototype.slice),z=U.call(Function.call,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,X=function(t,e){var n,o=t;if(H(B,o)&&(o="%"+(n=B[o])[0]+"%"),H(R,o)){var r=R[o];if(r===M&&(r=G(o)),void 0===r&&!e)throw new T("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:r}}throw new N("intrinsic "+t+" does not exist!")},K=function(t,e){if("string"!=typeof t||0===t.length)throw new T("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new T('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new N("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=q(t,0,1),n=q(t,-1);if("%"===e&&"%"!==n)throw new N("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new N("invalid intrinsic syntax, expected opening `%`");var o=[];return W(t,J,(function(t,e,n,r){o[o.length]=n?W(r,Z,"$1"):e||t})),o}(t),o=n.length>0?n[0]:"",r=X("%"+o+"%",e),i=r.name,s=r.value,a=!1,c=r.alias;c&&(o=c[0],Y(n,V([0,1],c)));for(var u=1,l=!0;u<n.length;u+=1){var p=n[u],f=q(p,0,1),h=q(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===h||"'"===h||"`"===h)&&f!==h)throw new N("property names with quotes must have matching quotes");if("constructor"!==p&&l||(a=!0),H(R,i="%"+(o+="."+p)+"%"))s=R[i];else if(null!=s){if(!(p in s)){if(!e)throw new T("base intrinsic for "+t+" exists, but the property is not available.");return}if(x&&u+1>=n.length){var d=x(s,p);s=(l=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:s[p]}else l=H(s,p),s=s[p];l&&!a&&(R[i]=s)}}return s},Q=K("%Object.defineProperty%",!0),tt=function(){if(Q)try{return Q({},"a",{value:1}),!0}catch(t){return!1}return!1};tt.hasArrayLengthDefineBug=function(){if(!tt())return null;try{return 1!==Q([],"length",{value:1}).length}catch(t){return!0}};var et=tt,nt=y,ot="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),rt=Object.prototype.toString,it=Array.prototype.concat,st=Object.defineProperty,at=et(),ct=st&&at,ut=function(t,e,n,o){if(e in t)if(!0===o){if(t[e]===n)return}else if("function"!=typeof(r=o)||"[object Function]"!==rt.call(r)||!o())return;var r;ct?st(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n},lt=function(t,e){var n=arguments.length>2?arguments[2]:{},o=nt(e);ot&&(o=it.call(o,Object.getOwnPropertySymbols(e)));for(var r=0;r<o.length;r+=1)ut(t,o[r],e[o[r]],n[o[r]])};lt.supportsDescriptors=!!ct;var pt=n,ft=function(){return"object"==typeof n&&n&&n.Math===Math&&n.Array===Array?n:pt},ht=lt,dt=ft,mt=lt,yt=n,vt=ft,_t=function(){var t=dt();if(ht.supportsDescriptors){var e=Object.getOwnPropertyDescriptor(t,"globalThis");e&&(!e.configurable||!e.enumerable&&e.writable&&globalThis===t)||Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else"object"==typeof globalThis&&globalThis===t||(t.globalThis=t);return t},gt=vt(),bt=function(){return gt};mt(bt,{getPolyfill:vt,implementation:yt,shim:_t});var wt,St=bt,At=n&&n.__extends||(wt=function(t,e){return wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},wt(t,e)},function(t,e){function n(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(o,"__esModule",{value:!0});var Et=o.NO_IL=o.NO=o.MemoryStream=oe=o.Stream=void 0,Ot=a.default(St.getPolyfill()),Nt={},Ct=o.NO=Nt;function Tt(){}function $t(t){for(var e=t.length,n=Array(e),o=0;o<e;++o)n[o]=t[o];return n}function xt(t,e,n){try{return t.f(e)}catch(t){return n._e(t),Nt}}var Dt={_n:Tt,_e:Tt,_c:Tt};function jt(t){t._start=function(t){t.next=t._n,t.error=t._e,t.complete=t._c,this.start(t)},t._stop=t.stop}Et=o.NO_IL=Dt;var kt=function(){function t(t,e){this._stream=t,this._listener=e}return t.prototype.unsubscribe=function(){this._stream._remove(this._listener)},t}(),Lt=function(){function t(t){this._listener=t}return t.prototype.next=function(t){this._listener._n(t)},t.prototype.error=function(t){this._listener._e(t)},t.prototype.complete=function(){this._listener._c()},t}(),It=function(){function t(t){this.type="fromObservable",this.ins=t,this.active=!1}return t.prototype._start=function(t){this.out=t,this.active=!0,this._sub=this.ins.subscribe(new Lt(t)),this.active||this._sub.unsubscribe()},t.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},t}(),Mt=function(){function t(t){this.type="merge",this.insArr=t,this.out=Nt,this.ac=0}return t.prototype._start=function(t){this.out=t;var e=this.insArr,n=e.length;this.ac=n;for(var o=0;o<n;o++)e[o]._add(this)},t.prototype._stop=function(){for(var t=this.insArr,e=t.length,n=0;n<e;n++)t[n]._remove(this);this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){if(--this.ac<=0){var t=this.out;if(t===Nt)return;t._c()}},t}(),Pt=function(){function t(t,e,n){this.i=t,this.out=e,this.p=n,n.ils.push(this)}return t.prototype._n=function(t){var e=this.p,n=this.out;if(n!==Nt&&e.up(t,this.i)){var o=$t(e.vals);n._n(o)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.p;t.out!==Nt&&0==--t.Nc&&t.out._c()},t}(),Rt=function(){function t(t){this.type="combine",this.insArr=t,this.out=Nt,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return t.prototype.up=function(t,e){var n=this.vals[e],o=this.Nn?n===Nt?--this.Nn:this.Nn:0;return this.vals[e]=t,0===o},t.prototype._start=function(t){this.out=t;var e=this.insArr,n=this.Nc=this.Nn=e.length,o=this.vals=new Array(n);if(0===n)t._n([]),t._c();else for(var r=0;r<n;r++)o[r]=Nt,e[r]._add(new Pt(r,t,this))},t.prototype._stop=function(){for(var t=this.insArr,e=t.length,n=this.ils,o=0;o<e;o++)t[o]._remove(n[o]);this.out=Nt,this.ils=[],this.vals=[]},t}(),Ft=function(){function t(t){this.type="fromArray",this.a=t}return t.prototype._start=function(t){for(var e=this.a,n=0,o=e.length;n<o;n++)t._n(e[n]);t._c()},t.prototype._stop=function(){},t}(),Gt=function(){function t(t){this.type="fromPromise",this.on=!1,this.p=t}return t.prototype._start=function(t){var e=this;this.on=!0,this.p.then((function(n){e.on&&(t._n(n),t._c())}),(function(e){t._e(e)})).then(Tt,(function(t){setTimeout((function(){throw t}))}))},t.prototype._stop=function(){this.on=!1},t}(),Bt=function(){function t(t){this.type="periodic",this.period=t,this.intervalID=-1,this.i=0}return t.prototype._start=function(t){var e=this;this.intervalID=setInterval((function(){t._n(e.i++)}),this.period)},t.prototype._stop=function(){-1!==this.intervalID&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},t}(),Ut=function(){function t(t,e){this.type="debug",this.ins=t,this.out=Nt,this.s=Tt,this.l="","string"==typeof e?this.l=e:"function"==typeof e&&(this.s=e)}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=this.s,o=this.l;if(n!==Tt)try{n(t)}catch(t){e._e(t)}else o?console.log(o+":",t):console.log(t);e._n(t)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Ht=function(){function t(t,e){this.type="drop",this.ins=e,this.out=Nt,this.max=t,this.dropped=0}return t.prototype._start=function(t){this.out=t,this.dropped=0,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&this.dropped++>=this.max&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Vt=function(){function t(t,e){this.out=t,this.op=e}return t.prototype._n=function(){this.op.end()},t.prototype._e=function(t){this.out._e(t)},t.prototype._c=function(){this.op.end()},t}(),Yt=function(){function t(t,e){this.type="endWhen",this.ins=e,this.out=Nt,this.o=t,this.oil=Dt}return t.prototype._start=function(t){this.out=t,this.o._add(this.oil=new Vt(t,this)),this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=Nt,this.oil=Dt},t.prototype.end=function(){var t=this.out;t!==Nt&&t._c()},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){this.end()},t}(),Wt=function(){function t(t,e){this.type="filter",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&n&&e._n(t)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),qt=function(){function t(t,e){this.out=t,this.op=e}return t.prototype._n=function(t){this.out._n(t)},t.prototype._e=function(t){this.out._e(t)},t.prototype._c=function(){this.op.inner=Nt,this.op.less()},t}(),zt=function(){function t(t){this.type="flatten",this.ins=t,this.out=Nt,this.open=!0,this.inner=Nt,this.il=Dt}return t.prototype._start=function(t){this.out=t,this.open=!0,this.inner=Nt,this.il=Dt,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.inner!==Nt&&this.inner._remove(this.il),this.out=Nt,this.open=!0,this.inner=Nt,this.il=Dt},t.prototype.less=function(){var t=this.out;t!==Nt&&(this.open||this.inner!==Nt||t._c())},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=this.inner,o=this.il;n!==Nt&&o!==Dt&&n._remove(o),(this.inner=t)._add(this.il=new qt(e,this))}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){this.open=!1,this.less()},t}(),Jt=function(){function t(t,e,n){var o=this;this.type="fold",this.ins=n,this.out=Nt,this.f=function(e){return t(o.acc,e)},this.acc=this.seed=e}return t.prototype._start=function(t){this.out=t,this.acc=this.seed,t._n(this.acc),this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt,this.acc=this.seed},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&e._n(this.acc=n)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Zt=function(){function t(t){this.type="last",this.ins=t,this.out=Nt,this.has=!1,this.val=Nt}return t.prototype._start=function(t){this.out=t,this.has=!1,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt,this.val=Nt},t.prototype._n=function(t){this.has=!0,this.val=t},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&(this.has?(t._n(this.val),t._c()):t._e(new Error("last() failed because input stream completed")))},t}(),Xt=function(){function t(t,e){this.type="map",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=xt(this,t,e);n!==Nt&&e._n(n)}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),Kt=function(){function t(t){this.type="remember",this.ins=t,this.out=Nt}return t.prototype._start=function(t){this.out=t,this.ins._add(t)},t.prototype._stop=function(){this.ins._remove(this.out),this.out=Nt},t}(),Qt=function(){function t(t,e){this.type="replaceError",this.ins=e,this.out=Nt,this.f=t}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;e!==Nt&&e._n(t)},t.prototype._e=function(t){var e=this.out;if(e!==Nt)try{this.ins._remove(this),(this.ins=this.f(t))._add(this)}catch(t){e._e(t)}},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),te=function(){function t(t,e){this.type="startWith",this.ins=t,this.out=Nt,this.val=e}return t.prototype._start=function(t){this.out=t,this.out._n(this.val),this.ins._add(t)},t.prototype._stop=function(){this.ins._remove(this.out),this.out=Nt},t}(),ee=function(){function t(t,e){this.type="take",this.ins=e,this.out=Nt,this.max=t,this.taken=0}return t.prototype._start=function(t){this.out=t,this.taken=0,this.max<=0?t._c():this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=Nt},t.prototype._n=function(t){var e=this.out;if(e!==Nt){var n=++this.taken;n<this.max?e._n(t):n===this.max&&(e._n(t),e._c())}},t.prototype._e=function(t){var e=this.out;e!==Nt&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Nt&&t._c()},t}(),ne=function(){function t(t){this._prod=t||Nt,this._ils=[],this._stopID=Nt,this._dl=Nt,this._d=!1,this._target=null,this._err=Nt}return t.prototype._n=function(t){var e=this._ils,n=e.length;if(this._d&&this._dl._n(t),1==n)e[0]._n(t);else{if(0==n)return;for(var o=$t(e),r=0;r<n;r++)o[r]._n(t)}},t.prototype._e=function(t){if(this._err===Nt){this._err=t;var e=this._ils,n=e.length;if(this._x(),this._d&&this._dl._e(t),1==n)e[0]._e(t);else{if(0==n)return;for(var o=$t(e),r=0;r<n;r++)o[r]._e(t)}if(!this._d&&0==n)throw this._err}},t.prototype._c=function(){var t=this._ils,e=t.length;if(this._x(),this._d&&this._dl._c(),1==e)t[0]._c();else{if(0==e)return;for(var n=$t(t),o=0;o<e;o++)n[o]._c()}},t.prototype._x=function(){0!==this._ils.length&&(this._prod!==Nt&&this._prod._stop(),this._err=Nt,this._ils=[])},t.prototype._stopNow=function(){this._prod._stop(),this._err=Nt,this._stopID=Nt},t.prototype._add=function(t){var e=this._target;if(e)return e._add(t);var n=this._ils;if(n.push(t),!(n.length>1))if(this._stopID!==Nt)clearTimeout(this._stopID),this._stopID=Nt;else{var o=this._prod;o!==Nt&&o._start(this)}},t.prototype._remove=function(t){var e=this,n=this._target;if(n)return n._remove(t);var o=this._ils,r=o.indexOf(t);r>-1&&(o.splice(r,1),this._prod!==Nt&&o.length<=0?(this._err=Nt,this._stopID=setTimeout((function(){return e._stopNow()}))):1===o.length&&this._pruneCycles())},t.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},t.prototype._hasNoSinks=function(t,e){if(-1!==e.indexOf(t))return!0;if(t.out===this)return!0;if(t.out&&t.out!==Nt)return this._hasNoSinks(t.out,e.concat(t));if(t._ils){for(var n=0,o=t._ils.length;n<o;n++)if(!this._hasNoSinks(t._ils[n],e.concat(t)))return!1;return!0}return!1},t.prototype.ctor=function(){return this instanceof re?re:t},t.prototype.addListener=function(t){t._n=t.next||Tt,t._e=t.error||Tt,t._c=t.complete||Tt,this._add(t)},t.prototype.removeListener=function(t){this._remove(t)},t.prototype.subscribe=function(t){return this.addListener(t),new kt(this,t)},t.prototype[Ot]=function(){return this},t.create=function(e){if(e){if("function"!=typeof e.start||"function"!=typeof e.stop)throw new Error("producer requires both start and stop functions");jt(e)}return new t(e)},t.createWithMemory=function(t){return t&&jt(t),new re(t)},t.never=function(){return new t({_start:Tt,_stop:Tt})},t.empty=function(){return new t({_start:function(t){t._c()},_stop:Tt})},t.throw=function(e){return new t({_start:function(t){t._e(e)},_stop:Tt})},t.from=function(e){if("function"==typeof e[Ot])return t.fromObservable(e);if("function"==typeof e.then)return t.fromPromise(e);if(Array.isArray(e))return t.fromArray(e);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},t.of=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.fromArray(e)},t.fromArray=function(e){return new t(new Ft(e))},t.fromPromise=function(e){return new t(new Gt(e))},t.fromObservable=function(e){if(void 0!==e.endWhen)return e;var n="function"==typeof e[Ot]?e[Ot]():e;return new t(new It(n))},t.periodic=function(e){return new t(new Bt(e))},t.prototype._map=function(t){return new(this.ctor())(new Xt(t,this))},t.prototype.map=function(t){return this._map(t)},t.prototype.mapTo=function(t){var e=this.map((function(){return t}));return e._prod.type="mapTo",e},t.prototype.filter=function(e){var n,o,r=this._prod;return new t(r instanceof Wt?new Wt((n=r.f,o=e,function(t){return n(t)&&o(t)}),r.ins):new Wt(e,this))},t.prototype.take=function(t){return new(this.ctor())(new ee(t,this))},t.prototype.drop=function(e){return new t(new Ht(e,this))},t.prototype.last=function(){return new t(new Zt(this))},t.prototype.startWith=function(t){return new re(new te(this,t))},t.prototype.endWhen=function(t){return new(this.ctor())(new Yt(t,this))},t.prototype.fold=function(t,e){return new re(new Jt(t,e,this))},t.prototype.replaceError=function(t){return new(this.ctor())(new Qt(t,this))},t.prototype.flatten=function(){return new t(new zt(this))},t.prototype.compose=function(t){return t(this)},t.prototype.remember=function(){return new re(new Kt(this))},t.prototype.debug=function(t){return new(this.ctor())(new Ut(this,t))},t.prototype.imitate=function(t){if(t instanceof re)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=t;for(var e=this._ils,n=e.length,o=0;o<n;o++)t._add(e[o]);this._ils=[]},t.prototype.shamefullySendNext=function(t){this._n(t)},t.prototype.shamefullySendError=function(t){this._e(t)},t.prototype.shamefullySendComplete=function(){this._c()},t.prototype.setDebugListener=function(t){t?(this._d=!0,t._n=t.next||Tt,t._e=t.error||Tt,t._c=t.complete||Tt,this._dl=t):(this._d=!1,this._dl=Nt)},t.merge=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new Mt(e))},t.combine=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new Rt(e))},t}(),oe=o.Stream=ne,re=function(t){function e(e){var n=t.call(this,e)||this;return n._has=!1,n}return At(e,t),e.prototype._n=function(e){this._v=e,this._has=!0,t.prototype._n.call(this,e)},e.prototype._add=function(t){var e=this._target;if(e)return e._add(t);var n=this._ils;if(n.push(t),n.length>1)this._has&&t._n(this._v);else if(this._stopID!==Nt)this._has&&t._n(this._v),clearTimeout(this._stopID),this._stopID=Nt;else if(this._has)t._n(this._v);else{var o=this._prod;o!==Nt&&o._start(this)}},e.prototype._stopNow=function(){this._has=!1,t.prototype._stopNow.call(this)},e.prototype._x=function(){this._has=!1,t.prototype._x.call(this)},e.prototype.map=function(t){return this._map(t)},e.prototype.mapTo=function(e){return t.prototype.mapTo.call(this,e)},e.prototype.take=function(e){return t.prototype.take.call(this,e)},e.prototype.endWhen=function(e){return t.prototype.endWhen.call(this,e)},e.prototype.replaceError=function(e){return t.prototype.replaceError.call(this,e)},e.prototype.remember=function(){return this},e.prototype.debug=function(e){return t.prototype.debug.call(this,e)},e}(ne),ie=o.MemoryStream=re,se=ne,ae=o.default=se,ce=e({__proto__:null,get MemoryStream(){return ie},get NO(){return Ct},get NO_IL(){return Et},get Stream(){return oe},default:ae},[o]),ue={};function le(){var t;return(t="undefined"!=typeof window?window:void 0!==n?n:this).Cyclejs=t.Cyclejs||{},(t=t.Cyclejs).adaptStream=t.adaptStream||function(t){return t},t}Object.defineProperty(ue,"__esModule",{value:!0}),ue.setAdapt=function(t){le().adaptStream=t};var pe=ue.adapt=function(t){return le().adaptStream(t)};var fe=0;function he(){return"cycle"+ ++fe}function de(t,e){void 0===e&&(e=he()),function(t,e){if("function"!=typeof t)throw new Error("First argument given to isolate() must be a 'dataflowComponent' function");if(null===e)throw new Error("Second argument given to isolate() must not be null")}(t,e);var n="object"==typeof e?he():"",o="string"==typeof e||"object"==typeof e?e:e.toString();return function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=function(t,e,n){var o={};return Object.keys(t).forEach((function(t){if("string"!=typeof e){var r=e[t];if(void 0===r){var i=e["*"];o[t]=void 0===i?n:i}else o[t]=r}else o[t]=e})),o}(e,o,n),a=function(t,e){var n={};for(var o in t){var r=t[o];t.hasOwnProperty(o)&&r&&null!==e[o]&&"function"==typeof r.isolateSource?n[o]=r.isolateSource(r,e[o]):t.hasOwnProperty(o)&&(n[o]=t[o])}return n}(e,s),c=function(t,e,n){var o={};for(var r in e){var i=t[r],s=e[r];e.hasOwnProperty(r)&&i&&null!==n[r]&&"function"==typeof i.isolateSink?o[r]=pe(i.isolateSink(ae.fromObservable(s),n[r])):e.hasOwnProperty(r)&&(o[r]=e[r])}return o}(e,t.apply(void 0,[a].concat(r)),s);return c}}de.reset=function(){return fe=0};var me={};Object.defineProperty(me,"__esModule",{value:!0});var ye=me.DropRepeatsOperator=void 0,ve=o,_e={},ge=function(){function t(t,e){this.ins=t,this.type="dropRepeats",this.out=null,this.v=_e,this.isEq=e||function(t,e){return t===e}}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.v=_e},t.prototype._n=function(t){var e=this.out;if(e){var n=this.v;n!==_e&&this.isEq(t,n)||(this.v=t,e._n(t))}},t.prototype._e=function(t){var e=this.out;e&&e._e(t)},t.prototype._c=function(){var t=this.out;t&&t._c()},t}();ye=me.DropRepeatsOperator=ge;var be=me.default=function(t){return void 0===t&&(t=void 0),function(e){return new ve.Stream(new ge(e,t))}},we=e({__proto__:null,get DropRepeatsOperator(){return ye},default:be},[me]),Se=function(){return Se=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Se.apply(this,arguments)};function Ae(t){return"string"==typeof t||"number"==typeof t?function(e){return void 0===e?void 0:e[t]}:t.get}function Ee(t){return"string"==typeof t||"number"==typeof t?function(e,n){var o,r;return Array.isArray(e)?function(t,e,n){if(n===t[e])return t;var o=parseInt(e);return void 0===n?t.filter((function(t,e){return e!==o})):t.map((function(t,e){return e===o?n:t}))}(e,t,n):void 0===e?((o={})[t]=n,o):Se({},e,((r={})[t]=n,r))}:t.set}function Oe(t,e){return t.select(e)}function Ne(t,e){var n=Ae(e),o=Ee(e);return t.map((function(t){return function(e){var r=n(e),i=t(r);return r===i?e:o(e,i)}}))}var Ce=function(){function t(t,e){this.isolateSource=Oe,this.isolateSink=Ne,this._stream=t.filter((function(t){return void 0!==t})).compose(be()).remember(),this._name=e,this.stream=pe(this._stream),this._stream._isCycleSource=e}return t.prototype.select=function(e){var n=Ae(e);return new t(this._stream.map(n),this._name)},t}(),Te=function(){function t(t,e,n){this.ins=n,this.out=t,this.p=e}return t.prototype._n=function(t){this.p;var e=this.out;null!==e&&e._n(t)},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){},t}(),$e=function(){function t(t,e){this.type="pickMerge",this.ins=e,this.out=null,this.sel=t,this.ils=new Map,this.inst=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this);var t=this.ils;t.forEach((function(e,n){e.ins._remove(e),e.ins=null,e.out=null,t.delete(n)})),t.clear(),this.out=null,this.ils=new Map,this.inst=null},t.prototype._n=function(t){this.inst=t;for(var e=t.arr,n=this.ils,o=this.out,r=this.sel,i=e.length,s=0;s<i;++s){var a=e[s],c=a._key,u=ae.fromObservable(a[r]||ae.never());n.has(c)||(n.set(c,new Te(o,this,u)),u._add(n.get(c)))}n.forEach((function(e,o){t.dict.has(o)&&t.dict.get(o)||(e.ins._remove(e),e.ins=null,e.out=null,n.delete(o))}))},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){var t=this.out;null!==t&&t._c()},t}();var xe=function(){function t(t,e,n,o){this.key=t,this.out=e,this.p=n,this.val=Ct,this.ins=o}return t.prototype._n=function(t){this.p;var e=this.out;this.val=t,null!==e&&this.p.up()},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){},t}(),De=function(){function t(t,e){this.type="combine",this.ins=e,this.sel=t,this.out=null,this.ils=new Map,this.inst=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this);var t=this.ils;t.forEach((function(t){t.ins._remove(t),t.ins=null,t.out=null,t.val=null})),t.clear(),this.out=null,this.ils=new Map,this.inst=null},t.prototype.up=function(){for(var t=this.inst.arr,e=t.length,n=this.ils,o=Array(e),r=0;r<e;++r){var i=t[r]._key;if(!n.has(i))return;var s=n.get(i).val;if(s===Ct)return;o[r]=s}this.out._n(o)},t.prototype._n=function(t){this.inst=t;var e=t.arr,n=this.ils,o=this.out,r=this.sel,i=t.dict,s=e.length,a=!1;if(n.forEach((function(t,e){i.has(e)||(t.ins._remove(t),t.ins=null,t.out=null,t.val=null,n.delete(e),a=!0)})),0!==s){for(var c=0;c<s;++c){var u=e[c],l=u._key;if(!u[r])throw new Error("pickCombine found an undefined child sink stream");var p=ae.fromObservable(u[r]);n.has(l)||(n.set(l,new xe(l,o,this,p)),p._add(n.get(l)))}a&&this.up()}else o._n([])},t.prototype._e=function(t){var e=this.out;null!==e&&e._e(t)},t.prototype._c=function(){var t=this.out;null!==t&&t._c()},t}();var je=function(){return je=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},je.apply(this,arguments)},ke=function(){function t(t){this._instances$=t}return t.prototype.pickMerge=function(t){return pe(this._instances$.compose(function(t){return function(e){return new oe(new $e(t,e))}}(t)))},t.prototype.pickCombine=function(t){return pe(this._instances$.compose(function(t){return function(e){return new oe(new De(t,e))}}(t)))},t}();function Le(t){return{"*":null}}function Ie(t,e){return{get:function(n){if(void 0!==n)for(var o=0,r=n.length;o<r;++o)if(""+t(n[o],o)===e)return n[o]},set:function(n,o){return void 0===n?[o]:void 0===o?n.filter((function(n,o){return""+t(n,o)!==e})):n.map((function(n,r){return""+t(n,r)===e?o:n}))}}}var Me={get:function(t){return t},set:function(t,e){return e}};var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});var Re=o,Fe=function(){function t(t){this.streams=t,this.type="concat",this.out=null,this.i=0}return t.prototype._start=function(t){this.out=t,this.streams[this.i]._add(this)},t.prototype._stop=function(){var t=this.streams;this.i<t.length&&t[this.i]._remove(this),this.i=0,this.out=null},t.prototype._n=function(t){var e=this.out;e&&e._n(t)},t.prototype._e=function(t){var e=this.out;e&&e._e(t)},t.prototype._c=function(){var t=this.out;if(t){var e=this.streams;e[this.i]._remove(this),++this.i<e.length?e[this.i]._add(this):t._c()}},t}();var Ge=Pe.default=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Re.Stream(new Fe(t))},Be=e({__proto__:null,default:Ge},[Pe]),Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});var He=Ue.default=function(){return"undefined"!=typeof queueMicrotask?queueMicrotask:"undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof process?process.nextTick:setTimeout},Ve=He();function Ye(t){if(We(t)){for(;t&&We(t);){t=qe(t).parent}return null!=t?t:null}return t.parentNode}function We(t){return 11===t.nodeType}function qe(t,e){var n,o,r;const i=t;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=e?e:null),null!==(o=i.firstChildNode)&&void 0!==o||(i.firstChildNode=t.firstChild),null!==(r=i.lastChildNode)&&void 0!==r||(i.lastChildNode=t.lastChild),i}const ze={createElement:function(t,e){return document.createElement(t,e)},createElementNS:function(t,e,n){return document.createElementNS(t,e,n)},createTextNode:function(t){return document.createTextNode(t)},createDocumentFragment:function(){return qe(document.createDocumentFragment())},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){if(We(t)){let e=t;for(;e&&We(e);){e=qe(e).parent}t=null!=e?e:t}We(e)&&(e=qe(e,t)),n&&We(n)&&(n=qe(n).firstChildNode),t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){We(e)&&(e=qe(e,t)),t.appendChild(e)},parentNode:Ye,nextSibling:function(t){var e;if(We(t)){const n=qe(t),o=Ye(n);if(o&&n.lastChildNode){const t=Array.from(o.childNodes),r=t.indexOf(n.lastChildNode);return null!==(e=t[r+1])&&void 0!==e?e:null}return null}return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},getTextContent:function(t){return t.textContent},isElement:function(t){return 1===t.nodeType},isText:function(t){return 3===t.nodeType},isComment:function(t){return 8===t.nodeType},isDocumentFragment:We};function Je(t,e,n,o,r){return{sel:t,data:e,children:n,text:o,elm:r,key:void 0===e?void 0:e.key}}const Ze=Array.isArray;function Xe(t){return"string"==typeof t||"number"==typeof t||t instanceof String||t instanceof Number}function Ke(t){return void 0===t}function Qe(t){return void 0!==t}const tn=Je("",{},[],void 0,void 0);function en(t,e){var n,o;const r=t.key===e.key,i=(null===(n=t.data)||void 0===n?void 0:n.is)===(null===(o=e.data)||void 0===o?void 0:o.is),s=t.sel===e.sel,a=!(!t.sel&&t.sel===e.sel)||typeof t.text==typeof e.text;return s&&r&&i&&a}function nn(){throw new Error("The document fragment is not supported on this platform.")}function on(t,e,n){var o;const r={};for(let i=e;i<=n;++i){const e=null===(o=t[i])||void 0===o?void 0:o.key;void 0!==e&&(r[e]=i)}return r}const rn=["create","update","remove","destroy","pre","post"];function sn(t,e,n){const o={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=void 0!==e?e:ze;for(const e of rn)for(const n of t){const t=n[e];void 0!==t&&o[e].push(t)}function i(t){const e=t.id?"#"+t.id:"",n=t.getAttribute("class"),o=n?"."+n.split(" ").join("."):"";return Je(r.tagName(t).toLowerCase()+e+o,{},[],void 0,t)}function s(t){return Je(void 0,{},[],void 0,t)}function a(t,e){return function(){if(0==--e){const e=r.parentNode(t);r.removeChild(e,t)}}}function c(t,e){var i,s,a,u;let l,p=t.data;if(void 0!==p){const e=null===(i=p.hook)||void 0===i?void 0:i.init;Qe(e)&&(e(t),p=t.data)}const f=t.children,h=t.sel;if("!"===h)Ke(t.text)&&(t.text=""),t.elm=r.createComment(t.text);else if(void 0!==h){const n=h.indexOf("#"),i=h.indexOf(".",n),a=n>0?n:h.length,u=i>0?i:h.length,d=-1!==n||-1!==i?h.slice(0,Math.min(a,u)):h,m=t.elm=Qe(p)&&Qe(l=p.ns)?r.createElementNS(l,d,p):r.createElement(d,p);for(a<u&&m.setAttribute("id",h.slice(a+1,u)),i>0&&m.setAttribute("class",h.slice(u+1).replace(/\./g," ")),l=0;l<o.create.length;++l)o.create[l](tn,t);if(Ze(f))for(l=0;l<f.length;++l){const t=f[l];null!=t&&r.appendChild(m,c(t,e))}else Xe(t.text)&&r.appendChild(m,r.createTextNode(t.text));const y=t.data.hook;Qe(y)&&(null===(s=y.create)||void 0===s||s.call(y,tn,t),y.insert&&e.push(t))}else if((null===(a=null==n?void 0:n.experimental)||void 0===a?void 0:a.fragments)&&t.children){for(t.elm=(null!==(u=r.createDocumentFragment)&&void 0!==u?u:nn)(),l=0;l<o.create.length;++l)o.create[l](tn,t);for(l=0;l<t.children.length;++l){const n=t.children[l];null!=n&&r.appendChild(t.elm,c(n,e))}}else t.elm=r.createTextNode(t.text);return t.elm}function u(t,e,n,o,i,s){for(;o<=i;++o){const i=n[o];null!=i&&r.insertBefore(t,c(i,s),e)}}function l(t){var e,n;const r=t.data;if(void 0!==r){null===(n=null===(e=null==r?void 0:r.hook)||void 0===e?void 0:e.destroy)||void 0===n||n.call(e,t);for(let e=0;e<o.destroy.length;++e)o.destroy[e](t);if(void 0!==t.children)for(let e=0;e<t.children.length;++e){const n=t.children[e];null!=n&&"string"!=typeof n&&l(n)}}}function p(t,e,n,i){for(var s,c;n<=i;++n){let i,u;const f=e[n];if(null!=f)if(Qe(f.sel)){l(f),i=o.remove.length+1,u=a(f.elm,i);for(let t=0;t<o.remove.length;++t)o.remove[t](f,u);const t=null===(c=null===(s=null==f?void 0:f.data)||void 0===s?void 0:s.hook)||void 0===c?void 0:c.remove;Qe(t)?t(f,u):u()}else f.children?(l(f),p(t,f.children,0,f.children.length-1)):r.removeChild(t,f.elm)}}function f(t,e,n){var i,s,a,l,h,d,m,y;const v=null===(i=e.data)||void 0===i?void 0:i.hook;null===(s=null==v?void 0:v.prepatch)||void 0===s||s.call(v,t,e);const _=e.elm=t.elm;if(t===e)return;if(void 0!==e.data||Qe(e.text)&&e.text!==t.text){null!==(a=e.data)&&void 0!==a||(e.data={}),null!==(l=t.data)&&void 0!==l||(t.data={});for(let n=0;n<o.update.length;++n)o.update[n](t,e);null===(m=null===(d=null===(h=e.data)||void 0===h?void 0:h.hook)||void 0===d?void 0:d.update)||void 0===m||m.call(d,t,e)}const g=t.children,b=e.children;Ke(e.text)?Qe(g)&&Qe(b)?g!==b&&function(t,e,n,o){let i,s,a,l,h=0,d=0,m=e.length-1,y=e[0],v=e[m],_=n.length-1,g=n[0],b=n[_];for(;h<=m&&d<=_;)null==y?y=e[++h]:null==v?v=e[--m]:null==g?g=n[++d]:null==b?b=n[--_]:en(y,g)?(f(y,g,o),y=e[++h],g=n[++d]):en(v,b)?(f(v,b,o),v=e[--m],b=n[--_]):en(y,b)?(f(y,b,o),r.insertBefore(t,y.elm,r.nextSibling(v.elm)),y=e[++h],b=n[--_]):en(v,g)?(f(v,g,o),r.insertBefore(t,v.elm,y.elm),v=e[--m],g=n[++d]):(void 0===i&&(i=on(e,h,m)),s=i[g.key],Ke(s)?r.insertBefore(t,c(g,o),y.elm):(a=e[s],a.sel!==g.sel?r.insertBefore(t,c(g,o),y.elm):(f(a,g,o),e[s]=void 0,r.insertBefore(t,a.elm,y.elm))),g=n[++d]);d<=_&&(l=null==n[_+1]?null:n[_+1].elm,u(t,l,n,d,_,o)),h<=m&&p(t,e,h,m)}(_,g,b,n):Qe(b)?(Qe(t.text)&&r.setTextContent(_,""),u(_,null,b,0,b.length-1,n)):Qe(g)?p(_,g,0,g.length-1):Qe(t.text)&&r.setTextContent(_,""):t.text!==e.text&&(Qe(g)&&p(_,g,0,g.length-1),r.setTextContent(_,e.text)),null===(y=null==v?void 0:v.postpatch)||void 0===y||y.call(v,t,e)}return function(t,e){let n,a,u;const l=[];for(n=0;n<o.pre.length;++n)o.pre[n]();for(!function(t,e){return t.isElement(e)}(r,t)?function(t,e){return t.isDocumentFragment(e)}(r,t)&&(t=s(t)):t=i(t),en(t,e)?f(t,e,l):(a=t.elm,u=r.parentNode(a),c(e,l),null!==u&&(r.insertBefore(u,e.elm,r.nextSibling(a)),p(u,[t],0,0))),n=0;n<l.length;++n)l[n].data.hook.insert(l[n]);for(n=0;n<o.post.length;++n)o.post[n]();return e}}function an(t,e,n){if(t.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==e)for(let t=0;t<e.length;++t){const n=e[t];if("string"==typeof n)continue;const o=n.data;void 0!==o&&an(o,n.children,n.sel)}}function cn(t,e,n){let o,r,i,s={};if(void 0!==n?(null!==e&&(s=e),Ze(n)?o=n:Xe(n)?r=n.toString():n&&n.sel&&(o=[n])):null!=e&&(Ze(e)?o=e:Xe(e)?r=e.toString():e&&e.sel?o=[e]:s=e),void 0!==o)for(i=0;i<o.length;++i)Xe(o[i])&&(o[i]=Je(void 0,void 0,void 0,o[i],void 0));return"s"!==t[0]||"v"!==t[1]||"g"!==t[2]||3!==t.length&&"."!==t[3]&&"#"!==t[3]||an(s,o,t),Je(t,s,o,r,void 0)}function un(t,e){const n=void 0!==e?e:ze;let o;if(n.isElement(t)){const o=t.id?"#"+t.id:"",r=t.getAttribute("class"),i=r?"."+r.split(" ").join("."):"",s=n.tagName(t).toLowerCase()+o+i,a={},c={},u={},l=[];let p,f,h;const d=t.attributes,m=t.childNodes;for(f=0,h=d.length;f<h;f++)p=d[f].nodeName,"d"===p[0]&&"a"===p[1]&&"t"===p[2]&&"a"===p[3]&&"-"===p[4]?c[p.slice(5)]=d[f].nodeValue||"":"id"!==p&&"class"!==p&&(a[p]=d[f].nodeValue);for(f=0,h=m.length;f<h;f++)l.push(un(m[f],e));return Object.keys(a).length>0&&(u.attrs=a),Object.keys(c).length>0&&(u.dataset=c),"s"!==s[0]||"v"!==s[1]||"g"!==s[2]||3!==s.length&&"."!==s[3]&&"#"!==s[3]||an(u,l,s),Je(s,u,l,void 0,t)}return n.isText(t)?(o=n.getTextContent(t),Je(void 0,void 0,void 0,o,t)):n.isComment(t)?(o=n.getTextContent(t),Je("!",{},[],o,t)):Je("",{},[],void 0,t)}function ln(t,e){let n;const o=e.elm;let r=t.data.attrs,i=e.data.attrs;if((r||i)&&r!==i){for(n in r=r||{},i=i||{},i){const t=i[n];r[n]!==t&&(!0===t?o.setAttribute(n,""):!1===t?o.removeAttribute(n):120!==n.charCodeAt(0)?o.setAttribute(n,t):58===n.charCodeAt(3)?o.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,t):58===n.charCodeAt(5)?o.setAttributeNS("http://www.w3.org/1999/xlink",n,t):o.setAttribute(n,t))}for(n in r)n in i||o.removeAttribute(n)}}const pn={create:ln,update:ln};function fn(t,e){let n,o;const r=e.elm;let i=t.data.class,s=e.data.class;if((i||s)&&i!==s){for(o in i=i||{},s=s||{},i)i[o]&&!Object.prototype.hasOwnProperty.call(s,o)&&r.classList.remove(o);for(o in s)n=s[o],n!==i[o]&&r.classList[n?"add":"remove"](o)}}const hn={create:fn,update:fn},dn=/[A-Z]/g;function mn(t,e){const n=e.elm;let o,r=t.data.dataset,i=e.data.dataset;if(!r&&!i)return;if(r===i)return;r=r||{},i=i||{};const s=n.dataset;for(o in r)i[o]||(s?o in s&&delete s[o]:n.removeAttribute("data-"+o.replace(dn,"-$&").toLowerCase()));for(o in i)r[o]!==i[o]&&(s?s[o]=i[o]:n.setAttribute("data-"+o.replace(dn,"-$&").toLowerCase(),i[o]))}const yn={create:mn,update:mn};function vn(t,e){let n,o,r;const i=e.elm;let s=t.data.props,a=e.data.props;if((s||a)&&s!==a)for(n in s=s||{},a=a||{},a)o=a[n],r=s[n],r===o||"value"===n&&i[n]===o||(i[n]=o)}const _n={create:vn,update:vn},gn="undefined"!=typeof window&&window.requestAnimationFrame.bind(window)||setTimeout,bn=function(t){gn((function(){gn(t)}))};let wn=!1;function Sn(t,e,n){bn((function(){t[e]=n}))}function An(t,e){let n,o;const r=e.elm;let i=t.data.style,s=e.data.style;if(!i&&!s)return;if(i===s)return;i=i||{},s=s||{};const a="delayed"in i;for(o in i)s[o]||("-"===o[0]&&"-"===o[1]?r.style.removeProperty(o):r.style[o]="");for(o in s)if(n=s[o],"delayed"===o&&s.delayed)for(const t in s.delayed)n=s.delayed[t],a&&n===i.delayed[t]||Sn(r.style,t,n);else"remove"!==o&&n!==i[o]&&("-"===o[0]&&"-"===o[1]?r.style.setProperty(o,n):r.style[o]=n)}const En={pre:function(){wn=!1},create:An,update:An,destroy:function(t){let e,n;const o=t.elm,r=t.data.style;if(r&&(e=r.destroy))for(n in e)o.style[n]=e[n]},remove:function(t,e){const n=t.data.style;if(!n||!n.remove)return void e();let o;wn||(t.elm.offsetLeft,wn=!0);const r=t.elm;let i=0;const s=n.remove;let a=0;const c=[];for(o in s)c.push(o),r.style[o]=s[o];const u=getComputedStyle(r)["transition-property"].split(", ");for(;i<u.length;++i)-1!==c.indexOf(u[i])&&a++;r.addEventListener("transitionend",(function(t){t.target===r&&--a,0===a&&e()}))}};function On(t,e){e.elm=t.elm,t.data.fn=e.data.fn,t.data.args=e.data.args,t.data.isolate=e.data.isolate,e.data=t.data,e.children=t.children,e.text=t.text,e.elm=t.elm}function Nn(t){var e=t.data;On(e.fn.apply(void 0,e.args),t)}function Cn(t,e){var n,o=t.data,r=e.data,i=o.args,s=r.args;for(o.fn===r.fn&&i.length===s.length||On(r.fn.apply(void 0,s),e),n=0;n<s.length;++n)if(i[n]!==s[n])return void On(r.fn.apply(void 0,s),e);On(t,e)}function Tn(t,e,n,o,r){void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r=!1);var i=null;return oe.create({start:function(s){i=o?function(t){xn(t,o),s.next(t)}:function(t){s.next(t)},t.addEventListener(e,i,{capture:n,passive:r})},stop:function(){t.removeEventListener(e,i,n),i=null}})}function $n(t,e){for(var n=Object.keys(t),o=n.length,r=0;r<o;r++){var i=n[r];if("object"==typeof t[i]&&"object"==typeof e[i]){if(!$n(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1}return!0}function xn(t,e){if(e)if("boolean"==typeof e)t.preventDefault();else if("function"==typeof e)e(t)&&t.preventDefault();else{if("object"!=typeof e)throw new Error("preventDefault has to be either a boolean, predicate function or object");$n(e,t)&&t.preventDefault()}}var Dn=function(){function t(t){this._name=t}return t.prototype.select=function(t){return this},t.prototype.elements=function(){var t=pe(ae.of([document]));return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(ae.of(document));return t._isCycleSource=this._name,t},t.prototype.events=function(t,e,n){var o;void 0===e&&(e={}),o=Tn(document,t,e.useCapture,e.preventDefault);var r=pe(o);return r._isCycleSource=this._name,r},t}(),jn=function(){function t(t){this._name=t}return t.prototype.select=function(t){return this},t.prototype.elements=function(){var t=pe(ae.of([document.body]));return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(ae.of(document.body));return t._isCycleSource=this._name,t},t.prototype.events=function(t,e,n){var o;void 0===e&&(e={}),o=Tn(document.body,t,e.useCapture,e.preventDefault);var r=pe(o);return r._isCycleSource=this._name,r},t}();function kn(t){if("string"!=typeof t&&(e=t,!("object"==typeof HTMLElement?e instanceof HTMLElement||e instanceof DocumentFragment:e&&"object"==typeof e&&null!==e&&(1===e.nodeType||11===e.nodeType)&&"string"==typeof e.nodeName)))throw new Error("Given container is not a DOM element neither a selector string.");var e}function Ln(t){for(var e="",n=t.length-1;n>=0&&"selector"===t[n].type;n--)e=t[n].scope+" "+e;return e.trim()}function In(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].type!==e[n].type||t[n].scope!==e[n].scope)return!1;return!0}var Mn=function(){function t(t,e){this.namespace=t,this.isolateModule=e,this._namespace=t.filter((function(t){return"selector"!==t.type}))}return t.prototype.isDirectlyInScope=function(t){var e=this.isolateModule.getNamespace(t);if(!e)return!1;if(this._namespace.length>e.length||!In(this._namespace,e.slice(0,this._namespace.length)))return!1;for(var n=this._namespace.length;n<e.length;n++)if("total"===e[n].type)return!1;return!0},t}();var Pn=function(){function t(t,e){this.namespace=t,this.isolateModule=e}return t.prototype.call=function(){var t=this.namespace,e=Ln(t),n=new Mn(t,this.isolateModule),o=this.isolateModule.getElement(t.filter((function(t){return"selector"!==t.type})));return void 0===o?[]:""===e?[o]:function(t){return Array.prototype.slice.call(t)}(o.querySelectorAll(e)).filter(n.isDirectlyInScope,n).concat(o.matches(e)?[o]:[])},t}(),Rn=function(){return Rn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Rn.apply(this,arguments)};function Fn(t){return{type:(e=t,e.length>1&&("."===e[0]||"#"===e[0])?"sibling":"total"),scope:t};var e}var Gn=function(){function t(e,n,o,r,i,s){var a;void 0===o&&(o=[]),this._rootElement$=e,this._sanitation$=n,this._namespace=o,this._isolateModule=r,this._eventDelegator=i,this._name=s,this.isolateSource=function(e,n){return new t(e._rootElement$,e._sanitation$,e._namespace.concat(Fn(n)),e._isolateModule,e._eventDelegator,e._name)},this.isolateSink=(a=this._namespace,function(t,e){return":root"===e?t:t.map((function(t){if(!t)return t;var n=Fn(e),o=Rn({},t,{data:Rn({},t.data,{isolate:t.data&&Array.isArray(t.data.isolate)?t.data.isolate:a.concat([n])})});return Rn({},o,{key:void 0!==o.key?o.key:JSON.stringify(o.data.isolate)})}))})}return t.prototype._elements=function(){if(0===this._namespace.length)return this._rootElement$.map((function(t){return[t]}));var t=new Pn(this._namespace,this._isolateModule);return this._rootElement$.map((function(){return t.call()}))},t.prototype.elements=function(){var t=pe(this._elements().remember());return t._isCycleSource=this._name,t},t.prototype.element=function(){var t=pe(this._elements().filter((function(t){return t.length>0})).map((function(t){return t[0]})).remember());return t._isCycleSource=this._name,t},Object.defineProperty(t.prototype,"namespace",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),t.prototype.select=function(e){if("string"!=typeof e)throw new Error("DOM driver's select() expects the argument to be a string as a CSS selector");if("document"===e)return new Dn(this._name);if("body"===e)return new jn(this._name);var n=":root"===e?[]:this._namespace.concat({type:"selector",scope:e.trim()});return new t(this._rootElement$,this._sanitation$,n,this._isolateModule,this._eventDelegator,this._name)},t.prototype.events=function(t,e,n){if(void 0===e&&(e={}),"string"!=typeof t)throw new Error("DOM driver's events() expects argument to be a string representing the event type to listen for.");var o=this._eventDelegator.addEventListener(t,this._namespace,e,n),r=pe(o);return r._isCycleSource=this._name,r},t.prototype.dispose=function(){this._sanitation$.shamefullySendNext(null)},t}(),Bn={},Un=n&&n.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,r++)o[r]=i[s];return o};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.SampleCombineOperator=Bn.SampleCombineListener=void 0;var Hn=o,Vn={},Yn=function(){function t(t,e){this.i=t,this.p=e,e.ils[t]=this}return t.prototype._n=function(t){var e=this.p;e.out!==Vn&&e.up(t,this.i)},t.prototype._e=function(t){this.p._e(t)},t.prototype._c=function(){this.p.down(this.i,this)},t}();Bn.SampleCombineListener=Yn;var Wn,qn=function(){function t(t,e){this.type="sampleCombine",this.ins=t,this.others=e,this.out=Vn,this.ils=[],this.Nn=0,this.vals=[]}return t.prototype._start=function(t){this.out=t;for(var e=this.others,n=this.Nn=e.length,o=this.vals=new Array(n),r=0;r<n;r++)o[r]=Vn,e[r]._add(new Yn(r,this));this.ins._add(this)},t.prototype._stop=function(){var t=this.others,e=t.length,n=this.ils;this.ins._remove(this);for(var o=0;o<e;o++)t[o]._remove(n[o]);this.out=Vn,this.vals=[],this.ils=[]},t.prototype._n=function(t){var e=this.out;e!==Vn&&(this.Nn>0||e._n(Un([t],this.vals)))},t.prototype._e=function(t){var e=this.out;e!==Vn&&e._e(t)},t.prototype._c=function(){var t=this.out;t!==Vn&&t._c()},t.prototype.up=function(t,e){var n=this.vals[e];this.Nn>0&&n===Vn&&this.Nn--,this.vals[e]=t},t.prototype.down=function(t,e){this.others[t]._remove(e)},t}();Bn.SampleCombineOperator=qn,Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return new Hn.Stream(new qn(e,t))}};var zn=Bn.default=Wn;function Jn(t){if(!t.sel)return{tagName:"",id:"",className:""};var e=t.sel,n=e.indexOf("#"),o=e.indexOf(".",n),r=n>0?n:e.length,i=o>0?o:e.length;return{tagName:-1!==n||-1!==o?e.slice(0,Math.min(r,i)):e,id:r<i?e.slice(r+1,i):void 0,className:o>0?e.slice(i+1).replace(/\./g," "):void 0}}Object.assign;var Zn=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()).Symbol;"function"==typeof Zn&&Zn("parent");var Xn=function(){function t(t){this.rootElement=t}return t.prototype.call=function(t){if(11===this.rootElement.nodeType)return this.wrapDocFrag(null===t?[]:[t]);if(null===t)return this.wrap([]);var e=Jn(t),n=e.tagName,o=e.id,r=function(t){var e=Jn(t).className,n=void 0===e?"":e;if(!t.data)return n;var o=t.data,r=o.class,i=o.props;return r&&(n+=" "+Object.keys(r).filter((function(t){return r[t]})).join(" ")),i&&i.className&&(n+=" "+i.className),n&&n.trim()}(t),i=((t.data||{}).props||{}).id,s=void 0===i?o:i;return"string"==typeof s&&s.toUpperCase()===this.rootElement.id.toUpperCase()&&n.toUpperCase()===this.rootElement.tagName.toUpperCase()&&r.toUpperCase()===this.rootElement.className.toUpperCase()?t:this.wrap([t])},t.prototype.wrapDocFrag=function(t){return Je("",{isolate:[]},t,void 0,this.rootElement)},t.prototype.wrap=function(t){var e=this.rootElement,n=e.tagName,o=e.id,r=e.className,i=o?"#"+o:"",s=r?"."+r.split(" ").join("."):"",a=cn(""+n.toLowerCase()+i+s,{},t);return a.data=a.data||{},a.data.isolate=a.data.isolate||[],a},t}(),Kn=[En,hn,_n,pn,yn],Qn=function(){function t(t){this.mapper=t,this.tree=[void 0,{}]}return t.prototype.set=function(t,e,n){for(var o=this.tree,r=void 0!==n?n:t.length,i=0;i<r;i++){var s=this.mapper(t[i]),a=o[1][s];a||(a=[void 0,{}],o[1][s]=a),o=a}o[0]=e},t.prototype.getDefault=function(t,e,n){return this.get(t,e,n)},t.prototype.get=function(t,e,n){for(var o=this.tree,r=void 0!==n?n:t.length,i=0;i<r;i++){var s=this.mapper(t[i]),a=o[1][s];if(!a){if(!e)return;a=[void 0,{}],o[1][s]=a}o=a}return e&&!o[0]&&(o[0]=e()),o[0]},t.prototype.delete=function(t){for(var e=this.tree,n=0;n<t.length-1;n++){var o=e[1][this.mapper(t[n])];if(!o)return;e=o}delete e[1][this.mapper(t[t.length-1])]},t}(),to=function(){function t(){this.namespaceTree=new Qn((function(t){return t.scope})),this.namespaceByElement=new Map,this.vnodesBeingRemoved=[]}return t.prototype.setEventDelegator=function(t){this.eventDelegator=t},t.prototype.insertElement=function(t,e){this.namespaceByElement.set(e,t),this.namespaceTree.set(t,e)},t.prototype.removeElement=function(t){this.namespaceByElement.delete(t);var e=this.getNamespace(t);e&&this.namespaceTree.delete(e)},t.prototype.getElement=function(t,e){return this.namespaceTree.get(t,void 0,e)},t.prototype.getRootElement=function(t){if(this.namespaceByElement.has(t))return t;for(var e=t;!this.namespaceByElement.has(e);){if(!(e=e.parentNode))return;if("HTML"===e.tagName)throw new Error("No root element found, this should not happen at all")}return e},t.prototype.getNamespace=function(t){var e=this.getRootElement(t);if(e)return this.namespaceByElement.get(e)},t.prototype.createModule=function(){var t=this;return{create:function(e,n){var o=n.elm,r=n.data,i=(void 0===r?{}:r).isolate;Array.isArray(i)&&t.insertElement(i,o)},update:function(e,n){var o=e.elm,r=e.data,i=void 0===r?{}:r,s=n.elm,a=n.data,c=void 0===a?{}:a,u=i.isolate,l=c.isolate;In(u,l)||Array.isArray(u)&&t.removeElement(o),Array.isArray(l)&&t.insertElement(l,s)},destroy:function(e){t.vnodesBeingRemoved.push(e)},remove:function(e,n){t.vnodesBeingRemoved.push(e),n()},post:function(){for(var e=t.vnodesBeingRemoved,n=e.length-1;n>=0;n--){var o=e[n],r=void 0!==o.data?o.data.isolation:void 0;void 0!==r&&t.removeElement(r),t.eventDelegator.removeElement(o.elm,r)}t.vnodesBeingRemoved=[]}}},t}(),eo=function(){function t(){this.arr=[],this.prios=[]}return t.prototype.add=function(t,e){for(var n=0;n<this.arr.length;n++)if(this.prios[n]<e)return this.arr.splice(n,0,t),void this.prios.splice(n,0,e);this.arr.push(t),this.prios.push(e)},t.prototype.forEach=function(t){for(var e=0;e<this.arr.length;e++)t(this.arr[e],e,this.arr)},t.prototype.delete=function(t){for(var e=0;e<this.arr.length;e++)if(this.arr[e]===t)return this.arr.splice(e,1),void this.prios.splice(e,1)},t}(),no=function(){return no=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},no.apply(this,arguments)},oo=["blur","canplay","canplaythrough","durationchange","emptied","ended","focus","load","loadeddata","loadedmetadata","mouseenter","mouseleave","pause","play","playing","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","unload","volumechange","waiting"],ro=function(){function t(t,e){var n=this;this.rootElement$=t,this.isolateModule=e,this.virtualListeners=new Qn((function(t){return t.scope})),this.nonBubblingListenersToAdd=new Set,this.virtualNonBubblingListener=[],this.isolateModule.setEventDelegator(this),this.domListeners=new Map,this.domListenersToAdd=new Map,this.nonBubblingListeners=new Map,t.addListener({next:function(t){n.origin!==t&&(n.origin=t,n.resetEventListeners(),n.domListenersToAdd.forEach((function(t,e){return n.setupDOMListener(e,t)})),n.domListenersToAdd.clear()),n.nonBubblingListenersToAdd.forEach((function(t){n.setupNonBubblingListener(t)}))}})}return t.prototype.addEventListener=function(t,e,n,o){var r,i=ae.never(),s=new Mn(e,this.isolateModule);if(void 0===o?-1===oo.indexOf(t):o)return this.domListeners.has(t)||this.setupDOMListener(t,!!n.passive),r=this.insertListener(i,s,t,n),i;var a=[];this.nonBubblingListenersToAdd.forEach((function(t){return a.push(t)}));for(var c=void 0,u=0,l=a.length,p=function(n){n[0];var o=n[1],r=n[2];return n[3],t===o&&In(r.namespace,e)};!c&&u<l;){var f=a[u];c=p(f)?f:c,u++}var h,d=c;if(d){var m=d[0];h=m}else{var y=new Pn(e,this.isolateModule);r=this.insertListener(i,s,t,n),d=[i,t,y,r],h=i,this.nonBubblingListenersToAdd.add(d),this.setupNonBubblingListener(d)}var v=this,_=null;return ae.create({start:function(t){_=h.subscribe(t)},stop:function(){d[0];var t=d[1],e=d[2];d[3],e.call().forEach((function(e){var n=e.subs;n&&n[t]&&(n[t].unsubscribe(),delete n[t])})),v.nonBubblingListenersToAdd.delete(d),_.unsubscribe()}})},t.prototype.removeElement=function(t,e){void 0!==e&&this.virtualListeners.delete(e);var n=[];this.nonBubblingListeners.forEach((function(e,o){if(e.has(t)){n.push([o,t]);var r=t.subs;r&&Object.keys(r).forEach((function(t){r[t].unsubscribe()}))}}));for(var o=0;o<n.length;o++){var r=this.nonBubblingListeners.get(n[o][0]);r&&(r.delete(n[o][1]),0===r.size?this.nonBubblingListeners.delete(n[o][0]):this.nonBubblingListeners.set(n[o][0],r))}},t.prototype.insertListener=function(t,e,n,o){var r=[],i=e._namespace,s=i.length;do{r.push(this.getVirtualListeners(n,i,!0,s)),s--}while(s>=0&&"total"!==i[s].type);for(var a=no({},o,{scopeChecker:e,subject:t,bubbles:!!o.bubbles,useCapture:!!o.useCapture,passive:!!o.passive}),c=0;c<r.length;c++)r[c].add(a,i.length);return a},t.prototype.getVirtualListeners=function(t,e,n,o){void 0===n&&(n=!1);var r=void 0!==o?o:e.length;if(!n)for(var i=r-1;i>=0;i--){if("total"===e[i].type){r=i+1;break}r=i}var s=this.virtualListeners.getDefault(e,(function(){return new Map}),r);return s.has(t)||s.set(t,new eo),s.get(t)},t.prototype.setupDOMListener=function(t,e){var n=this;if(this.origin){var o=Tn(this.origin,t,!1,!1,e).subscribe({next:function(o){return n.onEvent(t,o,e)},error:function(){},complete:function(){}});this.domListeners.set(t,{sub:o,passive:e})}else this.domListenersToAdd.set(t,e)},t.prototype.setupNonBubblingListener=function(t){t[0];var e=t[1],n=t[2],o=t[3];if(this.origin){var r=n.call();if(r.length){var i=this;r.forEach((function(t){var n,r=t.subs;if(!r||!r[e]){var s=Tn(t,e,!1,!1,o.passive).subscribe({next:function(t){return i.onEvent(e,t,!!o.passive,!1)},error:function(){},complete:function(){}});i.nonBubblingListeners.has(e)||i.nonBubblingListeners.set(e,new Map);var a=i.nonBubblingListeners.get(e);if(!a)return;a.set(t,{sub:s,destination:o}),t.subs=no({},r,((n={})[e]=s,n))}}))}}},t.prototype.resetEventListeners=function(){for(var t=this.domListeners.entries(),e=t.next();!e.done;){var n=e.value,o=n[0],r=n[1],i=r.sub,s=r.passive;i.unsubscribe(),this.setupDOMListener(o,s),e=t.next()}},t.prototype.putNonBubblingListener=function(t,e,n,o){var r=this.nonBubblingListeners.get(t);if(r){var i=r.get(e);i&&i.destination.passive===o&&i.destination.useCapture===n&&(this.virtualNonBubblingListener[0]=i.destination)}},t.prototype.onEvent=function(t,e,n,o){void 0===o&&(o=!0);var r=this.patchEvent(e),i=this.isolateModule.getRootElement(e.target);if(o){var s=this.isolateModule.getNamespace(e.target);if(!s)return;var a=this.getVirtualListeners(t,s);this.bubble(t,e.target,i,r,a,s,s.length-1,!0,n),this.bubble(t,e.target,i,r,a,s,s.length-1,!1,n)}else this.putNonBubblingListener(t,e.target,!0,n),this.doBubbleStep(t,e.target,i,r,this.virtualNonBubblingListener,!0,n),this.putNonBubblingListener(t,e.target,!1,n),this.doBubbleStep(t,e.target,i,r,this.virtualNonBubblingListener,!1,n),e.stopPropagation()},t.prototype.bubble=function(t,e,n,o,r,i,s,a,c){a||o.propagationHasBeenStopped||this.doBubbleStep(t,e,n,o,r,a,c);var u=n,l=s;if(e===n){if(!(s>=0&&"sibling"===i[s].type))return;u=this.isolateModule.getElement(i,s),l--}e.parentNode&&u&&this.bubble(t,e.parentNode,u,o,r,i,l,a,c),a&&!o.propagationHasBeenStopped&&this.doBubbleStep(t,e,n,o,r,a,c)},t.prototype.doBubbleStep=function(t,e,n,o,r,i,s){n&&(this.mutateEventCurrentTarget(o,e),r.forEach((function(t){if(t.passive===s&&t.useCapture===i){var r=Ln(t.scopeChecker.namespace);!o.propagationHasBeenStopped&&t.scopeChecker.isDirectlyInScope(e)&&(""!==r&&e.matches(r)||""===r&&e===n)&&(xn(o,t.preventDefault),t.subject.shamefullySendNext(o))}})))},t.prototype.patchEvent=function(t){var e=t;e.propagationHasBeenStopped=!1;var n=e.stopPropagation;return e.stopPropagation=function(){n.call(this),this.propagationHasBeenStopped=!0},e},t.prototype.mutateEventCurrentTarget=function(t,e){try{Object.defineProperty(t,"currentTarget",{value:e,configurable:!0})}catch(t){console.log("please use event.ownerTarget")}t.ownerTarget=e},t}();function io(t){return ae.merge(t,ae.never())}function so(t){return t.elm}function ao(t){(console.error||console.log)(t)}function co(t,e){void 0===e&&(e={}),kn(t);var n=e.modules||Kn;!function(t){if(!Array.isArray(t))throw new Error("Optional modules option must be an array for snabbdom modules")}(n);var o,r,i=new to,s=e&&e.snabbdomOptions||void 0,a=sn([i.createModule()].concat(n),void 0,s),c=ae.create({start:function(t){"loading"===document.readyState?document.addEventListener("readystatechange",(function(){var e=document.readyState;"interactive"!==e&&"complete"!==e||(t.next(null),t.complete())})):(t.next(null),t.complete())},stop:function(){}}),u=ae.create({start:function(t){r=new MutationObserver((function(){return t.next(null)}))},stop:function(){r.disconnect()}});return function(n,s){void 0===s&&(s="DOM"),function(t){if(!t||"function"!=typeof t.addListener||"function"!=typeof t.fold)throw new Error("The DOM driver function expects as input a Stream of virtual DOM elements")}(n);var l=ae.create(),p=c.map((function(){var e=function(t){var e="string"==typeof t?document.querySelector(t):t;if("string"==typeof t&&null===e)throw new Error("Cannot render into unknown element `"+t+"`");return e}(t)||document.body;return o=new Xn(e),e})),f=n.remember();f.addListener({}),u.addListener({});var h=p.map((function(t){return ae.merge(f.endWhen(l),l).map((function(t){return o.call(t)})).startWith(function(t){return t.data=t.data||{},t.data.isolate=[],t}(un(t))).fold(a,un(t)).drop(1).map(so).startWith(t).map((function(t){return r.observe(t,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!0,characterDataOldValue:!0}),t})).compose(io)})).flatten(),d=Ge(c,u).endWhen(l).compose(zn(h)).map((function(t){return t[1]})).remember();d.addListener({error:e.reportSnabbdomError||ao});var m=new ro(d,i);return new Gn(d,l,[],i,m,s)}}var uo="___",lo=function(){function t(t){this._mockConfig=t,t.elements?this._elements=t.elements:this._elements=pe(ae.empty())}return t.prototype.elements=function(){var t=this._elements;return t._isCycleSource="MockedDOM",t},t.prototype.element=function(){var t=this.elements().filter((function(t){return t.length>0})).map((function(t){return t[0]})).remember(),e=pe(t);return e._isCycleSource="MockedDOM",e},t.prototype.events=function(t,e,n){var o=this._mockConfig[t],r=pe(o||ae.empty());return r._isCycleSource="MockedDOM",r},t.prototype.select=function(e){return new t(this._mockConfig[e]||{})},t.prototype.isolateSource=function(t,e){return t.select("."+uo+e)},t.prototype.isolateSink=function(t,e){return pe(ae.fromObservable(t).map((function(t){return t.sel&&-1!==t.sel.indexOf(uo+e)||(t.sel+="."+uo+e),t})))},t}();function po(t){return function(t){return"string"==typeof t&&t.length>0}(t)&&("."===t[0]||"#"===t[0])}function fo(t){return function(e,n,o){var r=void 0!==e,i=void 0!==n,s=void 0!==o;return po(e)?i&&s?cn(t+e,n,o):cn(t+e,i?n:{}):s?cn(t+e,n,o):i?cn(t,e,n):cn(t,r?e:{})}}var ho=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","colorProfile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotlight","feTile","feTurbulence","filter","font","fontFace","fontFaceFormat","fontFaceName","fontFaceSrc","fontFaceUri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missingGlyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],mo=fo("svg");ho.forEach((function(t){mo[t]=fo(t)}));var yo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","meta","nav","noscript","object","ol","optgroup","option","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","u","ul","video"],vo={SVG_TAG_NAMES:ho,TAG_NAMES:yo,svg:mo,isSelector:po,createTagFunction:fo};yo.forEach((function(t){vo[t]=fo(t)}));var _o=vo.svg,go=vo.a,bo=vo.abbr,wo=vo.address,So=vo.area,Ao=vo.article,Eo=vo.aside,Oo=vo.audio,No=vo.b,Co=vo.base,To=vo.bdi,$o=vo.bdo,xo=vo.blockquote,Do=vo.body,jo=vo.br,ko=vo.button,Lo=vo.canvas,Io=vo.caption,Mo=vo.cite,Po=vo.code,Ro=vo.col,Fo=vo.colgroup,Go=vo.dd,Bo=vo.del,Uo=vo.dfn,Ho=vo.dir,Vo=vo.div,Yo=vo.dl,Wo=vo.dt,qo=vo.em,zo=vo.embed,Jo=vo.fieldset,Zo=vo.figcaption,Xo=vo.figure,Ko=vo.footer,Qo=vo.form,tr=vo.h1,er=vo.h2,nr=vo.h3,or=vo.h4,rr=vo.h5,ir=vo.h6,sr=vo.head,ar=vo.header,cr=vo.hgroup,ur=vo.hr,lr=vo.html,pr=vo.i,fr=vo.iframe,hr=vo.img,dr=vo.input,mr=vo.ins,yr=vo.kbd,vr=vo.keygen,_r=vo.label,gr=vo.legend,br=vo.li,wr=vo.link,Sr=vo.main,Ar=vo.map,Er=vo.mark,Or=vo.menu,Nr=vo.meta,Cr=vo.nav,Tr=vo.noscript,$r=vo.object,xr=vo.ol,Dr=vo.optgroup,jr=vo.option,kr=vo.p,Lr=vo.param,Ir=vo.pre,Mr=vo.progress,Pr=vo.q,Rr=vo.rp,Fr=vo.rt,Gr=vo.ruby,Br=vo.s,Ur=vo.samp,Hr=vo.script,Vr=vo.section,Yr=vo.select,Wr=vo.small,qr=vo.source,zr=vo.span,Jr=vo.strong,Zr=vo.style,Xr=vo.sub,Kr=vo.sup,Qr=vo.table,ti=vo.tbody,ei=vo.td,ni=vo.textarea,oi=vo.tfoot,ri=vo.th,ii=vo.thead,si=vo.title,ai=vo.tr,ci=vo.u,ui=vo.ul,li=vo.video;let pi=0;function fi(t,e,n={}){if("function"!=typeof t)throw new Error("collection: first argument (component) must be a function");const{combineList:o=["DOM"],globalList:r=["EVENTS"],stateSourceName:i="STATE",domSourceName:s="DOM",container:a="div",containerClass:c}=n;return n=>{const u="sygnal-collection-"+pi++,l={item:t,itemKey:(t,e)=>void 0!==t.id?t.id:e,itemScope:t=>t,channel:i,collectSinks:t=>Object.entries(n).reduce(((e,[n,r])=>{if(o.includes(n)){const o=t.pickCombine(n);n===s&&a?e[s]=o.map((t=>({sel:a,data:c?{props:{className:c}}:{},children:t,key:u,text:void 0,elm:void 0}))):e[n]=o}else e[n]=t.pickMerge(n);return e}),{})},p={[i]:e};return r.forEach((t=>p[t]=null)),o.forEach((t=>p[t]=null)),function(t,e,n){return de(function(t){return function(e){var n=t.channel||"state",o=t.itemKey,r=t.itemScope||Le,i=ae.fromObservable(e[n].stream).fold((function(i,s){var a,c,u,l,p,f=i.dict;if(Array.isArray(s)){for(var h=Array(s.length),d=new Set,m=0,y=s.length;m<y;++m){var v=""+(o?o(s[m],m):m);if(d.add(v),f.has(v))h[m]=f.get(v);else{var _=o?Ie(o,v):""+m,g="string"==typeof(p=r(v))?((a={"*":p})[n]=_,a):je({},p,((c={})[n]=_,c)),b=de(t.itemFactory?t.itemFactory(s[m],m):t.item,g)(e);f.set(v,b),h[m]=b}h[m]._key=v}return f.forEach((function(t,e){d.has(e)||f.delete(e)})),d.clear(),{dict:f,arr:h}}return f.clear(),v=""+(o?o(s,0):"this"),_=Me,g="string"==typeof(p=r(v))?((u={"*":p})[n]=_,u):je({},p,((l={})[n]=_,l)),b=de(t.itemFactory?t.itemFactory(s,0):t.item,g)(e),f.set(v,b),{dict:f,arr:[b]}}),{dict:new Map,arr:[]});return t.collectSinks(new ke(i))}}(t),e)(n)}(l,p,n)}}const hi=t=>{const{children:e,...n}=t;return cn("collection",{props:n},e)};function di(t){return t&&t.default&&t.default.default&&"function"==typeof t.default.default?t.default.default:t&&t.default?t.default:t}hi.label="collection",hi.preventInstantiation=!0;const mi=function(t){const e=di(t);return e&&e.default&&"function"==typeof e.default.create?e.default:e}(ce),yi=oe||ae&&ae.Stream||mi&&mi.Stream,vi=di(we);function _i(t,e,n,o={}){const{switched:r=["DOM"],stateSourceName:i="STATE"}=o,s=typeof e;if(!e)throw new Error("Missing 'name$' parameter for switchable()");if(!("string"===s||"function"===s||e instanceof yi))throw new Error("Invalid 'name$' parameter for switchable(): expects Stream, String, or Function");if(e instanceof yi){const o=e.compose(vi()).startWith(n).remember();return e=>gi(t,e,o,r)}{const o="function"===s&&e||(t=>t[e]);return e=>{const s=e&&("string"==typeof i&&e[i]||e.STATE||e.state).stream;if(!(s instanceof yi))throw new Error(`Could not find the state source: ${i}`);const a=s.map(o).filter((t=>"string"==typeof t)).compose(vi()).startWith(n).remember();return gi(t,e,a,r,i)}}}function gi(t,e,n,o=["DOM"],r="STATE"){"string"==typeof o&&(o=[o]);const i=Object.entries(t).map((([t,o])=>{if(e[r]){const i=e[r].stream,s=mi.combine(n,i).filter((([e,n])=>e==t)).map((([t,e])=>e)).remember(),a=new e[r].constructor(s,e[r]._name);return[t,o({...e,state:a})]}return[t,o(e)]}));return Object.keys(e).reduce(((t,e)=>{if(o.includes(e))t[e]=n.map((t=>{const n=i.find((([e,n])=>e===t));return n&&n[1][e]||mi.never()})).flatten().remember().startWith(void 0);else{const n=i.filter((([t,n])=>void 0!==n[e])).map((([t,n])=>n[e]));t[e]=mi.merge(...n)}return t}),{})}const bi=t=>{const{children:e,...n}=t;return cn("switchable",{props:n},e)};bi.label="switchable",bi.preventInstantiation=!0;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});var Si=o,Ai=function(){function t(t,e){this.dt=t,this.ins=e,this.type="delay",this.out=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null},t.prototype._n=function(t){var e=this.out;if(e)var n=setInterval((function(){e._n(t),clearInterval(n)}),this.dt)},t.prototype._e=function(t){var e=this.out;if(e)var n=setInterval((function(){e._e(t),clearInterval(n)}),this.dt)},t.prototype._c=function(){var t=this.out;if(t)var e=setInterval((function(){t._c(),clearInterval(e)}),this.dt)},t}();var Ei=wi.default=function(t){return function(e){return new Si.Stream(new Ai(t,e))}},Oi=e({__proto__:null,default:Ei},[wi]),Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});var Ci=o,Ti=function(){function t(t,e){this.dt=t,this.ins=e,this.type="debounce",this.out=null,this.id=null,this.t=Ci.NO}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.clearInterval()},t.prototype.clearInterval=function(){var t=this.id;null!==t&&clearInterval(t),this.id=null},t.prototype._n=function(t){var e=this,n=this.out;n&&(this.clearInterval(),this.t=t,this.id=setInterval((function(){e.clearInterval(),n._n(t),e.t=Ci.NO}),this.dt))},t.prototype._e=function(t){var e=this.out;e&&(this.clearInterval(),e._e(t))},t.prototype._c=function(){var t=this.out;t&&(this.clearInterval(),this.t!=Ci.NO&&t._n(this.t),this.t=Ci.NO,t._c())},t}();var $i=Ni.default=function(t){return function(e){return new Ci.Stream(new Ti(t,e))}},xi=e({__proto__:null,default:$i},[Ni]);const Di=di(Oi),ji=di(Be),ki=di(xi),Li=di(we),Ii="undefined"!=typeof window&&window||process&&process.env||{},Mi="BOOTSTRAP",Pi="INITIALIZE",Ri="PARENT";let Fi=0;const Gi=Symbol("ABORT");function Bi(t,e){if("function"==typeof e)return{fn:e,deps:null};if(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&"function"==typeof e[1])return{fn:e[1],deps:e[0]};throw new Error(`Invalid calculated field '${t}': expected a function or [depsArray, function]`)}function Ui(t){const{name:e,sources:n,isolateOpts:o,stateSourceName:r="STATE"}=t;if(n&&!Zi(n))throw new Error(`[${e}] Sources must be a Cycle.js sources object`);let i;i="string"==typeof o?{[r]:o}:!0===o?{}:o;const s=void 0===n;let a;if(Zi(i)){const e=e=>{const n={...t,sources:e};return new Hi(n).sinks};a=s?de(e,i):de(e,i)(n)}else a=s?e=>new Hi({...t,sources:e}).sinks:new Hi(t).sinks;return a.componentName=e,a.isSygnalComponent=!0,a}class Hi{constructor({name:t="NO NAME",sources:e,intent:n,model:o,hmrActions:r,context:i,response:s,view:a,peers:c={},components:u={},initialState:l,calculated:p,storeCalculatedInState:f=!0,DOMSourceName:h="DOM",stateSourceName:d="STATE",requestSourceName:m="HTTP",debug:y=!1}){if(!e||!Zi(e))throw new Error(`[${t}] Missing or invalid sources`);if(this._componentNumber=Fi++,this.name=t,this.sources=e,this.intent=n,this.model=o,this.hmrActions=r,this.context=i,this.response=s,this.view=a,this.peers=c,this.components=u,this.initialState=l,this.calculated=p,this.storeCalculatedInState=f,this.DOMSourceName=h,this.stateSourceName=d,this.requestSourceName=m,this.sourceNames=Object.keys(e),this._debug=y,this.calculated&&this.initialState&&Zi(this.calculated)&&Zi(this.initialState))for(const e of Object.keys(this.calculated))e in this.initialState&&console.warn(`[${t}] Calculated field '${e}' shadows a key in initialState. The initialState value will be overwritten on every state update.`);if(this.calculated&&Zi(this.calculated)){const e=Object.entries(this.calculated);this._calculatedNormalized={};for(const[t,n]of e)this._calculatedNormalized[t]=Bi(t,n);this._calculatedFieldNames=new Set(Object.keys(this._calculatedNormalized));for(const[e,{deps:n}]of Object.entries(this._calculatedNormalized))if(null!==n)for(const o of n)this._calculatedFieldNames.has(o)||!this.initialState||o in this.initialState||console.warn(`[${t}] Calculated field '${e}' declares dependency '${o}' which is not in initialState or calculated fields`);const n={};for(const[t,{deps:e}]of Object.entries(this._calculatedNormalized))n[t]=null===e?[]:e.filter((t=>this._calculatedFieldNames.has(t)));const o={},r={};for(const t of this._calculatedFieldNames)o[t]=0,r[t]=[];for(const[t,e]of Object.entries(n)){o[t]=e.length;for(const n of e)r[n].push(t)}const i=[];for(const[t,e]of Object.entries(o))0===e&&i.push(t);const s=[];for(;i.length>0;){const t=i.shift();s.push(t);for(const e of r[t])o[e]--,0===o[e]&&i.push(e)}if(s.length!==this._calculatedFieldNames.size){const t=[...this._calculatedFieldNames].filter((t=>!s.includes(t))),e=new Set,o=[],r=i=>{if(e.has(i))return o.push(i),!0;e.add(i),o.push(i);for(const e of n[i])if(t.includes(e)&&r(e))return!0;return o.pop(),e.delete(i),!1};r(t[0]);const i=o[o.length-1],a=o.slice(o.indexOf(i));throw new Error(`Circular calculated dependency: ${a.join(" → ")}`)}this._calculatedOrder=s.map((t=>[t,this._calculatedNormalized[t]])),this._calculatedFieldCache={};for(const[t,{deps:e}]of this._calculatedOrder)null!==e&&(this._calculatedFieldCache[t]={lastDepValues:void 0,lastResult:void 0})}else this._calculatedOrder=null,this._calculatedNormalized=null,this._calculatedFieldNames=null,this._calculatedFieldCache=null;this.isSubComponent=this.sourceNames.includes("props$");const v=e[d]&&e[d].stream;v&&(this.currentState=l||{},this.sources[d]=new Ce(v.map((t=>(this.currentState=t,"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onStateChanged(this._componentNumber,this.name,t),t)))));const _=e.props$;_&&(this.sources.props$=_.map((t=>{const{sygnalFactory:e,sygnalOptions:n,...o}=t;return this.currentProps=o,t})));const g=e.children$;var b;if(g&&(this.sources.children$=g.map((t=>(this.currentChildren=t,t)))),this.sources[h]&&(this.sources[h]=(b=this.sources[h],new Proxy(b,{get:(t,e,n)=>"symbol"==typeof e||e in t?Reflect.get(t,e,n):n=>t.select(n).events(e)}))),this.isSubComponent||void 0!==this.intent||void 0!==this.model||(this.initialState=l||!0,this.intent=t=>({__NOOP_ACTION__:mi.never()}),this.model={__NOOP_ACTION__:t=>t}),this.addCalculated=this.createMemoizedAddCalculated(),this.log=function(t){return function(e,n=!1){const o="function"==typeof e?e:t=>e;if(!n)return e=>e.debug((e=>{if(this.debug){const n=`[${t}] ${o(e)}`;console.log(n),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onDebugLog(this._componentNumber,n)}}));if(this.debug){const n=`[${t}] ${o(e)}`;console.log(n),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onDebugLog(this._componentNumber,n)}}}(`${this._componentNumber} | ${t}`),this.initChildSources$(),this.initIntent$(),this.initHmrActions(),this.initAction$(),this.initState(),this.initContext(),this.initModel$(),this.initPeers$(),this.initSubComponentSink$(),this.initSubComponentsRendered$(),this.initVdom$(),this.initSinks(),this.sinks.__index=this._componentNumber,this.log("Instantiated",!0),"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__){window.__SYGNAL_DEVTOOLS__.onComponentCreated(this._componentNumber,t,this);const n=e?.__parentComponentNumber;"number"==typeof n&&window.__SYGNAL_DEVTOOLS__.onSubComponentRegistered(n,this._componentNumber)}}get debug(){return this._debug||"true"===Ii.SYGNAL_DEBUG||!0===Ii.SYGNAL_DEBUG}initIntent$(){if(this.intent){if("function"!=typeof this.intent)throw new Error(`[${this.name}] Intent must be a function`);if(this.intent$=this.intent(this.sources),!(this.intent$ instanceof yi||Zi(this.intent$)))throw new Error(`[${this.name}] Intent must return either an action$ stream or map of event streams`)}}initHmrActions(){if(void 0!==this.hmrActions){if("string"==typeof this.hmrActions&&(this.hmrActions=[this.hmrActions]),!Array.isArray(this.hmrActions))throw new Error(`[${this.name}] hmrActions must be the name of an action or an array of names of actions to run when a component is hot-reloaded`);if(this.hmrActions.some((t=>"string"!=typeof t)))throw new Error(`[${this.name}] hmrActions must be the name of an action or an array of names of actions to run when a component is hot-reloaded`);this.hmrAction$=mi.fromArray(this.hmrActions.map((t=>({type:t}))))}else this.hmrAction$=mi.of().filter((t=>!1))}initAction$(){const t=this.sources&&this.sources[this.requestSourceName]||null;if(!this.intent$)return void(this.action$=mi.never());let e;if(this.intent$ instanceof yi)e=this.intent$;else{const t=Object.entries(this.intent$).map((([t,e])=>e.map((e=>({type:t,data:e})))));e=mi.merge(mi.never(),...t)}const n=e instanceof yi?e:e.apply&&e(this.sources)||mi.never(),o=mi.of({type:Mi}).compose(Di(10)),r=!0===window?.__SYGNAL_HMR_UPDATING?this.hmrAction$:mi.of().filter((t=>!1)),i=this.model[Mi]&&!0!==window?.__SYGNAL_HMR_UPDATING?ji(o,n):ji(mi.of().compose(Di(1)).filter((t=>!1)),r,n);let s;s=!0!==window?.__SYGNAL_HMR_UPDATING&&t&&"function"==typeof t.select?t.select("initial").flatten():mi.never();const a=s.map((t=>({type:"HYDRATE",data:t})));this.action$=mi.merge(i,a).compose(this.log((({type:t})=>`<${t}> Action triggered`))).map((t=>("undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onActionDispatched(this._componentNumber,this.name,t.type,t.data),t)))}initState(){void 0!==this.model&&(void 0===this.model[Pi]?this.model[Pi]={[this.stateSourceName]:(t,e)=>({...this.addCalculated(e)})}:Zi(this.model[Pi])&&Object.keys(this.model[Pi]).forEach((t=>{t!==this.stateSourceName&&(console.warn(`${Pi} can only be used with the ${this.stateSourceName} source... disregarding ${t}`),delete this.model[Pi][t])})))}initContext(){if(!this.context&&!this.sources.__parentContext$)return void(this.context$=mi.of({}));const t=this.sources[this.stateSourceName]?.stream.startWith({}).compose(Li(Ji))||mi.never(),e=this.sources.__parentContext$?.startWith({}).compose(Li(Ji))||mi.of({});this.context&&!Zi(this.context)&&console.error(`[${this.name}] Context must be an object mapping names to values of functions: ignoring provided ${typeof this.context}`),this.context$=mi.combine(t,e).map((([t,e])=>{const n=Zi(e)?e:{},o=Zi(this.context)?this.context:{},r=this.currentState,i={...n,...Object.entries(o).reduce(((t,e)=>{const[n,o]=e;let i;const s=typeof o;if("string"===s)i=r[o];else if("boolean"===s)i=r[n];else{if("function"!==s)return console.error(`[${this.name}] Invalid context entry '${n}': must be the name of a state property or a function returning a value to use`),t;i=o(r)}return t[n]=i,t}),{})};return this.currentContext=i,"undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS__?.connected&&window.__SYGNAL_DEVTOOLS__.onContextChanged(this._componentNumber,this.name,i),i})).compose(Li(Ji)).startWith({}),this.context$.subscribe({next:t=>t,error:t=>console.error(`[${this.name}] Error in context stream:`,t)})}initModel$(){if(void 0===this.model)return void(this.model$=this.sourceNames.reduce(((t,e)=>(t[e]=mi.never(),t)),{}));const t=Ii?.__SYGNAL_HMR_STATE,e=void 0!==t?t:this.initialState,n={type:Pi,data:e};this.isSubComponent&&this.initialState&&console.warn(`[${this.name}] Initial state provided to sub-component. This will overwrite any state provided by the parent component.`);const o=void 0!==e&&(!0!==Ii?.__SYGNAL_HMR_UPDATING||void 0!==t)?ji(mi.of(n),this.action$).compose(Di(0)):this.action$,r=()=>this.makeOnAction(o,!0,this.action$),i=()=>this.makeOnAction(this.action$,!1,this.action$),s=Object.entries(this.model),a={};s.forEach((t=>{let[e,n]=t;if("function"==typeof n&&(n={[this.stateSourceName]:n}),!Zi(n))throw new Error(`[${this.name}] Entry for each action must be an object: ${e}`);Object.entries(n).forEach((t=>{const[n,o]=t,s=n===this.stateSourceName,c=n===Ri,u=s?r():i(),l=(c?u(e,o).map((t=>({name:this.name,component:this.view,value:t}))):u(e,o)).compose(this.log((t=>{if(s)return`<${e}> State reducer added`;if(c)return`<${e}> Data sent to parent component: ${JSON.stringify(t.value).replaceAll('"',"")}`;{const o=t&&(t.type||t.command||t.name||t.key||Array.isArray(t)&&"Array"||t);return`<${e}> Data sent to [${n}]: ${JSON.stringify(o).replaceAll('"',"")}`}})));Array.isArray(a[n])?a[n].push(l):a[n]=[l]}))}));const c=Object.entries(a).reduce(((t,e)=>{const[n,o]=e;return t[n]=mi.merge(mi.never(),...o),t}),{});this.model$=c}initPeers$(){const t=this.sourceNames.reduce(((t,e)=>(e==this.DOMSourceName?t[e]={}:t[e]=[],t)),{});this.peers$=Object.entries(this.peers).reduce(((t,[e,n])=>{const o=n(this.sources);return this.sourceNames.forEach((n=>{n==this.DOMSourceName?t[n][e]=o[n]:t[n].push(o[n])})),t}),t)}initChildSources$(){let t;const e=mi.create({start:e=>{t=e.next.bind(e)},stop:t=>{}}).map((t=>mi.merge(...t))).flatten();this.sources.CHILD={select:t=>{const n=e;return("function"==typeof t?n.filter((e=>e.component===t)):t?n.filter((e=>e.name===t)):n).map((t=>t.value))}},this.newChildSources=e=>{"function"==typeof t&&t(e)}}initSubComponentSink$(){const t=mi.create({start:t=>{this.newSubComponentSinks=t.next.bind(t)},stop:t=>{}});t.subscribe({next:t=>t,error:t=>console.error(`[${this.name}] Error in sub-component sink stream:`,t)}),this.subComponentSink$=t.filter((t=>Object.keys(t).length>0))}initSubComponentsRendered$(){const t=mi.create({start:t=>{this.triggerSubComponentsRendered=t.next.bind(t)},stop:t=>{}});this.subComponentsRendered$=t.startWith(null)}initVdom$(){if("function"!=typeof this.view)return void(this.vdom$=mi.of(null));const t=this.collectRenderParameters();this.vdom$=t.map((t=>{const{props:e,state:n,children:o,context:r,...i}=t,{sygnalFactory:s,sygnalOptions:a,...c}=e||{};return this.view({...c,state:n,children:o,context:r,peers:i},n,r,i)})).compose(this.log("View rendered")).map((t=>t||{sel:"div",data:{},children:[]})).compose(this.instantiateSubComponents.bind(this)).filter((t=>void 0!==t)).compose(this.renderVdom.bind(this))}initSinks(){this.sinks=this.sourceNames.reduce(((t,e)=>{if(e==this.DOMSourceName)return t;const n=this.subComponentSink$&&e!==Ri?this.subComponentSink$.map((t=>t[e])).filter((t=>!!t)).flatten():mi.never();return e===this.stateSourceName?t[e]=mi.merge(this.model$[e]||mi.never(),n,this.sources[this.stateSourceName].stream.filter((t=>!1)),...this.peers$[e]||[]):t[e]=mi.merge(this.model$[e]||mi.never(),n,...this.peers$[e]||[]),t}),{}),this.sinks[this.DOMSourceName]=this.vdom$,this.sinks[Ri]=this.model$[Ri]||mi.never()}makeOnAction(t,e=!0,n){return n=n||t,(o,r)=>{const i=t.filter((({type:t})=>t==o));let s;if("function"==typeof r)s=i.map((t=>{const i=(t,e,r=10)=>{if("number"!=typeof r)throw new Error(`[${this.name}] Invalid delay value provided to next() function in model action '${o}'. Must be a number in ms.`);setTimeout((()=>{n.shamefullySendNext({type:t,data:e})}),r),this.log(`<${o}> Triggered a next() action: <${t}> ${r}ms delay`,!0)},s={...this.currentProps,children:this.currentChildren,context:this.currentContext};let a=t.data;if(e)return t=>{const e=this.isSubComponent?this.currentState:t,n=this.addCalculated(e);s.state=n;const o=r(n,a,i,s);return o===Gi?e:this.cleanupCalculated(o)};{const t=this.addCalculated(this.currentState);s.state=t;const e=r(t,a,i,s),n=typeof e;if(Zi(e)||["string","number","boolean","function"].includes(n))return e;if("undefined"===n)return console.warn(`[${this.name}] 'undefined' value sent to ${o}`),e;throw new Error(`[${this.name}] Invalid reducer type for action '${o}': ${n}`)}})).filter((t=>t!==Gi));else if(void 0===r||!0===r)s=i.map((({data:t})=>t));else{const t=r;s=i.mapTo(t)}return s}}createMemoizedAddCalculated(){let t,e;return function(n){if(!this.calculated||!Zi(n)||Array.isArray(n))return n;if(n===t)return e;if(!Zi(this.calculated))throw new Error(`[${this.name}] 'calculated' parameter must be an object mapping calculated state field names to functions`);const o=this.getCalculatedValues(n);if(!o)return t=n,e=n,n;const r={...n,...o};return t=n,e=r,r}}getCalculatedValues(t){if(!this._calculatedOrder||0===this._calculatedOrder.length)return;const e={...t},n={};for(const[t,{fn:o,deps:r}]of this._calculatedOrder)if(null!==r&&this._calculatedFieldCache){const i=this._calculatedFieldCache[t],s=r.map((t=>e[t]));if(void 0!==i.lastDepValues){let o=!0;for(let t=0;t<s.length;t++)if(s[t]!==i.lastDepValues[t]){o=!1;break}if(o){n[t]=i.lastResult,e[t]=i.lastResult;continue}}try{const r=o(e);i.lastDepValues=s,i.lastResult=r,n[t]=r,e[t]=r}catch(e){console.warn(`Calculated field '${t}' threw an error during calculation: ${e.message}`)}}else try{const r=o(e);n[t]=r,e[t]=r}catch(e){console.warn(`Calculated field '${t}' threw an error during calculation: ${e.message}`)}return n}cleanupCalculated(t){if(!t||!Zi(t)||Array.isArray(t))return t;const e={...this.storeCalculatedInState?this.addCalculated(t):t};if(!this.calculated||this.storeCalculatedInState)return e;return Object.keys(this.calculated).forEach((t=>{this.initialState&&void 0!==this.initialState[t]?e[t]=this.initialState[t]:delete e[t]})),e}collectRenderParameters(){const t=this.sources[this.stateSourceName],e={...this.peers$[this.DOMSourceName]},n=t&&t.isolateSource(t,{get:t=>this.addCalculated(t)}),o=n&&n.stream||mi.never();e.state=o.compose(Li(Ji)),this.sources.props$&&(e.props=this.sources.props$.compose(Li(zi))),this.sources.children$&&(e.children=this.sources.children$.compose(Li(Ji))),this.context$&&(e.context=this.context$.compose(Li(Ji)));const r=[],i=[];Object.entries(e).forEach((([t,e])=>{r.push(t),i.push(e)}));return mi.combine(...i).compose(ki(1)).map((t=>r.reduce(((e,n,o)=>(e[n]=t[o],"state"===n&&(e[this.stateSourceName]=t[o],e.calculated=t[o]&&this.getCalculatedValues(t[o])||{}),e)),{})))}instantiateSubComponents(t){return t.fold(((t,e)=>{const n=Vi(e,Object.keys(this.components)),o=Object.entries(n),r={"::ROOT::":e};if(0===o.length)return r;const i={},s=[];let a=0;const c=o.reduce(((e,[n,o])=>{const r=o.data,c=r.props||{},u=o.children||[],l=r.isCollection||!1,p=r.isSwitchable||!1,f=t=>{Object.entries(t).forEach((([t,e])=>{i[t]||=[],t===Ri?s.push(e):t!==this.DOMSourceName&&i[t].push(e)}))};if(t[n]){const o=t[n];return e[n]=o,o.props$.shamefullySendNext(c),o.children$.shamefullySendNext(u),f(o.sink$),e}const h=mi.create().startWith(c),d=mi.create().startWith(u);let m;m=l?this.instantiateCollection.bind(this):p?this.instantiateSwitchable.bind(this):this.instantiateCustomComponent.bind(this),a++;const y=m(o,h,d);return y[this.DOMSourceName]=y[this.DOMSourceName]?this.makeCoordinatedSubComponentDomSink(y[this.DOMSourceName]):mi.never(),e[n]={sink$:y,props$:h,children$:d},f(y),e}),r),u=Object.entries(i).reduce(((t,[e,n])=>(0===n.length||(t[e]=1===n.length?n[0]:mi.merge(...n)),t)),{});return this.newSubComponentSinks(u),this.newChildSources(s),a>0&&this.log(`New sub components instantiated: ${a}`,!0),c}),{})}makeCoordinatedSubComponentDomSink(t){const e=t.remember();return this.sources[this.stateSourceName].stream.compose(Li(Ji)).map((t=>e)).flatten().debug((t=>this.triggerSubComponentsRendered())).remember()}instantiateCollection(t,e,n){const o=t.data.props||{};const r={filter:"function"==typeof o.filter?o.filter:void 0,sort:Qi(o.sort)},i=mi.combine(this.sources[this.stateSourceName].stream.startWith(this.currentState),e.startWith(o)).compose(ki(1)).map((([t,e])=>(e.filter!==r.filter&&(r.filter="function"==typeof e.filter?e.filter:void 0),e.sort!==r.sort&&(r.sort=Qi(e.sort)),Zi(t)?this.addCalculated(t):t))),s=new Ce(i),a=o.from,c=o.of,u=o.idfield||"id";let l,p;if("function"==typeof c)if(c.isSygnalComponent)p=c;else{const t=c.componentName||c.label||c.name||"FUNCTION_COMPONENT",e=c,{model:n,intent:o,hmrActions:r,context:i,peers:s,components:a,initialState:u,calculated:l,storeCalculatedInState:f,DOMSourceName:h,stateSourceName:d,debug:m}=c;p=Ui({name:t,view:e,model:n,intent:o,hmrActions:r,context:i,peers:s,components:a,initialState:u,calculated:l,storeCalculatedInState:f,DOMSourceName:h,stateSourceName:d,debug:m})}else{if(!this.components[c])throw new Error(`[${this.name}] Invalid 'of' property in collection: ${c}`);p=this.components[c]}const f={get:t=>{if(!Array.isArray(t[a]))return[];const e=t[a],n="function"==typeof r.filter?e.filter(r.filter):e;return("function"==typeof r.sort?n.sort(r.sort):n).map(((t,e)=>Zi(t)?{...t,[u]:t[u]||e}:{value:t,[u]:e}))},set:(t,e)=>{if(this.calculated&&a in this.calculated)return console.warn(`Collection sub-component of ${this.name} attempted to update state on a calculated field '${a}': Update ignored`),t;const n=[];for(const o of t[a].map(((t,e)=>Zi(t)?{...t,[u]:t[u]||e}:{__primitive:!0,value:t,[u]:e})))if("function"!=typeof r.filter||r.filter(o)){const t=e.find((t=>t[u]===o[u]));void 0!==t&&n.push(o.__primitive?t.value:t)}else n.push(o.__primitive?o.value:o);return{...t,[a]:n}}};void 0===a?l={get:t=>!(t instanceof Array)&&t.value&&t.value instanceof Array?t.value:t,set:(t,e)=>e}:"string"==typeof a?Zi(this.currentState)?this.currentState&&a in this.currentState||this.calculated&&a in this.calculated?(Array.isArray(this.currentState[a])||console.warn(`[${this.name}] State property '${a}' in collection component is not an array: No components will be instantiated in the collection.`),l=f):(console.error(`Collection component in ${this.name} is attempting to use non-existent state property '${a}': To fix this error, specify a valid array property on the state. Attempting to use parent component state.`),l=void 0):(Array.isArray(this.currentState[a])||console.warn(`[${this.name}] State property '${a}' in collection component is not an array: No components will be instantiated in the collection.`),l=f):Zi(a)?"function"!=typeof a.get?(console.error(`Collection component in ${this.name} has an invalid 'from' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting child state from the current state. Attempting to use parent component state.`),l=void 0):l={get:t=>{const e=a.get(t);return Array.isArray(e)?e:(console.warn(`State getter function in collection component of ${this.name} did not return an array: No components will be instantiated in the collection. Returned value:`,e),[])},set:a.set}:(console.error(`Collection component in ${this.name} has an invalid 'from' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting child state from the current state. Attempting to use parent component state.`),l=void 0);const h={...this.sources,[this.stateSourceName]:s,props$:e,children$:n,__parentContext$:this.context$,PARENT:null,__parentComponentNumber:this._componentNumber},d=fi(p,l,{container:null})(h);if(!Zi(d))throw new Error(`[${this.name}] Invalid sinks returned from component factory of collection element`);return d}instantiateSwitchable(t,e,n){const o=t.data.props||{},r=this.sources[this.stateSourceName].stream.startWith(this.currentState).map((t=>Zi(t)?this.addCalculated(t):t)),i=new Ce(r),s=o.state;let a;const c={get:t=>t,set:(t,e)=>e};void 0===s?a=c:"string"==typeof s?a={get:t=>t[s],set:(t,e)=>this.calculated&&s in this.calculated?(console.warn(`Switchable sub-component of ${this.name} attempted to update state on a calculated field '${s}': Update ignored`),t):!Zi(e)||Array.isArray(e)?{...t,[s]:e}:{...t,[s]:e}}:Zi(s)?"function"!=typeof s.get?(console.error(`Switchable component in ${this.name} has an invalid 'state' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting sub-component state from the current state. Attempting to use parent component state.`),a=c):a={get:s.get,set:s.set}:(console.error(`Invalid state provided to switchable sub-component of ${this.name}: Expecting string, object, or undefined, but found ${typeof s}. Attempting to use parent component state.`),a=c);const u=o.of;Object.keys(u).forEach((t=>{const e=u[t];if(!e.isSygnalComponent){const n=e.componentName||e.label||e.name||"FUNCTION_COMPONENT",o=e,{model:r,intent:i,hmrActions:s,context:a,peers:c,components:l,initialState:p,calculated:f,storeCalculatedInState:h,DOMSourceName:d,stateSourceName:m,debug:y}=e,v={name:n,view:o,model:r,intent:i,hmrActions:s,context:a,peers:c,components:l,initialState:p,calculated:f,storeCalculatedInState:h,DOMSourceName:d,stateSourceName:m,debug:y};u[t]=Ui(v)}}));const l={...this.sources,[this.stateSourceName]:i,props$:e,children$:n,__parentContext$:this.context$,__parentComponentNumber:this._componentNumber},p=de(_i(u,e.map((t=>t.current))),{[this.stateSourceName]:a})(l);if(!Zi(p))throw new Error(`[${this.name}] Invalid sinks returned from component factory of switchable element`);return p}instantiateCustomComponent(t,e,n){const o=t.sel,r=t.data.props||{},i=this.sources[this.stateSourceName].stream.startWith(this.currentState).map((t=>Zi(t)?this.addCalculated(t):t)),s=new Ce(i),a=r.state;"function"!=typeof r.sygnalFactory&&Zi(r.sygnalOptions)&&(r.sygnalFactory=Ui(r.sygnalOptions));const c="sygnal-factory"===o?r.sygnalFactory:this.components[o]||r.sygnalFactory;if(!c){if("sygnal-factory"===o)throw new Error("Component not found on element with Capitalized selector and nameless function: JSX transpilation replaces selectors starting with upper case letters with functions in-scope with the same name, Sygnal cannot see the name of the resulting component.");throw new Error(`Component not found: ${o}`)}let u;const l={get:t=>t,set:(t,e)=>e};void 0===a?u=l:"string"==typeof a?u={get:t=>t[a],set:(t,e)=>this.calculated&&a in this.calculated?(console.warn(`Sub-component of ${this.name} attempted to update state on a calculated field '${a}': Update ignored`),t):{...t,[a]:e}}:Zi(a)?"function"!=typeof a.get?(console.error(`Sub-component in ${this.name} has an invalid 'state' field: Expecting 'undefined', a string indicating an array property in the state, or an object with 'get' and 'set' functions for retrieving and setting sub-component state from the current state. Attempting to use parent component state.`),u=l):u={get:a.get,set:a.set}:(console.error(`Invalid state provided to sub-component of ${this.name}: Expecting string, object, or undefined, but found ${typeof a}. Attempting to use parent component state.`),u=l);const p={...this.sources,[this.stateSourceName]:s,props$:e,children$:n,__parentContext$:this.context$,__parentComponentNumber:this._componentNumber},f=de(c,{[this.stateSourceName]:u})(p);if(!Zi(f)){throw new Error("Invalid sinks returned from component factory:","sygnal-factory"===o?"custom element":o)}return f}renderVdom(t){return mi.combine(this.subComponentsRendered$,t).compose(ki(1)).map((([t,e])=>{const n=Object.keys(this.components),o=e["::ROOT::"],r=Object.entries(e).filter((([t])=>"::ROOT::"!==t));if(0===r.length)return mi.of(o);const i=[],s=r.map((([t,e])=>(i.push(t),e.sink$[this.DOMSourceName].startWith(void 0))));return 0===s.length?mi.of(o):mi.combine(...s).compose(ki(1)).map((t=>{const e=t.reduce(((t,e,n)=>(t[i[n]]=e,t)),{});return Yi(qi(o),e,n)}))})).flatten().filter((t=>!!t)).remember()}}function Vi(t,e,n="r",o){if(!t)return{};if(t.data?.componentsProcessed)return{};"r"===n&&(t.data.componentsProcessed=!0);const r=t.sel,i=r&&"collection"===r.toLowerCase(),s=r&&"switchable"===r.toLowerCase(),a=r&&["collection","switchable","sygnal-factory",...e].includes(r)||"function"==typeof t.data?.props?.sygnalFactory||Zi(t.data?.props?.sygnalOptions),c=t.data&&t.data.props||{};t.data&&t.data.attrs;const u=t.children||[];let l={},p=o;if(a){if(p=Wi(t,n,o),i){if(!c.of)throw new Error("Collection element missing required 'component' property");if("string"!=typeof c.of&&"function"!=typeof c.of)throw new Error(`Invalid 'component' property of collection element: found ${typeof c.of} requires string or component factory function`);if("function"!=typeof c.of&&!e.includes(c.of))throw new Error(`Specified component for collection not found: ${c.of}`);void 0===c.from||"string"==typeof c.from||Array.isArray(c.from)||"function"==typeof c.from.get||console.warn(`No valid array found for collection ${"string"==typeof c.of?c.of:"function component"}: no collection components will be created`,c.from),t.data.isCollection=!0,t.data.props||={}}else if(s){if(!c.of)throw new Error("Switchable element missing required 'of' property");if(!Zi(c.of))throw new Error(`Invalid 'of' property of switchable element: found ${typeof c.of} requires object mapping names to component factories`);if(!Object.values(c.of).every((t=>"function"==typeof t)))throw new Error("One or more components provided to switchable element is not a valid component factory");if(!c.current||"string"!=typeof c.current&&"function"!=typeof c.current)throw new Error(`Missing or invalid 'current' property for switchable element: found '${typeof c.current}' requires string or function`);if(!Object.keys(c.of).includes(c.current))throw new Error(`Component '${c.current}' not found in switchable element`);t.data.isSwitchable=!0}void 0===c.key&&(t.data.props.key=p),l[p]=t}return u.length>0&&u.map(((t,o)=>Vi(t,e,`${n}.${o}`,p))).forEach((t=>{Object.entries(t).forEach((([t,e])=>l[t]=e))})),l}function Yi(t,e,n,o="r",r){if(!t)return;if(t.data?.componentsInjected)return t;"r"===o&&t.data&&(t.data.componentsInjected=!0);const i=t.sel||"NO SELECTOR",s=["collection","switchable","sygnal-factory",...n].includes(i)||"function"==typeof t.data?.props?.sygnalFactory||Zi(t.data?.props?.sygnalOptions),a=t?.data?.isCollection;t.data&&t.data.props;const c=t.children||[];let u=r;if(s){u=Wi(t,o,r);const n=e[u];return a?(t.sel="div",t.children=Array.isArray(n)?n:[n],t):n}return c.length>0?(t.children=c.map(((t,r)=>Yi(t,e,n,`${o}.${r}`,u))).flat(),t):t}function Wi(t,e,n){const o=t.sel,r="string"==typeof o?o:"functionComponent",i=t.data?.props||{};return`${n?`${n}|`:""}${r}::${i.id&&JSON.stringify(i.id).replaceAll('"',"")||e}`}function qi(t){return void 0===t?t:{...t,children:Array.isArray(t.children)?t.children.map(qi):void 0,data:t.data&&{...t.data,componentsInjected:!1}}}function zi(t,e){return Ji(function(t){if(!Zi(t))return t;const{state:e,of:n,from:o,filter:r,...i}=t;return i}(t))}function Ji(t,e,n=5,o=0){if(o>n)return!1;if(t===e)return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Ji(t[r],e[r],n,o+1))return!1;return!0}const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const s of r){if(!i.includes(s))return!1;if(!Ji(t[s],e[s],n,o+1))return!1}return!0}function Zi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Xi(t,e,n=!0){const o=n?1:-1;switch(!0){case t>e:return 1*o;case t<e:return-1*o;default:return 0}}function Ki(t){const e=Object.entries(t);if(e.length>1)return void console.error("Sort objects can only have one key:",t);const n=e[0],[o,r]=n;if(!["string","number"].includes(typeof r))return void console.error("Sort object properties must be a string or number:",t);let i=!0;if("string"==typeof r){if(!["asc","dec"].includes(r.toLowerCase()))return void console.error("Sort object string values must be asc or dec:",t);i="asc"===r.toLowerCase()}if("number"==typeof r){if(1!==r&&-1!==r)return void console.error("Sort object number values must be 1 or -1:",t);i=1===r}return(t,e)=>Xi(t[o],e[o],i)}function Qi(t){if(!t)return;const e=typeof t;if("function"===e)return t;if("string"===e){if("asc"===t.toLowerCase()||"dec"===t.toLowerCase()){const e="asc"===t.toLowerCase();return(t,n)=>Xi(t,n,e)}const e=t;return(t,n)=>Xi(t[e],n[e],!0)}if(Array.isArray(t)){const e=t.map((t=>"function"==typeof t?t:"string"!=typeof t||["asc","dec"].includes(t.toLowerCase())?Zi(t)?Ki(t):void 0:(e,n)=>Xi(e[t],n[t],!0)));return(t,n)=>e.filter((t=>"function"==typeof t)).reduce(((e,o)=>0!==e?e:o(t,n)),0)}return Zi(t)?Ki(t):void console.error("Invalid sort option (ignoring):",t)}function ts(t){return function(){var t;return(t="undefined"!=typeof window?window:"undefined"!=typeof global?global:this).Cyclejs=t.Cyclejs||{},(t=t.Cyclejs).adaptStream=t.adaptStream||function(t){return t},t}().adaptStream(t)}function es(t){return 0===Object.keys(t).length}function ns(t,e){if("function"!=typeof t)throw new Error("First argument given to Cycle must be the 'main' function.");if("object"!=typeof e||null===e)throw new Error("Second argument given to Cycle must be an object with driver functions as properties.");if(es(e))throw new Error("Second argument given to Cycle must be an object with at least one driver function declared as a property.");var n=function(t){if("object"!=typeof t||null===t)throw new Error("Argument given to setupReusable must be an object with driver functions as properties.");if(es(t))throw new Error("Argument given to setupReusable must be an object with at least one driver function declared as a property.");var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=ae.create());return e}(t),n=function(t,e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o](e[o],o),n[o]&&"object"==typeof n[o]&&(n[o]._isCycleSource=o));return n}(t,e),o=function(t){for(var e in t)t.hasOwnProperty(e)&&t[e]&&"function"==typeof t[e].shamefullySendNext&&(t[e]=ts(t[e]));return t}(n);function r(t){return function(t,e){var n=He(),o=Object.keys(t).filter((function(t){return!!e[t]})),r={},i={};o.forEach((function(t){r[t]={_n:[],_e:[]},i[t]={next:function(e){return r[t]._n.push(e)},error:function(e){return r[t]._e.push(e)},complete:function(){}}}));var s=o.map((function(e){return ae.fromObservable(t[e]).subscribe(i[e])}));return o.forEach((function(t){var o=e[t],s=function(t){n((function(){return o._n(t)}))},a=function(t){n((function(){(console.error||console.log)(t),o._e(t)}))};r[t]._n.forEach(s),r[t]._e.forEach(a),i[t].next=s,i[t].error=a,i[t]._n=s,i[t]._e=a})),r=null,function(){s.forEach((function(t){return t.unsubscribe()}))}}(t,e)}function i(){!function(t){for(var e in t)t.hasOwnProperty(e)&&t[e]&&t[e].dispose&&t[e].dispose()}(o),function(t){Object.keys(t).forEach((function(e){return t[e]._c()}))}(e)}return{sources:o,run:r,dispose:i}}(e),o=t(n.sources);return"undefined"!=typeof window&&(window.Cyclejs=window.Cyclejs||{},window.Cyclejs.sinks=o),{sinks:o,sources:n.sources,run:function(){var t=n.run(o);return function(){t(),n.dispose()}}}}function os(t){const e=new EventTarget;return t.subscribe({next:t=>e.dispatchEvent(new CustomEvent("data",{detail:t})),error:t=>console.error("[EVENTS driver] Error in sink stream:",t)}),{select:t=>{const n=!t,o=Array.isArray(t)?t:[t];let r;const i=mi.create({start:t=>{r=({detail:e})=>{const r=e&&e.data||null;(n||o.includes(e.type))&&t.next(r)},e.addEventListener("data",r)},stop:t=>e.removeEventListener("data",r)});return pe(i)}}}function rs(t){t.addListener({next:t=>{console.log(t)},error:t=>{console.error("[LOG driver] Error in sink stream:",t)}})}class is{constructor(){this._connected=!1,this._components=new Map,this._stateHistory=[],this._maxHistory=200}get connected(){return this._connected&&"undefined"!=typeof window}init(){"undefined"!=typeof window&&(window.__SYGNAL_DEVTOOLS__=this,window.addEventListener("message",(t=>{t.source===window&&"__SYGNAL_DEVTOOLS_EXTENSION__"===t.data?.source&&this._handleExtensionMessage(t.data)})))}_handleExtensionMessage(t){switch(t.type){case"CONNECT":this._connected=!0,t.payload?.maxHistory&&(this._maxHistory=t.payload.maxHistory),this._sendFullTree();break;case"DISCONNECT":this._connected=!1;break;case"SET_DEBUG":this._setDebug(t.payload);break;case"TIME_TRAVEL":this._timeTravel(t.payload);break;case"GET_STATE":this._sendComponentState(t.payload.componentId)}}onComponentCreated(t,e,n){const o={id:t,name:e,isSubComponent:n.isSubComponent,hasModel:!!n.model,hasIntent:!!n.intent,hasContext:!!n.context,hasCalculated:!!n.calculated,components:Object.keys(n.components||{}),parentId:null,children:[],debug:n._debug,createdAt:Date.now(),_instanceRef:new WeakRef(n)};this._components.set(t,o),this.connected&&this._post("COMPONENT_CREATED",this._serializeMeta(o))}onStateChanged(t,e,n){if(!this.connected)return;const o={componentId:t,componentName:e,timestamp:Date.now(),state:this._safeClone(n)};this._stateHistory.push(o),this._stateHistory.length>this._maxHistory&&this._stateHistory.shift(),this._post("STATE_CHANGED",{componentId:t,componentName:e,state:o.state,historyIndex:this._stateHistory.length-1})}onActionDispatched(t,e,n,o){this.connected&&this._post("ACTION_DISPATCHED",{componentId:t,componentName:e,actionType:n,data:this._safeClone(o),timestamp:Date.now()})}onSubComponentRegistered(t,e){const n=this._components.get(t),o=this._components.get(e);n&&o&&(o.parentId=t,n.children.includes(e)||n.children.push(e)),this.connected&&this._post("TREE_UPDATED",{parentId:t,childId:e})}onContextChanged(t,e,n){this.connected&&this._post("CONTEXT_CHANGED",{componentId:t,componentName:e,context:this._safeClone(n)})}onDebugLog(t,e){this.connected&&this._post("DEBUG_LOG",{componentId:t,message:e,timestamp:Date.now()})}_setDebug({componentId:t,enabled:e}){if(null==t)return"undefined"!=typeof window&&(window.SYGNAL_DEBUG=!!e&&"true"),void this._post("DEBUG_TOGGLED",{global:!0,enabled:e});const n=this._components.get(t);if(n&&n._instanceRef){const o=n._instanceRef.deref();o&&(o._debug=e,n.debug=e,this._post("DEBUG_TOGGLED",{componentId:t,enabled:e}))}}_timeTravel({historyIndex:t}){const e=this._stateHistory[t];if(!e)return;const n="undefined"!=typeof window&&window.__SYGNAL_DEVTOOLS_APP__;n?.sinks?.STATE?.shamefullySendNext&&(n.sinks.STATE.shamefullySendNext((()=>({...e.state}))),this._post("TIME_TRAVEL_APPLIED",{historyIndex:t,state:e.state}))}_sendComponentState(t){const e=this._components.get(t);if(e&&e._instanceRef){const n=e._instanceRef.deref();n&&this._post("COMPONENT_STATE",{componentId:t,state:this._safeClone(n.currentState),context:this._safeClone(n.currentContext),props:this._safeClone(n.currentProps)})}}_sendFullTree(){const t=[];for(const[e,n]of this._components){const e=n._instanceRef?.deref();t.push({...this._serializeMeta(n),state:e?this._safeClone(e.currentState):null,context:e?this._safeClone(e.currentContext):null})}this._post("FULL_TREE",{components:t,history:this._stateHistory})}_post(t,e){"undefined"!=typeof window&&window.postMessage({source:"__SYGNAL_DEVTOOLS_PAGE__",type:t,payload:e},"*")}_safeClone(t){if(null==t)return t;try{return JSON.parse(JSON.stringify(t))}catch(t){return"[unserializable]"}}_serializeMeta(t){const{_instanceRef:e,...n}=t;return n}}let ss=null;function as(){return ss||(ss=new is),ss}function cs(t){if(!t)return null;const e=t.default||t;return"function"!=typeof e?null:t.default?t:{default:e}}function us(t){return/^[a-zA-Z0-9-_]+$/.test(t)}function ls(t){if("string"!=typeof t)throw new Error("Class name must be a string");return t.trim().split(" ").reduce(((t,e)=>{if(0===e.trim().length)return t;if(!us(e))throw new Error(`${e} is not a valid CSS class name`);return t.push(e),t}),[])}var ps={};Object.defineProperty(ps,"__esModule",{value:!0});var fs=o,hs=function(){function t(t,e){this.dt=t,this.ins=e,this.type="throttle",this.out=null,this.id=null}return t.prototype._start=function(t){this.out=t,this.ins._add(this)},t.prototype._stop=function(){this.ins._remove(this),this.out=null,this.id=null},t.prototype.clearInterval=function(){var t=this.id;null!==t&&clearInterval(t),this.id=null},t.prototype._n=function(t){var e=this,n=this.out;n&&(this.id||(n._n(t),this.id=setInterval((function(){e.clearInterval()}),this.dt)))},t.prototype._e=function(t){var e=this.out;e&&(this.clearInterval(),e._e(t))},t.prototype._c=function(){var t=this.out;t&&(this.clearInterval(),t._c())},t}();var ds=ps.default=function(t){return function(e){return new fs.Stream(new hs(t,e))}};t.ABORT=Gi,t.Collection=hi,t.MainDOMSource=Gn,t.MockedDOMSource=lo,t.Switchable=bi,t.a=go,t.abbr=bo,t.address=wo,t.area=So,t.article=Ao,t.aside=Eo,t.audio=Oo,t.b=No,t.base=Co,t.bdi=To,t.bdo=$o,t.blockquote=xo,t.body=Do,t.br=jo,t.button=ko,t.canvas=Lo,t.caption=Io,t.cite=Mo,t.classes=function(...t){return t.reduce(((t,e)=>{var n,o;return"string"!=typeof e||t.includes(e)?Array.isArray(e)?t.push(...(o=e,o.map(ls).flat())):"object"==typeof e&&t.push(...(n=e,Object.entries(n).filter((([t,e])=>"function"==typeof e?e():!!e)).map((([t,e])=>{const n=t.trim();if(!us(n))throw new Error(`${n} is not a valid CSS class name`);return n})))):t.push(...ls(e)),t}),[]).join(" ")},t.code=Po,t.col=Ro,t.colgroup=Fo,t.collection=fi,t.component=Ui,t.dd=Go,t.debounce=$i,t.del=Bo,t.delay=Ei,t.dfn=Uo,t.dir=Ho,t.div=Vo,t.dl=Yo,t.driverFromAsync=function(t,e={}){const{selector:n="category",args:o="value",return:r="value",pre:i=(t=>t),post:s=(t=>t)}=e,a=t.name||"[anonymous function]",c=typeof o;if(!("string"===c||"function"===c||Array.isArray(o)&&o.every((t=>"string"==typeof t))))throw new Error(`The 'args' option for driverFromAsync(${a}) must be a string, array of strings, or a function. Received ${c}`);if("string"!=typeof n)throw new Error(`The 'selector' option for driverFromAsync(${a}) must be a string. Received ${typeof n}`);return e=>{let c=null;const u=mi.create({start:t=>{c=t.next.bind(t)},stop:()=>{}});return e.addListener({next:e=>{const u=i(e);let l=[];if("object"==typeof u&&null!==u){if("function"==typeof o){const t=o(u);l=Array.isArray(t)?t:[t]}"string"==typeof o&&(l=[u[o]]),Array.isArray(o)&&(l=o.map((t=>u[t])))}const p=`Error in driver created using driverFromAsync(${a})`;t(...l).then((t=>{const o=t=>{let o;if(void 0===r)o=t,"object"==typeof o&&null!==o?o[n]=e[n]:console.warn(`The 'return' option for driverFromAsync(${a}) was not set, but the promise returned an non-object. The result will be returned as-is, but the '${n}' property will not be set, so will not be filtered by the 'select' method of the driver.`);else{if("string"!=typeof r)throw new Error(`The 'return' option for driverFromAsync(${a}) must be a string. Received ${typeof r}`);o={[r]:t,[n]:e[n]}}return o};if("function"==typeof t.then)t.then((t=>{const n=s(t,e);"function"==typeof n.then?n.then((t=>{c(o(t))})).catch((t=>console.error(`${p}: ${t}`))):c(o(n))})).catch((t=>console.error(`${p}: ${t}`)));else{const n=s(t,e);"function"==typeof n.then?n.then((t=>{c(o(t))})).catch((t=>console.error(`${p}: ${t}`))):c(o(n))}})).catch((t=>console.error(`${p}: ${t}`)))},error:t=>{console.error(`Error received from sink stream in driver created using driverFromAsync(${a}):`,t)},complete:()=>{console.warn(`Unexpected completion of sink stream to driver created using driverFromAsync(${a})`)}}),{select:t=>void 0===t?u:"function"==typeof t?u.filter(t):u.filter((e=>e?.[n]===t))}}},t.dropRepeats=be,t.dt=Wo,t.em=qo,t.embed=zo,t.enableHMR=function(t,e,n,o){if(!t||"function"!=typeof t.hmr)return t;if(!e||"function"!=typeof e.accept)return t;let r=!1;const i=e=>{Promise.resolve((async e=>{if(r)return;r=!0;const o=Array.isArray(e)?e.find(Boolean):e;try{let e=cs(o);if(e||"function"!=typeof n||(e=cs(await n())),e){const n=t?.sources?.STATE?.stream?._v;t.hmr(e,n)}}finally{r=!1}})(e)).catch((()=>{}))};return void 0!==o&&e.accept(o,i),e.accept(i),"function"==typeof e.dispose&&"function"==typeof t.dispose&&e.dispose((()=>t.dispose())),t},t.exactState=function(){return t=>t},t.fieldset=Jo,t.figcaption=Zo,t.figure=Xo,t.footer=Ko,t.form=Qo,t.getDevTools=as,t.h=cn,t.h1=tr,t.h2=er,t.h3=nr,t.h4=or,t.h5=rr,t.h6=ir,t.head=sr,t.header=ar,t.hgroup=cr,t.hr=ur,t.html=lr,t.i=pr,t.iframe=fr,t.img=hr,t.input=dr,t.ins=mr,t.kbd=yr,t.keygen=vr,t.label=_r,t.legend=gr,t.li=br,t.link=wr,t.main=Sr,t.makeDOMDriver=co,t.makeDragDriver=function(){return function(t){const e=new Map,n=new EventTarget,o=[];let r=null;const i=t=>{if(!t?.category)return;const n=e.get(t.category)??{};e.set(t.category,{...n,...t})};t.subscribe({next(t){(t?.configs??(Array.isArray(t)?t:[t])).forEach(i)},error(){},complete(){}});const s=(t,e)=>n.dispatchEvent(new CustomEvent(t,{detail:e})),a=(t,e)=>{document.addEventListener(t,e),o.push([t,e])};a("dragstart",(t=>{for(const[n,o]of e){if(!o.draggable)continue;const e=t.target.closest(o.draggable);if(e){if(r=n,t.dataTransfer.effectAllowed="move",o.dragImage){const n=e.closest(o.dragImage);if(n){const e=n.getBoundingClientRect();t.dataTransfer.setDragImage(n,t.clientX-e.left,t.clientY-e.top)}}return void s(`${n}:dragstart`,{element:e,dataset:{...e.dataset}})}}})),a("dragend",(()=>{r&&(s(`${r}:dragend`,null),r=null)})),a("dragover",(t=>{for(const[,n]of e)if(n.dropZone&&(!r||!n.accepts||n.accepts===r)&&t.target.closest(n.dropZone))return void t.preventDefault()})),a("drop",(t=>{for(const[n,o]of e){if(!o.dropZone)continue;if(r&&o.accepts&&o.accepts!==r)continue;const i=t.target.closest(o.dropZone);if(!i)continue;t.preventDefault();let a=null;const c=r?e.get(r):null;return c?.draggable&&(a=t.target.closest(c.draggable)??null),void s(`${n}:drop`,{dropZone:i,insertBefore:a})}}));const c={select:t=>({events(e){const o=`${t}:${e}`;let r;return mi.create({start(t){r=({detail:e})=>t.next(e),n.addEventListener(o,r)},stop(){r&&n.removeEventListener(o,r)}})}}),dragstart:t=>c.select(t).events("dragstart"),dragend:t=>c.select(t).events("dragend"),drop:t=>c.select(t).events("drop"),dragover:t=>c.select(t).events("dragover"),dispose(){o.forEach((([t,e])=>document.removeEventListener(t,e)))}};return c}},t.map=Ar,t.mark=Er,t.menu=Or,t.meta=Nr,t.mockDOMSource=function(t){return new lo(t)},t.nav=Cr,t.noscript=Tr,t.object=$r,t.ol=xr,t.optgroup=Dr,t.option=jr,t.p=kr,t.param=Lr,t.pre=Ir,t.processDrag=function({draggable:t,dropZone:e}={},n={}){if(t&&"function"!=typeof t.events)throw new Error("processDrag: draggable must have an .events() method (e.g. DOM.select(...))");if(e&&"function"!=typeof e.events)throw new Error("processDrag: dropZone must have an .events() method (e.g. DOM.select(...))");const{effectAllowed:o="move"}=n;return{dragStart$:t?t.events("dragstart").map((t=>(t.dataTransfer.effectAllowed=o,t))):mi.never(),dragEnd$:t?t.events("dragend").mapTo(null):mi.never(),dragOver$:e?e.events("dragover").map((t=>(t.preventDefault(),null))):mi.never(),drop$:e?e.events("drop").map((t=>(t.preventDefault(),t))):mi.never()}},t.processForm=function(t,e={}){if(!t||"function"!=typeof t.events)throw new Error("processForm: first argument must have an .events() method (e.g. DOM.select(...))");let{events:n=["input","submit"],preventDefault:o=!0}=e;"string"==typeof n&&(n=[n]);const r=n.map((e=>t.events(e)));return mi.merge(...r).map((t=>{o&&t.preventDefault();const e="submit"===t.type?t.srcElement:t.currentTarget,n=new FormData(e);let r={};r.event=t,r.eventType=t.type;const i=e.querySelector("input[type=submit]:focus");if(i){const{name:t,value:e}=i;r[t||"submit"]=e}for(let[t,e]of n.entries())r[t]=e;return r}))},t.progress=Mr,t.q=Pr,t.rp=Rr,t.rt=Fr,t.ruby=Gr,t.run=function t(e,n={},o={}){if("undefined"!=typeof window){as().init()}const{mountPoint:r="#root",fragments:i=!0,useDefaultDrivers:s=!0}=o;if(!e.isSygnalComponent){const t=e.name||e.componentName||e.label||"FUNCTIONAL_COMPONENT",n=e,{model:o,intent:r,hmrActions:i,context:s,peers:a,components:c,initialState:u,calculated:l,storeCalculatedInState:p,DOMSourceName:f,stateSourceName:h,debug:d}=e;e=Ui({name:t,view:n,model:o,intent:r,hmrActions:i,context:s,peers:a,components:c,initialState:u,calculated:l,storeCalculatedInState:p,DOMSourceName:f,stateSourceName:h,debug:d})}"undefined"!=typeof window&&!0===window.__SYGNAL_HMR_UPDATING&&void 0!==window.__SYGNAL_HMR_PERSISTED_STATE&&(e.initialState=window.__SYGNAL_HMR_PERSISTED_STATE);const a=function(t,e){return void 0===e&&(e="state"),function(n){var o=ae.create(),r=o.fold((function(t,e){return e(t)}),void 0).drop(1),i=n;i[e]=new Ce(r,e);var s=t(i);return s[e]&&Ge(ae.fromObservable(s[e]),ae.never()).subscribe({next:function(t){return Ve((function(){return o._n(t)}))},error:function(t){return Ve((function(){return o._e(t)}))},complete:function(){return Ve((function(){return o._c()}))}}),s}}(e,"STATE"),c={...s?{EVENTS:os,DOM:co(r,{snabbdomOptions:{experimental:{fragments:i}}}),LOG:rs}:{},...n},{sources:u,sinks:l,run:p}=ns(a,c),f=p();let h=null;"undefined"!=typeof window&&u?.STATE?.stream&&"function"==typeof u.STATE.stream.addListener&&(h={next:t=>{window.__SYGNAL_HMR_PERSISTED_STATE=t},error:()=>{},complete:()=>{}},u.STATE.stream.addListener(h));const d={sources:u,sinks:l,dispose:()=>{h&&u?.STATE?.stream&&"function"==typeof u.STATE.stream.removeListener&&(u.STATE.stream.removeListener(h),h=null),f()}};"undefined"!=typeof window&&(window.__SYGNAL_DEVTOOLS_APP__=d);const m=(r,i)=>{const s="undefined"!=typeof window?window.__SYGNAL_HMR_PERSISTED_STATE:void 0,a=void 0!==s?s:e.initialState,c=void 0===i?a:i;"undefined"!=typeof window&&(window.__SYGNAL_HMR_UPDATING=!0,window.__SYGNAL_HMR_STATE=c,window.__SYGNAL_HMR_PERSISTED_STATE=c),d.dispose();const u=r.default||r;u.initialState=c;const l=t(u,n,o);if(d.sources=l.sources,d.sinks=l.sinks,d.dispose=l.dispose,void 0!==c&&l?.sinks?.STATE&&"function"==typeof l.sinks.STATE.shamefullySendNext){const t=()=>l.sinks.STATE.shamefullySendNext((()=>({...c})));setTimeout(t,0),setTimeout(t,20)}"undefined"!=typeof window&&l?.sources?.STATE?.stream&&"function"==typeof l.sources.STATE.stream.setDebugListener?l.sources.STATE.stream.setDebugListener({next:()=>{l.sources.STATE.stream.setDebugListener(null),window.__SYGNAL_HMR_STATE=void 0,setTimeout((()=>{window.__SYGNAL_HMR_UPDATING=!1}),100)}}):"undefined"!=typeof window&&(window.__SYGNAL_HMR_STATE=void 0,window.__SYGNAL_HMR_UPDATING=!1)},y=t=>t?Array.isArray(t)?y(t.find(Boolean)):t.default&&"function"==typeof t.default?t:"function"==typeof t?{default:t}:null:null;return d.hmr=(t,n)=>{const o=y(t)||{default:e};if(void 0!==n)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=n),void m(o,n);const r="undefined"!=typeof window?window.__SYGNAL_HMR_PERSISTED_STATE:void 0;if(void 0!==r)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=r),void m(o,r);const i=d?.sources?.STATE?.stream?._v;if(void 0!==i)return"undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=i),void m(o,i);d?.sinks?.STATE&&"function"==typeof d.sinks.STATE.shamefullySendNext?d.sinks.STATE.shamefullySendNext((t=>("undefined"!=typeof window&&(window.__SYGNAL_HMR_LAST_CAPTURED_STATE=t),m(o,t),Gi))):m(o)},d},t.s=Br,t.samp=Ur,t.sampleCombine=zn,t.script=Hr,t.section=Vr,t.select=Yr,t.small=Wr,t.source=qr,t.span=zr,t.strong=Jr,t.style=Zr,t.sub=Xr,t.sup=Kr,t.svg=_o,t.switchable=_i,t.table=Qr,t.tbody=ti,t.td=ei,t.textarea=ni,t.tfoot=oi,t.th=ri,t.thead=ii,t.throttle=ds,t.thunk=function(t,e,n,o){return void 0===o&&(o=n,n=e,e=void 0),cn(t,{key:e,hook:{init:Nn,prepatch:Cn},fn:n,args:o})},t.title=si,t.tr=ai,t.u=ci,t.ul=ui,t.video=li,t.xs=mi}));
|
package/package.json
CHANGED
package/src/component.js
CHANGED
|
@@ -549,7 +549,7 @@ class Component {
|
|
|
549
549
|
const isParentSink = (sink === PARENT_SINK_NAME)
|
|
550
550
|
|
|
551
551
|
const on = isStateSink ? onState() : onNormal()
|
|
552
|
-
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, value })) : on(action, reducer)
|
|
552
|
+
const on$ = isParentSink ? on(action, reducer).map(value => ({ name: this.name, component: this.view, value })) : on(action, reducer)
|
|
553
553
|
|
|
554
554
|
const wrapped$ = on$
|
|
555
555
|
.compose(this.log(data => {
|
|
@@ -615,9 +615,13 @@ class Component {
|
|
|
615
615
|
}).map(sources => xs.merge(...sources)).flatten()
|
|
616
616
|
|
|
617
617
|
this.sources[CHILD_SOURCE_NAME] = {
|
|
618
|
-
select: (
|
|
618
|
+
select: (nameOrComponent) => {
|
|
619
619
|
const all$ = childSources$
|
|
620
|
-
const filtered$ =
|
|
620
|
+
const filtered$ = typeof nameOrComponent === 'function'
|
|
621
|
+
? all$.filter(entry => entry.component === nameOrComponent)
|
|
622
|
+
: nameOrComponent
|
|
623
|
+
? all$.filter(entry => entry.name === nameOrComponent)
|
|
624
|
+
: all$
|
|
621
625
|
const unwrapped$ = filtered$.map(entry => entry.value)
|
|
622
626
|
return unwrapped$
|
|
623
627
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ type ComponentModel<STATE, PROPS, DRIVERS, ACTIONS, CALCULATED, SINK_RETURNS ext
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
type ChildSource = {
|
|
141
|
-
select: (
|
|
141
|
+
select: (typeOrComponent: string | Function) => Stream<any>
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export type SygnalDOMSource = MainDOMSource & {
|