UNPKG

@lightningchart/lcjs

Version:

A high-performance charting library.

2 lines 1.73 MB
/* LightningChart JS v8.0.2 */ var lcjs=function(t){"use strict";var i,n=(i=function(t,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},i(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}i(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=function(){function t(){this.o=!0}return t.prototype.u=function(){return this.o},t}(),e=function(t){function i(i,n){var r=t.call(this)||this;return r.S=i,r.M=i,r.o=n,r}return n(i,t),i.prototype.C=function(t){return t!==this.S&&(this.M=this.S,this.S=t,this.o=!0),this},i.prototype._=function(){return this.S},i.prototype.u=function(){return t.prototype.u.call(this)},i}(r),o=function(t,i){return{x:t,y:i}},s=function(t,i){return{x:t,y:i}},u=function(t,i,n){return{position:t,high:i,low:n}},a=function(t,i,n){return{x:t,y:i,z:n}},h=function(t){var i=Array(0),n=Array(0);return t.length>0&&t.forEach((function(t){i.push(o(t.position,t.high)),n.push(o(t.position,t.low))})),[i,n]},f=function(t,i){return{min:t,max:i}},c=function(t,i,n,r){return{x:t,y:i,width:n,height:r}},l=function(t,i){return void 0===i&&(i=!0),new e(t,i)},v=function(t,i,n,r){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),{left:t,top:i,right:n,bottom:r}},d=v,y=function(t,i){return{left:void 0!==i.left?i.left:t.left,top:void 0!==i.top?i.top:t.top,right:void 0!==i.right?i.right:t.right,bottom:void 0!==i.bottom?i.bottom:t.bottom}},A="delete",b=32,p=31,m={};function g(t){t&&(t.value=!0)}function x(){}function S(t){return void 0===t.size&&(t.size=t.T(M)),t.size}function w(t,i){if("number"!=typeof i){var n=i>>>0;if(""+n!==i||4294967295===n)return NaN;i=n}return i<0?S(t)+i:i}function M(){return!0}function C(t,i,n){return(0===t&&!O(t)||void 0!==n&&t<=-n)&&(void 0===i||void 0!==n&&i>=n)}function _(t,i){return k(t,i,0)}function T(t,i){return k(t,i,i)}function k(t,i,n){return void 0===t?n:O(t)?i===1/0?i:0|Math.max(0,i+t):void 0===i||i===t?t:0|Math.min(i,t)}function O(t){return t<0||0===t&&1/t==-1/0}var F="@@__IMMUTABLE_ITERABLE__@@";function I(t){return Boolean(t&&t[F])}var j="@@__IMMUTABLE_KEYED__@@";function B(t){return Boolean(t&&t[j])}var D="@@__IMMUTABLE_INDEXED__@@";function E(t){return Boolean(t&&t[D])}function L(t){return B(t)||E(t)}var P=function(t){return I(t)?t:st(t)},z=function(t){function i(t){return B(t)?t:ut(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i}(P),V=function(t){function i(t){return E(t)?t:at(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i}(P),R=function(t){function i(t){return I(t)&&!L(t)?t:ht(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i}(P);P.Keyed=z,P.Indexed=V,P.Set=R;var N="@@__IMMUTABLE_SEQ__@@";function G(t){return Boolean(t&&t[N])}var U="@@__IMMUTABLE_RECORD__@@";function Y(t){return Boolean(t&&t[U])}function W(t){return I(t)||Y(t)}var X="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[X])}var Z="function"==typeof Symbol&&Symbol.iterator,J="@@iterator",Q=Z||J,K=function(t){this.next=t};function q(t,i,n,r){var e=0===t?i:1===t?n:[i,n];return r?r.value=e:r={value:e,done:!1},r}function $(){return{value:void 0,done:!0}}function tt(t){return!!Array.isArray(t)||!!rt(t)}function it(t){return t&&"function"==typeof t.next}function nt(t){var i=rt(t);return i&&i.call(t)}function rt(t){var i=t&&(Z&&t[Z]||t[J]);if("function"==typeof i)return i}K.prototype.toString=function(){return"[Iterator]"},K.KEYS=0,K.VALUES=1,K.ENTRIES=2,K.prototype.inspect=K.prototype.toSource=function(){return this.toString()},K.prototype[Q]=function(){return this};var et=Object.prototype.hasOwnProperty;function ot(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var st=function(t){function i(t){return null==t?dt():W(t)?t.toSeq():function(t){var i,n,r=bt(t);if(r)return(n=rt(i=t))&&n===i.entries?r.fromEntrySeq():function(t){var i=rt(t);return i&&i===t.keys}(t)?r.toSetSeq():r;if("object"==typeof t)return new ct(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.toSeq=function(){return this},i.prototype.toString=function(){return this.O("Seq {","}")},i.prototype.cacheResult=function(){return!this.F&&this.I&&(this.F=this.entrySeq().toArray(),this.size=this.F.length),this},i.prototype.T=function(t,i){var n=this.F;if(n){for(var r=n.length,e=0;e!==r;){var o=n[i?r-++e:e++];if(!1===t(o[1],o[0],this))break}return e}return this.I(t,i)},i.prototype.j=function(t,i){var n=this.F;if(n){var r=n.length,e=0;return new K((function(){if(e===r)return{value:void 0,done:!0};var o=n[i?r-++e:e++];return q(t,o[0],o[1])}))}return this.D(t,i)},i}(P),ut=function(t){function i(t){return null==t?dt().toKeyedSeq():I(t)?B(t)?t.toSeq():t.fromEntrySeq():Y(t)?t.toSeq():yt(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.toKeyedSeq=function(){return this},i}(st),at=function(t){function i(t){return null==t?dt():I(t)?B(t)?t.entrySeq():t.toIndexedSeq():Y(t)?t.toSeq().entrySeq():At(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return i(arguments)},i.prototype.toIndexedSeq=function(){return this},i.prototype.toString=function(){return this.O("Seq [","]")},i}(st),ht=function(t){function i(t){return(I(t)&&!L(t)?t:at(t)).toSetSeq()}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return i(arguments)},i.prototype.toSetSeq=function(){return this},i}(st);st.isSeq=G,st.Keyed=ut,st.Set=ht,st.Indexed=at,st.prototype[N]=!0;var ft=function(t){function i(t){this.L=t,this.size=t.length}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.get=function(t,i){return this.has(t)?this.L[w(this,t)]:i},i.prototype.T=function(t,i){for(var n=this.L,r=n.length,e=0;e!==r;){var o=i?r-++e:e++;if(!1===t(n[o],o,this))break}return e},i.prototype.j=function(t,i){var n=this.L,r=n.length,e=0;return new K((function(){if(e===r)return{value:void 0,done:!0};var o=i?r-++e:e++;return q(t,o,n[o])}))},i}(at),ct=function(t){function i(t){var i=Object.keys(t);this.P=t,this.V=i,this.size=i.length}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.get=function(t,i){return void 0===i||this.has(t)?this.P[t]:i},i.prototype.has=function(t){return et.call(this.P,t)},i.prototype.T=function(t,i){for(var n=this.P,r=this.V,e=r.length,o=0;o!==e;){var s=r[i?e-++o:o++];if(!1===t(n[s],s,this))break}return o},i.prototype.j=function(t,i){var n=this.P,r=this.V,e=r.length,o=0;return new K((function(){if(o===e)return{value:void 0,done:!0};var s=r[i?e-++o:o++];return q(t,s,n[s])}))},i}(ut);ct.prototype[X]=!0;var lt,vt=function(t){function i(t){this.R=t,this.size=t.length||t.size}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.I=function(t,i){if(i)return this.cacheResult().T(t,i);var n=nt(this.R),r=0;if(it(n))for(var e;!(e=n.next()).done&&!1!==t(e.value,r++,this););return r},i.prototype.D=function(t,i){if(i)return this.cacheResult().j(t,i);var n=nt(this.R);if(!it(n))return new K($);var r=0;return new K((function(){var i=n.next();return i.done?i:q(t,r++,i.value)}))},i}(at);function dt(){return lt||(lt=new ft([]))}function yt(t){var i=bt(t);if(i)return i.fromEntrySeq();if("object"==typeof t)return new ct(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function At(t){var i=bt(t);if(i)return i;throw new TypeError("Expected Array or collection object of values: "+t)}function bt(t){return ot(t)?new ft(t):tt(t)?new vt(t):void 0}var pt="@@__IMMUTABLE_MAP__@@";function mt(t){return Boolean(t&&t[pt])}function gt(t){return mt(t)&&H(t)}function xt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function St(t,i){if(t===i||t!=t&&i!=i)return!0;if(!t||!i)return!1;if("function"==typeof t.valueOf&&"function"==typeof i.valueOf){if((t=t.valueOf())===(i=i.valueOf())||t!=t&&i!=i)return!0;if(!t||!i)return!1}return!!(xt(t)&&xt(i)&&t.equals(i))}var wt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,i){var n=65535&(t|=0),r=65535&(i|=0);return n*r+((t>>>16)*r+n*(i>>>16)<<16>>>0)|0};function Mt(t){return t>>>1&1073741824|3221225471&t}var Ct=Object.prototype.valueOf;function _t(t){if(null==t)return Tt(t);if("function"==typeof t.hashCode)return Mt(t.hashCode(t));var i,n,r,e=(i=t).valueOf!==Ct&&"function"==typeof i.valueOf?i.valueOf(i):i;if(null==e)return Tt(e);switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var i=0|t;for(i!==t&&(i^=4294967295*t);t>4294967295;)i^=t/=4294967295;return Mt(i)}(e);case"string":return e.length>Pt?(void 0===(r=Rt[n=e])&&(r=kt(n),Vt===zt&&(Vt=0,Rt={}),Vt++,Rt[n]=r),r):kt(e);case"object":case"function":return function(t){var i;if(Bt&&void 0!==(i=jt.get(t)))return i;if(void 0!==(i=t[Lt]))return i;if(!Ft){if(void 0!==(i=t.propertyIsEnumerable&&t.propertyIsEnumerable[Lt]))return i;if(void 0!==(i=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return i}if(i=It(),Bt)jt.set(t,i);else{if(void 0!==Ot&&!1===Ot(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Ft)Object.defineProperty(t,Lt,{enumerable:!1,configurable:!1,writable:!1,value:i});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Lt]=i;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Lt]=i}}return i}(e);case"symbol":return function(t){var i=Dt[t];return void 0!==i||(i=It(),Dt[t]=i),i}(e);default:if("function"==typeof e.toString)return kt(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function Tt(t){return null===t?1108378658:1108378659}function kt(t){for(var i=0,n=0;n<t.length;n++)i=31*i+t.charCodeAt(n)|0;return Mt(i)}var Ot=Object.isExtensible,Ft=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function It(){var t=++Et;return 1073741824&Et&&(Et=0),t}var jt,Bt="function"==typeof WeakMap;Bt&&(jt=new WeakMap);var Dt=Object.create(null),Et=0,Lt="__immutablehash__";"function"==typeof Symbol&&(Lt=Symbol(Lt));var Pt=16,zt=255,Vt=0,Rt={},Nt=function(t){function i(t,i){this.N=t,this.G=i,this.size=t.size}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.get=function(t,i){return this.N.get(t,i)},i.prototype.has=function(t){return this.N.has(t)},i.prototype.valueSeq=function(){return this.N.valueSeq()},i.prototype.reverse=function(){var t=this,i=Ht(this,!0);return this.G||(i.valueSeq=function(){return t.N.toSeq().reverse()}),i},i.prototype.map=function(t,i){var n=this,r=Xt(this,t,i);return this.G||(r.valueSeq=function(){return n.N.toSeq().map(t,i)}),r},i.prototype.T=function(t,i){var n=this;return this.N.T((function(i,r){return t(i,r,n)}),i)},i.prototype.j=function(t,i){return this.N.j(t,i)},i}(ut);Nt.prototype[X]=!0;var Gt=function(t){function i(t){this.N=t,this.size=t.size}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.includes=function(t){return this.N.includes(t)},i.prototype.T=function(t,i){var n=this,r=0;return i&&S(this),this.N.T((function(e){return t(e,i?n.size-++r:r++,n)}),i)},i.prototype.j=function(t,i){var n=this,r=this.N.j(1,i),e=0;return i&&S(this),new K((function(){var o=r.next();return o.done?o:q(t,i?n.size-++e:e++,o.value,o)}))},i}(at),Ut=function(t){function i(t){this.N=t,this.size=t.size}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.has=function(t){return this.N.includes(t)},i.prototype.T=function(t,i){var n=this;return this.N.T((function(i){return t(i,i,n)}),i)},i.prototype.j=function(t,i){var n=this.N.j(1,i);return new K((function(){var i=n.next();return i.done?i:q(t,i.value,i.value,i)}))},i}(ht),Yt=function(t){function i(t){this.N=t,this.size=t.size}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.entrySeq=function(){return this.N.toSeq()},i.prototype.T=function(t,i){var n=this;return this.N.T((function(i){if(i){ri(i);var r=I(i);return t(r?i.get(1):i[1],r?i.get(0):i[0],n)}}),i)},i.prototype.j=function(t,i){var n=this.N.j(1,i);return new K((function(){for(;;){var i=n.next();if(i.done)return i;var r=i.value;if(r){ri(r);var e=I(r);return q(t,e?r.get(0):r[0],e?r.get(1):r[1],i)}}}))},i}(ut);function Wt(t){var i=oi(t);return i.N=t,i.size=t.size,i.flip=function(){return t},i.reverse=function(){var i=t.reverse.apply(this);return i.flip=function(){return t.reverse()},i},i.has=function(i){return t.includes(i)},i.includes=function(i){return t.has(i)},i.cacheResult=si,i.I=function(i,n){var r=this;return t.T((function(t,n){return!1!==i(n,t,r)}),n)},i.D=function(i,n){if(2===i){var r=t.j(i,n);return new K((function(){var t=r.next();if(!t.done){var i=t.value[0];t.value[0]=t.value[1],t.value[1]=i}return t}))}return t.j(1===i?0:1,n)},i}function Xt(t,i,n){var r=oi(t);return r.size=t.size,r.has=function(i){return t.has(i)},r.get=function(r,e){var o=t.get(r,m);return o===m?e:i.call(n,o,r,t)},r.I=function(r,e){var o=this;return t.T((function(t,e,s){return!1!==r(i.call(n,t,e,s),e,o)}),e)},r.D=function(r,e){var o=t.j(2,e);return new K((function(){var e=o.next();if(e.done)return e;var s=e.value,u=s[0];return q(r,u,i.call(n,s[1],u,t),e)}))},r}function Ht(t,i){var n=this,r=oi(t);return r.N=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var i=Wt(t);return i.reverse=function(){return t.flip()},i}),r.get=function(n,r){return t.get(i?n:-1-n,r)},r.has=function(n){return t.has(i?n:-1-n)},r.includes=function(i){return t.includes(i)},r.cacheResult=si,r.T=function(n,r){var e=this,o=0;return r&&S(t),t.T((function(t,s){return n(t,i?s:r?e.size-++o:o++,e)}),!r)},r.j=function(r,e){var o=0;e&&S(t);var s=t.j(2,!e);return new K((function(){var t=s.next();if(t.done)return t;var u=t.value;return q(r,i?u[0]:e?n.size-++o:o++,u[1],t)}))},r}function Zt(t,i,n,r){var e=oi(t);return r&&(e.has=function(r){var e=t.get(r,m);return e!==m&&!!i.call(n,e,r,t)},e.get=function(r,e){var o=t.get(r,m);return o!==m&&i.call(n,o,r,t)?o:e}),e.I=function(e,o){var s=this,u=0;return t.T((function(t,o,a){if(i.call(n,t,o,a))return u++,e(t,r?o:u-1,s)}),o),u},e.D=function(e,o){var s=t.j(2,o),u=0;return new K((function(){for(;;){var o=s.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(i.call(n,f,h,t))return q(e,r?h:u++,f,o)}}))},e}function Jt(t,i,n,r){var e=t.size;if(C(i,n,e))return t;var o=_(i,e),s=T(n,e);if(o!=o||s!=s)return Jt(t.toSeq().cacheResult(),i,n,r);var u,a=s-o;a==a&&(u=a<0?0:a);var h=oi(t);return h.size=0===u?u:t.size&&u||void 0,!r&&G(t)&&u>=0&&(h.get=function(i,n){return(i=w(this,i))>=0&&i<u?t.get(i+o,n):n}),h.I=function(i,n){var e=this;if(0===u)return 0;if(n)return this.cacheResult().T(i,n);var s=0,a=!0,h=0;return t.T((function(t,n){if(!a||!(a=s++<o))return h++,!1!==i(t,r?n:h-1,e)&&h!==u})),h},h.D=function(i,n){if(0!==u&&n)return this.cacheResult().j(i,n);if(0===u)return new K($);var e=t.j(i,n),s=0,a=0;return new K((function(){for(;s++<o;)e.next();if(++a>u)return{value:void 0,done:!0};var t=e.next();return r||1===i||t.done?t:q(i,a-1,0===i?void 0:t.value[1],t)}))},h}function Qt(t,i,n,r){var e=oi(t);return e.I=function(e,o){var s=this;if(o)return this.cacheResult().T(e,o);var u=!0,a=0;return t.T((function(t,o,h){if(!u||!(u=i.call(n,t,o,h)))return a++,e(t,r?o:a-1,s)})),a},e.D=function(e,o){var s=this;if(o)return this.cacheResult().j(e,o);var u=t.j(2,o),a=!0,h=0;return new K((function(){var t,o,f;do{if((t=u.next()).done)return r||1===e?t:q(e,h++,0===e?void 0:t.value[1],t);var c=t.value;o=c[0],f=c[1],a&&(a=i.call(n,f,o,s))}while(a);return 2===e?t:q(e,o,f,t)}))},e}function Kt(t,i,n){var r=oi(t);return r.I=function(e,o){if(o)return this.cacheResult().T(e,o);var s=0,u=!1;return function t(a,h){a.T((function(o,a){return(!i||h<i)&&I(o)?t(o,h+1):(s++,!1===e(o,n?a:s-1,r)&&(u=!0)),!u}),o)}(t,0),s},r.D=function(r,e){if(e)return this.cacheResult().j(r,e);var o=t.j(r,e),s=[],u=0;return new K((function(){for(;o;){var t=o.next();if(!1===t.done){var a=t.value;if(2===r&&(a=a[1]),i&&!(s.length<i)||!I(a))return n?t:q(r,u++,a,t);s.push(o),o=a.j(r,e)}else o=s.pop()}return{value:void 0,done:!0}}))},r}function qt(t,i,n){i||(i=ui);var r=B(t),e=0,o=t.toSeq().map((function(i,r){return[r,i,e++,n?n(i,r,t):i]})).valueSeq().toArray();return o.sort((function(t,n){return i(t[3],n[3])||t[2]-n[2]})).forEach(r?function(t,i){o[i].length=2}:function(t,i){o[i]=t[1]}),r?ut(o):E(t)?at(o):ht(o)}function $t(t,i,n){if(i||(i=ui),n){var r=t.toSeq().map((function(i,r){return[i,n(i,r,t)]})).reduce((function(t,n){return ti(i,t[1],n[1])?n:t}));return r&&r[0]}return t.reduce((function(t,n){return ti(i,t,n)?n:t}))}function ti(t,i,n){var r=t(n,i);return 0===r&&n!==i&&(null==n||n!=n)||r>0}function ii(t,i,n,r){var e=oi(t),o=new ft(n).map((function(t){return t.size}));return e.size=r?o.max():o.min(),e.T=function(t,i){for(var n,r=this.j(1,i),e=0;!(n=r.next()).done&&!1!==t(n.value,e++,this););return e},e.D=function(t,e){var o=n.map((function(t){return t=P(t),nt(e?t.reverse():t)})),s=0,u=!1;return new K((function(){var n;return u||(n=o.map((function(t){return t.next()})),u=r?n.every((function(t){return t.done})):n.some((function(t){return t.done}))),u?{value:void 0,done:!0}:q(t,s++,i.apply(null,n.map((function(t){return t.value}))))}))},e}function ni(t,i){return t===i?t:G(t)?i:t.constructor(i)}function ri(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function ei(t){return B(t)?z:E(t)?V:R}function oi(t){return Object.create((B(t)?ut:E(t)?at:ht).prototype)}function si(){return this.N.cacheResult?(this.N.cacheResult(),this.size=this.N.size,this):st.prototype.cacheResult.call(this)}function ui(t,i){return void 0===t&&void 0===i?0:void 0===t?1:void 0===i?-1:t>i?1:t<i?-1:0}function ai(t,i){i=i||0;for(var n=Math.max(0,t.length-i),r=new Array(n),e=0;e<n;e++)r[e]=t[e+i];return r}function hi(t,i){if(!t)throw new Error(i)}function fi(t){hi(t!==1/0,"Cannot perform this action with an infinite size.")}function ci(t){if(ot(t)&&"string"!=typeof t)return t;if(H(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}Gt.prototype.cacheResult=Nt.prototype.cacheResult=Ut.prototype.cacheResult=Yt.prototype.cacheResult=si;var li=Object.prototype.toString;function vi(t){return"object"==typeof t&&(W(t)||Array.isArray(t)||function(t){if(!t||"object"!=typeof t||"[object Object]"!==li.call(t))return!1;var i=Object.getPrototypeOf(t);if(null===i)return!0;for(var n=i,r=Object.getPrototypeOf(i);null!==r;)n=r,r=Object.getPrototypeOf(n);return n===i}(t))}function di(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(i){return JSON.stringify(t)}}function yi(t,i,n){return W(t)?t.get(i,n):function(t,i){return W(t)?t.has(i):vi(t)&&et.call(t,i)}(t,i)?"function"==typeof t.get?t.get(i):t[i]:n}function Ai(t){if(Array.isArray(t))return ai(t);var i={};for(var n in t)et.call(t,n)&&(i[n]=t[n]);return i}function bi(t,i,n,r){r||(r=n,n=void 0);var e=pi(W(t),t,ci(i),0,n,r);return e===m?n:e}function pi(t,i,n,r,e,o){var s=i===m;if(r===n.length){var u=s?e:i,a=o(u);return a===u?i:a}if(!s&&!vi(i))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,r).map(di)+"]: "+i);var h=n[r],f=s?m:yi(i,h,m),c=pi(f===m?t:W(f),f,n,r+1,e,o);return c===f?i:c===m?function(t,i){if(!vi(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(i)}if(!et.call(t,i))return t;var n=Ai(t);return Array.isArray(n)?n.splice(i,1):delete n[i],n}(i,h):function(t,i,n){if(!vi(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(i,n)}if(et.call(t,i)&&n===t[i])return t;var r=Ai(t);return r[i]=n,r}(s?t?Ji():{}:i,h,c)}function mi(t,i){return function(t,i,n){return bi(t,i,m,(function(){return n}))}(this,t,i)}function gi(t){return function(t,i){return bi(t,i,(function(){return m}))}(this,t)}function xi(t,i,n,r){return bi(t,[i],n,r)}function Si(t,i,n){return 1===arguments.length?t(this):xi(this,t,i,n)}function wi(t,i,n){return bi(this,t,i,n)}function Mi(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return _i(this,t)}function Ci(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return _i(this,i,t)}function _i(t,i,n){for(var r=[],e=0;e<i.length;e++){var o=z(i[e]);0!==o.size&&r.push(o)}return 0===r.length?t:0!==t.toSeq().size||t.U||1!==r.length?t.withMutations((function(t){for(var i=n?function(i,r){xi(t,r,m,(function(t){return t===m?i:n(t,i,r)}))}:function(i,n){t.set(n,i)},e=0;e<r.length;e++)r[e].forEach(i)})):t.constructor(r[0])}function Ti(t,i,n){return ki(t,i,function(t){return function i(n,r,e){return vi(n)&&vi(r)&&(o=r,s=st(n),u=st(o),E(s)===E(u)&&B(s)===B(u))?ki(n,[r],i):t?t(n,r,e):r;var o,s,u}}(n))}function ki(t,i,n){if(!vi(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(W(t))return"function"==typeof n&&t.mergeWith?t.mergeWith.apply(t,[n].concat(i)):t.merge?t.merge.apply(t,i):t.concat.apply(t,i);for(var r=Array.isArray(t),e=t,o=r?V:z,s=r?function(i){e===t&&(e=Ai(e)),e.push(i)}:function(i,r){var o=et.call(e,r),s=o&&n?n(e[r],i,r):i;o&&s===e[r]||(e===t&&(e=Ai(e)),e[r]=s)},u=0;u<i.length;u++)o(i[u]).forEach(s);return e}function Oi(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return Ti(this,t)}function Fi(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];return Ti(this,i,t)}function Ii(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];return bi(this,t,Ji(),(function(t){return ki(t,i)}))}function ji(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];return bi(this,t,Ji(),(function(t){return Ti(t,i)}))}function Bi(t){var i=this.asMutable();return t(i),i.wasAltered()?i.Y(this.U):this}function Di(){return this.U?this:this.Y(new x)}function Ei(){return this.Y()}function Li(){return this.W}var Pi=function(t){function i(i){return null==i?Ji():mt(i)&&!H(i)?i:Ji().withMutations((function(n){var r=t(i);fi(r.size),r.forEach((function(t,i){return n.set(i,t)}))}))}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return Ji().withMutations((function(i){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);i.set(t[n],t[n+1])}}))},i.prototype.toString=function(){return this.O("Map {","}")},i.prototype.get=function(t,i){return this.X?this.X.get(0,void 0,t,i):i},i.prototype.set=function(t,i){return Qi(this,t,i)},i.prototype.remove=function(t){return Qi(this,t,m)},i.prototype.deleteAll=function(t){var i=P(t);return 0===i.size?this:this.withMutations((function(t){i.forEach((function(i){return t.remove(i)}))}))},i.prototype.clear=function(){return 0===this.size?this:this.U?(this.size=0,this.X=null,this.H=void 0,this.W=!0,this):Ji()},i.prototype.sort=function(t){return Sn(qt(this,t))},i.prototype.sortBy=function(t,i){return Sn(qt(this,i,t))},i.prototype.map=function(t,i){var n=this;return this.withMutations((function(r){r.forEach((function(e,o){r.set(o,t.call(i,e,o,n))}))}))},i.prototype.j=function(t,i){return new Wi(this,t,i)},i.prototype.T=function(t,i){var n=this,r=0;return this.X&&this.X.iterate((function(i){return r++,t(i[1],i[0],n)}),i),r},i.prototype.Y=function(t){return t===this.U?this:t?Zi(this.size,this.X,t,this.H):0===this.size?Ji():(this.U=t,this.W=!1,this)},i}(z);Pi.isMap=mt;var zi=Pi.prototype;zi[pt]=!0,zi[A]=zi.remove,zi.removeAll=zi.deleteAll,zi.setIn=mi,zi.removeIn=zi.deleteIn=gi,zi.update=Si,zi.updateIn=wi,zi.merge=zi.concat=Mi,zi.mergeWith=Ci,zi.mergeDeep=Oi,zi.mergeDeepWith=Fi,zi.mergeIn=Ii,zi.mergeDeepIn=ji,zi.withMutations=Bi,zi.wasAltered=Li,zi.asImmutable=Ei,zi["@@transducer/init"]=zi.asMutable=Di,zi["@@transducer/step"]=function(t,i){return t.set(i[0],i[1])},zi["@@transducer/result"]=function(t){return t.asImmutable()};var Vi=function(t,i){this.ownerID=t,this.entries=i};Vi.prototype.get=function(t,i,n,r){for(var e=this.entries,o=0,s=e.length;o<s;o++)if(St(n,e[o][0]))return e[o][1];return r},Vi.prototype.update=function(t,i,n,r,e,o,s){for(var u=e===m,a=this.entries,h=0,f=a.length;h<f&&!St(r,a[h][0]);h++);var c=h<f;if(c?a[h][1]===e:u)return this;if(g(s),(u||!c)&&g(o),!u||1!==a.length){if(!c&&!u&&a.length>=rn)return function(t,i,n,r){t||(t=new x);for(var e=new Ui(t,_t(n),[n,r]),o=0;o<i.length;o++){var s=i[o];e=e.update(t,0,void 0,s[0],s[1])}return e}(t,a,r,e);var l=t&&t===this.ownerID,v=l?a:ai(a);return c?u?h===f-1?v.pop():v[h]=v.pop():v[h]=[r,e]:v.push([r,e]),l?(this.entries=v,this):new Vi(t,v)}};var Ri=function(t,i,n){this.ownerID=t,this.bitmap=i,this.nodes=n};Ri.prototype.get=function(t,i,n,r){void 0===i&&(i=_t(n));var e=1<<((0===t?i:i>>>t)&p),o=this.bitmap;return o&e?this.nodes[tn(o&e-1)].get(t+5,i,n,r):r},Ri.prototype.update=function(t,i,n,r,e,o,s){void 0===n&&(n=_t(r));var u=(0===i?n:n>>>i)&p,a=1<<u,h=this.bitmap,f=!!(h&a);if(!f&&e===m)return this;var c=tn(h&a-1),l=this.nodes,v=f?l[c]:void 0,d=Ki(v,t,i+5,n,r,e,o,s);if(d===v)return this;if(!f&&d&&l.length>=en)return function(t,i,n,r,e){for(var o=0,s=new Array(b),u=0;0!==n;u++,n>>>=1)s[u]=1&n?i[o++]:void 0;return s[r]=e,new Ni(t,o+1,s)}(t,l,h,u,d);if(f&&!d&&2===l.length&&qi(l[1^c]))return l[1^c];if(f&&d&&1===l.length&&qi(d))return d;var y=t&&t===this.ownerID,A=f?d?h:h^a:h|a,g=f?d?nn(l,c,d,y):function(t,i,n){var r=t.length-1;if(n&&i===r)return t.pop(),t;for(var e=new Array(r),o=0,s=0;s<r;s++)s===i&&(o=1),e[s]=t[s+o];return e}(l,c,y):function(t,i,n,r){var e=t.length+1;if(r&&i+1===e)return t[i]=n,t;for(var o=new Array(e),s=0,u=0;u<e;u++)u===i?(o[u]=n,s=-1):o[u]=t[u+s];return o}(l,c,d,y);return y?(this.bitmap=A,this.nodes=g,this):new Ri(t,A,g)};var Ni=function(t,i,n){this.ownerID=t,this.count=i,this.nodes=n};Ni.prototype.get=function(t,i,n,r){void 0===i&&(i=_t(n));var e=(0===t?i:i>>>t)&p,o=this.nodes[e];return o?o.get(t+5,i,n,r):r},Ni.prototype.update=function(t,i,n,r,e,o,s){void 0===n&&(n=_t(r));var u=(0===i?n:n>>>i)&p,a=e===m,h=this.nodes,f=h[u];if(a&&!f)return this;var c=Ki(f,t,i+5,n,r,e,o,s);if(c===f)return this;var l=this.count;if(f){if(!c&&--l<on)return function(t,i,n,r){for(var e=0,o=0,s=new Array(n),u=0,a=1,h=i.length;u<h;u++,a<<=1){var f=i[u];void 0!==f&&u!==r&&(e|=a,s[o++]=f)}return new Ri(t,e,s)}(t,h,l,u)}else l++;var v=t&&t===this.ownerID,d=nn(h,u,c,v);return v?(this.count=l,this.nodes=d,this):new Ni(t,l,d)};var Gi=function(t,i,n){this.ownerID=t,this.keyHash=i,this.entries=n};Gi.prototype.get=function(t,i,n,r){for(var e=this.entries,o=0,s=e.length;o<s;o++)if(St(n,e[o][0]))return e[o][1];return r},Gi.prototype.update=function(t,i,n,r,e,o,s){void 0===n&&(n=_t(r));var u=e===m;if(n!==this.keyHash)return u?this:(g(s),g(o),$i(this,t,i,n,[r,e]));for(var a=this.entries,h=0,f=a.length;h<f&&!St(r,a[h][0]);h++);var c=h<f;if(c?a[h][1]===e:u)return this;if(g(s),(u||!c)&&g(o),u&&2===f)return new Ui(t,this.keyHash,a[1^h]);var l=t&&t===this.ownerID,v=l?a:ai(a);return c?u?h===f-1?v.pop():v[h]=v.pop():v[h]=[r,e]:v.push([r,e]),l?(this.entries=v,this):new Gi(t,this.keyHash,v)};var Ui=function(t,i,n){this.ownerID=t,this.keyHash=i,this.entry=n};Ui.prototype.get=function(t,i,n,r){return St(n,this.entry[0])?this.entry[1]:r},Ui.prototype.update=function(t,i,n,r,e,o,s){var u=e===m,a=St(r,this.entry[0]);return(a?e===this.entry[1]:u)?this:(g(s),u?void g(o):a?t&&t===this.ownerID?(this.entry[1]=e,this):new Ui(t,this.keyHash,[r,e]):(g(o),$i(this,t,i,_t(r),[r,e])))},Vi.prototype.iterate=Gi.prototype.iterate=function(t,i){for(var n=this.entries,r=0,e=n.length-1;r<=e;r++)if(!1===t(n[i?e-r:r]))return!1},Ri.prototype.iterate=Ni.prototype.iterate=function(t,i){for(var n=this.nodes,r=0,e=n.length-1;r<=e;r++){var o=n[i?e-r:r];if(o&&!1===o.iterate(t,i))return!1}},Ui.prototype.iterate=function(t,i){return t(this.entry)};var Yi,Wi=function(t){function i(t,i,n){this.Z=i,this.J=n,this.K=t.X&&Hi(t.X)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.next=function(){for(var t=this.Z,i=this.K;i;){var n=i.node,r=i.index++,e=void 0;if(n.entry){if(0===r)return Xi(t,n.entry)}else if(n.entries){if(r<=(e=n.entries.length-1))return Xi(t,n.entries[this.J?e-r:r])}else if(r<=(e=n.nodes.length-1)){var o=n.nodes[this.J?e-r:r];if(o){if(o.entry)return Xi(t,o.entry);i=this.K=Hi(o,i)}continue}i=this.K=this.K.q}return{value:void 0,done:!0}},i}(K);function Xi(t,i){return q(t,i[0],i[1])}function Hi(t,i){return{node:t,index:0,q:i}}function Zi(t,i,n,r){var e=Object.create(zi);return e.size=t,e.X=i,e.U=n,e.H=r,e.W=!1,e}function Ji(){return Yi||(Yi=Zi(0))}function Qi(t,i,n){var r,e;if(t.X){var o={value:!1},s={value:!1};if(r=Ki(t.X,t.U,0,void 0,i,n,o,s),!s.value)return t;e=t.size+(o.value?n===m?-1:1:0)}else{if(n===m)return t;e=1,r=new Vi(t.U,[[i,n]])}return t.U?(t.size=e,t.X=r,t.H=void 0,t.W=!0,t):r?Zi(e,r):Ji()}function Ki(t,i,n,r,e,o,s,u){return t?t.update(i,n,r,e,o,s,u):o===m?t:(g(u),g(s),new Ui(i,r,[e,o]))}function qi(t){return t.constructor===Ui||t.constructor===Gi}function $i(t,i,n,r,e){if(t.keyHash===r)return new Gi(i,r,[t.entry,e]);var o,s=(0===n?t.keyHash:t.keyHash>>>n)&p,u=(0===n?r:r>>>n)&p,a=s===u?[$i(t,i,n+5,r,e)]:(o=new Ui(i,r,e),s<u?[t,o]:[o,t]);return new Ri(i,1<<s|1<<u,a)}function tn(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function nn(t,i,n,r){var e=r?t:ai(t);return e[i]=n,e}var rn=8,en=16,on=8,sn="@@__IMMUTABLE_LIST__@@";function un(t){return Boolean(t&&t[sn])}var an=function(t){function i(i){var n=yn();if(null==i)return n;if(un(i))return i;var r=t(i),e=r.size;return 0===e?n:(fi(e),e>0&&e<b?dn(0,e,5,null,new fn(r.toArray())):n.withMutations((function(t){t.setSize(e),r.forEach((function(i,n){return t.set(n,i)}))})))}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return this(arguments)},i.prototype.toString=function(){return this.O("List [","]")},i.prototype.get=function(t,i){if((t=w(this,t))>=0&&t<this.size){var n=pn(this,t+=this.$);return n&&n.array[t&p]}return i},i.prototype.set=function(t,i){return function(t,i,n){if((i=w(t,i))!=i)return t;if(i>=t.size||i<0)return t.withMutations((function(t){i<0?mn(t,i).set(0,n):mn(t,0,i+1).set(i,n)}));i+=t.$;var r=t.tt,e=t.X,o={value:!1};return i>=gn(t.it)?r=An(r,t.U,0,i,n,o):e=An(e,t.U,t.nt,i,n,o),o.value?t.U?(t.X=e,t.tt=r,t.H=void 0,t.W=!0,t):dn(t.$,t.it,t.nt,e,r):t}(this,t,i)},i.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},i.prototype.insert=function(t,i){return this.splice(t,0,i)},i.prototype.clear=function(){return 0===this.size?this:this.U?(this.size=this.$=this.it=0,this.nt=5,this.X=this.tt=this.H=void 0,this.W=!0,this):yn()},i.prototype.push=function(){var t=arguments,i=this.size;return this.withMutations((function(n){mn(n,0,i+t.length);for(var r=0;r<t.length;r++)n.set(i+r,t[r])}))},i.prototype.pop=function(){return mn(this,0,-1)},i.prototype.unshift=function(){var t=arguments;return this.withMutations((function(i){mn(i,-t.length);for(var n=0;n<t.length;n++)i.set(n,t[n])}))},i.prototype.shift=function(){return mn(this,1)},i.prototype.concat=function(){for(var i=arguments,n=[],r=0;r<arguments.length;r++){var e=i[r],o=t("string"!=typeof e&&tt(e)?e:[e]);0!==o.size&&n.push(o)}return 0===n.length?this:0!==this.size||this.U||1!==n.length?this.withMutations((function(t){n.forEach((function(i){return i.forEach((function(i){return t.push(i)}))}))})):this.constructor(n[0])},i.prototype.setSize=function(t){return mn(this,0,t)},i.prototype.map=function(t,i){var n=this;return this.withMutations((function(r){for(var e=0;e<n.size;e++)r.set(e,t.call(i,r.get(e),e,n))}))},i.prototype.slice=function(t,i){var n=this.size;return C(t,i,n)?this:mn(this,_(t,n),T(i,n))},i.prototype.j=function(t,i){var n=i?this.size:0,r=vn(this,i);return new K((function(){var e=r();return e===ln?{value:void 0,done:!0}:q(t,i?--n:n++,e)}))},i.prototype.T=function(t,i){for(var n,r=i?this.size:0,e=vn(this,i);(n=e())!==ln&&!1!==t(n,i?--r:r++,this););return r},i.prototype.Y=function(t){return t===this.U?this:t?dn(this.$,this.it,this.nt,this.X,this.tt,t,this.H):0===this.size?yn():(this.U=t,this.W=!1,this)},i}(V);an.isList=un;var hn=an.prototype;hn[sn]=!0,hn[A]=hn.remove,hn.merge=hn.concat,hn.setIn=mi,hn.deleteIn=hn.removeIn=gi,hn.update=Si,hn.updateIn=wi,hn.mergeIn=Ii,hn.mergeDeepIn=ji,hn.withMutations=Bi,hn.wasAltered=Li,hn.asImmutable=Ei,hn["@@transducer/init"]=hn.asMutable=Di,hn["@@transducer/step"]=function(t,i){return t.push(i)},hn["@@transducer/result"]=function(t){return t.asImmutable()};var fn=function(t,i){this.array=t,this.ownerID=i};fn.prototype.removeBefore=function(t,i,n){if(n===i?1<<i:0===this.array.length)return this;var r=n>>>i&p;if(r>=this.array.length)return new fn([],t);var e,o=0===r;if(i>0){var s=this.array[r];if((e=s&&s.removeBefore(t,i-5,n))===s&&o)return this}if(o&&!e)return this;var u=bn(this,t);if(!o)for(var a=0;a<r;a++)u.array[a]=void 0;return e&&(u.array[r]=e),u},fn.prototype.removeAfter=function(t,i,n){if(n===(i?1<<i:0)||0===this.array.length)return this;var r,e=n-1>>>i&p;if(e>=this.array.length)return this;if(i>0){var o=this.array[e];if((r=o&&o.removeAfter(t,i-5,n))===o&&e===this.array.length-1)return this}var s=bn(this,t);return s.array.splice(e+1),r&&(s.array[e]=r),s};var cn,ln={};function vn(t,i){var n=t.$,r=t.it,e=gn(r),o=t.tt;return function t(s,u,a){return 0===u?function(t,s){var u=s===e?o&&o.array:t&&t.array,a=s>n?0:n-s,h=r-s;return h>b&&(h=b),function(){if(a===h)return ln;var t=i?--h:a++;return u&&u[t]}}(s,a):function(e,o,s){var u,a=e&&e.array,h=s>n?0:n-s>>o,f=1+(r-s>>o);return f>b&&(f=b),function(){for(;;){if(u){var n=u();if(n!==ln)return n;u=null}if(h===f)return ln;var r=i?--f:h++;u=t(a&&a[r],o-5,s+(r<<o))}}}(s,u,a)}(t.X,t.nt,0)}function dn(t,i,n,r,e,o,s){var u=Object.create(hn);return u.size=i-t,u.$=t,u.it=i,u.nt=n,u.X=r,u.tt=e,u.U=o,u.H=s,u.W=!1,u}function yn(){return cn||(cn=dn(0,0,5))}function An(t,i,n,r,e,o){var s,u=r>>>n&p,a=t&&u<t.array.length;if(!a&&void 0===e)return t;if(n>0){var h=t&&t.array[u],f=An(h,i,n-5,r,e,o);return f===h?t:((s=bn(t,i)).array[u]=f,s)}return a&&t.array[u]===e?t:(o&&g(o),s=bn(t,i),void 0===e&&u===s.array.length-1?s.array.pop():s.array[u]=e,s)}function bn(t,i){return i&&t&&i===t.ownerID?t:new fn(t?t.array.slice():[],i)}function pn(t,i){if(i>=gn(t.it))return t.tt;if(i<1<<t.nt+5){for(var n=t.X,r=t.nt;n&&r>0;)n=n.array[i>>>r&p],r-=5;return n}}function mn(t,i,n){void 0!==i&&(i|=0),void 0!==n&&(n|=0);var r=t.U||new x,e=t.$,o=t.it,s=e+i,u=void 0===n?o:n<0?o+n:e+n;if(s===e&&u===o)return t;if(s>=u)return t.clear();for(var a=t.nt,h=t.X,f=0;s+f<0;)h=new fn(h&&h.array.length?[void 0,h]:[],r),f+=1<<(a+=5);f&&(s+=f,e+=f,u+=f,o+=f);for(var c=gn(o),l=gn(u);l>=1<<a+5;)h=new fn(h&&h.array.length?[h]:[],r),a+=5;var v=t.tt,d=l<c?pn(t,u-1):l>c?new fn([],r):v;if(v&&l>c&&s<o&&v.array.length){for(var y=h=bn(h,r),A=a;A>5;A-=5){var b=c>>>A&p;y=y.array[b]=bn(y.array[b],r)}y.array[c>>>5&p]=v}if(u<o&&(d=d&&d.removeAfter(r,0,u)),s>=l)s-=l,u-=l,a=5,h=null,d=d&&d.removeBefore(r,0,s);else if(s>e||l<c){for(f=0;h;){var m=s>>>a&p;if(m!==l>>>a&p)break;m&&(f+=(1<<a)*m),a-=5,h=h.array[m]}h&&s>e&&(h=h.removeBefore(r,a,s-f)),h&&l<c&&(h=h.removeAfter(r,a,l-f)),f&&(s-=f,u-=f)}return t.U?(t.size=u-s,t.$=s,t.it=u,t.nt=a,t.X=h,t.tt=d,t.H=void 0,t.W=!0,t):dn(s,u,a,h,d)}function gn(t){return t<b?0:t-1>>>5<<5}var xn,Sn=function(t){function i(t){return null==t?Mn():gt(t)?t:Mn().withMutations((function(i){var n=z(t);fi(n.size),n.forEach((function(t,n){return i.set(n,t)}))}))}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return this(arguments)},i.prototype.toString=function(){return this.O("OrderedMap {","}")},i.prototype.get=function(t,i){var n=this.rt.get(t);return void 0!==n?this.et.get(n)[1]:i},i.prototype.clear=function(){return 0===this.size?this:this.U?(this.size=0,this.rt.clear(),this.et.clear(),this.W=!0,this):Mn()},i.prototype.set=function(t,i){return Cn(this,t,i)},i.prototype.remove=function(t){return Cn(this,t,m)},i.prototype.T=function(t,i){var n=this;return this.et.T((function(i){return i&&t(i[1],i[0],n)}),i)},i.prototype.j=function(t,i){return this.et.fromEntrySeq().j(t,i)},i.prototype.Y=function(t){if(t===this.U)return this;var i=this.rt.Y(t),n=this.et.Y(t);return t?wn(i,n,t,this.H):0===this.size?Mn():(this.U=t,this.W=!1,this.rt=i,this.et=n,this)},i}(Pi);function wn(t,i,n,r){var e=Object.create(Sn.prototype);return e.size=t?t.size:0,e.rt=t,e.et=i,e.U=n,e.H=r,e.W=!1,e}function Mn(){return xn||(xn=wn(Ji(),yn()))}function Cn(t,i,n){var r,e,o=t.rt,s=t.et,u=o.get(i),a=void 0!==u;if(n===m){if(!a)return t;s.size>=b&&s.size>=2*o.size?(r=(e=s.filter((function(t,i){return void 0!==t&&u!==i}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.U&&(r.U=e.U=t.U)):(r=o.remove(i),e=u===s.size-1?s.pop():s.set(u,void 0))}else if(a){if(n===s.get(u)[1])return t;r=o,e=s.set(u,[i,n])}else r=o.set(i,s.size),e=s.set(s.size,[i,n]);return t.U?(t.size=r.size,t.rt=r,t.et=e,t.H=void 0,t.W=!0,t):wn(r,e)}Sn.isOrderedMap=gt,Sn.prototype[X]=!0,Sn.prototype[A]=Sn.prototype.remove;var _n="@@__IMMUTABLE_STACK__@@";function Tn(t){return Boolean(t&&t[_n])}var kn=function(t){function i(t){return null==t?jn():Tn(t)?t:jn().pushAll(t)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return this(arguments)},i.prototype.toString=function(){return this.O("Stack [","]")},i.prototype.get=function(t,i){var n=this.ot;for(t=w(this,t);n&&t--;)n=n.next;return n?n.value:i},i.prototype.peek=function(){return this.ot&&this.ot.value},i.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var i=this.size+arguments.length,n=this.ot,r=arguments.length-1;r>=0;r--)n={value:t[r],next:n};return this.U?(this.size=i,this.ot=n,this.H=void 0,this.W=!0,this):In(i,n)},i.prototype.pushAll=function(i){if(0===(i=t(i)).size)return this;if(0===this.size&&Tn(i))return i;fi(i.size);var n=this.size,r=this.ot;return i.T((function(t){n++,r={value:t,next:r}}),!0),this.U?(this.size=n,this.ot=r,this.H=void 0,this.W=!0,this):In(n,r)},i.prototype.pop=function(){return this.slice(1)},i.prototype.clear=function(){return 0===this.size?this:this.U?(this.size=0,this.ot=void 0,this.H=void 0,this.W=!0,this):jn()},i.prototype.slice=function(i,n){if(C(i,n,this.size))return this;var r=_(i,this.size);if(T(n,this.size)!==this.size)return t.prototype.slice.call(this,i,n);for(var e=this.size-r,o=this.ot;r--;)o=o.next;return this.U?(this.size=e,this.ot=o,this.H=void 0,this.W=!0,this):In(e,o)},i.prototype.Y=function(t){return t===this.U?this:t?In(this.size,this.ot,t,this.H):0===this.size?jn():(this.U=t,this.W=!1,this)},i.prototype.T=function(t,i){var n=this;if(i)return new ft(this.toArray()).T((function(i,r){return t(i,r,n)}),i);for(var r=0,e=this.ot;e&&!1!==t(e.value,r++,this);)e=e.next;return r},i.prototype.j=function(t,i){if(i)return new ft(this.toArray()).j(t,i);var n=0,r=this.ot;return new K((function(){if(r){var i=r.value;return r=r.next,q(t,n++,i)}return{value:void 0,done:!0}}))},i}(V);kn.isStack=Tn;var On,Fn=kn.prototype;function In(t,i,n,r){var e=Object.create(Fn);return e.size=t,e.ot=i,e.U=n,e.H=r,e.W=!1,e}function jn(){return On||(On=In(0))}Fn[_n]=!0,Fn.shift=Fn.pop,Fn.unshift=Fn.push,Fn.unshiftAll=Fn.pushAll,Fn.withMutations=Bi,Fn.wasAltered=Li,Fn.asImmutable=Ei,Fn["@@transducer/init"]=Fn.asMutable=Di,Fn["@@transducer/step"]=function(t,i){return t.unshift(i)},Fn["@@transducer/result"]=function(t){return t.asImmutable()};var Bn="@@__IMMUTABLE_SET__@@";function Dn(t){return Boolean(t&&t[Bn])}function En(t){return Dn(t)&&H(t)}function Ln(t,i){if(t===i)return!0;if(!I(i)||void 0!==t.size&&void 0!==i.size&&t.size!==i.size||void 0!==t.H&&void 0!==i.H&&t.H!==i.H||B(t)!==B(i)||E(t)!==E(i)||H(t)!==H(i))return!1;if(0===t.size&&0===i.size)return!0;var n=!L(t);if(H(t)){var r=t.entries();return i.every((function(t,i){var e=r.next().value;return e&&St(e[1],t)&&(n||St(e[0],i))}))&&r.next().done}var e=!1;if(void 0===t.size)if(void 0===i.size)"function"==typeof t.cacheResult&&t.cacheResult();else{e=!0;var o=t;t=i,i=o}var s=!0,u=i.T((function(i,r){if(n?!t.has(i):e?!St(i,t.get(r,m)):!St(t.get(r,m),i))return s=!1,!1}));return s&&t.size===u}function Pn(t,i){var n=function(n){t.prototype[n]=i[n]};return Object.keys(i).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(i).forEach(n),t}function zn(t){if(!t||"object"!=typeof t)return t;if(!I(t)){if(!vi(t))return t;t=st(t)}if(B(t)){var i={};return t.T((function(t,n){i[n]=zn(t)})),i}var n=[];return t.T((function(t){n.push(zn(t))})),n}var Vn=function(t){function i(i){return null==i?Yn():Dn(i)&&!H(i)?i:Yn().withMutations((function(n){var r=t(i);fi(r.size),r.forEach((function(t){return n.add(t)}))}))}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.of=function(){return this(arguments)},i.fromKeys=function(t){return this(z(t).keySeq())},i.intersect=function(t){return(t=P(t).toArray()).length?Nn.intersect.apply(i(t.pop()),t):Yn()},i.union=function(t){return(t=P(t).toArray()).length?Nn.union.apply(i(t.pop()),t):Yn()},i.prototype.toString=function(){return this.O("Set {","}")},i.prototype.has=function(t){return this.rt.has(t)},i.prototype.add=function(t){return Gn(this,this.rt.set(t,t))},i.prototype.remove=function(t){return Gn(this,this.rt.remove(t))},i.prototype.clear=function(){return Gn(this,this.rt.clear())},i.prototype.map=function(t,i){var n=this,r=!1,e=Gn(this,this.rt.mapEntries((function(e){var o=e[1],s=t.call(i,o,o,n);return s!==o&&(r=!0),[s,s]}),i));return r?e:this},i.prototype.union=function(){for(var i=[],n=arguments.length;n--;)i[n]=arguments[n];return 0===(i=i.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.U||1!==i.length?this.withMutations((function(n){for(var r=0;r<i.length;r++)t(i[r]).forEach((function(t){return n.add(t)}))})):this.constructor(i[0])},i.prototype.intersect=function(){for(var i=[],n=arguments.length;n--;)i[n]=arguments[n];if(0===i.length)return this;i=i.map((function(i){return t(i)}));var r=[];return this.forEach((function(t){i.every((function(i){return i.includes(t)}))||r.push(t)})),this.withMutations((function(t){r.forEach((function(i){t.remove(i)}))}))},i.prototype.subtract=function(){for(var i=[],n=arguments.length;n--;)i[n]=arguments[n];if(0===i.length)return this;i=i.map((function(i){return t(i)}));var r=[];return this.forEach((function(t){i.some((function(i){return i.includes(t)}))&&r.push(t)})),this.withMutations((function(t){r.forEach((function(i){t.remove(i)}))}))},i.prototype.sort=function(t){return ar(qt(this,t))},i.prototype.sortBy=function(t,i){return ar(qt(this,i,t))},i.prototype.wasAltered=function(){return this.rt.wasAltered()},i.prototype.T=function(t,i){var n=this;return this.rt.T((function(i){return t(i,i,n)}),i)},i.prototype.j=function(t,i){return this.rt.j(t,i)},i.prototype.Y=function(t){if(t===this.U)return this;var i=this.rt.Y(t);return t?this.st(i,t):0===this.size?this.ut():(this.U=t,this.rt=i,this)},i}(R);Vn.isSet=Dn;var Rn,Nn=Vn.prototype;function Gn(t,i){return t.U?(t.size=i.size,t.rt=i,t):i===t.rt?t:0===i.size?t.ut():t.st(i)}function Un(t,i){var n=Object.create(Nn);return n.size=t?t.size:0,n.rt=t,n.U=i,n}function Yn(){return Rn||(Rn=Un(Ji()))}Nn[Bn]=!0,Nn[A]=Nn.remove,Nn.merge=Nn.concat=Nn.union,Nn.withMutations=Bi,Nn.asImmutable=Ei,Nn["@@transducer/init"]=Nn.asMutable=Di,Nn["@@transducer/step"]=function(t,i){return t.add(i)},Nn["@@transducer/result"]=function(t){return t.asImmutable()},Nn.ut=Yn,Nn.st=Un;var Wn,Xn=function(t){function i(t,n,r){if(!(this instanceof i))return new i(t,n,r);if(hi(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===n&&(n=1/0),r=void 0===r?1:Math.abs(r),n<t&&(r=-r),this.ht=t,this.ft=n,this.ct=r,this.size=Math.max(0,Math.ceil((n-t)/r-1)+1),0===this.size){if(Wn)return Wn;Wn=this}}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this.ht+"..."+this.ft+(1!==this.ct?" by "+this.ct:"")+" ]"},i.prototype.get=function(t,i){return this.has(t)?this.ht+w(this,t)*this.ct:i},i.prototype.includes=function(t){var i=(t-this.ht)/this.ct;return i>=0&&i<this.size&&i===Math.floor(i)},i.prototype.slice=function(t,n){return C(t,n,this.size)?this:(t=_(t,this.size),(n=T(n,this.size))<=t?new i(0,0):new i(this.get(t,this.ft),this.get(n,this.ft),this.ct))},i.prototype.indexOf=function(t){var i=t-this.ht;if(i%this.ct==0){var n=i/this.ct;if(n>=0&&n<this.size)return n}return-1},i.prototype.lastIndexOf=function(t){return this.indexOf(t)},i.prototype.T=function(t,i){for(var n=this.size,r=this.ct,e=i?this.ht+(n-1)*r:this.ht,o=0;o!==n&&!1!==t(e,i?n-++o:o++,this);)e+=i?-r:r;return o},i.prototype.j=function(t,i){var n=this.size,r=this.ct,e=i?this.ht+(n-1)*r:this.ht,o=0;return new K((function(){if(o===n)return{value:void 0,done:!0};var s=e;return e+=i?-r:r,q(t,i?n-++o:o++,s)}))},i.prototype.equals=function(t){return t instanceof i?this.ht===t.ht&&this.ft===t.ft&&this.ct===t.ct:Ln(this,t)},i}(at);function Hn(t,i,n){for(var r=ci(i),e=0;e!==r.length;)if((t=yi(t,r[e++],m))===m)return n;return t}function Zn(t,i){return Hn(this,t,i)}function Jn(){fi(this.size);var t={};return this.T((function(i,n){t[n]=i})),t}P.isIterable=I,P.isKeyed=B,P.isIndexed=E,P.isAssociative=L,P.isOrdered=H,P.Iterator=K,Pn(P,{toArray:function(){fi(this.size);var t=new Array(this.size||0),i=B(this),n=0;return this.T((function(r,e){t[n++]=i?[e,r]:r})),t},toIndexedSeq:function(){return new Gt(this)},toJS:function(){return zn(this)},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return Pi(this.toKeyedSeq())},toObject:Jn,toOrderedMap:function(){return Sn(this.toKeyedSeq())},toOrderedSet:function(){return ar(B(this)?this.valueSeq():this)},toSet:function(){return Vn(B(this)?this.valueSeq():this)},toSetSeq:function(){return new Ut(this)},toSeq:function(){return E(this)?this.toIndexedSeq():B(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return kn(B(this)?this.valueSeq():this)},toList:function(){return an(B(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},O:function(t,i){return 0===this.size?t+i:t+" "+this.toSeq().map(this.vt).join(", ")+" "+i},concat:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return ni(this,function(t,i){var n=B(t),r=[t].concat(i).map((function(t){return I(t)?n&&(t=z(t)):t=n?yt(t):At(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===r.length)return t;if(1===r.length){var e=r[0];if(e===t||n&&B(e)||E(t)&&E(e))return e}var o=new ft(r);return n?o=o.toKeyedSeq():E(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=r.reduce((function(t,i){if(void 0!==t){var n=i.size;if(void 0!==n)return t+n}}),0),o}(this,t))},includes:function(t){return this.some((function(i){return St(i,t)}))},entries:function(){return this.j(2)},every:function(t,i){fi(this.size);var n=!0;return this.T((function(r,e,o){if(!t.call(i,r,e,o))return n=!1,!1})),n},filter:function(t,i){return ni(this,Zt(this,t,i,!0))},find:function(t,i,n){var r=this.findEntry(t,i);return r?r[1]:n},forEach:function(t,i){return fi(this.size),this.T(i?t.bind(i):t)},join:function(t){fi(this.size),t=void 0!==t?""+t:",";var i="",n=!0;return this.T((function(r){n?n=!1:i+=t,i+=null!=r?r.toString():""})),i},keys:function(){return this.j(0)},map:function(t,i){return ni(this,Xt(this,t,i))},reduce:function(t,i,n){return tr(this,t,i,n,arguments.length<2,!1)},reduceRight:function(t,i,n){return tr(this,t,i,n,arguments.length<2,!0)},reverse:function(){return ni(this,Ht(this,!0))},slice:function(t,i){return ni(this,Jt(this,t,i,!0))},some:function(t,i){return!this.every(rr(t),i)},sort:function(t){return ni(this,qt(this,t))},values:function(){return this.j(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,i){return S(t?this.toSeq().filter(t,i):this)},countBy:function(t,i){return function(t,i,n){var r=Pi().asMutable();return t.T((function(e,o){r.update(i.call(n,e,o,t),0,(function(t){return t+1}))})),r.asImmutable()}(this,t,i)},equals:function(t){return Ln(this,t)},entrySeq:function(){var t=this;if(t.F)return new ft(t.F);var i=t.toSeq().map(nr).toIndexedSeq();return i.fromEntrySeq=function(){return t.toSeq()},i},filterNot:function(t,i){return this.filter(rr(t),i)},findEntry:function(t,i,n){var r=n;return this.T((function(n,e,o){if(t.call(i,n,e,o))return r=[e,n],!1})),r},findKey:function(t,i){var n=this.findEntry(t,i);return n&&n[0]},findLast:function(t,i,n){return this.toKeyedSeq().reverse().find(t,i,n)},findLastEntry:function(t,i,n){return this.toKeyedSeq().reverse().findEntry(t,i,n)},findLastKey:function(t,i)