2 lines
567 KiB
JavaScript
2 lines
567 KiB
JavaScript
/*! For license information please see bundle.js.LICENSE.txt */
|
|
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.squiggle_lang=t():r.squiggle_lang=t()}(self,(()=>(()=>{var r={76738:(r,t,e)=>{"use strict";var n=e(10456),o=e(2434),i=e(9438),a=e(22525),u=e(20114),s=i.make_float;function f(r,t,e){for(var n=i.make(r,[]),o=0;o<r;++o)n[o]=i.make(t,e);return n}function c(r){var t=r.length;return 0===t?[]:i.sub(r,0,t)}function l(r,t,e,n,o){if(o<0||t<0||t>(r.length-o|0)||n<0||n>(e.length-o|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.blit",Error:new Error};i.blit(r,t,e,n,o)}var m=a.create("Array.Bottom");function p(r,t){var e=function(e,o,a,u,s,f,c){for(var m=e+o|0,p=u+s|0,v=e,d=i.get(t,e),_=u,g=i.get(a,u),h=c;;){var y=h,b=g,A=_,S=d,T=v;if(n._2(r,S,b)<=0){i.set(f,y,S);var E=T+1|0;if(E>=m)return l(a,A,f,y+1|0,p-A|0);h=y+1|0,d=i.get(t,E),v=E}else{i.set(f,y,b);var x=A+1|0;if(x>=p)return l(t,T,f,y+1|0,m-T|0);h=y+1|0,g=i.get(a,x),_=x}}},o=function(e,o,a,u){for(var s=0;s<u;++s){for(var f=i.get(t,e+s|0),c=(a+s|0)-1|0;c>=a&&n._2(r,i.get(o,c),f)>0;)i.set(o,c+1|0,i.get(o,c)),c=c-1|0;i.set(o,c+1|0,f)}},a=function(r,n,i,u){if(u<=5)return o(r,n,i,u);var s=u/2|0,f=u-s|0;a(r+s|0,n,i+s|0,f),a(r,t,r+f|0,s),e(r+f|0,s,n,i+s|0,f,n,i)},u=t.length;if(u<=5)return o(0,t,0,u);var s=u/2|0,f=u-s|0,c=i.make(f,i.get(t,0));a(s,c,0,f),a(0,t,f,s),e(f,s,c,0,f,t,0)}var v=f,d=i.concat,_=p;t.make_float=s,t.init=function(r,t){if(0===r)return[];if(r<0)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.init",Error:new Error};for(var e=i.make(r,n._1(t,0)),o=1;o<r;++o)e[o]=n._1(t,o);return e},t.make_matrix=f,t.create_matrix=v,t.append=function(r,t){var e=r.length;return 0===e?c(t):0===t.length?i.sub(r,0,e):r.concat(t)},t.concat=d,t.sub=function(r,t,e){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.sub",Error:new Error};return i.sub(r,t,e)},t.copy=c,t.fill=function(r,t,e,n){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Array.fill",Error:new Error};for(var o=t,i=t+e|0;o<i;++o)r[o]=n},t.blit=l,t.to_list=function(r){for(var t=r.length-1|0,e=0;;){var n=e,o=t;if(o<0)return n;e={hd:r[o],tl:n},t=o-1|0}},t.of_list=function(r){if(!r)return[];for(var t=i.make(function(r,t){for(;;){var e=r;if(!t)return e;t=t.tl,r=e+1|0}}(0,r),r.hd),e=1,n=r.tl;;){var o=n,a=e;if(!o)return t;t[a]=o.hd,n=o.tl,e=a+1|0}},t.iter=function(r,t){for(var e=0,o=t.length;e<o;++e)n._1(r,t[e])},t.iteri=function(r,t){for(var e=0,o=t.length;e<o;++e)n._2(r,e,t[e])},t.map=function(r,t){var e=t.length;if(0===e)return[];for(var o=i.make(e,n._1(r,t[0])),a=1;a<e;++a)o[a]=n._1(r,t[a]);return o},t.mapi=function(r,t){var e=t.length;if(0===e)return[];for(var o=i.make(e,n._2(r,0,t[0])),a=1;a<e;++a)o[a]=n._2(r,a,t[a]);return o},t.fold_left=function(r,t,e){for(var o=t,i=0,a=e.length;i<a;++i)o=n._2(r,o,e[i]);return o},t.fold_right=function(r,t,e){for(var o=e,i=t.length-1|0;i>=0;--i)o=n._2(r,t[i],o);return o},t.iter2=function(r,t,e){if(t.length!==e.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.iter2: arrays must have the same length",Error:new Error};for(var o=0,i=t.length;o<i;++o)n._2(r,t[o],e[o])},t.map2=function(r,t,e){var o=t.length;if(o!==e.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Array.map2: arrays must have the same length",Error:new Error};if(0===o)return[];for(var a=i.make(o,n._2(r,t[0],e[0])),u=1;u<o;++u)a[u]=n._2(r,t[u],e[u]);return a},t.for_all=function(r,t){for(var e=t.length,o=0;;){var i=o;if(i===e)return!0;if(!n._1(r,t[i]))return!1;o=i+1|0}},t.exists=function(r,t){for(var e=t.length,o=0;;){var i=o;if(i===e)return!1;if(n._1(r,t[i]))return!0;o=i+1|0}},t.mem=function(r,t){for(var e=t.length,n=0;;){var i=n;if(i===e)return!1;if(o.equal(t[i],r))return!0;n=i+1|0}},t.memq=function(r,t){for(var e=t.length,n=0;;){var o=n;if(o===e)return!1;if(r===t[o])return!0;n=o+1|0}},t.sort=function(r,t){for(var e=function(e,o){var a=1+((o+o|0)+o|0)|0,u=a;if((a+2|0)<e)return n._2(r,i.get(t,a),i.get(t,a+1|0))<0&&(u=a+1|0),n._2(r,i.get(t,u),i.get(t,a+2|0))<0&&(u=a+2|0),u;if((a+1|0)<e&&n._2(r,i.get(t,a),i.get(t,a+1|0))<0)return a+1|0;if(a<e)return a;throw{RE_EXN_ID:m,_1:o,Error:new Error}},o=function(o,a,s){try{for(var f=a;;){var c=f,l=e(o,c);if(n._2(r,i.get(t,l),s)<=0)return i.set(t,c,s);i.set(t,c,i.get(t,l)),f=l}}catch(r){var p=u.internalToOCamlException(r);if(p.RE_EXN_ID===m)return i.set(t,p._1,s);throw p}},a=function(r,n){try{for(var o=n;;){var a=o,s=e(r,a);i.set(t,a,i.get(t,s)),o=s}}catch(r){var f=u.internalToOCamlException(r);if(f.RE_EXN_ID===m)return f._1;throw f}},s=function(e,o){for(;;){var a=e,u=(a-1|0)/3|0;if(a===u)throw{RE_EXN_ID:"Assert_failure",_1:["array.ml",236,4],Error:new Error};if(n._2(r,i.get(t,u),o)>=0)return i.set(t,a,o);if(i.set(t,a,i.get(t,u)),u<=0)return i.set(t,0,o);e=u}},f=t.length,c=((f+1|0)/3|0)-1|0;c>=0;--c)o(f,c,i.get(t,c));for(var l=f-1|0;l>=2;--l){var p=i.get(t,l);i.set(t,l,i.get(t,0)),s(a(l,0),p)}if(!(f<=1)){var v=i.get(t,1);i.set(t,1,i.get(t,0)),i.set(t,0,v)}},t.stable_sort=p,t.fast_sort=_,t.Floatarray={}},43924:(r,t,e)=>{"use strict";var n=e(51958),o=e(10456),i=e(65436),a=e(5890);function u(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function s(r){for(var t=r.length,e=0;e<t;++e)u(r,e,i.random_int(e,t))}function f(r,t){if(r<=0)return[];for(var e=new Array(r),n=0;n<r;++n)e[n]=t(n);return e}function c(r,t){var e=f(r,t);return s(e),e}function l(r,t,e){for(var n=r.length,o=t.length,i=n<o?n:o,a=new Array(i),u=0;u<i;++u)a[u]=e(r[u],t[u]);return a}function m(r){for(var t=r.length,e=0,n=0;n<t;++n)e=e+r[n].length|0;var o=new Array(e);e=0;for(var i=0;i<t;++i)for(var a=r[i],u=0,s=a.length;u<s;++u)o[e]=a[u],e=e+1|0;return o}function p(r,t){for(var e=0,n=r.length;e<n;++e)t(r[e])}function v(r,t){for(var e=r.length,n=new Array(e),o=0;o<e;++o)n[o]=t(r[o]);return n}function d(r,t){for(var e,n=r.length,o=0;void 0===e&&o<n;){var i=r[o];t(i)&&(e=a.some(i)),o=o+1|0}return e}function _(r,t){for(var e,n=r.length,o=0;void 0===e&&o<n;)t(r[o])&&(e=o),o=o+1|0;return e}function g(r,t){for(var e=r.length,n=new Array(e),o=0,i=0;i<e;++i){var a=r[i];t(a)&&(n[o]=a,o=o+1|0)}return n.length=o,n}function h(r,t){for(var e=r.length,n=new Array(e),o=0,i=0;i<e;++i){var a=r[i];t(a,i)&&(n[o]=a,o=o+1|0)}return n.length=o,n}function y(r,t){for(var e=r.length,n=new Array(e),o=0,i=0;i<e;++i){var u=t(r[i]);void 0!==u&&(n[o]=a.valFromOption(u),o=o+1|0)}return n.length=o,n}function b(r,t){for(var e=0,n=r.length;e<n;++e)t(e,r[e])}function A(r,t){for(var e=r.length,n=new Array(e),o=0;o<e;++o)n[o]=t(o,r[o]);return n}function S(r,t,e){for(var n=t,o=0,i=r.length;o<i;++o)n=e(n,r[o]);return n}function T(r,t,e){for(var n=t,o=r.length-1|0;o>=0;--o)n=e(n,r[o]);return n}function E(r,t,e,o){for(var i=e,a=n.int_min(r.length,t.length)-1|0;a>=0;--a)i=o(i,r[a],t[a]);return i}function x(r,t,e){for(var n=t,o=0,i=r.length;o<i;++o)n=e(n,r[o],o);return n}function G(r,t){for(var e=r.length,n=0;;){var o=n;if(o===e)return!0;if(!t(r[o]))return!1;n=o+1|0}}function w(r,t){for(var e=r.length,n=0;;){var o=n;if(o===e)return!1;if(t(r[o]))return!0;n=o+1|0}}function D(r,t,e,n,o){for(;;){var i=e;if(i===o)return!0;if(!n(r[i],t[i]))return!1;e=i+1|0}}function k(r,t,e){return D(r,t,0,e,n.int_min(r.length,t.length))}function O(r,t,e){for(var o=0,i=n.int_min(r.length,t.length);;){var a=o;if(a===i)return!1;if(e(r[a],t[a]))return!0;o=a+1|0}}function M(r,t,e){var n=r.length;return n===t.length&&D(r,t,0,e,n)}function F(r,t,e){var n=r.length,o=t.length;if(n>o)return 1;if(n<o)return-1;for(var i=0;;){var a=i;if(a===n)return 0;var u=e(r[a],t[a]);if(0!==u)return u;i=a+1|0}}function I(r,t){for(var e=r.length,n=0,o=0,i=new Array(e),a=new Array(e),u=0;u<e;++u){var s=r[u];t(s)?(i[n]=s,n=n+1|0):(a[o]=s,o=o+1|0)}return i.length=n,a.length=o,[i,a]}function P(r,t,e){var n=r.length;if(0===n)return"";for(var o=n-1|0,i=0,a="";;){var u=a,s=i;if(s===o)return u+e(r[s]);a=u+(e(r[s])+t),i=s+1|0}}function N(r,t){for(var e=new Array(r),n=0;n<r;++n)e[n]=t(n);return e}t.get=function(r,t){if(t>=0&&t<r.length)return a.some(r[t])},t.getExn=function(r,t){if(!(t>=0&&t<r.length))throw{RE_EXN_ID:"Assert_failure",_1:["belt_Array.ml",35,2],Error:new Error};return r[t]},t.set=function(r,t,e){return t>=0&&t<r.length&&(r[t]=e,!0)},t.setExn=function(r,t,e){if(!(t>=0&&t<r.length))throw{RE_EXN_ID:"Assert_failure",_1:["belt_Array.ml",45,2],Error:new Error};r[t]=e},t.shuffleInPlace=s,t.shuffle=function(r){var t=r.slice(0);return s(t),t},t.reverseInPlace=function(r){for(var t=r.length,e=0,n=t/2|0;e<n;++e)u(r,0+e|0,((0+t|0)-e|0)-1|0)},t.reverse=function(r){for(var t=r.length,e=new Array(t),n=0;n<t;++n)e[n]=r[(t-1|0)-n|0];return e},t.make=function(r,t){if(r<=0)return[];for(var e=new Array(r),n=0;n<r;++n)e[n]=t;return e},t.range=function(r,t){var e=t-r|0;if(e<0)return[];for(var n=new Array(e+1|0),o=0;o<=e;++o)n[o]=r+o|0;return n},t.rangeBy=function(r,t,e){var n=t-r|0;if(n<0||e<=0)return[];for(var o=1+(n/e|0)|0,i=new Array(o),a=r,u=0;u<o;++u)i[u]=a,a=a+e|0;return i},t.makeByU=f,t.makeBy=function(r,t){return f(r,o.__1(t))},t.makeByAndShuffleU=c,t.makeByAndShuffle=function(r,t){return c(r,o.__1(t))},t.zip=function(r,t){for(var e=r.length,n=t.length,o=e<n?e:n,i=new Array(o),a=0;a<o;++a)i[a]=[r[a],t[a]];return i},t.zipByU=l,t.zipBy=function(r,t,e){return l(r,t,o.__2(e))},t.unzip=function(r){for(var t=r.length,e=new Array(t),n=new Array(t),o=0;o<t;++o){var i=r[o];e[o]=i[0],n[o]=i[1]}return[e,n]},t.concat=function(r,t){for(var e=r.length,n=t.length,o=new Array(e+n|0),i=0;i<e;++i)o[i]=r[i];for(var a=0;a<n;++a)o[e+a|0]=t[a];return o},t.concatMany=m,t.slice=function(r,t,e){if(e<=0)return[];var o=r.length,i=t<0?n.int_max(o+t|0,0):t,a=o-i|0,u=a<e?a:e;if(u<=0)return[];for(var s=new Array(u),f=0;f<u;++f)s[f]=r[i+f|0];return s},t.sliceToEnd=function(r,t){for(var e=r.length,o=t<0?n.int_max(e+t|0,0):t,i=e>o?e-o|0:0,a=new Array(i),u=0;u<i;++u)a[u]=r[o+u|0];return a},t.fill=function(r,t,e,o){if(!(e<=0)){var i=r.length,a=t<0?n.int_max(i+t|0,0):t,u=i-a|0,s=u<e?u:e;if(!(s<=0))for(var f=a,c=a+s|0;f<c;++f)r[f]=o}},t.blit=function(r,t,e,o,i){var a=r.length,u=e.length,s=t<0?n.int_max(a+t|0,0):t,f=o<0?n.int_max(u+o|0,0):o,c=n.int_min(i,n.int_min(a-s|0,u-f|0));if(f<=s)for(var l=0;l<c;++l)e[l+f|0]=r[l+s|0];else for(var m=c-1|0;m>=0;--m)e[m+f|0]=r[m+s|0]},t.blitUnsafe=function(r,t,e,n,o){if(n<=t)for(var i=0;i<o;++i)e[i+n|0]=r[i+t|0];else for(var a=o-1|0;a>=0;--a)e[a+n|0]=r[a+t|0]},t.forEachU=p,t.forEach=function(r,t){p(r,o.__1(t))},t.mapU=v,t.map=function(r,t){return v(r,o.__1(t))},t.flatMapU=function(r,t){return m(v(r,t))},t.flatMap=function(r,t){return m(v(r,o.__1(t)))},t.getByU=d,t.getBy=function(r,t){return d(r,o.__1(t))},t.getIndexByU=_,t.getIndexBy=function(r,t){return _(r,o.__1(t))},t.keepU=g,t.keep=function(r,t){return g(r,o.__1(t))},t.keepWithIndexU=h,t.keepWithIndex=function(r,t){return h(r,o.__2(t))},t.keepMapU=y,t.keepMap=function(r,t){return y(r,o.__1(t))},t.forEachWithIndexU=b,t.forEachWithIndex=function(r,t){b(r,o.__2(t))},t.mapWithIndexU=A,t.mapWithIndex=function(r,t){return A(r,o.__2(t))},t.partitionU=I,t.partition=function(r,t){return I(r,o.__1(t))},t.reduceU=S,t.reduce=function(r,t,e){return S(r,t,o.__2(e))},t.reduceReverseU=T,t.reduceReverse=function(r,t,e){return T(r,t,o.__2(e))},t.reduceReverse2U=E,t.reduceReverse2=function(r,t,e,n){return E(r,t,e,o.__3(n))},t.reduceWithIndexU=x,t.reduceWithIndex=function(r,t,e){return x(r,t,o.__3(e))},t.joinWithU=P,t.joinWith=function(r,t,e){return P(r,t,o.__1(e))},t.someU=w,t.some=function(r,t){return w(r,o.__1(t))},t.everyU=G,t.every=function(r,t){return G(r,o.__1(t))},t.every2U=k,t.every2=function(r,t,e){return k(r,t,o.__2(e))},t.some2U=O,t.some2=function(r,t,e){return O(r,t,o.__2(e))},t.cmpU=F,t.cmp=function(r,t,e){return F(r,t,o.__2(e))},t.eqU=M,t.eq=function(r,t,e){return M(r,t,o.__2(e))},t.initU=N,t.init=function(r,t){return N(r,o.__1(t))}},71167:(r,t,e)=>{"use strict";var n=e(10456);t.MakeComparableU=function(r){return r},t.MakeComparable=function(r){var t=r.cmp;return{cmp:n.__2(t)}},t.comparableU=function(r){return{cmp:r}},t.comparable=function(r){return{cmp:n.__2(r)}},t.MakeHashableU=function(r){return r},t.MakeHashable=function(r){var t=r.hash,e=n.__1(t),o=r.eq;return{hash:e,eq:n.__2(o)}},t.hashableU=function(r,t){return{hash:r,eq:t}},t.hashable=function(r,t){return{hash:n.__1(r),eq:n.__2(t)}}},30776:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924),i=e(5890),a=e(54178);function u(r,t){for(;;){var e=t,n=r;if(!n)return e;var o={hd:n.hd,tl:0};e.tl=o,t=o,r=n.tl}}function s(r,t,e){for(;;){var n=e,o=t;if(!o)return;var i=o.tl,a=o.hd;if(r(a)){var u={hd:a,tl:0};n.tl=u,e=u,t=i}else t=i}}function f(r,t,e,n){for(;;){var o=n,i=e,a=t;if(!a)return;var u=a.tl,s=a.hd;if(r(s,o)){var f={hd:s,tl:0};i.tl=f,n=o+1|0,e=f,t=u}else n=o+1|0,t=u}}function c(r,t,e){for(;;){var n=e,o=t;if(!o)return;var a=o.tl,u=r(o.hd);if(void 0===u)t=a;else{var s={hd:i.valFromOption(u),tl:0};n.tl=s,e=s,t=a}}}function l(r,t){if(!r)return t;var e={hd:r.hd,tl:0};return u(r.tl,e).tl=t,e}function m(r,t){if(!r)return 0;var e={hd:t(r.hd),tl:0};return function(r,t,e){for(;;){var n=t,o=r;if(!o)return;var i={hd:e(o.hd),tl:0};n.tl=i,t=i,r=o.tl}}(r.tl,e,t),e}function p(r,t,e){if(!r)return 0;if(!t)return 0;var n={hd:e(r.hd,t.hd),tl:0};return function(r,t,e,n){for(;;){var o=n,i=e,a=t;if(!a)return;if(!i)return;var u={hd:r(a.hd,i.hd),tl:0};o.tl=u,n=u,e=i.tl,t=a.tl}}(e,r.tl,t.tl,n),n}function v(r,t){if(!r)return 0;var e={hd:t(0,r.hd),tl:0};return function(r,t,e,n){for(;;){var o=n,i=e,a=t;if(!i)return;var u={hd:r(a,i.hd),tl:0};o.tl=u,n=u,e=i.tl,t=a+1|0}}(t,1,r.tl,e),e}function d(r,t){if(r<=0)return 0;for(var e={hd:t(0),tl:0},n=e,o=1;o<r;){var i={hd:t(o),tl:0};n.tl=i,n=i,o=o+1|0}return e}function _(r){for(var t=r,e=0;;){if(!t)return e;e=e+1|0,t=t.tl}}function g(r){for(var t=r.length-1|0,e=0;;){var n=e,o=t;if(o<0)return n;e={hd:r[o],tl:n},t=o-1|0}}function h(r){var t=_(r),e=new Array(t);return function(r,t,e){for(;;){var n=e,o=t;if(!n)return;r[o]=n.hd,e=n.tl,t=o+1|0}}(e,0,r),e}function y(r,t){for(;;){var e=t,n=r;if(!n)return e;t={hd:n.hd,tl:e},r=n.tl}}function b(r,t){for(;;){var e=t,n=r;if(!e)return void(n.tl=0);t=e.tl,r=u(e.hd,n)}}function A(r,t){for(var e=0,n=r;;){var o=n,i=e;if(!o)return i;n=o.tl,e={hd:t(o.hd),tl:i}}}function S(r,t){for(;;){var e=r;if(!e)return;t(e.hd),r=e.tl}}function T(r,t){for(var e=r,n=0;;){var o=n,i=e;if(!i)return;t(o,i.hd),n=o+1|0,e=i.tl}}function E(r,t,e){for(;;){var n=r;if(!n)return t;t=e(t,n.hd),r=n.tl}}function x(r,t,e){return r?e(x(r.tl,t,e),r.hd):t}function G(r,t,e){return _(r)<1e3?x(r,t,e):o.reduceReverseU(h(r),t,e)}function w(r,t,e){for(var n=r,o=t,i=0;;){var a=i,u=n;if(!u)return o;i=a+1|0,o=e(o,u.hd,a),n=u.tl}}function D(r,t,e){for(var n=r,o=t,i=0;;){var a=i,u=o,s=n;if(!s)return a;if(!u)return a;i={hd:e(s.hd,u.hd),tl:a},o=u.tl,n=s.tl}}function k(r,t,e){for(;;){var n=t,o=r;if(!o)return;if(!n)return;e(o.hd,n.hd),t=n.tl,r=o.tl}}function O(r,t,e,n){for(;;){var o=t,i=r;if(!i)return e;if(!o)return e;e=n(e,i.hd,o.hd),t=o.tl,r=i.tl}}function M(r,t,e,n){return r&&t?n(M(r.tl,t.tl,e,n),r.hd,t.hd):e}function F(r,t,e,n){return _(r)<1e3?M(r,t,e,n):o.reduceReverse2U(h(r),h(t),e,n)}function I(r,t){for(;;){var e=r;if(!e)return!0;if(!t(e.hd))return!1;r=e.tl}}function P(r,t){for(;;){var e=r;if(!e)return!1;if(t(e.hd))return!0;r=e.tl}}function N(r,t,e){for(;;){var n=t,o=r;if(!o)return!0;if(!n)return!0;if(!e(o.hd,n.hd))return!1;t=n.tl,r=o.tl}}function R(r,t,e){for(;;){var n=t,o=r;if(!o)return n?-1:0;if(!n)return 1;var i=e(o.hd,n.hd);if(0!==i)return i;t=n.tl,r=o.tl}}function C(r,t,e){for(;;){var n=t,o=r;if(!o)return!n;if(!n)return!1;if(!e(o.hd,n.hd))return!1;t=n.tl,r=o.tl}}function L(r,t,e){for(;;){var n=t,o=r;if(!o)return!1;if(!n)return!1;if(e(o.hd,n.hd))return!0;t=n.tl,r=o.tl}}function V(r,t,e){for(;;){var n=r;if(!n)return!1;if(e(n.hd,t))return!0;r=n.tl}}function j(r,t,e){for(;;){var n=r;if(!n)return;var o=n.hd;if(e(o[0],t))return i.some(o[1]);r=n.tl}}function $(r,t,e){for(;;){var n=r;if(!n)return!1;if(e(n.hd[0],t))return!0;r=n.tl}}function U(r,t,e){if(!r)return 0;var n=r.tl,o=r.hd;if(e(o[0],t))return n;var i={hd:o,tl:0},a=function(r,t,e,n){for(;;){var o=e,i=r;if(!i)return!1;var a=i.tl,u=i.hd;if(n(u[0],t))return o.tl=a,!0;var s={hd:u,tl:0};o.tl=s,e=s,r=a}}(n,t,i,e);return a?i:r}function q(r,t,e,n){if(!r)return{hd:[t,e],tl:0};var o=r.tl,i=r.hd;if(n(i[0],t))return{hd:[t,e],tl:o};var a={hd:i,tl:0},u=function(r,t,e,n,o){for(;;){var i=n,a=r;if(!a)return!1;var u=a.tl,s=a.hd;if(o(s[0],t))return i.tl={hd:[t,e],tl:u},!0;var f={hd:s,tl:0};i.tl=f,n=f,r=u}}(o,t,e,a,n);return u?a:{hd:[t,e],tl:r}}function B(r,t){var e=h(r);return a.stableSortInPlaceByU(e,t),g(e)}function X(r,t){for(;;){var e=r;if(!e)return;var n=e.hd;if(t(n))return i.some(n);r=e.tl}}function W(r,t){for(;;){var e=r;if(!e)return 0;var n=e.tl,o=e.hd;if(t(o)){var i={hd:o,tl:0};return s(t,n,i),i}r=n}}function z(r,t){return W(r,n.__1(t))}function Y(r,t){for(var e=r,n=0;;){var o=n,i=e;if(!i)return 0;var a=i.tl,u=i.hd;if(t(u,o)){var s={hd:u,tl:0};return f(t,a,s,o+1|0),s}n=o+1|0,e=a}}function K(r,t){return Y(r,n.__2(t))}function H(r,t){for(;;){var e=r;if(!e)return 0;var n=e.tl,o=t(e.hd);if(void 0!==o){var a={hd:i.valFromOption(o),tl:0};return c(t,n,a),a}r=n}}function Z(r,t){if(!r)return[0,0];var e=r.hd,n={hd:e,tl:0},o={hd:e,tl:0},i=t(e);return function(r,t,e,n){for(;;){var o=n,i=e,a=t;if(!a)return;var u=a.tl,s=a.hd,f={hd:s,tl:0};r(s)?(i.tl=f,e=f,t=u):(o.tl=f,n=f,t=u)}}(t,r.tl,n,o),i?[n,o.tl]:[n.tl,o]}var J=_,Q=z,rr=K;t.length=_,t.size=J,t.head=function(r){if(r)return i.some(r.hd)},t.headExn=function(r){if(r)return r.hd;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.tail=function(r){if(r)return r.tl},t.tailExn=function(r){if(r)return r.tl;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.add=function(r,t){return{hd:t,tl:r}},t.get=function(r,t){if(!(t<0))for(var e=r,n=t;;){var o=n,a=e;if(!a)return;if(0===o)return i.some(a.hd);n=o-1|0,e=a.tl}},t.getExn=function(r,t){if(t<0)throw{RE_EXN_ID:"Not_found",Error:new Error};for(var e=r,n=t;;){var o=n,i=e;if(!i)throw{RE_EXN_ID:"Not_found",Error:new Error};if(0===o)return i.hd;n=o-1|0,e=i.tl}},t.make=function(r,t){if(r<=0)return 0;for(var e={hd:t,tl:0},n=e,o=1;o<r;){var i={hd:t,tl:0};n.tl=i,n=i,o=o+1|0}return e},t.makeByU=d,t.makeBy=function(r,t){return d(r,n.__1(t))},t.shuffle=function(r){var t=h(r);return o.shuffleInPlace(t),g(t)},t.drop=function(r,t){if(!(t<0))for(var e=r,n=t;;){if(0===n)return e;if(!e)return;n=n-1|0,e=e.tl}},t.take=function(r,t){if(!(t<0)){if(0===t)return 0;if(r){var e={hd:r.hd,tl:0},n=function(r,t,e){for(;;){var n=e,o=t,i=r;if(0===i)return!0;if(!o)return!1;var a={hd:o.hd,tl:0};n.tl=a,e=a,t=o.tl,r=i-1|0}}(t-1|0,r.tl,e);return n?e:void 0}}},t.splitAt=function(r,t){if(!(t<0)){if(0===t)return[0,r];if(r){var e={hd:r.hd,tl:0},n=function(r,t,e){for(;;){var n=e,o=t,i=r;if(0===i)return o;if(!o)return;var a={hd:o.hd,tl:0};n.tl=a,e=a,t=o.tl,r=i-1|0}}(t-1|0,r.tl,e);return void 0!==n?[e,n]:void 0}}},t.concat=l,t.concatMany=function(r){var t=r.length;if(1===t)return r[0];if(0===t)return 0;for(var e=r.length,n=r[e-1|0],o=e-2|0;o>=0;--o)n=l(r[o],n);return n},t.reverseConcat=y,t.flatten=function(r){for(;;){var t=r;if(!t)return 0;var e=t.hd;if(e){var n={hd:e.hd,tl:0};return b(u(e.tl,n),t.tl),n}r=t.tl}},t.mapU=m,t.map=function(r,t){return m(r,n.__1(t))},t.zip=function(r,t){if(!r)return 0;if(!t)return 0;var e={hd:[r.hd,t.hd],tl:0};return function(r,t,e){for(;;){var n=e,o=t,i=r;if(!i)return;if(!o)return;var a={hd:[i.hd,o.hd],tl:0};n.tl=a,e=a,t=o.tl,r=i.tl}}(r.tl,t.tl,e),e},t.zipByU=p,t.zipBy=function(r,t,e){return p(r,t,n.__2(e))},t.mapWithIndexU=v,t.mapWithIndex=function(r,t){return v(r,n.__2(t))},t.fromArray=g,t.toArray=h,t.reverse=function(r){return y(r,0)},t.mapReverseU=A,t.mapReverse=function(r,t){return A(r,n.__1(t))},t.forEachU=S,t.forEach=function(r,t){S(r,n.__1(t))},t.forEachWithIndexU=T,t.forEachWithIndex=function(r,t){T(r,n.__2(t))},t.reduceU=E,t.reduce=function(r,t,e){return E(r,t,n.__2(e))},t.reduceWithIndexU=w,t.reduceWithIndex=function(r,t,e){return w(r,t,n.__3(e))},t.reduceReverseU=G,t.reduceReverse=function(r,t,e){return G(r,t,n.__2(e))},t.mapReverse2U=D,t.mapReverse2=function(r,t,e){return D(r,t,n.__2(e))},t.forEach2U=k,t.forEach2=function(r,t,e){k(r,t,n.__2(e))},t.reduce2U=O,t.reduce2=function(r,t,e,o){return O(r,t,e,n.__3(o))},t.reduceReverse2U=F,t.reduceReverse2=function(r,t,e,o){return F(r,t,e,n.__3(o))},t.everyU=I,t.every=function(r,t){return I(r,n.__1(t))},t.someU=P,t.some=function(r,t){return P(r,n.__1(t))},t.every2U=N,t.every2=function(r,t,e){return N(r,t,n.__2(e))},t.some2U=L,t.some2=function(r,t,e){return L(r,t,n.__2(e))},t.cmpByLength=function(r,t){for(;;){var e=r;if(!e)return t?-1:0;if(!t)return 1;t=t.tl,r=e.tl}},t.cmpU=R,t.cmp=function(r,t,e){return R(r,t,n.__2(e))},t.eqU=C,t.eq=function(r,t,e){return C(r,t,n.__2(e))},t.hasU=V,t.has=function(r,t,e){return V(r,t,n.__2(e))},t.getByU=X,t.getBy=function(r,t){return X(r,n.__1(t))},t.keepU=W,t.keep=z,t.filter=Q,t.keepWithIndexU=Y,t.keepWithIndex=K,t.filterWithIndex=rr,t.keepMapU=H,t.keepMap=function(r,t){return H(r,n.__1(t))},t.partitionU=Z,t.partition=function(r,t){return Z(r,n.__1(t))},t.unzip=function(r){if(!r)return[0,0];var t=r.hd,e={hd:t[0],tl:0},n={hd:t[1],tl:0};return function(r,t,e){for(;;){var n=e,o=t,i=r;if(!i)return;var a=i.hd,u={hd:a[0],tl:0},s={hd:a[1],tl:0};o.tl=u,n.tl=s,e=s,t=u,r=i.tl}}(r.tl,e,n),[e,n]},t.getAssocU=j,t.getAssoc=function(r,t,e){return j(r,t,n.__2(e))},t.hasAssocU=$,t.hasAssoc=function(r,t,e){return $(r,t,n.__2(e))},t.removeAssocU=U,t.removeAssoc=function(r,t,e){return U(r,t,n.__2(e))},t.setAssocU=q,t.setAssoc=function(r,t,e,o){return q(r,t,e,n.__2(o))},t.sortU=B,t.sort=function(r,t){return B(r,n.__2(t))}},71307:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(30581),a=e(87329);function u(r,t,e){if(void 0===r)return i.singleton(t,e);var n=r.k;if(t===n)return i.updateValue(r,e);var o=r.v;return t<n?i.bal(u(r.l,t,e),n,o,r.r):i.bal(r.l,n,o,u(r.r,t,e))}function s(r,t,e){if(void 0!==r){var n=r.k;if(t===n){var a=e(o.some(r.v));if(void 0!==a)return i.updateValue(r,o.valFromOption(a));var u=r.l,f=r.r;if(void 0===u)return f;if(void 0===f)return u;var c={contents:f.k},l={contents:f.v},m=i.removeMinAuxWithRef(f,c,l);return i.bal(u,c.contents,l.contents,m)}var p=r.v,v=r.l,d=r.r;if(t<n){var _=s(v,t,e);return v===_?r:i.bal(_,n,p,d)}var g=s(d,t,e);return d===g?r:i.bal(v,n,p,g)}var h=e(void 0);return void 0!==h?i.singleton(t,o.valFromOption(h)):r}function f(r,t){var e=r.k,n=r.l,o=r.r;if(t===e){if(void 0===n)return o;if(void 0===o)return n;var a={contents:o.k},u={contents:o.v},s=i.removeMinAuxWithRef(o,a,u);return i.bal(n,a.contents,u.contents,s)}if(t<e){if(void 0===n)return r;var c=f(n,t);return c===n?r:i.bal(c,e,r.v,o)}if(void 0===o)return r;var l=f(o,t);return i.bal(n,e,r.v,l)}var c=i.isEmpty,l=a.has,m=a.cmpU,p=a.cmp,v=a.eqU,d=a.eq,_=i.findFirstByU,g=i.findFirstBy,h=i.forEachU,y=i.forEach,b=i.reduceU,A=i.reduce,S=i.everyU,T=i.every,E=i.someU,x=i.some,G=i.size,w=i.toList,D=i.toArray,k=a.fromArray,O=i.keysToArray,M=i.valuesToArray,F=i.minKey,I=i.minKeyUndefined,P=i.maxKey,N=i.maxKeyUndefined,R=i.minimum,C=i.minUndefined,L=i.maximum,V=i.maxUndefined,j=a.get,$=a.getUndefined,U=a.getWithDefault,q=a.getExn,B=i.checkInvariantInternal,X=a.mergeU,W=a.merge,z=i.keepSharedU,Y=i.keepShared,K=i.partitionSharedU,H=i.partitionShared,Z=a.split,J=i.mapU,Q=i.map,rr=i.mapWithKeyU,tr=i.mapWithKey;t.empty=void 0,t.isEmpty=c,t.has=l,t.cmpU=m,t.cmp=p,t.eqU=v,t.eq=d,t.findFirstByU=_,t.findFirstBy=g,t.forEachU=h,t.forEach=y,t.reduceU=b,t.reduce=A,t.everyU=S,t.every=T,t.someU=E,t.some=x,t.size=G,t.toList=w,t.toArray=D,t.fromArray=k,t.keysToArray=O,t.valuesToArray=M,t.minKey=F,t.minKeyUndefined=I,t.maxKey=P,t.maxKeyUndefined=N,t.minimum=R,t.minUndefined=C,t.maximum=L,t.maxUndefined=V,t.get=j,t.getUndefined=$,t.getWithDefault=U,t.getExn=q,t.checkInvariantInternal=B,t.remove=function(r,t){if(void 0!==r)return f(r,t)},t.removeMany=function(r,t){var e=t.length;if(void 0!==r)for(var n=r,o=0;;){var i=o;if(i>=e)return n;var a=f(n,t[i]);if(void 0===a)return a;o=i+1|0,n=a}},t.set=u,t.updateU=s,t.update=function(r,t,e){return s(r,t,n.__1(e))},t.mergeU=X,t.merge=W,t.mergeMany=function(r,t){for(var e=t.length,n=r,o=0;o<e;++o){var i=t[o];n=u(n,i[0],i[1])}return n},t.keepU=z,t.keep=Y,t.partitionU=K,t.partition=H,t.split=Z,t.mapU=J,t.map=Q,t.mapWithKeyU=rr,t.mapWithKey=tr},61769:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(30581);function a(r,t,e){var n=e(t,r.k);if(0===n){var o=r.l,u=r.r;return void 0!==o?void 0!==u?(r.r=i.removeMinAuxWithRootMutate(r,u),i.balMutate(r)):o:void 0!==u?u:o}if(n<0){var s=r.l;return void 0!==s?(r.l=a(s,t,e),i.balMutate(r)):r}var f=r.r;return void 0!==f?(r.r=a(f,t,e),i.balMutate(r)):r}function u(r,t,e,n){if(void 0!==r){var a=n(t,r.k);if(0===a){var s=e(o.some(r.v));if(void 0!==s)return r.v=o.valFromOption(s),r;var f=r.l,c=r.r;return void 0!==f?void 0!==c?(r.r=i.removeMinAuxWithRootMutate(r,c),i.balMutate(r)):f:void 0!==c?c:f}return a<0?r.l=u(r.l,t,e,n):r.r=u(r.r,t,e,n),i.balMutate(r)}var l=e(void 0);return void 0!==l?i.singleton(t,o.valFromOption(l)):r}function s(r,t,e){var n=r.data,o=u(n,t,e,r.cmp);o===n||(r.data=o)}function f(r,t,e){return i.reduceU(r.data,t,e)}function c(r,t,e){return i.cmpU(r.data,t.data,r.cmp,e)}function l(r,t,e){return i.eqU(r.data,t.data,r.cmp,e)}function m(r,t){return{cmp:r.cmp,data:i.mapU(r.data,t)}}function p(r,t){return{cmp:r.cmp,data:i.mapWithKeyU(r.data,t)}}t.Int=void 0,t.$$String=void 0,t.make=function(r){return{cmp:r.cmp,data:void 0}},t.clear=function(r){r.data=void 0},t.isEmpty=function(r){return void 0===r.data},t.has=function(r,t){return i.has(r.data,t,r.cmp)},t.cmpU=c,t.cmp=function(r,t,e){return c(r,t,n.__2(e))},t.eqU=l,t.eq=function(r,t,e){return l(r,t,n.__2(e))},t.forEachU=function(r,t){i.forEachU(r.data,t)},t.forEach=function(r,t){i.forEachU(r.data,n.__2(t))},t.reduceU=f,t.reduce=function(r,t,e){return f(r,t,n.__3(e))},t.everyU=function(r,t){return i.everyU(r.data,t)},t.every=function(r,t){return i.everyU(r.data,n.__2(t))},t.someU=function(r,t){return i.someU(r.data,t)},t.some=function(r,t){return i.someU(r.data,n.__2(t))},t.size=function(r){return i.size(r.data)},t.toList=function(r){return i.toList(r.data)},t.toArray=function(r){return i.toArray(r.data)},t.fromArray=function(r,t){var e=t.cmp;return{cmp:e,data:i.fromArray(r,e)}},t.keysToArray=function(r){return i.keysToArray(r.data)},t.valuesToArray=function(r){return i.valuesToArray(r.data)},t.minKey=function(r){return i.minKey(r.data)},t.minKeyUndefined=function(r){return i.minKeyUndefined(r.data)},t.maxKey=function(r){return i.maxKey(r.data)},t.maxKeyUndefined=function(r){return i.maxKeyUndefined(r.data)},t.minimum=function(r){return i.minimum(r.data)},t.minUndefined=function(r){return i.minUndefined(r.data)},t.maximum=function(r){return i.maximum(r.data)},t.maxUndefined=function(r){return i.maxUndefined(r.data)},t.get=function(r,t){return i.get(r.data,t,r.cmp)},t.getUndefined=function(r,t){return i.getUndefined(r.data,t,r.cmp)},t.getWithDefault=function(r,t,e){return i.getWithDefault(r.data,t,e,r.cmp)},t.getExn=function(r,t){return i.getExn(r.data,t,r.cmp)},t.checkInvariantInternal=function(r){i.checkInvariantInternal(r.data)},t.remove=function(r,t){var e=r.data;if(void 0!==e){var n=a(e,t,r.cmp);n===e||(r.data=n)}},t.removeMany=function(r,t){var e=r.data;if(void 0!==e){var n=function(r,t,e,n,o){for(;;){var i=e;if(i>=n)return r;var u=a(r,t[i],o);if(void 0===u)return;e=i+1|0,r=u}}(e,t,0,t.length,r.cmp);n===e||(r.data=n)}},t.set=function(r,t,e){var n=r.data,o=i.updateMutate(n,t,e,r.cmp);o===n||(r.data=o)},t.updateU=s,t.update=function(r,t,e){s(r,t,n.__1(e))},t.mergeMany=function(r,t){var e=r.data,n=function(r,t,e){for(var n=r,o=0,a=t.length;o<a;++o){var u=t[o];n=i.updateMutate(n,u[0],u[1],e)}return n}(e,t,r.cmp);n===e||(r.data=n)},t.mapU=m,t.map=function(r,t){return m(r,n.__1(t))},t.mapWithKeyU=p,t.mapWithKey=function(r,t){return p(r,n.__2(t))}},91377:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(30581),a=e(87329);function u(r,t){return{data:i.mapU(r.data,t)}}function s(r,t){return{data:i.mapWithKeyU(r.data,t)}}function f(r,t,e){return i.reduceU(r.data,t,e)}function c(r,t){var e=r.k;if(t===e){var n=r.l,o=r.r;return void 0!==n?void 0!==o?(r.r=i.removeMinAuxWithRootMutate(r,o),i.balMutate(r)):n:o}if(t<e){var a=r.l;return void 0!==a?(r.l=c(a,t),i.balMutate(r)):r}var u=r.r;return void 0!==u?(r.r=c(u,t),i.balMutate(r)):r}function l(r,t,e){if(void 0!==r){var n=r.k;if(n===t){var a=e(o.some(r.v));if(void 0!==a)return r.v=o.valFromOption(a),r;var u=r.l,s=r.r;return void 0!==u?void 0!==s?(r.r=i.removeMinAuxWithRootMutate(r,s),i.balMutate(r)):u:s}var f=r.l,c=r.r;if(t<n){var m=l(f,t,e);r.l=m}else r.r=l(c,t,e);return i.balMutate(r)}var p=e(void 0);return void 0!==p?i.singleton(t,o.valFromOption(p)):r}function m(r,t,e){var n=r.data,o=l(n,t,e);o===n||(r.data=o)}function p(r,t,e){return a.cmpU(r.data,t.data,e)}function v(r,t,e){return a.eqU(r.data,t.data,e)}t.make=function(r){return{data:void 0}},t.clear=function(r){r.data=void 0},t.isEmpty=function(r){return void 0===r.data},t.has=function(r,t){return a.has(r.data,t)},t.cmpU=p,t.cmp=function(r,t,e){return p(r,t,n.__2(e))},t.eqU=v,t.eq=function(r,t,e){return v(r,t,n.__2(e))},t.forEachU=function(r,t){i.forEachU(r.data,t)},t.forEach=function(r,t){i.forEachU(r.data,n.__2(t))},t.reduceU=f,t.reduce=function(r,t,e){return f(r,t,n.__3(e))},t.everyU=function(r,t){return i.everyU(r.data,t)},t.every=function(r,t){return i.everyU(r.data,n.__2(t))},t.someU=function(r,t){return i.someU(r.data,t)},t.some=function(r,t){return i.someU(r.data,n.__2(t))},t.size=function(r){return i.size(r.data)},t.toList=function(r){return i.toList(r.data)},t.toArray=function(r){return i.toArray(r.data)},t.fromArray=function(r){return{data:a.fromArray(r)}},t.keysToArray=function(r){return i.keysToArray(r.data)},t.valuesToArray=function(r){return i.valuesToArray(r.data)},t.minKey=function(r){return i.minKey(r.data)},t.minKeyUndefined=function(r){return i.minKeyUndefined(r.data)},t.maxKey=function(r){return i.maxKey(r.data)},t.maxKeyUndefined=function(r){return i.maxKeyUndefined(r.data)},t.minimum=function(r){return i.minimum(r.data)},t.minUndefined=function(r){return i.minUndefined(r.data)},t.maximum=function(r){return i.maximum(r.data)},t.maxUndefined=function(r){return i.maxUndefined(r.data)},t.get=function(r,t){return a.get(r.data,t)},t.getUndefined=function(r,t){return a.getUndefined(r.data,t)},t.getWithDefault=function(r,t,e){return a.getWithDefault(r.data,t,e)},t.getExn=function(r,t){return a.getExn(r.data,t)},t.checkInvariantInternal=function(r){i.checkInvariantInternal(r.data)},t.remove=function(r,t){var e=r.data;if(void 0!==e){var n=c(e,t);n===e||(r.data=n)}},t.removeMany=function(r,t){var e=r.data;if(void 0!==e){var n=function(r,t,e,n){for(;;){var o=e;if(o>=n)return r;var i=c(r,t[o]);if(void 0===i)return;e=o+1|0,r=i}}(e,t,0,t.length);n===e||(r.data=n)}},t.set=function(r,t,e){var n=r.data,o=a.addMutate(n,t,e);o===n||(r.data=o)},t.updateU=m,t.update=function(r,t,e){m(r,t,n.__1(e))},t.mapU=u,t.map=function(r,t){return u(r,n.__1(t))},t.mapWithKeyU=s,t.mapWithKey=function(r,t){return s(r,n.__2(t))}},23025:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890);function i(r,t){if(void 0!==r&&t(o.valFromOption(r)))return r}function a(r,t){if(void 0!==r)return t(o.valFromOption(r))}function u(r,t,e){return void 0!==r?e(o.valFromOption(r)):t}function s(r,t){if(void 0!==r)return o.some(t(o.valFromOption(r)))}function f(r,t){if(void 0!==r)return t(o.valFromOption(r))}function c(r,t,e){return void 0!==r?void 0!==t&&e(o.valFromOption(r),o.valFromOption(t)):void 0===t}function l(r,t,e){return void 0!==r?void 0!==t?e(o.valFromOption(r),o.valFromOption(t)):1:void 0!==t?-1:0}t.keepU=i,t.keep=function(r,t){return i(r,n.__1(t))},t.forEachU=a,t.forEach=function(r,t){a(r,n.__1(t))},t.getExn=function(r){if(void 0!==r)return o.valFromOption(r);throw{RE_EXN_ID:"Not_found",Error:new Error}},t.mapWithDefaultU=u,t.mapWithDefault=function(r,t,e){return u(r,t,n.__1(e))},t.mapU=s,t.map=function(r,t){return s(r,n.__1(t))},t.flatMapU=f,t.flatMap=function(r,t){return f(r,n.__1(t))},t.getWithDefault=function(r,t){return void 0!==r?o.valFromOption(r):t},t.orElse=function(r,t){return void 0!==r?r:t},t.isSome=function(r){return void 0!==r},t.isNone=function(r){return void 0===r},t.eqU=c,t.eq=function(r,t,e){return c(r,t,n.__2(e))},t.cmpU=l,t.cmp=function(r,t,e){return l(r,t,n.__2(e))}},17978:(r,t,e)=>{"use strict";var n=e(10456);function o(r,t,e){return 0===r.TAG?e(r._0):t}function i(r,t){return 0===r.TAG?{TAG:0,_0:t(r._0)}:{TAG:1,_0:r._0}}function a(r,t){return 0===r.TAG?t(r._0):{TAG:1,_0:r._0}}function u(r,t,e){return 0===r.TAG?0===t.TAG&&e(r._0,t._0):0!==t.TAG}function s(r,t,e){return 0===r.TAG?0===t.TAG?e(r._0,t._0):1:0===t.TAG?-1:0}t.getExn=function(r){if(0===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.mapWithDefaultU=o,t.mapWithDefault=function(r,t,e){return o(r,t,n.__1(e))},t.mapU=i,t.map=function(r,t){return i(r,n.__1(t))},t.flatMapU=a,t.flatMap=function(r,t){return a(r,n.__1(t))},t.getWithDefault=function(r,t){return 0===r.TAG?r._0:t},t.isOk=function(r){return 0===r.TAG},t.isError=function(r){return 0!==r.TAG},t.eqU=u,t.eq=function(r,t,e){return u(r,t,n.__2(e))},t.cmpU=s,t.cmp=function(r,t,e){return s(r,t,n.__2(e))}},54178:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924);function i(r,t){var e=r.length;if(0===e||1===e)return e;var n=r[0],o=r[1];if(!t(n,o))return t(o,n)?0|-function(r,t,e,n,o){for(;;){var i=e,a=t;if(i>=n)return i;var u=r[i];if(!o(u,a))return i;e=i+1|0,t=u}}(r,o,2,e,t):1;for(var i=o,a=2;;){var u=a,s=i;if(u>=e)return u;var f=r[u];if(!t(s,f))return u;a=u+1|0,i=f}}function a(r,t){var e=r.length;if(0===e)return!0;for(var n=0,o=e-1|0;;){var i=n;if(i===o)return!0;if(t(r[i],r[i+1|0])>0)return!1;n=i+1|0}}function u(r,t,e,n,i,a,u,s,f){for(var c=t+e|0,l=i+a|0,m=t,p=r[t],v=i,d=n[i],_=s;;){var g=_,h=d,y=v,b=p,A=m;if(f(b,h)<=0){u[g]=b;var S=A+1|0;if(S>=c)return o.blitUnsafe(n,y,u,g+1|0,l-y|0);_=g+1|0,p=r[S],m=S}else{u[g]=h;var T=y+1|0;if(T>=l)return o.blitUnsafe(r,A,u,g+1|0,c-A|0);_=g+1|0,d=n[T],v=T}}}function s(r,t,e,n,i,a,u,s,f){for(var c=t+e|0,l=i+a|0,m=t,p=r[t],v=i,d=n[i],_=s;;){var g=_,h=d,y=v,b=p,A=m,S=f(b,h);if(S<0){u[g]=b;var T=A+1|0,E=g+1|0;if(T<c){_=E,p=r[T],m=T;continue}return o.blitUnsafe(n,y,u,E,l-y|0),(E+l|0)-y|0}if(0!==S){u[g]=h;var x=y+1|0,G=g+1|0;if(!(x<l))return o.blitUnsafe(r,A,u,G,c-A|0),(G+c|0)-A|0;_=G,d=n[x],v=x}else{u[g]=b;var w=A+1|0,D=y+1|0,k=g+1|0;if(!(w<c&&D<l))return w===c?(o.blitUnsafe(n,D,u,k,l-D|0),(k+l|0)-D|0):(o.blitUnsafe(r,w,u,k,c-w|0),(k+c|0)-w|0);_=k,d=n[D],v=D,p=r[w],m=w}}}function f(r,t,e,n,o,i,a,u,s){for(var f=t+e|0,c=o+i|0,l=t,m=r[t],p=o,v=n[o],d=u;;){var _=d,g=p,h=m,y=l,b=s(h,v);if(b<0){var A=y+1|0;if(A>=f)return _;m=r[A],l=A}else if(0!==b){var S=g+1|0;if(S>=c)return _;v=n[S],p=S}else{a[_]=h;var T=y+1|0,E=g+1|0,x=_+1|0;if(!(T<f&&E<c))return x;d=x,v=n[E],p=E,m=r[T],l=T}}}function c(r,t,e,n,i,a,u,s,f){for(var c=t+e|0,l=i+a|0,m=t,p=r[t],v=i,d=n[i],_=s;;){var g=_,h=v,y=p,b=m,A=f(y,d);if(A<0){u[g]=y;var S=g+1|0,T=b+1|0;if(T>=c)return S;_=S,p=r[T],m=T}else if(0!==A){var E=h+1|0;if(!(E<l))return o.blitUnsafe(r,b,u,g,c-b|0),(g+c|0)-b|0;d=n[E],v=E}else{var x=b+1|0,G=h+1|0;if(!(x<c&&G<l))return x===c?g:(o.blitUnsafe(r,x,u,g,c-x|0),(g+c|0)-x|0);d=n[G],v=G,p=r[x],m=x}}}function l(r,t,e,n,o,i){for(var a=0;a<o;++a){for(var u=r[t+a|0],s=(n+a|0)-1|0;s>=n&&i(e[s],u)>0;)e[s+1|0]=e[s],s=s-1|0;e[s+1|0]=u}}function m(r,t,e,n,o,i){if(o<=5)return l(r,t,e,n,o,i);var a=o/2|0,s=o-a|0;m(r,t+a|0,e,n+a|0,s,i),m(r,t,r,t+s|0,a,i),u(r,t+s|0,a,e,n+a|0,s,e,n,i)}function p(r,t){var e=r.length;if(e<=5)return l(r,0,r,0,e,t);var n=e/2|0,o=e-n|0,i=new Array(o);m(r,n,i,0,o,t),m(r,0,r,o,n,t),u(r,o,n,i,0,o,r,0,t)}function v(r,t){var e=r.slice(0);return p(e,t),e}function d(r,t,e){var n=r.length;if(0===n)return-1;if(e(t,r[0])<0)return-1;if(e(t,r[n-1|0])>0)return 0|-(n+1|0);for(var o=0,i=n-1|0;;){var a=i,u=o,s=(u+a|0)/2|0,f=e(t,r[s]);if(0===f)return s;if(f<0){if(a===s)return 0===e(r[u],t)?u:0|-(a+1|0);i=s}else{if(u===s)return 0===e(r[a],t)?a:0|-(a+1|0);o=s}}}t.Int=void 0,t.$$String=void 0,t.strictlySortedLengthU=i,t.strictlySortedLength=function(r,t){return i(r,n.__2(t))},t.isSortedU=a,t.isSorted=function(r,t){return a(r,n.__2(t))},t.stableSortInPlaceByU=p,t.stableSortInPlaceBy=function(r,t){p(r,n.__2(t))},t.stableSortByU=v,t.stableSortBy=function(r,t){return v(r,n.__2(t))},t.binarySearchByU=d,t.binarySearchBy=function(r,t,e){return d(r,t,n.__2(e))},t.unionU=s,t.union=function(r,t,e,o,i,a,u,f,c){return s(r,t,e,o,i,a,u,f,n.__2(c))},t.intersectU=f,t.intersect=function(r,t,e,o,i,a,u,s,c){return f(r,t,e,o,i,a,u,s,n.__2(c))},t.diffU=c,t.diff=function(r,t,e,o,i,a,u,s,f){return c(r,t,e,o,i,a,u,s,n.__2(f))}},30581:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(54178);function a(r){return void 0!==r?r.h:0}function u(r,t,e,n){var o=a(r),i=a(n);return{k:t,v:e,h:o>=i?o+1|0:i+1|0,l:r,r:n}}function s(r,t){return{k:r,v:t,h:1,l:void 0,r:void 0}}function f(r,t){return void 0===t||void 0!==r&&r.h>=t.h}function c(r,t,e,n){var o=void 0!==r?r.h:0,i=void 0!==n?n.h:0;if(o>(i+2|0)){var s=r.l,f=r.r;return a(s)>=a(f)?u(s,r.k,r.v,u(f,t,e,n)):u(u(s,r.k,r.v,f.l),f.k,f.v,u(f.r,t,e,n))}if(i<=(o+2|0))return{k:t,v:e,h:o>=i?o+1|0:i+1|0,l:r,r:n};var c=n.l,l=n.r;return a(l)>=a(c)?u(u(r,t,e,c),n.k,n.v,l):u(u(r,t,e,c.l),c.k,c.v,u(c.r,n.k,n.v,l))}function l(r){for(;;){var t=r,e=t.l;if(void 0===e)return t.k;r=e}}function m(r){for(;;){var t=r,e=t.r;if(void 0===e)return t.k;r=e}}function p(r){for(;;){var t=r,e=t.l;if(void 0===e)return[t.k,t.v];r=e}}function v(r){for(;;){var t=r,e=t.r;if(void 0===e)return[t.k,t.v];r=e}}function d(r,t,e){var n=r.l;return void 0!==n?c(d(n,t,e),r.k,r.v,r.r):(t.contents=r.k,e.contents=r.v,r.r)}function _(r,t){for(;;){if(void 0===r)return t;t={hd:r,tl:t},r=r.l}}function g(r,t){if(void 0!==r){var e=g(r.l,t);if(void 0!==e)return e;var n=r.k,o=r.v;if(t(n,o))return[n,o];var i=g(r.r,t);return void 0!==i?i:void 0}}function h(r,t){for(;;){var e=r;if(void 0===e)return;h(e.l,t),t(e.k,e.v),r=e.r}}function y(r,t){if(void 0!==r){var e=y(r.l,t),n=t(r.v),o=y(r.r,t);return{k:r.k,v:n,h:r.h,l:e,r:o}}}function b(r,t){if(void 0!==r){var e=r.k,n=b(r.l,t),o=t(e,r.v),i=b(r.r,t);return{k:e,v:o,h:r.h,l:n,r:i}}}function A(r,t,e){for(;;){var n=t,o=r;if(void 0===o)return n;var i=o.k,a=o.v,u=o.l,s=o.r;t=e(A(u,n,e),i,a),r=s}}function S(r,t){for(;;){var e=r;if(void 0===e)return!0;if(!t(e.k,e.v))return!1;if(!S(e.l,t))return!1;r=e.r}}function T(r,t){for(;;){var e=r;if(void 0===e)return!1;if(t(e.k,e.v))return!0;if(T(e.l,t))return!0;r=e.r}}function E(r,t,e){return void 0!==r?c(E(r.l,t,e),r.k,r.v,r.r):s(t,e)}function x(r,t,e){return void 0!==r?c(r.l,r.k,r.v,x(r.r,t,e)):s(t,e)}function G(r,t,e,n){if(void 0===r)return E(n,t,e);if(void 0===n)return x(r,t,e);var o=r.k,i=r.v,a=r.h,s=r.l,f=r.r,l=n.k,m=n.v,p=n.h,v=n.l,d=n.r;return a>(p+2|0)?c(s,o,i,G(f,t,e,n)):p>(a+2|0)?c(G(r,t,e,v),l,m,d):u(r,t,e,n)}function w(r,t){if(void 0===r)return t;if(void 0===t)return r;var e={contents:t.k},n={contents:t.v},o=d(t,e,n);return G(r,e.contents,n.contents,o)}function D(r,t){if(void 0!==r){var e=r.k,n=r.v,o=D(r.l,t),i=t(e,n),a=D(r.r,t);return i?G(o,e,n,a):w(o,a)}}function k(r,t){if(void 0!==r){var e=r.k,n=r.v,i=k(r.l,t),a=t(e,n),u=k(r.r,t);return void 0!==a?G(i,e,o.valFromOption(a),u):w(i,u)}}function O(r,t){if(void 0===r)return[void 0,void 0];var e=r.k,n=r.v,o=O(r.l,t),i=o[1],a=o[0],u=t(e,n),s=O(r.r,t),f=s[1],c=s[0];return u?[G(a,e,n,c),w(i,f)]:[w(a,c),G(i,e,n,f)]}function M(r){var t=r.l,e=r.r;return(1+(void 0!==t?M(t):0)|0)+(void 0!==e?M(e):0)|0}function F(r){return void 0!==r?M(r):0}function I(r,t){for(;;){var e=t,n=r;if(void 0===n)return e;var o=n.k,i=n.v,a=n.l;t={hd:[o,i],tl:I(n.r,e)},r=a}}function P(r,t,e){for(;;){var n=t,o=r,i=o.k,a=o.l,u=o.r,s=void 0!==a?P(a,n,e):n;e[s]=i;var f=s+1|0;if(void 0===u)return f;t=f,r=u}}function N(r,t,e){for(;;){var n=t,o=r,i=o.l,a=o.r,u=void 0!==i?N(i,n,e):n;e[u]=o.v;var s=u+1|0;if(void 0===a)return s;t=s,r=a}}function R(r,t,e){for(;;){var n=t,o=r,i=o.l,a=o.k,u=o.r,s=void 0!==i?R(i,n,e):n;e[s]=[a,o.v];var f=s+1|0;if(void 0===u)return f;t=f,r=u}}function C(r,t,e){switch(e){case 0:return;case 1:var n=r[t];return s(n[0],n[1]);case 2:var o=r[t],i=r[t-1|0],a=o;return{k:i[0],v:i[1],h:2,l:s(a[0],a[1]),r:void 0};case 3:var f=r[t],c=r[t-1|0],l=r[t-2|0],m=c,p=f;return{k:m[0],v:m[1],h:2,l:s(p[0],p[1]),r:s(l[0],l[1])};default:var v=e/2|0,d=C(r,t,v),_=r[t-v|0],g=C(r,(t-v|0)-1|0,(e-v|0)-1|0);return u(d,_[0],_[1],g)}}function L(r,t,e){switch(e){case 0:return;case 1:var n=r[t];return s(n[0],n[1]);case 2:var o=r[t],i=r[t+1|0],a=o;return{k:i[0],v:i[1],h:2,l:s(a[0],a[1]),r:void 0};case 3:var f=r[t],c=r[t+1|0],l=r[t+2|0],m=c,p=f;return{k:m[0],v:m[1],h:2,l:s(p[0],p[1]),r:s(l[0],l[1])};default:var v=e/2|0,d=L(r,t,v),_=r[t+v|0],g=L(r,1+(t+v|0)|0,(e-v|0)-1|0);return u(d,_[0],_[1],g)}}function V(r,t,e,n){var o=F(r),i=F(t);if(o!==i)return o<i?-1:1;for(var a=_(r,0),u=_(t,0);;){var s=u,f=a;if(!f)return 0;if(!s)return 0;var c=s.hd,l=f.hd,m=e(l.k,c.k);if(0!==m)return m;var p=n(l.v,c.v);if(0!==p)return p;u=_(c.r,s.tl),a=_(l.r,f.tl)}}function j(r,t,e,n){if(F(r)!==F(t))return!1;for(var o=_(r,0),i=_(t,0);;){var a=i,u=o;if(!u)return!0;if(!a)return!0;var s=a.hd,f=u.hd;if(0!==e(f.k,s.k)||!n(f.v,s.v))return!1;i=_(s.r,a.tl),o=_(f.r,u.tl)}}function $(r){var t=r.l;r.l=t.r,t.r=r;var e=a(r.l),n=a(r.r);r.h=(e>n?e:n)+1|0;var o=a(t.l),i=r.h;return t.h=(o>i?o:i)+1|0,t}function U(r){var t=r.r;r.r=t.l,t.l=r;var e=a(r.l),n=a(r.r);r.h=(e>n?e:n)+1|0;var o=a(t.r),i=r.h;return t.h=(o>i?o:i)+1|0,t}function q(r){var t=a(r.l),e=a(r.r);return r.h=(t>e?t:e)+1|0,r}function B(r){var t,e,n=r.l,o=r.r,i=a(n),u=a(o);if(i>(2+u|0))return f(n.l,n.r)?q($(r)):q((e=U((t=r).l),t.l=e,$(t)));if(u>(2+i|0)){var s=o.l;return f(o.r,s)?q(U(r)):q(function(r){var t=$(r.r);return r.r=t,U(r)}(r))}return r.h=(i>u?i:u)+1|0,r}function X(r,t,e,n){if(void 0===r)return s(t,e);var o=n(t,r.k);if(0===o)return r.v=e,r;var i=r.l,a=r.r;if(o<0){var u=X(i,t,e,n);r.l=u}else r.r=X(a,t,e,n);return B(r)}t.copy=function r(t){return void 0!==t?{k:t.k,v:t.v,h:t.h,l:r(t.l),r:r(t.r)}:t},t.create=u,t.bal=c,t.singleton=s,t.updateValue=function(r,t){return r.v===t?r:{k:r.k,v:t,h:r.h,l:r.l,r:r.r}},t.minKey=function(r){if(void 0!==r)return o.some(l(r))},t.minKeyUndefined=function(r){if(void 0!==r)return l(r)},t.maxKey=function(r){if(void 0!==r)return o.some(m(r))},t.maxKeyUndefined=function(r){if(void 0!==r)return m(r)},t.minimum=function(r){if(void 0!==r)return p(r)},t.minUndefined=function(r){if(void 0!==r)return p(r)},t.maximum=function(r){if(void 0!==r)return v(r)},t.maxUndefined=function(r){if(void 0!==r)return v(r)},t.removeMinAuxWithRef=d,t.isEmpty=function(r){return void 0===r},t.stackAllLeft=_,t.findFirstByU=g,t.findFirstBy=function(r,t){return g(r,n.__2(t))},t.forEachU=h,t.forEach=function(r,t){h(r,n.__2(t))},t.mapU=y,t.map=function(r,t){return y(r,n.__1(t))},t.mapWithKeyU=b,t.mapWithKey=function(r,t){return b(r,n.__2(t))},t.reduceU=A,t.reduce=function(r,t,e){return A(r,t,n.__3(e))},t.everyU=S,t.every=function(r,t){return S(r,n.__2(t))},t.someU=T,t.some=function(r,t){return T(r,n.__2(t))},t.join=G,t.concat=w,t.concatOrJoin=function(r,t,e,n){return void 0!==e?G(r,t,o.valFromOption(e),n):w(r,n)},t.keepSharedU=D,t.keepShared=function(r,t){return D(r,n.__2(t))},t.keepMapU=k,t.keepMap=function(r,t){return k(r,n.__2(t))},t.partitionSharedU=O,t.partitionShared=function(r,t){return O(r,n.__2(t))},t.lengthNode=M,t.size=F,t.toList=function(r){return I(r,0)},t.checkInvariantInternal=function r(t){for(;;){var e=t;if(void 0===e)return;var n=e.l,o=e.r,i=a(n)-a(o)|0;if(!(i<=2&&i>=-2))throw{RE_EXN_ID:"Assert_failure",_1:["belt_internalAVLtree.ml",373,4],Error:new Error};r(n),t=o}},t.fillArray=R,t.toArray=function(r){if(void 0===r)return[];var t=M(r),e=new Array(t);return R(r,0,e),e},t.keysToArray=function(r){if(void 0===r)return[];var t=M(r),e=new Array(t);return P(r,0,e),e},t.valuesToArray=function(r){if(void 0===r)return[];var t=M(r),e=new Array(t);return N(r,0,e),e},t.fromSortedArrayAux=L,t.fromSortedArrayRevAux=C,t.fromSortedArrayUnsafe=function(r){return L(r,0,r.length)},t.cmpU=V,t.cmp=function(r,t,e,o){return V(r,t,e,n.__2(o))},t.eqU=j,t.eq=function(r,t,e,o){return j(r,t,e,n.__2(o))},t.get=function(r,t,e){for(;;){var n=r;if(void 0===n)return;var i=e(t,n.k);if(0===i)return o.some(n.v);r=i<0?n.l:n.r}},t.getUndefined=function(r,t,e){for(;;){var n=r;if(void 0===n)return;var o=e(t,n.k);if(0===o)return n.v;r=o<0?n.l:n.r}},t.getWithDefault=function(r,t,e,n){for(;;){var o=r;if(void 0===o)return e;var i=n(t,o.k);if(0===i)return o.v;r=i<0?o.l:o.r}},t.getExn=function(r,t,e){for(;;){var n=r;if(void 0===n)throw{RE_EXN_ID:"Not_found",Error:new Error};var o=e(t,n.k);if(0===o)return n.v;r=o<0?n.l:n.r}},t.has=function(r,t,e){for(;;){var n=r;if(void 0===n)return!1;var o=e(t,n.k);if(0===o)return!0;r=o<0?n.l:n.r}},t.fromArray=function(r,t){var e=r.length;if(0!==e){var n,o=i.strictlySortedLengthU(r,(function(r,e){return t(r[0],e[0])<0}));n=o>=0?L(r,0,o):C(r,(o=0|-o)-1|0,o);for(var a=o;a<e;++a){var u=r[a];n=X(n,u[0],u[1],t)}return n}},t.updateMutate=X,t.balMutate=B,t.removeMinAuxWithRootMutate=function r(t,e){var n=e.r,o=e.l;return void 0!==o?(e.l=r(t,o),B(e)):(t.k=e.k,t.v=e.v,n)}},87329:(r,t,e)=>{"use strict";var n=e(51958),o=e(10456),i=e(5890),a=e(54178),u=e(30581);function s(r,t){var e=t.k,n=t.v,o=t.l,a=t.r;if(r===e)return[o,i.some(n),a];if(r<e){if(void 0===o)return[void 0,void 0,t];var f=s(r,o);return[f[0],f[1],u.join(f[2],e,n,a)]}if(void 0===a)return[t,void 0,void 0];var c=s(r,a);return[u.join(o,e,n,c[0]),c[1],c[2]]}function f(r,t){return void 0!==t?s(r,t):[void 0,void 0,void 0]}function c(r,t,e){if(void 0!==r){if(r.h>=(void 0!==t?t.h:0)){var n=r.k,o=r.v,a=r.l,s=r.r,l=f(n,t);return u.concatOrJoin(c(a,l[0],e),n,e(n,i.some(o),l[1]),c(s,l[2],e))}}else if(void 0===t)return;var m=t.k,p=t.v,v=t.l,d=t.r,_=f(m,r);return u.concatOrJoin(c(_[0],v,e),m,e(m,_[1],i.some(p)),c(_[2],d,e))}function l(r,t,e){for(;;){var o=t,i=r;if(!i)return 0;if(!o)return 0;var a=o.hd,s=i.hd,f=n.string_compare(s.k,a.k);if(0!==f)return f;var c=e(s.v,a.v);if(0!==c)return c;t=u.stackAllLeft(a.r,o.tl),r=u.stackAllLeft(s.r,i.tl)}}function m(r,t,e){var n=u.size(r),o=u.size(t);return n===o?l(u.stackAllLeft(r,0),u.stackAllLeft(t,0),e):n<o?-1:1}function p(r,t,e){for(;;){var n=t,o=r;if(!o)return!0;if(!n)return!0;var i=n.hd,a=o.hd;if(a.k!==i.k||!e(a.v,i.v))return!1;t=u.stackAllLeft(i.r,n.tl),r=u.stackAllLeft(a.r,o.tl)}}function v(r,t,e){return u.size(r)===u.size(t)&&p(u.stackAllLeft(r,0),u.stackAllLeft(t,0),e)}function d(r,t,e){if(void 0===r)return u.singleton(t,e);var n=r.k;if(t===n)return r.k=t,r.v=e,r;var o=r.l,i=r.r;if(t<n){var a=d(o,t,e);r.l=a}else r.r=d(i,t,e);return u.balMutate(r)}t.N=void 0,t.A=void 0,t.S=void 0,t.add=function r(t,e,n){if(void 0===t)return u.singleton(e,n);var o=t.k;if(e===o)return u.updateValue(t,n);var i=t.v;return e<o?u.bal(r(t.l,e,n),o,i,t.r):u.bal(t.l,o,i,r(t.r,e,n))},t.get=function(r,t){for(;;){var e=r;if(void 0===e)return;var n=e.k;if(t===n)return i.some(e.v);r=t<n?e.l:e.r}},t.getUndefined=function(r,t){for(;;){var e=r;if(void 0===e)return;var n=e.k;if(t===n)return e.v;r=t<n?e.l:e.r}},t.getExn=function(r,t){for(;;){var e=r;if(void 0===e)throw{RE_EXN_ID:"Not_found",Error:new Error};var n=e.k;if(t===n)return e.v;r=t<n?e.l:e.r}},t.getWithDefault=function(r,t,e){for(;;){var n=r;if(void 0===n)return e;var o=n.k;if(t===o)return n.v;r=t<o?n.l:n.r}},t.has=function(r,t){for(;;){var e=r;if(void 0===e)return!1;var n=e.k;if(t===n)return!0;r=t<n?e.l:e.r}},t.remove=function r(t,e){if(void 0===t)return t;var n=t.k,o=t.l,i=t.r;if(e!==n)return e<n?u.bal(r(o,e),n,t.v,i):u.bal(o,n,t.v,r(i,e));if(void 0===o)return i;if(void 0===i)return o;var a={contents:i.k},s={contents:i.v},f=u.removeMinAuxWithRef(i,a,s);return u.bal(o,a.contents,s.contents,f)},t.splitAux=s,t.split=f,t.mergeU=c,t.merge=function(r,t,e){return c(r,t,o.__3(e))},t.compareAux=l,t.cmpU=m,t.cmp=function(r,t,e){return m(r,t,o.__2(e))},t.eqAux=p,t.eqU=v,t.eq=function(r,t,e){return v(r,t,o.__2(e))},t.addMutate=d,t.fromArray=function(r){var t=r.length;if(0!==t){var e,n=a.strictlySortedLengthU(r,(function(r,t){return r[0]<t[0]}));n>=0?e=u.fromSortedArrayAux(r,0,n):(n=0|-n,e=u.fromSortedArrayRevAux(r,n-1|0,n));for(var o=n;o<t;++o){var i=r[o];e=d(e,i[0],i[1])}return e}}},29085:(r,t,e)=>{"use strict";var n=e(51958),o=e(61008),i=e(10456),a=e(50382),u=e(20114);function s(r,t,e,n){if(!(e<=0))for(var o=t,i=e+t|0;o<i;++o)r[o]=n}function f(r,t,e,n,o){if(!(o<=0))if(r!==e){var i=r.length-t|0;if(o<=i)for(var a=0;a<o;++a)e[n+a|0]=r[t+a|0];else{for(var u=0;u<i;++u)e[n+u|0]=r[t+u|0];for(var s=i;s<o;++s)e[n+s|0]=0}}else{if(t<n){for(var f=(r.length-n|0)-1|0,c=o-1|0,l=f>c?c:f;l>=0;--l)r[n+l|0]=r[t+l|0];return}if(t<=n)return;for(var m=(r.length-t|0)-1|0,p=o-1|0,v=m>p?p:m,d=0;d<=v;++d)r[n+d|0]=r[t+d|0]}}var c=[];function l(r){var t=r.length,e=a.create(t);return f(r,0,e,0,t),e}function m(r){var t=r.length,e="",n=t;if(t<=4096&&t===r.length)return String.fromCharCode.apply(null,r);for(var o=0;n>0;){for(var i=n<1024?n:1024,a=new Array(i),u=0;u<i;++u)a[u]=r[u+o|0];e+=String.fromCharCode.apply(null,a),n=n-i|0,o=o+i|0}return e}function p(r){for(var t=r.length,e=new Array(t),n=0;n<t;++n)e[n]=r.codePointAt(n);return e}function v(r,t,e){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.sub / Bytes.sub",Error:new Error};var n=a.create(e);return f(r,t,n,0,e),n}function d(r,t){var e=r+t|0,n=t<0,o=e<0;if(r<0){if(!n)return e;if(o)return e;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error}}if(n)return e;if(o)throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.extend",Error:new Error};return e}function _(r,t){if(r>=t)return r;throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.concat",Error:new Error}}function g(r){return r>13||r<9?32===r:11!==r}function h(r,t){var e=t.length;if(0===e)return t;for(var n=a.create(e),o=0;o<e;++o)n[o]=i._1(r,t[o]);return n}function y(r,t){if(0===t.length)return t;var e=l(t);return e[0]=i._1(r,t[0]),e}function b(r,t,e,n){for(;;){var o=e;if(o>=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r[o]===n)return o;e=o+1|0}}function A(r,t,e,n){for(;;){var o=e;if(o>=t)return;if(r[o]===n)return o;e=o+1|0}}function S(r,t,e){for(;;){var n=t;if(n<0)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r[n]===e)return n;t=n-1|0}}function T(r,t,e){for(;;){var n=t;if(n<0)return;if(r[n]===e)return n;t=n-1|0}}function E(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from",Error:new Error};try{return b(r,n,t,e),!0}catch(r){var o=u.internalToOCamlException(r);if("Not_found"===o.RE_EXN_ID)return!1;throw o}}var x=a.bytes_compare,G=a.bytes_equal,w=m,D=p;t.make=function(r,t){var e=a.create(r);return s(e,0,r,t),e},t.init=function(r,t){for(var e=a.create(r),n=0;n<r;++n)e[n]=i._1(t,n);return e},t.empty=c,t.copy=l,t.of_string=p,t.to_string=m,t.sub=v,t.sub_string=function(r,t,e){return m(v(r,t,e))},t.extend=function(r,t,e){var o=d(d(r.length,t),e),i=a.create(o),u=t<0?[0|-t,0]:[0,t],s=u[1],c=u[0],l=n.int_min(r.length-c|0,o-s|0);return l>0&&f(r,c,i,s,l),i},t.fill=function(r,t,e,n){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.fill / Bytes.fill",Error:new Error};s(r,t,e,n)},t.blit=function(r,t,e,n,o){if(o<0||t<0||t>(r.length-o|0)||n<0||n>(e.length-o|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Bytes.blit",Error:new Error};f(r,t,e,n,o)},t.blit_string=function(r,t,e,n,o){if(o<0||t<0||t>(r.length-o|0)||n<0||n>(e.length-o|0))throw{RE_EXN_ID:"Invalid_argument",_1:"String.blit / Bytes.blit_string",Error:new Error};if(!(o<=0)){var i=r.length-t|0;if(o<=i)for(var a=0;a<o;++a)e[n+a|0]=r.codePointAt(t+a|0);else{for(var u=0;u<i;++u)e[n+u|0]=r.codePointAt(t+u|0);for(var s=i;s<o;++s)e[n+s|0]=0}}},t.concat=function(r,t){if(!t)return c;for(var e=r.length,n=a.create(function(r,t,e){for(;;){var n=e,o=r;if(!n)return o;var i=n.tl,a=n.hd;if(!i)return a.length+o|0;e=i,r=_((a.length+t|0)+o|0,o)}}(0,e,t)),o=0,i=t;;){var u=i,s=o;if(!u)return n;var l=u.tl,m=u.hd;if(!l)return f(m,0,n,s,m.length),n;f(m,0,n,s,m.length),f(r,0,n,s+m.length|0,e),i=l,o=(s+m.length|0)+e|0}},t.cat=function(r,t){var e=r.length,n=t.length,o=a.create(e+n|0);return f(r,0,o,0,e),f(t,0,o,e,n),o},t.iter=function(r,t){for(var e=0,n=t.length;e<n;++e)i._1(r,t[e])},t.iteri=function(r,t){for(var e=0,n=t.length;e<n;++e)i._2(r,e,t[e])},t.map=h,t.mapi=function(r,t){var e=t.length;if(0===e)return t;for(var n=a.create(e),o=0;o<e;++o)n[o]=i._2(r,o,t[o]);return n},t.trim=function(r){for(var t=r.length,e=0;e<t&&g(r[e]);)e=e+1|0;for(var n=t-1|0;n>=e&&g(r[n]);)n=n-1|0;return n>=e?v(r,e,1+(n-e|0)|0):c},t.escaped=function(r){for(var t=0,e=0,n=r.length;e<n;++e){var o=r[e];t=t+(o>=32?o>92||o<34?o>=127?4:1:o>91||o<35?2:1:o>=11?13!==o?4:2:o>=8?2:4)|0}if(t===r.length)return l(r);var i=a.create(t);t=0;for(var u=0,s=r.length;u<s;++u){var f=r[u],c=0;if(f>=35)92!==f?f>=127?c=1:i[t]=f:c=2;else if(f>=32)f>=34?c=2:i[t]=f;else if(f>=14)c=1;else switch(f){case 8:i[t]=92,i[t=t+1|0]=98;break;case 9:i[t]=92,i[t=t+1|0]=116;break;case 10:i[t]=92,i[t=t+1|0]=110;break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:c=1;break;case 13:i[t]=92,i[t=t+1|0]=114}switch(c){case 1:i[t]=92,i[t=t+1|0]=48+(f/100|0)|0,i[t=t+1|0]=48+(f/10|0)%10|0,i[t=t+1|0]=48+f%10|0;break;case 2:i[t]=92,i[t=t+1|0]=f}t=t+1|0}return i},t.index=function(r,t){return b(r,r.length,0,t)},t.index_opt=function(r,t){return A(r,r.length,0,t)},t.rindex=function(r,t){return S(r,r.length-1|0,t)},t.rindex_opt=function(r,t){return T(r,r.length-1|0,t)},t.index_from=function(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from / Bytes.index_from",Error:new Error};return b(r,n,t,e)},t.index_from_opt=function(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from_opt / Bytes.index_from_opt",Error:new Error};return A(r,n,t,e)},t.rindex_from=function(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from / Bytes.rindex_from",Error:new Error};return S(r,t,e)},t.rindex_from_opt=function(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from_opt / Bytes.rindex_from_opt",Error:new Error};return T(r,t,e)},t.contains=function(r,t){return E(r,0,t)},t.contains_from=E,t.rcontains_from=function(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rcontains_from / Bytes.rcontains_from",Error:new Error};try{return S(r,t,e),!0}catch(r){var n=u.internalToOCamlException(r);if("Not_found"===n.RE_EXN_ID)return!1;throw n}},t.uppercase_ascii=function(r){return h(o.uppercase_ascii,r)},t.lowercase_ascii=function(r){return h(o.lowercase_ascii,r)},t.capitalize_ascii=function(r){return y(o.uppercase_ascii,r)},t.uncapitalize_ascii=function(r){return y(o.lowercase_ascii,r)},t.compare=x,t.equal=G,t.unsafe_to_string=w,t.unsafe_of_string=D},51958:(r,t)=>{"use strict";function e(r,t){return r[1]===t[1]&&r[0]===t[0]}function n(r,t){var e=t[0],n=r[0];return n>e||!(n<e)&&r[1]>=t[1]}function o(r,t){return r[0]>t[0]||!(r[0]<t[0])&&r[1]>t[1]}t.int_compare=function(r,t){return r<t?-1:r===t?0:1},t.bool_compare=function(r,t){return r?t?0:1:t?-1:0},t.float_compare=function(r,t){return r===t?0:r<t?-1:r>t||r==r?1:t==t?-1:0},t.string_compare=function(r,t){return r===t?0:r<t?-1:1},t.bool_min=function(r,t){return r?t:r},t.int_min=function(r,t){return r<t?r:t},t.float_min=function(r,t){return r<t?r:t},t.string_min=function(r,t){return r<t?r:t},t.bool_max=function(r,t){return r||t},t.int_max=function(r,t){return r>t?r:t},t.float_max=function(r,t){return r>t?r:t},t.string_max=function(r,t){return r>t?r:t},t.i64_eq=e,t.i64_neq=function(r,t){return!e(r,t)},t.i64_lt=function(r,t){return!n(r,t)},t.i64_gt=o,t.i64_le=function(r,t){return!o(r,t)},t.i64_ge=n,t.i64_min=function(r,t){return n(r,t)?t:r},t.i64_max=function(r,t){return o(r,t)?r:t}},9438:(r,t)=>{"use strict";t.dup=function(r){return r.slice(0)},t.sub=function(r,t,e){for(var n=new Array(e),o=0,i=t;o<e;)n[o]=r[i],o=o+1|0,i=i+1|0;return n},t.concat=function(r){var t=function(r,t){for(;;){var e=t,n=r;if(!e)return n;t=e.tl,r=e.hd.length+n|0}}(0,r),e=new Array(t);return function(r,t,e){for(;;){var n=e,o=t;if(!n)return;for(var i=n.hd,a=i.length,u=o,s=0;s<a;)r[u]=i[s],u=u+1|0,s=s+1|0;e=n.tl,t=u}}(e,0,r),e},t.make=function(r,t){for(var e=new Array(r),n=0;n<r;++n)e[n]=t;return e},t.make_float=function(r){for(var t=new Array(r),e=0;e<r;++e)t[e]=0;return t},t.blit=function(r,t,e,n,o){if(n<=t)for(var i=0;i<o;++i)e[i+n|0]=r[i+t|0];else for(var a=o-1|0;a>=0;--a)e[a+n|0]=r[a+t|0]},t.get=function(r,t){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[t]},t.set=function(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[t]=e}},50382:(r,t)=>{"use strict";function e(r,t,e,n,o){for(;;){var i=e;if(i>=n)return o;var a=r[i],u=t[i];if(a>u)return 1;if(a<u)return-1;e=i+1|0}}function n(r,t){var n=r.length,o=t.length;return n===o?e(r,t,0,n,0):n<o?e(r,t,0,n,-1):e(r,t,0,o,1)}t.create=function(r){if(r<0)throw{RE_EXN_ID:"Invalid_argument",_1:"String.create",Error:new Error};for(var t=new Array(r),e=0;e<r;++e)t[e]=0;return t},t.get=function(r,t){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r[t]},t.set=function(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};r[t]=e},t.bytes_compare=n,t.bytes_greaterthan=function(r,t){return n(r,t)>0},t.bytes_greaterequal=function(r,t){return n(r,t)>=0},t.bytes_lessthan=function(r,t){return n(r,t)<0},t.bytes_lessequal=function(r,t){return n(r,t)<=0},t.bytes_equal=function(r,t){var e=r.length;if(e!==t.length)return!1;for(var n=0;;){var o=n;if(o===e)return!0;if(r[o]!==t[o])return!1;n=o+1|0}}},22525:(r,t)=>{"use strict";var e={contents:0};t.id=e,t.create=function(r){return e.contents=e.contents+1|0,r+"/"+e.contents},t.is_extension=function(r){return null!=r&&"string"==typeof r.RE_EXN_ID},t.exn_slot_name=function(r){return r.RE_EXN_ID}},80612:(r,t,e)=>{"use strict";var n=e(51958),o=e(70159);function i(r){return r>=65?r>=97?r>=123?-1:r-87|0:r>=91?-1:r-55|0:r>57||r<48?-1:r-48|0}function a(r){switch(r){case 0:return 8;case 1:return 16;case 2:return 10;case 3:return 2}}function u(r){var t=1,e=2,n=0;switch(r.codePointAt(n)){case 43:n=n+1|0;break;case 44:break;case 45:t=-1,n=n+1|0}if(48===r.codePointAt(n)){var o=r.codePointAt(n+1|0);if(o>=89)if(o>=111){if(o<121)switch(o){case 111:e=0,n=n+2|0;break;case 117:n=n+2|0;break;case 112:case 113:case 114:case 115:case 116:case 118:case 119:break;case 120:e=1,n=n+2|0}}else 98===o&&(e=3,n=n+2|0);else if(66!==o){if(o>=79)switch(o){case 79:e=0,n=n+2|0;break;case 85:n=n+2|0;break;case 80:case 81:case 82:case 83:case 84:case 86:case 87:break;case 88:e=1,n=n+2|0}}else e=3,n=n+2|0}return[n,t,e]}function s(r){return r>=65&&r<=90||r>=192&&r<=214||r>=216&&r<=222?r+32|0:r}function f(r){var t=r.length;if(t>31)throw{RE_EXN_ID:"Invalid_argument",_1:"format_int: format too long",Error:new Error};for(var e={justify:"+",signstyle:"-",filter:" ",alternate:!1,base:2,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},n=0;;){var o=n;if(o>=t)return e;var i=r.codePointAt(o),a=0;if(i>=69)if(i>=88)if(i>=121)a=1;else switch(i){case 88:e.base=1,e.uppercase=!0,n=o+1|0;continue;case 101:case 102:case 103:a=5;break;case 100:case 105:a=4;break;case 111:e.base=0,n=o+1|0;continue;case 117:e.base=2,n=o+1|0;continue;case 89:case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:case 98:case 99:case 104:case 106:case 107:case 108:case 109:case 110:case 112:case 113:case 114:case 115:case 116:case 118:case 119:a=1;break;case 120:e.base=1,n=o+1|0;continue}else{if(!(i>=72)){e.signedconv=!0,e.uppercase=!0,e.conv=String.fromCharCode(s(i)),n=o+1|0;continue}a=1}else switch(i){case 35:e.alternate=!0,n=o+1|0;continue;case 32:case 43:a=2;break;case 45:e.justify="-",n=o+1|0;continue;case 46:e.prec=0;for(var u=o+1|0;function(t){return function(){var e=r.codePointAt(t)-48|0;return e>=0&&e<=9}}(u)();)e.prec=(Math.imul(e.prec,10)+r.codePointAt(u)|0)-48|0,u=u+1|0;n=u;continue;case 33:case 34:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 47:default:a=1;break;case 48:e.filter="0",n=o+1|0;continue;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a=3}switch(a){case 1:n=o+1|0;continue;case 2:e.signstyle=String.fromCharCode(i),n=o+1|0;continue;case 3:e.width=0;for(var f=o;function(t){return function(){var e=r.codePointAt(t)-48|0;return e>=0&&e<=9}}(f)();)e.width=(Math.imul(e.width,10)+r.codePointAt(f)|0)-48|0,f=f+1|0;n=f;continue;case 4:e.signedconv=!0,e.base=2,n=o+1|0;continue;case 5:e.signedconv=!0,e.conv=String.fromCharCode(i),n=o+1|0;continue}}}function c(r,t){var e=r.justify,n=r.signstyle,o=r.filter,i=r.alternate,a=r.base,u=r.signedconv,s=r.width,f=r.uppercase,c=r.sign,l=t.length;u&&(c<0||"-"!==n)&&(l=l+1|0),i&&(0===a?l=l+1|0:1===a&&(l=l+2|0));var m="";if("+"===e&&" "===o)for(var p=l;p<s;++p)m+=o;if(u&&(c<0?m+="-":"-"!==n&&(m+=n)),i&&0===a&&(m+="0"),i&&1===a&&(m+="0x"),"+"===e&&"0"===o)for(var v=l;v<s;++v)m+=o;if(m=f?m+t.toUpperCase():m+t,"-"===e)for(var d=l;d<s;++d)m+=" ";return m}t.format_float=function(r,t){var e=f(r),n=e.prec<0?6:e.prec,o=t<0?(e.sign=-1,-t):t,i="";if(isNaN(o))i="nan",e.filter=" ";else if(isFinite(o))switch(e.conv){case"e":var a=(i=o.toExponential(n)).length;101===i.codePointAt(a-3|0)&&(i=i.slice(0,a-1|0)+"0"+i.slice(a-1|0));break;case"f":i=o.toFixed(n);break;case"g":var u=0!==n?n:1,s=(i=o.toExponential(u-1|0)).indexOf("e"),l=0|Number(i.slice(s+1|0));if(l<-4||o>=1e21||o.toFixed().length>u){for(var m=s-1|0;48===i.codePointAt(m);)m=m-1|0;46===i.codePointAt(m)&&(m=m-1|0);var p=(i=i.slice(0,m+1|0)+i.slice(s)).length;101===i.codePointAt(p-3|0)&&(i=i.slice(0,p-1|0)+"0"+i.slice(p-1|0))}else{var v=u;if(l<0)v=v-(l+1|0)|0,i=o.toFixed(v);else for(;(i=o.toFixed(v)).length>(u+1|0);)v=v-1|0;if(0!==v){for(var d=i.length-1|0;48===i.codePointAt(d);)d=d-1|0;46===i.codePointAt(d)&&(d=d-1|0),i=i.slice(0,d+1|0)}}}else i="inf",e.filter=" ";return c(e,i)},t.hexstring_of_float=function(r,t,e){if(!isFinite(r))return isNaN(r)?"nan":r>0?"infinity":"-infinity";var n=0==r&&1/r==-1/0?1:r>=0?0:1;n&&(r=-r);var o=0;if(0==r);else if(r<1)for(;r<1&&o>-1022;)r*=2,o--;else for(;r>=2;)r/=2,o++;var i=o<0?"":"+",a="";if(n)a="-";else switch(e){case 43:a="+";break;case 32:a=" "}if(t>=0&&t<13){var u=Math.pow(2,4*t);r=Math.round(r*u)/u}var s=r.toString(16);if(t>=0){var f=s.indexOf(".");if(f<0)s+="."+"0".repeat(t);else{var c=f+1+t;s.length<c?s+="0".repeat(c-s.length):s=s.substr(0,c)}}return a+"0x"+s+"p"+i+o.toString(10)},t.format_int=function(r,t){if("%d"===r)return String(t);var e=f(r),n=(t<0?e.signedconv?(e.sign=-1,-t>>>0):t>>>0:t).toString(function(r){switch(r){case 0:return 8;case 1:return 16;case 2:return 10}}(e.base));if(e.prec>=0){e.filter=" ";var o=e.prec-n.length|0;o>0&&(n="0".repeat(o)+n)}return c(e,n)},t.float_of_string=function(r){return function(r,t){var e=+r;if(r.length>0&&e==e)return e;if(e=+(r=r.replace(/_/g,"")),r.length>0&&e==e||/^[+-]?nan$/i.test(r))return e;var n=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)p([+-]?[0-9]+)/i.exec(r);if(n){var o=n[3].replace(/0+$/,""),i=parseInt(n[1]+n[2]+o,16),a=(0|n[4])-4*o.length;return i*Math.pow(2,a)}if(/^\+?inf(inity)?$/i.test(r))return 1/0;if(/^-inf(inity)?$/i.test(r))return-1/0;throw{RE_EXN_ID:"Failure",_1:"float_of_string"}}(r)},t.int64_format=function(r,t){if("%d"===r)return o.to_string(t);var e,i,a=f(r),u=a.signedconv&&n.i64_lt(t,o.zero)?(a.sign=-1,o.neg(t)):t;switch(a.base){case 0:e=function(r){var t="",e=[0,8],i="01234567";if(n.i64_lt(r,o.zero)){var a=o.discard_sign(r),u=o.div_mod(a,e),s=o.add([268435456,0],u[0]),f=u[1];for(t=i[o.to_int32(f)]+t;n.i64_neq(s,o.zero);){var c=o.div_mod(s,e);s=c[0],f=c[1],t=i[o.to_int32(f)]+t}}else{var l=o.div_mod(r,e),m=l[0],p=l[1];for(t=i[o.to_int32(p)]+t;n.i64_neq(m,o.zero);){var v=o.div_mod(m,e);m=v[0],p=v[1],t=i[o.to_int32(p)]+t}}return t}(u);break;case 1:e=o.to_hex(u);break;case 2:e=function(r){if(!n.i64_lt(r,o.zero))return o.to_string(r);var t=[0,10],e=o.discard_sign(r),i=o.div_mod(e,t),a=o.div_mod(o.add([0,8],i[1]),t),u=o.add(o.add([214748364,3435973836],i[0]),a[0]);return o.to_string(u)+"0123456789"[o.to_int32(a[1])]}(u)}if(a.prec>=0){a.filter=" ";var s=a.prec-e.length|0;i=s>0?"0".repeat(s)+e:e}else i=e;return c(a,i)},t.int_of_string=function(r){var t=u(r),e=t[0],n=a(t[2]),o=r.length,s=i(e<o?r.codePointAt(e):0);if(s<0||s>=n)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var f=t[1]*function(t,e){for(;;){var a=e,u=t;if(a===o)return u;var s=r.codePointAt(a);if(95!==s){var f=i(s);if(f<0||f>=n)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};var c=n*u+f;if(c>4294967295)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};e=a+1|0,t=c}else e=a+1|0}}(s,e+1|0),c=0|f;if(10===n&&f!==c)throw{RE_EXN_ID:"Failure",_1:"int_of_string",Error:new Error};return c},t.int64_of_string=function(r){var t,e=u(r),s=e[2],f=e[0],c=o.of_int32(a(s)),l=o.of_int32(e[1]);switch(s){case 0:t=[536870911,4294967295];break;case 1:t=[268435455,4294967295];break;case 2:t=[429496729,2576980377];break;case 3:t=o.max_int}var m=r.length,p=f<m?r.codePointAt(f):0,v=o.of_int32(i(p));if(n.i64_lt(v,o.zero)||n.i64_ge(v,c))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};var d=o.mul(l,function(e,a){for(;;){var u=a,s=e;if(u===m)return s;var f=r.codePointAt(u);if(95!==f){var l=o.of_int32(i(f));if(n.i64_lt(l,o.zero)||n.i64_ge(l,c)||n.i64_gt(s,t))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};a=u+1|0,e=o.add(o.mul(c,s),l)}else a=u+1|0}}(v,f+1|0)),_=o.or_(d,o.zero);if(n.i64_eq(c,[0,10])&&n.i64_neq(d,_))throw{RE_EXN_ID:"Failure",_1:"int64_of_string",Error:new Error};return _}},17266:(r,t)=>{"use strict";t.div=function(r,t){if(0===t)throw{RE_EXN_ID:"Division_by_zero",Error:new Error};return r/t|0},t.mod_=function(r,t){if(0===t)throw{RE_EXN_ID:"Division_by_zero",Error:new Error};return r%t}},70159:(r,t,e)=>{"use strict";var n=e(51958),o=[-2147483648,0],i=[2147483647,4294967295],a=[0,1],u=[0,0],s=[-1,4294967295];function f(r){return 0!=(-2147483648&r)}function c(r){return 0==(-2147483648&r)}function l(r){var t=1+(-1^r[1])|0;return[(-1^r[0])+(0===t?1:0)|0,t>>>0]}function m(r,t,e){var n=r[1],o=n+t|0,i=f(n)&&(f(t)||c(o))||f(t)&&c(o)?1:0;return[r[0]+e+i|0,o>>>0]}function p(r,t){return m(r,t[1],t[0])}function v(r,t,e){var n=1+(-1^t)>>>0;return m(r,n,(-1^e)+(0===n?1:0)|0)}function d(r,t){return v(r,t[1],t[0])}function _(r,t){if(0===t)return r;var e=r[1];return t>=32?[e<<(t-32|0),0]:[e>>>(32-t|0)|r[0]<<t,e<<t>>>0]}function g(r,t){if(0===t)return r;var e=r[0];return t<32?[e>>t,(e<<(32-t|0)|r[1]>>>t)>>>0]:[e>=0?0:-1,e>>(t-32|0)>>>0]}function h(r){return 0===r[0]&&0===r[1]}function y(r,t){for(;;){var e,n=t,i=r,a=i[0],s=0,f=0,c=0;if(0!==a)c=4;else{if(0===i[1])return u;c=4}if(4===c)if(0!==n[0])f=3;else{if(0===n[1])return u;f=3}if(3===f&&(-2147483648!==a||0!==i[1]?s=2:e=n[1]),2===s){var m=n[0],p=i[1],v=0;if(-2147483648!==m||0!==n[1]?v=3:e=p,3===v){var d=n[1];if(a<0){if(m>=0)return l(y(l(i),n));t=l(n),r=l(i);continue}if(m<0)return l(y(i,l(n)));var _=65535&a,g=p>>>16,h=65535&p,b=65535&m,A=d>>>16,S=65535&d,T=0,E=0,x=0,G=h*S;return T=(E=(E=(x=(G>>>16)+g*S)>>>16)+((x=(65535&x)+h*A)>>>16)+_*S)>>>16,T+=(E=(65535&E)+g*A)>>>16,T+=(E=(65535&E)+h*b)>>>16,[(E&=65535)|(T=T+((a>>>16)*S+_*A+g*b+h*(m>>>16))&65535)<<16,(65535&G|(65535&x)<<16)>>>0]}}return 0==(1&e)?u:o}}function b(r){return 4294967296*r[0]+r[1]}function A(r){return isNaN(r)||!isFinite(r)?u:r<=-0x8000000000000000?o:r+1>=0x8000000000000000?i:r<0?l(A(-r)):[r/4294967296|0,(r%4294967296|0)>>>0]}function S(r,t){for(;;){var e=t,i=r,f=i[0],c=0;if(0===e[0]&&0===e[1])throw{RE_EXN_ID:"Division_by_zero",Error:new Error};if(-2147483648!==f)if(0!==f)c=1;else{if(0===i[1])return u;c=1}else if(0!==i[1])c=1;else{if(n.i64_eq(e,a)||n.i64_eq(e,s))return i;if(n.i64_eq(e,o))return a;var m=_(S(g(i,1),e),1),v=0;if(0!==m[0])v=3;else{if(0===m[1])return e[0]<0?a:l(a);v=3}if(3===v)return p(m,S(d(i,y(e,m)),e))}if(1===c){var T=e[0],E=0;if(-2147483648!==T)E=2;else{if(0===e[1])return u;E=2}if(2===E){if(f<0){if(T>=0)return l(S(l(i),e));t=l(e),r=l(i);continue}if(T<0)return l(S(i,l(e)));for(var x=u,G=i;n.i64_ge(G,e);){for(var w=Math.floor(b(G)/b(e)),D=1>w?1:w,k=Math.ceil(Math.log(D)/Math.LN2),O=k<=48?1:Math.pow(2,k-48),M=A(D),F=y(M,e);F[0]<0||n.i64_gt(F,G);)F=y(M=A(D-=O),e);h(M)&&(M=a),x=p(x,M),G=d(G,F)}return x}}}}t.mk=function(r,t){return[t,r>>>0]},t.succ=function(r){var t=r[1]+1|0;return[r[0]+(0===t?1:0)|0,t>>>0]},t.min_int=o,t.max_int=i,t.one=a,t.zero=u,t.neg_one=s,t.of_int32=function(r){return[r<0?-1:0,r>>>0]},t.to_int32=function(r){return 0|r[1]},t.add=p,t.neg=l,t.sub=d,t.lsl_=_,t.lsr_=function(r,t){if(0===t)return r;var e=r[0],n=t-32|0;return 0===n?[0,e>>>0]:n>0?[0,e>>>n]:[e>>>t,(e<<(0|-n)|r[1]>>>t)>>>0]},t.asr_=g,t.is_zero=h,t.mul=y,t.xor=function(r,t){return[r[0]^t[0],(r[1]^t[1])>>>0]},t.or_=function(r,t){return[r[0]|t[0],(r[1]|t[1])>>>0]},t.and_=function(r,t){return[r[0]&t[0],(r[1]&t[1])>>>0]},t.equal=function(r,t){return r[1]===t[1]&&r[0]===t[0]},t.equal_null=function(r,t){return null!==t&&n.i64_eq(r,t)},t.equal_undefined=function(r,t){return void 0!==t&&n.i64_eq(r,t)},t.equal_nullable=function(r,t){return null!=t&&n.i64_eq(r,t)},t.to_float=b,t.of_float=A,t.div=S,t.mod_=function(r,t){return d(r,y(S(r,t),t))},t.compare=function(r,t){var e=t[0],n=r[0],o=n<e?-1:n===e?0:1;if(0!==o)return o;var i=t[1],a=r[1];return a<i?-1:a===i?0:1},t.float_of_bits=function(r){return t=r[1],e=r[0],new Float64Array(new Int32Array([t,e]).buffer)[0];var t,e},t.bits_of_float=function(r){var t=function(r){return new Int32Array(new Float64Array([r]).buffer)}(r);return[t[1],t[0]>>>0]},t.div_mod=function(r,t){var e=S(r,t);return[e,d(r,y(e,t))]},t.to_hex=function(r){var t=r[1],e=r[0],n=function(r){return(r>>>0).toString(16)};if(0===e&&0===t)return"0";if(0===t)return n(e)+"00000000";if(0===e)return n(t);var o=n(t),i=8-o.length|0;return i<=0?n(e)+o:n(e)+("0".repeat(i)+o)},t.discard_sign=function(r){return[2147483647&r[0],r[1]]},t.to_string=function r(t){if(function(r){var t=r[0],e=t>>21;return 0===e||-1===e&&!(0===r[1]&&-2097152===t)}(t))return String(b(t));if(t[0]<0)return n.i64_eq(t,o)?"-9223372036854775808":"-"+r(l(t));var e=A(Math.floor(b(t)/10)),i=e[1],a=e[0],u=v(v(t,i<<3,i>>>29|a<<3),i<<1,i>>>31|a<<1),s=u[1],f=u[0];if(0===s&&0===f)return r(e)+"0";if(f<0){var c=1+(-1^s)>>>0,p=Math.ceil(c/10),d=10*p-c;return r(v(e,0|p,0))+String(0|d)}var _=Math.floor(s/10),g=s-10*_;return r(m(e,0|_,0))+String(0|g)}},20114:(r,t,e)=>{"use strict";var n=e(5890),o=e(22525),i="JsError";t.$$Error=i,t.internalToOCamlException=function(r){return o.is_extension(r)?r:{RE_EXN_ID:"JsError",_1:r}},t.as_js_exn=function(r){if(r.RE_EXN_ID===i)return n.some(r._1)}},7569:(r,t)=>{"use strict";function e(r,t,e,n,o,i){var a=((t+r|0)+n|0)+i|0;return(a<<o|a>>>(32-o|0)|0)+e|0}function n(r,t,n,o,i,a,u){return e(t&n|(-1^t)&o,r,t,i,a,u)}function o(r,t,n,o,i,a,u){return e(t&o|n&(-1^o),r,t,i,a,u)}function i(r,t,n,o,i,a,u){return e(t^n^o,r,t,i,a,u)}function a(r,t,n,o,i,a,u){return e(n^(t|-1^o),r,t,i,a,u)}function u(r,t){var e=r[0],u=r[1],s=r[2],f=r[3];e=n(e,u,s,f,t[0],7,-680876936),f=n(f,e,u,s,t[1],12,-389564586),s=n(s,f,e,u,t[2],17,606105819),u=n(u,s,f,e,t[3],22,-1044525330),e=n(e,u,s,f,t[4],7,-176418897),f=n(f,e,u,s,t[5],12,1200080426),s=n(s,f,e,u,t[6],17,-1473231341),u=n(u,s,f,e,t[7],22,-45705983),e=n(e,u,s,f,t[8],7,1770035416),f=n(f,e,u,s,t[9],12,-1958414417),s=n(s,f,e,u,t[10],17,-42063),u=n(u,s,f,e,t[11],22,-1990404162),e=n(e,u,s,f,t[12],7,1804603682),f=n(f,e,u,s,t[13],12,-40341101),s=n(s,f,e,u,t[14],17,-1502002290),e=o(e,u=n(u,s,f,e,t[15],22,1236535329),s,f,t[1],5,-165796510),f=o(f,e,u,s,t[6],9,-1069501632),s=o(s,f,e,u,t[11],14,643717713),u=o(u,s,f,e,t[0],20,-373897302),e=o(e,u,s,f,t[5],5,-701558691),f=o(f,e,u,s,t[10],9,38016083),s=o(s,f,e,u,t[15],14,-660478335),u=o(u,s,f,e,t[4],20,-405537848),e=o(e,u,s,f,t[9],5,568446438),f=o(f,e,u,s,t[14],9,-1019803690),s=o(s,f,e,u,t[3],14,-187363961),u=o(u,s,f,e,t[8],20,1163531501),e=o(e,u,s,f,t[13],5,-1444681467),f=o(f,e,u,s,t[2],9,-51403784),s=o(s,f,e,u,t[7],14,1735328473),e=i(e,u=o(u,s,f,e,t[12],20,-1926607734),s,f,t[5],4,-378558),f=i(f,e,u,s,t[8],11,-2022574463),s=i(s,f,e,u,t[11],16,1839030562),u=i(u,s,f,e,t[14],23,-35309556),e=i(e,u,s,f,t[1],4,-1530992060),f=i(f,e,u,s,t[4],11,1272893353),s=i(s,f,e,u,t[7],16,-155497632),u=i(u,s,f,e,t[10],23,-1094730640),e=i(e,u,s,f,t[13],4,681279174),f=i(f,e,u,s,t[0],11,-358537222),s=i(s,f,e,u,t[3],16,-722521979),u=i(u,s,f,e,t[6],23,76029189),e=i(e,u,s,f,t[9],4,-640364487),f=i(f,e,u,s,t[12],11,-421815835),s=i(s,f,e,u,t[15],16,530742520),e=a(e,u=i(u,s,f,e,t[2],23,-995338651),s,f,t[0],6,-198630844),f=a(f,e,u,s,t[7],10,1126891415),s=a(s,f,e,u,t[14],15,-1416354905),u=a(u,s,f,e,t[5],21,-57434055),e=a(e,u,s,f,t[12],6,1700485571),f=a(f,e,u,s,t[3],10,-1894986606),s=a(s,f,e,u,t[10],15,-1051523),u=a(u,s,f,e,t[1],21,-2054922799),e=a(e,u,s,f,t[8],6,1873313359),f=a(f,e,u,s,t[15],10,-30611744),s=a(s,f,e,u,t[6],15,-1560198380),u=a(u,s,f,e,t[13],21,1309151649),e=a(e,u,s,f,t[4],6,-145523070),f=a(f,e,u,s,t[11],10,-1120210379),s=a(s,f,e,u,t[2],15,718787259),u=a(u,s,f,e,t[9],21,-343485551),r[0]=e+r[0]|0,r[1]=u+r[1]|0,r[2]=s+r[2]|0,r[3]=f+r[3]|0}var s=[1732584193,-271733879,-1732584194,271733878],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];t.md5_string=function(r,t,e){var n=r.slice(t,e),o=n.length;s[0]=1732584193,s[1]=-271733879,s[2]=-1732584194,s[3]=271733878;for(var i=0;i<=15;++i)f[i]=0;for(var a=o/64|0,c=1;c<=a;++c){for(var l=0;l<=15;++l){var m=((c<<6)-64|0)+(l<<2)|0;f[l]=((n.charCodeAt(m)+(n.charCodeAt(m+1|0)<<8)|0)+(n.charCodeAt(m+2|0)<<16)|0)+(n.charCodeAt(m+3|0)<<24)|0}u(s,f)}for(var p=n.slice(a<<6),v=0;v<=15;++v)f[v]=0;for(var d=p.length-1|0,_=0;_<=d;++_)f[_/4|0]=f[_/4|0]|p.charCodeAt(_)<<(_%4<<3);var g=d+1|0;if(f[g/4|0]=f[g/4|0]|128<<(g%4<<3),g>55){u(s,f);for(var h=0;h<=15;++h)f[h]=0}return f[14]=o<<3,u(s,f),String.fromCharCode(255&s[0],s[0]>>8&255,s[0]>>16&255,s[0]>>24&255,255&s[1],s[1]>>8&255,s[1]>>16&255,s[1]>>24&255,255&s[2],s[2]>>8&255,s[2]>>16&255,s[2]>>24&255,255&s[3],s[3]>>8&255,s[3]>>16&255,s[3]>>24&255)}},2434:(r,t,e)=>{"use strict";var n=e(51958),o=function(r,t){for(var e in r)t(e)};function i(r,t){if(r===t)return 0;var e=typeof r,o=typeof t;switch(e){case"boolean":if("boolean"===o)return n.bool_compare(r,t);break;case"function":if("function"===o)throw{RE_EXN_ID:"Invalid_argument",_1:"compare: functional value",Error:new Error};break;case"number":if("number"===o)return n.int_compare(r,t);break;case"string":return"string"===o?n.string_compare(r,t):1;case"undefined":return-1}switch(o){case"string":return-1;case"undefined":return 1;default:if("boolean"===e)return 1;if("boolean"===o)return-1;if("function"===e)return 1;if("function"===o)return-1;if("number"===e)return null===t||void 0!==t.BS_PRIVATE_NESTED_SOME_NONE?1:-1;if("number"===o)return null===r||void 0!==r.BS_PRIVATE_NESTED_SOME_NONE?-1:1;if(null===r)return void 0!==t.BS_PRIVATE_NESTED_SOME_NONE?1:-1;if(null===t)return void 0!==r.BS_PRIVATE_NESTED_SOME_NONE?-1:1;if(void 0!==r.BS_PRIVATE_NESTED_SOME_NONE)return void 0!==t.BS_PRIVATE_NESTED_SOME_NONE?a(r,t):-1;var u=0|r.TAG,s=0|t.TAG;if(248===u)return n.int_compare(r[1],t[1]);if(251===u)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: abstract value",Error:new Error};if(u!==s)return u<s?-1:1;var f=0|r.length,c=0|t.length;if(f===c){if(!Array.isArray(r))return r instanceof Date&&t instanceof Date?r-t:a(r,t);for(var l=0;;){var m=l;if(m===f)return 0;var p=i(r[m],t[m]);if(0!==p)return p;l=m+1|0}}else if(f<c)for(var v=0;;){var d=v;if(d===f)return-1;var _=i(r[d],t[d]);if(0!==_)return _;v=d+1|0}else for(var g=0;;){var h=g;if(h===c)return 1;var y=i(r[h],t[h]);if(0!==y)return y;g=h+1|0}}}function a(r,t){var e={contents:void 0},a={contents:void 0},u=function(r,t){var e=r[2],n=r[1];if(!Object.prototype.hasOwnProperty.call(n,t)||i(r[0][t],n[t])>0){var o=e.contents;return void 0!==o&&t>=o?void 0:void(e.contents=t)}},s=[r,t,a],f=[t,r,e];o(r,(function(r){return u(s,r)})),o(t,(function(r){return u(f,r)}));var c=e.contents,l=a.contents;return void 0!==c?void 0!==l?n.string_compare(c,l):-1:void 0!==l?1:0}function u(r,t){if(r===t)return!0;var e=typeof r;if("string"===e||"number"===e||"boolean"===e||"undefined"===e||null===r)return!1;var n=typeof t;if("function"===e||"function"===n)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if("number"===n||"undefined"===n||null===t)return!1;var i=0|r.TAG,a=0|t.TAG;if(248===i)return r[1]===t[1];if(251===i)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: abstract value",Error:new Error};if(i!==a)return!1;var s=0|r.length;if(s!==(0|t.length))return!1;if(!Array.isArray(r)){if(r instanceof Date&&t instanceof Date)return!(r>t||r<t);var f={contents:!0};return o(r,(function(r){Object.prototype.hasOwnProperty.call(t,r)||(f.contents=!1)})),f.contents&&o(t,(function(e){Object.prototype.hasOwnProperty.call(r,e)&&u(t[e],r[e])||(f.contents=!1)})),f.contents}for(var c=0;;){var l=c;if(l===s)return!0;if(!u(r[l],t[l]))return!1;c=l+1|0}}t.obj_dup=function(r){if(Array.isArray(r)){for(var t=r.length,e=new Array(t),n=0;n<t;++n)e[n]=r[n];return void 0!==r.TAG&&(e.TAG=r.TAG),e}return Object.assign({},r)},t.update_dummy=function(r,t){if(Array.isArray(t)){for(e=0;e<t.length;++e)r[e]=t[e];void 0!==t.TAG&&(r.TAG=t.TAG)}else for(var e in t)r[e]=t[e]},t.compare=i,t.equal=u,t.equal_null=function(r,t){return null!==t?u(r,t):r===t},t.equal_undefined=function(r,t){return void 0!==t?u(r,t):r===t},t.equal_nullable=function(r,t){return null==t?r===t:u(r,t)},t.notequal=function(r,t){return!u(r,t)},t.greaterequal=function(r,t){return i(r,t)>=0},t.greaterthan=function(r,t){return i(r,t)>0},t.lessthan=function(r,t){return i(r,t)<0},t.lessequal=function(r,t){return i(r,t)<=0},t.min=function(r,t){return i(r,t)<=0?r:t},t.max=function(r,t){return i(r,t)>=0?r:t}},5890:(r,t)=>{"use strict";function e(r){return void 0===r?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==r&&void 0!==r.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:r.BS_PRIVATE_NESTED_SOME_NONE+1|0}:r}function n(r){if(null===r||void 0===r.BS_PRIVATE_NESTED_SOME_NONE)return r;var t=r.BS_PRIVATE_NESTED_SOME_NONE;return 0===t?void 0:{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}t.nullable_to_opt=function(r){return null==r?void 0:e(r)},t.undefined_to_opt=function(r){return void 0===r?void 0:e(r)},t.null_to_opt=function(r){return null===r?void 0:e(r)},t.valFromOption=n,t.some=e,t.isNested=function(r){return void 0!==r.BS_PRIVATE_NESTED_SOME_NONE},t.option_get=function(r){return void 0===r?void 0:n(r)},t.option_unwrap=function(r){return void 0!==r?r.VAL:r}},89875:(r,t)=>{"use strict";t.spliceApply=function(r,t){var e,n;n=t.length;var o=[];for(e=0;e<n-1;++e)o.push(t[e]);var i=t[n-1];for(e=0;e<i.length;++e)o.push(i[e]);return r.apply(null,o)},t.spliceNewApply=function(r,t){var e,n;n=t.length;var o=[null];for(e=0;e<n-1;++e)o.push(t[e]);var i=t[n-1];for(e=0;e<i.length;++e)o.push(i[e]);return new(Function.prototype.bind.apply(r,o))},t.spliceObjApply=function(r,t,e){var n,o;o=e.length;var i=[];for(n=0;n<o-1;++n)i.push(e[n]);var a=e[o-1];for(n=0;n<a.length;++n)i.push(a[n]);return r[t].apply(r,i)}},29468:(r,t)=>{"use strict";t.get=function(r,t){if(t>=r.length||t<0)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return r.codePointAt(t)},t.make=function(r,t){return String.fromCharCode(t).repeat(r)}},77267:(r,t)=>{"use strict";t.sys_getenv=function(r){if("undefined"==typeof process||void 0===process.env)throw{RE_EXN_ID:"Not_found",Error:new Error};var t=process.env[r];if(void 0!==t)return t;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.sys_time=function(r){return"undefined"==typeof process||void 0===process.uptime?-1:process.uptime()},t.os_type=function(r){return"undefined"!=typeof process&&"win32"===process.platform?"Win32":"Unix"},t.sys_getcwd=function(r){return"undefined"==typeof process||void 0===process.cwd?"/":process.cwd()},t.sys_get_argv=function(r){if("undefined"==typeof process)return["",[""]];var t=process.argv;return null==t?["",[""]]:[t[0],t]},t.sys_exit=function(r){if("undefined"!=typeof process)return process.exit(r)},t.sys_is_directory=function(r){throw{RE_EXN_ID:"Failure",_1:"sys_is_directory not implemented",Error:new Error}},t.sys_file_exists=function(r){throw{RE_EXN_ID:"Failure",_1:"sys_file_exists not implemented",Error:new Error}}},61008:(r,t,e)=>{"use strict";var n=e(29085);t.chr=function(r){if(r<0||r>255)throw{RE_EXN_ID:"Invalid_argument",_1:"Char.chr",Error:new Error};return r},t.escaped=function(r){var t=0;if(r>=40){if(92===r)return"\\\\";t=r>=127?1:2}else if(r>=32){if(r>=39)return"\\'";t=2}else if(r>=14)t=1;else switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:t=1;break;case 13:return"\\r"}switch(t){case 1:var e=[0,0,0,0];return e[0]=92,e[1]=48+(r/100|0)|0,e[2]=48+(r/10|0)%10|0,e[3]=48+r%10|0,n.to_string(e);case 2:var o=[0];return o[0]=r,n.to_string(o)}},t.lowercase=function(r){return r>=65&&r<=90||r>=192&&r<=214||r>=216&&r<=222?r+32|0:r},t.uppercase=function(r){return r>=97&&r<=122||r>=224&&r<=246||r>=248&&r<=254?r-32|0:r},t.lowercase_ascii=function(r){return r>=65&&r<=90?r+32|0:r},t.uppercase_ascii=function(r){return r>=97&&r<=122?r-32|0:r},t.compare=function(r,t){return r-t|0},t.equal=function(r,t){return 0==(r-t|0)}},10456:(r,t,e)=>{"use strict";var n=e(9438);function o(r,t){for(;;){var e=t,i=r,a=i.length,u=0===a?1:a,s=u-e.length|0;if(0===s)return i.apply(null,e);if(s>=0)return function(r,t){return function(e){return o(r,t.concat([e]))}}(i,e);t=n.sub(e,u,0|-s),r=i.apply(null,n.sub(e,0,u))}}function i(r,t){var e=r.length;if(1===e)return r(t);switch(e){case 1:return r(t);case 2:return function(e){return r(t,e)};case 3:return function(e,n){return r(t,e,n)};case 4:return function(e,n,o){return r(t,e,n,o)};case 5:return function(e,n,o,i){return r(t,e,n,o,i)};case 6:return function(e,n,o,i,a){return r(t,e,n,o,i,a)};case 7:return function(e,n,o,i,a,u){return r(t,e,n,o,i,a,u)};default:return o(r,[t])}}function a(r,t,e){var n=r.length;if(2===n)return r(t,e);switch(n){case 1:return o(r(t),[e]);case 2:return r(t,e);case 3:return function(n){return r(t,e,n)};case 4:return function(n,o){return r(t,e,n,o)};case 5:return function(n,o,i){return r(t,e,n,o,i)};case 6:return function(n,o,i,a){return r(t,e,n,o,i,a)};case 7:return function(n,o,i,a,u){return r(t,e,n,o,i,a,u)};default:return o(r,[t,e])}}function u(r,t,e,n){var i=r.length;if(3===i)return r(t,e,n);switch(i){case 1:return o(r(t),[e,n]);case 2:return o(r(t,e),[n]);case 3:return r(t,e,n);case 4:return function(o){return r(t,e,n,o)};case 5:return function(o,i){return r(t,e,n,o,i)};case 6:return function(o,i,a){return r(t,e,n,o,i,a)};case 7:return function(o,i,a,u){return r(t,e,n,o,i,a,u)};default:return o(r,[t,e,n])}}function s(r,t,e,n,i){var a=r.length;if(4===a)return r(t,e,n,i);switch(a){case 1:return o(r(t),[e,n,i]);case 2:return o(r(t,e),[n,i]);case 3:return o(r(t,e,n),[i]);case 4:return r(t,e,n,i);case 5:return function(o){return r(t,e,n,i,o)};case 6:return function(o,a){return r(t,e,n,i,o,a)};case 7:return function(o,a,u){return r(t,e,n,i,o,a,u)};default:return o(r,[t,e,n,i])}}function f(r,t,e,n,i,a){var u=r.length;if(5===u)return r(t,e,n,i,a);switch(u){case 1:return o(r(t),[e,n,i,a]);case 2:return o(r(t,e),[n,i,a]);case 3:return o(r(t,e,n),[i,a]);case 4:return o(r(t,e,n,i),[a]);case 5:return r(t,e,n,i,a);case 6:return function(o){return r(t,e,n,i,a,o)};case 7:return function(o,u){return r(t,e,n,i,a,o,u)};default:return o(r,[t,e,n,i,a])}}function c(r,t,e,n,i,a,u){var s=r.length;if(6===s)return r(t,e,n,i,a,u);switch(s){case 1:return o(r(t),[e,n,i,a,u]);case 2:return o(r(t,e),[n,i,a,u]);case 3:return o(r(t,e,n),[i,a,u]);case 4:return o(r(t,e,n,i),[a,u]);case 5:return o(r(t,e,n,i,a),[u]);case 6:return r(t,e,n,i,a,u);case 7:return function(o){return r(t,e,n,i,a,u,o)};default:return o(r,[t,e,n,i,a,u])}}function l(r,t,e,n,i,a,u,s){var f=r.length;if(7===f)return r(t,e,n,i,a,u,s);switch(f){case 1:return o(r(t),[e,n,i,a,u,s]);case 2:return o(r(t,e),[n,i,a,u,s]);case 3:return o(r(t,e,n),[i,a,u,s]);case 4:return o(r(t,e,n,i),[a,u,s]);case 5:return o(r(t,e,n,i,a),[u,s]);case 6:return o(r(t,e,n,i,a,u),[s]);case 7:return r(t,e,n,i,a,u,s);default:return o(r,[t,e,n,i,a,u,s])}}function m(r,t,e,n,i,a,u,s,f){var c=r.length;if(8===c)return r(t,e,n,i,a,u,s,f);switch(c){case 1:return o(r(t),[e,n,i,a,u,s,f]);case 2:return o(r(t,e),[n,i,a,u,s,f]);case 3:return o(r(t,e,n),[i,a,u,s,f]);case 4:return o(r(t,e,n,i),[a,u,s,f]);case 5:return o(r(t,e,n,i,a),[u,s,f]);case 6:return o(r(t,e,n,i,a,u),[s,f]);case 7:return o(r(t,e,n,i,a,u,s),[f]);default:return o(r,[t,e,n,i,a,u,s,f])}}t.app=o,t._1=i,t.__1=function(r){return 1===r.length?r:function(t){return i(r,t)}},t._2=a,t.__2=function(r){return 2===r.length?r:function(t,e){return a(r,t,e)}},t._3=u,t.__3=function(r){return 3===r.length?r:function(t,e,n){return u(r,t,e,n)}},t._4=s,t.__4=function(r){return 4===r.length?r:function(t,e,n,o){return s(r,t,e,n,o)}},t._5=f,t.__5=function(r){return 5===r.length?r:function(t,e,n,o,i){return f(r,t,e,n,o,i)}},t._6=c,t.__6=function(r){return 6===r.length?r:function(t,e,n,o,i,a){return c(r,t,e,n,o,i,a)}},t._7=l,t.__7=function(r){return 7===r.length?r:function(t,e,n,o,i,a,u){return l(r,t,e,n,o,i,a,u)}},t._8=m,t.__8=function(r){return 8===r.length?r:function(t,e,n,o,i,a,u,s){return m(r,t,e,n,o,i,a,u,s)}}},23271:(r,t,e)=>{"use strict";var n=e(61008),o=e(29085),i=e(10971),a=e(7569),u=e(50382),s=e(29468);function f(r){return a.md5_string(r,0,r.length)}function c(r,t,e){if(t<0||e<0||t>(r.length-e|0))throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.substring",Error:new Error};return a.md5_string(r,t,e)}function l(r){return r+(r<10?48:87)|0}var m=i.compare,p=i.equal;t.compare=m,t.equal=p,t.string=f,t.bytes=function(r){return f(o.unsafe_to_string(r))},t.substring=c,t.subbytes=function(r,t,e){return c(o.unsafe_to_string(r),t,e)},t.to_hex=function(r){if(16!==r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.to_hex",Error:new Error};for(var t=u.create(32),e=0;e<=15;++e){var n=s.get(r,e);t[e<<1]=l(n>>>4),t[1+(e<<1)|0]=l(15&n)}return o.unsafe_to_string(t)},t.from_hex=function(r){if(32!==r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};for(var t=function(r){if(r>=65){if(r>=97){if(r>=103)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-97|0)|0}if(r>=71)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return 10+(r-65|0)|0}if(r>57||r<48)throw{RE_EXN_ID:"Invalid_argument",_1:"Digest.from_hex",Error:new Error};return r-48|0},e=function(e){return(t(s.get(r,e))<<4)+t(s.get(r,e+1|0))|0},i=u.create(16),a=0;a<=15;++a)u.set(i,a,n.chr(e(a<<1)));return o.unsafe_to_string(i)}},59125:(r,t,e)=>{"use strict";var n=e(51958),o=e(80612),i=e(20114),a=n.int_compare;t.zero=0,t.one=1,t.minus_one=-1,t.succ=function(r){return r+1|0},t.pred=function(r){return r-1|0},t.abs=function(r){return r>=0?r:0|-r},t.max_int=2147483647,t.min_int=-2147483648,t.lognot=function(r){return-1^r},t.of_string_opt=function(r){try{return o.int_of_string(r)}catch(r){var t=i.internalToOCamlException(r);if("Failure"===t.RE_EXN_ID)return;throw t}},t.to_string=function(r){return o.format_int("%d",r)},t.compare=a,t.equal=function(r,t){return r===t}},72880:(r,t,e)=>{"use strict";var n=e(51958),o=e(70159),i=e(80612),a=e(20114),u=o.compare,s=o.equal,f=o.zero,c=o.one,l=o.neg_one,m=o.succ,p=o.max_int,v=o.min_int,d=o.to_string;t.zero=f,t.one=c,t.minus_one=l,t.succ=m,t.pred=function(r){return o.sub(r,o.one)},t.abs=function(r){return n.i64_ge(r,o.zero)?r:o.neg(r)},t.max_int=p,t.min_int=v,t.lognot=function(r){return o.xor(r,o.neg_one)},t.of_string_opt=function(r){try{return i.int64_of_string(r)}catch(r){var t=a.internalToOCamlException(r);if("Failure"===t.RE_EXN_ID)return;throw t}},t.to_string=d,t.compare=u,t.equal=s},91413:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(89875);t.copyWithin=function(r,t){return t.copyWithin(r)},t.copyWithinFrom=function(r,t,e){return e.copyWithin(r,t)},t.copyWithinFromRange=function(r,t,e,n){return n.copyWithin(r,t,e)},t.fillInPlace=function(r,t){return t.fill(r)},t.fillFromInPlace=function(r,t,e){return e.fill(r,t)},t.fillRangeInPlace=function(r,t,e,n){return n.fill(r,t,e)},t.push=function(r,t){return t.push(r)},t.pushMany=function(r,t){return i.spliceObjApply(t,"push",[r])},t.sortInPlaceWith=function(r,t){return t.sort(n.__2(r))},t.spliceInPlace=function(r,t,e,n){return i.spliceObjApply(n,"splice",[r,t,e])},t.removeFromInPlace=function(r,t){return t.splice(r)},t.removeCountInPlace=function(r,t,e){return e.splice(r,t)},t.unshift=function(r,t){return t.unshift(r)},t.unshiftMany=function(r,t){return i.spliceObjApply(t,"unshift",[r])},t.concat=function(r,t){return t.concat(r)},t.concatMany=function(r,t){return i.spliceObjApply(t,"concat",[r])},t.includes=function(r,t){return t.includes(r)},t.indexOf=function(r,t){return t.indexOf(r)},t.indexOfFrom=function(r,t,e){return e.indexOf(r,t)},t.joinWith=function(r,t){return t.join(r)},t.lastIndexOf=function(r,t){return t.lastIndexOf(r)},t.lastIndexOfFrom=function(r,t,e){return e.lastIndexOf(r,t)},t.slice=function(r,t,e){return e.slice(r,t)},t.sliceFrom=function(r,t){return t.slice(r)},t.every=function(r,t){return t.every(n.__1(r))},t.everyi=function(r,t){return t.every(n.__2(r))},t.filter=function(r,t){return t.filter(n.__1(r))},t.filteri=function(r,t){return t.filter(n.__2(r))},t.find=function(r,t){return o.undefined_to_opt(t.find(n.__1(r)))},t.findi=function(r,t){return o.undefined_to_opt(t.find(n.__2(r)))},t.findIndex=function(r,t){return t.findIndex(n.__1(r))},t.findIndexi=function(r,t){return t.findIndex(n.__2(r))},t.forEach=function(r,t){t.forEach(n.__1(r))},t.forEachi=function(r,t){t.forEach(n.__2(r))},t.map=function(r,t){return t.map(n.__1(r))},t.mapi=function(r,t){return t.map(n.__2(r))},t.reduce=function(r,t,e){return e.reduce(n.__2(r),t)},t.reducei=function(r,t,e){return e.reduce(n.__3(r),t)},t.reduceRight=function(r,t,e){return e.reduceRight(n.__2(r),t)},t.reduceRighti=function(r,t,e){return e.reduceRight(n.__3(r),t)},t.some=function(r,t){return t.some(n.__1(r))},t.somei=function(r,t){return t.some(n.__2(r))}},11126:(r,t)=>{"use strict";t.$$Error="JsError",t.raiseError=function(r){throw new Error(r)},t.raiseEvalError=function(r){throw new EvalError(r)},t.raiseRangeError=function(r){throw new RangeError(r)},t.raiseReferenceError=function(r){throw new ReferenceError(r)},t.raiseSyntaxError=function(r){throw new SyntaxError(r)},t.raiseTypeError=function(r){throw new TypeError(r)},t.raiseUriError=function(r){throw new URIError(r)}},19905:(r,t)=>{"use strict";t.equal=function(r,t){return r===t},t.max=2147483647,t.min=-2147483648},65436:(r,t,e)=>{"use strict";var n=e(19905);function o(r){return r>n.max?n.max:r<n.min?n.min:Math.ceil(r)}function i(r){return r>n.max?n.max:r<n.min?n.min:Math.floor(r)}var a=o,u=i;t.unsafe_ceil=function(r){return Math.ceil(r)},t.ceil_int=o,t.ceil=a,t.unsafe_floor=function(r){return Math.floor(r)},t.floor_int=i,t.floor=u,t.random_int=function(r,t){return i(Math.random()*(t-r|0))+r|0}},41724:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(89875);t.charAt=function(r,t){return t.charAt(r)},t.charCodeAt=function(r,t){return t.charCodeAt(r)},t.codePointAt=function(r,t){return t.codePointAt(r)},t.concat=function(r,t){return t.concat(r)},t.concatMany=function(r,t){return i.spliceObjApply(t,"concat",[r])},t.endsWith=function(r,t){return t.endsWith(r)},t.endsWithFrom=function(r,t,e){return e.endsWith(r,t)},t.includes=function(r,t){return t.includes(r)},t.includesFrom=function(r,t,e){return e.includes(r,t)},t.indexOf=function(r,t){return t.indexOf(r)},t.indexOfFrom=function(r,t,e){return e.indexOf(r,t)},t.lastIndexOf=function(r,t){return t.lastIndexOf(r)},t.lastIndexOfFrom=function(r,t,e){return e.lastIndexOf(r,t)},t.localeCompare=function(r,t){return t.localeCompare(r)},t.match_=function(r,t){return o.null_to_opt(t.match(r))},t.normalizeByForm=function(r,t){return t.normalize(r)},t.repeat=function(r,t){return t.repeat(r)},t.replace=function(r,t,e){return e.replace(r,t)},t.replaceByRe=function(r,t,e){return e.replace(r,t)},t.unsafeReplaceBy0=function(r,t,e){return e.replace(r,n.__3(t))},t.unsafeReplaceBy1=function(r,t,e){return e.replace(r,n.__4(t))},t.unsafeReplaceBy2=function(r,t,e){return e.replace(r,n.__5(t))},t.unsafeReplaceBy3=function(r,t,e){return e.replace(r,n.__6(t))},t.search=function(r,t){return t.search(r)},t.slice=function(r,t,e){return e.slice(r,t)},t.sliceToEnd=function(r,t){return t.slice(r)},t.split=function(r,t){return t.split(r)},t.splitAtMost=function(r,t,e){return e.split(r,t)},t.splitByRe=function(r,t){return t.split(r)},t.splitByReAtMost=function(r,t,e){return e.split(r,t)},t.startsWith=function(r,t){return t.startsWith(r)},t.startsWithFrom=function(r,t,e){return e.startsWith(r,t)},t.substr=function(r,t){return t.substr(r)},t.substrAtMost=function(r,t,e){return e.substr(r,t)},t.substring=function(r,t,e){return e.substring(r,t)},t.substringToEnd=function(r,t){return t.substring(r)},t.anchor=function(r,t){return t.anchor(r)},t.link=function(r,t){return t.link(r)}},24417:(r,t,e)=>{"use strict";var n=e(10456),o=e(77267),i=e(80612),a=e(29468),u=e(22525),s=e(20114),f=u.create("Pervasives.Exit");function c(r){for(var t=r.length,e=0;;){var n=e;if(n>=t)return r+".";var o=a.get(r,n);if(o>=48){if(o>=58)return r;e=n+1|0}else{if(45!==o)return r;e=n+1|0}}}var l={contents:function(r){}};t.invalid_arg=function(r){throw{RE_EXN_ID:"Invalid_argument",_1:r,Error:new Error}},t.failwith=function(r){throw{RE_EXN_ID:"Failure",_1:r,Error:new Error}},t.Exit=f,t.abs=function(r){return r>=0?r:0|-r},t.max_int=2147483647,t.min_int=-2147483648,t.lnot=function(r){return-1^r},t.infinity=1/0,t.neg_infinity=-1/0,t.max_float=17976931348623157e292,t.min_float=22250738585072014e-324,t.epsilon_float=2220446049250313e-31,t.classify_float=function(r){return isFinite(r)?Math.abs(r)>=22250738585072014e-324?0:0!==r?1:2:isNaN(r)?4:3},t.char_of_int=function(r){if(r<0||r>255)throw{RE_EXN_ID:"Invalid_argument",_1:"char_of_int",Error:new Error};return r},t.string_of_bool=function(r){return r?"true":"false"},t.bool_of_string=function(r){switch(r){case"false":return!1;case"true":return!0;default:throw{RE_EXN_ID:"Invalid_argument",_1:"bool_of_string",Error:new Error}}},t.bool_of_string_opt=function(r){switch(r){case"false":return!1;case"true":return!0;default:return}},t.int_of_string_opt=function(r){try{return i.int_of_string(r)}catch(r){var t=s.internalToOCamlException(r);if("Failure"===t.RE_EXN_ID)return;throw t}},t.string_of_float=function(r){return c(i.format_float("%.12g",r))},t.float_of_string_opt=function(r){try{return i.float_of_string(r)}catch(r){var t=s.internalToOCamlException(r);if("Failure"===t.RE_EXN_ID)return;throw t}},t.$at=function r(t,e){return t?{hd:t.hd,tl:r(t.tl,e)}:e},t.print_string=function(r){console.log(r)},t.print_int=function(r){console.log(String(r))},t.print_float=function(r){console.log(c(i.format_float("%.12g",r)))},t.print_newline=function(r){console.log("")},t.prerr_newline=function(r){console.error("")},t.exit=function(r){return n._1(l.contents,void 0),o.sys_exit(r)},t.at_exit=function(r){var t=l.contents;l.contents=function(e){n._1(r,void 0),n._1(t,void 0)}},t.valid_float_lexem=c},43036:(r,t,e)=>{"use strict";var n=e(51958),o=e(76738),i=e(59125),a=e(72880),u=e(23271),s=e(9438),f=e(70159),c=e(29468);function l(r){return[Math.floor(2147483647*Math.random())]}function m(r,t){o.blit(t.st,0,r.st,0,55),r.idx=t.idx}function p(r,t){for(var e=function(r,t){return u.string(r+String(t))},n=0===t.length?[0]:t,o=n.length,i=0;i<=54;++i)s.set(r.st,i,i);for(var a,f="x",l=0,m=54+(55>o?55:o)|0;l<=m;++l){var p=l%55,v=l%o;f=e(f,s.get(n,v)),s.set(r.st,p,1073741823&(s.get(r.st,p)^(a=f,((c.get(a,0)+(c.get(a,1)<<8)|0)+(c.get(a,2)<<16)|0)+(c.get(a,3)<<24)|0)))}r.idx=0}function v(r){var t={st:s.make(55,0),idx:0};return p(t,r),t}function d(r){var t={st:s.make(55,0),idx:0};return m(t,r),t}function _(r){r.idx=(r.idx+1|0)%55;var t=s.get(r.st,r.idx),e=1073741823&(s.get(r.st,(r.idx+24|0)%55)+(t^t>>>25&31)|0);return s.set(r.st,r.idx,e),e}function g(r,t){if(t>1073741823||t<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int",Error:new Error};for(;;){var e=_(r),n=e%t;if((e-n|0)<=(1+(1073741823-t|0)|0))return n}}function h(r,t){if(t<=0)throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int32",Error:new Error};for(;;){var e=_(r)|(1&_(r))<<30,n=e%t;if((e-n|0)<=(1+(i.max_int-t|0)|0))return n}}function y(r,t){if(n.i64_le(t,f.zero))throw{RE_EXN_ID:"Invalid_argument",_1:"Random.int64",Error:new Error};for(;;){var e=f.of_int32(_(r)),o=f.lsl_(f.of_int32(_(r)),30),i=f.lsl_(f.of_int32(7&_(r)),60),u=f.or_(e,f.or_(o,i)),s=f.mod_(u,t);if(!n.i64_gt(f.sub(u,s),f.add(f.sub(a.max_int,t),f.one)))return s}}function b(r){return(_(r)/1073741824+_(r))/1073741824}function A(r){return 0==(1&_(r))}var S={st:[987910699,495797812,364182224,414272206,318284740,990407751,383018966,270373319,840823159,24560019,536292337,512266505,189156120,730249596,143776328,51606627,140166561,366354223,1003410265,700563762,981890670,913149062,526082594,1021425055,784300257,667753350,630144451,949649812,48546892,415514493,258888527,511570777,89983870,283659902,308386020,242688715,482270760,865188196,1027664170,207196989,193777847,619708188,671350186,149669678,257044018,87658204,558145612,183450813,28133145,901332182,710253903,510646120,652377910,409934019,801085050],idx:0};function T(r){p(S,r)}var E={make:v,make_self_init:function(r){return v(l())},copy:d,bits:_,$$int:g,int32:h,int64:y,$$float:function(r,t){return b(r)*t},bool:A};t.init=function(r){p(S,[r])},t.full_init=T,t.self_init=function(r){T(l())},t.bits=function(r){return _(S)},t.$$int=function(r){return g(S,r)},t.int32=function(r){return h(S,r)},t.int64=function(r){return y(S,r)},t.$$float=function(r){return b(S)*r},t.bool=function(r){return A(S)},t.State=E,t.get_state=function(r){return d(S)},t.set_state=function(r){m(S,r)}},10971:(r,t,e)=>{"use strict";var n=e(51958),o=e(29085),i=e(10456),a=e(30776),u=e(29468),s=e(20114);function f(r,t,e){return o.unsafe_to_string(o.sub(o.unsafe_of_string(r),t,e))}function c(r){return r>13||r<9?32===r:11!==r}function l(r,t,e,n){for(;;){var o=e;if(o>=t)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.codePointAt(o)===n)return o;e=o+1|0}}function m(r,t,e,n){for(;;){var o=e;if(o>=t)return;if(r.codePointAt(o)===n)return o;e=o+1|0}}function p(r,t,e){for(;;){var n=t;if(n<0)throw{RE_EXN_ID:"Not_found",Error:new Error};if(r.codePointAt(n)===e)return n;t=n-1|0}}function v(r,t,e){for(;;){var n=t;if(n<0)return;if(r.codePointAt(n)===e)return n;t=n-1|0}}function d(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from",Error:new Error};try{return l(r,n,t,e),!0}catch(r){var o=s.internalToOCamlException(r);if("Not_found"===o.RE_EXN_ID)return!1;throw o}}var _=n.string_compare,g=u.make,h=o.blit_string;t.make=g,t.init=function(r,t){return o.unsafe_to_string(o.init(r,t))},t.sub=f,t.blit=h,t.concat=function(r,t){return a.toArray(t).join(r)},t.iter=function(r,t){for(var e=0,n=t.length;e<n;++e)i._1(r,t.codePointAt(e))},t.iteri=function(r,t){for(var e=0,n=t.length;e<n;++e)i._2(r,e,t.codePointAt(e))},t.map=function(r,t){return o.unsafe_to_string(o.map(r,o.unsafe_of_string(t)))},t.mapi=function(r,t){return o.unsafe_to_string(o.mapi(r,o.unsafe_of_string(t)))},t.trim=function(r){return""===r||!c(r.codePointAt(0))&&!c(r.codePointAt(r.length-1|0))?r:o.unsafe_to_string(o.trim(o.unsafe_of_string(r)))},t.escaped=function(r){return function(t){for(;;){var e=t;if(e>=r.length)return!1;var n=r.codePointAt(e);if(n<32)return!0;if(n>92||n<34){if(n>=127)return!0;t=e+1|0}else{if(n>91||n<35)return!0;t=e+1|0}}}(0)?o.unsafe_to_string(o.escaped(o.unsafe_of_string(r))):r},t.index=function(r,t){return l(r,r.length,0,t)},t.index_opt=function(r,t){return m(r,r.length,0,t)},t.rindex=function(r,t){return p(r,r.length-1|0,t)},t.rindex_opt=function(r,t){return v(r,r.length-1|0,t)},t.index_from=function(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from / Bytes.index_from",Error:new Error};return l(r,n,t,e)},t.index_from_opt=function(r,t,e){var n=r.length;if(t<0||t>n)throw{RE_EXN_ID:"Invalid_argument",_1:"String.index_from_opt / Bytes.index_from_opt",Error:new Error};return m(r,n,t,e)},t.rindex_from=function(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from / Bytes.rindex_from",Error:new Error};return p(r,t,e)},t.rindex_from_opt=function(r,t,e){if(t<-1||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rindex_from_opt / Bytes.rindex_from_opt",Error:new Error};return v(r,t,e)},t.contains=function(r,t){return d(r,0,t)},t.contains_from=d,t.rcontains_from=function(r,t,e){if(t<0||t>=r.length)throw{RE_EXN_ID:"Invalid_argument",_1:"String.rcontains_from / Bytes.rcontains_from",Error:new Error};try{return p(r,t,e),!0}catch(r){var n=s.internalToOCamlException(r);if("Not_found"===n.RE_EXN_ID)return!1;throw n}},t.uppercase_ascii=function(r){return o.unsafe_to_string(o.uppercase_ascii(o.unsafe_of_string(r)))},t.lowercase_ascii=function(r){return o.unsafe_to_string(o.lowercase_ascii(o.unsafe_of_string(r)))},t.capitalize_ascii=function(r){return o.unsafe_to_string(o.capitalize_ascii(o.unsafe_of_string(r)))},t.uncapitalize_ascii=function(r){return o.unsafe_to_string(o.uncapitalize_ascii(o.unsafe_of_string(r)))},t.compare=_,t.equal=function(r,t){return r===t},t.split_on_char=function(r,t){for(var e=0,n=t.length,o=t.length-1|0;o>=0;--o)t.codePointAt(o)===r&&(e={hd:f(t,o+1|0,(n-o|0)-1|0),tl:e},n=o);return{hd:f(t,0,n),tl:e}}},35829:r=>{"use strict";var t="function"==typeof Float32Array?Float32Array:void 0;r.exports=t},92356:(r,t,e)=>{"use strict";var n,o=e(51716),i=e(35829),a=e(85944);n=o()?i:a,r.exports=n},85944:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},10024:r=>{"use strict";var t="function"==typeof Float64Array?Float64Array:void 0;r.exports=t},70554:(r,t,e)=>{"use strict";var n,o=e(87902),i=e(10024),a=e(45498);n=o()?i:a,r.exports=n},45498:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},79320:(r,t,e)=>{"use strict";var n,o=e(89033),i=e(51611),a=e(68278);n=o()?i:a,r.exports=n},51611:r=>{"use strict";var t="function"==typeof Int16Array?Int16Array:void 0;r.exports=t},68278:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},37959:(r,t,e)=>{"use strict";var n,o=e(62084),i=e(79794),a=e(90781);n=o()?i:a,r.exports=n},79794:r=>{"use strict";var t="function"==typeof Int32Array?Int32Array:void 0;r.exports=t},90781:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},48603:(r,t,e)=>{"use strict";var n,o=e(72359),i=e(29043),a=e(13985);n=o()?i:a,r.exports=n},29043:r=>{"use strict";var t="function"==typeof Int8Array?Int8Array:void 0;r.exports=t},13985:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},11683:(r,t,e)=>{"use strict";var n=e(48603),o=e(24909),i=e(40784),a=e(79320),u=e(53033),s=e(37959),f=e(20613),c=e(92356),l=[[e(70554),"Float64Array"],[c,"Float32Array"],[s,"Int32Array"],[f,"Uint32Array"],[a,"Int16Array"],[u,"Uint16Array"],[n,"Int8Array"],[o,"Uint8Array"],[i,"Uint8ClampedArray"]];r.exports=l},88088:(r,t,e)=>{"use strict";var n=e(53026);r.exports=n},53026:(r,t,e)=>{"use strict";var n=e(36892),o=e(97085);r.exports=function(r){var t,e;if(!n(r))throw new TypeError("invalid argument. Must provide a typed array. Value: `"+r+"`.");for((t={}).type=o(r),t.data=[],e=0;e<r.length;e++)t.data.push(r[e]);return t}},97085:(r,t,e)=>{"use strict";var n=e(83507),o=e(98221),i=e(36613),a=e(11683);r.exports=function(r){var t,e;for(e=0;e<a.length;e++)if(n(r,a[e][0]))return a[e][1];for(;r;){for(t=o(r),e=0;e<a.length;e++)if(t===a[e][1])return a[e][1];r=i(r)}}},53033:(r,t,e)=>{"use strict";var n,o=e(26970),i=e(6530),a=e(18345);n=o()?i:a,r.exports=n},18345:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},6530:r=>{"use strict";var t="function"==typeof Uint16Array?Uint16Array:void 0;r.exports=t},20613:(r,t,e)=>{"use strict";var n,o=e(15993),i=e(86435),a=e(25479);n=o()?i:a,r.exports=n},25479:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},86435:r=>{"use strict";var t="function"==typeof Uint32Array?Uint32Array:void 0;r.exports=t},24909:(r,t,e)=>{"use strict";var n,o=e(62837),i=e(91296),a=e(76242);n=o()?i:a,r.exports=n},76242:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},91296:r=>{"use strict";var t="function"==typeof Uint8Array?Uint8Array:void 0;r.exports=t},40784:(r,t,e)=>{"use strict";var n,o=e(75130),i=e(72743),a=e(2013);n=o()?i:a,r.exports=n},2013:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},72743:r=>{"use strict";var t="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;r.exports=t},3497:r=>{"use strict";var t="function"==typeof Float32Array?Float32Array:null;r.exports=t},51716:(r,t,e)=>{"use strict";var n=e(64439);r.exports=n},64439:(r,t,e)=>{"use strict";var n=e(13617),o=e(9918),i=e(3497);r.exports=function(){var r,t;if("function"!=typeof i)return!1;try{t=new i([1,3.14,-3.14,5e40]),r=n(t)&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===o}catch(t){r=!1}return r}},91612:r=>{"use strict";var t="function"==typeof Float64Array?Float64Array:null;r.exports=t},87902:(r,t,e)=>{"use strict";var n=e(7655);r.exports=n},7655:(r,t,e)=>{"use strict";var n=e(42840),o=e(91612);r.exports=function(){var r,t;if("function"!=typeof o)return!1;try{t=new o([1,3.14,-3.14,NaN]),r=n(t)&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}},56439:r=>{"use strict";r.exports=function(){}},30201:(r,t,e)=>{"use strict";var n=e(36771);r.exports=n},36771:(r,t,e)=>{"use strict";var n=e(56439);r.exports=function(){return"foo"===n.name}},89033:(r,t,e)=>{"use strict";var n=e(49253);r.exports=n},95748:r=>{"use strict";var t="function"==typeof Int16Array?Int16Array:null;r.exports=t},49253:(r,t,e)=>{"use strict";var n=e(92561),o=e(58397),i=e(48147),a=e(95748);r.exports=function(){var r,t;if("function"!=typeof a)return!1;try{t=new a([1,3.14,-3.14,o+1]),r=n(t)&&1===t[0]&&3===t[1]&&-3===t[2]&&t[3]===i}catch(t){r=!1}return r}},62084:(r,t,e)=>{"use strict";var n=e(98162);r.exports=n},50548:r=>{"use strict";var t="function"==typeof Int32Array?Int32Array:null;r.exports=t},98162:(r,t,e)=>{"use strict";var n=e(60466),o=e(26360),i=e(64158),a=e(50548);r.exports=function(){var r,t;if("function"!=typeof a)return!1;try{t=new a([1,3.14,-3.14,o+1]),r=n(t)&&1===t[0]&&3===t[1]&&-3===t[2]&&t[3]===i}catch(t){r=!1}return r}},72359:(r,t,e)=>{"use strict";var n=e(75992);r.exports=n},88754:r=>{"use strict";var t="function"==typeof Int8Array?Int8Array:null;r.exports=t},75992:(r,t,e)=>{"use strict";var n=e(26431),o=e(79450),i=e(34744),a=e(88754);r.exports=function(){var r,t;if("function"!=typeof a)return!1;try{t=new a([1,3.14,-3.14,o+1]),r=n(t)&&1===t[0]&&3===t[1]&&-3===t[2]&&t[3]===i}catch(t){r=!1}return r}},89563:r=>{"use strict";var t="function"==typeof Buffer?Buffer:null;r.exports=t},64749:(r,t,e)=>{"use strict";var n=e(44872);r.exports=n},44872:(r,t,e)=>{"use strict";var n=e(70410),o=e(89563);r.exports=function(){var r,t;if("function"!=typeof o)return!1;try{t="function"==typeof o.from?o.from([1,2,3,4]):new o([1,2,3,4]),r=n(t)&&1===t[0]&&2===t[1]&&3===t[2]&&4===t[3]}catch(t){r=!1}return r}},601:(r,t,e)=>{"use strict";var n=e(95570);r.exports=n},95570:r=>{"use strict";var t=Object.prototype.hasOwnProperty;r.exports=function(r,e){return null!=r&&t.call(r,e)}},85557:(r,t,e)=>{"use strict";var n=e(66528);r.exports=n},66528:r=>{"use strict";r.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},65768:(r,t,e)=>{"use strict";var n=e(30544);r.exports=n},30544:(r,t,e)=>{"use strict";var n=e(85557)();r.exports=function(){return n&&"symbol"==typeof Symbol.toStringTag}},26970:(r,t,e)=>{"use strict";var n=e(4560);r.exports=n},4560:(r,t,e)=>{"use strict";var n=e(67819),o=e(38649),i=e(47890);r.exports=function(){var r,t;if("function"!=typeof i)return!1;try{t=new i(t=[1,3.14,-3.14,o+1,o+2]),r=n(t)&&1===t[0]&&3===t[1]&&t[2]===o-2&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}},47890:r=>{"use strict";var t="function"==typeof Uint16Array?Uint16Array:null;r.exports=t},15993:(r,t,e)=>{"use strict";var n=e(23706);r.exports=n},23706:(r,t,e)=>{"use strict";var n=e(23024),o=e(82386),i=e(19002);r.exports=function(){var r,t;if("function"!=typeof i)return!1;try{t=new i(t=[1,3.14,-3.14,o+1,o+2]),r=n(t)&&1===t[0]&&3===t[1]&&t[2]===o-2&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}},19002:r=>{"use strict";var t="function"==typeof Uint32Array?Uint32Array:null;r.exports=t},62837:(r,t,e)=>{"use strict";var n=e(46544);r.exports=n},46544:(r,t,e)=>{"use strict";var n=e(37561),o=e(69872),i=e(85518);r.exports=function(){var r,t;if("function"!=typeof i)return!1;try{t=new i(t=[1,3.14,-3.14,o+1,o+2]),r=n(t)&&1===t[0]&&3===t[1]&&t[2]===o-2&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}},85518:r=>{"use strict";var t="function"==typeof Uint8Array?Uint8Array:null;r.exports=t},75130:(r,t,e)=>{"use strict";var n=e(9318);r.exports=n},9318:(r,t,e)=>{"use strict";var n=e(90023),o=e(14880);r.exports=function(){var r,t;if("function"!=typeof o)return!1;try{t=new o([-1,0,1,3.14,4.99,255,256]),r=n(t)&&0===t[0]&&0===t[1]&&1===t[2]&&3===t[3]&&5===t[4]&&255===t[5]&&255===t[6]}catch(t){r=!1}return r}},14880:r=>{"use strict";var t="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;r.exports=t},83507:(r,t,e)=>{"use strict";var n=e(75651);r.exports=n},75651:r=>{"use strict";r.exports=function(r,t){if("function"!=typeof t)throw new TypeError("invalid argument. `constructor` argument must be callable. Value: `"+t+"`.");return r instanceof t}},6177:(r,t,e)=>{"use strict";var n,o=e(42269);n=function(){return o(arguments)}(),r.exports=n},80037:(r,t,e)=>{"use strict";var n,o=e(6177),i=e(42269),a=e(87854);n=o?i:a,r.exports=n},42269:(r,t,e)=>{"use strict";var n=e(90329);r.exports=function(r){return"[object Arguments]"===n(r)}},87854:(r,t,e)=>{"use strict";var n=e(601),o=e(18987),i=e(88703),a=e(98613),u=e(82386);r.exports=function(r){return null!==r&&"object"==typeof r&&!i(r)&&"number"==typeof r.length&&a(r.length)&&r.length>=0&&r.length<=u&&n(r,"callee")&&!o(r,"callee")}},89596:(r,t,e)=>{"use strict";var n=e(43300);r.exports=n},43300:(r,t,e)=>{"use strict";var n=e(98613),o=e(71971);r.exports=function(r){return null!=r&&"function"!=typeof r&&"number"==typeof r.length&&n(r.length)&&r.length>=0&&r.length<=o}},88703:(r,t,e)=>{"use strict";var n=e(94331);r.exports=n},94331:(r,t,e)=>{"use strict";var n,o=e(90329);n=Array.isArray?Array.isArray:function(r){return"[object Array]"===o(r)},r.exports=n},79572:(r,t,e)=>{"use strict";var n=e(1874),o=e(62146),i=e(58813),a=e(50736);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},62146:(r,t,e)=>{"use strict";var n=e(58813),o=e(50736);r.exports=function(r){return n(r)||o(r)}},50736:(r,t,e)=>{"use strict";var n=e(65768),o=e(90329),i=e(25867),a=n();r.exports=function(r){return"object"==typeof r&&(r instanceof Boolean||(a?i(r):"[object Boolean]"===o(r)))}},58813:r=>{"use strict";r.exports=function(r){return"boolean"==typeof r}},25118:r=>{"use strict";var t=Boolean.prototype.toString;r.exports=t},25867:(r,t,e)=>{"use strict";var n=e(25118);r.exports=function(r){try{return n.call(r),!0}catch(r){return!1}}},70410:(r,t,e)=>{"use strict";var n=e(99734);r.exports=n},99734:(r,t,e)=>{"use strict";var n=e(93961);r.exports=function(r){return n(r)&&(r._isBuffer||r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))}},71388:(r,t,e)=>{"use strict";var n=e(31046);r.exports=n},31046:(r,t,e)=>{"use strict";var n=e(98613),o=e(19924);r.exports=function(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&n(r.length)&&r.length>=0&&r.length<=o}},51364:(r,t,e)=>{"use strict";var n;n=!e(46873).call("beep","0"),r.exports=n},18987:(r,t,e)=>{"use strict";var n=e(60428);r.exports=n},60428:(r,t,e)=>{"use strict";var n=e(94565),o=e(16305).isPrimitive,i=e(44096).isPrimitive,a=e(46873),u=e(51364);r.exports=function(r,t){var e;return null!=r&&(!(e=a.call(r,t))&&u&&n(r)?!o(t=+t)&&i(t)&&t>=0&&t<r.length:e)}},46873:r=>{"use strict";var t=Object.prototype.propertyIsEnumerable;r.exports=t},27907:(r,t,e)=>{"use strict";var n=e(45356);r.exports=n},45356:(r,t,e)=>{"use strict";var n=e(36613),o=e(90329);r.exports=function(r){if("object"!=typeof r||null===r)return!1;if(r instanceof Error)return!0;for(;r;){if("[object Error]"===o(r))return!0;r=n(r)}return!1}},13617:(r,t,e)=>{"use strict";var n=e(20448);r.exports=n},20448:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Float32Array;r.exports=function(r){return o&&r instanceof Float32Array||"[object Float32Array]"===n(r)}},42840:(r,t,e)=>{"use strict";var n=e(54790);r.exports=n},54790:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Float64Array;r.exports=function(r){return o&&r instanceof Float64Array||"[object Float64Array]"===n(r)}},13939:(r,t,e)=>{"use strict";var n=e(80338);r.exports=n},80338:(r,t,e)=>{"use strict";var n=e(98155);r.exports=function(r){return"function"===n(r)}},92561:(r,t,e)=>{"use strict";var n=e(10326);r.exports=n},10326:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Int16Array;r.exports=function(r){return o&&r instanceof Int16Array||"[object Int16Array]"===n(r)}},60466:(r,t,e)=>{"use strict";var n=e(1353);r.exports=n},1353:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Int32Array;r.exports=function(r){return o&&r instanceof Int32Array||"[object Int32Array]"===n(r)}},26431:(r,t,e)=>{"use strict";var n=e(26169);r.exports=n},26169:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Int8Array;r.exports=function(r){return o&&r instanceof Int8Array||"[object Int8Array]"===n(r)}},44096:(r,t,e)=>{"use strict";var n=e(1874),o=e(62995),i=e(1630),a=e(37817);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},14281:(r,t,e)=>{"use strict";var n=e(9918),o=e(95465),i=e(98613);r.exports=function(r){return r<n&&r>o&&i(r)}},62995:(r,t,e)=>{"use strict";var n=e(1630),o=e(37817);r.exports=function(r){return n(r)||o(r)}},37817:(r,t,e)=>{"use strict";var n=e(9765).isObject,o=e(14281);r.exports=function(r){return n(r)&&o(r.valueOf())}},1630:(r,t,e)=>{"use strict";var n=e(9765).isPrimitive,o=e(14281);r.exports=function(r){return n(r)&&o(r)}},98480:(r,t,e)=>{"use strict";var n=e(24909),o={uint16:e(53033),uint8:n};r.exports=o},49169:(r,t,e)=>{"use strict";var n=e(64709);r.exports=n},64709:(r,t,e)=>{"use strict";var n,o,i=e(98480);(o=new i.uint16(1))[0]=4660,n=52===new i.uint8(o.buffer)[0],r.exports=n},16305:(r,t,e)=>{"use strict";var n=e(1874),o=e(98264),i=e(18822),a=e(42853);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},98264:(r,t,e)=>{"use strict";var n=e(18822),o=e(42853);r.exports=function(r){return n(r)||o(r)}},42853:(r,t,e)=>{"use strict";var n=e(9765).isObject,o=e(22957);r.exports=function(r){return n(r)&&o(r.valueOf())}},18822:(r,t,e)=>{"use strict";var n=e(9765).isPrimitive,o=e(22957);r.exports=function(r){return n(r)&&o(r)}},88692:(r,t,e)=>{"use strict";var n=e(1874),o=e(70714),i=e(58646),a=e(95060);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},70714:(r,t,e)=>{"use strict";var n=e(58646),o=e(95060);r.exports=function(r){return n(r)||o(r)}},95060:(r,t,e)=>{"use strict";var n=e(44096).isObject;r.exports=function(r){return n(r)&&r.valueOf()>=0}},58646:(r,t,e)=>{"use strict";var n=e(44096).isPrimitive;r.exports=function(r){return n(r)&&r>=0}},9765:(r,t,e)=>{"use strict";var n=e(1874),o=e(31090),i=e(1257),a=e(15938);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},31090:(r,t,e)=>{"use strict";var n=e(1257),o=e(15938);r.exports=function(r){return n(r)||o(r)}},15938:(r,t,e)=>{"use strict";var n=e(65768),o=e(90329),i=e(40993),a=e(23363),u=n();r.exports=function(r){return"object"==typeof r&&(r instanceof i||(u?a(r):"[object Number]"===o(r)))}},1257:r=>{"use strict";r.exports=function(r){return"number"==typeof r}},95609:(r,t,e)=>{"use strict";var n=e(40993).prototype.toString;r.exports=n},23363:(r,t,e)=>{"use strict";var n=e(95609);r.exports=function(r){try{return n.call(r),!0}catch(r){return!1}}},93961:(r,t,e)=>{"use strict";var n=e(1874),o=e(84871),i=e(36715);n(i,"isObjectLikeArray",o(i)),r.exports=i},36715:r=>{"use strict";r.exports=function(r){return null!==r&&"object"==typeof r}},30324:(r,t,e)=>{"use strict";var n=e(16377);r.exports=n},16377:(r,t,e)=>{"use strict";var n=e(88703);r.exports=function(r){return"object"==typeof r&&null!==r&&!n(r)}},33022:(r,t,e)=>{"use strict";var n=e(52230);r.exports=n},52230:(r,t,e)=>{"use strict";var n=e(30324),o=e(13939),i=e(36613),a=e(601),u=e(90329),s=Object.prototype;r.exports=function(r){var t;return!!n(r)&&(!(t=i(r))||!a(r,"constructor")&&a(t,"constructor")&&o(t.constructor)&&"[object Function]"===u(t.constructor)&&a(t,"isPrototypeOf")&&o(t.isPrototypeOf)&&(t===s||function(r){var t;for(t in r)if(!a(r,t))return!1;return!0}(r)))}},50718:(r,t,e)=>{"use strict";var n=e(1874),o=e(87371),i=e(35407),a=e(21147);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},87371:(r,t,e)=>{"use strict";var n=e(35407),o=e(21147);r.exports=function(r){return n(r)||o(r)}},21147:(r,t,e)=>{"use strict";var n=e(44096).isObject;r.exports=function(r){return n(r)&&r.valueOf()>0}},35407:(r,t,e)=>{"use strict";var n=e(44096).isPrimitive;r.exports=function(r){return n(r)&&r>0}},94565:(r,t,e)=>{"use strict";var n=e(1874),o=e(11759),i=e(33607),a=e(44190);n(o,"isPrimitive",i),n(o,"isObject",a),r.exports=o},11759:(r,t,e)=>{"use strict";var n=e(33607),o=e(44190);r.exports=function(r){return n(r)||o(r)}},44190:(r,t,e)=>{"use strict";var n=e(65768),o=e(90329),i=e(2949),a=n();r.exports=function(r){return"object"==typeof r&&(r instanceof String||(a?i(r):"[object String]"===o(r)))}},33607:r=>{"use strict";r.exports=function(r){return"string"==typeof r}},2949:(r,t,e)=>{"use strict";var n=e(78525);r.exports=function(r){try{return n.call(r),!0}catch(r){return!1}}},78525:r=>{"use strict";var t=String.prototype.valueOf;r.exports=t},94133:(r,t,e)=>{"use strict";var n=e(99924);r.exports=n},99924:(r,t,e)=>{"use strict";var n=e(88692).isPrimitive,o=e(19924);r.exports=function(r){return null!==r&&"object"==typeof r&&n(r.length)&&r.length<=o&&"number"==typeof r.BYTES_PER_ELEMENT&&"number"==typeof r.byteOffset&&"number"==typeof r.byteLength}},30343:(r,t,e)=>{"use strict";var n=e(48603),o=e(24909),i=e(40784),a=e(79320),u=e(53033),s=e(37959),f=e(20613),c=e(92356),l=[e(70554),c,s,f,a,u,n,o,i];r.exports=l},36892:(r,t,e)=>{"use strict";var n=e(62143);r.exports=n},62143:(r,t,e)=>{"use strict";var n=e(98221),o=e(83294),i=e(36613),a=e(87902),u=e(70554),s=e(30343),f=e(13837),c=a()?i(u):l;function l(){}c="TypedArray"===o(c)?c:l,r.exports=function(r){var t,e;if("object"!=typeof r||null===r)return!1;if(r instanceof c)return!0;for(e=0;e<s.length;e++)if(r instanceof s[e])return!0;for(;r;){for(t=n(r),e=0;e<f.length;e++)if(f[e]===t)return!0;r=i(r)}return!1}},67819:(r,t,e)=>{"use strict";var n=e(9743);r.exports=n},9743:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Uint16Array;r.exports=function(r){return o&&r instanceof Uint16Array||"[object Uint16Array]"===n(r)}},23024:(r,t,e)=>{"use strict";var n=e(33882);r.exports=n},33882:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Uint32Array;r.exports=function(r){return o&&r instanceof Uint32Array||"[object Uint32Array]"===n(r)}},37561:(r,t,e)=>{"use strict";var n=e(87421);r.exports=n},87421:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Uint8Array;r.exports=function(r){return o&&r instanceof Uint8Array||"[object Uint8Array]"===n(r)}},90023:(r,t,e)=>{"use strict";var n=e(62306);r.exports=n},62306:(r,t,e)=>{"use strict";var n=e(90329),o="function"==typeof Uint8ClampedArray;r.exports=function(r){return o&&r instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===n(r)}},65201:(r,t,e)=>{"use strict";var n=e(2995);r.exports=n},2995:(r,t,e)=>{"use strict";var n=e(36892),o=e(88703),i=e(9765).isPrimitive,a=e(1570),u=e(82827);r.exports=function(r){var t,e;if(o(r)){for(t=0,e=0;e<r.length;e++){if(!i(r[e])||r[e]>1||r[e]<0)return!1;t+=r[e]}return a(t,1)<=u}if(n(r)){for(t=0,e=0;e<r.length;e++){if(r[e]>1||r[e]<0)return!1;t+=r[e]}return a(t,1)<=u}return!1}},85412:(r,t,e)=>{"use strict";var n=e(88703);r.exports=function(r){if("function"!=typeof r)throw new TypeError("invalid argument. Must provide a function. Value: `"+r+"`.");return function(t){var e,o;if(!n(t))return!1;if(0===(e=t.length))return!1;for(o=0;o<e;o++)if(!1===r(t[o]))return!1;return!0}}},84871:(r,t,e)=>{"use strict";var n=e(85412);r.exports=n},30322:(r,t,e)=>{"use strict";var n=e(1874),o=e(55081);n(o,"ndarray",e(60852)),r.exports=o},55081:r=>{"use strict";r.exports=function(r,t,e,n,o){var i,a,u,s;if(r<=0)return n;if(1===e&&1===o){if((u=r%8)>0)for(s=0;s<u;s++)n[s]=t[s];if(r<8)return n;for(s=u;s<r;s+=8)n[s]=t[s],n[s+1]=t[s+1],n[s+2]=t[s+2],n[s+3]=t[s+3],n[s+4]=t[s+4],n[s+5]=t[s+5],n[s+6]=t[s+6],n[s+7]=t[s+7];return n}for(i=e<0?(1-r)*e:0,a=o<0?(1-r)*o:0,s=0;s<r;s++)n[a]=t[i],i+=e,a+=o;return n}},60852:r=>{"use strict";r.exports=function(r,t,e,n,o,i,a){var u,s,f,c;if(r<=0)return o;if(u=n,s=a,1===e&&1===i){if((f=r%8)>0)for(c=0;c<f;c++)o[s]=t[u],u+=e,s+=i;if(r<8)return o;for(c=f;c<r;c+=8)o[s]=t[u],o[s+1]=t[u+1],o[s+2]=t[u+2],o[s+3]=t[u+3],o[s+4]=t[u+4],o[s+5]=t[u+5],o[s+6]=t[u+6],o[s+7]=t[u+7],u+=8,s+=8;return o}for(c=0;c<r;c++)o[s]=t[u],u+=e,s+=i;return o}},96322:(r,t,e)=>{"use strict";var n=e(48834).lW;r.exports=n},69579:(r,t,e)=>{"use strict";var n,o=e(64749),i=e(96322),a=e(87387);n=o()?i:a,r.exports=n},87387:r=>{"use strict";r.exports=function(){throw new Error("not implemented")}},33002:(r,t,e)=>{"use strict";var n=e(13939)(e(69579).from);r.exports=n},54451:(r,t,e)=>{"use strict";var n,o=e(33002),i=e(5061),a=e(80769);n=o?i:a,r.exports=n},5061:(r,t,e)=>{"use strict";var n=e(70410),o=e(69579);r.exports=function(r){if(!n(r))throw new TypeError("invalid argument. Must provide a Buffer. Value: `"+r+"`");return o.from(r)}},80769:(r,t,e)=>{"use strict";var n=e(70410),o=e(69579);r.exports=function(r){if(!n(r))throw new TypeError("invalid argument. Must provide a Buffer. Value: `"+r+"`");return new o(r)}},71971:r=>{"use strict";r.exports=4294967295},19924:r=>{"use strict";r.exports=9007199254740991},72376:r=>{"use strict";r.exports=.5772156649015329},83027:r=>{"use strict";r.exports=1023},69880:r=>{"use strict";r.exports=2146435072},19226:r=>{"use strict";r.exports=.6931471805599453},50574:r=>{"use strict";r.exports=-1023},42666:r=>{"use strict";r.exports=1023},49215:r=>{"use strict";r.exports=9007199254740991},90054:r=>{"use strict";r.exports=-1074},95465:(r,t,e)=>{"use strict";var n=e(40993).NEGATIVE_INFINITY;r.exports=n},30678:r=>{"use strict";r.exports=9.869604401089358},87598:r=>{"use strict";r.exports=3.141592653589793},9918:r=>{"use strict";var t=Number.POSITIVE_INFINITY;r.exports=t},71181:r=>{"use strict";r.exports=22250738585072014e-324},82827:r=>{"use strict";r.exports=1.4901161193847656e-8},61802:r=>{"use strict";r.exports=1.7320508075688772},13195:r=>{"use strict";r.exports=2.5066282746310007},58397:r=>{"use strict";r.exports=32767},48147:r=>{"use strict";r.exports=-32768},26360:r=>{"use strict";r.exports=2147483647},64158:r=>{"use strict";r.exports=-2147483648},79450:r=>{"use strict";r.exports=127},34744:r=>{"use strict";r.exports=-128},38649:r=>{"use strict";r.exports=65535},82386:r=>{"use strict";r.exports=4294967295},69872:r=>{"use strict";r.exports=255},8245:(r,t,e)=>{"use strict";var n=e(31911);r.exports=n},31911:(r,t,e)=>{"use strict";var n=e(98613);r.exports=function(r){return n(r/2)}},99041:(r,t,e)=>{"use strict";var n=e(97273);r.exports=n},97273:(r,t,e)=>{"use strict";var n=e(9918),o=e(95465);r.exports=function(r){return r===n||r===o}},98613:(r,t,e)=>{"use strict";var n=e(15623);r.exports=n},15623:(r,t,e)=>{"use strict";var n=e(95943);r.exports=function(r){return n(r)===r}},22957:(r,t,e)=>{"use strict";var n=e(67152);r.exports=n},67152:r=>{"use strict";r.exports=function(r){return r!=r}},30522:(r,t,e)=>{"use strict";var n=e(12881);r.exports=n},12881:(r,t,e)=>{"use strict";var n=e(95465);r.exports=function(r){return 0===r&&1/r===n}},72352:(r,t,e)=>{"use strict";var n=e(9210);r.exports=n},9210:(r,t,e)=>{"use strict";var n=e(8245);r.exports=function(r){return n(r>0?r-1:r+1)}},2e4:(r,t,e)=>{"use strict";var n=e(76414);r.exports=n},76414:(r,t,e)=>{"use strict";var n=e(9918);r.exports=function(r){return 0===r&&1/r===n}},32593:(r,t,e)=>{"use strict";var n=e(63865);r.exports=n},63865:r=>{"use strict";r.exports=function(r){return Math.abs(r)}},21536:(r,t,e)=>{"use strict";var n=e(25954);r.exports=n},25954:r=>{"use strict";var t=Math.ceil;r.exports=t},69116:(r,t,e)=>{"use strict";var n=e(44712),o=e(75228),i=e(87487),a=[0,0];r.exports=function(r,t){var e,u;return n(a,r),e=a[0],e&=2147483647,u=o(t),i(e|=u&=2147483648,a[1])}},2738:(r,t,e)=>{"use strict";var n=e(69116);r.exports=n},84518:(r,t,e)=>{"use strict";var n=e(22957),o=e(64469),i=e(95465),a=e(9918),u=e(74401),s=1.4426950408889634;r.exports=function(r){var t;return n(r)||r===a?r:r===i?0:r>709.782712893384?a:r<-745.1332191019411?0:r>-3.725290298461914e-9&&r<3.725290298461914e-9?1+r:(t=o(r<0?s*r-.5:s*r+.5),u(r-.6931471803691238*t,1.9082149292705877e-10*t,t))}},74401:(r,t,e)=>{"use strict";var n=e(86469),o=e(60160);r.exports=function(r,t,e){var i,a,u;return u=(i=r-t)-(a=i*i)*o(a),n(1-(t-i*u/(2-u)-r),e)}},90465:(r,t,e)=>{"use strict";var n=e(84518);r.exports=n},60160:r=>{"use strict";r.exports=function(r){return 0===r?.16666666666666602:.16666666666666602+r*(r*(6613756321437934e-20+r*(4.1381367970572385e-8*r-16533902205465252e-22))-.0027777777777015593)}},56348:(r,t,e)=>{"use strict";var n=e(22957),o=e(98613),i=e(66131),a=e(9918),u=e(56836);r.exports=function(r){return n(r)?NaN:o(r)?r<0?NaN:r<=170?u[r]:a:i(r+1)}},70059:(r,t,e)=>{"use strict";var n=e(56348);r.exports=n},95943:(r,t,e)=>{"use strict";var n=e(63458);r.exports=n},63458:r=>{"use strict";var t=Math.floor;r.exports=t},68146:(r,t,e)=>{"use strict";var n=e(22957),o=e(98613),i=e(30522),a=e(32593),u=e(95943),s=e(73012),f=e(9918),c=e(95465),l=e(87598),m=e(22773),p=e(88434),v=e(76081);r.exports=function(r){var t,e,d,_;if(o(r)&&r<0||r===c||n(r))return NaN;if(0===r)return i(r)?c:f;if(r>171.61447887182297)return f;if(r<-170.5674972726612)return 0;if((e=a(r))>33)return r>=0?m(r):(t=0==(1&(d=u(e)))?-1:1,(_=e-d)>.5&&(_=e-(d+=1)),_=e*s(l*_),t*l/(a(_)*m(e)));for(_=1;r>=3;)_*=r-=1;for(;r<0;){if(r>-1e-9)return p(r,_);_/=r,r+=1}for(;r<2;){if(r<1e-9)return p(r,_);_/=r,r+=1}return 2===r?_:_*v(r-=2)}},66131:(r,t,e)=>{"use strict";var n=e(68146);r.exports=n},77834:r=>{"use strict";r.exports=function(r){return 0===r?.08333333333334822:.08333333333334822+r*(.0034722222160545866+r*(r*(.0007873113957930937*r-.00022954996161337813)-.0026813261780578124))}},76081:r=>{"use strict";r.exports=function(r){var t,e;return 0===r?1:((r<0?-r:r)<=1?(t=1+r*(.4942148268014971+r*(.20744822764843598+r*(.04763678004571372+r*(.010421379756176158+r*(.0011913514700658638+r*(.00016011952247675185+0*r)))))),e=1+r*(.0714304917030273+r*(r*(.035823639860549865+r*(.011813978522206043+r*(r*(.0005396055804933034+-23158187332412014e-21*r)-.004456419138517973)))-.23459179571824335))):(t=0+(r=1/r)*(.00016011952247675185+r*(.0011913514700658638+r*(.010421379756176158+r*(.04763678004571372+r*(.20744822764843598+r*(.4942148268014971+1*r)))))),e=r*(.0005396055804933034+r*(r*(.011813978522206043+r*(.035823639860549865+r*(r*(.0714304917030273+1*r)-.23459179571824335)))-.004456419138517973))-23158187332412014e-21),t/e)}},88434:(r,t,e)=>{"use strict";var n=e(72376);r.exports=function(r,t){return t/((1+n*r)*r)}},22773:(r,t,e)=>{"use strict";var n=e(13195),o=e(33727),i=e(90465),a=e(77834);r.exports=function(r){var t,e,u;return t=1+(t=1/r)*a(t),e=i(r),e=r>143.01608?(u=o(r,.5*r-.25))*(u/e):o(r,r-.5)/e,n*e*t}},87982:(r,t,e)=>{"use strict";var n=e(76761);r.exports=n},76761:(r,t,e)=>{"use strict";var n=e(73799),o=e(21478);r.exports=function(r,t){var e,i,a,u;return a=(u=r*r)*u,i=u*n(u),i+=a*a*o(u),(a=1-(e=.5*u))+(1-a-e+(u*i-r*t))}},73799:r=>{"use strict";r.exports=function(r){return 0===r?.0416666666666666:.0416666666666666+r*(2480158728947673e-20*r-.001388888888887411)}},21478:r=>{"use strict";r.exports=function(r){return 0===r?-2.7557314351390663e-7:r*(2.087572321298175e-9+-11359647557788195e-27*r)-2.7557314351390663e-7}},33800:(r,t,e)=>{"use strict";var n=e(91327);r.exports=n},91327:r=>{"use strict";var t=-.16666666666666632;r.exports=function(r,e){var n,o,i;return n=.00833333333332249+(i=r*r)*(27557313707070068e-22*i-.0001984126982985795)+i*(i*i)*(1.58969099521155e-10*i-2.5050760253406863e-8),o=i*r,0===e?r+o*(t+i*n):r-(i*(.5*e-o*n)-e-o*t)}},86469:(r,t,e)=>{"use strict";var n=e(24207);r.exports=n},24207:(r,t,e)=>{"use strict";var n=e(9918),o=e(95465),i=e(83027),a=e(42666),u=e(50574),s=e(90054),f=e(22957),c=e(99041),l=e(2738),m=e(55429),p=e(85399),v=e(44712),d=e(87487),_=[0,0],g=[0,0];r.exports=function(r,t){var e,h;return 0===r||f(r)||c(r)?r:(m(_,r),t+=_[1],(t+=p(r=_[0]))<s?l(0,r):t>a?r<0?o:n:(t<=u?(t+=52,h=2220446049250313e-31):h=1,v(g,r),e=g[0],e&=2148532223,h*d(e|=t+i<<20,g[1])))}},98030:(r,t,e)=>{"use strict";var n=e(13258);r.exports=n},13258:(r,t,e)=>{"use strict";var n=e(75228),o=e(14603),i=e(22957),a=e(83027),u=e(95465),s=e(46100),f=e(18958),c=.6931471803691238,l=1.9082149292705877e-10,m=1048575;r.exports=function(r){var t,e,p,v,d,_,g,h,y,b,A;return 0===r?u:i(r)||r<0?NaN:(v=0,(e=n(r))<1048576&&(v-=54,e=n(r*=0x40000000000000)),e>=2146435072?r+r:(v+=(e>>20)-a|0,v+=(g=614244+(e&=m)&1048576|0)>>20|0,_=(r=o(r,e|1072693248^g))-1,(m&2+e)<3?0===_?0===v?0:v*c+v*l:(d=_*_*(.5-.3333333333333333*_),0===v?_-d:v*c-(d-v*l-_)):(g=e-398458|0,h=440401-e|0,p=(b=(A=(y=_/(2+_))*y)*A)*s(b),d=A*f(b)+p,(g|=h)>0?(t=.5*_*_,0===v?_-(t-y*(t+d)):v*c-(t-(y*(t+d)+v*l)-_)):0===v?_-y*(_-d):v*c-(y*(_-d)-v*l-_))))}},46100:r=>{"use strict";r.exports=function(r){return 0===r?.3999999999940942:.3999999999940942+r*(.22222198432149784+.15313837699209373*r)}},18958:r=>{"use strict";r.exports=function(r){return 0===r?.6666666666666735:.6666666666666735+r*(.2857142874366239+r*(.1818357216161805+.14798198605116586*r))}},57106:(r,t,e)=>{"use strict";var n=e(84309);r.exports=n},84309:(r,t,e)=>{"use strict";var n=e(2e4),o=e(22957),i=e(95465),a=e(9918);r.exports=function(r,t){var e,u,s,f;if(2===(e=arguments.length))return o(r)||o(t)?NaN:r===a||t===a?a:r===t&&0===r?n(r)?r:t:r>t?r:t;for(u=i,f=0;f<e;f++){if(o(s=arguments[f])||s===a)return s;(s>u||s===u&&0===s&&n(s))&&(u=s)}return u}},33727:(r,t,e)=>{"use strict";var n=e(70938);r.exports=n},49434:(r,t,e)=>{"use strict";var n=e(75228),o=e(43340),i=e(14603),a=e(83027),u=e(96383),s=1048576,f=[1,1.5],c=[0,.5849624872207642],l=[0,1.350039202129749e-8];r.exports=function(r,t,e){var m,p,v,d,_,g,h,y,b,A,S,T,E,x,G,w,D,k,O,M;return k=0,e<s&&(k-=53,e=n(t*=9007199254740992)),k+=(e>>20)-a|0,e=1072693248|(O=1048575&e|0),O<=235662?M=0:O<767610?M=1:(M=0,k+=1,e-=s),m=524288+(e>>1|536870912),_=(D=1/((t=i(t,e))+(h=f[M])))*((w=t-h)-(d=o(p=w*D,0))*(g=i(0,m+=M<<18))-d*(t-(g-h))),G=(v=p*p)*v*u(v),g=o(g=3+(v=d*d)+(G+=_*(d+p)),0),E=(S=-7.028461650952758e-9*(b=o(b=(w=d*g)+(D=_*g+(G-(g-3-v))*p),0))+.9617966939259756*(D-(b-w))+l[M])-((T=o(T=(A=.9617967009544373*b)+S+(y=c[M])+(x=k),0))-x-y-A),r[0]=T,r[1]=E,r}},76803:(r,t,e)=>{"use strict";var n=e(43340),o=e(62464);r.exports=function(r,t){var e,i,a,u,s;return e=(s=1.9259629911266175e-8*(a=t-1)-a*a*o(a)*1.4426950408889634)-((i=n(i=(u=1.4426950216293335*a)+s,0))-u),r[0]=i,r[1]=e,r}},96383:r=>{"use strict";r.exports=function(r){return 0===r?.5999999999999946:.5999999999999946+r*(.4285714285785502+r*(.33333332981837743+r*(.272728123808534+r*(.23066074577556175+.20697501780033842*r))))}},21707:r=>{"use strict";r.exports=function(r){return 0===r?.16666666666666602:.16666666666666602+r*(r*(6613756321437934e-20+r*(4.1381367970572385e-8*r-16533902205465252e-22))-.0027777777777015593)}},62464:r=>{"use strict";r.exports=function(r){return 0===r?.5:.5+r*(.25*r-.3333333333333333)}},70938:(r,t,e)=>{"use strict";var n=e(22957),o=e(72352),i=e(99041),a=e(98613),u=e(95688),s=e(32593),f=e(44712),c=e(43340),l=e(64375),m=e(95465),p=e(9918),v=e(73612),d=e(84188),_=e(34907),g=e(49434),h=e(76803),y=e(82437),b=2147483647,A=1083179008,S=1e300,T=1e-300,E=[0,0],x=[0,0];r.exports=function r(t,e){var G,w,D,k,O,M,F,I,P,N,R,C,L,V;if(n(t)||n(e))return NaN;if(f(E,e),O=E[0],0===E[1]){if(0===e)return 1;if(1===e)return t;if(-1===e)return 1/t;if(.5===e)return u(t);if(-.5===e)return 1/u(t);if(2===e)return t*t;if(3===e)return t*t*t;if(4===e)return(t*=t)*t;if(i(e))return _(t,e)}if(f(E,t),k=E[0],0===E[1]){if(0===k)return v(t,e);if(1===t)return 1;if(-1===t&&o(e))return-1;if(i(t))return t===m?r(-0,-e):e<0?0:p}if(t<0&&!1===a(e))return(t-t)/(t-t);if(D=s(t),G=k&b|0,w=O&b|0,F=O>>>31|0,M=(M=k>>>31|0)&&o(e)?-1:1,w>1105199104){if(w>1139802112)return d(t,e);if(G<1072693247)return 1===F?M*S*S:M*T*T;if(G>1072693248)return 0===F?M*S*S:M*T*T;R=h(x,D)}else R=g(x,D,G);if(N=(e-(I=c(e,0)))*R[0]+e*R[1],P=I*R[0],f(E,C=N+P),L=l(E[0]),V=l(E[1]),L>=A){if(0!=(L-A|V))return M*S*S;if(N+8008566259537294e-32>C-P)return M*S*S}else if((L&b)>=1083231232){if(0!=(L-3230714880|V))return M*T*T;if(N<=C-P)return M*T*T}return M*y(L,P,N)}},82437:(r,t,e)=>{"use strict";var n=e(75228),o=e(14603),i=e(43340),a=e(64375),u=e(86469),s=e(19226),f=e(83027),c=e(21707),l=2147483647,m=1048575,p=1048576;r.exports=function(r,t,e){var v,d,_,g,h,y,b,A,S;return S=((A=r&l|0)>>20)-f|0,b=0,A>1071644672&&(d=o(0,((b=r+(p>>S+1)>>>0)&~(m>>(S=((b&l)>>20)-f|0)))>>>0),b=(b&m|p)>>20-S>>>0,r<0&&(b=-b),t-=d),h=(g=(e-((d=i(d=e+t,0))-t))*s+-1.904654299957768e-9*d)-((y=(_=.6931471824645996*d)+g)-_),v=y-(d=y*y)*c(d),r=n(y=1-(y*v/(v-2)-(h+y*h)-y)),r=a(r),(r+=b<<20>>>0)>>20<=0?u(y,b):o(y,r)}},73612:(r,t,e)=>{"use strict";var n=e(72352),o=e(2738),i=e(95465),a=e(9918);r.exports=function(r,t){return t===i?a:t===a?0:t>0?n(t)?r:0:n(t)?o(a,r):a}},84188:(r,t,e)=>{"use strict";var n=e(75228);r.exports=function(r,t){return(2147483647&n(r))<=1072693247?t<0?1/0:0:t>0?1/0:0}},34907:(r,t,e)=>{"use strict";var n=e(32593),o=e(9918);r.exports=function(r,t){return-1===r?(r-r)/(r-r):1===r?1:n(r)<1==(t===o)?0:o}},87352:(r,t,e)=>{"use strict";var n=e(50333);r.exports=n},86186:(r,t,e)=>{"use strict";var n=e(95943),o=e(86469),i=[10680707,7228996,1387004,2578385,16069853,12639074,9804092,4427841,16666979,11263675,12935607,2387514,4345298,14681673,3074569,13734428,16653803,1880361,10960616,8533493,3062596,8710556,7349940,6258241,3772886,3769171,3798172,8675211,12450088,3874808,9961438,366607,15675153,9132554,7151469,3571407,2607881,12013382,4155038,6285869,7677882,13102053,15825725,473591,9065106,15363067,6271263,9264392,5636912,4652155,7056368,13614112,10155062,1944035,9527646,15080200,6658437,6231200,6832269,16767104,5075751,3212806,1398474,7579849,6349435,12618859],a=[1.570796251296997,7.549789415861596e-8,5390302529957765e-30,3282003415807913e-37,1270655753080676e-44,12293330898111133e-52,27337005381646456e-60,21674168387780482e-67],u=16777216,s=5.960464477539063e-8,f=p(20),c=p(20),l=p(20),m=p(20);function p(r){var t,e;for(t=[],e=0;e<r;e++)t.push(0);return t}function v(r,t,e,f,c,p,d,_,g){var h,y,b,A,S,T,E,x,G;for(A=p,G=f[e],x=e,S=0;x>0;S++)y=s*G|0,m[S]=G-u*y|0,G=f[x-1]+y,x-=1;if(G=o(G,c),G-=8*n(.125*G),G-=E=0|G,b=0,c>0?(E+=S=m[e-1]>>24-c,m[e-1]-=S<<24-c,b=m[e-1]>>23-c):0===c?b=m[e-1]>>23:G>=.5&&(b=2),b>0){for(E+=1,h=0,S=0;S<e;S++)x=m[S],0===h?0!==x&&(h=1,m[S]=16777216-x):m[S]=16777215-x;if(c>0)switch(c){case 1:m[e-1]&=8388607;break;case 2:m[e-1]&=4194303}2===b&&(G=1-G,0!==h&&(G-=o(1,c)))}if(0===G){for(x=0,S=e-1;S>=p;S--)x|=m[S];if(0===x){for(T=1;0===m[p-T];T++);for(S=e+1;S<=e+T;S++){for(g[_+S]=i[d+S],y=0,x=0;x<=_;x++)y+=r[x]*g[_+(S-x)];f[S]=y}return v(r,t,e+=T,f,c,p,d,_,g)}}if(0===G)for(e-=1,c-=24;0===m[e];)e-=1,c-=24;else(G=o(G,-c))>=u?(y=s*G|0,m[e]=G-u*y|0,c+=24,m[e+=1]=y):m[e]=0|G;for(y=o(1,c),S=e;S>=0;S--)f[S]=y*m[S],y*=s;for(S=e;S>=0;S--){for(y=0,T=0;T<=A&&T<=e-S;T++)y+=a[T]*f[S+T];l[e-S]=y}for(y=0,S=e;S>=0;S--)y+=l[S];for(t[0]=0===b?y:-y,y=l[0]-y,S=1;S<=e;S++)y+=l[S];return t[1]=0===b?y:-y,7&E}r.exports=function(r,t,e,n){var o,a,u,s,l,m,p;for((a=(e-3)/24|0)<0&&(a=0),s=e-24*(a+1),m=a-(u=n-1),p=u+4,l=0;l<=p;l++)f[l]=m<0?0:i[m],m+=1;for(l=0;l<=4;l++){for(o=0,m=0;m<=u;m++)o+=r[m]*f[u+(l-m)];c[l]=o}return v(r,t,4,c,s,4,a,u,f)}},50333:(r,t,e)=>{"use strict";var n=e(75228),o=e(88759),i=e(87487),a=e(86186),u=e(27737),s=1.5707963267341256,f=6077100506506192e-26,c=2*f,l=3*f,m=4*f,p=[0,0,0],v=[0,0];r.exports=function(r,t){var e,d,_,g,h,y,b;if((_=2147483647&n(r)|0)<=1072243195)return t[0]=r,t[1]=0,0;if(_<=1074752122)return 598523==(1048575&_)?u(r,_,t):_<=1073928572?r>0?(b=r-s,t[0]=b-f,t[1]=b-t[0]-f,1):(b=r+s,t[0]=b+f,t[1]=b-t[0]+f,-1):r>0?(b=r-2*s,t[0]=b-c,t[1]=b-t[0]-c,2):(b=r+2*s,t[0]=b+c,t[1]=b-t[0]+c,-2);if(_<=1075594811)return _<=1075183036?1074977148===_?u(r,_,t):r>0?(b=r-3*s,t[0]=b-l,t[1]=b-t[0]-l,3):(b=r+3*s,t[0]=b+l,t[1]=b-t[0]+l,-3):1075388923===_?u(r,_,t):r>0?(b=r-4*s,t[0]=b-m,t[1]=b-t[0]-m,4):(b=r+4*s,t[0]=b+m,t[1]=b-t[0]+m,-4);if(_<1094263291)return u(r,_,t);if(_>=2146435072)return t[0]=NaN,t[1]=NaN,0;for(e=o(r),b=i(_-((d=(_>>20)-1046)<<20|0),e),h=0;h<2;h++)p[h]=0|b,b=16777216*(b-p[h]);for(p[2]=b,g=3;0===p[g-1];)g-=1;return y=a(p,v,d,g,1),r<0?(t[0]=-v[0],t[1]=-v[1],-y):(t[0]=v[0],t[1]=v[1],y)}},27737:(r,t,e)=>{"use strict";var n=e(86605),o=e(75228);r.exports=function(r,t,e){var i,a,u,s,f;return u=r-1.5707963267341256*(i=n(.6366197723675814*r)),s=6077100506506192e-26*i,f=t>>20|0,e[0]=u-s,f-(o(e[0])>>20&2047)>16&&(s=20222662487959506e-37*i-((a=u)-(u=a-(s=6077100506303966e-26*i))-s),e[0]=u-s,f-(o(e[0])>>20&2047)>49&&(s=84784276603689e-45*i-((a=u)-(u=a-(s=20222662487111665e-37*i))-s),e[0]=u-s)),e[1]=u-e[0]-s,i}},86605:(r,t,e)=>{"use strict";var n=e(81406);r.exports=n},81406:r=>{"use strict";var t=Math.round;r.exports=t},73012:(r,t,e)=>{"use strict";var n=e(86118);r.exports=n},86118:(r,t,e)=>{"use strict";var n=e(75228),o=e(87982),i=e(33800),a=e(87352),u=[0,0];r.exports=function(r){var t;if(t=n(r),(t&=2147483647)<=1072243195)return t<1045430272?r:i(r,0);if(t>=2146435072)return NaN;switch(3&a(r,u)){case 0:return i(u[0],u[1]);case 1:return o(u[0],u[1]);case 2:return-i(u[0],u[1]);default:return-o(u[0],u[1])}}},95688:(r,t,e)=>{"use strict";var n=e(7831);r.exports=n},7831:r=>{"use strict";var t=Math.sqrt;r.exports=t},64469:(r,t,e)=>{"use strict";var n=e(23436);r.exports=n},23436:(r,t,e)=>{"use strict";var n=e(95943),o=e(21536);r.exports=function(r){return r<0?o(r):n(r)}},39659:(r,t,e)=>{"use strict";var n=e(94983);r.exports=n},94983:r=>{"use strict";r.exports=function(r,t){var e,n;return((e=(65535&(r>>>=0))>>>0)*(n=(65535&(t>>>=0))>>>0)>>>0)+((r>>>16>>>0)*n+e*(t>>>16>>>0)<<16>>>0)>>>0}},1570:(r,t,e)=>{"use strict";var n=e(78642);r.exports=n},78642:(r,t,e)=>{"use strict";var n=e(9918),o=e(32593),i=e(22957),a=e(99041);r.exports=function(r,t){return i(r)||i(t)?NaN:a(r)||a(t)?r===t?NaN:n:o(r-t)}},40993:(r,t,e)=>{"use strict";var n=e(80209);r.exports=n},80209:r=>{"use strict";r.exports=Number},85399:(r,t,e)=>{"use strict";var n=e(63148);r.exports=n},63148:(r,t,e)=>{"use strict";var n=e(75228),o=e(69880),i=e(83027);r.exports=function(r){var t=n(r);return(t=(t&o)>>>20)-i|0}},87487:(r,t,e)=>{"use strict";var n=e(42952);r.exports=n},60241:(r,t,e)=>{"use strict";var n,o,i;!0===e(49169)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},r.exports=n},42952:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(60241),a=new o(1),u=new n(a.buffer),s=i.HIGH,f=i.LOW;r.exports=function(r,t){return u[s]=r,u[f]=t,a[0]}},34566:(r,t,e)=>{"use strict";var n;n=!0===e(49169)?1:0,r.exports=n},75228:(r,t,e)=>{"use strict";var n=e(41);r.exports=n},41:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(34566),a=new o(1),u=new n(a.buffer);r.exports=function(r){return a[0]=r,u[i]}},88759:(r,t,e)=>{"use strict";var n=e(95807);r.exports=n},84357:(r,t,e)=>{"use strict";var n;n=!0===e(49169)?0:1,r.exports=n},95807:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(84357),a=new o(1),u=new n(a.buffer);r.exports=function(r){return a[0]=r,u[i]}},55429:(r,t,e)=>{"use strict";var n=e(8653);r.exports=n},8653:(r,t,e)=>{"use strict";var n=e(53800);r.exports=function(r,t){return 1===arguments.length?n([0,0],r):n(r,t)}},53800:(r,t,e)=>{"use strict";var n=e(71181),o=e(99041),i=e(22957),a=e(32593);r.exports=function(r,t){return i(t)||o(t)?(r[0]=t,r[1]=0,r):0!==t&&a(t)<n?(r[0]=4503599627370496*t,r[1]=-52,r):(r[0]=t,r[1]=0,r)}},50284:(r,t,e)=>{"use strict";var n;n=!0===e(49169)?1:0,r.exports=n},14603:(r,t,e)=>{"use strict";var n=e(55157);r.exports=n},55157:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(50284),a=new o(1),u=new n(a.buffer);r.exports=function(r,t){return a[0]=r,u[i]=t>>>0,a[0]}},43340:(r,t,e)=>{"use strict";var n=e(54239);r.exports=n},6482:(r,t,e)=>{"use strict";var n;n=!0===e(49169)?0:1,r.exports=n},54239:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(6482),a=new o(1),u=new n(a.buffer);r.exports=function(r,t){return a[0]=r,u[i]=t>>>0,a[0]}},44712:(r,t,e)=>{"use strict";var n=e(70977);r.exports=n},65856:(r,t,e)=>{"use strict";var n,o,i;!0===e(49169)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},r.exports=n},70977:(r,t,e)=>{"use strict";var n=e(78106);r.exports=function(r,t){return 1===arguments.length?n([0,0],r):n(r,t)}},78106:(r,t,e)=>{"use strict";var n=e(20613),o=e(70554),i=e(65856),a=new o(1),u=new n(a.buffer),s=i.HIGH,f=i.LOW;r.exports=function(r,t){return a[0]=t,r[0]=u[s],r[1]=u[f],r}},64375:(r,t,e)=>{"use strict";var n=e(36872);r.exports=n},36872:r=>{"use strict";r.exports=function(r){return 0|r}},73750:(r,t,e)=>{"use strict";var n=e(1874),o=e(67359),i=e(68949),a=e(601),u=e(33022),s=e(71388),f=e(23024),c=e(79572).isPrimitive,l=e(50718).isPrimitive,m=e(49215),p=e(82386),v=e(20613),d=e(57106),_=e(39659),g=e(30322),h=e(88088),y=e(28858),b=624,A=p>>>0,S=19650218,T=2147483648,E=2147483647,x=2636928640,G=4022730752,w=[0,2567483615],D=1/(m+1),k=67108864,O=m*D,M=630;function F(r,t){var e;return e=t?"option":"argument",r.length<631?new RangeError("invalid "+e+". `state` array has insufficient length."):1!==r[0]?new RangeError("invalid "+e+". `state` array has an incompatible schema version. Expected: 1. Actual: "+r[0]+"."):3!==r[1]?new RangeError("invalid "+e+". `state` array has an incompatible number of sections. Expected: 3. Actual: "+r[1]+"."):r[2]!==b?new RangeError("invalid "+e+". `state` array has an incompatible state length. Expected: "+b+". Actual: "+r[2]+"."):1!==r[627]?new RangeError("invalid "+e+". `state` array has an incompatible section length. Expected: "+1..toString()+". Actual: "+r[627]+"."):r[629]!==r.length-M?new RangeError("invalid "+e+". `state` array length is incompatible with seed section length. Expected: "+(r.length-M)+". Actual: "+r[629]+"."):null}function I(r,t,e){var n;for(r[0]=e>>>0,n=1;n<t;n++)e=((e=r[n-1]>>>0)^e>>>30)>>>0,r[n]=_(e,1812433253)+n>>>0;return r}function P(r,t,e,n){var o,i,a,u;for(i=1,a=0,u=d(t,n);u>0;u--)o=r[i-1]>>>0,o=_(o=(o^o>>>30)>>>0,1664525)>>>0,r[i]=(r[i]>>>0^o)+e[a]+a>>>0,a+=1,(i+=1)>=t&&(r[0]=r[t-1],i=1),a>=n&&(a=0);for(u=t-1;u>0;u--)o=r[i-1]>>>0,o=_(o=(o^o>>>30)>>>0,1566083941)>>>0,r[i]=(r[i]>>>0^o)-i>>>0,(i+=1)>=t&&(r[0]=r[t-1],i=1);return r[0]=2147483648,r}function N(r){var t,e;for(e=0;e<227;e++)t=r[e]&T|r[e+1]&E,r[e]=r[e+397]^t>>>1^w[1&t];for(;e<623;e++)t=r[e]&T|r[e+1]&E,r[e]=r[e-227]^t>>>1^w[1&t];return t=r[623]&T|r[0]&E,r[623]=r[396]^t>>>1^w[1&t],r}r.exports=function(r){var t,e,m,d,_,T;if(m={},arguments.length){if(!u(r))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+r+"`.");if(a(r,"copy")&&(m.copy=r.copy,!c(r.copy)))throw new TypeError("invalid option. `copy` option must be a boolean. Option: `"+r.copy+"`.");if(a(r,"state")){if(e=r.state,m.state=!0,!f(e))throw new TypeError("invalid option. `state` option must be a Uint32Array. Option: `"+e+"`.");if(T=F(e,!0))throw T;!1===m.copy?t=e:(t=new v(e.length),g(e.length,e,1,t,1)),e=new v(t.buffer,t.byteOffset+3*t.BYTES_PER_ELEMENT,b),d=new v(t.buffer,t.byteOffset+630*t.BYTES_PER_ELEMENT,e[629])}if(void 0===d)if(a(r,"seed"))if(d=r.seed,m.seed=!0,l(d)){if(d>A)throw new RangeError("invalid option. `seed` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `"+d+"`.");d>>>=0}else{if(!1===s(d)||d.length<1)throw new TypeError("invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `"+d+"`.");if(1===d.length){if(d=d[0],!l(d))throw new TypeError("invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `"+d+"`.");if(d>A)throw new RangeError("invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `"+d+"`.");d>>>=0}else _=d.length,(t=new v(M+_))[0]=1,t[1]=3,t[2]=b,t[627]=1,t[628]=b,t[629]=_,g.ndarray(_,d,1,0,t,1,630),e=new v(t.buffer,t.byteOffset+3*t.BYTES_PER_ELEMENT,b),d=new v(t.buffer,t.byteOffset+630*t.BYTES_PER_ELEMENT,_),e=P(e=I(e,b,S),b,d,_)}else d=y()>>>0}else d=y()>>>0;return void 0===e&&((t=new v(631))[0]=1,t[1]=3,t[2]=b,t[627]=1,t[628]=b,t[629]=1,t[630]=d,e=new v(t.buffer,t.byteOffset+3*t.BYTES_PER_ELEMENT,b),d=new v(t.buffer,t.byteOffset+630*t.BYTES_PER_ELEMENT,1),e=I(e,b,d)),n($,"NAME","mt19937"),o($,"seed",E),o($,"seedLength",w),i($,"state",L,V),o($,"stateLength",R),o($,"byteLength",C),n($,"toJSON",j),n($,"MIN",1),n($,"MAX",p),n($,"normalized",U),n(U,"NAME",$.NAME),o(U,"seed",E),o(U,"seedLength",w),i(U,"state",L,V),o(U,"stateLength",R),o(U,"byteLength",C),n(U,"toJSON",j),n(U,"MIN",0),n(U,"MAX",O),$;function E(){var r=t[629];return g(r,d,1,new v(r),1)}function w(){return t[629]}function R(){return t.length}function C(){return t.byteLength}function L(){var r=t.length;return g(r,t,1,new v(r),1)}function V(r){var n;if(!f(r))throw new TypeError("invalid argument. Must provide a Uint32Array. Value: `"+r+"`.");if(n=F(r,!1))throw n;!1===m.copy?m.state&&r.length===t.length?g(r.length,r,1,t,1):(t=r,m.state=!0):(r.length!==t.length&&(t=new v(r.length)),g(r.length,r,1,t,1)),e=new v(t.buffer,t.byteOffset+3*t.BYTES_PER_ELEMENT,b),d=new v(t.buffer,t.byteOffset+630*t.BYTES_PER_ELEMENT,t[629])}function j(){var r={type:"PRNG"};return r.name=$.NAME,r.state=h(t),r.params=[],r}function $(){var r,n;return(n=t[628])>=b&&(e=N(e),n=0),r=e[n],t[628]=n+1,r^=r>>>11,r^=r<<7&x,r^=r<<15&G,(r^=r>>>18)>>>0}function U(){var r=$()>>>5,t=$()>>>6;return(r*k+t)*D}}},49074:(r,t,e)=>{"use strict";var n=e(1874),o=e(78093);n(o,"factory",e(73750)),r.exports=o},78093:(r,t,e)=>{"use strict";var n=e(73750)({seed:e(28858)()});r.exports=n},28858:(r,t,e)=>{"use strict";var n=e(82386),o=e(95943),i=n-1;r.exports=function(){return o(1+i*Math.random())>>>0}},26164:(r,t,e)=>{"use strict";var n=e(95943);r.exports=function(r,t,e){var o,i,a,u;for(a=r.length,i=new Array(t),u=0;u<t;u++)o=n(a*e()),i[u]=r[o];return i}},20957:(r,t,e)=>{"use strict";var n=e(1874),o=e(89596),i=e(94133),a=e(94565).isPrimitive,u=e(49074).factory,s=e(24008),f=e(26164),c=e(17006),l=e(95344),m=e(37289),p=e(21040),v=e(25036),d=Array.prototype.slice;r.exports=function(){var r,t,e,_,g,h;if(e=s(p),1===arguments.length)o(arguments[0])||i(arguments[0])?t=arguments[0]:g=v(e,r=arguments[0]);else if(arguments.length>1){if(r=arguments[1],!o(t=arguments[0])&&!i(t))throw new TypeError("invalid argument. `pool` argument must be array-like. Value: `"+t+"`.");g=v(e,r)}if(g)throw g;return _=r&&r.seed?u({seed:r.seed}):u(),void 0===t?h=y:(t=a(t)?t.split(""):s(t),h=b),n(h,"seed",_.seed),n(h,"PRNG",_),_=_.normalized,h;function y(r,t){var n,u,s,p,g,h;if(!o(r)&&!i(r))throw new TypeError("invalid argument. First argument must be array-like. Value: `"+r+"`.");if(a(r)&&(r=r.split("")),p={},arguments.length>1&&(h=v(p,t)))throw h;if(n=void 0===p.replace?e.replace:p.replace,void 0!==p.probs&&(s=p.probs),g=p.size?p.size:e.size?e.size:r.length,!1===n&&g>r.length)throw new RangeError("invalid input option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `"+g+"`.");return s?n?m(r,g,_,s):c(r,g,_,s):n?f(r,g,_):(u=d.call(r),l(u,g,_))}function b(r){var n,o,i,a,u,s;if(0===t.length)return null;if(i={},arguments.length&&(u=v(i,r)))throw u;if(o=void 0===i.mutate?e.mutate:i.mutate,n=void 0===i.replace?e.replace:i.replace,a=i.size?i.size:e.size?e.size:t.length,!1===n&&a>t.length)throw new RangeError("invalid input option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `"+a+"`.");return n?f(t,a,_):(s=l(t,a,_),o&&(t=t.slice(a,t.length)),s)}}},95344:(r,t,e)=>{"use strict";var n=e(95943),o=Array.prototype.slice;r.exports=function(r,t,e){var i,a,u;for(a=r.length-1;a>0;a--)u=n(e()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return o.call(r,0,t)}},40054:(r,t,e)=>{"use strict";var n=e(1874),o=e(97325);n(o,"factory",e(20957)),r.exports=o},17006:r=>{"use strict";r.exports=function(r,t,e,n){var o,i,a,u,s,f,c,l;for(u=r.length,o=new Array(u),s=0;s<u;s++)o[s]=n[s];for(a=new Array(t),s=0;s<t;s++){for(l=e(),i=0,f=0;f<u&&!(l<(i+=o[f]));f++);for(c=0;c<u;c++)c!==f&&(o[c]/=1-o[f]);o[f]=0,a[s]=r[f]}return a}},97325:(r,t,e)=>{"use strict";var n=e(20957)();r.exports=n},25036:(r,t,e)=>{"use strict";var n=e(88692),o=e(65201),i=e(601),a=e(79572).isPrimitive,u=e(33022);r.exports=function(r,t){return u(t)?i(t,"size")&&(r.size=t.size,!n(r.size))?new TypeError("invalid option. `size` option must be a nonnegative integer. Option: `"+r.size+"`."):i(t,"probs")&&(r.probs=t.probs,!o(r.probs))?new TypeError("invalid option. `probs` option must be an array of probabilities that sum to one. Option: `"+r.probs+"`."):i(t,"mutate")&&(r.mutate=t.mutate,!a(r.mutate))?new TypeError("invalid option. `mutate` option must be a boolean primitive. Option: `"+r.mutate+"`."):i(t,"replace")&&(r.replace=t.replace,!a(r.replace))?new TypeError("invalid option. `replace` option must be a boolean primitive. Option: `"+r.replace+"`."):null:new TypeError("invalid argument. Options argument must be an object. Value: `"+t+"`.")}},37289:(r,t,e)=>{"use strict";var n=e(95943);r.exports=function(r,t,e,o){var i,a,u,s,f,c,l,m,p,v;for(u=o.slice(),c=r.length,i=[],a=[],p=0;p<c;p++)u[p]*=c,u[p]<1?i.push(p):a.push(p);for(s=new Array(c),l=new Array(c);0!==i.length&&0!==a.length;)v=i.shift(),m=a.shift(),l[v]=u[v],s[v]=m,u[m]=u[m]+u[v]-1,u[m]<1?i.push(m):a.push(m);for(p=0;p<a.length;p++)l[a[p]]=1;for(p=0;p<i.length;p++)l[i[p]]=1;for(f=new Array(t),p=0;p<t;p++)v=n(c*e()),e()<l[v]?f[p]=r[v]:f[p]=r[s[v]];return f}},18840:(r,t,e)=>{"use strict";var n=e(1874),o=e(11407);n(o,"REGEXP",e(3032)),r.exports=o},11407:r=>{"use strict";r.exports=function(){return/^\s*function\s*([^(]*)/i}},3032:(r,t,e)=>{"use strict";var n=e(11407)();r.exports=n},5814:(r,t,e)=>{"use strict";var n=e(1874),o=e(89115);n(o,"REGEXP",e(37437)),r.exports=o,r.exports=o},89115:r=>{"use strict";r.exports=function(){return/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/}},37437:(r,t,e)=>{"use strict";var n=e(89115)();r.exports=n},28435:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(r)||n(t)||t<0||t>1?NaN:r<0?0:r>=1?1:1-t}},21279:(r,t,e)=>{"use strict";var n=e(62739),o=e(22957);r.exports=function(r){return o(r)||r<0||r>1?n(NaN):function(t){return o(t)?NaN:t<0?0:t>=1?1:1-r}}},47541:(r,t,e)=>{"use strict";var n=e(1874),o=e(28435);n(o,"factory",e(21279)),r.exports=o},89145:(r,t,e)=>{"use strict";var n=e(73002);r.exports=n},73002:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r){return n(r)||r<0||r>1?NaN:r}},44602:(r,t,e)=>{"use strict";var n=e(62739),o=e(22957);r.exports=function(r){return o(r)||r<0||r>1?n(NaN):function(t){return o(t)?NaN:0===t?1-r:1===t?r:0}}},8170:(r,t,e)=>{"use strict";var n=e(1874),o=e(32502);n(o,"factory",e(44602)),r.exports=o},32502:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(r)||n(t)||t<0||t>1?NaN:0===r?1-t:1===r?t:0}},22663:(r,t,e)=>{"use strict";var n=e(62739),o=e(22957);r.exports=function(r){return o(r)||r<0||r>1?n(NaN):function(t){return o(t)||t<0||t>1?NaN:t<=1-r?0:1}}},53356:(r,t,e)=>{"use strict";var n=e(1874),o=e(25810);n(o,"factory",e(22663)),r.exports=o},25810:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(t)||n(r)||t<0||t>1||r<0||r>1?NaN:r<=1-t?0:1}},98073:(r,t,e)=>{"use strict";var n=e(58190);r.exports=n},58190:(r,t,e)=>{"use strict";var n=e(22957),o=e(95688);r.exports=function(r){return n(r)||r<0||r>1?NaN:o((1-r)*r)}},9279:(r,t,e)=>{"use strict";var n=e(23942);r.exports=n},23942:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r){return n(r)||r<0||r>1?NaN:r*(1-r)}},36900:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(r)||n(t)?NaN:r<t?0:1}},89961:(r,t,e)=>{"use strict";var n=e(62739),o=e(22957);r.exports=function(r){return o(r)?n(NaN):function(t){return o(t)?NaN:t<r?0:1}}},63400:(r,t,e)=>{"use strict";var n=e(1874),o=e(36900);n(o,"factory",e(89961)),r.exports=o},14393:(r,t,e)=>{"use strict";var n=e(62739),o=e(9918),i=e(22957);r.exports=function(r){return i(r)?n(NaN):function(t){return i(t)?NaN:t===r?o:0}}},69746:(r,t,e)=>{"use strict";var n=e(1874),o=e(14229);n(o,"factory",e(14393)),r.exports=o},14229:(r,t,e)=>{"use strict";var n=e(9918),o=e(22957);r.exports=function(r,t){return o(r)||o(t)?NaN:r===t?n:0}},59316:(r,t,e)=>{"use strict";var n=e(62739),o=e(22957);r.exports=function(r){return o(r)?n(NaN):function(t){return o(t)||t<0||t>1?NaN:r}}},71364:(r,t,e)=>{"use strict";var n=e(1874),o=e(70414);n(o,"factory",e(59316)),r.exports=o},70414:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(r)||r<0||r>1?NaN:t}},43441:(r,t,e)=>{"use strict";var n=e(22957),o=e(90465);r.exports=function(r,t,e){return n(r)||n(t)||n(e)||e<0?NaN:0===e?r<t?0:1:1/(1+o(-(r-t)/e))}},32712:(r,t,e)=>{"use strict";var n=e(62739),o=e(63400).factory,i=e(22957),a=e(90465);r.exports=function(r,t){return i(r)||i(t)||t<0?n(NaN):0===t?o(r):function(e){return i(e)?NaN:1/(1+a(-(e-r)/t))}}},72621:(r,t,e)=>{"use strict";var n=e(1874),o=e(43441);n(o,"factory",e(32712)),r.exports=o},6114:(r,t,e)=>{"use strict";var n=e(59454);r.exports=n},59454:(r,t,e)=>{"use strict";var n=e(22957);r.exports=function(r,t){return n(r)||n(t)||t<=0?NaN:r}},5114:(r,t,e)=>{"use strict";var n=e(62739),o=e(69746).factory,i=e(22957),a=e(32593),u=e(90465),s=e(33727),f=e(95465);r.exports=function(r,t){return i(r)||i(t)||t<0?n(NaN):0===t?o(r):function(e){var n,o;return i(e)?NaN:e===f?0:(o=a((e-r)/t),(n=u(-o))/(t*s(1+n,2)))}}},64136:(r,t,e)=>{"use strict";var n=e(1874),o=e(57710);n(o,"factory",e(5114)),r.exports=o},57710:(r,t,e)=>{"use strict";var n=e(22957),o=e(32593),i=e(90465),a=e(33727),u=e(95465),s=e(9918);r.exports=function(r,t,e){var f,c;return n(r)||n(t)||n(e)||e<0?NaN:r===u?0:0===e?r===t?s:0:(c=o((r-t)/e),(f=i(-c))/(e*a(1+f,2)))}},72965:(r,t,e)=>{"use strict";var n=e(62739),o=e(71364).factory,i=e(22957),a=e(98030);r.exports=function(r,t){return i(r)||i(t)||t<0?n(NaN):0===t?o(r):function(e){return i(e)||e<0||e>1?NaN:r+t*a(e/(1-e))}}},5427:(r,t,e)=>{"use strict";var n=e(1874),o=e(16179);n(o,"factory",e(72965)),r.exports=o},16179:(r,t,e)=>{"use strict";var n=e(22957),o=e(98030);r.exports=function(r,t,e){return n(t)||n(e)||n(r)||e<0||r<0||r>1?NaN:0===e?t:t+e*o(r/(1-r))}},38296:(r,t,e)=>{"use strict";var n=e(88244);r.exports=n},88244:(r,t,e)=>{"use strict";var n=e(22957),o=e(61802),i=e(87598);r.exports=function(r,t){return n(r)||n(t)||t<=0?NaN:t*i/o}},85853:(r,t,e)=>{"use strict";var n=e(85140);r.exports=n},85140:(r,t,e)=>{"use strict";var n=e(22957),o=e(30678);r.exports=function(r,t){return n(r)||n(t)||t<=0?NaN:t*t*o/3}},54507:r=>{"use strict";r.exports=function(r){return function(){return r}}},62739:(r,t,e)=>{"use strict";var n=e(54507);r.exports=n},98221:(r,t,e)=>{"use strict";var n=e(55443);r.exports=n},55443:(r,t,e)=>{"use strict";var n=e(90329),o=e(18840).REGEXP,i=e(70410);r.exports=function(r){var t,e,a;if(("Object"===(e=n(r).slice(8,-1))||"Error"===e)&&r.constructor){if("string"==typeof(a=r.constructor).name)return a.name;if(t=o.exec(a.toString()))return t[1]}return i(r)?"Buffer":e}},67938:(r,t,e)=>{"use strict";var n=e(88703),o=e(88692).isPrimitive,i=e(9918),a=e(68865);r.exports=function(r,t){var e;if(arguments.length>1){if(!o(t))throw new TypeError("invalid argument. `level` must be a nonnegative integer. Value: `"+t+"`.");if(0===t)return r}else t=i;return e=n(r)?new Array(r.length):{},a(r,e,[r],[e],t)}},68865:(r,t,e)=>{"use strict";var n=e(601),o=e(88703),i=e(70410),a=e(27907),u=e(98155),s=e(43129),f=e(52770),c=e(37069),l=e(16170),m=e(37586),p=e(36613),v=e(55528),d=e(54451),_=e(21413);r.exports=function r(t,e,g,h,y){var b,A,S,T,E,x,G,w,D,k;if(y-=1,"object"!=typeof t||null===t)return t;if(i(t))return d(t);if(a(t))return function(t){var e,i,a,u,s,f,l=[],p=[];for(s=new t.constructor(t.message),l.push(t),p.push(s),t.stack&&(s.stack=t.stack),t.code&&(s.code=t.code),t.errno&&(s.errno=t.errno),t.syscall&&(s.syscall=t.syscall),e=c(t),f=0;f<e.length;f++)u=e[f],i=m(t,u),n(i,"value")&&(a=o(t[u])?[]:{},i.value=r(t[u],a,l,p,-1)),v(s,u,i);return s}(t);if("date"===(S=u(t)))return new Date(+t);if("regexp"===S)return s(t.toString());if("set"===S)return new Set(t);if("map"===S)return new Map(t);if("string"===S||"boolean"===S||"number"===S)return t.valueOf();if(E=_[S])return E(t);if("array"!==S&&"object"!==S)return"function"==typeof Object.freeze?function(t){var e,i,a,u,s,f,c,d;for(e=[],u=[],c=Object.create(p(t)),e.push(t),u.push(c),i=l(t),d=0;d<i.length;d++)a=i[d],s=m(t,a),n(s,"value")&&(f=o(t[a])?[]:{},s.value=r(t[a],f,e,u,-1)),v(c,a,s);return Object.isExtensible(t)||Object.preventExtensions(c),Object.isSealed(t)&&Object.seal(c),Object.isFrozen(t)&&Object.freeze(c),c}(t):{};if(A=c(t),y>0)for(b=S,k=0;k<A.length;k++)w=t[x=A[k]],S=u(w),"object"!=typeof w||null===w||"array"!==S&&"object"!==S||i(w)?"object"===b?(T=m(t,x),n(T,"value")&&(T.value=r(w)),v(e,x,T)):e[x]=r(w):-1===(D=f(g,w))?(G=o(w)?new Array(w.length):{},g.push(w),h.push(G),"array"===b?e[x]=r(w,G,g,h,y):(T=m(t,x),n(T,"value")&&(T.value=r(w,G,g,h,y)),v(e,x,T))):e[x]=h[D];else if("array"===S)for(k=0;k<A.length;k++)e[x=A[k]]=t[x];else for(k=0;k<A.length;k++)x=A[k],T=m(t,x),v(e,x,T);return Object.isExtensible(t)||Object.preventExtensions(e),Object.isSealed(t)&&Object.seal(e),Object.isFrozen(t)&&Object.freeze(e),e}},24008:(r,t,e)=>{"use strict";var n=e(67938);r.exports=n},21413:(r,t,e)=>{"use strict";var n,o=e(48603),i=e(24909),a=e(40784),u=e(79320),s=e(53033),f=e(37959),c=e(20613),l=e(92356),m=e(70554);n={int8array:function(r){return new o(r)},uint8array:function(r){return new i(r)},uint8clampedarray:function(r){return new a(r)},int16array:function(r){return new u(r)},uint16array:function(r){return new s(r)},int32array:function(r){return new f(r)},uint32array:function(r){return new c(r)},float32array:function(r){return new l(r)},float64array:function(r){return new m(r)}},r.exports=n},67359:(r,t,e)=>{"use strict";var n=e(96025);r.exports=n},96025:(r,t,e)=>{"use strict";var n=e(55528);r.exports=function(r,t,e){n(r,t,{configurable:!1,enumerable:!1,get:e})}},1874:(r,t,e)=>{"use strict";var n=e(41445);r.exports=n},41445:(r,t,e)=>{"use strict";var n=e(55528);r.exports=function(r,t,e){n(r,t,{configurable:!1,enumerable:!1,writable:!1,value:e})}},68949:(r,t,e)=>{"use strict";var n=e(13154);r.exports=n},13154:(r,t,e)=>{"use strict";var n=e(55528);r.exports=function(r,t,e,o){n(r,t,{configurable:!1,enumerable:!1,get:e,set:o})}},42656:r=>{"use strict";var t=Object.defineProperty;r.exports=t},67382:r=>{"use strict";var t="function"==typeof Object.defineProperty?Object.defineProperty:null;r.exports=t},46511:(r,t,e)=>{"use strict";var n=e(67382);r.exports=function(){try{return n({},"x",{}),!0}catch(r){return!1}}},55528:(r,t,e)=>{"use strict";var n,o=e(46511),i=e(42656),a=e(96545);n=o()?i:a,r.exports=n},96545:r=>{"use strict";var t=Object.prototype,e=t.toString,n=t.__defineGetter__,o=t.__defineSetter__,i=t.__lookupGetter__,a=t.__lookupSetter__;r.exports=function(r,u,s){var f,c,l,m;if("object"!=typeof r||null===r||"[object Array]"===e.call(r))throw new TypeError("invalid argument. First argument must be an object. Value: `"+r+"`.");if("object"!=typeof s||null===s||"[object Array]"===e.call(s))throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+s+"`.");if((c="value"in s)&&(i.call(r,u)||a.call(r,u)?(f=r.__proto__,r.__proto__=t,delete r[u],r[u]=s.value,r.__proto__=f):r[u]=s.value),l="get"in s,m="set"in s,c&&(l||m))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return l&&n&&n.call(r,u,s.get),m&&o&&o.call(r,u,s.set),r}},60087:(r,t,e)=>{"use strict";var n=e(13939),o=e(30201),i=e(18840).REGEXP,a=o();r.exports=function(r){if(!1===n(r))throw new TypeError("invalid argument. Must provide a function. Value: `"+r+"`.");return a?r.name:i.exec(r.toString())[1]}},83294:(r,t,e)=>{"use strict";var n=e(60087);r.exports=n},90556:(r,t,e)=>{"use strict";var n,o=e(13939),i=e(87071),a=e(14357);n=o(Object.getPrototypeOf)?i:a,r.exports=n},76551:(r,t,e)=>{"use strict";var n=e(90556);r.exports=function(r){return null==r?null:(r=Object(r),n(r))}},36613:(r,t,e)=>{"use strict";var n=e(76551);r.exports=n},87071:r=>{"use strict";var t=Object.getPrototypeOf;r.exports=t},14357:(r,t,e)=>{"use strict";var n=e(90329),o=e(82628);r.exports=function(r){var t=o(r);return t||null===t?t:"[object Function]"===n(r.constructor)?r.constructor.prototype:r instanceof Object?Object.prototype:null}},82628:r=>{"use strict";r.exports=function(r){return r.__proto__}},40667:r=>{"use strict";r.exports=function(){return new Function("return this;")()}},22576:(r,t,e)=>{"use strict";var n="object"==typeof e.g?e.g:null;r.exports=n},87175:(r,t,e)=>{"use strict";var n=e(19451);r.exports=n},19451:(r,t,e)=>{"use strict";var n=e(79572).isPrimitive,o=e(40667),i=e(60021),a=e(4116),u=e(22576);r.exports=function(r){if(arguments.length){if(!n(r))throw new TypeError("invalid argument. Must provide a boolean primitive. Value: `"+r+"`.");if(r)return o()}if(i)return i;if(a)return a;if(u)return u;throw new Error("unexpected error. Unable to resolve global object.")}},60021:r=>{"use strict";var t="object"==typeof self?self:null;r.exports=t},4116:r=>{"use strict";var t="object"==typeof window?window:null;r.exports=t},52770:(r,t,e)=>{"use strict";var n=e(92496);r.exports=n},92496:(r,t,e)=>{"use strict";var n=e(16305),o=e(71388),i=e(94565).isPrimitive,a=e(44096).isPrimitive;r.exports=function(r,t,e){var u,s;if(!o(r)&&!i(r))throw new TypeError("invalid argument. First argument must be an array-like object. Value: `"+r+"`.");if(0===(u=r.length))return-1;if(3===arguments.length){if(!a(e))throw new TypeError("invalid argument. `fromIndex` must be an integer. Value: `"+e+"`.");if(e>=0){if(e>=u)return-1;s=e}else(s=u+e)<0&&(s=0)}else s=0;if(n(t)){for(;s<u;s++)if(n(r[s]))return s}else for(;s<u;s++)if(r[s]===t)return s;return-1}},19737:r=>{"use strict";r.exports=function(r){return Object.keys(Object(r))}},5624:(r,t,e)=>{"use strict";var n=e(80037),o=e(19737),i=Array.prototype.slice;r.exports=function(r){return n(r)?o(i.call(r)):o(r)}},25348:(r,t,e)=>{"use strict";var n=e(19737);r.exports=function(){return function(){return 2!==(n(arguments)||"").length}(1,2)}},83435:(r,t,e)=>{"use strict";var n,o=e(601),i=e(52770),a=e(98155),u=e(4399),s=e(38610),f=e(28514);n=function(){var r;if("undefined"===a(f))return!1;for(r in f)try{-1===i(s,r)&&o(f,r)&&null!==f[r]&&"object"===a(f[r])&&u(f[r])}catch(r){return!0}return!1}(),r.exports=n},2145:r=>{"use strict";var t=void 0!==Object.keys;r.exports=t},10459:(r,t,e)=>{"use strict";var n=e(18987)(e(6830),"prototype");r.exports=n},7402:(r,t,e)=>{"use strict";var n=!e(18987)({toString:null},"toString");r.exports=n},95901:r=>{"use strict";var t="undefined"!=typeof window;r.exports=t},37069:(r,t,e)=>{"use strict";var n=e(89777);r.exports=n},4399:r=>{"use strict";r.exports=function(r){return r.constructor&&r.constructor.prototype===r}},82818:(r,t,e)=>{"use strict";var n=e(83435),o=e(4399),i=e(95901);r.exports=function(r){if(!1===i&&!n)return o(r);try{return o(r)}catch(r){return!1}}},89777:(r,t,e)=>{"use strict";var n,o=e(25348),i=e(2145),a=e(19737),u=e(5624),s=e(54877);n=i?o()?u:a:s,r.exports=n},54877:(r,t,e)=>{"use strict";var n=e(93961),o=e(601),i=e(80037),a=e(10459),u=e(7402),s=e(82818),f=e(81308);r.exports=function(r){var t,e,c,l,m,p,v;if(l=[],i(r)){for(v=0;v<r.length;v++)l.push(v.toString());return l}if("string"==typeof r){if(r.length>0&&!o(r,"0"))for(v=0;v<r.length;v++)l.push(v.toString())}else{if(!1==(c="function"==typeof r)&&!n(r))return l;e=a&&c}for(m in r)e&&"prototype"===m||!o(r,m)||l.push(String(m));if(u)for(t=s(r),v=0;v<f.length;v++)p=f[v],t&&"constructor"===p||!o(r,p)||l.push(String(p));return l}},28514:r=>{"use strict";var t="undefined"==typeof window?void 0:window;r.exports=t},90329:(r,t,e)=>{"use strict";var n,o=e(65768),i=e(83709),a=e(83627);n=o()?a:i,r.exports=n},83709:(r,t,e)=>{"use strict";var n=e(12414);r.exports=function(r){return n.call(r)}},83627:(r,t,e)=>{"use strict";var n=e(601),o=e(89543),i=e(12414);r.exports=function(r){var t,e,a;if(null==r)return i.call(r);e=r[o],t=n(r,o);try{r[o]=void 0}catch(t){return i.call(r)}return a=i.call(r),t?r[o]=e:delete r[o],a}},12414:r=>{"use strict";var t=Object.prototype.toString;r.exports=t},89543:r=>{"use strict";var t="function"==typeof Symbol?Symbol.toStringTag:"";r.exports=t},6830:(r,t,e)=>{"use strict";var n=e(18078);r.exports=n},18078:r=>{"use strict";r.exports=function(){}},87872:r=>{"use strict";var t=Object.getOwnPropertyDescriptor;r.exports=function(r,e){var n;return null==r||void 0===(n=t(r,e))?null:n}},23268:r=>{"use strict";var t=void 0!==Object.getOwnPropertyDescriptor;r.exports=t},37586:(r,t,e)=>{"use strict";var n,o=e(23268),i=e(87872),a=e(1170);n=o?i:a,r.exports=n},1170:(r,t,e)=>{"use strict";var n=e(601);r.exports=function(r,t){return n(r,t)?{configurable:!0,enumerable:!0,writable:!0,value:r[t]}:null}},70565:r=>{"use strict";var t=Object.getOwnPropertyNames;r.exports=function(r){return t(Object(r))}},89999:r=>{"use strict";var t=void 0!==Object.getOwnPropertyNames;r.exports=t},16170:(r,t,e)=>{"use strict";var n,o=e(89999),i=e(70565),a=e(7604);n=o?i:a,r.exports=n},7604:(r,t,e)=>{"use strict";var n=e(37069);r.exports=function(r){return n(Object(r))}},79067:(r,t,e)=>{"use strict";var n=e(94565).isPrimitive,o=e(5814);r.exports=function(r){if(!n(r))throw new TypeError("invalid argument. Must provide a regular expression string. Value: `"+r+"`.");return(r=o().exec(r))?new RegExp(r[1],r[2]):null}},43129:(r,t,e)=>{"use strict";var n=e(79067);r.exports=n},39467:(r,t,e)=>{"use strict";var n=e(20933),o=e(73996),i=e(79150);r.exports=function(){return"function"==typeof n||"object"==typeof i||"function"==typeof o}},73996:(r,t,e)=>{"use strict";var n=e(87175)(),o=n.document&&n.document.childNodes;r.exports=o},20933:r=>{"use strict";r.exports=/./},79150:r=>{"use strict";var t=Int8Array;r.exports=t},98155:(r,t,e)=>{"use strict";var n=e(39467),o=e(369),i=e(46450),a=n()?i:o;r.exports=a},46450:(r,t,e)=>{"use strict";var n=e(98221);r.exports=function(r){return n(r).toLowerCase()}},369:(r,t,e)=>{"use strict";var n=e(98221);r.exports=function(r){var t;return null===r?"null":"object"==(t=typeof r)?n(r).toLowerCase():t}},95766:(r,t)=>{"use strict";t.byteLength=function(r){var t=s(r),e=t[0],n=t[1];return 3*(e+n)/4-n},t.toByteArray=function(r){var t,e,i=s(r),a=i[0],u=i[1],f=new o(function(r,t,e){return 3*(t+e)/4-e}(0,a,u)),c=0,l=u>0?a-4:a;for(e=0;e<l;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=255&t;return 2===u&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,f[c++]=255&t),1===u&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t),f},t.fromByteArray=function(r){for(var t,n=r.length,o=n%3,i=[],a=16383,u=0,s=n-o;u<s;u+=a)i.push(f(r,u,u+a>s?s:u+a));return 1===o?(t=r[n-1],i.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],i.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"=")),i.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=i.length;a<u;++a)e[a]=i[a],n[i.charCodeAt(a)]=a;function s(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function f(r,t,n){for(var o,i,a=[],u=t;u<n;u+=3)o=(r[u]<<16&16711680)+(r[u+1]<<8&65280)+(255&r[u+2]),a.push(e[(i=o)>>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48834:(r,t,e)=>{"use strict";var n=e(95766),o=e(62333),i=e(77906);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(r,t){if(a()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t)).__proto__=s.prototype:(null===r&&(r=new s(t)),r.length=t),r}function s(r,t,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(r,t,e);if("number"==typeof r){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,r)}return f(this,r,t,e)}function f(r,t,e,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),s.TYPED_ARRAY_SUPPORT?(r=t).__proto__=s.prototype:r=m(r,t),r}(r,t,e,n):"string"==typeof t?function(r,t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,e),o=(r=u(r,n)).write(t,e);return o!==n&&(r=r.slice(0,o)),r}(r,t,e):function(r,t){if(s.isBuffer(t)){var e=0|p(t.length);return 0===(r=u(r,e)).length||t.copy(r,0,0,e),r}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?u(r,0):m(r,t);if("Buffer"===t.type&&i(t.data))return m(r,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(r,t)}function c(r){if("number"!=typeof r)throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function l(r,t){if(c(t),r=u(r,t<0?0:0|p(t)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function m(r,t){var e=t.length<0?0:0|p(t.length);r=u(r,e);for(var n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(r){if(r>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|r}function v(r,t){if(s.isBuffer(r))return r.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;"string"!=typeof r&&(r=""+r);var e=r.length;if(0===e)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return j(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return $(r).length;default:if(n)return j(r).length;t=(""+t).toLowerCase(),n=!0}}function d(r,t,e){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(t>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return O(this,t,e);case"utf8":case"utf-8":return G(this,t,e);case"ascii":return D(this,t,e);case"latin1":case"binary":return k(this,t,e);case"base64":return x(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function _(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function g(r,t,e,n,o){if(0===r.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(o)return-1;e=r.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:h(r,t,e,n,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):h(r,[t],e,n,o);throw new TypeError("val must be string, number or Buffer")}function h(r,t,e,n,o){var i,a=1,u=r.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(r.length<2||t.length<2)return-1;a=2,u/=2,s/=2,e/=2}function f(r,t){return 1===a?r[t]:r.readUInt16BE(t*a)}if(o){var c=-1;for(i=e;i<u;i++)if(f(r,i)===f(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===s)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(e+s>u&&(e=u-s),i=e;i>=0;i--){for(var l=!0,m=0;m<s;m++)if(f(r,i+m)!==f(t,m)){l=!1;break}if(l)return i}return-1}function y(r,t,e,n){e=Number(e)||0;var o=r.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;r[e+a]=u}return a}function b(r,t,e,n){return U(j(t,r.length-e),r,e,n)}function A(r,t,e,n){return U(function(r){for(var t=[],e=0;e<r.length;++e)t.push(255&r.charCodeAt(e));return t}(t),r,e,n)}function S(r,t,e,n){return A(r,t,e,n)}function T(r,t,e,n){return U($(t),r,e,n)}function E(r,t,e,n){return U(function(r,t){for(var e,n,o,i=[],a=0;a<r.length&&!((t-=2)<0);++a)n=(e=r.charCodeAt(a))>>8,o=e%256,i.push(o),i.push(n);return i}(t,r.length-e),r,e,n)}function x(r,t,e){return 0===t&&e===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(t,e))}function G(r,t,e){e=Math.min(r.length,e);for(var n=[],o=t;o<e;){var i,a,u,s,f=r[o],c=null,l=f>239?4:f>223?3:f>191?2:1;if(o+l<=e)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(i=r[o+1]))&&(s=(31&f)<<6|63&i)>127&&(c=s);break;case 3:i=r[o+1],a=r[o+2],128==(192&i)&&128==(192&a)&&(s=(15&f)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=r[o+1],a=r[o+2],u=r[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&f)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(c=s)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=l}return function(r){var t=r.length;if(t<=w)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=w));return e}(n)}t.lW=s,t.h2=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.g.TYPED_ARRAY_SUPPORT?e.g.TYPED_ARRAY_SUPPORT:function(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===r.foo()&&"function"==typeof r.subarray&&0===r.subarray(1,1).byteLength}catch(r){return!1}}(),a(),s.poolSize=8192,s._augment=function(r){return r.__proto__=s.prototype,r},s.from=function(r,t,e){return f(null,r,t,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(r,t,e){return function(r,t,e,n){return c(t),t<=0?u(r,t):void 0!==e?"string"==typeof n?u(r,t).fill(e,n):u(r,t).fill(e):u(r,t)}(null,r,t,e)},s.allocUnsafe=function(r){return l(null,r)},s.allocUnsafeSlow=function(r){return l(null,r)},s.isBuffer=function(r){return!(null==r||!r._isBuffer)},s.compare=function(r,t){if(!s.isBuffer(r)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var e=r.length,n=t.length,o=0,i=Math.min(e,n);o<i;++o)if(r[o]!==t[o]){e=r[o],n=t[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(r,t){if(!i(r))throw new TypeError('"list" argument must be an Array of Buffers');if(0===r.length)return s.alloc(0);var e;if(void 0===t)for(t=0,e=0;e<r.length;++e)t+=r[e].length;var n=s.allocUnsafe(t),o=0;for(e=0;e<r.length;++e){var a=r[e];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},s.byteLength=v,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)_(this,t,t+1);return this},s.prototype.swap32=function(){var r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},s.prototype.swap64=function(){var r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},s.prototype.toString=function(){var r=0|this.length;return 0===r?"":0===arguments.length?G(this,0,r):d.apply(this,arguments)},s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||0===s.compare(this,r)},s.prototype.inspect=function(){var r="",e=t.h2;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"},s.prototype.compare=function(r,t,e,n,o){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===e&&(e=r?r.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||e>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=e)return 0;if(n>=o)return-1;if(t>=e)return 1;if(this===r)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(e>>>=0)-(t>>>=0),u=Math.min(i,a),f=this.slice(n,o),c=r.slice(t,e),l=0;l<u;++l)if(f[l]!==c[l]){i=f[l],a=c[l];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(r,t,e){return-1!==this.indexOf(r,t,e)},s.prototype.indexOf=function(r,t,e){return g(this,r,t,e,!0)},s.prototype.lastIndexOf=function(r,t,e){return g(this,r,t,e,!1)},s.prototype.write=function(r,t,e,n){if(void 0===t)n="utf8",e=this.length,t=0;else if(void 0===e&&"string"==typeof t)n=t,e=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-t;if((void 0===e||e>o)&&(e=o),r.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return y(this,r,t,e);case"utf8":case"utf-8":return b(this,r,t,e);case"ascii":return A(this,r,t,e);case"latin1":case"binary":return S(this,r,t,e);case"base64":return T(this,r,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,r,t,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function D(r,t,e){var n="";e=Math.min(r.length,e);for(var o=t;o<e;++o)n+=String.fromCharCode(127&r[o]);return n}function k(r,t,e){var n="";e=Math.min(r.length,e);for(var o=t;o<e;++o)n+=String.fromCharCode(r[o]);return n}function O(r,t,e){var n,o=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>o)&&(e=o);for(var i="",a=t;a<e;++a)i+=(n=r[a])<16?"0"+n.toString(16):n.toString(16);return i}function M(r,t,e){for(var n=r.slice(t,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function F(r,t,e){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function I(r,t,e,n,o,i){if(!s.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function P(r,t,e,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(r.length-e,2);o<i;++o)r[e+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function N(r,t,e,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(r.length-e,4);o<i;++o)r[e+o]=t>>>8*(n?o:3-o)&255}function R(r,t,e,n,o,i){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function C(r,t,e,n,i){return i||R(r,0,e,4),o.write(r,t,e,n,23,4),e+4}function L(r,t,e,n,i){return i||R(r,0,e,8),o.write(r,t,e,n,52,8),e+8}s.prototype.slice=function(r,t){var e,n=this.length;if((r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<r&&(t=r),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(r,t)).__proto__=s.prototype;else{var o=t-r;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+r]}return e},s.prototype.readUIntLE=function(r,t,e){r|=0,t|=0,e||F(r,t,this.length);for(var n=this[r],o=1,i=0;++i<t&&(o*=256);)n+=this[r+i]*o;return n},s.prototype.readUIntBE=function(r,t,e){r|=0,t|=0,e||F(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n},s.prototype.readUInt8=function(r,t){return t||F(r,1,this.length),this[r]},s.prototype.readUInt16LE=function(r,t){return t||F(r,2,this.length),this[r]|this[r+1]<<8},s.prototype.readUInt16BE=function(r,t){return t||F(r,2,this.length),this[r]<<8|this[r+1]},s.prototype.readUInt32LE=function(r,t){return t||F(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},s.prototype.readUInt32BE=function(r,t){return t||F(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},s.prototype.readIntLE=function(r,t,e){r|=0,t|=0,e||F(r,t,this.length);for(var n=this[r],o=1,i=0;++i<t&&(o*=256);)n+=this[r+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(r,t,e){r|=0,t|=0,e||F(r,t,this.length);for(var n=t,o=1,i=this[r+--n];n>0&&(o*=256);)i+=this[r+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(r,t){return t||F(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},s.prototype.readInt16LE=function(r,t){t||F(r,2,this.length);var e=this[r]|this[r+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(r,t){t||F(r,2,this.length);var e=this[r+1]|this[r]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(r,t){return t||F(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},s.prototype.readInt32BE=function(r,t){return t||F(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},s.prototype.readFloatLE=function(r,t){return t||F(r,4,this.length),o.read(this,r,!0,23,4)},s.prototype.readFloatBE=function(r,t){return t||F(r,4,this.length),o.read(this,r,!1,23,4)},s.prototype.readDoubleLE=function(r,t){return t||F(r,8,this.length),o.read(this,r,!0,52,8)},s.prototype.readDoubleBE=function(r,t){return t||F(r,8,this.length),o.read(this,r,!1,52,8)},s.prototype.writeUIntLE=function(r,t,e,n){r=+r,t|=0,e|=0,n||I(this,r,t,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[t]=255&r;++i<e&&(o*=256);)this[t+i]=r/o&255;return t+e},s.prototype.writeUIntBE=function(r,t,e,n){r=+r,t|=0,e|=0,n||I(this,r,t,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[t+o]=255&r;--o>=0&&(i*=256);)this[t+o]=r/i&255;return t+e},s.prototype.writeUInt8=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=255&r,t+1},s.prototype.writeUInt16LE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8):P(this,r,t,!0),t+2},s.prototype.writeUInt16BE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=255&r):P(this,r,t,!1),t+2},s.prototype.writeUInt32LE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=255&r):N(this,r,t,!0),t+4},s.prototype.writeUInt32BE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r):N(this,r,t,!1),t+4},s.prototype.writeIntLE=function(r,t,e,n){if(r=+r,t|=0,!n){var o=Math.pow(2,8*e-1);I(this,r,t,e,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&r;++i<e&&(a*=256);)r<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(r/a>>0)-u&255;return t+e},s.prototype.writeIntBE=function(r,t,e,n){if(r=+r,t|=0,!n){var o=Math.pow(2,8*e-1);I(this,r,t,e,o-1,-o)}var i=e-1,a=1,u=0;for(this[t+i]=255&r;--i>=0&&(a*=256);)r<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(r/a>>0)-u&255;return t+e},s.prototype.writeInt8=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=255&r,t+1},s.prototype.writeInt16LE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8):P(this,r,t,!0),t+2},s.prototype.writeInt16BE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=255&r):P(this,r,t,!1),t+2},s.prototype.writeInt32LE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&r,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):N(this,r,t,!0),t+4},s.prototype.writeInt32BE=function(r,t,e){return r=+r,t|=0,e||I(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=255&r):N(this,r,t,!1),t+4},s.prototype.writeFloatLE=function(r,t,e){return C(this,r,t,!0,e)},s.prototype.writeFloatBE=function(r,t,e){return C(this,r,t,!1,e)},s.prototype.writeDoubleLE=function(r,t,e){return L(this,r,t,!0,e)},s.prototype.writeDoubleBE=function(r,t,e){return L(this,r,t,!1,e)},s.prototype.copy=function(r,t,e,n){if(e||(e=0),n||0===n||(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===r.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-e&&(n=r.length-t+e);var o,i=n-e;if(this===r&&e<t&&t<n)for(o=i-1;o>=0;--o)r[o+t]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)r[o+t]=this[o+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+i),t);return i},s.prototype.fill=function(r,t,e,n){if("string"==typeof r){if("string"==typeof t?(n=t,t=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===r.length){var o=r.charCodeAt(0);o<256&&(r=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof r&&(r&=255);if(t<0||this.length<t||this.length<e)throw new RangeError("Out of range index");if(e<=t)return this;var i;if(t>>>=0,e=void 0===e?this.length:e>>>0,r||(r=0),"number"==typeof r)for(i=t;i<e;++i)this[i]=r;else{var a=s.isBuffer(r)?r:j(new s(r,n).toString()),u=a.length;for(i=0;i<e-t;++i)this[i+t]=a[i%u]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function j(r,t){var e;t=t||1/0;for(var n=r.length,o=null,i=[],a=0;a<n;++a){if((e=r.charCodeAt(a))>55295&&e<57344){if(!o){if(e>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(t-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((t-=1)<0)break;i.push(e)}else if(e<2048){if((t-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((t-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function $(r){return n.toByteArray(function(r){if((r=function(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}(r).replace(V,"")).length<2)return"";for(;r.length%4!=0;)r+="=";return r}(r))}function U(r,t,e,n){for(var o=0;o<n&&!(o+e>=t.length||o>=r.length);++o)t[o+e]=r[o];return o}},62333:(r,t)=>{t.read=function(r,t,e,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,f=s>>1,c=-7,l=e?o-1:0,m=e?-1:1,p=r[t+l];for(l+=m,i=p&(1<<-c)-1,p>>=-c,c+=u;c>0;i=256*i+r[t+l],l+=m,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+r[t+l],l+=m,c-=8);if(0===i)i=1-f;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=f}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(r,t,e,n,o,i){var a,u,s,f=8*i-o-1,c=(1<<f)-1,l=c>>1,m=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,v=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+l>=1?m/s:m*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=c?(u=0,a=c):a+l>=1?(u=(t*s-1)*Math.pow(2,o),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;r[e+p]=255&u,p+=v,u/=256,o-=8);for(a=a<<o|u,f+=o;f>0;r[e+p]=255&a,p+=v,a/=256,f-=8);r[e+p-v]|=128*d}},77906:r=>{var t={}.toString;r.exports=Array.isArray||function(r){return"[object Array]"==t.call(r)}},43925:function(r){var t;r.exports=(t=function(r,t){var e=Array.prototype.concat,n=Array.prototype.slice,o=Object.prototype.toString;function i(t,e){var n=t>e?t:e;return r.pow(10,17-~~(r.log(n>0?n:-n)*r.LOG10E))}var a=Array.isArray||function(r){return"[object Array]"===o.call(r)};function u(r){return"[object Function]"===o.call(r)}function s(r){return"number"==typeof r&&r-r==0}function f(){return new f._init(arguments)}function c(){return 0}function l(){return 1}function m(r,t){return r===t?1:0}f.fn=f.prototype,f._init=function(r){if(a(r[0]))if(a(r[0][0])){u(r[1])&&(r[0]=f.map(r[0],r[1]));for(var t=0;t<r[0].length;t++)this[t]=r[0][t];this.length=r[0].length}else this[0]=u(r[1])?f.map(r[0],r[1]):r[0],this.length=1;else if(s(r[0]))this[0]=f.seq.apply(null,r),this.length=1;else{if(r[0]instanceof f)return f(r[0].toArray());this[0]=[],this.length=1}return this},f._init.prototype=f.prototype,f._init.constructor=f,f.utils={calcRdx:i,isArray:a,isFunction:u,isNumber:s,toVector:function(r){return e.apply([],r)}},f._random_fn=r.random,f.setRandom=function(r){if("function"!=typeof r)throw new TypeError("fn is not a function");f._random_fn=r},f.extend=function(r){var t,e;if(1===arguments.length){for(e in r)f[e]=r[e];return this}for(t=1;t<arguments.length;t++)for(e in arguments[t])r[e]=arguments[t][e];return r},f.rows=function(r){return r.length||1},f.cols=function(r){return r[0].length||1},f.dimensions=function(r){return{rows:f.rows(r),cols:f.cols(r)}},f.row=function(r,t){return a(t)?t.map((function(t){return f.row(r,t)})):r[t]},f.rowa=function(r,t){return f.row(r,t)},f.col=function(r,t){if(a(t)){var e=f.arange(r.length).map((function(){return new Array(t.length)}));return t.forEach((function(t,n){f.arange(r.length).forEach((function(o){e[o][n]=r[o][t]}))})),e}for(var n=new Array(r.length),o=0;o<r.length;o++)n[o]=[r[o][t]];return n},f.cola=function(r,t){return f.col(r,t).map((function(r){return r[0]}))},f.diag=function(r){for(var t=f.rows(r),e=new Array(t),n=0;n<t;n++)e[n]=[r[n][n]];return e},f.antidiag=function(r){for(var t=f.rows(r)-1,e=new Array(t),n=0;t>=0;t--,n++)e[n]=[r[n][t]];return e},f.transpose=function(r){var t,e,n,o,i,u=[];for(a(r[0])||(r=[r]),e=r.length,n=r[0].length,i=0;i<n;i++){for(t=new Array(e),o=0;o<e;o++)t[o]=r[o][i];u.push(t)}return 1===u.length?u[0]:u},f.map=function(r,t,e){var n,o,i,u,s;for(a(r[0])||(r=[r]),o=r.length,i=r[0].length,u=e?r:new Array(o),n=0;n<o;n++)for(u[n]||(u[n]=new Array(i)),s=0;s<i;s++)u[n][s]=t(r[n][s],n,s);return 1===u.length?u[0]:u},f.cumreduce=function(r,t,e){var n,o,i,u,s;for(a(r[0])||(r=[r]),o=r.length,i=r[0].length,u=e?r:new Array(o),n=0;n<o;n++)for(u[n]||(u[n]=new Array(i)),i>0&&(u[n][0]=r[n][0]),s=1;s<i;s++)u[n][s]=t(u[n][s-1],r[n][s]);return 1===u.length?u[0]:u},f.alter=function(r,t){return f.map(r,t,!0)},f.create=function(r,t,e){var n,o,i=new Array(r);for(u(t)&&(e=t,t=r),n=0;n<r;n++)for(i[n]=new Array(t),o=0;o<t;o++)i[n][o]=e(n,o);return i},f.zeros=function(r,t){return s(t)||(t=r),f.create(r,t,c)},f.ones=function(r,t){return s(t)||(t=r),f.create(r,t,l)},f.rand=function(r,t){return s(t)||(t=r),f.create(r,t,f._random_fn)},f.identity=function(r,t){return s(t)||(t=r),f.create(r,t,m)},f.symmetric=function(r){var t,e,n=r.length;if(r.length!==r[0].length)return!1;for(t=0;t<n;t++)for(e=0;e<n;e++)if(r[e][t]!==r[t][e])return!1;return!0},f.clear=function(r){return f.alter(r,c)},f.seq=function(r,t,e,n){u(n)||(n=!1);var o,a=[],s=i(r,t),f=(t*s-r*s)/((e-1)*s),c=r;for(o=0;c<=t&&o<e;c=(r*s+f*s*++o)/s)a.push(n?n(c,o):c);return a},f.arange=function(r,e,n){var o,i=[];if(n=n||1,e===t&&(e=r,r=0),r===e||0===n)return[];if(r<e&&n<0)return[];if(r>e&&n>0)return[];if(n>0)for(o=r;o<e;o+=n)i.push(o);else for(o=r;o>e;o+=n)i.push(o);return i},f.slice=function(){function r(r,e,n,o){var i,a=[],u=r.length;if(e===t&&n===t&&o===t)return f.copy(r);if(o=o||1,(e=(e=e||0)>=0?e:u+e)===(n=(n=n||r.length)>=0?n:u+n)||0===o)return[];if(e<n&&o<0)return[];if(e>n&&o>0)return[];if(o>0)for(i=e;i<n;i+=o)a.push(r[i]);else for(i=e;i>n;i+=o)a.push(r[i]);return a}return function(t,e){var n,o;return s((e=e||{}).row)?s(e.col)?t[e.row][e.col]:r(f.rowa(t,e.row),(n=e.col||{}).start,n.end,n.step):s(e.col)?r(f.cola(t,e.col),(o=e.row||{}).start,o.end,o.step):(o=e.row||{},n=e.col||{},r(t,o.start,o.end,o.step).map((function(t){return r(t,n.start,n.end,n.step)})))}}(),f.sliceAssign=function(e,n,o){var i,a;if(s(n.row)){if(s(n.col))return e[n.row][n.col]=o;n.col=n.col||{},n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1,i=f.arange(n.col.start,r.min(e.length,n.col.end),n.col.step);var u=n.row;return i.forEach((function(r,t){e[u][r]=o[t]})),e}if(s(n.col)){n.row=n.row||{},n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1,a=f.arange(n.row.start,r.min(e[0].length,n.row.end),n.row.step);var c=n.col;return a.forEach((function(r,t){e[r][c]=o[t]})),e}return o[0].length===t&&(o=[o]),n.row.start=n.row.start||0,n.row.end=n.row.end||e.length,n.row.step=n.row.step||1,n.col.start=n.col.start||0,n.col.end=n.col.end||e[0].length,n.col.step=n.col.step||1,a=f.arange(n.row.start,r.min(e.length,n.row.end),n.row.step),i=f.arange(n.col.start,r.min(e[0].length,n.col.end),n.col.step),a.forEach((function(r,t){i.forEach((function(n,i){e[r][n]=o[t][i]}))})),e},f.diagonal=function(r){var t=f.zeros(r.length,r.length);return r.forEach((function(r,e){t[e][e]=r})),t},f.copy=function(r){return r.map((function(r){return s(r)?r:r.map((function(r){return r}))}))};var p=f.prototype;return p.length=0,p.push=Array.prototype.push,p.sort=Array.prototype.sort,p.splice=Array.prototype.splice,p.slice=Array.prototype.slice,p.toArray=function(){return this.length>1?n.call(this):n.call(this)[0]},p.map=function(r,t){return f(f.map(this,r,t))},p.cumreduce=function(r,t){return f(f.cumreduce(this,r,t))},p.alter=function(r){return f.alter(this,r),this},function(r){for(var t=0;t<r.length;t++)!function(r){p[r]=function(t){var e,n=this;return t?(setTimeout((function(){t.call(n,p[r].call(n))})),this):(e=f[r](this),a(e)?f(e):e)}}(r[t])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(r){for(var t=0;t<r.length;t++)!function(r){p[r]=function(t,e){var n=this;return e?(setTimeout((function(){e.call(n,p[r].call(n,t))})),this):f(f[r](this,t))}}(r[t])}("row col".split(" ")),function(r){for(var t=0;t<r.length;t++)!function(r){p[r]=function(){return f(f[r].apply(null,arguments))}}(r[t])}("create zeros ones rand identity".split(" ")),f}(Math),function(r,t){var e=r.utils.isFunction;function n(r,t){return r-t}function o(r,e,n){return t.max(e,t.min(r,n))}r.sum=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e];return t},r.sumsqrd=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e]*r[e];return t},r.sumsqerr=function(t){for(var e,n=r.mean(t),o=0,i=t.length;--i>=0;)o+=(e=t[i]-n)*e;return o},r.sumrow=function(r){for(var t=0,e=r.length;--e>=0;)t+=r[e];return t},r.product=function(r){for(var t=1,e=r.length;--e>=0;)t*=r[e];return t},r.min=function(r){for(var t=r[0],e=0;++e<r.length;)r[e]<t&&(t=r[e]);return t},r.max=function(r){for(var t=r[0],e=0;++e<r.length;)r[e]>t&&(t=r[e]);return t},r.unique=function(r){for(var t={},e=[],n=0;n<r.length;n++)t[r[n]]||(t[r[n]]=!0,e.push(r[n]));return e},r.mean=function(t){return r.sum(t)/t.length},r.meansqerr=function(t){return r.sumsqerr(t)/t.length},r.geomean=function(e){return t.pow(r.product(e),1/e.length)},r.median=function(r){var t=r.length,e=r.slice().sort(n);return 1&t?e[t/2|0]:(e[t/2-1]+e[t/2])/2},r.cumsum=function(t){return r.cumreduce(t,(function(r,t){return r+t}))},r.cumprod=function(t){return r.cumreduce(t,(function(r,t){return r*t}))},r.diff=function(r){var t,e=[],n=r.length;for(t=1;t<n;t++)e.push(r[t]-r[t-1]);return e},r.rank=function(r){var t,e=[],o={};for(t=0;t<r.length;t++)o[s=r[t]]?o[s]++:(o[s]=1,e.push(s));var i=e.sort(n),a={},u=1;for(t=0;t<i.length;t++){var s,f=o[s=i[t]],c=(u+(u+f-1))/2;a[s]=c,u+=f}return r.map((function(r){return a[r]}))},r.mode=function(r){var t,e=r.length,o=r.slice().sort(n),i=1,a=0,u=0,s=[];for(t=0;t<e;t++)o[t]===o[t+1]?i++:(i>a?(s=[o[t]],a=i,u=0):i===a&&(s.push(o[t]),u++),i=1);return 0===u?s[0]:s},r.range=function(t){return r.max(t)-r.min(t)},r.variance=function(t,e){return r.sumsqerr(t)/(t.length-(e?1:0))},r.pooledvariance=function(t){return t.reduce((function(t,e){return t+r.sumsqerr(e)}),0)/(t.reduce((function(r,t){return r+t.length}),0)-t.length)},r.deviation=function(t){for(var e=r.mean(t),n=t.length,o=new Array(n),i=0;i<n;i++)o[i]=t[i]-e;return o},r.stdev=function(e,n){return t.sqrt(r.variance(e,n))},r.pooledstdev=function(e){return t.sqrt(r.pooledvariance(e))},r.meandev=function(e){for(var n=r.mean(e),o=[],i=e.length-1;i>=0;i--)o.push(t.abs(e[i]-n));return r.mean(o)},r.meddev=function(e){for(var n=r.median(e),o=[],i=e.length-1;i>=0;i--)o.push(t.abs(e[i]-n));return r.median(o)},r.coeffvar=function(t){return r.stdev(t)/r.mean(t)},r.quartiles=function(r){var e=r.length,o=r.slice().sort(n);return[o[t.round(e/4)-1],o[t.round(e/2)-1],o[t.round(3*e/4)-1]]},r.quantiles=function(r,e,i,a){var u,s,f,c,l,m=r.slice().sort(n),p=[e.length],v=r.length;for(void 0===i&&(i=3/8),void 0===a&&(a=3/8),u=0;u<e.length;u++)f=v*(s=e[u])+(i+s*(1-i-a)),c=t.floor(o(f,1,v-1)),l=o(f-c,0,1),p[u]=(1-l)*m[c-1]+l*m[c];return p},r.percentile=function(r,t,e){var o=r.slice().sort(n),i=t*(o.length+(e?1:-1))+(e?0:1),a=parseInt(i),u=i-a;return a+1<o.length?o[a-1]+u*(o[a]-o[a-1]):o[a-1]},r.percentileOfScore=function(r,t,e){var n,o,i=0,a=r.length,u=!1;for("strict"===e&&(u=!0),o=0;o<a;o++)n=r[o],(u&&n<t||!u&&n<=t)&&i++;return i/a},r.histogram=function(e,n){n=n||4;var o,i=r.min(e),a=(r.max(e)-i)/n,u=e.length,s=[];for(o=0;o<n;o++)s[o]=0;for(o=0;o<u;o++)s[t.min(t.floor((e[o]-i)/a),n-1)]+=1;return s},r.covariance=function(t,e){var n,o=r.mean(t),i=r.mean(e),a=t.length,u=new Array(a);for(n=0;n<a;n++)u[n]=(t[n]-o)*(e[n]-i);return r.sum(u)/(a-1)},r.corrcoeff=function(t,e){return r.covariance(t,e)/r.stdev(t,1)/r.stdev(e,1)},r.spearmancoeff=function(t,e){return t=r.rank(t),e=r.rank(e),r.corrcoeff(t,e)},r.stanMoment=function(e,n){for(var o=r.mean(e),i=r.stdev(e),a=e.length,u=0,s=0;s<a;s++)u+=t.pow((e[s]-o)/i,n);return u/e.length},r.skewness=function(t){return r.stanMoment(t,3)},r.kurtosis=function(t){return r.stanMoment(t,4)-3};var i=r.prototype;!function(t){for(var n=0;n<t.length;n++)!function(t){i[t]=function(n,o){var a=[],u=0,s=this;if(e(n)&&(o=n,n=!1),o)return setTimeout((function(){o.call(s,i[t].call(s,n))})),this;if(this.length>1){for(s=!0===n?this:this.transpose();u<s.length;u++)a[u]=r[t](s[u]);return a}return r[t](this[0],n)}}(t[n])}("cumsum cumprod".split(" ")),function(t){for(var n=0;n<t.length;n++)!function(t){i[t]=function(n,o){var a=[],u=0,s=this;if(e(n)&&(o=n,n=!1),o)return setTimeout((function(){o.call(s,i[t].call(s,n))})),this;if(this.length>1){for("sumrow"!==t&&(s=!0===n?this:this.transpose());u<s.length;u++)a[u]=r[t](s[u]);return!0===n?r[t](r.utils.toVector(a)):a}return r[t](this[0],n)}}(t[n])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(t){for(var n=0;n<t.length;n++)!function(t){i[t]=function(){var n,o=[],a=0,u=this,s=Array.prototype.slice.call(arguments);if(e(s[s.length-1])){n=s[s.length-1];var f=s.slice(0,s.length-1);return setTimeout((function(){n.call(u,i[t].apply(u,f))})),this}n=void 0;var c=function(e){return r[t].apply(u,[e].concat(s))};if(this.length>1){for(u=u.transpose();a<u.length;a++)o[a]=c(u[a]);return o}return c(this[0])}}(t[n])}("quantiles percentileOfScore".split(" "))}(t,Math),function(r,t){r.gammaln=function(r){var e,n,o,i=0,a=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],u=1.000000000190015;for(o=(n=e=r)+5.5,o-=(e+.5)*t.log(o);i<6;i++)u+=a[i]/++n;return t.log(2.5066282746310007*u/e)-o},r.loggam=function(r){var e,n,o,i,a,u,s,f=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(e=r,s=0,1==r||2==r)return 0;for(r<=7&&(e=r+(s=t.floor(7-r))),n=1/(e*e),o=2*t.PI,a=f[9],u=8;u>=0;u--)a*=n,a+=f[u];if(i=a/e+.5*t.log(o)+(e-.5)*t.log(e)-e,r<=7)for(u=1;u<=s;u++)i-=t.log(e-1),e-=1;return i},r.gammafn=function(r){var e,n,o,i,a=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],u=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],s=!1,f=0,c=0,l=0,m=r;if(r>171.6243769536076)return 1/0;if(m<=0){if(!(i=m%1+36e-17))return 1/0;s=(1&m?-1:1)*t.PI/t.sin(t.PI*i),m=1-m}for(o=m,n=m<1?m++:(m-=f=(0|m)-1)-1,e=0;e<8;++e)l=(l+a[e])*n,c=c*n+u[e];if(i=l/c+1,o<m)i/=o;else if(o>m)for(e=0;e<f;++e)i*=m,m++;return s&&(i=s/i),i},r.gammap=function(t,e){return r.lowRegGamma(t,e)*r.gammafn(t)},r.lowRegGamma=function(e,n){var o,i=r.gammaln(e),a=e,u=1/e,s=u,f=n+1-e,c=1/1e-30,l=1/f,m=l,p=1,v=-~(8.5*t.log(e>=1?e:1/e)+.4*e+17);if(n<0||e<=0)return NaN;if(n<e+1){for(;p<=v;p++)u+=s*=n/++a;return u*t.exp(-n+e*t.log(n)-i)}for(;p<=v;p++)m*=(l=1/(l=(o=-p*(p-e))*l+(f+=2)))*(c=f+o/c);return 1-m*t.exp(-n+e*t.log(n)-i)},r.factorialln=function(t){return t<0?NaN:r.gammaln(t+1)},r.factorial=function(t){return t<0?NaN:r.gammafn(t+1)},r.combination=function(e,n){return e>170||n>170?t.exp(r.combinationln(e,n)):r.factorial(e)/r.factorial(n)/r.factorial(e-n)},r.combinationln=function(t,e){return r.factorialln(t)-r.factorialln(e)-r.factorialln(t-e)},r.permutation=function(t,e){return r.factorial(t)/r.factorial(t-e)},r.betafn=function(e,n){if(!(e<=0||n<=0))return e+n>170?t.exp(r.betaln(e,n)):r.gammafn(e)*r.gammafn(n)/r.gammafn(e+n)},r.betaln=function(t,e){return r.gammaln(t)+r.gammaln(e)-r.gammaln(t+e)},r.betacf=function(r,e,n){var o,i,a,u,s=1e-30,f=1,c=e+n,l=e+1,m=e-1,p=1,v=1-c*r/l;for(t.abs(v)<s&&(v=s),u=v=1/v;f<=100&&(v=1+(i=f*(n-f)*r/((m+(o=2*f))*(e+o)))*v,t.abs(v)<s&&(v=s),p=1+i/p,t.abs(p)<s&&(p=s),u*=(v=1/v)*p,v=1+(i=-(e+f)*(c+f)*r/((e+o)*(l+o)))*v,t.abs(v)<s&&(v=s),p=1+i/p,t.abs(p)<s&&(p=s),u*=a=(v=1/v)*p,!(t.abs(a-1)<3e-7));f++);return u},r.gammapinv=function(e,n){var o,i,a,u,s,f,c=0,l=n-1,m=r.gammaln(n);if(e>=1)return t.max(100,n+100*t.sqrt(n));if(e<=0)return 0;for(n>1?(s=t.log(l),f=t.exp(l*(s-1)-m),u=e<.5?e:1-e,o=(2.30753+.27061*(i=t.sqrt(-2*t.log(u))))/(1+i*(.99229+.04481*i))-i,e<.5&&(o=-o),o=t.max(.001,n*t.pow(1-1/(9*n)-o/(3*t.sqrt(n)),3))):o=e<(i=1-n*(.253+.12*n))?t.pow(e/i,1/n):1-t.log(1-(e-i)/(1-i));c<12;c++){if(o<=0)return 0;if((o-=i=(a=(r.lowRegGamma(n,o)-e)/(i=n>1?f*t.exp(-(o-l)+l*(t.log(o)-s)):t.exp(-o+l*t.log(o)-m)))/(1-.5*t.min(1,a*((n-1)/o-1))))<=0&&(o=.5*(o+i)),t.abs(i)<1e-8*o)break}return o},r.erf=function(r){var e,n,o,i,a=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],u=a.length-1,s=!1,f=0,c=0;for(r<0&&(r=-r,s=!0),n=4*(e=2/(2+r))-2;u>0;u--)o=f,f=n*f-c+a[u],c=o;return i=e*t.exp(-r*r+.5*(a[0]+n*f)-c),s?i-1:1-i},r.erfc=function(t){return 1-r.erf(t)},r.erfcinv=function(e){var n,o,i,a,u=0;if(e>=2)return-100;if(e<=0)return 100;for(a=e<1?e:2-e,n=-.70711*((2.30753+.27061*(i=t.sqrt(-2*t.log(a/2))))/(1+i*(.99229+.04481*i))-i);u<2;u++)n+=(o=r.erfc(n)-a)/(1.1283791670955126*t.exp(-n*n)-n*o);return e<1?n:-n},r.ibetainv=function(e,n,o){var i,a,u,s,f,c,l,m,p,v,d=n-1,_=o-1,g=0;if(e<=0)return 0;if(e>=1)return 1;for(n>=1&&o>=1?(u=e<.5?e:1-e,c=(2.30753+.27061*(s=t.sqrt(-2*t.log(u))))/(1+s*(.99229+.04481*s))-s,e<.5&&(c=-c),l=(c*c-3)/6,m=2/(1/(2*n-1)+1/(2*o-1)),p=c*t.sqrt(l+m)/m-(1/(2*o-1)-1/(2*n-1))*(l+5/6-2/(3*m)),c=n/(n+o*t.exp(2*p))):(i=t.log(n/(n+o)),a=t.log(o/(n+o)),c=e<(s=t.exp(n*i)/n)/(p=s+(f=t.exp(o*a)/o))?t.pow(n*p*e,1/n):1-t.pow(o*p*(1-e),1/o)),v=-r.gammaln(n)-r.gammaln(o)+r.gammaln(n+o);g<10;g++){if(0===c||1===c)return c;if((c-=s=(f=(r.ibeta(c,n,o)-e)/(s=t.exp(d*t.log(c)+_*t.log(1-c)+v)))/(1-.5*t.min(1,f*(d/c-_/(1-c)))))<=0&&(c=.5*(c+s)),c>=1&&(c=.5*(c+s+1)),t.abs(s)<1e-8*c&&g>0)break}return c},r.ibeta=function(e,n,o){var i=0===e||1===e?0:t.exp(r.gammaln(n+o)-r.gammaln(n)-r.gammaln(o)+n*t.log(e)+o*t.log(1-e));return!(e<0||e>1)&&(e<(n+1)/(n+o+2)?i*r.betacf(e,n,o)/n:1-i*r.betacf(1-e,o,n)/o)},r.randn=function(e,n){var o,i,a,u,s;if(n||(n=e),e)return r.create(e,n,(function(){return r.randn()}));do{o=r._random_fn(),i=1.7156*(r._random_fn()-.5),s=(a=o-.449871)*a+(u=t.abs(i)+.386595)*(.196*u-.25472*a)}while(s>.27597&&(s>.27846||i*i>-4*t.log(o)*o*o));return i/o},r.randg=function(e,n,o){var i,a,u,s,f,c,l=e;if(o||(o=n),e||(e=1),n)return(c=r.zeros(n,o)).alter((function(){return r.randg(e)})),c;e<1&&(e+=1),i=e-1/3,a=1/t.sqrt(9*i);do{do{s=1+a*(f=r.randn())}while(s<=0);s*=s*s,u=r._random_fn()}while(u>1-.331*t.pow(f,4)&&t.log(u)>.5*f*f+i*(1-s+t.log(s)));if(e==l)return i*s;do{u=r._random_fn()}while(0===u);return t.pow(u,1/l)*i*s},function(t){for(var e=0;e<t.length;e++)!function(t){r.fn[t]=function(){return r(r.map(this,(function(e){return r[t](e)})))}}(t[e])}("gammaln gammafn factorial factorialln".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){r.fn[t]=function(){return r(r[t].apply(null,arguments))}}(t[e])}("randn".split(" "))}(t,Math),function(r,t){function e(r,e,n,o){for(var i,a=0,u=1,s=1,f=1,c=0,l=0;t.abs((s-l)/s)>o;)l=s,u=f+(i=-(e+c)*(e+n+c)*r/(e+2*c)/(e+2*c+1))*u,s=(a=s+i*a)+(i=(c+=1)*(n-c)*r/(e+2*c-1)/(e+2*c))*s,a/=f=u+i*f,u/=f,s/=f,f=1;return s/e}function n(e,n,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],a=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],u=.5*e;if(u>=8)return 1;var s,f=2*r.normal.cdf(u,0,1,1,0)-1;f=f>=t.exp(-50/o)?t.pow(f,o):0;for(var c=u,l=(8-u)/(s=e>3?2:3),m=c+l,p=0,v=o-1,d=1;d<=s;d++){for(var _=0,g=.5*(m+c),h=.5*(m-c),y=1;y<=12;y++){var b,A=g+h*(6<y?i[(b=12-y+1)-1]:-i[(b=y)-1]),S=A*A;if(S>60)break;var T=2*r.normal.cdf(A,0,1,1,0)*.5-2*r.normal.cdf(A,e,1,1,0)*.5;T>=t.exp(-30/v)&&(_+=T=a[b-1]*t.exp(-.5*S)*t.pow(T,v))}p+=_*=2*h*o/t.sqrt(2*t.PI),c=m,m+=l}return(f+=p)<=t.exp(-30/n)?0:(f=t.pow(f,n))>=1?1:f}!function(t){for(var e=0;e<t.length;e++)!function(t){r[t]=function r(t,e,n){return this instanceof r?(this._a=t,this._b=e,this._c=n,this):new r(t,e,n)},r.fn[t]=function(e,n,o){var i=r[t](e,n,o);return i.data=this,i},r[t].prototype.sample=function(e){var n=this._a,o=this._b,i=this._c;return e?r.alter(e,(function(){return r[t].sample(n,o,i)})):r[t].sample(n,o,i)},function(e){for(var n=0;n<e.length;n++)!function(e){r[t].prototype[e]=function(n){var o=this._a,i=this._b,a=this._c;return n||0===n||(n=this.data),"number"!=typeof n?r.fn.map.call(n,(function(n){return r[t][e](n,o,i,a)})):r[t][e](n,o,i,a)}}(e[n])}("pdf cdf inv".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){r[t].prototype[e]=function(){return r[t][e](this._a,this._b,this._c)}}(e[n])}("mean median mode variance".split(" "))}(t[e])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),r.extend(r.beta,{pdf:function(e,n,o){return e>1||e<0?0:1==n&&1==o?1:n<512&&o<512?t.pow(e,n-1)*t.pow(1-e,o-1)/r.betafn(n,o):t.exp((n-1)*t.log(e)+(o-1)*t.log(1-e)-r.betaln(n,o))},cdf:function(t,e,n){return t>1||t<0?1*(t>1):r.ibeta(t,e,n)},inv:function(t,e,n){return r.ibetainv(t,e,n)},mean:function(r,t){return r/(r+t)},median:function(t,e){return r.ibetainv(.5,t,e)},mode:function(r,t){return(r-1)/(r+t-2)},sample:function(t,e){var n=r.randg(t);return n/(n+r.randg(e))},variance:function(r,e){return r*e/(t.pow(r+e,2)*(r+e+1))}}),r.extend(r.centralF,{pdf:function(e,n,o){var i;return e<0?0:n<=2?0===e&&n<2?1/0:0===e&&2===n?1:1/r.betafn(n/2,o/2)*t.pow(n/o,n/2)*t.pow(e,n/2-1)*t.pow(1+n/o*e,-(n+o)/2):(i=n*e/(o+e*n),n*(o/(o+e*n))/2*r.binomial.pdf((n-2)/2,(n+o-2)/2,i))},cdf:function(t,e,n){return t<0?0:r.ibeta(e*t/(e*t+n),e/2,n/2)},inv:function(t,e,n){return n/(e*(1/r.ibetainv(t,e/2,n/2)-1))},mean:function(r,t){return t>2?t/(t-2):void 0},mode:function(r,t){return r>2?t*(r-2)/(r*(t+2)):void 0},sample:function(t,e){return 2*r.randg(t/2)/t/(2*r.randg(e/2)/e)},variance:function(r,t){if(!(t<=4))return 2*t*t*(r+t-2)/(r*(t-2)*(t-2)*(t-4))}}),r.extend(r.cauchy,{pdf:function(r,e,n){return n<0?0:n/(t.pow(r-e,2)+t.pow(n,2))/t.PI},cdf:function(r,e,n){return t.atan((r-e)/n)/t.PI+.5},inv:function(r,e,n){return e+n*t.tan(t.PI*(r-.5))},median:function(r){return r},mode:function(r){return r},sample:function(e,n){return r.randn()*t.sqrt(1/(2*r.randg(.5)))*n+e}}),r.extend(r.chisquare,{pdf:function(e,n){return e<0?0:0===e&&2===n?.5:t.exp((n/2-1)*t.log(e)-e/2-n/2*t.log(2)-r.gammaln(n/2))},cdf:function(t,e){return t<0?0:r.lowRegGamma(e/2,t/2)},inv:function(t,e){return 2*r.gammapinv(t,.5*e)},mean:function(r){return r},median:function(r){return r*t.pow(1-2/(9*r),3)},mode:function(r){return r-2>0?r-2:0},sample:function(t){return 2*r.randg(t/2)},variance:function(r){return 2*r}}),r.extend(r.exponential,{pdf:function(r,e){return r<0?0:e*t.exp(-e*r)},cdf:function(r,e){return r<0?0:1-t.exp(-e*r)},inv:function(r,e){return-t.log(1-r)/e},mean:function(r){return 1/r},median:function(r){return 1/r*t.log(2)},mode:function(){return 0},sample:function(e){return-1/e*t.log(r._random_fn())},variance:function(r){return t.pow(r,-2)}}),r.extend(r.gamma,{pdf:function(e,n,o){return e<0?0:0===e&&1===n?1/o:t.exp((n-1)*t.log(e)-e/o-r.gammaln(n)-n*t.log(o))},cdf:function(t,e,n){return t<0?0:r.lowRegGamma(e,t/n)},inv:function(t,e,n){return r.gammapinv(t,e)*n},mean:function(r,t){return r*t},mode:function(r,t){if(r>1)return(r-1)*t},sample:function(t,e){return r.randg(t)*e},variance:function(r,t){return r*t*t}}),r.extend(r.invgamma,{pdf:function(e,n,o){return e<=0?0:t.exp(-(n+1)*t.log(e)-o/e-r.gammaln(n)+n*t.log(o))},cdf:function(t,e,n){return t<=0?0:1-r.lowRegGamma(e,n/t)},inv:function(t,e,n){return n/r.gammapinv(1-t,e)},mean:function(r,t){return r>1?t/(r-1):void 0},mode:function(r,t){return t/(r+1)},sample:function(t,e){return e/r.randg(t)},variance:function(r,t){if(!(r<=2))return t*t/((r-1)*(r-1)*(r-2))}}),r.extend(r.kumaraswamy,{pdf:function(r,e,n){return 0===r&&1===e?n:1===r&&1===n?e:t.exp(t.log(e)+t.log(n)+(e-1)*t.log(r)+(n-1)*t.log(1-t.pow(r,e)))},cdf:function(r,e,n){return r<0?0:r>1?1:1-t.pow(1-t.pow(r,e),n)},inv:function(r,e,n){return t.pow(1-t.pow(1-r,1/n),1/e)},mean:function(t,e){return e*r.gammafn(1+1/t)*r.gammafn(e)/r.gammafn(1+1/t+e)},median:function(r,e){return t.pow(1-t.pow(2,-1/e),1/r)},mode:function(r,e){if(r>=1&&e>=1&&1!==r&&1!==e)return t.pow((r-1)/(r*e-1),1/r)},variance:function(){throw new Error("variance not yet implemented")}}),r.extend(r.lognormal,{pdf:function(r,e,n){return r<=0?0:t.exp(-t.log(r)-.5*t.log(2*t.PI)-t.log(n)-t.pow(t.log(r)-e,2)/(2*n*n))},cdf:function(e,n,o){return e<0?0:.5+.5*r.erf((t.log(e)-n)/t.sqrt(2*o*o))},inv:function(e,n,o){return t.exp(-1.4142135623730951*o*r.erfcinv(2*e)+n)},mean:function(r,e){return t.exp(r+e*e/2)},median:function(r){return t.exp(r)},mode:function(r,e){return t.exp(r-e*e)},sample:function(e,n){return t.exp(r.randn()*n+e)},variance:function(r,e){return(t.exp(e*e)-1)*t.exp(2*r+e*e)}}),r.extend(r.noncentralt,{pdf:function(e,n,o){return t.abs(o)<1e-14?r.studentt.pdf(e,n):t.abs(e)<1e-14?t.exp(r.gammaln((n+1)/2)-o*o/2-.5*t.log(t.PI*n)-r.gammaln(n/2)):n/e*(r.noncentralt.cdf(e*t.sqrt(1+2/n),n+2,o)-r.noncentralt.cdf(e,n,o))},cdf:function(e,n,o){var i=1e-14;if(t.abs(o)<i)return r.studentt.cdf(e,n);var a=!1;e<0&&(a=!0,o=-o);for(var u=r.normal.cdf(-o,0,1),s=i+1,f=s,c=e*e/(e*e+n),l=0,m=t.exp(-o*o/2),p=t.exp(-o*o/2-.5*t.log(2)-r.gammaln(1.5))*o;l<200||f>i||s>i;)f=s,l>0&&(m*=o*o/(2*l),p*=o*o/(2*(l+.5))),u+=.5*(s=m*r.beta.cdf(c,l+.5,n/2)+p*r.beta.cdf(c,l+1,n/2)),l++;return a?1-u:u}}),r.extend(r.normal,{pdf:function(r,e,n){return t.exp(-.5*t.log(2*t.PI)-t.log(n)-t.pow(r-e,2)/(2*n*n))},cdf:function(e,n,o){return.5*(1+r.erf((e-n)/t.sqrt(2*o*o)))},inv:function(t,e,n){return-1.4142135623730951*n*r.erfcinv(2*t)+e},mean:function(r){return r},median:function(r){return r},mode:function(r){return r},sample:function(t,e){return r.randn()*e+t},variance:function(r,t){return t*t}}),r.extend(r.pareto,{pdf:function(r,e,n){return r<e?0:n*t.pow(e,n)/t.pow(r,n+1)},cdf:function(r,e,n){return r<e?0:1-t.pow(e/r,n)},inv:function(r,e,n){return e/t.pow(1-r,1/n)},mean:function(r,e){if(!(e<=1))return e*t.pow(r,e)/(e-1)},median:function(r,e){return r*(e*t.SQRT2)},mode:function(r){return r},variance:function(r,e){if(!(e<=2))return r*r*e/(t.pow(e-1,2)*(e-2))}}),r.extend(r.studentt,{pdf:function(e,n){return n=n>1e100?1e100:n,1/(t.sqrt(n)*r.betafn(.5,n/2))*t.pow(1+e*e/n,-(n+1)/2)},cdf:function(e,n){var o=n/2;return r.ibeta((e+t.sqrt(e*e+n))/(2*t.sqrt(e*e+n)),o,o)},inv:function(e,n){var o=r.ibetainv(2*t.min(e,1-e),.5*n,.5);return o=t.sqrt(n*(1-o)/o),e>.5?o:-o},mean:function(r){return r>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(e){return r.randn()*t.sqrt(e/(2*r.randg(e/2)))},variance:function(r){return r>2?r/(r-2):r>1?1/0:void 0}}),r.extend(r.weibull,{pdf:function(r,e,n){return r<0||e<0||n<0?0:n/e*t.pow(r/e,n-1)*t.exp(-t.pow(r/e,n))},cdf:function(r,e,n){return r<0?0:1-t.exp(-t.pow(r/e,n))},inv:function(r,e,n){return e*t.pow(-t.log(1-r),1/n)},mean:function(t,e){return t*r.gammafn(1+1/e)},median:function(r,e){return r*t.pow(t.log(2),1/e)},mode:function(r,e){return e<=1?0:r*t.pow((e-1)/e,1/e)},sample:function(e,n){return e*t.pow(-t.log(r._random_fn()),1/n)},variance:function(e,n){return e*e*r.gammafn(1+2/n)-t.pow(r.weibull.mean(e,n),2)}}),r.extend(r.uniform,{pdf:function(r,t,e){return r<t||r>e?0:1/(e-t)},cdf:function(r,t,e){return r<t?0:r<e?(r-t)/(e-t):1},inv:function(r,t,e){return t+r*(e-t)},mean:function(r,t){return.5*(r+t)},median:function(t,e){return r.mean(t,e)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(t,e){return t/2+e/2+(e/2-t/2)*(2*r._random_fn()-1)},variance:function(r,e){return t.pow(e-r,2)/12}}),r.extend(r.binomial,{pdf:function(e,n,o){return 0===o||1===o?n*o===e?1:0:r.combination(n,e)*t.pow(o,e)*t.pow(1-o,n-e)},cdf:function(n,o,i){var a,u=1e-10;if(n<0)return 0;if(n>=o)return 1;if(i<0||i>1||o<=0)return NaN;var s=i,f=(n=t.floor(n))+1,c=o-n,l=f+c,m=t.exp(r.gammaln(l)-r.gammaln(c)-r.gammaln(f)+f*t.log(s)+c*t.log(1-s));return a=s<(f+1)/(l+2)?m*e(s,f,c,u):1-m*e(1-s,c,f,u),t.round(1/u*(1-a))/(1/u)}}),r.extend(r.negbin,{pdf:function(e,n,o){return e===e>>>0&&(e<0?0:r.combination(e+n-1,n-1)*t.pow(1-o,e)*t.pow(o,n))},cdf:function(t,e,n){var o=0,i=0;if(t<0)return 0;for(;i<=t;i++)o+=r.negbin.pdf(i,e,n);return o}}),r.extend(r.hypgeom,{pdf:function(e,n,o,i){if(e!=e|0)return!1;if(e<0||e<o-(n-i))return 0;if(e>i||e>o)return 0;if(2*o>n)return 2*i>n?r.hypgeom.pdf(n-o-i+e,n,n-o,n-i):r.hypgeom.pdf(i-e,n,n-o,i);if(2*i>n)return r.hypgeom.pdf(o-e,n,o,n-i);if(o<i)return r.hypgeom.pdf(e,n,i,o);for(var a=1,u=0,s=0;s<e;s++){for(;a>1&&u<i;)a*=1-o/(n-u),u++;a*=(i-s)*(o-s)/((s+1)*(n-o-i+s+1))}for(;u<i;u++)a*=1-o/(n-u);return t.min(1,t.max(0,a))},cdf:function(e,n,o,i){if(e<0||e<o-(n-i))return 0;if(e>=i||e>=o)return 1;if(2*o>n)return 2*i>n?r.hypgeom.cdf(n-o-i+e,n,n-o,n-i):1-r.hypgeom.cdf(i-e-1,n,n-o,i);if(2*i>n)return 1-r.hypgeom.cdf(o-e-1,n,o,n-i);if(o<i)return r.hypgeom.cdf(e,n,i,o);for(var a=1,u=1,s=0,f=0;f<e;f++){for(;a>1&&s<i;){var c=1-o/(n-s);u*=c,a*=c,s++}a+=u*=(i-f)*(o-f)/((f+1)*(n-o-i+f+1))}for(;s<i;s++)a*=1-o/(n-s);return t.min(1,t.max(0,a))}}),r.extend(r.poisson,{pdf:function(e,n){return n<0||e%1!=0||e<0?0:t.pow(n,e)*t.exp(-n)/r.factorial(e)},cdf:function(t,e){var n=[],o=0;if(t<0)return 0;for(;o<=t;o++)n.push(r.poisson.pdf(o,e));return r.sum(n)},mean:function(r){return r},variance:function(r){return r},sampleSmall:function(e){var n=1,o=0,i=t.exp(-e);do{o++,n*=r._random_fn()}while(n>i);return o-1},sampleLarge:function(e){var n,o,i,a,u,s,f,c,l,m,p=e;for(a=t.sqrt(p),u=t.log(p),s=.02483*(f=.931+2.53*a)-.059,c=1.1239+1.1328/(f-3.4),l=.9277-3.6224/(f-2);;){if(o=t.random()-.5,i=t.random(),m=.5-t.abs(o),n=t.floor((2*s/m+f)*o+p+.43),m>=.07&&i<=l)return n;if(!(n<0||m<.013&&i>m)&&t.log(i)+t.log(c)-t.log(s/(m*m)+f)<=n*u-p-r.loggam(n+1))return n}},sample:function(r){return r<10?this.sampleSmall(r):this.sampleLarge(r)}}),r.extend(r.triangular,{pdf:function(r,t,e,n){return e<=t||n<t||n>e?NaN:r<t||r>e?0:r<n?2*(r-t)/((e-t)*(n-t)):r===n?2/(e-t):2*(e-r)/((e-t)*(e-n))},cdf:function(r,e,n,o){return n<=e||o<e||o>n?NaN:r<=e?0:r>=n?1:r<=o?t.pow(r-e,2)/((n-e)*(o-e)):1-t.pow(n-r,2)/((n-e)*(n-o))},inv:function(r,e,n,o){return n<=e||o<e||o>n?NaN:r<=(o-e)/(n-e)?e+(n-e)*t.sqrt(r*((o-e)/(n-e))):e+(n-e)*(1-t.sqrt((1-r)*(1-(o-e)/(n-e))))},mean:function(r,t,e){return(r+t+e)/3},median:function(r,e,n){return n<=(r+e)/2?e-t.sqrt((e-r)*(e-n))/t.sqrt(2):n>(r+e)/2?r+t.sqrt((e-r)*(n-r))/t.sqrt(2):void 0},mode:function(r,t,e){return e},sample:function(e,n,o){var i=r._random_fn();return i<(o-e)/(n-e)?e+t.sqrt(i*(n-e)*(o-e)):n-t.sqrt((1-i)*(n-e)*(n-o))},variance:function(r,t,e){return(r*r+t*t+e*e-r*t-r*e-t*e)/18}}),r.extend(r.arcsine,{pdf:function(r,e,n){return n<=e?NaN:r<=e||r>=n?0:2/t.PI*t.pow(t.pow(n-e,2)-t.pow(2*r-e-n,2),-.5)},cdf:function(r,e,n){return r<e?0:r<n?2/t.PI*t.asin(t.sqrt((r-e)/(n-e))):1},inv:function(r,e,n){return e+(.5-.5*t.cos(t.PI*r))*(n-e)},mean:function(r,t){return t<=r?NaN:(r+t)/2},median:function(r,t){return t<=r?NaN:(r+t)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(e,n){return(e+n)/2+(n-e)/2*t.sin(2*t.PI*r.uniform.sample(0,1))},variance:function(r,e){return e<=r?NaN:t.pow(e-r,2)/8}}),r.extend(r.laplace,{pdf:function(r,e,n){return n<=0?0:t.exp(-t.abs(r-e)/n)/(2*n)},cdf:function(r,e,n){return n<=0?0:r<e?.5*t.exp((r-e)/n):1-.5*t.exp(-(r-e)/n)},mean:function(r){return r},median:function(r){return r},mode:function(r){return r},variance:function(r,t){return 2*t*t},sample:function(e,n){var o,i=r._random_fn()-.5;return e-n*((o=i)/t.abs(o))*t.log(1-2*t.abs(i))}}),r.extend(r.tukey,{cdf:function(e,o,i){var a=o,u=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],s=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(e<=0)return 0;if(i<2||a<2)return NaN;if(!Number.isFinite(e))return 1;if(i>25e3)return n(e,1,a);var f,c=.5*i,l=c*t.log(i)-i*t.log(2)-r.gammaln(c),m=c-1,p=.25*i;f=i<=100?1:i<=800?.5:i<=5e3?.25:.125,l+=t.log(f);for(var v=0,d=1;d<=50;d++){for(var _=0,g=(2*d-1)*f,h=1;h<=16;h++){var y,b;8<h?(y=h-8-1,b=l+m*t.log(g+u[y]*f)-(u[y]*f+g)*p):(y=h-1,b=l+m*t.log(g-u[y]*f)+(u[y]*f-g)*p),b>=-30&&(_+=n(8<h?e*t.sqrt(.5*(u[y]*f+g)):e*t.sqrt(.5*(-u[y]*f+g)),1,a)*s[y]*t.exp(b))}if(d*f>=1&&_<=1e-14)break;v+=_}if(_>1e-14)throw new Error("tukey.cdf failed to converge");return v>1&&(v=1),v},inv:function(e,n,o){if(o<2||n<2)return NaN;if(e<0||e>1)return NaN;if(0===e)return 0;if(1===e)return 1/0;var i,a=function(r,e,n){var o=.5-.5*r,i=t.sqrt(t.log(1/(o*o))),a=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);n<120&&(a+=(a*a*a+a)/n/4);var u=.8832-.2368*a;return n<120&&(u+=-1.214/n+1.208*a/n),a*(u*t.log(e-1)+1.4142)}(e,n,o),u=r.tukey.cdf(a,n,o)-e;i=u>0?t.max(0,a-1):a+1;for(var s,f=r.tukey.cdf(i,n,o)-e,c=1;c<50;c++)if(s=i-f*(i-a)/(f-u),u=f,a=i,s<0&&(s=0,f=-e),f=r.tukey.cdf(s,n,o)-e,i=s,t.abs(i-a)<1e-4)return s;throw new Error("tukey.inv failed to converge")}})}(t,Math),function(r,t){var e,n,o=Array.prototype.push,i=r.utils.isArray;function a(t){return i(t)||t instanceof r}r.extend({add:function(t,e){return a(e)?(a(e[0])||(e=[e]),r.map(t,(function(r,t,n){return r+e[t][n]}))):r.map(t,(function(r){return r+e}))},subtract:function(t,e){return a(e)?(a(e[0])||(e=[e]),r.map(t,(function(r,t,n){return r-e[t][n]||0}))):r.map(t,(function(r){return r-e}))},divide:function(t,e){return a(e)?(a(e[0])||(e=[e]),r.multiply(t,r.inv(e))):r.map(t,(function(r){return r/e}))},multiply:function(t,e){var n,o,i,u,s,f,c,l;if(void 0===t.length&&void 0===e.length)return t*e;if(s=t.length,f=t[0].length,c=r.zeros(s,i=a(e)?e[0].length:f),l=0,a(e)){for(;l<i;l++)for(n=0;n<s;n++){for(u=0,o=0;o<f;o++)u+=t[n][o]*e[o][l];c[n][l]=u}return 1===s&&1===l?c[0][0]:c}return r.map(t,(function(r){return r*e}))},outer:function(t,e){return r.multiply(t.map((function(r){return[r]})),[e])},dot:function(t,e){a(t[0])||(t=[t]),a(e[0])||(e=[e]);for(var n,o,i=1===t[0].length&&1!==t.length?r.transpose(t):t,u=1===e[0].length&&1!==e.length?r.transpose(e):e,s=[],f=0,c=i.length,l=i[0].length;f<c;f++){for(s[f]=[],n=0,o=0;o<l;o++)n+=i[f][o]*u[f][o];s[f]=n}return 1===s.length?s[0]:s},pow:function(e,n){return r.map(e,(function(r){return t.pow(r,n)}))},exp:function(e){return r.map(e,(function(r){return t.exp(r)}))},log:function(e){return r.map(e,(function(r){return t.log(r)}))},abs:function(e){return r.map(e,(function(r){return t.abs(r)}))},norm:function(r,e){var n=0,o=0;for(isNaN(e)&&(e=2),a(r[0])&&(r=r[0]);o<r.length;o++)n+=t.pow(t.abs(r[o]),e);return t.pow(n,1/e)},angle:function(e,n){return t.acos(r.dot(e,n)/(r.norm(e)*r.norm(n)))},aug:function(r,t){var e,n=[];for(e=0;e<r.length;e++)n.push(r[e].slice());for(e=0;e<n.length;e++)o.apply(n[e],t[e]);return n},inv:function(t){for(var e,n=t.length,o=t[0].length,i=r.identity(n,o),a=r.gauss_jordan(t,i),u=[],s=0;s<n;s++)for(u[s]=[],e=o;e<a[0].length;e++)u[s][e-o]=a[s][e];return u},det:function(r){var t,e=r.length,n=2*e,o=new Array(n),i=e-1,a=n-1,u=i-e+1,s=a,f=0,c=0;if(2===e)return r[0][0]*r[1][1]-r[0][1]*r[1][0];for(;f<n;f++)o[f]=1;for(f=0;f<e;f++){for(t=0;t<e;t++)o[u<0?u+e:u]*=r[f][t],o[s<e?s+e:s]*=r[f][t],u++,s--;u=--i-e+1,s=--a}for(f=0;f<e;f++)c+=o[f];for(;f<n;f++)c-=o[f];return c},gauss_elimination:function(e,n){var o,i,a,u,s=0,f=0,c=e.length,l=e[0].length,m=1,p=0,v=[];for(o=(e=r.aug(e,n))[0].length,s=0;s<c;s++){for(i=e[s][s],f=s,u=s+1;u<l;u++)i<t.abs(e[u][s])&&(i=e[u][s],f=u);if(f!=s)for(u=0;u<o;u++)a=e[s][u],e[s][u]=e[f][u],e[f][u]=a;for(f=s+1;f<c;f++)for(m=e[f][s]/e[s][s],u=s;u<o;u++)e[f][u]=e[f][u]-m*e[s][u]}for(s=c-1;s>=0;s--){for(p=0,f=s+1;f<=c-1;f++)p+=v[f]*e[s][f];v[s]=(e[s][o-1]-p)/e[s][s]}return v},gauss_jordan:function(e,n){var o,i,a,u=r.aug(e,n),s=u.length,f=u[0].length,c=0;for(i=0;i<s;i++){var l=i;for(a=i+1;a<s;a++)t.abs(u[a][i])>t.abs(u[l][i])&&(l=a);var m=u[i];for(u[i]=u[l],u[l]=m,a=i+1;a<s;a++)for(c=u[a][i]/u[i][i],o=i;o<f;o++)u[a][o]-=u[i][o]*c}for(i=s-1;i>=0;i--){for(c=u[i][i],a=0;a<i;a++)for(o=f-1;o>i-1;o--)u[a][o]-=u[i][o]*u[a][i]/c;for(u[i][i]/=c,o=s;o<f;o++)u[i][o]/=c}return u},triaUpSolve:function(t,e){var n,o=t[0].length,i=r.zeros(1,o)[0],a=!1;return null!=e[0].length&&(e=e.map((function(r){return r[0]})),a=!0),r.arange(o-1,-1,-1).forEach((function(a){n=r.arange(a+1,o).map((function(r){return i[r]*t[a][r]})),i[a]=(e[a]-r.sum(n))/t[a][a]})),a?i.map((function(r){return[r]})):i},triaLowSolve:function(t,e){var n,o=t[0].length,i=r.zeros(1,o)[0],a=!1;return null!=e[0].length&&(e=e.map((function(r){return r[0]})),a=!0),r.arange(o).forEach((function(o){n=r.arange(o).map((function(r){return t[o][r]*i[r]})),i[o]=(e[o]-r.sum(n))/t[o][o]})),a?i.map((function(r){return[r]})):i},lu:function(t){var e,n=t.length,o=r.identity(n),i=r.zeros(t.length,t[0].length);return r.arange(n).forEach((function(r){i[0][r]=t[0][r]})),r.arange(1,n).forEach((function(a){r.arange(a).forEach((function(n){e=r.arange(n).map((function(r){return o[a][r]*i[r][n]})),o[a][n]=(t[a][n]-r.sum(e))/i[n][n]})),r.arange(a,n).forEach((function(n){e=r.arange(a).map((function(r){return o[a][r]*i[r][n]})),i[a][n]=t[e.length][n]-r.sum(e)}))})),[o,i]},cholesky:function(e){var n,o=e.length,i=r.zeros(e.length,e[0].length);return r.arange(o).forEach((function(a){n=r.arange(a).map((function(r){return t.pow(i[a][r],2)})),i[a][a]=t.sqrt(e[a][a]-r.sum(n)),r.arange(a+1,o).forEach((function(t){n=r.arange(a).map((function(r){return i[a][r]*i[t][r]})),i[t][a]=(e[a][t]-r.sum(n))/i[a][a]}))})),i},gauss_jacobi:function(e,n,o,i){for(var a,u,s,f,c=0,l=0,m=e.length,p=[],v=[],d=[];c<m;c++)for(p[c]=[],v[c]=[],d[c]=[],l=0;l<m;l++)c>l?(p[c][l]=e[c][l],v[c][l]=d[c][l]=0):c<l?(v[c][l]=e[c][l],p[c][l]=d[c][l]=0):(d[c][l]=e[c][l],p[c][l]=v[c][l]=0);for(s=r.multiply(r.multiply(r.inv(d),r.add(p,v)),-1),u=r.multiply(r.inv(d),n),a=o,f=r.add(r.multiply(s,o),u),c=2;t.abs(r.norm(r.subtract(f,a)))>i;)a=f,f=r.add(r.multiply(s,a),u),c++;return f},gauss_seidel:function(e,n,o,i){for(var a,u,s,f,c,l=0,m=e.length,p=[],v=[],d=[];l<m;l++)for(p[l]=[],v[l]=[],d[l]=[],a=0;a<m;a++)l>a?(p[l][a]=e[l][a],v[l][a]=d[l][a]=0):l<a?(v[l][a]=e[l][a],p[l][a]=d[l][a]=0):(d[l][a]=e[l][a],p[l][a]=v[l][a]=0);for(f=r.multiply(r.multiply(r.inv(r.add(d,p)),v),-1),s=r.multiply(r.inv(r.add(d,p)),n),u=o,c=r.add(r.multiply(f,o),s),l=2;t.abs(r.norm(r.subtract(c,u)))>i;)u=c,c=r.add(r.multiply(f,u),s),l+=1;return c},SOR:function(e,n,o,i,a){for(var u,s,f,c,l,m=0,p=e.length,v=[],d=[],_=[];m<p;m++)for(v[m]=[],d[m]=[],_[m]=[],u=0;u<p;u++)m>u?(v[m][u]=e[m][u],d[m][u]=_[m][u]=0):m<u?(d[m][u]=e[m][u],v[m][u]=_[m][u]=0):(_[m][u]=e[m][u],v[m][u]=d[m][u]=0);for(c=r.multiply(r.inv(r.add(_,r.multiply(v,a))),r.subtract(r.multiply(_,1-a),r.multiply(d,a))),f=r.multiply(r.multiply(r.inv(r.add(_,r.multiply(v,a))),n),a),s=o,l=r.add(r.multiply(c,o),f),m=2;t.abs(r.norm(r.subtract(l,s)))>i;)s=l,l=r.add(r.multiply(c,s),f),m++;return l},householder:function(e){for(var n,o,i,a,u=e.length,s=e[0].length,f=0,c=[],l=[];f<u-1;f++){for(n=0,a=f+1;a<s;a++)n+=e[a][f]*e[a][f];for(n=(e[f+1][f]>0?-1:1)*t.sqrt(n),o=t.sqrt((n*n-e[f+1][f]*n)/2),(c=r.zeros(u,1))[f+1][0]=(e[f+1][f]-n)/(2*o),i=f+2;i<u;i++)c[i][0]=e[i][f]/(2*o);l=r.subtract(r.identity(u,s),r.multiply(r.multiply(c,r.transpose(c)),2)),e=r.multiply(l,r.multiply(e,l))}return e},QR:(e=r.sum,n=r.arange,function(o){var i,a,u,s=o.length,f=o[0].length,c=r.zeros(f,f);for(o=r.copy(o),a=0;a<f;a++){for(c[a][a]=t.sqrt(e(n(s).map((function(r){return o[r][a]*o[r][a]})))),i=0;i<s;i++)o[i][a]=o[i][a]/c[a][a];for(u=a+1;u<f;u++)for(c[a][u]=e(n(s).map((function(r){return o[r][a]*o[r][u]}))),i=0;i<s;i++)o[i][u]=o[i][u]-o[i][a]*c[a][u]}return[o,c]}),lstsq:function(t,e){var n=!1;void 0===e[0].length&&(e=e.map((function(r){return[r]})),n=!0);var o=r.QR(t),i=o[0],a=o[1],u=t[0].length,s=r.slice(i,{col:{end:u}}),f=function(t){var e=(t=r.copy(t)).length,n=r.identity(e);return r.arange(e-1,-1,-1).forEach((function(e){r.sliceAssign(n,{row:e},r.divide(r.slice(n,{row:e}),t[e][e])),r.sliceAssign(t,{row:e},r.divide(r.slice(t,{row:e}),t[e][e])),r.arange(e).forEach((function(o){var i=r.multiply(t[o][e],-1),a=r.slice(t,{row:o}),u=r.multiply(r.slice(t,{row:e}),i);r.sliceAssign(t,{row:o},r.add(a,u));var s=r.slice(n,{row:o}),f=r.multiply(r.slice(n,{row:e}),i);r.sliceAssign(n,{row:o},r.add(s,f))}))})),n}(r.slice(a,{row:{end:u}})),c=r.transpose(s);void 0===c[0].length&&(c=[c]);var l=r.multiply(r.multiply(f,c),e);return void 0===l.length&&(l=[[l]]),n?l.map((function(r){return r[0]})):l},jacobi:function(e){for(var n,o,i,a,u,s,f,c=1,l=e.length,m=r.identity(l,l),p=[];1===c;){for(u=e[0][1],i=0,a=1,n=0;n<l;n++)for(o=0;o<l;o++)n!=o&&u<t.abs(e[n][o])&&(u=t.abs(e[n][o]),i=n,a=o);for(s=e[i][i]===e[a][a]?e[i][a]>0?t.PI/4:-t.PI/4:t.atan(2*e[i][a]/(e[i][i]-e[a][a]))/2,(f=r.identity(l,l))[i][i]=t.cos(s),f[i][a]=-t.sin(s),f[a][i]=t.sin(s),f[a][a]=t.cos(s),m=r.multiply(m,f),e=r.multiply(r.multiply(r.inv(f),e),f),c=0,n=1;n<l;n++)for(o=1;o<l;o++)n!=o&&t.abs(e[n][o])>.001&&(c=1)}for(n=0;n<l;n++)p.push(e[n][n]);return[m,p]},rungekutta:function(r,t,e,n,o,i){var a,u,s;if(2===i)for(;n<=e;)o+=((a=t*r(n,o))+(u=t*r(n+t,o+a)))/2,n+=t;if(4===i)for(;n<=e;)o+=((a=t*r(n,o))+2*(u=t*r(n+t/2,o+a/2))+2*(s=t*r(n+t/2,o+u/2))+t*r(n+t,o+s))/6,n+=t;return o},romberg:function(r,e,n,o){for(var i,a,u,s,f,c=0,l=(n-e)/2,m=[],p=[],v=[];c<o/2;){for(f=r(e),u=e,s=0;u<=n;u+=l,s++)m[s]=u;for(i=m.length,u=1;u<i-1;u++)f+=(u%2!=0?4:2)*r(m[u]);f=l/3*(f+r(n)),v[c]=f,l/=2,c++}for(a=v.length,i=1;1!==a;){for(u=0;u<a-1;u++)p[u]=(t.pow(4,i)*v[u+1]-v[u])/(t.pow(4,i)-1);a=p.length,v=p,p=[],i++}return v},richardson:function(r,e,n,o){function i(r,t){for(var e,n=0,o=r.length;n<o;n++)r[n]===t&&(e=n);return e}for(var a,u,s,f,c,l=t.abs(n-r[i(r,n)+1]),m=0,p=[],v=[];o>=l;)a=i(r,n+o),u=i(r,n),p[m]=(e[a]-2*e[u]+e[2*u-a])/(o*o),o/=2,m++;for(f=p.length,s=1;1!=f;){for(c=0;c<f-1;c++)v[c]=(t.pow(4,s)*p[c+1]-p[c])/(t.pow(4,s)-1);f=v.length,p=v,v=[],s++}return p},simpson:function(r,t,e,n){for(var o,i=(e-t)/n,a=r(t),u=[],s=t,f=0,c=1;s<=e;s+=i,f++)u[f]=s;for(o=u.length;c<o-1;c++)a+=(c%2!=0?4:2)*r(u[c]);return i/3*(a+r(e))},hermite:function(r,t,e,n){for(var o,i=r.length,a=0,u=0,s=[],f=[],c=[],l=[];u<i;u++){for(s[u]=1,o=0;o<i;o++)u!=o&&(s[u]*=(n-r[o])/(r[u]-r[o]));for(f[u]=0,o=0;o<i;o++)u!=o&&(f[u]+=1/(r[u]-r[o]));c[u]=(1-2*(n-r[u])*f[u])*(s[u]*s[u]),l[u]=(n-r[u])*(s[u]*s[u]),a+=c[u]*t[u]+l[u]*e[u]}return a},lagrange:function(r,t,e){for(var n,o,i=0,a=0,u=r.length;a<u;a++){for(o=t[a],n=0;n<u;n++)a!=n&&(o*=(e-r[n])/(r[a]-r[n]));i+=o}return i},cubic_spline:function(t,e,n){for(var o,i,a=t.length,u=0,s=[],f=[],c=[],l=[],m=[],p=[];u<a-1;u++)l[u]=t[u+1]-t[u];for(c[0]=0,u=1;u<a-1;u++)c[u]=3/l[u]*(e[u+1]-e[u])-3/l[u-1]*(e[u]-e[u-1]);for(u=1;u<a-1;u++)s[u]=[],f[u]=[],s[u][u-1]=l[u-1],s[u][u]=2*(l[u-1]+l[u]),s[u][u+1]=l[u],f[u][0]=c[u];for(i=r.multiply(r.inv(s),f),o=0;o<a-1;o++)m[o]=(e[o+1]-e[o])/l[o]-l[o]*(i[o+1][0]+2*i[o][0])/3,p[o]=(i[o+1][0]-i[o][0])/(3*l[o]);for(o=0;o<a&&!(t[o]>n);o++);return e[o-=1]+(n-t[o])*m[o]+r.sq(n-t[o])*i[o]+(n-t[o])*r.sq(n-t[o])*p[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(t){var e,n,o,i,a,u=t.length,s=t[0].length,f=0,c=[],l=[],m=[],p=[],v=[],d=[],_=[];for(f=0;f<u;f++)c[f]=r.sum(t[f])/s;for(f=0;f<s;f++)for(v[f]=[],e=0;e<u;e++)v[f][e]=t[e][f]-c[e];for(v=r.transpose(v),f=0;f<u;f++)for(d[f]=[],e=0;e<u;e++)d[f][e]=r.dot([v[f]],[v[e]])/(s-1);for(a=(o=r.jacobi(d))[0],l=o[1],_=r.transpose(a),f=0;f<l.length;f++)for(e=f;e<l.length;e++)l[f]<l[e]&&(n=l[f],l[f]=l[e],l[e]=n,m=_[f],_[f]=_[e],_[e]=m);for(i=r.transpose(v),f=0;f<u;f++)for(p[f]=[],e=0;e<i.length;e++)p[f][e]=r.dot([_[f]],[i[e]]);return[t,l,_,p]}}),function(t){for(var e=0;e<t.length;e++)!function(t){r.fn[t]=function(e,n){var o=this;return n?(setTimeout((function(){n.call(o,r.fn[t].call(o,e))}),15),this):"number"==typeof r[t](this,e)?r[t](this,e):r(r[t](this,e))}}(t[e])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(t,Math),function(r,t){var e=[].slice,n=r.utils.isNumber,o=r.utils.isArray;function i(r,e,n,o){if(r>1||n>1||r<=0||n<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(r*e+n*o)/(e+o);return(r-n)/t.sqrt(i*(1-i)*(1/e+1/o))}r.extend({zscore:function(){var t=e.call(arguments);return n(t[1])?(t[0]-t[1])/t[2]:(t[0]-r.mean(t[1]))/r.stdev(t[1],t[2])},ztest:function(){var n,i=e.call(arguments);return o(i[1])?(n=r.zscore(i[0],i[1],i[3]),1===i[2]?r.normal.cdf(-t.abs(n),0,1):2*r.normal.cdf(-t.abs(n),0,1)):i.length>2?(n=r.zscore(i[0],i[1],i[2]),1===i[3]?r.normal.cdf(-t.abs(n),0,1):2*r.normal.cdf(-t.abs(n),0,1)):(n=i[0],1===i[1]?r.normal.cdf(-t.abs(n),0,1):2*r.normal.cdf(-t.abs(n),0,1))}}),r.extend(r.fn,{zscore:function(r,t){return(r-this.mean())/this.stdev(t)},ztest:function(e,n,o){var i=t.abs(this.zscore(e,o));return 1===n?r.normal.cdf(-i,0,1):2*r.normal.cdf(-i,0,1)}}),r.extend({tscore:function(){var n=e.call(arguments);return 4===n.length?(n[0]-n[1])/(n[2]/t.sqrt(n[3])):(n[0]-r.mean(n[1]))/(r.stdev(n[1],!0)/t.sqrt(n[1].length))},ttest:function(){var o,i=e.call(arguments);return 5===i.length?(o=t.abs(r.tscore(i[0],i[1],i[2],i[3])),1===i[4]?r.studentt.cdf(-o,i[3]-1):2*r.studentt.cdf(-o,i[3]-1)):n(i[1])?(o=t.abs(i[0]),1==i[2]?r.studentt.cdf(-o,i[1]-1):2*r.studentt.cdf(-o,i[1]-1)):(o=t.abs(r.tscore(i[0],i[1])),1==i[2]?r.studentt.cdf(-o,i[1].length-1):2*r.studentt.cdf(-o,i[1].length-1))}}),r.extend(r.fn,{tscore:function(r){return(r-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(e,n){return 1===n?1-r.studentt.cdf(t.abs(this.tscore(e)),this.cols()-1):2*r.studentt.cdf(-t.abs(this.tscore(e)),this.cols()-1)}}),r.extend({anovafscore:function(){var n,o,i,a,u,s,f,c,l=e.call(arguments);if(1===l.length){for(u=new Array(l[0].length),f=0;f<l[0].length;f++)u[f]=l[0][f];l=u}for(o=new Array,f=0;f<l.length;f++)o=o.concat(l[f]);for(i=r.mean(o),n=0,f=0;f<l.length;f++)n+=l[f].length*t.pow(r.mean(l[f])-i,2);for(n/=l.length-1,s=0,f=0;f<l.length;f++)for(a=r.mean(l[f]),c=0;c<l[f].length;c++)s+=t.pow(l[f][c]-a,2);return n/(s/(o.length-l.length))},anovaftest:function(){var t,o,i,a,u=e.call(arguments);if(n(u[0]))return 1-r.centralF.cdf(u[0],u[1],u[2]);var s=r.anovafscore(u);for(t=u.length-1,i=0,a=0;a<u.length;a++)i+=u[a].length;return o=i-t-1,1-r.centralF.cdf(s,t,o)},ftest:function(t,e,n){return 1-r.centralF.cdf(t,e,n)}}),r.extend(r.fn,{anovafscore:function(){return r.anovafscore(this.toArray())},anovaftes:function(){var t,e=0;for(t=0;t<this.length;t++)e+=this[t].length;return r.ftest(this.anovafscore(),this.length-1,e-this.length)}}),r.extend({qscore:function(){var o,i,a,u,s,f=e.call(arguments);return n(f[0])?(o=f[0],i=f[1],a=f[2],u=f[3],s=f[4]):(o=r.mean(f[0]),i=r.mean(f[1]),a=f[0].length,u=f[1].length,s=f[2]),t.abs(o-i)/(s*t.sqrt((1/a+1/u)/2))},qtest:function(){var t,n=e.call(arguments);3===n.length?(t=n[0],n=n.slice(1)):7===n.length?(t=r.qscore(n[0],n[1],n[2],n[3],n[4]),n=n.slice(5)):(t=r.qscore(n[0],n[1],n[2]),n=n.slice(3));var o=n[0],i=n[1];return 1-r.tukey.cdf(t,i,o-i)},tukeyhsd:function(t){for(var e=r.pooledstdev(t),n=t.map((function(t){return r.mean(t)})),o=t.reduce((function(r,t){return r+t.length}),0),i=[],a=0;a<t.length;++a)for(var u=a+1;u<t.length;++u){var s=r.qtest(n[a],n[u],t[a].length,t[u].length,e,o,t.length);i.push([[a,u],s])}return i}}),r.extend({normalci:function(){var n,o=e.call(arguments),i=new Array(2);return n=4===o.length?t.abs(r.normal.inv(o[1]/2,0,1)*o[2]/t.sqrt(o[3])):t.abs(r.normal.inv(o[1]/2,0,1)*r.stdev(o[2])/t.sqrt(o[2].length)),i[0]=o[0]-n,i[1]=o[0]+n,i},tci:function(){var n,o=e.call(arguments),i=new Array(2);return n=4===o.length?t.abs(r.studentt.inv(o[1]/2,o[3]-1)*o[2]/t.sqrt(o[3])):t.abs(r.studentt.inv(o[1]/2,o[2].length-1)*r.stdev(o[2],!0)/t.sqrt(o[2].length)),i[0]=o[0]-n,i[1]=o[0]+n,i},significant:function(r,t){return r<t}}),r.extend(r.fn,{normalci:function(t,e){return r.normalci(t,e,this.toArray())},tci:function(t,e){return r.tci(t,e,this.toArray())}}),r.extend(r.fn,{oneSidedDifferenceOfProportions:function(t,e,n,o){var a=i(t,e,n,o);return r.ztest(a,1)},twoSidedDifferenceOfProportions:function(t,e,n,o){var a=i(t,e,n,o);return r.ztest(a,2)}})}(t,Math),t.models=function(){function r(r,e){var n=r.length,o=e[0].length-1,i=n-o-1,a=t.lstsq(e,r),u=t.multiply(e,a.map((function(r){return[r]}))).map((function(r){return r[0]})),s=t.subtract(r,u),f=t.mean(r),c=t.sum(u.map((function(r){return Math.pow(r-f,2)}))),l=t.sum(r.map((function(r,t){return Math.pow(r-u[t],2)}))),m=c+l;return{exog:e,endog:r,nobs:n,df_model:o,df_resid:i,coef:a,predict:u,resid:s,ybar:f,SST:m,SSE:c,SSR:l,R2:c/m}}function e(e){var n,o,i=(n=e.exog,o=n[0].length,t.arange(o).map((function(e){var i=t.arange(o).filter((function(r){return r!==e}));return r(t.col(n,e).map((function(r){return r[0]})),t.col(n,i))}))),a=Math.sqrt(e.SSR/e.df_resid),u=i.map((function(r){var t=r.SST,e=r.R2;return a/Math.sqrt(t*(1-e))})),s=e.coef.map((function(r,t){return(r-0)/u[t]})),f=s.map((function(r){var n=t.studentt.cdf(r,e.df_resid);return 2*(n>.5?1-n:n)})),c=t.studentt.inv(.975,e.df_resid),l=e.coef.map((function(r,t){var e=c*u[t];return[r-e,r+e]}));return{se:u,t:s,p:f,sigmaHat:a,interval95:l}}return{ols:function(n,o){var i=r(n,o),a=e(i),u=function(r){var e,n,o,i=r.R2/r.df_model/((1-r.R2)/r.df_resid);return{F_statistic:i,pvalue:1-(e=i,n=r.df_model,o=r.df_resid,t.beta.cdf(e/(o/n+e),n/2,o/2))}}(i),s=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=a,i.f=u,i.adjust_R2=s,i}}}(),t.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),e=0;e<arguments.length;e++){var n=[1];r[e]=n.concat(arguments[e])}return t(r)},builddxmatrix:function(){for(var r=new Array(arguments[0].length),e=0;e<arguments[0].length;e++){var n=[1];r[e]=n.concat(arguments[0][e])}return t(r)},buildjxmatrix:function(r){for(var e=new Array(r.length),n=0;n<r.length;n++)e[n]=r[n];return t.builddxmatrix(e)},buildymatrix:function(r){return t(r).transpose()},buildjymatrix:function(r){return r.transpose()},matrixmult:function(r,e){var n,o,i,a,u;if(r.cols()==e.rows()){if(e.rows()>1){for(a=[],n=0;n<r.rows();n++)for(a[n]=[],o=0;o<e.cols();o++){for(u=0,i=0;i<r.cols();i++)u+=r.toArray()[n][i]*e.toArray()[i][o];a[n][o]=u}return t(a)}for(a=[],n=0;n<r.rows();n++)for(a[n]=[],o=0;o<e.cols();o++){for(u=0,i=0;i<r.cols();i++)u+=r.toArray()[n][i]*e.toArray()[o];a[n][o]=u}return t(a)}},regress:function(r,e){var n=t.xtranspxinv(r),o=r.transpose(),i=t.matrixmult(t(n),o);return t.matrixmult(i,e)},regresst:function(r,e,n){var o=t.regress(r,e),i={anova:{}},a=t.jMatYBar(r,o);i.yBar=a;var u=e.mean();i.anova.residuals=t.residuals(e,a),i.anova.ssr=t.ssr(a,u),i.anova.msr=i.anova.ssr/(r[0].length-1),i.anova.sse=t.sse(e,a),i.anova.mse=i.anova.sse/(e.length-(r[0].length-1)-1),i.anova.sst=t.sst(e,u),i.anova.mst=i.anova.sst/(e.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=t.anovaftest(i.anova.fratio,r[0].length-1,e.length-(r[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(r[0].length);for(var s,f,c,l=t.xtranspxinv(r),m=0;m<o.length;m++)s=Math.sqrt(i.anova.mse*Math.abs(l[m][m])),f=Math.abs(o[m]/s),c=t.ttest(f,e.length-r[0].length-1,n),i.stats[m]=[o[m],s,f,c];return i.regress=o,i},xtranspx:function(r){return t.matrixmult(r.transpose(),r)},xtranspxinv:function(r){var e=t.matrixmult(r.transpose(),r);return t.inv(e)},jMatYBar:function(r,e){var n=t.matrixmult(r,e);return new t(n)},residuals:function(r,e){return t.matrixsubtract(r,e)},ssr:function(r,t){for(var e=0,n=0;n<r.length;n++)e+=Math.pow(r[n]-t,2);return e},sse:function(r,t){for(var e=0,n=0;n<r.length;n++)e+=Math.pow(r[n]-t[n],2);return e},sst:function(r,t){for(var e=0,n=0;n<r.length;n++)e+=Math.pow(r[n]-t,2);return e},matrixsubtract:function(r,e){for(var n=new Array(r.length),o=0;o<r.length;o++){n[o]=new Array(r[o].length);for(var i=0;i<r[o].length;i++)n[o][i]=r[o][i]-e[o][i]}return t(n)}}),t.jStat=t,t)},39515:(r,t,e)=>{var n=e(38761)(e(37772),"DataView");r.exports=n},89612:(r,t,e)=>{var n=e(52118),o=e(96909),i=e(98138),a=e(4174),u=e(7942);function s(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,r.exports=s},80235:(r,t,e)=>{var n=e(3945),o=e(21846),i=e(88028),a=e(72344),u=e(94769);function s(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,r.exports=s},79430:(r,t,e)=>{var n=e(38761)(e(37772),"Map");r.exports=n},96738:(r,t,e)=>{var n=e(92411),o=e(36417),i=e(86928),a=e(79493),u=e(24150);function s(r){var t=-1,e=null==r?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,r.exports=s},52760:(r,t,e)=>{var n=e(38761)(e(37772),"Promise");r.exports=n},2143:(r,t,e)=>{var n=e(38761)(e(37772),"Set");r.exports=n},45386:(r,t,e)=>{var n=e(96738),o=e(52842),i=e(52482);function a(r){var t=-1,e=null==r?0:r.length;for(this.__data__=new n;++t<e;)this.add(r[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,r.exports=a},86571:(r,t,e)=>{var n=e(80235),o=e(15243),i=e(72858),a=e(4417),u=e(8605),s=e(71418);function f(r){var t=this.__data__=new n(r);this.size=t.size}f.prototype.clear=o,f.prototype.delete=i,f.prototype.get=a,f.prototype.has=u,f.prototype.set=s,r.exports=f},50857:(r,t,e)=>{var n=e(37772).Symbol;r.exports=n},79162:(r,t,e)=>{var n=e(37772).Uint8Array;r.exports=n},93215:(r,t,e)=>{var n=e(38761)(e(37772),"WeakMap");r.exports=n},49432:r=>{r.exports=function(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}},67552:r=>{r.exports=function(r,t){for(var e=-1,n=null==r?0:r.length,o=0,i=[];++e<n;){var a=r[e];t(a,e,r)&&(i[o++]=a)}return i}},1634:(r,t,e)=>{var n=e(36473),o=e(79631),i=e(86152),a=e(73226),u=e(39045),s=e(77598),f=Object.prototype.hasOwnProperty;r.exports=function(r,t){var e=i(r),c=!e&&o(r),l=!e&&!c&&a(r),m=!e&&!c&&!l&&s(r),p=e||c||l||m,v=p?n(r.length,String):[],d=v.length;for(var _ in r)!t&&!f.call(r,_)||p&&("length"==_||l&&("offset"==_||"parent"==_)||m&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||u(_,d))||v.push(_);return v}},50343:r=>{r.exports=function(r,t){for(var e=-1,n=null==r?0:r.length,o=Array(n);++e<n;)o[e]=t(r[e],e,r);return o}},65067:r=>{r.exports=function(r,t){for(var e=-1,n=t.length,o=r.length;++e<n;)r[o+e]=t[e];return r}},87064:r=>{r.exports=function(r,t){for(var e=-1,n=null==r?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}},22218:(r,t,e)=>{var n=e(41225);r.exports=function(r,t){for(var e=r.length;e--;)if(n(r[e][0],t))return e;return-1}},24303:(r,t,e)=>{var n=e(26548),o=e(92019)(n);r.exports=o},98043:(r,t,e)=>{var n=e(24303);r.exports=function(r,t){var e=[];return n(r,(function(r,n,o){t(r,n,o)&&e.push(r)})),e}},15308:(r,t,e)=>{var n=e(55463)();r.exports=n},26548:(r,t,e)=>{var n=e(15308),o=e(90249);r.exports=function(r,t){return r&&n(r,t,o)}},13324:(r,t,e)=>{var n=e(17297),o=e(33812);r.exports=function(r,t){for(var e=0,i=(t=n(t,r)).length;null!=r&&e<i;)r=r[o(t[e++])];return e&&e==i?r:void 0}},1897:(r,t,e)=>{var n=e(65067),o=e(86152);r.exports=function(r,t,e){var i=t(r);return o(r)?i:n(i,e(r))}},53366:(r,t,e)=>{var n=e(50857),o=e(62107),i=e(37157),a=n?n.toStringTag:void 0;r.exports=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":a&&a in Object(r)?o(r):i(r)}},20187:r=>{r.exports=function(r,t){return null!=r&&t in Object(r)}},15183:(r,t,e)=>{var n=e(53366),o=e(15125);r.exports=function(r){return o(r)&&"[object Arguments]"==n(r)}},88746:(r,t,e)=>{var n=e(51952),o=e(15125);r.exports=function r(t,e,i,a,u){return t===e||(null==t||null==e||!o(t)&&!o(e)?t!=t&&e!=e:n(t,e,i,a,r,u))}},51952:(r,t,e)=>{var n=e(86571),o=e(74871),i=e(11491),a=e(17416),u=e(70940),s=e(86152),f=e(73226),c=e(77598),l="[object Arguments]",m="[object Array]",p="[object Object]",v=Object.prototype.hasOwnProperty;r.exports=function(r,t,e,d,_,g){var h=s(r),y=s(t),b=h?m:u(r),A=y?m:u(t),S=(b=b==l?p:b)==p,T=(A=A==l?p:A)==p,E=b==A;if(E&&f(r)){if(!f(t))return!1;h=!0,S=!1}if(E&&!S)return g||(g=new n),h||c(r)?o(r,t,e,d,_,g):i(r,t,b,e,d,_,g);if(!(1&e)){var x=S&&v.call(r,"__wrapped__"),G=T&&v.call(t,"__wrapped__");if(x||G){var w=x?r.value():r,D=G?t.value():t;return g||(g=new n),_(w,D,e,d,g)}}return!!E&&(g||(g=new n),a(r,t,e,d,_,g))}},37036:(r,t,e)=>{var n=e(86571),o=e(88746);r.exports=function(r,t,e,i){var a=e.length,u=a,s=!i;if(null==r)return!u;for(r=Object(r);a--;){var f=e[a];if(s&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++a<u;){var c=(f=e[a])[0],l=r[c],m=f[1];if(s&&f[2]){if(void 0===l&&!(c in r))return!1}else{var p=new n;if(i)var v=i(l,m,c,r,t,p);if(!(void 0===v?o(m,l,3,i,p):v))return!1}}return!0}},6840:(r,t,e)=>{var n=e(61049),o=e(47394),i=e(29259),a=e(87035),u=/^\[object .+?Constructor\]$/,s=Function.prototype,f=Object.prototype,c=s.toString,l=f.hasOwnProperty,m=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");r.exports=function(r){return!(!i(r)||o(r))&&(n(r)?m:u).test(a(r))}},35522:(r,t,e)=>{var n=e(53366),o=e(61158),i=e(15125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,r.exports=function(r){return i(r)&&o(r.length)&&!!a[n(r)]}},68286:(r,t,e)=>{var n=e(26423),o=e(74716),i=e(23059),a=e(86152),u=e(65798);r.exports=function(r){return"function"==typeof r?r:null==r?i:"object"==typeof r?a(r)?o(r[0],r[1]):n(r):u(r)}},86411:(r,t,e)=>{var n=e(16001),o=e(54248),i=Object.prototype.hasOwnProperty;r.exports=function(r){if(!n(r))return o(r);var t=[];for(var e in Object(r))i.call(r,e)&&"constructor"!=e&&t.push(e);return t}},26423:(r,t,e)=>{var n=e(37036),o=e(49882),i=e(73477);r.exports=function(r){var t=o(r);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(e){return e===r||n(e,r,t)}}},74716:(r,t,e)=>{var n=e(88746),o=e(72579),i=e(95041),a=e(21401),u=e(28792),s=e(73477),f=e(33812);r.exports=function(r,t){return a(r)&&u(t)?s(f(r),t):function(e){var a=o(e,r);return void 0===a&&a===t?i(e,r):n(t,a,3)}}},20256:r=>{r.exports=function(r){return function(t){return null==t?void 0:t[r]}}},82952:(r,t,e)=>{var n=e(13324);r.exports=function(r){return function(t){return n(t,r)}}},36060:(r,t,e)=>{var n=e(23059),o=e(43114),i=e(75251);r.exports=function(r,t){return i(o(r,t,n),r+"")}},86532:(r,t,e)=>{var n=e(86874),o=e(83043),i=e(23059),a=o?function(r,t){return o(r,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;r.exports=a},36473:r=>{r.exports=function(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}},1054:(r,t,e)=>{var n=e(50857),o=e(50343),i=e(86152),a=e(4795),u=n?n.prototype:void 0,s=u?u.toString:void 0;r.exports=function r(t){if("string"==typeof t)return t;if(i(t))return o(t,r)+"";if(a(t))return s?s.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},47826:r=>{r.exports=function(r){return function(t){return r(t)}}},59950:r=>{r.exports=function(r,t){return r.has(t)}},17297:(r,t,e)=>{var n=e(86152),o=e(21401),i=e(54452),a=e(66188);r.exports=function(r,t){return n(r)?r:o(r,t)?[r]:i(a(r))}},24019:(r,t,e)=>{var n=e(37772)["__core-js_shared__"];r.exports=n},92019:(r,t,e)=>{var n=e(67878);r.exports=function(r,t){return function(e,o){if(null==e)return e;if(!n(e))return r(e,o);for(var i=e.length,a=t?i:-1,u=Object(e);(t?a--:++a<i)&&!1!==o(u[a],a,u););return e}}},55463:r=>{r.exports=function(r){return function(t,e,n){for(var o=-1,i=Object(t),a=n(t),u=a.length;u--;){var s=a[r?u:++o];if(!1===e(i[s],s,i))break}return t}}},83043:(r,t,e)=>{var n=e(38761),o=function(){try{var r=n(Object,"defineProperty");return r({},"",{}),r}catch(r){}}();r.exports=o},74871:(r,t,e)=>{var n=e(45386),o=e(87064),i=e(59950);r.exports=function(r,t,e,a,u,s){var f=1&e,c=r.length,l=t.length;if(c!=l&&!(f&&l>c))return!1;var m=s.get(r),p=s.get(t);if(m&&p)return m==t&&p==r;var v=-1,d=!0,_=2&e?new n:void 0;for(s.set(r,t),s.set(t,r);++v<c;){var g=r[v],h=t[v];if(a)var y=f?a(h,g,v,t,r,s):a(g,h,v,r,t,s);if(void 0!==y){if(y)continue;d=!1;break}if(_){if(!o(t,(function(r,t){if(!i(_,t)&&(g===r||u(g,r,e,a,s)))return _.push(t)}))){d=!1;break}}else if(g!==h&&!u(g,h,e,a,s)){d=!1;break}}return s.delete(r),s.delete(t),d}},11491:(r,t,e)=>{var n=e(50857),o=e(79162),i=e(41225),a=e(74871),u=e(75179),s=e(16909),f=n?n.prototype:void 0,c=f?f.valueOf:void 0;r.exports=function(r,t,e,n,f,l,m){switch(e){case"[object DataView]":if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=t.byteLength||!l(new o(r),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+r,+t);case"[object Error]":return r.name==t.name&&r.message==t.message;case"[object RegExp]":case"[object String]":return r==t+"";case"[object Map]":var p=u;case"[object Set]":var v=1&n;if(p||(p=s),r.size!=t.size&&!v)return!1;var d=m.get(r);if(d)return d==t;n|=2,m.set(r,t);var _=a(p(r),p(t),n,f,l,m);return m.delete(r),_;case"[object Symbol]":if(c)return c.call(r)==c.call(t)}return!1}},17416:(r,t,e)=>{var n=e(13483),o=Object.prototype.hasOwnProperty;r.exports=function(r,t,e,i,a,u){var s=1&e,f=n(r),c=f.length;if(c!=n(t).length&&!s)return!1;for(var l=c;l--;){var m=f[l];if(!(s?m in t:o.call(t,m)))return!1}var p=u.get(r),v=u.get(t);if(p&&v)return p==t&&v==r;var d=!0;u.set(r,t),u.set(t,r);for(var _=s;++l<c;){var g=r[m=f[l]],h=t[m];if(i)var y=s?i(h,g,m,t,r,u):i(g,h,m,r,t,u);if(!(void 0===y?g===h||a(g,h,e,i,u):y)){d=!1;break}_||(_="constructor"==m)}if(d&&!_){var b=r.constructor,A=t.constructor;b==A||!("constructor"in r)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof A&&A instanceof A||(d=!1)}return u.delete(r),u.delete(t),d}},51242:(r,t,e)=>{var n="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;r.exports=n},13483:(r,t,e)=>{var n=e(1897),o=e(80633),i=e(90249);r.exports=function(r){return n(r,i,o)}},27937:(r,t,e)=>{var n=e(98304);r.exports=function(r,t){var e=r.__data__;return n(t)?e["string"==typeof t?"string":"hash"]:e.map}},49882:(r,t,e)=>{var n=e(28792),o=e(90249);r.exports=function(r){for(var t=o(r),e=t.length;e--;){var i=t[e],a=r[i];t[e]=[i,a,n(a)]}return t}},38761:(r,t,e)=>{var n=e(6840),o=e(98109);r.exports=function(r,t){var e=o(r,t);return n(e)?e:void 0}},62107:(r,t,e)=>{var n=e(50857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;r.exports=function(r){var t=i.call(r,u),e=r[u];try{r[u]=void 0;var n=!0}catch(r){}var o=a.call(r);return n&&(t?r[u]=e:delete r[u]),o}},80633:(r,t,e)=>{var n=e(67552),o=e(30981),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(r){return null==r?[]:(r=Object(r),n(a(r),(function(t){return i.call(r,t)})))}:o;r.exports=u},70940:(r,t,e)=>{var n=e(39515),o=e(79430),i=e(52760),a=e(2143),u=e(93215),s=e(53366),f=e(87035),c="[object Map]",l="[object Promise]",m="[object Set]",p="[object WeakMap]",v="[object DataView]",d=f(n),_=f(o),g=f(i),h=f(a),y=f(u),b=s;(n&&b(new n(new ArrayBuffer(1)))!=v||o&&b(new o)!=c||i&&b(i.resolve())!=l||a&&b(new a)!=m||u&&b(new u)!=p)&&(b=function(r){var t=s(r),e="[object Object]"==t?r.constructor:void 0,n=e?f(e):"";if(n)switch(n){case d:return v;case _:return c;case g:return l;case h:return m;case y:return p}return t}),r.exports=b},98109:r=>{r.exports=function(r,t){return null==r?void 0:r[t]}},1369:(r,t,e)=>{var n=e(17297),o=e(79631),i=e(86152),a=e(39045),u=e(61158),s=e(33812);r.exports=function(r,t,e){for(var f=-1,c=(t=n(t,r)).length,l=!1;++f<c;){var m=s(t[f]);if(!(l=null!=r&&e(r,m)))break;r=r[m]}return l||++f!=c?l:!!(c=null==r?0:r.length)&&u(c)&&a(m,c)&&(i(r)||o(r))}},52118:(r,t,e)=>{var n=e(99191);r.exports=function(){this.__data__=n?n(null):{},this.size=0}},96909:r=>{r.exports=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}},98138:(r,t,e)=>{var n=e(99191),o=Object.prototype.hasOwnProperty;r.exports=function(r){var t=this.__data__;if(n){var e=t[r];return"__lodash_hash_undefined__"===e?void 0:e}return o.call(t,r)?t[r]:void 0}},4174:(r,t,e)=>{var n=e(99191),o=Object.prototype.hasOwnProperty;r.exports=function(r){var t=this.__data__;return n?void 0!==t[r]:o.call(t,r)}},7942:(r,t,e)=>{var n=e(99191);r.exports=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},39045:r=>{var t=/^(?:0|[1-9]\d*)$/;r.exports=function(r,e){var n=typeof r;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&t.test(r))&&r>-1&&r%1==0&&r<e}},21401:(r,t,e)=>{var n=e(86152),o=e(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;r.exports=function(r,t){if(n(r))return!1;var e=typeof r;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=r&&!o(r))||a.test(r)||!i.test(r)||null!=t&&r in Object(t)}},98304:r=>{r.exports=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r}},47394:(r,t,e)=>{var n,o=e(24019),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";r.exports=function(r){return!!i&&i in r}},16001:r=>{var t=Object.prototype;r.exports=function(r){var e=r&&r.constructor;return r===("function"==typeof e&&e.prototype||t)}},28792:(r,t,e)=>{var n=e(29259);r.exports=function(r){return r==r&&!n(r)}},3945:r=>{r.exports=function(){this.__data__=[],this.size=0}},21846:(r,t,e)=>{var n=e(22218),o=Array.prototype.splice;r.exports=function(r){var t=this.__data__,e=n(t,r);return!(e<0||(e==t.length-1?t.pop():o.call(t,e,1),--this.size,0))}},88028:(r,t,e)=>{var n=e(22218);r.exports=function(r){var t=this.__data__,e=n(t,r);return e<0?void 0:t[e][1]}},72344:(r,t,e)=>{var n=e(22218);r.exports=function(r){return n(this.__data__,r)>-1}},94769:(r,t,e)=>{var n=e(22218);r.exports=function(r,t){var e=this.__data__,o=n(e,r);return o<0?(++this.size,e.push([r,t])):e[o][1]=t,this}},92411:(r,t,e)=>{var n=e(89612),o=e(80235),i=e(79430);r.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},36417:(r,t,e)=>{var n=e(27937);r.exports=function(r){var t=n(this,r).delete(r);return this.size-=t?1:0,t}},86928:(r,t,e)=>{var n=e(27937);r.exports=function(r){return n(this,r).get(r)}},79493:(r,t,e)=>{var n=e(27937);r.exports=function(r){return n(this,r).has(r)}},24150:(r,t,e)=>{var n=e(27937);r.exports=function(r,t){var e=n(this,r),o=e.size;return e.set(r,t),this.size+=e.size==o?0:1,this}},75179:r=>{r.exports=function(r){var t=-1,e=Array(r.size);return r.forEach((function(r,n){e[++t]=[n,r]})),e}},73477:r=>{r.exports=function(r,t){return function(e){return null!=e&&e[r]===t&&(void 0!==t||r in Object(e))}}},77777:(r,t,e)=>{var n=e(30733);r.exports=function(r){var t=n(r,(function(r){return 500===e.size&&e.clear(),r})),e=t.cache;return t}},99191:(r,t,e)=>{var n=e(38761)(Object,"create");r.exports=n},54248:(r,t,e)=>{var n=e(4355)(Object.keys,Object);r.exports=n},4146:(r,t,e)=>{r=e.nmd(r);var n=e(51242),o=t&&!t.nodeType&&t,i=o&&r&&!r.nodeType&&r,a=i&&i.exports===o&&n.process,u=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(r){}}();r.exports=u},37157:r=>{var t=Object.prototype.toString;r.exports=function(r){return t.call(r)}},4355:r=>{r.exports=function(r,t){return function(e){return r(t(e))}}},43114:(r,t,e)=>{var n=e(49432),o=Math.max;r.exports=function(r,t,e){return t=o(void 0===t?r.length-1:t,0),function(){for(var i=arguments,a=-1,u=o(i.length-t,0),s=Array(u);++a<u;)s[a]=i[t+a];a=-1;for(var f=Array(t+1);++a<t;)f[a]=i[a];return f[t]=e(s),n(r,this,f)}}},37772:(r,t,e)=>{var n=e(51242),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();r.exports=i},52842:r=>{r.exports=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this}},52482:r=>{r.exports=function(r){return this.__data__.has(r)}},16909:r=>{r.exports=function(r){var t=-1,e=Array(r.size);return r.forEach((function(r){e[++t]=r})),e}},75251:(r,t,e)=>{var n=e(86532),o=e(97787)(n);r.exports=o},97787:r=>{var t=Date.now;r.exports=function(r){var e=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}},15243:(r,t,e)=>{var n=e(80235);r.exports=function(){this.__data__=new n,this.size=0}},72858:r=>{r.exports=function(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}},4417:r=>{r.exports=function(r){return this.__data__.get(r)}},8605:r=>{r.exports=function(r){return this.__data__.has(r)}},71418:(r,t,e)=>{var n=e(80235),o=e(79430),i=e(96738);r.exports=function(r,t){var e=this.__data__;if(e instanceof n){var a=e.__data__;if(!o||a.length<199)return a.push([r,t]),this.size=++e.size,this;e=this.__data__=new i(a)}return e.set(r,t),this.size=e.size,this}},54452:(r,t,e)=>{var n=e(77777),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n((function(r){var t=[];return 46===r.charCodeAt(0)&&t.push(""),r.replace(o,(function(r,e,n,o){t.push(n?o.replace(i,"$1"):e||r)})),t}));r.exports=a},33812:(r,t,e)=>{var n=e(4795);r.exports=function(r){if("string"==typeof r||n(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t}},87035:r=>{var t=Function.prototype.toString;r.exports=function(r){if(null!=r){try{return t.call(r)}catch(r){}try{return r+""}catch(r){}}return""}},86874:r=>{r.exports=function(r){return function(){return r}}},41225:r=>{r.exports=function(r,t){return r===t||r!=r&&t!=t}},90882:(r,t,e)=>{var n=e(67552),o=e(98043),i=e(68286),a=e(86152);r.exports=function(r,t){return(a(r)?n:o)(r,i(t,3))}},72579:(r,t,e)=>{var n=e(13324);r.exports=function(r,t,e){var o=null==r?void 0:n(r,t);return void 0===o?e:o}},95041:(r,t,e)=>{var n=e(20187),o=e(1369);r.exports=function(r,t){return null!=r&&o(r,t,n)}},23059:r=>{r.exports=function(r){return r}},79631:(r,t,e)=>{var n=e(15183),o=e(15125),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(r){return o(r)&&a.call(r,"callee")&&!u.call(r,"callee")};r.exports=s},86152:r=>{var t=Array.isArray;r.exports=t},67878:(r,t,e)=>{var n=e(61049),o=e(61158);r.exports=function(r){return null!=r&&o(r.length)&&!n(r)}},93746:(r,t,e)=>{var n=e(67878),o=e(15125);r.exports=function(r){return o(r)&&n(r)}},73226:(r,t,e)=>{r=e.nmd(r);var n=e(37772),o=e(36330),i=t&&!t.nodeType&&t,a=i&&r&&!r.nodeType&&r,u=a&&a.exports===i?n.Buffer:void 0,s=(u?u.isBuffer:void 0)||o;r.exports=s},61049:(r,t,e)=>{var n=e(53366),o=e(29259);r.exports=function(r){if(!o(r))return!1;var t=n(r);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:r=>{r.exports=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}},29259:r=>{r.exports=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)}},15125:r=>{r.exports=function(r){return null!=r&&"object"==typeof r}},4795:(r,t,e)=>{var n=e(53366),o=e(15125);r.exports=function(r){return"symbol"==typeof r||o(r)&&"[object Symbol]"==n(r)}},77598:(r,t,e)=>{var n=e(35522),o=e(47826),i=e(4146),a=i&&i.isTypedArray,u=a?o(a):n;r.exports=u},90249:(r,t,e)=>{var n=e(1634),o=e(86411),i=e(67878);r.exports=function(r){return i(r)?n(r):o(r)}},30733:(r,t,e)=>{var n=e(96738);function o(r,t){if("function"!=typeof r||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=e.cache;if(i.has(o))return i.get(o);var a=r.apply(this,n);return e.cache=i.set(o,a)||i,a};return e.cache=new(o.Cache||n),e}o.Cache=n,r.exports=o},65798:(r,t,e)=>{var n=e(20256),o=e(82952),i=e(21401),a=e(33812);r.exports=function(r){return i(r)?n(a(r)):o(r)}},30981:r=>{r.exports=function(){return[]}},36330:r=>{r.exports=function(){return!1}},66188:(r,t,e)=>{var n=e(1054);r.exports=function(r){return null==r?"":n(r)}},7226:(r,t,e)=>{var n=e(67552),o=e(50343),i=e(20256),a=e(36473),u=e(93746),s=Math.max;r.exports=function(r){if(!r||!r.length)return[];var t=0;return r=n(r,(function(r){if(u(r))return t=s(r.length,t),!0})),a(t,(function(t){return o(r,i(t))}))}},34122:(r,t,e)=>{var n=e(49432),o=e(50343),i=e(7226);r.exports=function(r,t){if(!r||!r.length)return[];var e=i(r);return null==t?e:o(e,(function(r){return n(t,void 0,r)}))}},32032:(r,t,e)=>{var n=e(36060),o=e(34122),i=n((function(r){var t=r.length,e=t>1?r[t-1]:void 0;return e="function"==typeof e?(r.pop(),e):void 0,o(r,e)}));r.exports=i},29722:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqArray=void 0;const a=i(e(92996)),u=e(12262);t.SqArray=class{constructor(r,t){this._value=r,this.location=t}getValues(){return a.getValues(this._value).map(((r,t)=>(0,u.wrapValue)(r,this.location.extend(t))))}}},44245:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqSymbolicDistribution=t.SqSampleSetDistribution=t.SqPointSetDistribution=t.wrapDistribution=t.SqDistributionTag=void 0;const a=i(e(97069)),u=e(24176);Object.defineProperty(t,"SqDistributionTag",{enumerable:!0,get:function(){return u.distributionTag}});const s=e(94250),f=e(72048),c=e(71682);t.wrapDistribution=r=>{const t=a.getTag(r);return new d[t](r)};class l{constructor(r){this._value=r,this.valueMethod=r=>{const t=r(this._value);if(!t)throw new Error("Internal casting error");return t}}pointSet(r){const t=a.toPointSet(this._value,r);return(0,c.resultMap2)(t,f.wrapPointSetDist,(r=>new s.SqDistributionError(r)))}toString(){a.toString(this._value)}mean(r){return(0,c.resultMap2)(a.mean({env:r},this._value),(r=>r),(r=>new s.SqDistributionError(r)))}pdf(r,t){return(0,c.resultMap2)(a.pdf({env:r},this._value,t),(r=>r),(r=>new s.SqDistributionError(r)))}cdf(r,t){return(0,c.resultMap2)(a.cdf({env:r},this._value,t),(r=>r),(r=>new s.SqDistributionError(r)))}inv(r,t){return(0,c.resultMap2)(a.inv({env:r},this._value,t),(r=>r),(r=>new s.SqDistributionError(r)))}stdev(r){return(0,c.resultMap2)(a.stdev({env:r},this._value),(r=>r),(r=>new s.SqDistributionError(r)))}}class m extends l{constructor(){super(...arguments),this.tag=u.distributionTag.PointSet}value(){return(0,f.wrapPointSetDist)(this.valueMethod(a.getPointSet))}}t.SqPointSetDistribution=m;class p extends l{constructor(){super(...arguments),this.tag=u.distributionTag.SampleSet}value(){return this.valueMethod(a.getSampleSet)}}t.SqSampleSetDistribution=p;class v extends l{constructor(){super(...arguments),this.tag=u.distributionTag.Symbolic}}t.SqSymbolicDistribution=v;const d={[u.distributionTag.PointSet]:m,[u.distributionTag.SampleSet]:p,[u.distributionTag.Symbolic]:v}},94250:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqDistributionError=void 0;const a=i(e(94508));t.SqDistributionError=class{constructor(r){this._value=r}toString(){return a.toString(this._value)}}},58041:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqFrame=t.SqError=void 0;const a=i(e(26612)),u=i(e(8642));class s{constructor(r){this._value=r}toString(){return a.toString(this._value)}toStringWithStackTrace(){return a.toStringWithStackTrace(this._value)}static createOtherError(r){return new s(a.createOtherError(r))}getTopFrame(){const r=u.getTopFrame(a.getFrameStack(this._value));return r?new f(r):void 0}getFrameArray(){return a.getFrameArray(this._value).map((r=>new f(r)))}location(){var r;return null===(r=this.getTopFrame())||void 0===r?void 0:r.location()}}t.SqError=s;class f{constructor(r){this._value=r}name(){return u.Frame.getName(this._value)}location(){return u.Frame.getLocation(this._value)}}t.SqFrame=f},69586:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqLambda=void 0;const a=i(e(94530));t.SqLambda=class{constructor(r,t){this._value=r,this.location=t}parameters(){return a.parameters(this._value)}call(r){const{project:t,sourceId:e}=this.location,n="__lambda__",o=r.map((r=>"number"==typeof r?r:(r=>`"${r.replace(new RegExp('"',"g"),'\\"')}"`)(r))).join(","),i=`${[..."result"===this.location.path.root?["__result__"]:[],...this.location.path.items].map(((r,t)=>"string"==typeof r?t?"."+r:r:`[${r}]`)).join("")}(${o})`;return t.setSource(n,i),t.setContinues(n,[e]),t.run(n),t.getResult(n)}}},87219:(r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SqLambdaDeclaration=void 0,t.SqLambdaDeclaration=class{constructor(r){this._value=r}}},72048:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t},a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.SqContinuousPointSetDist=t.SqDiscretePointSetDist=t.SqMixedPointSetDist=t.wrapPointSetDist=void 0;const u=a(e(32032)),s=e(44245),f=i(e(46060)),c=e(85189),l=r=>{let t=r.xyShape.xs,e=r.xyShape.ys;return(0,u.default)(t,e,((r,t)=>({x:r,y:t})))};t.wrapPointSetDist=r=>{const t=f.getTag(r);return new _[t](r)};class m{constructor(r){this._value=r,this.valueMethod=r=>{const t=r(this._value);if(!t)throw new Error("Internal casting error");return t}}asDistribution(){return(0,s.wrapDistribution)(f.toDistribution(this._value))}}class p extends m{constructor(){super(...arguments),this.tag=c.pointSetDistributionTag.Mixed}get value(){return this.valueMethod(f.getMixed)}asShape(){const r=this.value;return{discrete:l(r.discrete),continuous:l(r.continuous)}}}t.SqMixedPointSetDist=p;class v extends m{constructor(){super(...arguments),this.tag=c.pointSetDistributionTag.Discrete}get value(){return this.valueMethod(f.getDiscrete)}asShape(){const r=this.value;return{discrete:l(r),continuous:[]}}}t.SqDiscretePointSetDist=v;class d extends m{constructor(){super(...arguments),this.tag=c.pointSetDistributionTag.Continuous}get value(){return this.valueMethod(f.getContinues)}asShape(){const r=this.value;return{discrete:[],continuous:l(r)}}}t.SqContinuousPointSetDist=d;const _={[c.pointSetDistributionTag.Mixed]:p,[c.pointSetDistributionTag.Discrete]:v,[c.pointSetDistributionTag.Continuous]:d}},27431:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqProject=void 0;const a=i(e(66607)),u=e(58041),s=e(94386),f=e(12262),c=e(71682),l=e(62836);class m{constructor(r){this._value=r}static create(){return new m(a.createProject())}getSourceIds(){return a.getSourceIds(this._value)}setSource(r,t){return a.setSource(this._value,r,t)}removeSource(r){a.removeSource(this._value,r)}getSource(r){return a.getSource(this._value,r)}touchSource(r){return a.touchSource(this._value,r)}clean(r){return a.clean(this._value,r)}cleanAll(){return a.cleanAll(this._value)}cleanResults(r){return a.cleanResults(this._value,r)}cleanAllResults(){return a.cleanAllResults(this._value)}getIncludes(r){return(0,c.resultMap2)(a.getIncludes(this._value,r),(r=>r),(r=>new u.SqError(r)))}getContinues(r){return a.getContinues(this._value,r)}setContinues(r,t){return a.setContinues(this._value,r,t)}getRunOrder(){return a.getRunOrder(this._value)}getRunOrderFor(r){return a.getRunOrderFor(this._value,r)}parseIncludes(r){return a.parseIncludes(this._value,r)}run(r){return a.run(this._value,r)}runAll(){return a.runAll(this._value)}getBindings(r){return new s.SqRecord(a.getBindings(this._value,r),new l.SqValueLocation(this,r,{root:"bindings",items:[]}))}getResult(r){const t=a.getResult(this._value,r);return(0,c.resultMap2)(t,(t=>(0,f.wrapValue)(t,new l.SqValueLocation(this,r,{root:"result",items:[]}))),(r=>new u.SqError(r)))}setEnvironment(r){a.setEnvironment(this._value,r)}getEnvironment(){return a.getEnvironment(this._value)}}t.SqProject=m},94386:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqRecord=void 0;const a=i(e(76747)),u=e(12262);t.SqRecord=class{constructor(r,t){this._value=r,this.location=t}entries(){return a.getKeyValuePairs(this._value).map((([r,t])=>[r,(0,u.wrapValue)(t,this.location.extend(r))]))}toString(){return a.toString(this._value)}asValue(){return new u.SqRecordValue(a.toSquiggleValue(this._value),this.location)}}},12262:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SqVoidValue=t.SqTimeDurationValue=t.SqStringValue=t.SqRecordValue=t.SqNumberValue=t.SqLambdaValue=t.SqDistributionValue=t.SqDeclarationValue=t.SqDateValue=t.SqBoolValue=t.SqArrayValue=t.SqAbstractValue=t.wrapValue=t.SqValueTag=void 0;const a=i(e(73947)),u=e(7643);Object.defineProperty(t,"SqValueTag",{enumerable:!0,get:function(){return u.squiggleValueTag}});const s=e(44245),f=e(69586),c=e(87219),l=e(94386),m=e(29722);t.wrapValue=(r,t)=>{const e=a.getTag(r);return new x[e](r,t)};class p{constructor(r,t){this._value=r,this.location=t,this.valueMethod=r=>r(this._value)}toString(){return a.toString(this._value)}}t.SqAbstractValue=p;class v extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Array}get value(){return new m.SqArray(this.valueMethod(a.getArray),this.location)}}t.SqArrayValue=v;class d extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Bool}get value(){return this.valueMethod(a.getBool)}}t.SqBoolValue=d;class _ extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Date}get value(){return this.valueMethod(a.getDate)}}t.SqDateValue=_;class g extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Declaration}get value(){return new c.SqLambdaDeclaration(this.valueMethod(a.getDeclaration))}}t.SqDeclarationValue=g;class h extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Distribution}get value(){return(0,s.wrapDistribution)(this.valueMethod(a.getDistribution))}}t.SqDistributionValue=h;class y extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Lambda}get value(){return new f.SqLambda(this.valueMethod(a.getLambda),this.location)}}t.SqLambdaValue=y;class b extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Number}get value(){return this.valueMethod(a.getNumber)}}t.SqNumberValue=b;class A extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Record}get value(){return new l.SqRecord(this.valueMethod(a.getRecord),this.location)}}t.SqRecordValue=A;class S extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.String}get value(){return this.valueMethod(a.getString)}}t.SqStringValue=S;class T extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.TimeDuration}get value(){return this.valueMethod(a.getTimeDuration)}}t.SqTimeDurationValue=T;class E extends p{constructor(){super(...arguments),this.tag=u.squiggleValueTag.Void}get value(){return null}}t.SqVoidValue=E;const x={[u.squiggleValueTag.Array]:v,[u.squiggleValueTag.Bool]:d,[u.squiggleValueTag.Date]:_,[u.squiggleValueTag.Declaration]:g,[u.squiggleValueTag.Distribution]:h,[u.squiggleValueTag.Lambda]:y,[u.squiggleValueTag.Number]:b,[u.squiggleValueTag.Record]:A,[u.squiggleValueTag.String]:S,[u.squiggleValueTag.TimeDuration]:T,[u.squiggleValueTag.Void]:E}},62836:(r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SqValueLocation=void 0;class e{constructor(r,t,e){this.project=r,this.sourceId=t,this.path=e}extend(r){return new e(this.project,this.sourceId,{root:this.path.root,items:[...this.path.items,r]})}}t.SqValueLocation=e},52955:function(r,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(r,t,e,n){void 0===n&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}:function(r,t,e,n){void 0===n&&(n=e),r[n]=t[e]}),o=this&&this.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),i=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)"default"!==e&&Object.prototype.hasOwnProperty.call(r,e)&&n(t,r,e);return o(t,r),t};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SqParseError=void 0;const a=i(e(40337)),u=e(71682);class s{constructor(r){this._value=r}getMessage(){return a.ParseError_getMessage(this._value)}getLocation(){return a.ParseError_getLocation(this._value)}}t.SqParseError=s,t.parse=function(r){const t=a.parse(r,"main");return(0,u.resultMap2)(t,(r=>r),(r=>new s(r)))}},71682:(r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ok=t.resultMap2=t.resultMap=void 0,t.resultMap=function(r,t){return"Ok"===r.tag?{tag:"Ok",value:t(r.value)}:{tag:"Error",value:r.value}},t.resultMap2=function(r,t,e){return"Ok"===r.tag?{tag:"Ok",value:t(r.value)}:{tag:"Error",value:e(r.value)}},t.Ok=function(r){return{tag:"Ok",value:r}}},33162:function(r,t,e){"use strict";var n=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.kde=void 0;const o=n(e(90882));t.kde=(r,t,e,n)=>{const i=(r=(0,o.default)(r,isFinite)).length;if(0===i)return{usedWidth:e,xs:[],ys:[]};const a=r[0],u=r[i-1]-a,s=(t-1)*e/(u+2*e),f=Math.max(1,Math.floor(s)),c=u/(t-1-2*f),l=a-(e=f*c),m=Array(t+2*f).fill(0),p=1/c;r.forEach((r=>{const t=r-l,e=Math.floor(t*p),n=t-e*c,o=c-n;m[f+e+1]+=o,m[f+e+2]+=n}));const v=n/(e*e),d=Array(t).fill(0).map(((r,t)=>l+t*c));let _=0,g=0;const h=d.map(((r,t)=>{const e=m[t]-2*m[t+f]+m[t+2*f];return _+=e,g+=_,v*g}));return{usedWidth:e,xs:d,ys:h}}},56966:(r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nrd=t.nrd0=void 0;const e=(r,t)=>{const e=t*(r.length-1),n=Math.floor(e);if(n+1<r.length){const t=e-n,o=r[n];return o+t*(r[n+1]-o)}return r[n]},n=r=>{const t=r.length,e=(r[0]+r[t-1])/2;let n=0,o=0;r.forEach((r=>{let t=r-e;n+=t,o+=t*t}));const i=n/t;return o/t-i*i},o=r=>e(r,.75)-e(r,.25);t.nrd0=r=>{const t=Math.sqrt(n(r)),e=Math.min(t,o(r)/1.34),i=Math.abs(r[1]);return.9*(isNaN(e)?isNaN(t)?isNaN(i)?1:i:t:e)*Math.pow(r.length,-.2)},t.nrd=r=>{const t=o(r)/1.34;return 1.06*Math.min(Math.sqrt(n(r)),t)*Math.pow(r.length,-.2)}},62343:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toPointSetDist=void 0;const n=e(33162),o=e(56966),i=e(82058);t.toPointSetDist=(r,t,e)=>{r=Array.from(new Float64Array(r).sort());const{continuousPart:a,discretePart:u}=(0,i.splitContinuousAndDiscrete)(r,(r=>Math.max(20,r.length/50))(r)),s=a.length;let f,c,l=1/r.length;if(s<=5)l=1/(r.length-s);else if(a[0]===a[s-1])u.xs.push(s),u.ys.push(a[0]);else{const r=(0,o.nrd0)(a),i=e||r,{usedWidth:u,xs:s,ys:m}=(0,n.kde)(a,t,i,l);f={xs:s,ys:m},c={outputXYPoints:t,bandwidthXSuggested:r,bandwidthXImplemented:u}}return u.ys=u.ys.map((r=>r*l)),{continuousDist:f,discreteDist:u}}},82058:(r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitContinuousAndDiscrete=void 0,t.splitContinuousAndDiscrete=(r,t)=>{const e=[],n=[],o=[];if(!Number.isInteger(t))throw new Error("Minimum discrete weight must be an integer");if(t<=1)throw new Error("Minimum discrete weight must be at least 2");const i=t-1,a=r.length;let u=0;for(;u<a-i;){const t=r[u];if(t!==r[u+i])e.push(t),u++;else{const e=u;let s=i;const f=e=>e<a&&r[e]===t;for(;f(e+2*s);)s*=2;let c=e+s;for(u=Math.min(c+s,a);u-c>1;){const e=c+Math.floor((u-c)/2);r[e]===t?c=e:u=e}o.push(t),n.push(u-e)}}return e.push(...r.slice(u)),{continuousPart:e,discretePart:{xs:o,ys:n}}}},97069:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=t.toPointSet=t.normalize=t.pdf=t.inv=t.cdf=t.sample=t.variance=t.stdev=t.mean=t.getSymbolic=t.getSampleSet=t.getPointSet=t.getTag=t.defaultEnvironment=void 0;const n=e(10456),o=e(75591);t.defaultEnvironment=o.defaultEnvironment,t.getTag=o.getTag,t.getPointSet=o.getPointSet,t.getSampleSet=o.getSampleSet,t.getSymbolic=o.getSymbolic,t.mean=function(r,t){const e=n._2(o.mean,r.env,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.stdev=function(r,t){const e=n._2(o.stdev,r.env,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.variance=function(r,t){const e=n._2(o.variance,r.env,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.sample=function(r,t){const e=n._2(o.sample,r.env,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.cdf=function(r,t,e){const i=n._3(o.cdf,r.env,t,e);return 0===i.TAG?{tag:"Ok",value:i._0}:{tag:"Error",value:i._0}},t.inv=function(r,t,e){const i=n._3(o.inv,r.env,t,e);return 0===i.TAG?{tag:"Ok",value:i._0}:{tag:"Error",value:i._0}},t.pdf=function(r,t,e){const i=n._3(o.pdf,r.env,t,e);return 0===i.TAG?{tag:"Ok",value:i._0}:{tag:"Error",value:i._0}},t.normalize=function(r,t){const e=n._2(o.normalize,r.env,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.toPointSet=function(r,t){const e=n._2(o.toPointSet,r,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.toString=o.toString},94508:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0;const n=e(57399);t.toString=n.toString},46060:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toDistribution=t.getContinues=t.getDiscrete=t.getMixed=t.getTag=void 0;const n=e(28765);t.getTag=n.getTag,t.getMixed=n.getMixed,t.getDiscrete=n.getDiscrete,t.getContinues=n.getContinues,t.toDistribution=n.toDistribution},85189:(r,t)=>{"use strict";var e;Object.defineProperty(t,"__esModule",{value:!0}),t.pointSetDistributionTag=void 0,(e=t.pointSetDistributionTag||(t.pointSetDistributionTag={})).Mixed="Mixed",e.Discrete="Discrete",e.Continuous="Continuous"},24176:(r,t)=>{"use strict";var e;Object.defineProperty(t,"__esModule",{value:!0}),t.distributionTag=void 0,(e=t.distributionTag||(t.distributionTag={})).PointSet="PointSet",e.SampleSet="SampleSet",e.Symbolic="Symbolic"},66607:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=t.setEnvironment=t.evaluate=t.getResult=t.getBindings=t.runAll=t.run=t.rawParse=t.parseIncludes=t.getRunOrderFor=t.getRunOrder=t.getDependents=t.getDependencies=t.setContinues=t.getContinues=t.getPastChain=t.getIncludes=t.cleanAllResults=t.cleanResults=t.cleanAll=t.clean=t.touchSource=t.getSource=t.removeSource=t.setSource=t.getSourceIds=t.createProject=void 0;const n=e(10456),o=e(91835);t.createProject=o.createProject,t.getSourceIds=o.getSourceIds,t.setSource=function(r,t,e){return n._3(o.setSource,r,t,e)},t.removeSource=function(r,t){return n._2(o.removeSource,r,t)},t.getSource=function(r,t){return n._2(o.getSource,r,t)},t.touchSource=function(r,t){return n._2(o.touchSource,r,t)},t.clean=function(r,t){return n._2(o.clean,r,t)},t.cleanAll=o.cleanAll,t.cleanResults=function(r,t){return n._2(o.cleanResults,r,t)},t.cleanAllResults=o.cleanAllResults,t.getIncludes=function(r,t){const e=n._2(o.getIncludes,r,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.getPastChain=function(r,t){return n._2(o.getPastChain,r,t)},t.getContinues=function(r,t){return n._2(o.getContinues,r,t)},t.setContinues=function(r,t,e){return n._3(o.setContinues,r,t,e)},t.getDependencies=function(r,t){return n._2(o.getDependencies,r,t)},t.getDependents=function(r,t){return n._2(o.getDependents,r,t)},t.getRunOrder=o.getRunOrder,t.getRunOrderFor=function(r,t){return n._2(o.getRunOrderFor,r,t)},t.parseIncludes=function(r,t){return n._2(o.parseIncludes,r,t)},t.rawParse=function(r,t){return n._2(o.rawParse,r,t)},t.run=function(r,t){return n._2(o.run,r,t)},t.runAll=o.runAll,t.getBindings=function(r,t){return n._2(o.getBindings,r,t)},t.getResult=function(r,t){const e=n._2(o.getResult,r,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.evaluate=function(r){const t=o.evaluate(r);return[0===t[0].TAG?{tag:"Ok",value:t[0]._0}:{tag:"Error",value:t[0]._0},t[1]]},t.setEnvironment=function(r,t){return n._2(o.setEnvironment,r,t)},t.getEnvironment=o.getEnvironment},73947:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTimeDuration=t.getString=t.getRecord=t.getNumber=t.getLambda=t.getDistribution=t.getDeclaration=t.getDate=t.getBool=t.getArray=t.toStringResult=t.toString=t.getTag=void 0;const n=e(31989);t.getTag=n.getTag,t.toString=n.toString,t.toStringResult=function(r){return n.toStringResult("Ok"===r.tag?{TAG:0,_0:r.value}:{TAG:1,_0:r.value})},t.getArray=n.getArray,t.getBool=n.getBool,t.getDate=n.getDate,t.getDeclaration=n.getDeclaration,t.getDistribution=n.getDistribution,t.getLambda=n.getLambda,t.getNumber=n.getNumber,t.getRecord=n.getRecord,t.getString=n.getString,t.getTimeDuration=n.getTimeDuration},92996:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=t.getValues=void 0;const n=e(65040);t.getValues=n.getValues,t.toString=n.toString},94530:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parameters=t.toString=void 0;const n=e(83801);t.toString=n.toString,t.parameters=n.parameters},76747:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSquiggleValue=t.toString=t.getKeyValuePairs=void 0;const n=e(33674);t.getKeyValuePairs=n.getKeyValuePairs,t.toString=n.toString,t.toSquiggleValue=n.toSquiggleValue},7643:(r,t)=>{"use strict";var e;Object.defineProperty(t,"__esModule",{value:!0}),t.squiggleValueTag=void 0,(e=t.squiggleValueTag||(t.squiggleValueTag={})).Array="Array",e.Bool="Bool",e.Date="Date",e.Declaration="Declaration",e.Distribution="Distribution",e.Lambda="Lambda",e.Number="Number",e.Record="Record",e.String="String",e.TimeDuration="TimeDuration",e.Void="Void"},8642:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.getTopFrame=t.toFrameArray=t.Frame_getName=t.Frame_getLocation=void 0;const n=e(68034);t.Frame_getLocation=n.Frame.getLocation,t.Frame_getName=n.Frame.getName,t.toFrameArray=n.toFrameArray,t.getTopFrame=n.getTopFrame,t.Frame=n.Frame},40337:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseError=t.parse=t.ParseError_getLocation=t.ParseError_getMessage=t.ParseError_t=void 0;const n=e(10456),o=e(42687);t.ParseError_t=class{},t.ParseError_getMessage=o.ParseError.getMessage,t.ParseError_getLocation=o.ParseError.getLocation,t.parse=function(r,t){const e=n._2(o.parse,r,t);return 0===e.TAG?{tag:"Ok",value:e._0}:{tag:"Error",value:e._0}},t.ParseError=o.ParseError},36080:(r,t)=>{"use strict";function e(r,t,e){return{type:"Call",fn:r,args:t,location:e}}function n(r,t){return{type:"Identifier",value:r,location:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeVoid=t.nodeTernary=t.nodeString=t.nodeModuleIdentifier=t.nodeLetStatement=t.nodeLambda=t.nodeKeyValue=t.nodeInteger=t.nodeIdentifier=t.nodeFloat=t.nodeCall=t.nodeBoolean=t.nodeProgram=t.nodeBlock=t.constructRecord=t.constructArray=t.makeFunctionCall=t.postOperatorToFunction=t.unaryToFunction=t.toFunction=void 0,t.toFunction={"+":"add","-":"subtract","!=":"unequal",".-":"dotSubtract",".*":"dotMultiply","./":"dotDivide",".^":"dotPow",".+":"dotAdd","*":"multiply","/":"divide","&&":"and","^":"pow","<":"smaller","<=":"smallerEq","==":"equal",">":"larger",">=":"largerEq","||":"or",to:"credibleIntervalToDistribution"},t.unaryToFunction={"-":"unaryMinus","!":"not",".-":"unaryDotMinus"},t.postOperatorToFunction={".":"$_atIndex_$","()":"$$_applyAll_$$","[]":"$_atIndex_$"},t.makeFunctionCall=function(r,t,o){return"$$_applyAll_$$"===r?e(t[0],t.splice(1),o):e(n(r,o),t,o)},t.constructArray=function(r,t){return{type:"Array",elements:r,location:t}},t.constructRecord=function(r,t){return{type:"Record",elements:r,location:t}},t.nodeBlock=function(r,t){return{type:"Block",statements:r,location:t}},t.nodeProgram=function(r,t){return{type:"Program",statements:r,location:t}},t.nodeBoolean=function(r,t){return{type:"Boolean",value:r,location:t}},t.nodeCall=e,t.nodeFloat=function(r,t){return{type:"Float",value:r,location:t}},t.nodeIdentifier=n,t.nodeInteger=function(r,t){return{type:"Integer",value:r,location:t}},t.nodeKeyValue=function(r,t,e){return"Identifier"===r.type&&(r=Object.assign(Object.assign({},r),{type:"String"})),{type:"KeyValue",key:r,value:t,location:e}},t.nodeLambda=function(r,t,e,n){return{type:"Lambda",args:r,body:t,location:e,name:null==n?void 0:n.value}},t.nodeLetStatement=function(r,t,e){return{type:"LetStatement",variable:r,value:"Lambda"===t.type?Object.assign(Object.assign({},t),{name:r.value}):t,location:e}},t.nodeModuleIdentifier=function(r,t){return{type:"ModuleIdentifier",value:r,location:t}},t.nodeString=function(r,t){return{type:"String",value:r,location:t}},t.nodeTernary=function(r,t,e,n){return{type:"Ternary",condition:r,trueExpression:t,falseExpression:e,location:n}},t.nodeVoid=function(r){return{type:"Void",location:r}}},26612:(r,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toStringWithStackTrace=t.getFrameArray=t.createOtherError=t.toString=t.getFrameStack=t.getTopFrame=t.fromMessage=t.t=t.Message_t=void 0;const n=e(5777);t.Message_t=class{},t.t=class{},t.fromMessage=n.fromMessage,t.getTopFrame=n.getTopFrame,t.getFrameStack=n.getFrameStack,t.toString=n.toString,t.createOtherError=n.createOtherError,t.getFrameArray=n.getFrameArray,t.toStringWithStackTrace=n.toStringWithStackTrace},52340:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890),i=e(17646),a=e(21374),u=e(73539),s=e(85659),f=e(51618),c=e(72540),l={sampleCount:s.Environment.defaultSampleCount,xyPointLength:s.Environment.defaultXYPointLength};function m(r){if(5===r.TAG)return r._0}function p(r){return 0===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:i.$$default(m(r),1),[Symbol.for("name")]:"Error"}}function v(r){return 1===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:i.$$default(m(r),1),[Symbol.for("name")]:"Error"}}function d(r){return 2===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:i.$$default(m(r),1),[Symbol.for("name")]:"Error"}}function _(r){return 4===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:i.$$default(m(r),1),[Symbol.for("name")]:"Error"}}function g(r){return 0===r.TAG?r._0:{TAG:5,_0:r._0,[Symbol.for("name")]:"GenDistError"}}function h(r,t){var e=r.xyPointLength,n=r.sampleCount,s=function(e,n,o){return h(void 0!==e?e:r,void 0!==n?n:t)},c=function(r){var t=s(void 0,{TAG:0,_0:{NAME:"ToDist",VAL:1},_1:r,[Symbol.for("name")]:"FromDist"});if(0!==t.TAG)return{TAG:1,_0:i.$$default(m(t),1),[Symbol.for("name")]:"Error"};var e=t._0;switch(0|e.TAG){case 0:return{TAG:0,_0:e._0,[Symbol.for("name")]:"Ok"};case 1:case 2:return{TAG:1,_0:i.$$default(m(t),1),[Symbol.for("name")]:"Error"}}};switch(0|t.TAG){case 0:var l=t._0,v=t._1,d=l.NAME;if("ToString"===d){var _=l.VAL;return _?g(a.fmap(u.toSparkline(v,n,_._0,void 0),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"String"}}))):{TAG:2,_0:u.toString(v),[Symbol.for("name")]:"String"}}if("ToScore"===d){var y=l.VAL;return g(a.fmap(u.Score.logScore(v,y._0,y._1,r),(function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Float"}})))}if("ToFloat"===d)return g(a.fmap(u.toFloatOperation(v,c,l.VAL),(function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Float"}})));if("ToBool"===d)return{TAG:4,_0:u.isNormalized(v),[Symbol.for("name")]:"Bool"};if("ToDist"!==d){var b=l.VAL,A=b[0];if(A){var S=b[2];return"Dist"===S.NAME?g(a.fmap(u.algebraicCombination(A._0,v,c,(function(r){var t=s(void 0,{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:0,_0:n,[Symbol.for("name")]:"ToSampleSet"}},_1:r,[Symbol.for("name")]:"FromDist"});if(0!==t.TAG)return{TAG:1,_0:i.$$default(m(t),1),[Symbol.for("name")]:"Error"};var e=t._0;switch(0|e.TAG){case 1:return{TAG:0,_0:e._0,[Symbol.for("name")]:"Ok"};case 0:case 2:return{TAG:1,_0:i.$$default(m(t),1),[Symbol.for("name")]:"Error"}}}),b[1],S.VAL),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}}))):{TAG:5,_0:0,[Symbol.for("name")]:"GenDistError"}}var T=b[2],E=b[1];return"Dist"===T.NAME?g(a.fmap(u.pointwiseCombination(v,c,E,T.VAL),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}}))):g(a.fmap(u.pointwiseCombinationFloat(v,c,E,T.VAL),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})))}var x=l.VAL;if("number"==typeof x)switch(x){case 0:return{TAG:0,_0:u.normalize(v),[Symbol.for("name")]:"Dist"};case 1:return g(a.fmap(u.toPointSet(v,e,n,void 0,void 0),(function(r){return{TAG:0,_0:{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"},[Symbol.for("name")]:"Dist"}})));case 2:return console.log("Console log requested: ",v),{TAG:0,_0:v,[Symbol.for("name")]:"Dist"}}else switch(0|x.TAG){case 0:return g(a.fmap(u.toSampleSetDist(v,x._0),(function(r){return{TAG:0,_0:{TAG:1,_0:r,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Dist"}})));case 1:var G=x._0;return g("object"==typeof G?a.fmap(u.pointwiseCombinationFloat(v,c,{NAME:"LogarithmWithThreshold",VAL:G.VAL},x._1),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})):"Power"===G?a.fmap(u.pointwiseCombinationFloat(v,c,"Power",x._1),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})):"Multiply"===G?a.fmap(u.pointwiseCombinationFloat(v,c,"Multiply",x._1),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})):a.fmap(u.pointwiseCombinationFloat(v,c,"Logarithm",x._1),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})));case 2:return g(a.fmap(u.truncate(v,c,o.some(x._0),o.some(x._1),void 0),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})))}case 1:return s(void 0,{TAG:1,_0:t._0,_1:t._1,[Symbol.for("name")]:"FromFloat"});case 2:return g(a.fmap(a.errMap(f.make(t._0),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"SampleSetError"}})),(function(r){return{TAG:0,_0:{TAG:1,_0:r,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Dist"}})));case 3:return g(a.fmap(u.mixture(t._0,(function(r,t){return p(s(void 0,{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Multiply",{NAME:"Float",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}))}),(function(r,t){return p(s(void 0,{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Add",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}))}),r),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Dist"}})))}}var y={distEstimateDistAnswer:function(r,t,e){return v(h(r,n._2(c.Constructors.UsingDists.LogScore.distEstimateDistAnswer,t,e)))},distEstimateDistAnswerWithPrior:function(r,t,e,o){return v(h(r,n._3(c.Constructors.UsingDists.LogScore.distEstimateDistAnswerWithPrior,t,e,o)))},distEstimateScalarAnswer:function(r,t,e){return v(h(r,n._2(c.Constructors.UsingDists.LogScore.distEstimateScalarAnswer,t,e)))},distEstimateScalarAnswerWithPrior:function(r,t,e,o){return v(h(r,n._3(c.Constructors.UsingDists.LogScore.distEstimateScalarAnswerWithPrior,t,e,o)))}},b={toDist:function(r){if(0===r.TAG)return r._0},toDistR:p,toFloat:function(r){if(1===r.TAG)return r._0},toFloatR:v,toString:function(r){if(2===r.TAG)return r._0},toStringR:d,toBool:function(r){if(4===r.TAG)return r._0},toBoolR:_,toError:m,fmap:function(r,t,e){var n,o=0;if(0===e.TAG)switch(0|t.TAG){case 0:n={TAG:0,_0:{TAG:0,_0:e._0,_1:t._0,[Symbol.for("name")]:"FromDist"},[Symbol.for("name")]:"Ok"};break;case 5:n={TAG:1,_0:t._0,[Symbol.for("name")]:"Error"};break;default:o=1}else switch(0|t.TAG){case 1:n={TAG:0,_0:{TAG:1,_0:e._0,_1:t._0,[Symbol.for("name")]:"FromFloat"},[Symbol.for("name")]:"Ok"};break;case 5:n={TAG:1,_0:t._0,[Symbol.for("name")]:"Error"};break;default:o=1}return 1===o&&(n=0===e.TAG?{TAG:1,_0:{TAG:7,_0:"Expected dist, got something else",[Symbol.for("name")]:"OtherError"},[Symbol.for("name")]:"Error"}:{TAG:1,_0:{TAG:7,_0:"Expected float, got something else",[Symbol.for("name")]:"OtherError"},[Symbol.for("name")]:"Error"}),g(a.fmap(n,(function(t){return h(r,t)})))}},A={mean:function(r,t){return v(h(r,n._1(c.Constructors.UsingDists.mean,t)))},stdev:function(r,t){return v(h(r,n._1(c.Constructors.UsingDists.stdev,t)))},variance:function(r,t){return v(h(r,n._1(c.Constructors.UsingDists.variance,t)))},sample:function(r,t){return v(h(r,n._1(c.Constructors.UsingDists.sample,t)))},cdf:function(r,t,e){return v(h(r,n._2(c.Constructors.UsingDists.cdf,t,e)))},inv:function(r,t,e){return v(h(r,n._2(c.Constructors.UsingDists.inv,t,e)))},pdf:function(r,t,e){return v(h(r,n._2(c.Constructors.UsingDists.pdf,t,e)))},normalize:function(r,t){return p(h(r,n._1(c.Constructors.UsingDists.normalize,t)))},isNormalized:function(r,t){return _(h(r,n._1(c.Constructors.UsingDists.isNormalized,t)))},LogScore:y,toPointSet:function(r,t){return p(h(r,n._1(c.Constructors.UsingDists.toPointSet,t)))},toSampleSet:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.toSampleSet,t,e)))},fromSamples:function(r,t){return p(h(r,n._1(c.Constructors.UsingDists.fromSamples,t)))},truncate:function(r,t,e,o){return p(h(r,n._3(c.Constructors.UsingDists.truncate,t,e,o)))},inspect:function(r,t){return p(h(r,n._1(c.Constructors.UsingDists.inspect,t)))},toString:function(r,t){return d(h(r,n._1(c.Constructors.UsingDists.toString,t)))},toSparkline:function(r,t,e){return d(h(r,n._2(c.Constructors.UsingDists.toSparkline,t,e)))},algebraicAdd:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicAdd,t,e)))},algebraicMultiply:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicMultiply,t,e)))},algebraicDivide:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicDivide,t,e)))},algebraicSubtract:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicSubtract,t,e)))},algebraicLogarithm:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicLogarithm,t,e)))},algebraicPower:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.algebraicPower,t,e)))},scaleLogarithm:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.scaleLogarithm,t,e)))},scaleMultiply:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.scaleMultiply,t,e)))},scalePower:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.scalePower,t,e)))},pointwiseAdd:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwiseAdd,t,e)))},pointwiseMultiply:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwiseMultiply,t,e)))},pointwiseDivide:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwiseDivide,t,e)))},pointwiseSubtract:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwiseSubtract,t,e)))},pointwiseLogarithm:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwiseLogarithm,t,e)))},pointwisePower:function(r,t,e){return p(h(r,n._2(c.Constructors.UsingDists.pointwisePower,t,e)))}};t.defaultEnv=l,t.run=h,t.runFromDist=function(r,t,e){return h(r,{TAG:0,_0:t,_1:e,[Symbol.for("name")]:"FromDist"})},t.runFromFloat=function(r,t,e){return h(r,{TAG:1,_0:t,_1:e,[Symbol.for("name")]:"FromFloat"})},t.Output=b,t.Constructors=A},72540:(r,t,e)=>{"use strict";var n=e(69129),o=e(21374),i=e(46366),a=e(52017),u=e(70749),s=e(88950),f=e(51618),c={fromString:function(r){return{TAG:7,_0:r,[Symbol.for("name")]:"OtherError"}},toString:function(r){if("number"==typeof r)switch(r){case 0:return"Function not yet implemented";case 1:return"Unreachable";case 2:return"Distribution vertical shift is invalid"}else switch(0|r.TAG){case 0:var t=r._0;return"number"==typeof t?"Too Few Samples":0===t.TAG?"Found a non-number in input: "+t._0:u.$$Error.toString(t._0);case 1:return"Argument Error "+r._0;case 2:return u.$$Error.toString(r._0);case 3:return f.pointsetConversionErrorToString(r._0);case 4:return s.sparklineErrorToString(r._0);case 5:return"Requested strategy invalid: "+r._0;case 6:return"Logarithm of input error: "+r._0;case 7:return r._0;case 8:return"XY Shape Error: "+a.$$Error.toString(r._0)}},resultStringToResultError:function(r){return o.errMap(r,(function(r){return{TAG:7,_0:r,[Symbol.for("name")]:"OtherError"}}))},sampleErrorToDistErr:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"SampleSetError"}}};function l(r){var t=r.NAME;if("ToString"===t){var e=r.VAL;return e?"sparkline("+n.toString(e._0)+")":"toString"}if("ToFloat"===t){var o=r.VAL;if("object"!=typeof o)return"Sample"===o?"sample":"IntegralSum"===o?"integralSum":"Max"===o?"max":"Min"===o?"min":"Stdev"===o?"stdev":"Mean"===o?"mean":"Mode"===o?"mode":"variance";var a=o.NAME;return"Inv"===a?"inv("+i.toFixed(o.VAL)+")":"Pdf"===a?"pdf("+i.toFixed(o.VAL)+")":"cdf("+i.toFixed(o.VAL)+")"}if("ToBool"===t)return"isNormalized";if("ToDist"!==t)return r.VAL[0]?"algebraic":"pointwise";var u=r.VAL;if("number"==typeof u)switch(u){case 0:return"normalize";case 1:return"toPointSet";case 2:return"inspect"}else switch(0|u.TAG){case 0:return"toSampleSet("+n.toString(u._0)+")";case 1:var s=u._0;return"object"==typeof s?"scaleLogWithThreshold("+i.toFixed(u._1)+", epsilon="+i.toFixed(s.VAL)+")":"Power"===s?"scalePower("+i.toFixed(u._1)+")":"Multiply"===s?"scaleMultiply("+i.toFixed(u._1)+")":"scaleLog("+i.toFixed(u._1)+")";case 2:return"truncate"}}function m(r){var t=r.NAME;if("ToString"===t)return l({NAME:"ToString",VAL:r.VAL});if("ToScore"===t)return"logScore";if("ToFloat"===t)return l({NAME:"ToFloat",VAL:r.VAL});if("ToBool"===t)return l({NAME:"ToBool",VAL:r.VAL});if("ToDist"===t)return l({NAME:"ToDist",VAL:r.VAL});var e=r.VAL;return l({NAME:"ToDistCombination",VAL:[e[0],e[1],e[2]]})}var p={floatCallToString:l,distCallToString:m,toString:function(r){switch(0|r.TAG){case 0:return m(r._0);case 1:return l(r._0);case 2:return"fromSamples";case 3:return"mixture"}}},v={UsingDists:{mean:function(r){return{TAG:0,_0:{NAME:"ToFloat",VAL:"Mean"},_1:r,[Symbol.for("name")]:"FromDist"}},stdev:function(r){return{TAG:0,_0:{NAME:"ToFloat",VAL:"Stdev"},_1:r,[Symbol.for("name")]:"FromDist"}},variance:function(r){return{TAG:0,_0:{NAME:"ToFloat",VAL:"Variance"},_1:r,[Symbol.for("name")]:"FromDist"}},sample:function(r){return{TAG:0,_0:{NAME:"ToFloat",VAL:"Sample"},_1:r,[Symbol.for("name")]:"FromDist"}},cdf:function(r,t){return{TAG:0,_0:{NAME:"ToFloat",VAL:{NAME:"Cdf",VAL:t}},_1:r,[Symbol.for("name")]:"FromDist"}},inv:function(r,t){return{TAG:0,_0:{NAME:"ToFloat",VAL:{NAME:"Inv",VAL:t}},_1:r,[Symbol.for("name")]:"FromDist"}},pdf:function(r,t){return{TAG:0,_0:{NAME:"ToFloat",VAL:{NAME:"Pdf",VAL:t}},_1:r,[Symbol.for("name")]:"FromDist"}},normalize:function(r){return{TAG:0,_0:{NAME:"ToDist",VAL:0},_1:r,[Symbol.for("name")]:"FromDist"}},isNormalized:function(r){return{TAG:0,_0:{NAME:"ToBool",VAL:0},_1:r,[Symbol.for("name")]:"FromDist"}},toPointSet:function(r){return{TAG:0,_0:{NAME:"ToDist",VAL:1},_1:r,[Symbol.for("name")]:"FromDist"}},toSampleSet:function(r,t){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:0,_0:t,[Symbol.for("name")]:"ToSampleSet"}},_1:r,[Symbol.for("name")]:"FromDist"}},fromSamples:function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"FromSamples"}},truncate:function(r,t,e){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:2,_0:t,_1:e,[Symbol.for("name")]:"Truncate"}},_1:r,[Symbol.for("name")]:"FromDist"}},inspect:function(r){return{TAG:0,_0:{NAME:"ToDist",VAL:2},_1:r,[Symbol.for("name")]:"FromDist"}},LogScore:{distEstimateDistAnswer:function(r,t){return{TAG:0,_0:{NAME:"ToScore",VAL:{_0:{TAG:0,_0:t,[Symbol.for("name")]:"Score_Dist"},_1:void 0,[Symbol.for("name")]:"LogScore"}},_1:r,[Symbol.for("name")]:"FromDist"}},distEstimateDistAnswerWithPrior:function(r,t,e){return{TAG:0,_0:{NAME:"ToScore",VAL:{_0:{TAG:0,_0:t,[Symbol.for("name")]:"Score_Dist"},_1:e,[Symbol.for("name")]:"LogScore"}},_1:r,[Symbol.for("name")]:"FromDist"}},distEstimateScalarAnswer:function(r,t){return{TAG:0,_0:{NAME:"ToScore",VAL:{_0:{TAG:1,_0:t,[Symbol.for("name")]:"Score_Scalar"},_1:void 0,[Symbol.for("name")]:"LogScore"}},_1:r,[Symbol.for("name")]:"FromDist"}},distEstimateScalarAnswerWithPrior:function(r,t,e){return{TAG:0,_0:{NAME:"ToScore",VAL:{_0:{TAG:1,_0:t,[Symbol.for("name")]:"Score_Scalar"},_1:e,[Symbol.for("name")]:"LogScore"}},_1:r,[Symbol.for("name")]:"FromDist"}}},scaleMultiply:function(r,t){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:1,_0:"Multiply",_1:t,[Symbol.for("name")]:"Scale"}},_1:r,[Symbol.for("name")]:"FromDist"}},scalePower:function(r,t){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:1,_0:"Power",_1:t,[Symbol.for("name")]:"Scale"}},_1:r,[Symbol.for("name")]:"FromDist"}},scaleLogarithm:function(r,t){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:1,_0:"Logarithm",_1:t,[Symbol.for("name")]:"Scale"}},_1:r,[Symbol.for("name")]:"FromDist"}},scaleLogarithmWithThreshold:function(r,t,e){return{TAG:0,_0:{NAME:"ToDist",VAL:{TAG:1,_0:{NAME:"LogarithmWithThreshold",VAL:e},_1:t,[Symbol.for("name")]:"Scale"}},_1:r,[Symbol.for("name")]:"FromDist"}},toString:function(r){return{TAG:0,_0:{NAME:"ToString",VAL:0},_1:r,[Symbol.for("name")]:"FromDist"}},toSparkline:function(r,t){return{TAG:0,_0:{NAME:"ToString",VAL:{_0:t,[Symbol.for("name")]:"ToSparkline"}},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicAdd:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Add",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicMultiply:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Multiply",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicDivide:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Divide",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicSubtract:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Subtract",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicLogarithm:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Logarithm",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},algebraicPower:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[{_0:0,[Symbol.for("name")]:"Algebraic"},"Power",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwiseAdd:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Add",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwiseMultiply:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Multiply",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwiseDivide:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Divide",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwiseSubtract:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Subtract",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwiseLogarithm:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Logarithm",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}},pointwisePower:function(r,t){return{TAG:0,_0:{NAME:"ToDistCombination",VAL:[0,"Power",{NAME:"Dist",VAL:t}]},_1:r,[Symbol.for("name")]:"FromDist"}}}};t.$$Error=c,t.DistributionOperation=p,t.Constructors=v},73539:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924),i=e(5890),a=e(62751),u=e(17646),s=e(21374),f=e(52017),c=e(40884),l=e(70749),m=e(85659),p=e(96770),v=e(14307),d=e(51618),_=e(72540);function g(r){switch(0|r.TAG){case 1:return!0;case 0:case 2:return!1}}function h(r,t){switch(0|r.TAG){case 0:return p.sampleNRendered(t,r._0);case 1:return d.sampleN(r._0,t);case 2:return v.T.sampleN(t,r._0)}}function y(r){switch(0|r.TAG){case 0:return n._1(p.T.integralEndY,r._0);case 1:case 2:return 1}}function b(r,t,e){if("object"!=typeof e&&"Mean"!==e&&"Min"!==e&&"Max"!==e&&"Sample"!==e){if("IntegralSum"===e)return{TAG:0,_0:y(r),[Symbol.for("name")]:"Ok"};switch(0|r.TAG){case 1:var o=r._0;return"Stdev"===e?{TAG:0,_0:d.stdev(o),[Symbol.for("name")]:"Ok"}:"Mode"===e?{TAG:0,_0:d.mode(o),[Symbol.for("name")]:"Ok"}:{TAG:0,_0:d.variance(o),[Symbol.for("name")]:"Ok"};case 0:case 2:return{TAG:1,_0:0,[Symbol.for("name")]:"Error"}}}var i,a;switch(0|r.TAG){case 0:case 1:i=void 0;break;case 2:i=s.toOption(v.T.operate(e,r._0))}switch(0|r.TAG){case 1:var u=r._0;if("object"==typeof e){var f=e.NAME;a="Cdf"===f?d.cdf(u,e.VAL):"Inv"===f?d.percentile(u,e.VAL):void 0}else a="Sample"===e?d.sample(u):"Max"===e?d.max(u):"Min"===e?d.min(u):"Mean"===e?d.mean(u):void 0;break;case 0:case 2:a=void 0}return void 0!==i?{TAG:0,_0:i,[Symbol.for("name")]:"Ok"}:void 0!==a?{TAG:0,_0:a,[Symbol.for("name")]:"Ok"}:s.fmap(n._1(t,r),(function(r){return p.operate(e,r)}))}function A(r,t,e,n,o){var i=void 0!==n?n:"ByWeight";switch(0|r.TAG){case 0:return{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"};case 1:return s.errMap(d.toPointSetDist(r._0,{sampleCount:e,outputXYPoints:t,kernelWidth:void 0,pointSetDistLength:t}),(function(r){return{TAG:3,_0:r,[Symbol.for("name")]:"PointSetConversionError"}}));case 2:return{TAG:0,_0:v.T.toPointSetDist(i,t,r._0),[Symbol.for("name")]:"Ok"}}}function S(r,t,e,o){return s.fmap(s.fmap(s.merge(n._1(r,e),n._1(r,o)),(function(r){return p.combineAlgebraically(t,r[0],r[1])})),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"}}))}function T(r,t,e,o){var i=function(r,e){return l.Algebraic.toFn(t,r,e)};return s.fmap(s.bind(s.merge(n._1(r,e),n._1(r,o)),(function(r){return s.errMap(d.map2(i,r[0],r[1]),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"SampleSetError"}}))})),(function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"SampleSet"}}))}function E(r,t,e){switch(0|t.TAG){case 0:case 1:return"NoSolution";case 2:switch(0|e.TAG){case 0:case 1:return"NoSolution";case 2:return v.T.tryAnalyticalSimplification(t._0,e._0,r)}}}function x(r){switch(0|r.TAG){case 0:var t=r._0;switch(0|t.TAG){case 0:return m.OpCost.mixedCost;case 1:return f.T.length(t._0.xyShape);case 2:return m.OpCost.continuousCost}case 1:return m.OpCost.wildcardCost;case 2:var e=r._0;return"object"==typeof e&&"Float"===e.NAME?m.OpCost.floatCost:m.OpCost.symbolicCost}}var G={logScore:function(r,t,e,o){return s.bind(function(r,t,e,o){var i=function(r){return A(r,o.xyPointLength,o.sampleCount,"ByWeight")},a=void 0!==e?i(e):void 0,u=function(r,t,e){return s.merge(n._1(r,t),n._1(r,e))};if(0===t.TAG){var f=t._0;if(void 0===a)return s.fmap(u(i,r,f),(function(r){return{TAG:0,_0:{estimate:r[0],answer:r[1],prior:void 0},[Symbol.for("name")]:"DistAnswer"}}));if(0!==a.TAG)return{TAG:1,_0:a._0,[Symbol.for("name")]:"Error"};var c=a._0;return s.fmap(u(i,r,f),(function(r){return{TAG:0,_0:{estimate:r[0],answer:r[1],prior:c},[Symbol.for("name")]:"DistAnswer"}}))}var l=t._0;if(void 0===a)return s.fmap(i(r),(function(r){return{TAG:1,_0:{estimate:r,answer:l,prior:void 0},[Symbol.for("name")]:"ScalarAnswer"}}));if(0!==a.TAG)return{TAG:1,_0:a._0,[Symbol.for("name")]:"Error"};var m=a._0;return s.fmap(i(r),(function(r){return{TAG:1,_0:{estimate:r,answer:l,prior:m},[Symbol.for("name")]:"ScalarAnswer"}}))}(r,t,e,o),(function(r){return s.errMap(p.logScore(r),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"OperationError"}}))}))}};t.sampleN=h,t.sample=function(r){return u.toExn(a.first(h(r,1)),"Should not have happened")},t.toSampleSetDist=function(r,t){return s.errMap(d.make(h(r,t)),_.$$Error.sampleErrorToDistErr)},t.fromFloat=function(r){return{TAG:2,_0:v.Float.make(r),[Symbol.for("name")]:"Symbolic"}},t.toString=function(r){switch(0|r.TAG){case 0:return"Point Set Distribution";case 1:return"Sample Set Distribution";case 2:return v.T.toString(r._0)}},t.normalize=function(r){switch(0|r.TAG){case 0:return{TAG:0,_0:n._1(p.T.normalize,r._0),[Symbol.for("name")]:"PointSet"};case 1:case 2:return r}},t.isNormalized=function(r){return Math.abs(y(r)-1)<1e-7},t.toFloatOperation=b,t.Score=G,t.toPointSet=A,t.toSparkline=function(r,t,e,n){var o=void 0!==e?e:20;return s.bind(A(r,Math.imul(o,3),t,"Linear"),(function(r){return s.errMap(p.toSparkline(r,o),(function(r){return{TAG:4,_0:r,[Symbol.for("name")]:"SparklineError"}}))}))},t.truncate=function(r,t,e,o,a){var f=void 0!==e?i.valFromOption(e):void 0,c=void 0!==o?i.valFromOption(o):void 0;if(u.isNone(f)&&u.isNone(c))return{TAG:0,_0:r,[Symbol.for("name")]:"Ok"};var l=function(r,t,e){if(void 0!==r){if(void 0!==t)switch(0|e.TAG){case 0:case 1:return;case 2:var n=e._0;if("object"==typeof n&&"Uniform"===n.NAME&&r<t)return{TAG:2,_0:{NAME:"Uniform",VAL:v.Uniform.truncate(r,t,n.VAL)},[Symbol.for("name")]:"Symbolic"}}}else if(void 0===t)return;switch(0|e.TAG){case 0:case 1:return;case 2:var o=e._0;return"object"==typeof o&&"Uniform"===o.NAME?{TAG:2,_0:{NAME:"Uniform",VAL:v.Uniform.truncate(r,t,o.VAL)},[Symbol.for("name")]:"Symbolic"}:void 0}}(f,c,r);if(void 0!==l)return{TAG:0,_0:l,[Symbol.for("name")]:"Ok"};if(1==(0|r.TAG)){var m=d.truncate(r._0,f,c);return 0===m.TAG?{TAG:0,_0:{TAG:1,_0:m._0,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:0,_0:m._0,[Symbol.for("name")]:"SampleSetError"},[Symbol.for("name")]:"Error"}}return s.fmap(n._1(t,r),(function(r){return{TAG:0,_0:n._1(p.T.normalize,n._3(p.T.truncate,f,c,r)),[Symbol.for("name")]:"PointSet"}}))},t.algebraicCombination=function(r,t,e,n,o,i){var u=function(r,t,e,n){if("Logarithm"===n){var o=function(r){return s.fmap(b(r,e,{NAME:"Cdf",VAL:m.Epsilon.ten}),(function(r){return r>0}))},i=a.R.firstErrorOrOpen([o(r),o(t)]);if(0!==i.TAG)return i._0;var u=i._0;return 2!==u.length?1:u[0]?{TAG:6,_0:"First input must be completely greater than 0",[Symbol.for("name")]:"LogarithmOfDistributionError"}:u[1]?{TAG:6,_0:"Second input must be completely greater than 0",[Symbol.for("name")]:"LogarithmOfDistributionError"}:void 0}}(t,i,e,o);if(void 0!==u)return{TAG:1,_0:u,[Symbol.for("name")]:"Error"};switch(r){case 0:var f=function(r,t,e){return"object"==typeof E(e,r,t)?"AsSymbolic":function(r,t,e){return!(function(r,t){return!!g(r)||g(t)}(r,t)||!l.Convolution.canDoAlgebraicOperation(e))&&Math.imul(x(r),x(t))<m.OpCost.monteCarloCost}(r,t,e)?"AsConvolution":"AsMonteCarlo"}(t,i,o);if("AsSymbolic"===f){var c=E(o,t,i);return"object"==typeof c?"Error"===c.NAME?{TAG:1,_0:{TAG:2,_0:c.VAL,[Symbol.for("name")]:"OperationError"},[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:2,_0:c.VAL,[Symbol.for("name")]:"Symbolic"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:1,[Symbol.for("name")]:"Error"}}if("AsConvolution"!==f)return T(n,o,t,i);var p=l.Convolution.fromAlgebraicOperation(o);return void 0!==p?S(e,p,t,i):{TAG:1,_0:1,[Symbol.for("name")]:"Error"};case 1:var v=E(o,t,i);return"object"==typeof v?"Error"===v.NAME?{TAG:1,_0:{TAG:2,_0:v.VAL,[Symbol.for("name")]:"OperationError"},[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:2,_0:v.VAL,[Symbol.for("name")]:"Symbolic"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:5,_0:"No analytic solution for inputs",[Symbol.for("name")]:"RequestedStrategyInvalidError"},[Symbol.for("name")]:"Error"};case 2:return T(n,o,t,i);case 3:var d=l.Convolution.fromAlgebraicOperation(o);return void 0!==d?S(e,d,t,i):{TAG:1,_0:{TAG:5,_0:"Convolution not supported for "+l.Algebraic.toString(o),[Symbol.for("name")]:"RequestedStrategyInvalidError"},[Symbol.for("name")]:"Error"}}},t.pointwiseCombination=function(r,t,e,o){return s.bind(s.merge(n._1(t,r),n._1(t,o)),(function(r){return s.errMap(s.fmap(p.combinePointwise(void 0,void 0,void 0,(function(r,t){return l.Algebraic.toFn(e,r,t)}),r[0],r[1]),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"}})),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"OperationError"}}))}))},t.pointwiseCombinationFloat=function(r,t,e,o){var i=function(e){return s.bind(n._1(t,r),(function(r){var t=l.Scale.toIntegralSumCacheFn(e),i=l.Scale.toIntegralCacheFn(e);return s.errMap(n._4(p.T.mapYResult,n._1(t,o),n._1(i,o),r,(function(r){return l.Scale.toFn(e,r,o)})),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"OperationError"}}))}))},a="object"==typeof e?i({NAME:"LogarithmWithThreshold",VAL:e.VAL}):"Multiply"===e||"Divide"===e||"Power"===e||"Logarithm"===e?i(e):{TAG:1,_0:2,[Symbol.for("name")]:"Error"};return s.fmap(a,(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"}}))},t.mixture=function(r,t,e,i){var u;if(a.isEmpty(r))return{TAG:1,_0:{TAG:7,_0:"Mixture error: mixture must have at least 1 element",[Symbol.for("name")]:"OtherError"},[Symbol.for("name")]:"Error"};if(u=r,a.every(u,(function(r){return g(r[0])}))){var f=a.fmap(r,(function(r){var t,e=r[0];switch(0|e.TAG){case 1:t={TAG:0,_0:[e._0,r[1]],[Symbol.for("name")]:"Ok"};break;case 0:case 2:t={TAG:1,_0:"Unreachable",[Symbol.for("name")]:"Error"}}return s.toExn(t,"Mixture coding error: SampleSet expected. This should be inaccessible.")})),l=d.mixture(f,i.sampleCount);return 0===l.TAG?{TAG:0,_0:{TAG:1,_0:l._0,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:_.$$Error.sampleErrorToDistErr(l._0),[Symbol.for("name")]:"Error"}}var m=a.Floats.sum(a.fmap(r,c.second)),p=a.R.firstErrorOrOpen(a.fmap(r,(function(r){return n._2(t,r[0],r[1]/m)})));return s.bind(p,(function(r){return a.fold_left(o.sliceToEnd(r,1),{TAG:0,_0:a.unsafe_get(r,0),[Symbol.for("name")]:"Ok"},(function(r,t){return s.bind(r,(function(r){return n._2(e,r,t)}))}))}))},t.isSymbolic=function(r){switch(0|r.TAG){case 0:case 1:return!1;case 2:return!0}},t.isPointSet=function(r){switch(0|r.TAG){case 0:return!0;case 1:case 2:return!1}}},7473:(r,t,e)=>{"use strict";var n=e(10456),o=e(91413),i=e(43924),a=e(9438),u=e(24417),s=e(62751),f=e(52017),c=e(70749);function l(r,t){var e=void 0!==r&&r,n=f.T.length(t),u=t.ys,c=t.xs;o.unshift(a.get(c,0),c),o.unshift(a.get(u,0),u),o.push(a.get(c,n-1|0),c),o.push(a.get(u,n-1|0),u);for(var l=s.length(c),m=new Array(l),p=new Array(l-1|0),v=new Array(l-2|0),d=0;d<l;++d)i.set(m,d,a.get(c,d)*a.get(c,d));for(var _=0,g=l-2|0;_<=g;++_)i.set(p,_,a.get(c,_)*a.get(c,_+1|0));for(var h=0,y=l-3|0;h<=y;++h)i.set(v,h,a.get(c,h)*a.get(c,h+2|0));var b=new Array(l-2|0),A=new Array(l-2|0),S=new Array(l-2|0);if(e){for(var T=1,E=l-2|0;T<=E;++T){i.set(b,T-1|0,(a.get(c,T+1|0)-a.get(c,T-1|0))*a.get(u,T)/2);var x=a.get(c,T-1|0),G=a.get(c,T),w=a.get(c,T+1|0),D=2*(x*Math.log(x/G)/(x-G)+w*Math.log(G/w)/(w-G))/(x-w),k=2*(Math.log(G/x)/(x-G)+w*Math.log(w/G)/(w-G))/(x-w)-Math.pow(D,2);i.set(A,T-1|0,D),i.set(S,T-1|0,k)}return{n:l-2|0,masses:b,means:A,variances:S}}for(var O=1,M=l-2|0;O<=M;++O)i.set(b,O-1|0,(a.get(c,O+1|0)-a.get(c,O-1|0))*a.get(u,O)/2),i.set(A,O-1|0,(a.get(c,O-1|0)+a.get(c,O)+a.get(c,O+1|0))/3),i.set(S,O-1|0,(a.get(m,O-1|0)+a.get(m,O)+a.get(m,O+1|0)-a.get(p,O-1|0)-a.get(p,O)-a.get(v,O-1|0))/18);return{n:l-2|0,masses:b,means:A,variances:S}}t.toDiscretePointMassesFromTriangulars=l,t.combineShapesContinuousContinuous=function(r,t,e){for(var o=l(void 0,t),f=l(!1,e),c="Multiply"===r?function(r,t){return r*t}:"Add"===r?function(r,t){return r+t}:function(r,t){return r-t},m="Multiply"===r?function(r,t,e,n){return r*t+r*Math.pow(n,2)+t*Math.pow(e,2)}:function(r,t,e,n){return r+t},p=u.infinity,v=u.neg_infinity,d=new Array(Math.imul(o.n,f.n)),_=new Array(Math.imul(o.n,f.n)),g=new Array(Math.imul(o.n,f.n)),h=0,y=o.n;h<y;++h)for(var b=0,A=f.n;b<A;++b){var S=Math.imul(h,f.n)+b|0;i.set(d,S,a.get(o.masses,h)*a.get(f.masses,b));var T=n._2(c,a.get(o.means,h),a.get(f.means,b)),E=n._4(m,a.get(o.variances,h),a.get(f.variances,b),a.get(o.means,h),a.get(f.means,b));i.set(_,S,T),i.set(g,S,E);var x=T-2*Math.sqrt(E)*1.644854,G=T+2*Math.sqrt(E)*1.644854;x<p&&(p=x),G>v&&(v=G)}for(var w=s.Floats.range(p,v,300),D=i.make(300,0),k=0,O=s.length(d);k<O;++k)if(a.get(g,k)>0&&a.get(d,k)>0)for(var M=0,F=s.length(w);M<F;++M){var I=a.get(w,M)-a.get(_,k),P=a.get(d,k)*Math.exp(-Math.pow(I,2)/(2*a.get(g,k)))/Math.sqrt(6.28318552*a.get(g,k));i.set(D,M,a.get(D,M)+P)}return{xs:w,ys:D}},t.toDiscretePointMassesFromDiscrete=function(r){var t=r.ys,e=r.xs,n=s.length(e);return{n,masses:s.makeBy(n,(function(r){return a.get(t,r)})),means:s.makeBy(n,(function(r){return a.get(e,r)})),variances:s.makeBy(n,(function(r){return 0}))}},t.combineShapesContinuousDiscrete=function(r,t,e,o){var u=f.T.length(t),l=f.T.length(e),m=c.Convolution.toFn(r),p=0===o?function(r,t){return n._2(m,t,r)}:m,v=new Array(l);if("Multiply"===r)for(var d=0;d<l;++d){for(var _=new Array(u),g=0;g<u;++g){var h=a.get(e.xs,d)>0?g:(u-1|0)-g|0;i.set(_,h,[n._2(p,a.get(t.xs,g),a.get(e.xs,d)),a.get(t.ys,g)*a.get(e.ys,d)/Math.abs(a.get(e.xs,d))])}i.set(v,d,_)}else for(var y=0;y<l;++y){for(var b=new Array(u),A=0;A<u;++A){var S=0===o&&"Subtract"===r?(u-1|0)-A|0:A;i.set(b,S,[n._2(p,a.get(t.xs,A),a.get(e.xs,y)),a.get(t.ys,A)*a.get(e.ys,y)])}i.set(v,y,b)}return s.fold_left(s.fmap(v,f.T.fromZippedArray),f.T.empty,(function(r,t){return f.PointwiseCombination.addCombine(f.XtoY.continuousInterpolator("Linear","UseZero"),r,t)}))},t.isOrdered=function(r){return s.Floats.isSorted(r.xs)}},93756:(r,t,e)=>{"use strict";var n=e(10456),o=e(9438),i=e(24417),a=e(5890),u=e(62751),s=e(17646),f=e(21374),c=e(52017),l=e(85659),m=e(9770),p=e(88950),v=e(7473);function d(r,t,e){var i=void 0!==r?r:function(r,t){return t*r},a=void 0!==t?t:function(r,t,e){return t*r+e*Math.pow(r,2)/2},s=e.xyShape.xs,f=e.xyShape.ys;return u.reducei(s,0,(function(r,t,u){var c,l=e.interpolation;if(0!==u)if("Linear"===l){var m=o.get(s,u-1|0),p=o.get(s,u);if(m===p)c=0;else{var v=o.get(f,u-1|0),d=(v-o.get(f,u))/(m-p),_=v-d*m;c=n._3(a,p,_,d)-n._3(a,m,_,d)}}else c=n._2(i,o.get(s,u),o.get(f,u-1|0))-n._2(i,o.get(s,u-1|0),o.get(f,u-1|0));else c=0;return r+c}))}function _(r){return d((function(r,t){return t*Math.pow(r,3)/3}),(function(r,t,e){return t*Math.pow(r,3)/3+e*Math.pow(r,4)/4}),r)}var g={integrate:d,getMeanOfSquares:_};function h(r,t,e,n){return{xyShape:n,interpolation:void 0!==r?r:"Linear",integralSumCache:void 0!==t?a.valFromOption(t):void 0,integralCache:void 0!==e?a.valFromOption(e):void 0}}function y(r,t){return{xyShape:n._1(t,r.xyShape),interpolation:r.interpolation,integralSumCache:r.integralSumCache,integralCache:r.integralCache}}var b={xyShape:{xs:[i.neg_infinity],ys:[0]},interpolation:"Linear",integralSumCache:0,integralCache:void 0},A={xyShape:c.T.empty,interpolation:"Linear",integralSumCache:0,integralCache:b};function S(r){return h(void 0,a.some(r.integralSumCache),a.some(r.integralCache),c.$$Range.stepwiseToLinear(r.xyShape))}function T(r,t,e,o,i,u){var s=void 0!==r?r:c.PointwiseCombination.combine,l=void 0!==t?t:function(r,t){},p=void 0!==e?e:"PDF",v=m.Common.combineIntegralSums(l,i.integralSumCache,u.integralSumCache),d=i.interpolation,_=u.interpolation,g="Linear"===d?"Linear"===_?[i,u]:[i,S(u)]:"Linear"===_?[S(i),u]:[i,u],y=g[0],b="PDF"===p?"UseZero":"UseOutermostPoints",A=c.XtoY.continuousInterpolator(y.interpolation,b);return f.fmap(n._4(s,A,o,y.xyShape,g[1].xyShape),(function(r){return h(void 0,a.some(v),void 0,r)}))}function E(r,t){return{xyShape:r.xyShape,interpolation:r.interpolation,integralSumCache:t,integralCache:r.integralCache}}function x(r,t){return{xyShape:r.xyShape,interpolation:r.interpolation,integralSumCache:r.integralSumCache,integralCache:t}}function G(r,t,e,n){var o=void 0!==r?r:function(r){},i=void 0!==t?t:function(r){};return f.fmap(c.T.mapYResult(e.xyShape,n),(function(r){return h(e.interpolation,a.some(s.bind(e.integralSumCache,o)),a.some(s.bind(e.integralCache,i)),r)}))}function w(r,t,e,n){var o=void 0!==r?r:function(r){},i=void 0!==t?t:function(r){};return h(e.interpolation,a.some(s.bind(e.integralSumCache,o)),a.some(s.bind(e.integralCache,i)),c.T.mapY(e.xyShape,n))}function D(r,t){var e=s.bind(r.integralSumCache,(function(r){return t*r})),n=s.bind(r.integralCache,(function(r){return D(r,t)}));return x(E(w(void 0,void 0,r,(function(r){return r*t})),e),n)}function k(r){var t=c.T.isEmpty(r.xyShape),e=r.integralCache;return t?b:void 0!==e?e:h(void 0,void 0,void 0,s.toExt(c.$$Range.integrateWithTriangles(r.xyShape),"This should not have happened"))}function O(r){return s.defaultFn(r.integralSumCache,(function(t){var e=k(r);return c.T.lastY(e.xyShape)}))}function M(r){return d((function(r,t){return t*Math.pow(r,2)/2}),(function(r,t,e){return t*Math.pow(r,2)/2+e*Math.pow(r,3)/3}),r)}var F=m.Dist({minX:function(r){return c.T.minX(r.xyShape)},maxX:function(r){return c.T.maxX(r.xyShape)},mapY:w,mapYResult:G,xToY:function(r,t){var e=t.xyShape;return p.MixedPoint.makeContinuous("Linear"===t.interpolation?c.XtoY.linear(e,r):s.$$default(c.XtoY.stepwiseIncremental(e,r),0))},toPointSetDist:function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"Continuous"}},toContinuous:function(r){return a.some(r)},toDiscrete:function(r){},normalize:function(r){return E(D(x(r,k(r)),1/O(r)),1)},toDiscreteProbabilityMassFraction:function(r){return 0},downsample:function(r,t){return y(t,(function(e){return c.XsConversion.proportionByProbabilityMass(e,r,k(t).xyShape)}))},truncate:function(r,t,e){var n=s.$$default(r,i.neg_infinity),o=s.$$default(t,i.infinity),a=c.Zipped.filterByX(c.T.zip(e.xyShape),(function(r){return r>=n&&r<=o})),f=s.dimap(r,(function(r){return[[r-i.epsilon_float,0]]}),(function(r){return[]})),l=s.dimap(t,(function(r){return[[r+i.epsilon_float,0]]}),(function(r){return[]})),m=u.concatMany([f,a,l]);return h(void 0,void 0,void 0,c.T.fromZippedArray(m))},updateIntegralCache:x,integral:k,integralEndY:O,integralXtoY:function(r,t){var e=k(t).xyShape;return c.XtoY.linear(e,r)},integralYtoX:function(r,t){var e=k(t).xyShape;return c.YtoX.linear(e,r)},mean:M,variance:function(r){return c.Analysis.getVarianceDangerously(r,M,_)}});t.Analysis=g,t.getShape=function(r){return r.xyShape},t.interpolation=function(r){return r.interpolation},t.make=h,t.shapeMap=y,t.lastY=function(r){return c.T.lastY(r.xyShape)},t.oShapeMap=function(r,t){var e=a.some(t.integralCache),o=a.some(t.integralSumCache),i=t.interpolation;return s.fmap(n._1(r,t.xyShape),(function(r){return h(i,o,e,r)}))},t.emptyIntegral=b,t.empty=A,t.stepwiseToLinear=S,t.combinePointwise=T,t.toLinear=function(r){if("Linear"===r.interpolation)return r;var t=a.some(r.integralSumCache),e=a.some(r.integralCache);return s.fmap(c.$$Range.stepsToContinuous(r.xyShape),(function(r){return h(void 0,t,e,r)}))},t.shapeFn=function(r,t){return n._1(t,r.xyShape)},t.updateIntegralSumCache=E,t.updateIntegralCache=x,t.sum=function(r,t){var e=void 0!==r?r:function(r,t){};return u.fold_left(t,A,(function(r,t){return f.toExn(T(void 0,e,void 0,(function(r,t){return{TAG:0,_0:r+t,[Symbol.for("name")]:"Ok"}}),r,t),"Addition should never fail")}))},t.reduce=function(r,t,e){var n=void 0!==t?t:function(r,t){};return u.R.foldM(r,A,(function(r,t){return T(void 0,n,void 0,e,r,t)}))},t.mapYResult=G,t.mapY=w,t.scaleBy=D,t.T=F,t.isNormalized=function(r){var t=n._1(F.integralEndY,x(r,n._1(F.integral,r)));return t<1+l.Epsilon.seven&&t>1-l.Epsilon.seven},t.downsampleEquallyOverX=function(r,t){return y(t,(function(t){return c.XsConversion.proportionEquallyOverX(t,r)}))},t.combineAlgebraicallyWithDiscrete=function(r,t,e,n){var o=t.xyShape,i=e.xyShape;if(c.T.isEmpty(o)||c.T.isEmpty(i))return A;var u="Linear"===t.interpolation?t:S(t),s=v.combineShapesContinuousDiscrete(r,u.xyShape,i,n),f="Multiply"===r?m.Common.combineIntegralSums((function(r,t){return r*t}),t.integralSumCache,e.integralSumCache):void 0;return h(t.interpolation,a.some(f),void 0,s)},t.combineAlgebraically=function(r,t,e){var n=t.xyShape,o=e.xyShape,i=c.T.length(n),u=c.T.length(o);if(0===i||0===u)return A;var s=v.combineShapesContinuousContinuous(r,n,o),f=m.Common.combineIntegralSums((function(r,t){return r*t}),t.integralSumCache,e.integralSumCache);return h(void 0,a.some(f),void 0,s)}},37385:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924),i=e(9438),a=e(24417),u=e(5890),s=e(61769),f=e(62751),c=e(17646),l=e(21374),m=e(18305),p=e(52017),v=e(70749),d=e(93756),_=e(9770),g=e(88950),h=e(53767);function y(r,t,e){return{xyShape:e,integralSumCache:void 0!==r?u.valFromOption(r):void 0,integralCache:void 0!==t?u.valFromOption(t):void 0}}function b(r,t){return{xyShape:n._1(t,r.xyShape),integralSumCache:r.integralSumCache,integralCache:r.integralCache}}var A={xyShape:{xs:[a.neg_infinity],ys:[0]},interpolation:"Stepwise",integralSumCache:0,integralCache:void 0},S={xyShape:p.T.empty,integralSumCache:0,integralCache:A};function T(r,t,e,o,i){var a=void 0!==r?r:p.PointwiseCombination.combine,u=void 0!==e?e:function(r,t){return{TAG:0,_0:r+t,[Symbol.for("name")]:"Ok"}};return l.fmap(n._4(a,p.XtoY.discreteInterpolator,u,o.xyShape,i.xyShape),(function(r){return y(void 0,void 0,r)}))}function E(r,t){return{xyShape:r.xyShape,integralSumCache:t,integralCache:r.integralCache}}function x(r,t){return{xyShape:r.xyShape,integralSumCache:r.integralSumCache,integralCache:t}}function G(r,t,e,n){var o=void 0!==r?r:function(r){},i=void 0!==t?t:function(r){};return l.fmap(p.T.mapYResult(e.xyShape,n),(function(r){return y(u.some(c.bind(e.integralSumCache,o)),u.some(c.bind(e.integralCache,i)),r)}))}function w(r,t,e,n){var o=void 0!==r?r:function(r){},i=void 0!==t?t:function(r){};return y(u.some(c.bind(e.integralSumCache,o)),u.some(c.bind(e.integralCache,i)),p.T.mapY(e.xyShape,n))}function D(r,t){var e=c.fmap(r.integralSumCache,(function(r){return t*r})),n=c.fmap(r.integralCache,(function(r){return d.scaleBy(r,t)}));return x(E(w(void 0,void 0,r,(function(r){return r*t})),e),n)}function k(r){var t=p.T.isEmpty(r.xyShape),e=r.integralCache;if(t)return A;if(void 0!==e)return e;var n=r.xyShape,o={xs:[p.T.minX(n)-a.epsilon_float],ys:[0]},i=p.T.accumulateYs(p.T.concat(o,n),(function(r,t){return r+t}));return d.make("Stepwise",void 0,void 0,i)}function O(r){return c.defaultFn(r.integralSumCache,(function(t){return d.lastY(k(r))}))}function M(r){var t=r.xyShape;return f.reducei(t.xs,0,(function(r,e,n){return r+e*i.get(t.ys,n)}))}var F=_.Dist({minX:function(r){return p.T.minX(r.xyShape)},maxX:function(r){return p.T.maxX(r.xyShape)},mapY:w,mapYResult:G,xToY:function(r,t){return g.MixedPoint.makeDiscrete(c.$$default(p.XtoY.stepwiseIfAtX(t.xyShape,r),0))},toPointSetDist:function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Discrete"}},toContinuous:function(r){},toDiscrete:function(r){return u.some(r)},normalize:function(r){return E(D(r,1/O(r)),1)},toDiscreteProbabilityMassFraction:function(r){return 1},downsample:function(r,t){var e=p.T.length(t.xyShape);return r<e&&r>=1&&e>1?y(void 0,void 0,p.T.fromZippedArray(p.Zipped.sortByX(f.slice(o.reverse(p.Zipped.sortByY(p.T.zip(t.xyShape))),0,r)))):t},truncate:function(r,t,e){return y(void 0,void 0,p.T.fromZippedArray(p.Zipped.filterByX(p.T.zip(e.xyShape),(function(e){return e>=c.$$default(r,a.neg_infinity)&&e<=c.$$default(t,a.infinity)}))))},updateIntegralCache:x,integral:k,integralEndY:O,integralXtoY:function(r,t){return p.XtoY.linear(d.getShape(k(t)),r)},integralYtoX:function(r,t){return p.YtoX.linear(d.getShape(k(t)),r)},mean:M,variance:function(r){return p.Analysis.getVarianceDangerously(r,M,(function(r){return M(b(r,p.T.square))}))}});t.make=y,t.shapeMap=b,t.getShape=function(r){return r.xyShape},t.oShapeMap=function(r,t){var e=u.some(t.integralCache),o=u.some(t.integralSumCache);return c.fmap(n._1(r,t.xyShape),(function(r){return y(o,e,r)}))},t.emptyIntegral=A,t.empty=S,t.shapeFn=function(r,t){return n._1(t,r.xyShape)},t.lastY=function(r){return p.T.lastY(r.xyShape)},t.combinePointwise=T,t.reduce=function(r,t,e){var n=e;return f.R.foldM(r,S,(function(r){return function(t){return T(void 0,0,n,r,t)}}))},t.updateIntegralSumCache=E,t.updateIntegralCache=x,t.combineAlgebraically=function(r,t,e){for(var o=t.xyShape,a=e.xyShape,f=p.T.length(o),l=p.T.length(a),m=_.Common.combineIntegralSums((function(r,t){return r*t}),t.integralSumCache,e.integralSumCache),d=v.Convolution.toFn(r),g=h.empty(void 0),b=0;b<f;++b)for(var A=0;A<l;++A){var S=n._2(d,i.get(o.xs,b),i.get(a.xs,A)),T=c.$$default(h.get(S,g),0),E=i.get(o.ys,b)*i.get(a.ys,A);s.set(g,S,T+E)}var x=p.Zipped.sortByX(h.toArray(g)),G=p.T.fromZippedArray(x);return y(u.some(m),void 0,G)},t.mapYResult=G,t.mapY=w,t.scaleBy=D,t.T=F,t.sampleN=function(r,t){var e=n._1(F.normalize,r).xyShape;return m.Random.sample(e.xs,{probs:e.ys,size:t})}},9770:(r,t,e)=>{"use strict";var n=e(10456),o={combineIntegralSums:function(r,t,e){if(void 0!==t&&void 0!==e)return n._2(r,t,e)},combineIntegrals:function(r,t,e){if(void 0!==t&&void 0!==e)return n._2(r,t,e)}};t.Dist=function(r){var t=r.minX,e=r.maxX,o={get:r.integral,xToY:r.integralXtoY,yToX:r.integralYtoX,sum:r.integralEndY};return{minX:t,maxX:e,integral:r.integral,xTotalRange:function(r){return n._1(e,r)-n._1(t,r)},mapY:r.mapY,mapYResult:r.mapYResult,xToY:r.xToY,downsample:r.downsample,toPointSetDist:r.toPointSetDist,toDiscreteProbabilityMassFraction:r.toDiscreteProbabilityMassFraction,toContinuous:r.toContinuous,toDiscrete:r.toDiscrete,normalize:r.normalize,truncate:r.truncate,mean:r.mean,variance:r.variance,integralEndY:r.integralEndY,updateIntegralCache:r.updateIntegralCache,Integral:o}},t.Common=o},69937:(r,t,e)=>{"use strict";var n=e(51958),o=e(10456),i=e(5890),a=e(62751),u=e(17646),s=e(21374),f=e(52017),c=e(37385),l=e(93756),m=e(9770),p=e(88950);function v(r,t,e,n){return{continuous:e,discrete:n,integralSumCache:void 0!==r?i.valFromOption(r):void 0,integralCache:void 0!==t?i.valFromOption(t):void 0}}function d(r){return r.continuous}function _(r){return r.discrete}function g(r,t){return{continuous:r.continuous,discrete:r.discrete,integralSumCache:r.integralSumCache,integralCache:t}}function h(r){var t=o._1(l.T.Integral.get,r.continuous),e=o._1(c.T.Integral.get,r.discrete),n=l.updateIntegralCache(r.continuous,t),a=c.updateIntegralCache(r.discrete,e),u=o._1(l.T.Integral.sum,n),s=o._1(c.T.Integral.sum,a),f=u+s,m=u/f,p=s/f,d=l.updateIntegralSumCache(l.scaleBy(n,m/u),m),_=c.updateIntegralSumCache(c.scaleBy(a,p/s),p);return v(1,i.some(void 0),d,_)}function y(r){var t=r.integralCache;if(void 0!==t)return t;var e=o._1(l.T.Integral.get,r.continuous),n=l.stepwiseToLinear(o._1(c.T.Integral.get,r.discrete));return l.make(void 0,void 0,void 0,f.PointwiseCombination.addCombine(f.XtoY.continuousInterpolator("Linear","UseOutermostPoints"),l.getShape(e),l.getShape(n)))}function b(r,t,e,n,o){var i=void 0!==r?r:function(r){},a=void 0!==t?t:function(r){},s=c.updateIntegralCache(c.updateIntegralSumCache(n,u.bind(e.discrete.integralSumCache,i)),u.bind(e.discrete.integralCache,a));return{continuous:l.updateIntegralCache(l.updateIntegralSumCache(o,u.bind(e.continuous.integralSumCache,i)),u.bind(e.continuous.integralCache,a)),discrete:s,integralSumCache:u.bind(e.integralSumCache,i),integralCache:u.bind(e.integralCache,a)}}function A(r){var t=r.discrete,e=r.continuous,n=o._1(c.T.mean,t),i=o._1(l.T.mean,e),a=o._1(c.T.Integral.sum,t),u=o._1(l.T.Integral.sum,e);return(n*a+i*u)/(a+u)}var S=m.Dist({minX:function(r){return n.float_min(o._1(l.T.minX,r.continuous),o._1(c.T.minX,r.discrete))},maxX:function(r){return n.float_max(o._1(l.T.maxX,r.continuous),o._1(c.T.maxX,r.discrete))},mapY:function(r,t,e,n){return b(void 0!==r?r:function(r){},void 0!==t?t:function(r){},e,o._4(c.T.mapY,void 0,void 0,e.discrete,n),o._4(l.T.mapY,void 0,void 0,e.continuous,n))},mapYResult:function(r,t,e,n){var i=void 0!==r?r:function(r){},a=void 0!==t?t:function(r){};return s.fmap(s.merge(o._4(c.T.mapYResult,void 0,void 0,e.discrete,n),o._4(l.T.mapYResult,void 0,void 0,e.continuous,n)),(function(r){return b(i,a,e,r[0],r[1])}))},xToY:function(r,t){var e=h(t),n=o._2(l.T.xToY,r,e.continuous),i=o._2(c.T.xToY,r,e.discrete);return p.MixedPoint.add(n,i)},toPointSetDist:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Mixed"}},toContinuous:d,toDiscrete:_,normalize:h,toDiscreteProbabilityMassFraction:function(r){var t=o._1(c.T.Integral.sum,r.discrete);return t/(t+o._1(l.T.Integral.sum,r.continuous))},downsample:function(r,t){var e=o._1(c.T.Integral.sum,t.discrete),n=o._1(l.T.Integral.sum,t.continuous),i=e+n,a=o._2(c.T.downsample,r*(e/i)|0,t.discrete);return{continuous:o._2(l.T.downsample,r*(n/i)|0,t.continuous),discrete:a,integralSumCache:t.integralSumCache,integralCache:t.integralCache}},truncate:function(r,t,e){var n=o._3(l.T.truncate,r,t,e.continuous),a=o._3(c.T.truncate,r,t,e.discrete);return v(i.some(void 0),i.some(void 0),n,a)},updateIntegralCache:g,integral:y,integralEndY:function(r){return l.lastY(y(r))},integralXtoY:function(r,t){return f.XtoY.linear(l.getShape(y(t)),r)},integralYtoX:function(r,t){return f.YtoX.linear(l.getShape(y(t)),r)},mean:A,variance:function(r){var t=r.discrete,e=r.continuous,n=o._1(c.T.Integral.sum,t),i=o._1(l.T.Integral.sum,e),a=n+i,u=n/a;return 0!==u?1!==u?f.Analysis.getVarianceDangerously(r,A,(function(r){var t=o._1(c.T.mean,c.shapeMap(r.discrete,f.T.square)),e=l.Analysis.getMeanOfSquares(r.continuous);return(t*n+e*i)/a})):o._1(c.T.variance,t):o._1(l.T.variance,e)}});t.make=v,t.totalLength=function(r){return f.T.length(l.getShape(r.continuous))+f.T.length(c.getShape(r.discrete))|0},t.scaleBy=function(r,t){var e=c.scaleBy(r.discrete,t),n=l.scaleBy(r.continuous,t),o=u.bind(r.integralCache,(function(r){return l.scaleBy(r,t)})),a=u.bind(r.integralSumCache,(function(r){return r*t}));return v(i.some(a),i.some(o),n,e)},t.toContinuous=d,t.toDiscrete=_,t.updateIntegralCache=g,t.T=S,t.combineAlgebraically=function(r,t,e){var n=l.combineAlgebraically(r,t.continuous,e.continuous),o=l.combineAlgebraicallyWithDiscrete(r,e.continuous,t.discrete,0),i=l.combineAlgebraicallyWithDiscrete(r,t.continuous,e.discrete,1);return{continuous:l.sum(void 0,[n,o,i]),discrete:c.combineAlgebraically(r,t.discrete,e.discrete),integralSumCache:m.Common.combineIntegralSums((function(r,t){return r*t}),t.integralSumCache,e.integralSumCache),integralCache:void 0}},t.combinePointwise=function(r,t,e,n,o){var u=void 0!==r?r:function(r,t){},f=void 0!==t?t:function(r,t){},p=c.reduce(a.O.concatSomes(a.fmap([n,o],_)),u,e),g=l.reduce(a.O.concatSomes(a.fmap([n,o],d)),u,e),h=m.Common.combineIntegralSums(u,n.integralSumCache,o.integralSumCache),y=m.Common.combineIntegrals(f,n.integralCache,o.integralCache);return s.fmap(s.merge(g,p),(function(r){return v(i.some(h),i.some(y),r[0],r[1])}))}},4239:(r,t,e)=>{"use strict";var n=e(5890),o=e(62751),i=e(17646),a=e(69937),u=e(52017),s=e(37385),f=e(93756);t.buildSimple=function(r,t){var e=i.defaultFn(r,(function(r){return f.make(void 0,0,void 0,{xs:[],ys:[]})})),c=i.defaultFn(t,(function(r){return s.make(0,void 0,{xs:[],ys:[]})})),l=o.length(u.T.xs(f.getShape(e))),m=o.length(u.T.xs(s.getShape(c)));return 0===l||1===l?0!==m?{TAG:1,_0:c,[Symbol.for("name")]:"Discrete"}:void 0:0===m?{TAG:2,_0:e,[Symbol.for("name")]:"Continuous"}:{TAG:0,_0:a.make(n.some(void 0),n.some(void 0),e,c),[Symbol.for("name")]:"Mixed"}}},96770:(r,t,e)=>{"use strict";var n=e(10456),o=e(43036),i=e(43924),a=e(5890),u=e(17646),s=e(21374),f=e(69937),c=e(52017),l=e(37385),m=e(93756),p=e(98),v=e(9770),d=e(70857);function _(r,t){switch(0|t.TAG){case 0:return n._1(r[0],t._0);case 1:return n._1(r[1],t._0);case 2:return n._1(r[2],t._0)}}function g(r,t){switch(0|r.TAG){case 0:return{TAG:0,_0:n._1(t[0],r._0),[Symbol.for("name")]:"Mixed"};case 1:return{TAG:1,_0:n._1(t[1],r._0),[Symbol.for("name")]:"Discrete"};case 2:return{TAG:2,_0:n._1(t[2],r._0),[Symbol.for("name")]:"Continuous"}}}function h(r,t){switch(0|r.TAG){case 0:return s.fmap(n._1(t[0],r._0),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Mixed"}}));case 1:return s.fmap(n._1(t[1],r._0),(function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Discrete"}}));case 2:return s.fmap(n._1(t[2],r._0),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"Continuous"}}))}}var y=[function(r){return r},function(r){return f.make(a.some(r.integralSumCache),a.some(r.integralCache),m.empty,r)},function(r){return f.make(a.some(r.integralSumCache),a.some(r.integralCache),r,l.empty)}];function b(r){return _(y,r)}function A(r,t,e,n,o,i){var a=void 0!==r?r:c.PointwiseCombination.combine,u=void 0!==t?t:function(r,t){},p=void 0!==e?e:function(r,t){};switch(0|o.TAG){case 0:break;case 1:if(1==(0|i.TAG))return s.fmap(l.combinePointwise(a,u,n,o._0,i._0),(function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Discrete"}}));break;case 2:switch(0|i.TAG){case 0:case 1:break;case 2:return s.fmap(m.combinePointwise(a,u,void 0,n,o._0,i._0),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"Continuous"}}))}}return s.fmap(f.combinePointwise(u,p,n,b(o),b(i)),(function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Mixed"}}))}var S=[f.T.toContinuous,l.T.toContinuous,m.T.toContinuous],T=[f.T.toDiscrete,l.T.toDiscrete,m.T.toDiscrete],E=[f.T.toDiscreteProbabilityMassFraction,l.T.toDiscreteProbabilityMassFraction,m.T.toDiscreteProbabilityMassFraction],x=[f.T.minX,l.T.minX,m.T.minX],G=[f.T.Integral.get,l.T.Integral.get,m.T.Integral.get],w=[f.T.Integral.sum,l.T.Integral.sum,m.T.Integral.sum],D=[f.T.maxX,l.T.maxX,m.T.maxX],k=v.Dist({minX:function(r){return _(x,r)},maxX:function(r){return _(D,r)},mapY:function(r,t,e,o){var i=void 0!==r?r:function(r){},a=void 0!==t?t:function(r){};return g(e,[function(r){return n._4(f.T.mapY,i,a,r,o)},function(r){return n._4(l.T.mapY,i,a,r,o)},function(r){return n._4(m.T.mapY,i,a,r,o)}])},mapYResult:function(r,t,e,o){var i=void 0!==r?r:function(r){},a=void 0!==t?t:function(r){};return h(e,[function(r){return n._4(f.T.mapYResult,i,a,r,o)},function(r){return n._4(l.T.mapYResult,i,a,r,o)},function(r){return n._4(m.T.mapYResult,i,a,r,o)}])},xToY:function(r){var t=[n._1(f.T.xToY,r),n._1(l.T.xToY,r),n._1(m.T.xToY,r)];return function(r){return _(t,r)}},toPointSetDist:function(r){return r},toContinuous:function(r){return _(S,r)},toDiscrete:function(r){return _(T,r)},normalize:function(r){return g(r,[f.T.normalize,l.T.normalize,m.T.normalize])},toDiscreteProbabilityMassFraction:function(r){return _(E,r)},downsample:function(r,t){return g(t,[n._1(f.T.downsample,r),n._1(l.T.downsample,r),n._1(m.T.downsample,r)])},truncate:function(r,t,e){return g(e,[n._2(f.T.truncate,r,t),n._2(l.T.truncate,r,t),n._2(m.T.truncate,r,t)])},updateIntegralCache:function(r,t){return g(r,[function(r){return n._2(f.T.updateIntegralCache,r,t)},function(r){return n._2(l.T.updateIntegralCache,r,t)},function(r){return n._2(m.T.updateIntegralCache,r,t)}])},integral:function(r){return _(G,r)},integralEndY:function(r){return _(w,r)},integralXtoY:function(r){var t=[n._1(f.T.Integral.xToY,r),n._1(l.T.Integral.xToY,r),n._1(m.T.Integral.xToY,r)];return function(r){return _(t,r)}},integralYtoX:function(r){var t=[n._1(f.T.Integral.yToX,r),n._1(l.T.Integral.yToX,r),n._1(m.T.Integral.yToX,r)];return function(r){return _(t,r)}},mean:function(r){switch(0|r.TAG){case 0:return n._1(f.T.mean,r._0);case 1:return n._1(l.T.mean,r._0);case 2:return n._1(m.T.mean,r._0)}},variance:function(r){switch(0|r.TAG){case 0:return n._1(f.T.variance,r._0);case 1:return n._1(l.T.variance,r._0);case 2:return n._1(m.T.variance,r._0)}}});function O(r,t){var e=n._2(k.xToY,r,t);return e.continuous+e.discrete}var M=k.Integral.yToX,F=k.Integral.xToY;function I(r,t){for(var e=i.make(r,0),o=0;o<r;++o)i.set(e,o,n._1(t,void 0));return e}function P(r){var t=o.$$float(1);return n._2(k.Integral.yToX,t,r)}t.mapToAll=_,t.fmap=g,t.fmapResult=h,t.toMixed=b,t.combineAlgebraically=function(r,t,e){switch(0|t.TAG){case 0:break;case 1:var o=t._0;switch(0|e.TAG){case 0:break;case 1:return n._1(l.T.toPointSetDist,l.combineAlgebraically(r,o,e._0));case 2:return n._1(m.T.toPointSetDist,m.combineAlgebraicallyWithDiscrete(r,e._0,o,0))}break;case 2:var i=t._0;switch(0|e.TAG){case 0:break;case 1:return n._1(m.T.toPointSetDist,m.combineAlgebraicallyWithDiscrete(r,i,e._0,1));case 2:return n._1(m.T.toPointSetDist,m.combineAlgebraically(r,i,e._0))}}return n._1(f.T.toPointSetDist,f.combineAlgebraically(r,b(t),b(e)))},t.combinePointwise=A,t.T=k,t.logScore=function(r){return d.logScore(r,(function(r){return function(t,e){return A(void 0,void 0,void 0,r,t,e)}}),k.Integral.sum,b)},t.pdf=O,t.inv=M,t.cdf=F,t.doN=I,t.sample=P,t.isFloat=function(r){switch(0|r.TAG){case 1:var t=r._0.xyShape;if(1!==t.xs.length)return!1;var e=t.ys;return 1===e.length&&1===e[0];case 0:case 2:return!1}},t.sampleNRendered=function(r,t){var e=n._1(k.Integral.get,t),o=n._2(k.updateIntegralCache,t,e);return I(r,(function(r){return P(o)}))},t.operate=function(r,t){if("object"!=typeof r)return"Max"===r?n._1(k.maxX,t):"Min"===r?n._1(k.minX,t):"Mean"===r?n._1(k.mean,t):P(t);var e=r.NAME;return"Inv"===e?n._2(M,r.VAL,t):"Pdf"===e?O(r.VAL,t):n._2(F,r.VAL,t)},t.toSparkline=function(r,t){return s.fmap(u.toResult(u.fmap(n._1(k.toContinuous,r),(function(r){return m.downsampleEquallyOverX(t,r)})),0),(function(r){return p.create(m.getShape(r).ys,void 0,void 0)}))},t.makeDiscrete=function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"Discrete"}},t.makeContinuous=function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"Continuous"}},t.makeMixed=function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Mixed"}}},70857:(r,t,e)=>{"use strict";var n=e(10456),o=e(24417),i=e(21374),a=e(69937),u=e(37385),s=e(93756);function f(r,t){var e=r/t;return e<0?{TAG:1,_0:1,[Symbol.for("name")]:"Error"}:{TAG:0,_0:-t*Math.log(e),[Symbol.for("name")]:"Ok"}}function c(r,t){return 0===t?{TAG:0,_0:0,[Symbol.for("name")]:"Ok"}:0===r?{TAG:0,_0:o.infinity,[Symbol.for("name")]:"Ok"}:f(r,t)}function l(r,t,e,o,u){var s=function(r,t){return i.fmap(n._3(e,c,r,t),o)};switch(0|r.TAG){case 0:break;case 1:if(1==(0|t.TAG))return s(r,t);break;case 2:switch(0|t.TAG){case 0:case 1:break;case 2:return s(r,t)}}return i.fmap(function(r,t){var e=n._1(u,r),o=n._1(u,t),f=n._1(a.T.toContinuous,e),c=n._1(a.T.toDiscrete,e),l=n._1(a.T.toContinuous,o),m=n._1(a.T.toDiscrete,o);return void 0!==f&&void 0!==c&&void 0!==l&&void 0!==m?i.merge(s({TAG:1,_0:c,[Symbol.for("name")]:"Discrete"},{TAG:1,_0:m,[Symbol.for("name")]:"Discrete"}),s({TAG:2,_0:f,[Symbol.for("name")]:"Continuous"},{TAG:2,_0:l,[Symbol.for("name")]:"Continuous"})):{TAG:1,_0:{_0:"unreachable state",[Symbol.for("name")]:"Other"},[Symbol.for("name")]:"Error"}}(r,t),(function(r){return r[0]+r[1]}))}function m(r,t,e,n,o,a){var u=l(r,t,n,o,a),s=l(e,t,n,o,a);return i.fmap(i.merge(u,s),(function(r){return r[0]-r[1]}))}var p={integrand:c,sum:l,sumWithPrior:m};function v(r){return r.continuous+r.discrete}function d(r,t){var e=n._1((function(t){switch(0|r.TAG){case 0:return;case 1:return v(n._2(u.T.xToY,t,r._0));case 2:return v(n._2(s.T.xToY,t,r._0))}}),t);return void 0!==e&&e>=0?0===e?{TAG:0,_0:o.infinity,[Symbol.for("name")]:"Ok"}:{TAG:0,_0:-Math.log(e),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:5,[Symbol.for("name")]:"Error"}}function _(r,t,e){return i.fmap(i.merge(d(r,t),d(e,t)),(function(r){return r[0]-r[1]}))}var g={sum:v,score:d,scoreWithPrior:_};t.logFn=function(r){return Math.log(r)},t.minusScaledLogOfQuotient=f,t.WithDistAnswer=p,t.WithScalarAnswer=g,t.twoGenericDistsToTwoPointSetDists=function(r,t,e){return i.merge(n._2(r,t,void 0),n._2(r,e,void 0))},t.logScore=function(r,t,e,n){if(0===r.TAG){var o=r._0,i=o.prior,a=o.answer,u=o.estimate;return void 0!==i?m(u,a,i,t,e,n):l(u,a,t,e,n)}var s=r._0,f=s.prior,c=s.answer,p=s.estimate;return void 0!==f?_(p,c,f):d(p,c)}},88950:(r,t,e)=>{"use strict";var n=e(10456),o={fmap:function(r,t){switch(0|r.TAG){case 0:return{TAG:0,_0:n._1(t[0],r._0),[Symbol.for("name")]:"Mixed"};case 1:return{TAG:1,_0:n._1(t[1],r._0),[Symbol.for("name")]:"Discrete"};case 2:return{TAG:2,_0:n._1(t[2],r._0),[Symbol.for("name")]:"Continuous"}}}};function i(r,t,e){return{continuous:n._2(r,t.continuous,e.continuous),discrete:n._2(r,t.discrete,e.discrete)}}var a={toContinuousValue:function(r){return r.continuous},toDiscreteValue:function(r){return r.discrete},makeContinuous:function(r){return{continuous:r,discrete:0}},makeDiscrete:function(r){return{continuous:0,discrete:r}},fmap:function(r,t){return{continuous:n._1(r,t.continuous),discrete:n._1(r,t.discrete)}},combine2:i,add:function(r,t){return i((function(r,t){return r+t}),r,t)}};t.ShapeMonad=o,t.MixedPoint=a,t.sparklineErrorToString=function(r){return"Cannot find the sparkline of a discrete distribution"}},51618:(r,t,e)=>{"use strict";var n=e(65436),o=e(62751),i=e(69129),a=e(17646),u=e(21374),s=e(46366),f=e(52017),c=e(37385),l=e(40884),m=e(92421),p=e(62343),v=e(70749),d=e(93756),_=e(4239),g={toPointSetDist:function(r,t,e){return p.toPointSetDist(r,t,e)}};function h(r){return"Too Few Samples to convert to point set"}function y(r){return{TAG:1,_0:r,[Symbol.for("name")]:"OperationError"}}function b(r){return"number"==typeof r?"Too few samples when constructing sample set":0===r.TAG?"Found a non-number in input: "+r._0:v.$$Error.toString(r._0)}var A={pointsetConversionErrorToString:h,fromOperationError:y,toString:b};function S(r){return o.length(r)>5?{TAG:0,_0:r,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:0,[Symbol.for("name")]:"Error"}}function T(r){return r}var E={make:S,get:T},x=o.length;function G(r){var t=n.random_int(0,o.length(r)-1|0);return o.unsafe_get(r,t)}function w(r){return u.bind(u.errMap(o.R.firstErrorOrOpen(r),y),S)}function D(r,t,e){return w(o.fmap(o.zip(t,e),(function(t){return l.toFnCall(r,t)})))}function k(r,t){return S(o.filter(r,(function(r){return r>=t})))}function O(r,t){return S(o.filter(r,(function(r){return r<=t})))}t.JS=g,t.$$Error=A,t.pointsetConversionErrorToString=h,t.fromOperationError=y,t.toString=b,t.T=E,t.make=S,t.get=T,t.length=x,t.toPointSetDist=function(r,t){var e=p.toPointSetDist(r,t.outputXYPoints,t.kernelWidth);return a.toResult(_.buildSimple(a.fmap(e.continuousDist,(function(r){return d.make(void 0,void 0,void 0,r)})),c.make(void 0,void 0,e.discreteDist)),0)},t.sample=G,t.sampleN=function(r,t){return t<=o.length(r)?o.slice(r,0,t):o.makeBy(t,(function(t){return G(r)}))},t._fromSampleResultArray=w,t.samplesMap=function(r,t){return w(o.fmap(t,r))},t.map2=D,t.map3=function(r,t,e,n){return w(o.fmap(o.zip3(t,e,n),(function(t){return m.toFnCall(r,t)})))},t.mapN=function(r,t){return w(o.fmap(o.transpose(o.fmap(t,T)),r))},t.mean=function(r){return o.Floats.mean(r)},t.geomean=function(r){return o.Floats.geomean(r)},t.mode=function(r){return o.Floats.mode(r)},t.sum=function(r){return o.Floats.sum(r)},t.min=function(r){return o.Floats.min(r)},t.max=function(r){return o.Floats.max(r)},t.stdev=function(r){return o.Floats.stdev(r)},t.variance=function(r){return o.Floats.variance(r)},t.percentile=function(r,t){return o.Floats.percentile(r,t)},t.cdf=function(r,t){return o.reduce(r,0,(function(r,e){return r+(e<=t?1:0)|0}))/o.length(r)},t.mixture=function(r,t){var e=o.Floats.sum(o.fmap(r,l.second)),n=c.sampleN(c.make(void 0,void 0,f.T.fromZippedArray(o.fmapi(r,(function(r,t){return[i.toFloat(r),t[1]/e]})))),t),u=o.fmap(o.fmap(r,l.first),T),m=o.O.openIfAllSome(o.fmapi(n,(function(r,t){var e=o.get(u,s.toInt(t));return a.bind(e,(function(t){return o.get(t,r)}))})));return S(a.toExn(m,"Mixture unreachable error"))},t.truncateLeft=k,t.truncateRight=O,t.truncate=function(r,t,e){return u.bind(function(r){return a.dimap(t,(function(t){return k(r,t)}),(function(t){return{TAG:0,_0:r,[Symbol.for("name")]:"Ok"}}))}(r),(function(r){return a.dimap(e,(function(t){return O(r,t)}),(function(t){return{TAG:0,_0:r,[Symbol.for("name")]:"Ok"}}))}))},t.minOfTwo=function(r,t){return D((function(r,t){return{TAG:0,_0:Math.min(r,t),[Symbol.for("name")]:"Ok"}}),r,t)},t.maxOfTwo=function(r,t){return D((function(r,t){return{TAG:0,_0:Math.max(r,t),[Symbol.for("name")]:"Ok"}}),r,t)},t.minOfFloat=function(r,t){return w(o.fmap(r,(function(r){return{TAG:0,_0:Math.min(r,t),[Symbol.for("name")]:"Ok"}})))},t.maxOfFloat=function(r,t){return w(o.fmap(r,(function(r){return{TAG:0,_0:Math.max(r,t),[Symbol.for("name")]:"Ok"}})))}},14307:(r,t,e)=>{"use strict";var n=e(51958),o=e(10456),i=e(43925),a=e(43924),u=e(24417),s=e(62751),f=e(17646),c=e(18305),l=e(46366),m=e(37385),p=e(70749),v=e(93756),d=e(85659);function _(r,t){return i.normal.pdf(r,t.mean,t.stdev)}function g(r,t){return i.normal.cdf(r,t.mean,t.stdev)}function h(r,t){return{NAME:"Normal",VAL:{mean:s.Floats.mean([r,t]),stdev:(t-r)/3.2897072539029444}}}function y(r,t){return i.normal.inv(r,t.mean,t.stdev)}function b(r){return i.normal.sample(r.mean,r.stdev)}function A(r){return{TAG:0,_0:i.normal.mean(r.mean,r.stdev),[Symbol.for("name")]:"Ok"}}function S(r){return"Normal("+r.mean+","+r.stdev+")"}function T(r,t){return{NAME:"Normal",VAL:{mean:r.mean+t.mean,stdev:Math.sqrt(Math.pow(r.stdev,2)+Math.pow(t.stdev,2))}}}function E(r,t){return{NAME:"Normal",VAL:{mean:r.mean-t.mean,stdev:Math.sqrt(Math.pow(r.stdev,2)+Math.pow(t.stdev,2))}}}function x(r,t,e){return"Subtract"===r?E(t,e):"Add"===r?T(t,e):void 0}function G(r,t,e){return"Subtract"===r?{NAME:"Normal",VAL:{mean:t-e.mean,stdev:e.stdev}}:"Multiply"===r?{NAME:"Normal",VAL:{mean:t*e.mean,stdev:Math.abs(t)*e.stdev}}:"Add"===r?{NAME:"Normal",VAL:{mean:t+e.mean,stdev:e.stdev}}:void 0}function w(r,t,e){return"Subtract"===r?{NAME:"Normal",VAL:{mean:t.mean-e,stdev:t.stdev}}:"Divide"===r?{NAME:"Normal",VAL:{mean:t.mean/e,stdev:t.stdev/Math.abs(e)}}:"Multiply"===r?{NAME:"Normal",VAL:{mean:t.mean*e,stdev:t.stdev*Math.abs(e)}}:"Add"===r?{NAME:"Normal",VAL:{mean:t.mean+e,stdev:t.stdev}}:void 0}var D={make:function(r,t){return t>0?{TAG:0,_0:{NAME:"Normal",VAL:{mean:r,stdev:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Standard deviation of normal distribution must be larger than 0",[Symbol.for("name")]:"Error"}},pdf:_,cdf:g,from90PercentCI:h,inv:y,sample:b,mean:A,toString:S,add:T,subtract:E,pointwiseProduct:function(r,t){return{NAME:"Normal",VAL:{mean:(r.mean*Math.pow(t.stdev,2)+t.mean*Math.pow(r.stdev,2))/(Math.pow(r.stdev,2)+Math.pow(t.stdev,2)),stdev:1/(1/Math.pow(r.stdev,2)+1/Math.pow(t.stdev,2))}}},operate:x,operateFloatFirst:G,operateFloatSecond:w};function k(r){return"Exponential("+r.rate+")"}var O={make:function(r){return r>0?{TAG:0,_0:{NAME:"Exponential",VAL:{rate:r}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Exponential distributions rate must be larger than 0.",[Symbol.for("name")]:"Error"}},pdf:function(r,t){return i.exponential.pdf(r,t.rate)},cdf:function(r,t){return i.exponential.cdf(r,t.rate)},inv:function(r,t){return i.exponential.inv(r,t.rate)},sample:function(r){return i.exponential.sample(r.rate)},mean:function(r){return{TAG:0,_0:i.exponential.mean(r.rate),[Symbol.for("name")]:"Ok"}},toString:k};function M(r,t){return i.cauchy.pdf(r,t.local,t.scale)}function F(r,t){return i.cauchy.cdf(r,t.local,t.scale)}function I(r,t){return i.cauchy.inv(r,t.local,t.scale)}function P(r){return i.cauchy.sample(r.local,r.scale)}function N(r){return"Cauchy("+r.local+", "+r.scale+")"}var R={make:function(r,t){return t>0?{TAG:0,_0:{NAME:"Cauchy",VAL:{local:r,scale:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Cauchy distribution scale parameter must larger than 0.",[Symbol.for("name")]:"Error"}},pdf:M,cdf:F,inv:I,sample:P,mean:function(r){return{TAG:1,_0:"Cauchy distributions may have no mean value.",[Symbol.for("name")]:"Error"}},toString:N};function C(r,t){return i.triangular.pdf(r,t.low,t.high,t.medium)}function L(r,t){return i.triangular.cdf(r,t.low,t.high,t.medium)}function V(r,t){return i.triangular.inv(r,t.low,t.high,t.medium)}function j(r){return i.triangular.sample(r.low,r.high,r.medium)}function $(r){return{TAG:0,_0:i.triangular.mean(r.low,r.high,r.medium),[Symbol.for("name")]:"Ok"}}function U(r){return"Triangular("+r.low+", "+r.medium+", "+r.high+")"}var q={make:function(r,t,e){return r<t&&t<e?{TAG:0,_0:{NAME:"Triangular",VAL:{low:r,medium:t,high:e}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Triangular values must be increasing order.",[Symbol.for("name")]:"Error"}},pdf:C,cdf:L,inv:V,sample:j,mean:$,toString:U};function B(r,t){return r>0&&t>0?{TAG:0,_0:{NAME:"Beta",VAL:{alpha:r,beta:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Beta distribution parameters must be positive",[Symbol.for("name")]:"Error"}}function X(r,t){return i.beta.pdf(r,t.alpha,t.beta)}function W(r,t){return i.beta.cdf(r,t.alpha,t.beta)}function z(r,t){return i.beta.inv(r,t.alpha,t.beta)}function Y(r){return i.beta.sample(r.alpha,r.beta)}function K(r){return{TAG:0,_0:i.beta.mean(r.alpha,r.beta),[Symbol.for("name")]:"Ok"}}function H(r){return"Beta("+r.alpha+","+r.beta+")"}function Z(r,t){return B(r*t,(1-r)*t)}var J={make:B,pdf:X,cdf:W,inv:z,sample:Y,mean:K,toString:H,fromMeanAndSampleSize:Z,fromMeanAndStdev:function(r,t){return 0<t&&t<=.5?0<=r&&r<=1?Z(r,r*(1-r)/(t*t)-1):{TAG:1,_0:"Mean must be in between 0 and 1.0.",[Symbol.for("name")]:"Error"}:{TAG:1,_0:"Stdev must be in in between 0 and 0.5.",[Symbol.for("name")]:"Error"}}};function Q(r,t){return i.lognormal.pdf(r,t.mu,t.sigma)}function rr(r,t){return i.lognormal.cdf(r,t.mu,t.sigma)}function tr(r,t){return i.lognormal.inv(r,t.mu,t.sigma)}function er(r){return{TAG:0,_0:i.lognormal.mean(r.mu,r.sigma),[Symbol.for("name")]:"Ok"}}function nr(r){return i.lognormal.sample(r.mu,r.sigma)}function or(r){return"Lognormal("+r.mu+","+r.sigma+")"}function ir(r,t){var e=Math.log(r),n=Math.log(t);return{NAME:"Lognormal",VAL:{mu:s.Floats.mean([e,n]),sigma:(n-e)/3.2897072539029444}}}function ar(r,t){return{NAME:"Lognormal",VAL:{mu:r.mu+t.mu,sigma:Math.sqrt(Math.pow(r.sigma,2)+Math.pow(t.sigma,2))}}}function ur(r,t){return{NAME:"Lognormal",VAL:{mu:r.mu-t.mu,sigma:Math.sqrt(Math.pow(r.sigma,2)+Math.pow(t.sigma,2))}}}function sr(r,t,e){return"Divide"===r?ur(t,e):"Multiply"===r?ar(t,e):void 0}function fr(r,t,e){return"Divide"===r?t>0?{NAME:"Lognormal",VAL:{mu:Math.log(t)-e.mu,sigma:e.sigma}}:void 0:"Multiply"===r&&t>0?{NAME:"Lognormal",VAL:{mu:Math.log(t)+e.mu,sigma:e.sigma}}:void 0}function cr(r,t,e){return"Divide"===r?e>0?{NAME:"Lognormal",VAL:{mu:t.mu-Math.log(e),sigma:t.sigma}}:void 0:"Multiply"===r&&e>0?{NAME:"Lognormal",VAL:{mu:t.mu+Math.log(e),sigma:t.sigma}}:void 0}var lr={make:function(r,t){return t>0?{TAG:0,_0:{NAME:"Lognormal",VAL:{mu:r,sigma:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Lognormal standard deviation must be larger than 0",[Symbol.for("name")]:"Error"}},pdf:Q,cdf:rr,inv:tr,mean:er,sample:nr,toString:or,from90PercentCI:ir,fromMeanAndStdev:function(r,t){if(r<=0)return{TAG:1,_0:"Lognormal mean must be larger than 0",[Symbol.for("name")]:"Error"};if(t<=0)return{TAG:1,_0:"Lognormal standard deviation must be larger than 0",[Symbol.for("name")]:"Error"};var e=Math.pow(t,2),n=Math.pow(r,2);return{TAG:0,_0:{NAME:"Lognormal",VAL:{mu:2*Math.log(r)-.5*Math.log(e+n),sigma:Math.sqrt(Math.log(e/n+1))}},[Symbol.for("name")]:"Ok"}},multiply:ar,divide:ur,operate:sr,operateFloatFirst:fr,operateFloatSecond:cr};function mr(r,t){return i.uniform.pdf(r,t.low,t.high)}function pr(r,t){return i.uniform.cdf(r,t.low,t.high)}function vr(r,t){return i.uniform.inv(r,t.low,t.high)}function dr(r){return i.uniform.sample(r.low,r.high)}function _r(r){return{TAG:0,_0:i.uniform.mean(r.low,r.high),[Symbol.for("name")]:"Ok"}}function gr(r){return"Uniform("+r.low+","+r.high+")"}var hr={make:function(r,t){return t>r?{TAG:0,_0:{NAME:"Uniform",VAL:{low:r,high:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"High must be larger than low",[Symbol.for("name")]:"Error"}},pdf:mr,cdf:pr,inv:vr,sample:dr,mean:_r,toString:gr,truncate:function(r,t,e){return{low:n.float_max(f.$$default(r,u.neg_infinity),e.low),high:n.float_min(f.$$default(t,u.infinity),e.high)}}};function yr(r,t){return c.Logistic.pdf(r,t.location,t.scale)}function br(r,t){return c.Logistic.cdf(r,t.location,t.scale)}function Ar(r,t){return c.Logistic.quantile(r,t.location,t.scale)}function Sr(r){return Ar(dr({low:0,high:1}),r)}function Tr(r){return{TAG:0,_0:c.Logistic.mean(r.location,r.scale),[Symbol.for("name")]:"Ok"}}function Er(r){return"Logistic("+r.location+","+r.scale+")"}var xr={make:function(r,t){return t>0?{TAG:0,_0:{NAME:"Logistic",VAL:{location:r,scale:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Scale must be positive",[Symbol.for("name")]:"Error"}},pdf:yr,cdf:br,inv:Ar,sample:Sr,mean:Tr,toString:Er};function Gr(r,t){return c.Bernoulli.pmf(r,t.p)}function wr(r,t){return c.Bernoulli.cdf(r,t.p)}function Dr(r,t){return c.Bernoulli.quantile(r,t.p)}function kr(r){return{TAG:0,_0:c.Bernoulli.mean(r.p),[Symbol.for("name")]:"Ok"}}function Or(r){return 1===r.p?1:0}function Mr(r){return 0===r.p?0:1}function Fr(r){return Dr(dr({low:0,high:1}),r)}function Ir(r){return"Bernoulli("+r.p+")"}function Pr(r){var t=r.p;return{TAG:1,_0:m.make(1,void 0,{xs:[0,1],ys:[1-t,t]}),[Symbol.for("name")]:"Discrete"}}var Nr={make:function(r){return r>=0&&r<=1?{TAG:0,_0:{NAME:"Bernoulli",VAL:{p:r}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Bernoulli parameter must be between 0 and 1",[Symbol.for("name")]:"Error"}},pmf:function(r,t){return c.Bernoulli.pmf(r,t.p)},pdf:Gr,cdf:wr,inv:Dr,mean:kr,min:Or,max:Mr,sample:Fr,toString:Ir,toPointSetDist:Pr};function Rr(r,t){return i.gamma.pdf(r,t.shape,t.scale)}function Cr(r,t){return i.gamma.cdf(r,t.shape,t.scale)}function Lr(r,t){return i.gamma.inv(r,t.shape,t.scale)}function Vr(r){return i.gamma.sample(r.shape,r.scale)}function jr(r){return{TAG:0,_0:i.gamma.mean(r.shape,r.scale),[Symbol.for("name")]:"Ok"}}function $r(r){return"("+r.shape+", "+r.scale+")"}var Ur={make:function(r,t){return r>0?t>0?{TAG:0,_0:{NAME:"Gamma",VAL:{shape:r,scale:t}},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"scale must be larger than 0",[Symbol.for("name")]:"Error"}:{TAG:1,_0:"shape must be larger than 0",[Symbol.for("name")]:"Error"}},pdf:Rr,cdf:Cr,inv:Lr,sample:Vr,mean:jr,toString:$r};function qr(r,t){return r===t?1:0}function Br(r,t){return r>=t?1:0}function Xr(r,t){return r<t?0:1}function Wr(r){return"PointMass("+r+")"}function zr(r){return{TAG:1,_0:m.make(1,void 0,{xs:[r],ys:[1]}),[Symbol.for("name")]:"Discrete"}}var Yr={make:function(r){return{NAME:"Float",VAL:r}},makeSafe:function(r){return l.$$isFinite(r)?{TAG:0,_0:{NAME:"Float",VAL:r},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Float must be finite",[Symbol.for("name")]:"Error"}},pdf:qr,cdf:Br,inv:Xr,mean:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"Ok"}},sample:function(r){return r},toString:Wr,toPointSetDist:zr},Kr={make:function(r,t){return r<=0&&r<t?{TAG:0,_0:h(r,t),[Symbol.for("name")]:"Ok"}:r<t?{TAG:0,_0:ir(r,t),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Low value must be less than high value.",[Symbol.for("name")]:"Error"}}};function Hr(r,t){var e=t.NAME;return"Lognormal"===e?Q(r,t.VAL):"Exponential"===e?i.exponential.pdf(r,t.VAL.rate):"Normal"===e?_(r,t.VAL):"Cauchy"===e?M(r,t.VAL):"Logistic"===e?yr(r,t.VAL):"Uniform"===e?mr(r,t.VAL):"Float"===e?qr(r,t.VAL):"Gamma"===e?Rr(r,t.VAL):"Bernoulli"===e?Gr(r,t.VAL):"Beta"===e?X(r,t.VAL):C(r,t.VAL)}function Zr(r,t){var e=t.NAME;return"Lognormal"===e?rr(r,t.VAL):"Exponential"===e?i.exponential.cdf(r,t.VAL.rate):"Normal"===e?g(r,t.VAL):"Cauchy"===e?F(r,t.VAL):"Logistic"===e?br(r,t.VAL):"Uniform"===e?pr(r,t.VAL):"Float"===e?Br(r,t.VAL):"Gamma"===e?Cr(r,t.VAL):"Bernoulli"===e?wr(r,t.VAL):"Beta"===e?W(r,t.VAL):L(r,t.VAL)}function Jr(r,t){var e=t.NAME;return"Lognormal"===e?tr(r,t.VAL):"Exponential"===e?i.exponential.inv(r,t.VAL.rate):"Normal"===e?y(r,t.VAL):"Cauchy"===e?I(r,t.VAL):"Logistic"===e?Ar(r,t.VAL):"Uniform"===e?vr(r,t.VAL):"Float"===e?Xr(r,t.VAL):"Gamma"===e?Lr(r,t.VAL):"Bernoulli"===e?Dr(r,t.VAL):"Beta"===e?z(r,t.VAL):V(r,t.VAL)}function Qr(r){var t=r.NAME;return"Lognormal"===t?nr(r.VAL):"Exponential"===t?i.exponential.sample(r.VAL.rate):"Normal"===t?b(r.VAL):"Cauchy"===t?P(r.VAL):"Logistic"===t?Sr(r.VAL):"Uniform"===t?dr(r.VAL):"Float"===t?r.VAL:"Gamma"===t?Vr(r.VAL):"Bernoulli"===t?Fr(r.VAL):"Beta"===t?Y(r.VAL):j(r.VAL)}function rt(r,t){for(var e=a.make(r,0),n=0;n<r;++n)a.set(e,n,o._1(t,void 0));return e}function tt(r){var t=r.NAME;return"Lognormal"===t?tr(1e-4,r.VAL):"Exponential"===t?i.exponential.inv(1e-4,r.VAL.rate):"Normal"===t?y(1e-4,r.VAL):"Cauchy"===t?I(1e-4,r.VAL):"Logistic"===t?Ar(1e-4,r.VAL):"Float"===t?r.VAL:"Gamma"===t?Lr(1e-4,r.VAL):"Bernoulli"===t?Or(r.VAL):"Beta"===t?z(1e-4,r.VAL):r.VAL.low}function et(r){var t=r.NAME;return"Lognormal"===t?tr(.9999,r.VAL):"Exponential"===t?i.exponential.inv(.9999,r.VAL.rate):"Normal"===t?y(.9999,r.VAL):"Cauchy"===t?I(.9999,r.VAL):"Logistic"===t?Ar(.9999,r.VAL):"Uniform"===t?r.VAL.high:"Float"===t?r.VAL:"Gamma"===t?Lr(.9999,r.VAL):"Bernoulli"===t?Mr(r.VAL):"Beta"===t?z(.9999,r.VAL):r.VAL.high}function nt(r){var t=r.NAME;return"Lognormal"===t?er(r.VAL):"Exponential"===t?{TAG:0,_0:i.exponential.mean(r.VAL.rate),[Symbol.for("name")]:"Ok"}:"Normal"===t?A(r.VAL):"Cauchy"===t?{TAG:1,_0:"Cauchy distributions may have no mean value.",[Symbol.for("name")]:"Error"}:"Logistic"===t?Tr(r.VAL):"Uniform"===t?_r(r.VAL):"Float"===t?{TAG:0,_0:r.VAL,[Symbol.for("name")]:"Ok"}:"Gamma"===t?jr(r.VAL):"Bernoulli"===t?kr(r.VAL):"Beta"===t?K(r.VAL):$(r.VAL)}function ot(r,t,e){if("Linear"===(void 0!==r?r:"Linear"))return s.Floats.range(tt(t),et(t),e);if("object"==typeof t&&"Uniform"===t.NAME){var n=t.VAL,o=n.high-n.low,i=d.Epsilon.ten*o;return[n.low-i,n.low,n.low+i,n.high-i,n.high,n.high+i]}var a=s.Floats.range(1e-4,.9999,e);return s.fmap(a,(function(r){return Jr(r,t)}))}var it={minCdfValue:1e-4,maxCdfValue:.9999,pdf:Hr,cdf:Zr,inv:Jr,sample:Qr,doN:rt,sampleN:function(r,t){return rt(r,(function(r){return Qr(t)}))},toString:function(r){var t=r.NAME;return"Lognormal"===t?or(r.VAL):"Exponential"===t?k(r.VAL):"Normal"===t?S(r.VAL):"Cauchy"===t?N(r.VAL):"Logistic"===t?Er(r.VAL):"Uniform"===t?gr(r.VAL):"Float"===t?Wr(r.VAL):"Gamma"===t?$r(r.VAL):"Bernoulli"===t?Ir(r.VAL):"Beta"===t?H(r.VAL):U(r.VAL)},min:tt,max:et,mean:nt,operate:function(r,t){if("object"!=typeof r)return"Max"===r?{TAG:0,_0:et(t),[Symbol.for("name")]:"Ok"}:"Min"===r?{TAG:0,_0:tt(t),[Symbol.for("name")]:"Ok"}:"Mean"===r?nt(t):{TAG:0,_0:Qr(t),[Symbol.for("name")]:"Ok"};var e=r.NAME;return"Inv"===e?{TAG:0,_0:Jr(r.VAL,t),[Symbol.for("name")]:"Ok"}:"Pdf"===e?{TAG:0,_0:Hr(r.VAL,t),[Symbol.for("name")]:"Ok"}:{TAG:0,_0:Zr(r.VAL,t),[Symbol.for("name")]:"Ok"}},interpolateXs:ot,tryAnalyticalSimplification:function(r,t,e){if("object"!=typeof r)return"NoSolution";var n=r.NAME;if("Lognormal"===n){if("object"!=typeof t)return"NoSolution";var o=t.NAME,i=r.VAL;return"Lognormal"===o?f.dimap(sr(e,i,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"})):"Float"===o?f.dimap(cr(e,i,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"})):"NoSolution"}if("Normal"===n){if("object"!=typeof t)return"NoSolution";var a=t.NAME,u=r.VAL;return"Normal"===a?f.dimap(x(e,u,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"})):"Float"===a?f.dimap(w(e,u,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"})):"NoSolution"}if("Float"!==n)return"NoSolution";if("object"!=typeof t)return"NoSolution";var s=t.NAME,c=r.VAL;if("Lognormal"===s)return f.dimap(fr(e,c,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"}));if("Normal"===s)return f.dimap(G(e,c,t.VAL),(function(r){return{NAME:"AnalyticalSolution",VAL:r}}),(function(r){return"NoSolution"}));if("Float"!==s)return"NoSolution";var l=p.Algebraic.toFn(e,c,t.VAL);return 0===l.TAG?{NAME:"AnalyticalSolution",VAL:{NAME:"Float",VAL:l._0}}:{NAME:"Error",VAL:l._0}},toPointSetDist:function(r,t,e){var n=void 0!==r?r:"ByWeight";if("object"==typeof e){var o=e.NAME;if("Float"===o)return zr(e.VAL);if("Bernoulli"===o)return Pr(e.VAL)}var i=ot(n,e,t),a=s.fmap(i,(function(r){return Hr(r,e)}));return{TAG:2,_0:v.make(void 0,1,void 0,{xs:i,ys:a}),[Symbol.for("name")]:"Continuous"}}};t.normal95confidencePoint=1.6448536269514722,t.Normal=D,t.Exponential=O,t.Cauchy=R,t.Triangular=q,t.Beta=J,t.Lognormal=lr,t.Uniform=hr,t.Logistic=xr,t.Bernoulli=Nr,t.Gamma=Ur,t.Float=Yr,t.From90thPercentile=Kr,t.T=it},2572:(r,t,e)=>{"use strict";var n=e(10456),o=e(11126),i=e(89875),a=e(91638),u=e(65416),s=e(35706);function f(r,t){return u.$$Function.make(r,"",!1,t.map((function(t){var e=t.fn;return u.FnDefinition.make(r,t.inputs,(function(r,t,o){return n._1(e,r)}),void 0)})),void 0,void 0,void 0,void 0,void 0)}function c(r,t,e){return f(r,[{inputs:t,fn:e}])}var l=[s.Make.ff2f("add",(function(r,t){return r+t}),void 0,void 0,void 0,void 0),s.Make.ff2f("subtract",(function(r,t){return r-t}),void 0,void 0,void 0,void 0),s.Make.ff2f("multiply",(function(r,t){return r*t}),void 0,void 0,void 0,void 0),s.Make.ff2f("divide",(function(r,t){return r/t}),void 0,void 0,void 0,void 0),s.Make.ff2f("pow",(function(r,t){return Math.pow(r,t)}),void 0,void 0,void 0,void 0),s.Make.ff2b("equal",(function(r,t){return r===t}),void 0,void 0,void 0,void 0),s.Make.bb2b("equal",(function(r,t){return r===t}),void 0,void 0,void 0,void 0),s.Make.ff2b("unequal",(function(r,t){return r!==t}),void 0,void 0,void 0,void 0),s.Make.ff2b("unequal",(function(r,t){return r!==t}),void 0,void 0,void 0,void 0),s.Make.ff2b("smaller",(function(r,t){return r<t}),void 0,void 0,void 0,void 0),s.Make.ff2b("smallerEq",(function(r,t){return r<=t}),void 0,void 0,void 0,void 0),s.Make.ff2b("larger",(function(r,t){return r>t}),void 0,void 0,void 0,void 0),s.Make.ff2b("largerEq",(function(r,t){return r>=t}),void 0,void 0,void 0,void 0),s.Make.bb2b("or",(function(r,t){return!!r||t}),void 0,void 0,void 0,void 0),s.Make.bb2b("and",(function(r,t){return!!r&&t}),void 0,void 0,void 0,void 0),s.Make.f2f("unaryMinus",(function(r){return-r}),void 0,void 0,void 0,void 0),c("not",[0],(function(r){if(1!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||6!==t.TAG?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:1,_0:0!==t._0,[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"Ok"}})),c("not",[1],(function(r){if(1!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||1!==t.TAG?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:1,_0:!t._0,[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"Ok"}})),c("concat",[8,8],(function(r){if(2!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};if(8!==t.TAG)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:8!==e.TAG?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:8,_0:t._0.concat(e._0),[Symbol.for("name")]:"IEvString"},[Symbol.for("name")]:"Ok"}})),c("concat",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"}],(function(r){if(2!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};if(0!==t.TAG)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];if("number"==typeof e)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};if(0!==e.TAG)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var n=t._0.slice();return i.spliceObjApply(n,"push",[e._0]),{TAG:0,_0:{TAG:0,_0:n,[Symbol.for("name")]:"IEvArray"},[Symbol.for("name")]:"Ok"}})),c("inspect",[9],(function(r){if(1!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return console.log(a.toString(t)),{TAG:0,_0:t,[Symbol.for("name")]:"Ok"}})),c("inspect",[9,8],(function(r){if(2!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0],e=r[1];return"number"==typeof e?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:8!==e.TAG?{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"}:(console.log(e._0+": "+a.toString(t)),{TAG:0,_0:t,[Symbol.for("name")]:"Ok"})})),c("javascriptraise",[9],(function(r){if(1!==r.length)return{TAG:1,_0:s.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return o.raiseError(a.toString(t))}))];t.nameSpace="",t.makeFnMany=f,t.makeFn=c,t.library=l},95792:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924),i=e(9438),a=e(62751),u=e(69129),s=e(21374),f=e(5777),c=e(1578),l=e(70059),m=e(65416),p=e(35706),v="Danger";function d(r,t){return(r+1)/(t+2)}function _(r){return l(r)}function g(r,t){return l(r)/(l(r-t)*l(t))}function h(r,t,e){return g(r,t)*Math.pow(e,t)*Math.pow(1-e,r-t)}var y={laplace:d,factorial:_,choose:g,pow:function(r,t){return Math.pow(r,t)},binomial:h},b=m.$$Function.make("laplace",v,!0,[n._2(p.DefineFn.Numbers.twoToOne,"laplace",d)],["Danger.laplace(1, 20)"],6,void 0,void 0,void 0),A=m.$$Function.make("factorial",v,!0,[n._2(p.DefineFn.Numbers.oneToOne,"factorial",_)],["Danger.factorial(20)"],6,void 0,void 0,void 0),S=m.$$Function.make("choose",v,!0,[n._2(p.DefineFn.Numbers.twoToOne,"choose",g)],["Danger.choose(1, 20)"],6,void 0,void 0,void 0),T=m.$$Function.make("binomial",v,!0,[n._2(p.DefineFn.Numbers.threeToOne,"binomial",h)],["Danger.binomial(1, 20, 0.5)"],6,void 0,void 0,void 0),E={Helpers:y,Lib:{laplace:b,factorial:A,choose:S,binomial:T}};function x(r,t,e,n,o,i){var s=function(t){var e=p.Wrappers.evNumber(t),n=c.doLambdaCall(r,[e],o,i);return"number"==typeof n||6!==n.TAG?{TAG:1,_0:{TAG:15,_0:"Error 1 in Danger.integrate. It's possible that your function doesn't return a number, try definining auxiliaryFunction(x) = mean(yourFunction(x)) and integrate auxiliaryFunction instead",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"}:{TAG:0,_0:n._0,[Symbol.for("name")]:"Ok"}},l=0|n,m=l-2|0,v=e-t,d=v/u.toFloat(l-1|0),_=v/u.toFloat(l-1|0)/2,g=(e-t)/u.toFloat(l-1|0),h=a.makeBy(m,(function(r){return t+(r+1|0)*g})),y=a.fmap(h,s),b=a.R.firstErrorOrOpen(y);if(0!==b.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 2 in Danger.integrate. It's possible that your function doesn't return a number, try definining auxiliaryFunction(x) = mean(yourFunction(x)) and integrate auxiliaryFunction instead.Original error: "+f.Message.toString(b._0),[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var A=a.reduce(b._0,0,(function(r,t){return r+t})),S=s(t),T=s(e);return 0!==S.TAG?{TAG:1,_0:S._0,[Symbol.for("name")]:"Error"}:0!==T.TAG?{TAG:1,_0:T._0,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:(S._0+T._0)*_+A*d,[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}var G={integrateFunctionBetweenWithNumIntegrationPoints:x},w=m.$$Function.make("integrateFunctionBetweenWithNumIntegrationPoints",v,!1,[m.FnDefinition.make("integrateFunctionBetweenWithNumIntegrationPoints",[7,0,0,0],(function(r,t,e){if(4!==r.length)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var n=r[0],o=r[3];if("number"==typeof o)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==o.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(0===o._0)return{TAG:1,_0:{TAG:15,_0:"Integration error 4 in Danger.integrate: Increment can't be 0.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if("number"==typeof n)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(5!==n.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var i=r[1];if("number"==typeof i)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var a=r[2];if("number"==typeof a)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==a.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 5 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var u=r[3];return x(n._0,i._0,a._0,u._0,t,e)}),void 0)],["Danger.integrateFunctionBetweenWithNumIntegrationPoints({|x| x+1}, 1, 10, 10)"],6,void 0,void 0,void 0),D=m.$$Function.make("integrateFunctionBetweenWithEpsilon",v,!1,[m.FnDefinition.make("integrateFunctionBetweenWithEpsilon",[7,0,0,0],(function(r,t,e){if(4!==r.length)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var n=r[0],o=r[3];if("number"==typeof o)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==o.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(0===o._0)return{TAG:1,_0:{TAG:15,_0:"Integration error in Danger.integrate: Increment can't be 0.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if("number"==typeof n)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(5!==n.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var i=r[1];if("number"==typeof i)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var a=i._0,u=r[2];if("number"==typeof u)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==u.TAG)return{TAG:1,_0:{TAG:15,_0:"Integration error 8 in Danger.integrate. Remember that inputs are (function, number (min), number (max), number(increment))",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var c=u._0,l=r[3];return s.errMap(x(n._0,a,c,(c-a)/l._0,t,e),(function(r){return{TAG:15,_0:"Integration error 7 in Danger.integrate. Something went wrong along the way: "+f.Message.toString(r),[Symbol.for("name")]:"REOther"}}))}),void 0)],["Danger.integrateFunctionBetweenWithEpsilon({|x| x+1}, 1, 10, 0.1)"],6,void 0,void 0,void 0),k={Helpers:G,Lib:{integrateFunctionBetweenWithNumIntegrationPoints:w,integrateFunctionBetweenWithEpsilon:D}};function O(r){return a.reducei(r,0,(function(t,e,n){return e>i.get(r,t)?n:t}))}function M(r,t,e,n,u){var s=t>0,f=e>0,l=t>e;if(!(a.length(r)>1))return{TAG:1,_0:{TAG:15,_0:"Error in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions, number of functions should be greater than 1.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(!s)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions, funds should be greater than 0.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(!f)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions, approximateIncrement should be greater than 0.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(!l)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions, approximateIncrement should be smaller than funds amount.",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var m=function(r,t){var e=p.Wrappers.evNumber(t),o=c.doLambdaCall(r,[e],n,u);return"number"==typeof o||6!==o.TAG?{TAG:1,_0:{TAG:15,_0:"Error 1 in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions. It's possible that your function doesn't return a number, try definining auxiliaryFunction(x) = mean(yourFunction(x)) and integrate auxiliaryFunction instead",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"}:{TAG:0,_0:o._0,[Symbol.for("name")]:"Ok"}},v=Math.round(t/e),d=t/v,_=o.make(0|v,d),g={TAG:0,_0:{optimalAllocations:o.make(a.length(r),0),currentMarginalReturns:a.R.firstErrorOrOpen(a.fmap(r,(function(r){return m(r,0)})))},[Symbol.for("name")]:"Ok"},h=a.reduce(_,g,(function(t,e){if(0!==t.TAG)return{TAG:1,_0:t._0,[Symbol.for("name")]:"Error"};var n=t._0,o=n.currentMarginalReturns;if(0!==o.TAG)return{TAG:1,_0:o._0,[Symbol.for("name")]:"Error"};var a=o._0,u=O(a),s=n.optimalAllocations.slice(0),f=i.get(s,u)+e;i.set(s,u,f);var c,l=i.get(r,u),p=m(l,f);if(0===p.TAG){var v=a.slice(0);i.set(v,u,p._0),c={TAG:0,_0:v,[Symbol.for("name")]:"Ok"}}else c={TAG:1,_0:p._0,[Symbol.for("name")]:"Error"};return{TAG:0,_0:{optimalAllocations:s,currentMarginalReturns:c},[Symbol.for("name")]:"Ok"}}));return 0===h.TAG?{TAG:0,_0:p.Wrappers.evArrayOfEvNumber(h._0.optimalAllocations),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:h._0,[Symbol.for("name")]:"Error"}}var F={findBiggestElementIndex:O,optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions:M},I=m.$$Function.make("optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions",v,!1,[m.FnDefinition.make("optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions",[{TAG:2,_0:7,[Symbol.for("name")]:"FRTypeArray"},0,0],(function(r,t,e){if(3!==r.length)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var o=r[1];if("number"==typeof o)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==o.TAG)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var i=r[2];if("number"==typeof i)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:{TAG:15,_0:"Error in Danger.diminishingMarginalReturnsForTwoFunctions",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"};var u=a.fmap(n._0,(function(r){return"number"==typeof r||5!==r.TAG?{TAG:1,_0:{TAG:15,_0:"Error in Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions. A member of the array wasn't a function",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"}:{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}})),s=a.R.firstErrorOrOpen(u);return 0===s.TAG?M(s._0,o._0,i._0,t,e):{TAG:1,_0:s._0,[Symbol.for("name")]:"Error"}}),void 0)],["Danger.optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions([{|x| x+1}, {|y| 10}], 100, 0.01)"],0,void 0,void 0,void 0),P={Helpers:F,Lib:{optimalAllocationGivenDiminishingMarginalReturnsForManyFunctions:I}},N=[b,A,S,T,w,D,I];t.nameSpace=v,t.requiresNamespace=!0,t.Combinatorics=E,t.Integration=k,t.DiminishingReturns=P,t.library=N},15264:(r,t,e)=>{"use strict";var n=e(10456),o=e(40321),i=e(65416),a=e(35706);function u(r,t,e){return i.$$Function.make(r,"",!1,[i.FnDefinition.make(r,t,(function(r,t,o){return n._1(e,r)}),void 0)],void 0,void 0,void 0,void 0,void 0)}function s(r,t){return i.$$Function.make(r,"",!1,[i.FnDefinition.make(r,[0],(function(r,e,o){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var i=r[0];return"number"==typeof i||6!==i.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:9,_0:n._1(t,i._0),[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}}),void 0)],void 0,void 0,void 0,void 0,void 0)}function f(r,t){return i.$$Function.make(r,"",!1,[i.FnDefinition.make(r,[4],(function(r,e,o){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var i=r[0];return"number"==typeof i||9!==i.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._1(t,i._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)],void 0,void 0,void 0,void 0,void 0)}var c=[u("toString",[3],(function(r){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||2!==t.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:8,_0:o.$$Date.toString(t._0),[Symbol.for("name")]:"IEvString"},[Symbol.for("name")]:"Ok"}})),u("makeDateFromYear",[0],(function(r){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(6!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=o.$$Date.makeFromYear(t._0);return 0===e.TAG?{TAG:0,_0:{TAG:2,_0:e._0,[Symbol.for("name")]:"IEvDate"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:13,_0:e._0,[Symbol.for("name")]:"RETodo"},[Symbol.for("name")]:"Error"}})),u("dateFromNumber",[0],(function(r){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||6!==t.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:2,_0:o.$$Date.fromFloat(t._0),[Symbol.for("name")]:"IEvDate"},[Symbol.for("name")]:"Ok"}})),u("toNumber",[3],(function(r){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||2!==t.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:o.$$Date.toFloat(t._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}})),u("subtract",[3,3],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(2!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];if("number"==typeof e)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(2!==e.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var n=o.$$Date.subtract(t._0,e._0);return 0===n.TAG?{TAG:0,_0:{TAG:9,_0:n._0,[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:13,_0:n._0,[Symbol.for("name")]:"RETodo"},[Symbol.for("name")]:"Error"}})),u("subtract",[3,4],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(2!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||9!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:2,_0:o.$$Date.subtractDuration(t._0,e._0),[Symbol.for("name")]:"IEvDate"},[Symbol.for("name")]:"Ok"}})),u("add",[3,4],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(2!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||9!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:2,_0:o.$$Date.addDuration(t._0,e._0),[Symbol.for("name")]:"IEvDate"},[Symbol.for("name")]:"Ok"}})),u("toString",[4],(function(r){if(1!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];return"number"==typeof t||9!==t.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:8,_0:o.Duration.toString(t._0),[Symbol.for("name")]:"IEvString"},[Symbol.for("name")]:"Ok"}})),s("minutes",o.Duration.fromMinutes),s("fromUnit_minutes",o.Duration.fromMinutes),s("hours",o.Duration.fromHours),s("fromUnit_hours",o.Duration.fromHours),s("days",o.Duration.fromDays),s("fromUnit_days",o.Duration.fromDays),s("years",o.Duration.fromYears),s("fromUnit_years",o.Duration.fromYears),f("toMinutes",o.Duration.toMinutes),f("toHours",o.Duration.toHours),f("toDays",o.Duration.toDays),f("toYears",o.Duration.toYears),u("add",[4,4],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(9!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||9!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:9,_0:o.Duration.add(t._0,e._0),[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}})),u("subtract",[4,4],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(9!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||9!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:9,_0:o.Duration.subtract(t._0,e._0),[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}})),u("multiply",[4,0],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(9!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||6!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:9,_0:o.Duration.multiply(t._0,e._0),[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}})),u("divide",[4,0],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(9!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||6!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:9,_0:o.Duration.divide(t._0,e._0),[Symbol.for("name")]:"IEvTimeDuration"},[Symbol.for("name")]:"Ok"}})),u("divide",[4,4],(function(r){if(2!==r.length)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};if(9!==t.TAG)return{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||9!==e.TAG?{TAG:1,_0:a.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:t._0/e._0,[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}))];t.makeFn=u,t.makeNumberToDurationFn=s,t.makeDurationToNumberFn=f,t.library=c},2889:(r,t,e)=>{"use strict";var n=e(71307),o=e(62751),i=e(21374),a=e(5777),u=e(1578),s=e(65416),f=e(35706),c="Dict";function l(r){return{TAG:0,_0:o.fmap(n.keysToArray(r),f.Wrappers.evString),[Symbol.for("name")]:"IEvArray"}}function m(r){return f.Wrappers.evArray(o.fmap(n.toArray(r),(function(r){return f.Wrappers.evArray([{TAG:8,_0:r[0],[Symbol.for("name")]:"IEvString"},r[1]])})))}function p(r){return i.fmap(i.fmap(o.R.firstErrorOrOpen(o.fmap(r,(function(r){if("number"==typeof r)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(0!==r.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var t=r._0;if(2!==t.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var e=t[0];if("number"==typeof e)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(8!==e.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=t[1];return{TAG:0,_0:[e._0,n],[Symbol.for("name")]:"Ok"}}))),n.fromArray),f.Wrappers.evRecord)}function v(r,t,e){return{TAG:7,_0:n.set(r,t,e),[Symbol.for("name")]:"IEvRecord"}}function d(r){return{TAG:7,_0:n.fromArray(o.concatMany(o.fmap(r,n.toArray))),[Symbol.for("name")]:"IEvRecord"}}function _(r,t,e,o){return f.Wrappers.evRecord(n.map(r,(function(r){return u.doLambdaCall(t,[r],e,o)})))}var g={keys:l,values:function(r){return{TAG:0,_0:n.valuesToArray(r),[Symbol.for("name")]:"IEvArray"}},toList:m,fromList:p,set:v,mergeMany:d,map:_},h=[s.$$Function.make("set",c,!0,[s.FnDefinition.make("set",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"},8,9],(function(r,t,e){if(3!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(7!==n.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];if("number"==typeof o)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(8!==o.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var i=r[2];return{TAG:0,_0:v(n._0,o._0,i),[Symbol.for("name")]:"Ok"}}),void 0)],['Dict.set({a: 1, b: 2}, "c", 3)'],7,void 0,void 0,void 0),s.$$Function.make("merge",c,!0,[s.FnDefinition.make("merge",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"},{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"}],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(7!==n.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||7!==o.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:d([n._0,o._0]),[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.merge({a: 1, b: 2}, {c: 3, d: 4})"],7,void 0,void 0,void 0),s.$$Function.make("mergeMany",c,!0,[s.FnDefinition.make("mergeMany",[{TAG:2,_0:{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"},[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||0!==n.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:d(o.fmap(n._0,(function(r){return"number"==typeof r||7!==r.TAG?a.Message.$$throw(f.impossibleError):r._0}))),[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.mergeMany([{a: 1, b: 2}, {c: 3, d: 4}])"],7,void 0,void 0,void 0),s.$$Function.make("keys",c,!0,[s.FnDefinition.make("keys",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||7!==n.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:l(n._0),[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.keys({a: 1, b: 2})"],0,void 0,void 0,void 0),s.$$Function.make("values",c,!0,[s.FnDefinition.make("values",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var o=r[0];return"number"==typeof o||7!==o.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:0,_0:n.valuesToArray(o._0),[Symbol.for("name")]:"IEvArray"},[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.values({a: 1, b: 2})"],0,void 0,void 0,void 0),s.$$Function.make("toList",c,!0,[s.FnDefinition.make("toList",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||7!==n.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:m(n._0),[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.toList({a: 1, b: 2})"],0,void 0,void 0,void 0),s.$$Function.make("fromList",c,!0,[s.FnDefinition.make("fromList",[{TAG:2,_0:{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||0!==n.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:p(n._0)}),void 0)],['Dict.fromList([["a", 1], ["b", 2]])'],7,void 0,void 0,void 0),s.$$Function.make("map",c,!0,[s.FnDefinition.make("map",[{TAG:1,_0:9,[Symbol.for("name")]:"FRTypeDict"},7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};if(7!==n.TAG)return{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||5!==o.TAG?{TAG:1,_0:f.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:_(n._0,o._0,t,e),[Symbol.for("name")]:"Ok"}}),void 0)],["Dict.map({a: 1, b: 2}, {|x| x + 1})"],7,void 0,void 0,void 0)];t.nameSpace=c,t.Internals=g,t.library=h},45725:(r,t,e)=>{"use strict";var n=e(10456),o=e(21374),i=e(40884),a=e(14307),u=e(65416),s=e(35706),f="Dist";function c(r,t,e){return u.$$Function.make(r,f,!1,e,t,4,void 0,void 0,void 0)}function l(r,t,e){return o.errMap(o.fmap(o.bind(e,(function(e){return n._3(s.Process.DistOrNumberToDist.twoValuesUsingSymbolicDist,r,e,t)})),s.Wrappers.evDistribution),(function(r){return{TAG:15,_0:r,[Symbol.for("name")]:"REOther"}}))}function m(r,t){return u.FnDefinition.make(r,[5,5],(function(r,e,o){return l(t,e.environment,n._1(s.Prepare.ToValueTuple.twoDistOrNumber,r))}),void 0)}function p(r,t){return u.FnDefinition.make(r,[{TAG:0,_0:[["p5",5],["p95",5]],[Symbol.for("name")]:"FRTypeRecord"}],(function(r,e,o){return l(t,e.environment,n._2(s.Prepare.ToValueTuple.Record.twoDistOrNumber,r,["p5","p95"]))}),void 0)}function v(r,t){return u.FnDefinition.make(r,[{TAG:0,_0:[["mean",5],["stdev",5]],[Symbol.for("name")]:"FRTypeRecord"}],(function(r,e,o){return l(t,e.environment,n._2(s.Prepare.ToValueTuple.Record.twoDistOrNumber,r,["mean","stdev"]))}),void 0)}var d={$$process:l,make:m,makeRecordP5P95:p,makeRecordMeanStdev:v};function _(r,t,e){return o.errMap(o.fmap(o.bind(e,(function(e){return n._3(s.Process.DistOrNumberToDist.oneValueUsingSymbolicDist,r,e,t)})),s.Wrappers.evDistribution),(function(r){return{TAG:15,_0:r,[Symbol.for("name")]:"REOther"}}))}function g(r,t){return u.FnDefinition.make(r,[5],(function(r,e,o){return _(t,e.environment,n._1(s.Prepare.ToValueTuple.oneDistOrNumber,r))}),void 0)}var h={$$process:_,make:g},y=[c("normal",["normal(5,1)","normal({p5: 4, p95: 10})","normal({mean: 5, stdev: 2})"],[m("normal",(function(r){return i.toFnCall(a.Normal.make,r)})),p("normal",(function(r){return{TAG:0,_0:i.toFnCall(a.Normal.from90PercentCI,r),[Symbol.for("name")]:"Ok"}})),v("normal",(function(r){return i.toFnCall(a.Normal.make,r)}))]),c("lognormal",["lognormal(0.5, 0.8)","lognormal({p5: 4, p95: 10})","lognormal({mean: 5, stdev: 2})"],[m("lognormal",(function(r){return i.toFnCall(a.Lognormal.make,r)})),p("lognormal",(function(r){return{TAG:0,_0:i.toFnCall(a.Lognormal.from90PercentCI,r),[Symbol.for("name")]:"Ok"}})),v("lognormal",(function(r){return i.toFnCall(a.Lognormal.fromMeanAndStdev,r)}))]),c("uniform",["uniform(10, 12)"],[m("uniform",(function(r){return i.toFnCall(a.Uniform.make,r)}))]),c("beta",["beta(20, 25)","beta({mean: 0.39, stdev: 0.1})"],[m("beta",(function(r){return i.toFnCall(a.Beta.make,r)})),v("beta",(function(r){return i.toFnCall(a.Beta.fromMeanAndStdev,r)}))]),c("cauchy",["cauchy(5, 1)"],[m("cauchy",(function(r){return i.toFnCall(a.Cauchy.make,r)}))]),c("gamma",["gamma(5, 1)"],[m("gamma",(function(r){return i.toFnCall(a.Gamma.make,r)}))]),c("logistic",["logistic(5, 1)"],[m("logistic",(function(r){return i.toFnCall(a.Logistic.make,r)}))]),c("to (distribution)",["5 to 10","to(5,10)","-5 to 5"],[m("to",(function(r){return i.toFnCall(a.From90thPercentile.make,r)})),m("credibleIntervalToDistribution",(function(r){return i.toFnCall(a.From90thPercentile.make,r)}))]),c("exponential",["exponential(2)"],[g("exponential",a.Exponential.make)]),c("bernoulli",["bernoulli(0.5)"],[g("bernoulli",a.Bernoulli.make)]),c("pointMass",["pointMass(0.5)"],[g("pointMass",a.Float.makeSafe)])],b={nameSpace:f,output:4,requiresNamespace:!1,fnMake:c,TwoArgDist:d,OneArgDist:h,library:y},A=i.toFnCall;t.twoArgs=A,t.DistributionCreation=b,t.library=y},94677:(r,t,e)=>{"use strict";var n=e(10456),o=e(62751),i=e(21374),a=e(58199),u=e(65416),s=e(35706),f={TAG:0,_0:[["fn",7],["inputs",{TAG:2,_0:{TAG:0,_0:[["min",0],["max",0]],[Symbol.for("name")]:"FRTypeRecord"},[Symbol.for("name")]:"FRTypeArray"}]],[Symbol.for("name")]:"FRTypeRecord"};function c(r){var t=n._2(s.Prepare.ToValueArray.Record.twoArgs,[r],["fn","inputs"]);if(0!==t.TAG)return{TAG:1,_0:t._0,[Symbol.for("name")]:"Error"};var e=t._0;if(2!==e.length)return{TAG:1,_0:s.impossibleErrorString,[Symbol.for("name")]:"Error"};var u=e[0];if("number"==typeof u)return{TAG:1,_0:s.impossibleErrorString,[Symbol.for("name")]:"Error"};if(5!==u.TAG)return{TAG:1,_0:s.impossibleErrorString,[Symbol.for("name")]:"Error"};var f=u._0,c=e[1];return"number"==typeof c?{TAG:1,_0:s.impossibleErrorString,[Symbol.for("name")]:"Error"}:0!==c.TAG?{TAG:1,_0:s.impossibleErrorString,[Symbol.for("name")]:"Error"}:i.fmap(o.R.firstErrorOrOpen(o.fmap(c._0,(function(r){return i.fmap(i.bind(n._2(s.Prepare.ToValueArray.Record.twoArgs,[r],["min","max"]),s.Prepare.ToValueTuple.twoNumbers),(function(r){return a.ContinuousFloatArg.make(r[0],r[1])}))}))),(function(r){return{TAG:3,_0:a.make(f,r),[Symbol.for("name")]:"IEvDeclaration"}}))}var l={frType:f,fromExpressionValue:c},m="Function",p=[u.$$Function.make("declare",m,!0,[u.FnDefinition.make("declare",[f],(function(r,t,e){return i.errMap(i.bind(s.getOrError(r,0),c),s.wrapError)}),void 0)],["Function.declare({\n fn: {|a,b| a },\n inputs: [\n {min: 0, max: 100},\n {min: 30, max: 50}\n ]\n})"],3,"Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.",!0,void 0)];t.Declaration=l,t.nameSpace=m,t.library=p},5372:(r,t,e)=>{"use strict";var n=e(10456),o=e(43924),i=e(62751),a=e(17646),u=e(21374),s=e(5777),f=e(73539),c=e(85659),l=e(14307),m=e(1578),p=e(52340),v=e(65416);function d(r){switch(r){case"add":case"dotAdd":return"Add";case"divide":case"dotDivide":return"Divide";case"log":return"Logarithm";case"dotMultiply":case"multiply":default:return"Multiply";case"dotPow":case"pow":return"Power";case"dotSubtract":case"subtract":return"Subtract"}}function _(r){if(2===r.length){var t=r[0];if("number"!=typeof t)switch(0|t.TAG){case 4:var e=t._0,n=r[1];if("number"==typeof n)return;switch(0|n.TAG){case 4:return[e,n._0];case 6:return[e,f.fromFloat(n._0)];default:return}case 6:var o=r[1];return"number"==typeof o||4!==o.TAG?void 0:[f.fromFloat(t._0),o._0];default:return}}}function g(r,t,e){return p.run(e,{TAG:0,_0:{NAME:"ToFloat",VAL:r},_1:t,[Symbol.for("name")]:"FromDist"})}function h(r,t,e){return p.run(e,{TAG:0,_0:{NAME:"ToString",VAL:r},_1:t,[Symbol.for("name")]:"FromDist"})}function y(r,t,e){return p.run(e,{TAG:0,_0:{NAME:"ToBool",VAL:r},_1:t,[Symbol.for("name")]:"FromDist"})}function b(r,t,e){return p.run(e,{TAG:0,_0:{NAME:"ToDist",VAL:r},_1:t,[Symbol.for("name")]:"FromDist"})}function A(r,t,e,n,o){return p.run(o,{TAG:0,_0:{NAME:"ToDistCombination",VAL:[r,d(t),{NAME:"Dist",VAL:n}]},_1:e,[Symbol.for("name")]:"FromDist"})}function S(r){return"number"==typeof r||6!==r.TAG?{TAG:1,_0:"Not a number",[Symbol.for("name")]:"Error"}:{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}}function T(r){return i.R.firstErrorOrOpen(i.fmap(r,S))}function E(r){if("number"==typeof r)return{TAG:1,_0:"Not a distribution",[Symbol.for("name")]:"Error"};switch(0|r.TAG){case 4:return{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"};case 6:return{TAG:0,_0:f.fromFloat(r._0),[Symbol.for("name")]:"Ok"};default:return{TAG:1,_0:"Not a distribution",[Symbol.for("name")]:"Error"}}}function x(r){return i.R.firstErrorOrOpen(i.fmap(r,E))}function G(r,t,e){return i.length(r)===i.length(t)?p.run(e,{TAG:3,_0:i.zip(r,t),[Symbol.for("name")]:"Mixture"}):{TAG:5,_0:{TAG:1,_0:"Error, mixture call has different number of distributions and weights",[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}}function w(r,t){var e=i.length(r);return G(r,o.make(e,1/e),t)}function D(r,t){var e=0,n=r.length;if(n>=3)e=1;else switch(n){case 0:e=1;break;case 1:var o=r[0];if("number"==typeof o)e=1;else{if(0===o.TAG){var a=x(o._0);return 0===a.TAG?w(a._0,t):{TAG:5,_0:{TAG:1,_0:a._0,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}}e=1}break;case 2:var s=r[0];if("number"==typeof s||0!==s.TAG)e=1;else{var f=r[1];if("number"==typeof f)e=1;else{if(0===f.TAG){var c=x(s._0),l=T(f._0);if(0===c.TAG)return 0===l.TAG?G(c._0,l._0,t):{TAG:5,_0:{TAG:1,_0:l._0,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"};var m=c._0;return 0===l.TAG?{TAG:5,_0:{TAG:1,_0:m,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}:{TAG:5,_0:{TAG:1,_0:m+"|"+l._0,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}}e=1}}}if(1===e){var p=i.last(r),v=0;if(void 0===p)return{TAG:5,_0:{TAG:1,_0:"Last argument of mx must be array or distribution",[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"};if("number"==typeof p)return{TAG:5,_0:{TAG:1,_0:"Last argument of mx must be array or distribution",[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"};switch(0|p.TAG){case 0:var d=T(p._0),_=x(i.slice(r,0,i.length(r)-1|0)),g=u.merge(_,d);if(0!==g.TAG)return{TAG:5,_0:{TAG:1,_0:g._0,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"};var h=g._0;return G(h[0],h[1],t);case 4:case 6:v=2;break;default:return{TAG:5,_0:{TAG:1,_0:"Last argument of mx must be array or distribution",[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}}if(2===v){var y=x(r);return 0===y.TAG?w(y._0,t):{TAG:5,_0:{TAG:1,_0:y._0,[Symbol.for("name")]:"ArgumentError"},[Symbol.for("name")]:"GenDistError"}}}}function k(r){return"triangular"===r?{TAG:0,_0:l.Triangular.make,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Unreachable state",[Symbol.for("name")]:"Error"}}function O(r){return 0===r.TAG?{TAG:0,_0:{TAG:2,_0:r._0,[Symbol.for("name")]:"Symbolic"},[Symbol.for("name")]:"Dist"}:{TAG:5,_0:{TAG:7,_0:r._0,[Symbol.for("name")]:"OtherError"},[Symbol.for("name")]:"GenDistError"}}function M(r,t){var e=r[1],o=r[0],i=0;switch(o){case"cdf":if(2!==e.length)return;var s=e[0];if("number"==typeof s)return;if(4!==s.TAG)return;var l=e[1];return"number"==typeof l||6!==l.TAG?void 0:g({NAME:"Cdf",VAL:l._0},s._0,t);case"dotExp":if(1!==e.length)return;var m=e[0];return"number"==typeof m||4!==m.TAG?void 0:A(0,"dotPow",f.fromFloat(c.$$Math.e),m._0,t);case"dotAdd":case"dotDivide":case"dotMultiply":case"dotPow":case"dotSubtract":i=3;break;case"exp":if(1!==e.length)return;var p=e[0];return"number"==typeof p||4!==p.TAG?void 0:A({_0:0,[Symbol.for("name")]:"Algebraic"},"pow",f.fromFloat(c.$$Math.e),p._0,t);case"inspect":if(1!==e.length)return;var v=e[0];return"number"==typeof v||4!==v.TAG?void 0:b(2,v._0,t);case"integralSum":if(1!==e.length)return;var d=e[0];return"number"==typeof d||4!==d.TAG?void 0:g("IntegralSum",d._0,t);case"inv":if(2!==e.length)return;var S=e[0];if("number"==typeof S)return;if(4!==S.TAG)return;var T=e[1];return"number"==typeof T||6!==T.TAG?void 0:g({NAME:"Inv",VAL:T._0},S._0,t);case"isNormalized":if(1!==e.length)return;var E=e[0];return"number"==typeof E||4!==E.TAG?void 0:y(0,E._0,t);case"log":if(1!==e.length)i=2;else{var x=e[0];if("number"==typeof x)i=2;else{if(4===x.TAG)return A({_0:0,[Symbol.for("name")]:"Algebraic"},"log",x._0,f.fromFloat(c.$$Math.e),t);i=2}}break;case"log10":if(1!==e.length)return;var G=e[0];return"number"==typeof G||4!==G.TAG?void 0:A({_0:0,[Symbol.for("name")]:"Algebraic"},"log",G._0,f.fromFloat(10),t);case"mixture":case"mx":return D(e,t);case"normalize":if(1!==e.length)return;var w=e[0];return"number"==typeof w||4!==w.TAG?void 0:b(0,w._0,t);case"pdf":if(2!==e.length)return;var M=e[0];if("number"==typeof M)return;if(4!==M.TAG)return;var F=e[1];return"number"==typeof F||6!==F.TAG?void 0:g({NAME:"Pdf",VAL:F._0},M._0,t);case"quantile":if(2!==e.length)return;var I=e[0];if("number"==typeof I)return;if(4!==I.TAG)return;var P=e[1];return"number"==typeof P||6!==P.TAG?void 0:g({NAME:"Inv",VAL:P._0},I._0,t);case"sample":if(1!==e.length)return;var N=e[0];return"number"==typeof N||4!==N.TAG?void 0:g("Sample",N._0,t);case"sampleN":if(2!==e.length)return;var R=e[0];if("number"==typeof R)return;if(4!==R.TAG)return;var C=e[1];return"number"==typeof C||6!==C.TAG?void 0:{TAG:3,_0:f.sampleN(R._0,0|C._0),[Symbol.for("name")]:"FloatArray"};case"scaleExp":if(1!==e.length)return;var L=e[0];return"number"==typeof L||4!==L.TAG?void 0:b({TAG:1,_0:"Power",_1:c.$$Math.e,[Symbol.for("name")]:"Scale"},L._0,t);case"scaleLog":var V=e.length;if(V>=3)return;switch(V){case 0:return;case 1:var j=e[0];return"number"==typeof j||4!==j.TAG?void 0:b({TAG:1,_0:"Logarithm",_1:c.$$Math.e,[Symbol.for("name")]:"Scale"},j._0,t);case 2:var $=e[0];if("number"==typeof $)return;if(4!==$.TAG)return;var U=e[1];return"number"==typeof U||6!==U.TAG?void 0:b({TAG:1,_0:"Logarithm",_1:U._0,[Symbol.for("name")]:"Scale"},$._0,t)}case"scaleLog10":if(1!==e.length)return;var q=e[0];return"number"==typeof q||4!==q.TAG?void 0:b({TAG:1,_0:"Logarithm",_1:10,[Symbol.for("name")]:"Scale"},q._0,t);case"scaleLogWithThreshold":if(3!==e.length)return;var B=e[0];if("number"==typeof B)return;if(4!==B.TAG)return;var X=e[1];if("number"==typeof X)return;if(6!==X.TAG)return;var W=e[2];return"number"==typeof W||6!==W.TAG?void 0:b({TAG:1,_0:{NAME:"LogarithmWithThreshold",VAL:W._0},_1:X._0,[Symbol.for("name")]:"Scale"},B._0,t);case"scaleMultiply":if(2!==e.length)return;var z=e[0];if("number"==typeof z)return;if(4!==z.TAG)return;var Y=e[1];return"number"==typeof Y||6!==Y.TAG?void 0:b({TAG:1,_0:"Multiply",_1:Y._0,[Symbol.for("name")]:"Scale"},z._0,t);case"scalePow":if(2!==e.length)return;var K=e[0];if("number"==typeof K)return;if(4!==K.TAG)return;var H=e[1];return"number"==typeof H||6!==H.TAG?void 0:b({TAG:1,_0:"Power",_1:H._0,[Symbol.for("name")]:"Scale"},K._0,t);case"sparkline":var Z=e.length;if(Z>=3)return;switch(Z){case 0:return;case 1:var J=e[0];return"number"==typeof J||4!==J.TAG?void 0:h({_0:c.Environment.sparklineLength,[Symbol.for("name")]:"ToSparkline"},J._0,t);case 2:var Q=e[0];if("number"==typeof Q)return;if(4!==Q.TAG)return;var rr=e[1];return"number"==typeof rr||6!==rr.TAG?void 0:h({_0:0|rr._0,[Symbol.for("name")]:"ToSparkline"},Q._0,t)}case"add":case"divide":case"multiply":case"pow":case"subtract":i=2;break;case"toPointSet":if(1!==e.length)return;var tr=e[0];return"number"==typeof tr||4!==tr.TAG?void 0:b(1,tr._0,t);case"toString":if(1!==e.length)return;var er=e[0];return"number"==typeof er||4!==er.TAG?void 0:h(0,er._0,t);case"triangular":if(3!==e.length)return;var nr=e[0];if("number"==typeof nr)return;if(6!==nr.TAG)return;var or=nr._0,ir=e[1];if("number"==typeof ir)return;if(6!==ir.TAG)return;var ar=ir._0,ur=e[2];if("number"==typeof ur)return;if(6!==ur.TAG)return;var sr=ur._0;return O(u.bind(k(o),(function(r){return n._3(r,or,ar,sr)})));case"truncate":if(3!==e.length)return;var fr=e[0];if("number"==typeof fr)return;if(4!==fr.TAG)return;var cr=e[1];if("number"==typeof cr)return;if(6!==cr.TAG)return;var lr=e[2];return"number"==typeof lr||6!==lr.TAG?void 0:b({TAG:2,_0:cr._0,_1:lr._0,[Symbol.for("name")]:"Truncate"},fr._0,t);case"truncateLeft":if(2!==e.length)return;var mr=e[0];if("number"==typeof mr)return;if(4!==mr.TAG)return;var pr=e[1];return"number"==typeof pr||6!==pr.TAG?void 0:b({TAG:2,_0:pr._0,_1:void 0,[Symbol.for("name")]:"Truncate"},mr._0,t);case"truncateRight":if(2!==e.length)return;var vr=e[0];if("number"==typeof vr)return;if(4!==vr.TAG)return;var dr=e[1];return"number"==typeof dr||6!==dr.TAG?void 0:b({TAG:2,_0:void 0,_1:dr._0,[Symbol.for("name")]:"Truncate"},vr._0,t);case"unaryMinus":if(1!==e.length)return;var _r=e[0];return"number"==typeof _r||4!==_r.TAG?void 0:A({_0:0,[Symbol.for("name")]:"Algebraic"},"multiply",_r._0,f.fromFloat(-1),t);case"max":case"mean":case"min":case"mode":case"stdev":case"variance":i=1;break;default:return}switch(i){case 1:if(1!==e.length)return;var gr,hr=e[0];if("number"==typeof hr)return;if(4!==hr.TAG)return;switch(o){case"max":gr="Max";break;case"mean":default:gr="Mean";break;case"min":gr="Min";break;case"mode":gr="Mode";break;case"stdev":gr="Stdev";break;case"variance":gr="Variance"}return g(gr,hr._0,t);case 2:return 2!==e.length?void 0:a.fmap(_(e),(function(r){return A({_0:0,[Symbol.for("name")]:"Algebraic"},o,r[0],r[1],t)}));case 3:return 2!==e.length?void 0:a.fmap(_(e),(function(r){return A(0,o,r[0],r[1],t)}))}}function F(r){switch(0|r.TAG){case 0:return{TAG:0,_0:{TAG:4,_0:r._0,[Symbol.for("name")]:"IEvDistribution"},[Symbol.for("name")]:"Ok"};case 1:return{TAG:0,_0:{TAG:6,_0:r._0,[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"};case 2:return{TAG:0,_0:{TAG:8,_0:r._0,[Symbol.for("name")]:"IEvString"},[Symbol.for("name")]:"Ok"};case 3:return{TAG:0,_0:{TAG:0,_0:i.fmap(r._0,(function(r){return{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"}})),[Symbol.for("name")]:"IEvArray"},[Symbol.for("name")]:"Ok"};case 4:return{TAG:0,_0:{TAG:1,_0:r._0,[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"Ok"};case 5:return{TAG:1,_0:{TAG:2,_0:r._0,[Symbol.for("name")]:"REDistributionError"},[Symbol.for("name")]:"Error"}}}function I(r,t){var e=M(r,t);return void 0!==e?F(e):s.Message.$$throw({TAG:15,_0:"Internal error in FR_GenericDist implementation",[Symbol.for("name")]:"REOther"})}var P={Helpers:{arithmeticMap:d,catchAndConvertTwoArgsToDists:_,toFloatFn:g,toStringFn:h,toBoolFn:y,toDistFn:b,twoDiststoDistFn:A,parseNumber:S,parseNumberArray:T,parseDist:E,parseDistributionArray:x,mixtureWithGivenWeights:G,mixtureWithDefaultWeights:w,mixture:D},SymbolicConstructors:{threeFloat:k,symbolicResultToOutput:O},dispatchToGenericOutput:M,genericOutputToReducerValue:F,dispatch:I};function N(r,t){return v.$$Function.make(r,"",!1,[v.FnDefinition.make(r,t,(function(t,e,n){return I([r,t],e.environment)}),void 0)],void 0,void 0,void 0,void 0,void 0)}function R(r){var t=[[6,0],[0,6],[6,6]];return i.concatMany(i.fmap(["add","multiply","subtract","divide","pow","log","dotAdd","dotMultiply","dotSubtract","dotDivide","dotPow"],(function(r){return i.fmap(t,(function(t){return N(r,t)}))})))}var C=i.concatMany([[N("triangular",[0,0,0]),N("sample",[6]),N("sampleN",[6,0]),N("mean",[6]),N("stdev",[6]),N("variance",[6]),N("min",[6]),N("max",[6]),N("mode",[6]),N("integralSum",[6]),N("toString",[6]),N("sparkline",[6]),N("sparkline",[6,0]),N("exp",[6]),N("normalize",[6]),N("isNormalized",[6]),N("toPointSet",[6]),N("scaleLog",[6]),N("scaleLog10",[6]),N("scaleLog",[6,0]),N("scaleLogWithThreshold",[6,0,0]),N("scaleMultiply",[6,0]),N("scalePow",[6,0]),N("scaleExp",[6]),N("cdf",[6,0]),N("pdf",[6,0]),N("inv",[6,0]),N("quantile",[6,0]),N("inspect",[6]),N("truncateLeft",[6,0]),N("truncateRight",[6,0]),N("truncate",[6,0,0]),N("log",[6]),N("log10",[6]),N("unaryMinus",[6]),N("dotExp",[6])],R()]),L=m.makeFFILambda("mx",(function(r,t,e){var n=I(["mx",r],t.environment);return 0===n.TAG?n._0:s.Message.$$throw(n._0)}));t.Old=P,t.makeProxyFn=N,t.makeOperationFns=R,t.library=C,t.mxLambda=L},81982:(r,t,e)=>{"use strict";var n=e(43924),o=e(62751),i=e(17646),a=e(21374),u=e(46366),s=e(1578),f=e(65416),c=e(35706),l="List";function m(r,t){return{TAG:0,_0:n.make(u.toInt(r),t),[Symbol.for("name")]:"IEvArray"}}function p(r,t){return{TAG:0,_0:o.fmap(o.Floats.range(r,t,u.toInt(t-r+1)),c.Wrappers.evNumber),[Symbol.for("name")]:"IEvArray"}}function v(r,t,e,n){return c.Wrappers.evArray(o.fmap(r,(function(r){return s.doLambdaCall(t,[r],e,n)})))}function d(r,t,e,n,i){return o.reduce(r,t,(function(r,t){return s.doLambdaCall(e,[r,t],n,i)}))}function _(r,t,e,n,i){return o.reduceReverse(r,t,(function(r,t){return s.doLambdaCall(e,[r,t],n,i)}))}function g(r,t,e,n){return c.Wrappers.evArray(r.filter((function(r){var o=s.doLambdaCall(t,[r],e,n);return!("number"==typeof o||1!==o.TAG||!o._0)})))}var h={length:function(r){return{TAG:6,_0:o.length(r),[Symbol.for("name")]:"IEvNumber"}},makeFromNumber:m,upTo:p,first:function(r){return i.toResult(o.first(r),"No first element")},last:function(r){return i.toResult(o.last(r),"No last element")},reverse:function(r){return{TAG:0,_0:n.reverse(r),[Symbol.for("name")]:"IEvArray"}},map:v,reduce:d,reduceReverse:_,filter:g},y=[f.$$Function.make("length",l,!0,[f.FnDefinition.make("length",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||0!==n.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:o.length(n._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)],["List.length([1,4,5])"],6,void 0,void 0,void 0),f.$$Function.make("make",l,!0,[f.FnDefinition.make("make",[0,9],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(6!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return{TAG:0,_0:m(n._0,o),[Symbol.for("name")]:"Ok"}}),void 0)],['List.make(2, "testValue")'],0,void 0,void 0,void 0),f.$$Function.make("upTo",l,!0,[f.FnDefinition.make("upTo",[0,0],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(6!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||6!==o.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:p(n._0,o._0),[Symbol.for("name")]:"Ok"}}),void 0)],["List.upTo(1,4)"],0,void 0,void 0,void 0),f.$$Function.make("first",l,!0,[f.FnDefinition.make("first",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||0!==n.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:a.errMap(i.toResult(o.first(n._0),"No first element"),c.wrapError)}),void 0)],["List.first([1,4,5])"],void 0,void 0,void 0,void 0),f.$$Function.make("last",l,!0,[f.FnDefinition.make("last",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||0!==n.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:a.errMap(i.toResult(o.last(n._0),"No last element"),c.wrapError)}),void 0)],["List.last([1,4,5])"],void 0,void 0,void 0,void 0),f.$$Function.make("reverse",l,!1,[f.FnDefinition.make("reverse",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[0];return"number"==typeof o||0!==o.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:0,_0:n.reverse(o._0),[Symbol.for("name")]:"IEvArray"},[Symbol.for("name")]:"Ok"}}),void 0)],["List.reverse([1,4,5])"],0,void 0,void 0,void 0),f.$$Function.make("map",l,!1,[f.FnDefinition.make("map",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||5!==o.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:v(n._0,o._0,t,e),[Symbol.for("name")]:"Ok"}}),void 0)],["List.map([1,4,5], {|x| x+1})"],0,void 0,void 0,void 0),f.$$Function.make("reduce",l,!1,[f.FnDefinition.make("reduce",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},9,7],(function(r,t,e){if(3!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1],i=r[2];return"number"==typeof i||5!==i.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:d(n._0,o,i._0,t,e),[Symbol.for("name")]:"Ok"}}),void 0)],["List.reduce([1,4,5], 2, {|acc, el| acc+el})"],void 0,void 0,void 0,void 0),f.$$Function.make("reduceReverse",l,!1,[f.FnDefinition.make("reduceReverse",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},9,7],(function(r,t,e){if(3!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1],i=r[2];return"number"==typeof i||5!==i.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:_(n._0,o,i._0,t,e),[Symbol.for("name")]:"Ok"}}),void 0)],["List.reduceReverse([1,4,5], 2, {|acc, el| acc-el})"],void 0,void 0,void 0,void 0),f.$$Function.make("filter",l,!1,[f.FnDefinition.make("filter",[{TAG:2,_0:9,[Symbol.for("name")]:"FRTypeArray"},7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||5!==o.TAG?{TAG:1,_0:c.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:g(n._0,o._0,t,e),[Symbol.for("name")]:"Ok"}}),void 0)],["List.filter([1,4,5], {|x| x>3})"],void 0,void 0,void 0,void 0)];t.nameSpace=l,t.requiresNamespace=!0,t.Internals=h,t.library=y},36039:(r,t,e)=>{"use strict";var n=e(35706),o=[n.Make.f2f("sqrt",(function(r){return Math.pow(r,.5)}),"Math",!0,void 0,void 0),n.Make.f2f("sin",(function(r){return Math.sin(r)}),"Math",!0,void 0,void 0),n.Make.f2f("cos",(function(r){return Math.cos(r)}),"Math",!0,void 0,void 0),n.Make.f2f("tan",(function(r){return Math.tan(r)}),"Math",!0,void 0,void 0),n.Make.f2f("asin",(function(r){return Math.asin(r)}),"Math",!0,void 0,void 0),n.Make.f2f("acos",(function(r){return Math.acos(r)}),"Math",!0,void 0,void 0),n.Make.f2f("atan",(function(r){return Math.atan(r)}),"Math",!0,void 0,void 0)];t.library=o},36244:(r,t,e)=>{"use strict";var n=e(10456),o=e(62751),i=e(21374),a=e(65416),u=e(35706),s="Number";function f(r,t){return a.FnDefinition.make(r,[{TAG:2,_0:0,[Symbol.for("name")]:"FRTypeArray"}],(function(r,e,a){return i.errMap(i.bind(i.bind(n._1(u.Prepare.ToTypedArray.numbers,r),(function(r){return 0===o.length(r)?{TAG:1,_0:"List is empty",[Symbol.for("name")]:"Error"}:{TAG:0,_0:r,[Symbol.for("name")]:"Ok"}})),t),u.wrapError)}),void 0)}var c={make:f},l=[u.Make.f2f("floor",(function(r){return Math.floor(r)}),s,!1,["floor(3.5)"],void 0),a.$$Function.make("ceiling",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"ceil",(function(r){return Math.ceil(r)}))],["ceil(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("absolute value",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"abs",(function(r){return Math.abs(r)}))],["abs(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("exponent",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"exp",(function(r){return Math.exp(r)}))],["exp(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("log",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"log",(function(r){return Math.log(r)}))],["log(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("log base 10",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"log10",(function(r){return Math.log10(r)}))],["log10(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("log base 2",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"log2",(function(r){return Math.log2(r)}))],["log2(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("round",s,!1,[n._2(u.DefineFn.Numbers.oneToOne,"round",(function(r){return Math.round(r)}))],["round(3.5)"],6,void 0,void 0,void 0),a.$$Function.make("sum",s,!1,[f("sum",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.sum(r)),[Symbol.for("name")]:"Ok"}}))],["sum([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("product",s,!1,[f("product",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.product(r)),[Symbol.for("name")]:"Ok"}}))],["product([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("min",s,!1,[f("min",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.min(r)),[Symbol.for("name")]:"Ok"}}))],["min([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("max",s,!1,[f("max",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.max(r)),[Symbol.for("name")]:"Ok"}}))],["max([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("mean",s,!1,[f("mean",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.mean(r)),[Symbol.for("name")]:"Ok"}}))],["mean([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("geometric mean",s,!1,[f("geomean",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.geomean(r)),[Symbol.for("name")]:"Ok"}}))],["geomean([3,5,2])"],6,void 0,void 0,void 0),a.$$Function.make("standard deviation",s,!1,[f("stdev",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.stdev(r)),[Symbol.for("name")]:"Ok"}}))],["stdev([3,5,2,3,5])"],6,void 0,void 0,void 0),a.$$Function.make("variance",s,!1,[f("variance",(function(r){return{TAG:0,_0:u.Wrappers.evNumber(o.Floats.variance(r)),[Symbol.for("name")]:"Ok"}}))],["variance([3,5,2,3,5])"],6,void 0,void 0,void 0),a.$$Function.make("sort",s,!1,[f("sort",(function(r){return{TAG:0,_0:u.Wrappers.evArray(o.fmap(o.Floats.sort(r),u.Wrappers.evNumber)),[Symbol.for("name")]:"Ok"}}))],["sort([3,5,2,3,5])"],0,void 0,void 0,void 0),a.$$Function.make("cumulative sum",s,!1,[f("cumsum",(function(r){return{TAG:0,_0:u.Wrappers.evArray(o.fmap(o.Floats.cumSum(r),u.Wrappers.evNumber)),[Symbol.for("name")]:"Ok"}}))],["cumsum([3,5,2,3,5])"],0,void 0,void 0,void 0),a.$$Function.make("cumulative prod",s,!1,[f("cumprod",(function(r){return{TAG:0,_0:u.Wrappers.evArray(o.fmap(o.Floats.cumProd(r),u.Wrappers.evNumber)),[Symbol.for("name")]:"Ok"}}))],["cumprod([3,5,2,3,5])"],0,void 0,void 0,void 0),a.$$Function.make("diff",s,!1,[f("diff",(function(r){return{TAG:0,_0:u.Wrappers.evArray(o.fmap(o.Floats.diff(r),u.Wrappers.evNumber)),[Symbol.for("name")]:"Ok"}}))],["diff([3,5,2,3,5])"],0,void 0,void 0,void 0)];t.nameSpace=s,t.requiresNamespace=!1,t.ArrayNumberDist=c,t.library=l},88112:(r,t,e)=>{"use strict";var n=e(10456),o=e(71307),i=e(62751),a=e(21374),u=e(5777),s=e(52017),f=e(37385),c=e(93756),l=e(73539),m=e(96770),p=e(1578),v=e(65416),d=e(35706),_="PointSet";function g(r,t){if(1!==r.length)return u.Message.$$throw(d.impossibleError);var e=r[0];return"number"==typeof e||0!==e.TAG?u.Message.$$throw(d.impossibleError):a.fmap(a.bind({TAG:0,_0:i.fmap(e._0,(function(r){if("number"==typeof r)return u.Message.$$throw(d.impossibleError);if(7!==r.TAG)return u.Message.$$throw(d.impossibleError);var t=r._0,e=o.get(t,"x"),n=o.get(t,"y");return void 0!==e&&"number"!=typeof e&&6===e.TAG&&void 0!==n&&"number"!=typeof n&&6===n.TAG?[e._0,n._0]:u.Message.$$throw(d.impossibleError)})),[Symbol.for("name")]:"Ok"},(function(r){return a.errMap(s.T.makeFromZipped(r),s.$$Error.toString)})),(function(r){return{TAG:4,_0:{TAG:0,_0:n._1(t,r),[Symbol.for("name")]:"PointSet"},[Symbol.for("name")]:"IEvDistribution"}}))}function h(r){return 0===r.TAG?{TAG:0,_0:d.Wrappers.evDistribution({TAG:0,_0:r._0,[Symbol.for("name")]:"PointSet"}),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:9,_0:r._0,[Symbol.for("name")]:"REOperationError"},[Symbol.for("name")]:"Error"}}function y(r,t,e,n){var o=p.doLambdaCall(r,t,e,n);return"number"==typeof o||6!==o.TAG?{TAG:1,_0:4,[Symbol.for("name")]:"Error"}:{TAG:0,_0:o._0,[Symbol.for("name")]:"Ok"}}function b(r,t,e,o){return h(n._4(m.T.mapYResult,void 0,void 0,r,(function(r){return y(t,[{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"}],e,o)})))}var A={toType:h,doLambdaCall:y,mapY:b},S=[v.$$Function.make("fromDist",_,!0,[v.FnDefinition.make("fromDist",[6],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||4!==n.TAG?{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"}:a.errMap(a.fmap(a.fmap(l.toPointSet(n._0,t.environment.xyPointLength,t.environment.sampleCount,void 0,void 0),d.Wrappers.pointSet),d.Wrappers.evDistribution),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"REDistributionError"}}))}),void 0)],["PointSet.fromDist(normal(5,2))"],4,void 0,void 0,void 0),v.$$Function.make("mapY",_,!0,[v.FnDefinition.make("mapY",[6,7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"};var o=n._0;switch(0|o.TAG){case 0:var i=r[1];return"number"==typeof i||5!==i.TAG?{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"}:b(o._0,i._0,t,e);case 1:case 2:return{TAG:1,_0:d.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["PointSet.mapY(mx(normal(5,2)), {|x| x + 1})"],4,void 0,void 0,void 0),v.$$Function.make("makeContinuous",_,!0,[v.FnDefinition.make("makeContinuous",[{TAG:2,_0:{TAG:0,_0:[["x",2],["y",2]],[Symbol.for("name")]:"FRTypeRecord"},[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){return a.errMap(g(r,(function(r){return{TAG:2,_0:c.make(void 0,void 0,void 0,r),[Symbol.for("name")]:"Continuous"}})),d.wrapError)}),void 0)],["PointSet.makeContinuous([\n {x: 0, y: 0.2},\n {x: 1, y: 0.7},\n {x: 2, y: 0.8},\n {x: 3, y: 0.2}\n ])"],4,void 0,void 0,void 0),v.$$Function.make("makeDiscrete",_,!0,[v.FnDefinition.make("makeDiscrete",[{TAG:2,_0:{TAG:0,_0:[["x",2],["y",2]],[Symbol.for("name")]:"FRTypeRecord"},[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){return a.errMap(g(r,(function(r){return{TAG:1,_0:f.make(void 0,void 0,r),[Symbol.for("name")]:"Discrete"}})),d.wrapError)}),void 0)],["PointSet.makeDiscrete([\n {x: 0, y: 0.2},\n {x: 1, y: 0.7},\n {x: 2, y: 0.8},\n {x: 3, y: 0.2}\n ])"],4,void 0,void 0,void 0)];t.nameSpace=_,t.requiresNamespace=!0,t.inputsToDist=g,t.Internal=A,t.library=S},63953:(r,t,e)=>{"use strict";var n=e(10456),o=e(62751),i=e(21374),a=e(73539),u=e(51618),s=e(1578),f=e(72540),c=e(65416),l=e(35706),m="SampleSet";function p(r,t,e,n){var o=s.doLambdaCall(r,t,e,n);return"number"==typeof o||6!==o.TAG?{TAG:1,_0:4,[Symbol.for("name")]:"Error"}:{TAG:0,_0:o._0,[Symbol.for("name")]:"Ok"}}function v(r){return 0===r.TAG?{TAG:0,_0:l.Wrappers.evDistribution({TAG:1,_0:r._0,[Symbol.for("name")]:"SampleSet"}),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:2,_0:{TAG:0,_0:r._0,[Symbol.for("name")]:"SampleSetError"},[Symbol.for("name")]:"REDistributionError"},[Symbol.for("name")]:"Error"}}function d(r,t,e){var n=t.environment.sampleCount;return o.R.firstErrorOrOpen(o.makeBy(n,(function(n){return p(r,[{TAG:6,_0:n,[Symbol.for("name")]:"IEvNumber"}],t,e)})))}function _(r,t,e,n){return v(u.samplesMap((function(r){return p(t,[{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"}],e,n)}),r))}function g(r,t,e,n,o){return v(u.map2((function(r,t){return p(e,[{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"},{TAG:6,_0:t,[Symbol.for("name")]:"IEvNumber"}],n,o)}),r,t))}function h(r,t,e,n,o,i){return v(u.map3((function(r,t,e){return p(n,[{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"},{TAG:6,_0:t,[Symbol.for("name")]:"IEvNumber"},{TAG:6,_0:e,[Symbol.for("name")]:"IEvNumber"}],o,i)}),r,t,e))}function y(r){return o.O.openIfAllSome(o.fmap(r,(function(r){if("number"!=typeof r&&4===r.TAG){var t=r._0;switch(0|t.TAG){case 1:return t._0;case 0:case 2:return}}})))}function b(r,t,e,n){var i=y(r);return void 0===i?{TAG:1,_0:{TAG:5,_0:"",[Symbol.for("name")]:"REFunctionNotFound"},[Symbol.for("name")]:"Error"}:v(u.mapN((function(r){return p(t,[{TAG:0,_0:o.fmap(r,(function(r){return l.Wrappers.evNumber(r)})),[Symbol.for("name")]:"IEvArray"}],e,n)}),i))}var A={doLambdaCall:p,toType:v,fromFn:d,map1:_,map2:g,map3:h,parseSampleSetArray:y,mapN:b},S=[c.$$Function.make("fromDist",m,!0,[c.FnDefinition.make("fromDist",[6],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];return"number"==typeof n||4!==n.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:i.errMap(i.fmap(i.fmap(a.toSampleSetDist(n._0,t.environment.sampleCount),l.Wrappers.sampleSet),l.Wrappers.evDistribution),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"REDistributionError"}}))}),void 0)],["SampleSet.fromDist(normal(5,2))"],4,void 0,void 0,void 0),c.$$Function.make("fromList",m,!0,[c.FnDefinition.make("fromList",[{TAG:2,_0:0,[Symbol.for("name")]:"FRTypeArray"}],(function(r,t,e){var o=i.bind(n._1(l.Prepare.ToTypedArray.numbers,r),(function(r){return i.errMap(u.make(r),u.$$Error.toString)}));return i.errMap(i.fmap(i.fmap(o,l.Wrappers.sampleSet),l.Wrappers.evDistribution),l.wrapError)}),void 0)],["SampleSet.fromList([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])"],4,void 0,void 0,void 0),c.$$Function.make("toList",m,!0,[c.FnDefinition.make("toList",[6],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var i=n._0;switch(0|i.TAG){case 1:return{TAG:0,_0:l.Wrappers.evArray(o.fmap(i._0,l.Wrappers.evNumber)),[Symbol.for("name")]:"Ok"};case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["SampleSet.toList(SampleSet.fromDist(normal(5,2)))"],0,void 0,void 0,void 0),c.$$Function.make("fromFn",m,!0,[c.FnDefinition.make("fromFn",[7],(function(r,t,e){if(1!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(5!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=d(n._0,t,e);return 0===o.TAG?{TAG:0,_0:l.Wrappers.evDistribution(l.Wrappers.sampleSet(o._0)),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{TAG:9,_0:o._0,[Symbol.for("name")]:"REOperationError"},[Symbol.for("name")]:"Error"}}),void 0)],["SampleSet.fromFn({|| sample(normal(5,2))})"],4,void 0,void 0,void 0),c.$$Function.make("map",m,!0,[c.FnDefinition.make("map",[6,7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=n._0;switch(0|o.TAG){case 1:var i=r[1];return"number"==typeof i||5!==i.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:_(o._0,i._0,t,e);case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["SampleSet.map(SampleSet.fromDist(normal(5,2)), {|x| x + 1})"],4,void 0,void 0,void 0),c.$$Function.make("map2",m,!0,[c.FnDefinition.make("map2",[6,6,7],(function(r,t,e){if(3!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=n._0;switch(0|o.TAG){case 1:var i=r[1];if("number"==typeof i)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==i.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var a=i._0;switch(0|a.TAG){case 1:var u=r[2];return"number"==typeof u||5!==u.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:g(o._0,a._0,u._0,t,e);case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["SampleSet.map2(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), {|x, y| x + y})"],4,void 0,void 0,void 0),c.$$Function.make("map3",m,!0,[c.FnDefinition.make("map3",[6,6,6,7],(function(r,t,e){if(4!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=n._0;switch(0|o.TAG){case 1:var i=r[1];if("number"==typeof i)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==i.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var a=i._0;switch(0|a.TAG){case 1:var u=r[2];if("number"==typeof u)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==u.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var s=u._0;switch(0|s.TAG){case 1:var f=r[3];return"number"==typeof f||5!==f.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:h(o._0,a._0,s._0,f._0,t,e);case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["SampleSet.map3(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), {|x, y, z| max([x,y,z])})"],4,void 0,void 0,void 0),c.$$Function.make("mapN",m,!0,[c.FnDefinition.make("mapN",[{TAG:2,_0:6,[Symbol.for("name")]:"FRTypeArray"},7],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(0!==n.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||5!==o.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:b(n._0,o._0,t,e)}),void 0)],["SampleSet.mapN([SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2))], {|x| max(x)})"],4,void 0,void 0,void 0)];function T(r,t,e){return c.FnDefinition.make(r,t,(function(r,t,o){return n._1(e,r)}),void 0)}function E(r){return i.errMap(i.fmap(r,(function(r){return l.Wrappers.evDistribution(l.Wrappers.sampleSet(r))})),(function(r){return{TAG:2,_0:f.$$Error.sampleErrorToDistErr(r),[Symbol.for("name")]:"REDistributionError"}}))}function x(r,t,e){return c.$$Function.make(r,m,!1,[T(r,[6,6],(function(r){if(2!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var e=r[0];if("number"==typeof e)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==e.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=e._0;switch(0|o.TAG){case 1:var i=r[1];if("number"==typeof i)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==i.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var a=i._0;switch(0|a.TAG){case 1:return E(n._2(t,o._0,a._0));case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}})),T(r,[6,0],(function(r){if(2!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==t.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=t._0;switch(0|o.TAG){case 1:var i=r[1];return"number"==typeof i||6!==i.TAG?{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}:E(n._2(e,o._0,i._0));case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}})),T(r,[0,6],(function(r){if(2!==r.length)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(6!==t.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];if("number"==typeof o)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};if(4!==o.TAG)return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"};var i=o._0;switch(0|i.TAG){case 1:return E(n._2(e,i._0,t._0));case 0:case 2:return{TAG:1,_0:l.impossibleError,[Symbol.for("name")]:"Error"}}}))],["SampleSet."+r+"(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(6,2)))","SampleSet."+r+"(SampleSet.fromDist(normal(5,2)), 3.0)","SampleSet."+r+"(4.0, SampleSet.fromDist(normal(6,2)))"],4,void 0,void 0,void 0)}var G=[x("min",u.minOfTwo,u.minOfFloat),x("max",u.maxOfTwo,u.maxOfFloat)],w={template:T,wrapper:E,mkBig:x,library:G},D=o.concat(S,G);t.nameSpace=m,t.requiresNamespace=!0,t.Internal=A,t.libaryBase=S,t.Comparison=w,t.library=D},28299:(r,t,e)=>{"use strict";var n=e(10456),o=e(21374),i=e(73539),a=e(65416),u=e(35706),s="Dist";function f(r,t,e,n){return o.errMap(o.fmap(i.Score.logScore(r,t,e,n),u.Wrappers.evNumber),(function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"REDistributionError"}}))}var c=[a.$$Function.make("logScore",s,!0,[a.FnDefinition.make("logScore",[{TAG:0,_0:[["estimate",6],["answer",5],["prior",6]],[Symbol.for("name")]:"FRTypeRecord"}],(function(r,t,e){var o=n._2(u.Prepare.ToValueArray.Record.threeArgs,r,["estimate","answer","prior"]);if(0!==o.TAG)return{TAG:1,_0:u.wrapError(o._0),[Symbol.for("name")]:"Error"};var i=o._0;if(3!==i.length)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var a=i[0];if("number"==typeof a)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};if(4!==a.TAG)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var s=a._0,c=i[1];if("number"==typeof c)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};switch(0|c.TAG){case 4:var l=i[2];return"number"==typeof l||4!==l.TAG?{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"}:f(s,{TAG:0,_0:c._0,[Symbol.for("name")]:"Score_Dist"},l._0,t.environment);case 6:var m=i[2];return"number"==typeof m||4!==m.TAG?{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"}:f(s,{TAG:1,_0:c._0,[Symbol.for("name")]:"Score_Scalar"},m._0,t.environment);default:return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0),a.FnDefinition.make("logScore",[{TAG:0,_0:[["estimate",6],["answer",5]],[Symbol.for("name")]:"FRTypeRecord"}],(function(r,t,e){var o=n._2(u.Prepare.ToValueArray.Record.twoArgs,r,["estimate","answer"]);if(0!==o.TAG)return{TAG:1,_0:u.wrapError(o._0),[Symbol.for("name")]:"Error"};var i=o._0;if(2!==i.length)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var a=i[0];if("number"==typeof a)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};if(4!==a.TAG)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var s=a._0,c=i[1];if("number"==typeof c)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};switch(0|c.TAG){case 4:return f(s,{TAG:0,_0:c._0,[Symbol.for("name")]:"Score_Dist"},void 0,t.environment);case 6:return f(s,{TAG:1,_0:c._0,[Symbol.for("name")]:"Score_Scalar"},void 0,t.environment);default:return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"}}}),void 0)],["Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1), prior: normal(5.5,3)})","Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)})","Dist.logScore({estimate: normal(5,2), answer: 4.5})"],6,void 0,void 0,void 0),a.$$Function.make("klDivergence",s,!0,[a.FnDefinition.make("klDivergence",[6,6],(function(r,t,e){if(2!==r.length)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var n=r[0];if("number"==typeof n)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};if(4!==n.TAG)return{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"};var o=r[1];return"number"==typeof o||4!==o.TAG?{TAG:1,_0:u.impossibleError,[Symbol.for("name")]:"Error"}:f(n._0,{TAG:0,_0:o._0,[Symbol.for("name")]:"Score_Dist"},void 0,t.environment)}),void 0)],["Dist.klDivergence(normal(5,2), normal(5,1.5))"],6,void 0,void 0,void 0)];t.nameSpace=s,t.requiresNamespace=!0,t.runScoring=f,t.library=c},20449:(r,t,e)=>{"use strict";var n=e(65416),o=e(35706);function i(r,t){return n.$$Function.make("fromUnit_"+r,"",!1,[n.FnDefinition.make("fromUnit_"+r,[0],(function(r,e,n){if(1!==r.length)return{TAG:1,_0:o.impossibleError,[Symbol.for("name")]:"Error"};var i=r[0];return"number"==typeof i||6!==i.TAG?{TAG:1,_0:o.impossibleError,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:i._0*t,[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)],void 0,void 0,void 0,void 0,void 0)}var a=[i("n",1e-9),i("m",.001),i("k",1e3),i("M",1e6),i("B",1e9),i("G",1e9),i("T",1e12),i("P",1e15)];t.makeUnitFn=i,t.library=a},75591:(r,t,e)=>{"use strict";var n=e(24176),o=e(73539),i=e(92162),a=e(52340),u=n.distributionTag.PointSet,s=n.distributionTag.SampleSet,f=n.distributionTag.Symbolic,c=a.Constructors.mean,l=a.Constructors.stdev,m=a.Constructors.variance,p=a.Constructors.sample,v=a.Constructors.cdf,d=a.Constructors.inv,_=a.Constructors.pdf,g=a.Constructors.normalize,h=o.toString,y=i.defaultEnvironment;t.defaultEnvironment=y,t.dtPointSet_=u,t.dtSampleSet_=s,t.dtSymbolic_=f,t.getTag=function(r){switch(0|r.TAG){case 0:return u;case 1:return s;case 2:return f}},t.getPointSet=function(r){switch(0|r.TAG){case 0:return r._0;case 1:case 2:return}},t.getSampleSet=function(r){switch(0|r.TAG){case 1:return r._0;case 0:case 2:return}},t.getSymbolic=function(r){switch(0|r.TAG){case 0:case 1:return;case 2:return r._0}},t.mean=c,t.stdev=l,t.variance=m,t.sample=p,t.cdf=v,t.inv=d,t.pdf=_,t.normalize=g,t.toPointSet=function(r,t){return o.toPointSet(r,t.xyPointLength,t.sampleCount,void 0,void 0)},t.toString=h},57399:(r,t,e)=>{"use strict";var n=e(72540);t.toString=function(r){return n.$$Error.toString(r)}},28765:(r,t,e)=>{"use strict";var n=e(85189),o=n.pointSetDistributionTag.Mixed,i=n.pointSetDistributionTag.Discrete,a=n.pointSetDistributionTag.Continuous;t.pstMixed_=o,t.pstDiscrete_=i,t.pstContinuous_=a,t.getTag=function(r){switch(0|r.TAG){case 0:return o;case 1:return i;case 2:return a}},t.getMixed=function(r){switch(0|r.TAG){case 0:return r._0;case 1:case 2:return}},t.getDiscrete=function(r){switch(0|r.TAG){case 1:return r._0;case 0:case 2:return}},t.getContinues=function(r){switch(0|r.TAG){case 0:case 1:return;case 2:return r._0}},t.toDistribution=function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"}}},91835:(r,t,e)=>{"use strict";var n=e(51489),o=e(86119),i=n.getSourceIds,a=n.setSource,u=n.removeSource,s=n.getSource,f=n.touchSource,c=n.clean,l=n.cleanAll,m=n.cleanResults,p=n.cleanAllResults,v=n.getIncludes,d=n.getPastChain,_=n.getContinues,g=n.setContinues,h=n.getDependencies,y=n.getDependents,b=n.getRunOrder,A=n.getRunOrderFor,S=n.parseIncludes,T=n.rawParse,E=n.run,x=n.runAll,G=n.getResult,w=n.evaluate,D=n.setEnvironment,k=n.getEnvironment;t.T=void 0,t.Private=void 0,t.createProject=function(r){return n.createProject(void 0)},t.getSourceIds=i,t.setSource=a,t.removeSource=u,t.getSource=s,t.touchSource=f,t.clean=c,t.cleanAll=l,t.cleanResults=m,t.cleanAllResults=p,t.getIncludes=v,t.getPastChain=d,t.getContinues=_,t.setContinues=g,t.getDependencies=h,t.getDependents=y,t.getRunOrder=b,t.getRunOrderFor=A,t.parseIncludes=S,t.rawParse=T,t.run=E,t.runAll=x,t.getBindings=function(r,t){return o.toMap(n.getBindings(r,t))},t.getResult=G,t.evaluate=w,t.setEnvironment=D,t.getEnvironment=k},31989:(r,t,e)=>{"use strict";var n=e(7643),o=e(91638),i=n.squiggleValueTag.Array,a=n.squiggleValueTag.Bool,u=n.squiggleValueTag.Date,s=n.squiggleValueTag.Declaration,f=n.squiggleValueTag.Distribution,c=n.squiggleValueTag.Lambda,l=n.squiggleValueTag.Number,m=n.squiggleValueTag.Record,p=n.squiggleValueTag.String,v=n.squiggleValueTag.TimeDuration,d=n.squiggleValueTag.Void,_=o.toString,g=o.toStringResult;t.svtArray_=i,t.svtBool_=a,t.svtDate_=u,t.svtDeclaration_=s,t.svtDistribution_=f,t.svtLambda_=c,t.svtNumber_=l,t.svtRecord_=m,t.svtString_=p,t.svtTimeDuration_=v,t.svtVoid_=d,t.getTag=function(r){if("number"==typeof r)return d;switch(0|r.TAG){case 0:return i;case 1:return a;case 2:return u;case 3:return s;case 4:return f;case 5:return c;case 6:return l;case 7:return m;case 8:return p;case 9:return v}},t.toString=_,t.toStringResult=g,t.getArray=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(0===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getBool=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(1===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getDate=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(2===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getDeclaration=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(3===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getDistribution=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(4===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getLambda=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(5===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getNumber=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(6===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getRecord=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(7===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getString=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(8===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}},t.getTimeDuration=function(r){if("number"==typeof r)throw{RE_EXN_ID:"Not_found",Error:new Error};if(9===r.TAG)return r._0;throw{RE_EXN_ID:"Not_found",Error:new Error}}},65040:(r,t,e)=>{"use strict";var n=e(91638),o=n.arrayToValueArray,i=n.toStringArray;t.getValues=o,t.toString=i},83801:(r,t,e)=>{"use strict";var n=e(91638),o=e(1578),i=n.toStringLambda,a=o.parameters;t.toString=i,t.parameters=a},33674:(r,t,e)=>{"use strict";var n=e(91638),o=n.recordToKeyValuePairs,i=n.toStringMap;t.getKeyValuePairs=o,t.toString=i,t.toSquiggleValue=function(r){return{TAG:7,_0:r,[Symbol.for("name")]:"IEvRecord"}}},65416:(r,t,e)=>{"use strict";var n=e(10456),o=e(71307),i=e(62751),a=e(17646);function u(r){if("number"==typeof r)switch(r){case 0:return"number";case 1:return"bool";case 2:return"numeric";case 3:return"date";case 4:return"duration";case 5:return"distribution|number";case 6:return"distribution";case 7:return"lambda";case 8:return"string";case 9:return"any"}else switch(0|r.TAG){case 0:return"{"+i.joinWith(i.fmap(r._0,(function(r){return r[0]+": "+u(r[1])})),", ")+"}";case 1:return"dict("+u(r._0)+")";case 2:return"list("+u(r._0)+")";case 3:return"variant"}}function s(r,t){if("number"==typeof r)switch(r){case 0:return"number"!=typeof t&&6===t.TAG;case 1:return"number"!=typeof t&&1===t.TAG;case 2:if("number"==typeof t)return!1;switch(0|t.TAG){case 4:var e=t._0;switch(0|e.TAG){case 0:case 1:return!1;case 2:var n=e._0;return"object"==typeof n&&"Float"===n.NAME}case 6:return!0;default:return!1}case 3:return"number"!=typeof t&&2===t.TAG;case 4:return"number"!=typeof t&&9===t.TAG;case 5:if("number"==typeof t)return!1;switch(0|t.TAG){case 4:case 6:return!0;default:return!1}case 6:return"number"!=typeof t&&4===t.TAG;case 7:return"number"!=typeof t&&5===t.TAG;case 8:return"number"!=typeof t&&8===t.TAG;case 9:return!0}else switch(0|r.TAG){case 0:if("number"==typeof t)return!1;if(7!==t.TAG)return!1;var a=t._0;return i.every(r._0,(function(r){var t=o.get(a,r[0]);return void 0!==t&&s(r[1],t)}));case 1:if("number"==typeof t)return!1;if(7!==t.TAG)return!1;var u=r._0;return i.every(o.valuesToArray(t._0),(function(r){return s(u,r)}));case 2:if("number"==typeof t)return!1;if(0!==t.TAG)return!1;var f=r._0;return i.every(t._0,(function(r){return s(f,r)}));case 3:return!1}}function f(r,t){return!(i.length(r)!==i.length(t))&&i.every(i.zip(r,t),(function(r){return s(r[0],r[1])}))}var c={toString:u,matchWithValue:s,matchWithValueArray:f};function l(r){var t=i.joinWith(i.fmap(r.inputs,u),", ");return r.name+"("+t+")"}function m(r,t,e,o){return f(r.inputs,t)?n._3(r.run,t,e,o):{TAG:1,_0:{TAG:15,_0:"Incorrect Types",[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"}}var p={toString:l,isMatch:function(r,t){return f(r.inputs,t)},run:m,make:function(r,t,e,n){return{name:r,inputs:t,run:e}}};function v(r){return{name:r.name,definitions:i.fmap(r.definitions,l),examples:r.examples,description:r.description,isExperimental:r.isExperimental}}var d={make:function(r,t,e,n,o,i,u,s,f){var c=void 0!==s&&s;return{name:r,definitions:n,requiresNamespace:e,nameSpace:t,output:i,examples:a.$$default(o,[]),description:u,isExperimental:c}},toJson:v};function _(r){return i.reduce(r,void 0,(function(r,t){return i.reduce(t.definitions,r,(function(r,e){var n=i.concatMany([""===t.nameSpace?[]:[t.nameSpace+"."+e.name],t.requiresNamespace?[]:[e.name]]);return i.reduce(n,r,(function(r,t){var n=o.get(r,t);return void 0!==n?(n.push(e),r):o.set(r,t,[e])}))}))}))}var g={toJson:function(r){return i.fmap(r.functions,v)},allExamples:function(r){return i.concatMany(i.fmap(r.functions,(function(r){return r.examples})))},allExamplesWithFns:function(r){return i.concatMany(i.fmap(r.functions,(function(r){return i.fmap(r.examples,(function(t){return[r,t]}))})))},allNames:function(r){return o.keysToArray(r.fnNameDict)},_buildFnNameDict:_,make:function(r){return{functions:r,fnNameDict:_(r)}},call:function(r,t,e,n,a){var u=o.get(r.fnNameDict,t);if(void 0===u)return{TAG:1,_0:{TAG:11,_0:t,[Symbol.for("name")]:"RESymbolNotFound"},[Symbol.for("name")]:"Error"};var s,c=u.find((function(r){return f(r.inputs,e)}));return void 0!==c?m(c,e,n,a):{TAG:1,_0:{TAG:15,_0:(s=i.joinWith(i.fmap(i.fmap(u,l),(function(r){return"["+r+"]"})),"; "),"There are function matches for "+t+"(), but with different arguments: "+s),[Symbol.for("name")]:"REOther"},[Symbol.for("name")]:"Error"}}};t.FRType=c,t.FnDefinition=p,t.$$Function=d,t.Registry=g},35706:(r,t,e)=>{"use strict";var n=e(10456),o=e(71307),i=e(62751),a=e(17646),u=e(21374),s=e(73539),f=e(51618),c=e(72540),l=e(65416),m="Wrong inputs / Logically impossible",p={TAG:15,_0:m,[Symbol.for("name")]:"REOther"};function v(r){return{TAG:2,_0:r,[Symbol.for("name")]:"Symbolic"}}function d(r){return{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"}}var _={symbolic:v,pointSet:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"PointSet"}},sampleSet:function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"SampleSet"}},evDistribution:function(r){return{TAG:4,_0:r,[Symbol.for("name")]:"IEvDistribution"}},evNumber:d,evArray:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"IEvArray"}},evRecord:function(r){return{TAG:7,_0:r,[Symbol.for("name")]:"IEvRecord"}},evString:function(r){return{TAG:8,_0:r,[Symbol.for("name")]:"IEvString"}},symbolicEvDistribution:function(r){return{TAG:4,_0:{TAG:2,_0:r,[Symbol.for("name")]:"Symbolic"},[Symbol.for("name")]:"IEvDistribution"}},evArrayOfEvNumber:function(r){return{TAG:0,_0:i.fmap(r,d),[Symbol.for("name")]:"IEvArray"}}};function g(r,t){return a.toResult(i.get(r,t),m)}function h(r,t){if(1!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var e=r[0];if("number"==typeof e)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(7!==e.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var n=e._0;return{TAG:0,_0:[o.getExn(n,t[0]),o.getExn(n,t[1])],[Symbol.for("name")]:"Ok"}}function y(r){return"number"==typeof r||0!==r.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}}function b(r){if(2!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};switch(0|t.TAG){case 4:var e=t._0,n=r[1];if("number"==typeof n)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};switch(0|n.TAG){case 4:return{TAG:0,_0:[{TAG:1,_0:e,[Symbol.for("name")]:"FRValueDist"},{TAG:1,_0:n._0,[Symbol.for("name")]:"FRValueDist"}],[Symbol.for("name")]:"Ok"};case 6:return{TAG:0,_0:[{TAG:1,_0:e,[Symbol.for("name")]:"FRValueDist"},{TAG:0,_0:n._0,[Symbol.for("name")]:"FRValueNumber"}],[Symbol.for("name")]:"Ok"};default:return{TAG:1,_0:m,[Symbol.for("name")]:"Error"}}case 6:var o=t._0,i=r[1];if("number"==typeof i)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};switch(0|i.TAG){case 4:return{TAG:0,_0:[{TAG:0,_0:o,[Symbol.for("name")]:"FRValueNumber"},{TAG:1,_0:i._0,[Symbol.for("name")]:"FRValueDist"}],[Symbol.for("name")]:"Ok"};case 6:return{TAG:0,_0:[{TAG:0,_0:o,[Symbol.for("name")]:"FRValueNumber"},{TAG:0,_0:i._0,[Symbol.for("name")]:"FRValueNumber"}],[Symbol.for("name")]:"Ok"};default:return{TAG:1,_0:m,[Symbol.for("name")]:"Error"}}default:return{TAG:1,_0:m,[Symbol.for("name")]:"Error"}}}function A(r){if(2!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(4!==t.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||4!==e.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:[t._0,e._0],[Symbol.for("name")]:"Ok"}}function S(r){return"number"==typeof r||6!==r.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}}function T(r){return"number"==typeof r||7!==r.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}}var E={ToValueArray:{Record:{twoArgs:h,threeArgs:function(r,t){if(1!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var e=r[0];if("number"==typeof e)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(7!==e.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var n=e._0;return{TAG:0,_0:[o.getExn(n,t[0]),o.getExn(n,t[1]),o.getExn(n,t[2])],[Symbol.for("name")]:"Ok"}}},$$Array:{openA:y,arrayOfArrays:function(r){return"number"==typeof r||0!==r.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:i.R.firstErrorOrOpen(i.fmap(r._0,y))}}},ToValueTuple:{twoDistOrNumber:b,twoDist:A,twoNumbers:function(r){if(2!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(6!==t.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var e=r[1];return"number"==typeof e||6!==e.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:[t._0,e._0],[Symbol.for("name")]:"Ok"}},threeNumbers:function(r){if(3!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(6!==t.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var e=r[1];if("number"==typeof e)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};if(6!==e.TAG)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var n=r[2];return"number"==typeof n||6!==n.TAG?{TAG:1,_0:m,[Symbol.for("name")]:"Error"}:{TAG:0,_0:[t._0,e._0,n._0],[Symbol.for("name")]:"Ok"}},oneDistOrNumber:function(r){if(1!==r.length)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};var t=r[0];if("number"==typeof t)return{TAG:1,_0:m,[Symbol.for("name")]:"Error"};switch(0|t.TAG){case 4:return{TAG:0,_0:{TAG:1,_0:t._0,[Symbol.for("name")]:"FRValueDist"},[Symbol.for("name")]:"Ok"};case 6:return{TAG:0,_0:{TAG:0,_0:t._0,[Symbol.for("name")]:"FRValueNumber"},[Symbol.for("name")]:"Ok"};default:return{TAG:1,_0:m,[Symbol.for("name")]:"Error"}}},Record:{twoDistOrNumber:function(r,t){return u.bind(h(r,t),b)},twoDist:function(r,t){return u.bind(h(r,t),A)}}},oneNumber:S,oneDict:T,ToTypedArray:{numbers:function(r){return u.bind(u.bind(g(r,0),y),(function(r){return i.R.firstErrorOrOpen(i.fmap(r,S))}))},dicts:function(r){return u.bind(u.bind(g(r,0),y),(function(r){return i.R.firstErrorOrOpen(i.fmap(r,T))}))}}};function x(r){return 0===r.TAG?{TAG:0,_0:s.sample(r._0),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:{_0:r._0,[Symbol.for("name")]:"Other"},[Symbol.for("name")]:"Error"}}function G(r,t,e){var o=s.toSampleSetDist(r,e.sampleCount);if(0!==o.TAG)return{TAG:1,_0:c.$$Error.toString(o._0),[Symbol.for("name")]:"Error"};var i=f.samplesMap((function(r){return x(n._1(t,r))}),o._0);return 0===i.TAG?{TAG:0,_0:{TAG:1,_0:i._0,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:c.$$Error.toString({TAG:0,_0:i._0,[Symbol.for("name")]:"SampleSetError"}),[Symbol.for("name")]:"Error"}}function w(r,t,e,o){var i=u.merge(s.toSampleSetDist(r,o.sampleCount),s.toSampleSetDist(t,o.sampleCount));if(0!==i.TAG)return{TAG:1,_0:c.$$Error.toString(i._0),[Symbol.for("name")]:"Error"};var a=i._0,l=f.map2((function(r,t){return x(n._1(e,[r,t]))}),a[0],a[1]);return 0===l.TAG?{TAG:0,_0:{TAG:1,_0:l._0,[Symbol.for("name")]:"SampleSet"},[Symbol.for("name")]:"Ok"}:{TAG:1,_0:f.$$Error.toString(l._0),[Symbol.for("name")]:"Error"}}function D(r,t,e){return 0===t.TAG?n._1(r,t._0):G(t._0,n.__1(r),e)}function k(r,t,e){var o=t[0];if(0===o.TAG){var i=t[1],a=o._0;return 0===i.TAG?n._1(r,[a,i._0]):G(i._0,(function(t){return n._1(r,[a,t])}),e)}var u=t[1],s=o._0;if(0!==u.TAG)return w(s,u._0,r,e);var f=u._0;return G(s,(function(t){return n._1(r,[t,f])}),e)}var O={DistOrNumberToDist:{Helpers:{toSampleSet:function(r,t){return s.toSampleSetDist(r,t.sampleCount)},mapFnResult:x,wrapSymbolic:function(r,t){return u.fmap(n._1(r,t),v)},singleVarSample:G,twoVarSample:w},oneValue:D,oneValueUsingSymbolicDist:function(r,t){return function(e){return D((function(t){return u.fmap(n._1(r,t),v)}),t,e)}},twoValues:k,twoValuesUsingSymbolicDist:function(r,t){return function(e){return k((function(t){return u.fmap(n._1(r,t),v)}),t,e)}}}},M={Numbers:{oneToOne:function(r,t){return l.FnDefinition.make(r,[0],(function(r,e,o){if(1!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];return"number"==typeof i||6!==i.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._1(t,i._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)},twoToOne:function(r,t){return l.FnDefinition.make(r,[0,0],(function(r,e,o){if(2!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];if("number"==typeof i)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var a=r[1];return"number"==typeof a||6!==a.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._2(t,i._0,a._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)},threeToOne:function(r,t){return l.FnDefinition.make(r,[0,0,0],(function(r,e,o){if(3!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];if("number"==typeof i)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var a=r[1];if("number"==typeof a)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(6!==a.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var u=r[2];return"number"==typeof u||6!==u.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._3(t,i._0,a._0,u._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)}}},F={f2f:function(r,t,e,o,i,u){var s=void 0!==e?e:"",f=void 0!==o&&o;return l.$$Function.make(r,s,f,[l.FnDefinition.make(r,[0],(function(r,e,o){if(1!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];return"number"==typeof i||6!==i.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._1(t,i._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)],a.$$default(i,[]),6,void 0,void 0,void 0)},ff2f:function(r,t,e,o,i,u){var s=void 0!==e?e:"",f=void 0!==o&&o;return l.$$Function.make(r,s,f,[l.FnDefinition.make(r,[0,0],(function(r,e,o){if(2!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];if("number"==typeof i)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var a=r[1];return"number"==typeof a||6!==a.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:6,_0:n._2(t,i._0,a._0),[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"Ok"}}),void 0)],a.$$default(i,[]),6,void 0,void 0,void 0)},ff2b:function(r,t,e,o,i,u){var s=void 0!==e?e:"",f=void 0!==o&&o;return l.$$Function.make(r,s,f,[l.FnDefinition.make(r,[0,0],(function(r,e,o){if(2!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];if("number"==typeof i)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(6!==i.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var a=r[1];return"number"==typeof a||6!==a.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:1,_0:n._2(t,i._0,a._0),[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"Ok"}}),void 0)],a.$$default(i,[]),1,void 0,void 0,void 0)},bb2b:function(r,t,e,o,i,u){var s=void 0!==e?e:"",f=void 0!==o&&o;return l.$$Function.make(r,s,f,[l.FnDefinition.make(r,[1,1],(function(r,e,o){if(2!==r.length)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var i=r[0];if("number"==typeof i)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};if(1!==i.TAG)return{TAG:1,_0:p,[Symbol.for("name")]:"Error"};var a=r[1];return"number"==typeof a||1!==a.TAG?{TAG:1,_0:p,[Symbol.for("name")]:"Error"}:{TAG:0,_0:{TAG:1,_0:n._2(t,i._0,a._0),[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"Ok"}}),void 0)],a.$$default(i,[]),1,void 0,void 0,void 0)}};t.impossibleErrorString=m,t.impossibleError=p,t.wrapError=function(r){return{TAG:15,_0:r,[Symbol.for("name")]:"REOther"}},t.Wrappers=_,t.getOrError=g,t.Prepare=E,t.Process=O,t.DefineFn=M,t.Make=F},51324:(r,t,e)=>{"use strict";var n=e(62751),o=e(94677),i=e(15264),a=e(2889),u=e(45725),s=e(81982),f=e(36039),c=e(20449),l=e(95792),m=e(36244),p=e(2572),v=e(28299),d=e(88112),_=e(63953),g=e(5372),h=e(65416),y=n.concatMany([p.library,a.library,u.library,l.library,o.library,_.library,s.library,m.library,d.library,v.library,g.library,c.library,i.library,f.library]),b=h.Registry.make(y),A=[["mx",g.mxLambda],["mixture",g.mxLambda]];t.fnList=y,t.registry=b,t.call=function(r,t,e,n){return h.Registry.call(b,r,t,e,n)},t.nonRegistryLambdas=A},85659:(r,t,e)=>{"use strict";var n=e(51958),o=e(62751),i={e:Math.E,pi:Math.PI},a={minDiscreteToKeep:function(r){return n.int_max(20,o.length(r)/50|0)}};t.$$Math=i,t.Epsilon={ten:1e-10,seven:1e-7,five:1e-5},t.Environment={defaultXYPointLength:1e3,defaultSampleCount:1e4,sparklineLength:20},t.OpCost={floatCost:1,symbolicCost:1e3,mixedCost:1e3,continuousCost:1e3,wildcardCost:1e3,monteCarloCost:1e4},t.ToPointSet=a},37151:(r,t,e)=>{"use strict";var n=e(71307),o=e(86119);t.get=function(r,t){for(;;){var e=r,n=e.parent,i=o.get(e.namespace,t);if(void 0!==i)return i;if(void 0===n)return;r=n}},t.set=function(r,t,e){return{namespace:o.set(r.namespace,t,e),parent:r.parent}},t.toString=function r(t){var e=t.parent,n=o.toString(t.namespace);return void 0!==e?"{"+n+"} / "+r(e):"{"+n+"}"},t.extend=function(r){return{namespace:o.make(void 0),parent:r}},t.make=function(r){return{namespace:o.make(void 0),parent:void 0}},t.removeResult=function(r){return{namespace:n.remove(r.namespace,"__result__"),parent:r.parent}},t.locals=function(r){return r.namespace},t.fromNamespace=function(r){return{namespace:r,parent:void 0}}},92162:(r,t,e)=>{"use strict";var n=e(17646),o=e(11844),i=e(37151),a=e(6023),u=e(52340).defaultEnv;t.defaultEnvironment=u,t.createContext=function(r,t){return{bindings:i.extend(i.fromNamespace(r)),environment:t,frameStack:0,inFunction:void 0}},t.currentFunctionName=function(r){return n.$$default(n.fmap(r.inFunction,a.name),o.topFrameName)}},10277:(r,t,e)=>{"use strict";var n=e(17978),o=e(71307),i=e(20114),a=e(62751),u=e(21374),s=e(5777),f=e(91638),c=e(1578),l=e(92162),m=e(37151),p=e(68034),v=e(42687),d=e(26459),_=e(66231);function g(r,t,e){return s.throwMessageWithFrameStack(r,p.extend(e.frameStack,l.currentFunctionName(e),t.ast.location))}function h(r,t){for(;;){var e=r,n=e.content;switch(0|n.TAG){case 0:var i={bindings:m.extend(t.bindings),environment:t.environment,frameStack:t.frameStack,inFunction:t.inFunction};return[a.reduce(n._0,[0,i],(function(r,t){return h(t,r[1])}))[0],t];case 1:var u=a.reduce(n._0,[0,t],(function(r,t){return h(t,r[1])}));return[u[0],u[1]];case 2:return[{TAG:0,_0:a.fmap(n._0,(function(r){return h(r,t)[0]})),[Symbol.for("name")]:"IEvArray"},t];case 3:var s={TAG:7,_0:o.fromArray(a.fmap(n._0,function(r){return function(e){var n=h(e[0],t)[0];return["number"==typeof n||8!==n.TAG?g({TAG:15,_0:"Record keys must be strings",[Symbol.for("name")]:"REOther"},r,t):n._0,h(e[1],t)[0]]}}(e))),[Symbol.for("name")]:"IEvRecord"};return[s,t];case 4:var l=n._0,p=m.get(t.bindings,l);return void 0!==p?[p,t]:g({TAG:11,_0:l,[Symbol.for("name")]:"RESymbolNotFound"},e,t);case 5:var v=h(n._0,t)[0];if("number"==typeof v)return g({TAG:3,_0:"Boolean",_1:"",[Symbol.for("name")]:"REExpectedType"},e,t);if(1!==v.TAG)return g({TAG:3,_0:"Boolean",_1:"",[Symbol.for("name")]:"REExpectedType"},e,t);r=v._0?n._1:n._2;continue;case 6:var d=h(n._1,t);return[0,{bindings:m.set(t.bindings,n._0,d[0]),environment:t.environment,frameStack:t.frameStack,inFunction:t.inFunction}];case 7:var _=h(n._0,t)[0],y=a.fmap(n._1,(function(r){return h(r,t)[0]}));return"number"==typeof _?g({TAG:8,_0:f.toString(_),[Symbol.for("name")]:"RENotAFunction"},e,t):5!==_.TAG?g({TAG:8,_0:f.toString(_),[Symbol.for("name")]:"RENotAFunction"},e,t):[c.doLambdaCallFrom(_._0,y,t,h,e.ast.location),t];case 8:return[{TAG:5,_0:c.makeLambda(n._2,n._0,t.bindings,n._1,e.ast.location),[Symbol.for("name")]:"IEvLambda"},t];case 9:return[n._0,t]}}}function y(r){return n.map(v.parse(r,"main"),_.fromNode)}function b(r){var t=l.createContext(d.stdLib,l.defaultEnvironment);try{return{TAG:0,_0:h(r,t)[0],[Symbol.for("name")]:"Ok"}}catch(r){var e=i.internalToOCamlException(r);return{TAG:1,_0:s.fromException(e),[Symbol.for("name")]:"Error"}}}var A={parse:y,createDefaultContext:function(r){return l.createContext(d.stdLib,l.defaultEnvironment)},evaluate:b,evaluateString:function(r){return n.flatMap(u.errMap(y(r),s.fromParseError),b)}};t.Bindings=void 0,t.Result=void 0,t.T=void 0,t.toLocation=function(r){return r.ast.location},t.throwFrom=g,t.evaluate=h,t.BackCompatible=A},4464:(r,t)=>{"use strict";var e={TAG:9,_0:0,[Symbol.for("name")]:"EValue"};t.T=void 0,t.eArray=function(r){return{TAG:2,_0:r,[Symbol.for("name")]:"EArray"}},t.eBool=function(r){return{TAG:9,_0:{TAG:1,_0:r,[Symbol.for("name")]:"IEvBool"},[Symbol.for("name")]:"EValue"}},t.eCall=function(r,t){return{TAG:7,_0:r,_1:t,[Symbol.for("name")]:"ECall"}},t.eLambda=function(r,t,e){return{TAG:8,_0:r,_1:t,_2:e,[Symbol.for("name")]:"ELambda"}},t.eNumber=function(r){return{TAG:9,_0:{TAG:6,_0:r,[Symbol.for("name")]:"IEvNumber"},[Symbol.for("name")]:"EValue"}},t.eRecord=function(r){return{TAG:3,_0:r,[Symbol.for("name")]:"ERecord"}},t.eString=function(r){return{TAG:9,_0:{TAG:8,_0:r,[Symbol.for("name")]:"IEvString"},[Symbol.for("name")]:"EValue"}},t.eSymbol=function(r){return{TAG:4,_0:r,[Symbol.for("name")]:"ESymbol"}},t.eBlock=function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"EBlock"}},t.eProgram=function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"EProgram"}},t.eLetStatement=function(r,t){return{TAG:6,_0:r,_1:t,[Symbol.for("name")]:"EAssign"}},t.eTernary=function(r,t,e){return{TAG:5,_0:r,_1:t,_2:e,[Symbol.for("name")]:"ETernary"}},t.eIdentifier=function(r){return{TAG:4,_0:r,[Symbol.for("name")]:"ESymbol"}},t.eVoid=e},71396:(r,t,e)=>{"use strict";var n=e(30776),o=e(7837);t.ExtraList=void 0,t.intersperse=function(r,t){return n.toArray(o.intersperse(n.fromArray(r),t))}},7837:(r,t)=>{"use strict";t.intersperse=function r(t,e){if(!t)return 0;var n=t.tl,o=t.hd;return n?{hd:o,tl:{hd:e,tl:r(n,e)}}:{hd:o,tl:0}}},68034:(r,t,e)=>{"use strict";var n=e(30776),o=e(11844);function i(r){var t=r.location;return r.name+(void 0!==t?" at line "+t.start.line.toString()+", column "+t.start.column.toString():"")}var a={toString:i,getLocation:function(r){return r.location},getName:function(r){return r.name}};function u(r,t,e){return n.add(r,{name:t,location:e})}var s=n.toArray,f=n.head;t.Frame=a,t.make=function(r){return 0},t.extend=u,t.makeSingleFrameStack=function(r){return u(0,o.topFrameName,r)},t.toString=function(r){return n.toArray(n.map(r,(function(r){return" "+i(r)}))).join("\n")},t.toFrameArray=s,t.getTopFrame=f,t.isEmpty=function(r){return void 0!==n.head(r)}},1578:(r,t,e)=>{"use strict";var n=e(10456),o=e(9438),i=e(62751),a=e(5777),u=e(92162),s=e(37151),f=e(68034);function c(r,t,e,o,i){var s=e.bindings,c=e.environment,l=f.extend(e.frameStack,u.currentFunctionName(e),i),m={bindings:s,environment:c,frameStack:l,inFunction:r};return a.rethrowWithFrameStack((function(e){return r.TAG,n._3(r.body,t,m,o)}),l)}t.makeLambda=function(r,t,e,u,f){return{TAG:0,parameters:t,body:function(r,f,c){var l=i.length(r),m=i.length(t);l!==m&&a.Message.$$throw({TAG:0,_0:void 0,_1:m,_2:l,[Symbol.for("name")]:"REArityError"});var p=s.extend(e),v={bindings:i.reducei(t,p,(function(t,e,n){return s.set(t,e,o.get(r,n))})),environment:f.environment,frameStack:f.frameStack,inFunction:f.inFunction};return n._2(c,u,v)[0]},location:f,name:r,[Symbol.for("name")]:"FnLambda"}},t.makeFFILambda=function(r,t){return{TAG:1,body:t,name:r,[Symbol.for("name")]:"FnBuiltin"}},t.parameters=function(r){return 0===r.TAG?r.parameters:["..."]},t.doLambdaCallFrom=c,t.doLambdaCall=function(r,t,e,n){return c(r,t,e,n,void 0)}},6023:(r,t,e)=>{"use strict";var n=e(17646);t.name=function(r){return 0===r.TAG?n.$$default(r.name,"<anonymous>"):r.name}},86119:(r,t,e)=>{"use strict";var n=e(71307),o=e(62751),i=e(91638),a=n.get,u=n.set;function s(r,t){return n.reduce(t,r,n.set)}var f=n.fromArray;t.make=function(r){},t.get=a,t.set=u,t.mergeFrom=s,t.mergeMany=function(r){return o.reduce(r,void 0,s)},t.toString=function(r){return o.fmap(n.toArray(r),(function(r){return r[0]+": "+i.toString(r[1])})).toString()},t.fromArray=f,t.toMap=function(r){return r},t.toRecord=function(r){return{TAG:7,_0:r,[Symbol.for("name")]:"IEvRecord"}}},68154:(r,t,e)=>{"use strict";const n=e(36080);function o(r,t,e,n){var i=Error.call(this,r);return Object.setPrototypeOf&&Object.setPrototypeOf(i,o.prototype),i.expected=t,i.found=e,i.location=n,i.name="SyntaxError",i}function i(r,t,e){return e=e||" ",r.length>t?r:(t-=r.length,r+(e+=e.repeat(t)).slice(0,t))}!function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(o,Error),o.prototype.format=function(r){var t="Error: "+this.message;if(this.location){var e,n=null;for(e=0;e<r.length;e++)if(r[e].source===this.location.source){n=r[e].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,a=this.location.source+":"+o.line+":"+o.column;if(n){var u=this.location.end,s=i("",o.line.toString().length," "),f=n[o.line-1],c=(o.line===u.line?u.column:f.length+1)-o.column||1;t+="\n --\x3e "+a+"\n"+s+" |\n"+o.line+" | "+f+"\n"+s+" | "+i("",o.column-1," ")+i("",c,"^")}else t+="\n at "+a}return t},o.buildMessage=function(r,t){var e={literal:function(r){return'"'+o(r.text)+'"'},class:function(r){var t=r.parts.map((function(r){return Array.isArray(r)?i(r[0])+"-"+i(r[1]):i(r)}));return"["+(r.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function o(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function i(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function a(r){return e[r.type](r)}return"Expected "+function(r){var t,e,n=r.map(a);if(n.sort(),n.length>0){for(t=1,e=1;t<n.length;t++)n[t-1]!==n[t]&&(n[e]=n[t],e++);n.length=e}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(r)+" but "+function(r){return r?'"'+o(r)+'"':"end of input"}(t)+" found."},r.exports={SyntaxError:o,parse:function(r,t){var e,i={},a=(t=void 0!==t?t:{}).grammarSource,u={start:$t},s=$t,f="{",c="}",l="call",m="(",p=")",v=",",d="then",_="else",g=".-",h="->",y="|>",b="[",A=".",S="]",T="true",E="false",x="|",G=/^[_a-z0-9]/i,w=/^[_a-zA-Z]/,D=/^[$_a-z]/,k=/^[$_a-z0-9]/i,O=/^[A-Z]/,M=/^[^']/,F=/^[^"]/,I=/^[e]/i,P=/^[0-9]/,N=/^[a-z]/i,R=/^[_$]/,C=/^[^\r\n]/,L=/^[^*]/,V=/^[ \t]/,j=/^[\n\r]/,$=Nt("{",!1),U=Nt("}",!1),q=Nt("call",!1),B=Nt("(",!1),X=Nt(")",!1),W=Ct("assignment"),z=Nt("=",!1),Y=Nt(",",!1),K=Nt("if",!1),H=Nt("then",!1),Z=Nt("else",!1),J=Nt("?",!1),Q=Nt(":",!1),rr=Ct("operator"),tr=Nt("||",!1),er=Nt("&&",!1),nr=Nt("==",!1),or=Nt("!=",!1),ir=Nt("<=",!1),ar=Nt("<",!1),ur=Nt(">=",!1),sr=Nt(">",!1),fr=Nt("to",!1),cr=Nt("+",!1),lr=Nt("-",!1),mr=Nt(".+",!1),pr=Nt(".-",!1),vr=Nt("*",!1),dr=Nt("/",!1),_r=Nt(".*",!1),gr=Nt("./",!1),hr=Nt("^",!1),yr=Nt(".^",!1),br=Nt("->",!1),Ar=Nt("|>",!1),Sr=Ct("unary operator"),Tr=Nt("!",!1),Er=Nt("[",!1),xr=Nt(".",!1),Gr=Nt("]",!1),wr=Ct("void"),Dr=Nt("()",!1),kr=Ct("identifier"),Or=(Rt(["_",["a","z"]],!1,!1),Rt(["_",["a","z"],["0","9"]],!1,!0)),Mr=Rt(["_",["a","z"],["A","Z"]],!1,!1),Fr=Ct("$identifier"),Ir=Rt(["$","_",["a","z"]],!1,!1),Pr=Rt(["$","_",["a","z"],["0","9"]],!1,!0),Nr=Rt([["A","Z"]],!1,!1),Rr=Ct("string"),Cr=Nt("'",!1),Lr=Rt(["'"],!0,!1),Vr=Nt('"',!1),jr=Rt(['"'],!0,!1),$r=Ct("integer"),Ur=Rt(["e"],!1,!0),qr=Ct("float"),Br=Rt([["0","9"]],!1,!1),Xr=Ct("boolean"),Wr=Nt("true",!1),zr=Nt("false",!1),Yr=Rt([["a","z"]],!1,!0),Kr=Rt(["_","$"],!1,!1),Hr=Nt("|",!1),Zr=Ct("array"),Jr=Ct("record"),Qr=Ct("whitespace"),rt=Ct("whitespace or newline"),tt=Ct("statement separator"),et=Nt(";",!1),nt=Ct("line comment"),ot=Nt("//",!1),it=Nt("#",!1),at=Rt(["\r","\n"],!0,!1),ut=Ct("comment"),st=Nt("/*",!1),ft=Rt(["*"],!0,!1),ct=Nt("*/",!1),lt=Rt([" ","\t"],!1,!1),mt=Ct("newline"),pt=Rt(["\n","\r"],!1,!1),vt=function(r,t,e){return{operator:t,right:e}},dt=function(r,t,e){return{operator:t,right:e}},_t=function(r,t,e){return{operator:t,right:e}},gt=function(r,t,e){return{operator:t,right:e}},ht=function(r,t,e){return{operator:t,right:e}},yt=function(r,t,e){return{operator:t,right:e}},bt=function(r,t){return t},At=function(r,t){return{fn:n.postOperatorToFunction["[]"],args:[t]}},St=function(r,t){return{fn:n.postOperatorToFunction["[]"],args:[n.nodeString(t,Pt())]}},Tt=function(r,t){return{fn:n.postOperatorToFunction["()"],args:t}},Et=function(r,t){return{fn:n.postOperatorToFunction["[]"],args:[t]}},xt=function(r,t){return{fn:n.postOperatorToFunction["[]"],args:[n.nodeString(t,Pt())]}},Gt=0,wt=0,Dt=[{line:1,column:1}],kt=0,Ot=[],Mt=0,Ft={};if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');s=u[t.startRule]}function It(){return r.substring(wt,Gt)}function Pt(){return Vt(wt,Gt)}function Nt(r,t){return{type:"literal",text:r,ignoreCase:t}}function Rt(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function Ct(r){return{type:"other",description:r}}function Lt(t){var e,n=Dt[t];if(n)return n;for(e=t-1;!Dt[e];)e--;for(n={line:(n=Dt[e]).line,column:n.column};e<t;)10===r.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return Dt[t]=n,n}function Vt(r,t){var e=Lt(r),n=Lt(t);return{source:a,start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function jt(r){Gt<kt||(Gt>kt&&(kt=Gt,Ot=[]),Ot.push(r))}function $t(){var r,t,e=76*Gt+0,o=Ft[e];return o?(Gt=o.nextPos,o.result):(r=Gt,De(),t=function(){var r,t,e,o,a,u,s=76*Gt+2,f=Ft[s];return f?(Gt=f.nextPos,f.result):(r=Gt,(t=Xt())!==i?(e=Gt,Me()!==i&&(o=Kt())!==i?e=o:(Gt=e,e=i),e===i&&(e=null),wt=r,a=t,(u=e)&&a.push(u),r=n.nodeProgram(a,Pt())):(Gt=r,r=i),r===i&&(r=Gt,(t=Kt())!==i&&(wt=r,t=function(r){return n.nodeProgram([r],Pt())}(t)),r=t),Ft[s]={nextPos:Gt,result:r},r)}(),t!==i?(De(),Ie(),wt=r,r=t):(Gt=r,r=i),Ft[e]={nextPos:Gt,result:r},r)}function Ut(){var r,t=76*Gt+1,e=Ft[t];return e?(Gt=e.nextPos,e.result):((r=xe())===i&&(r=qt()),Ft[t]={nextPos:Gt,result:r},r)}function qt(){var r,t,e,o=76*Gt+3,a=Ft[o];return a?(Gt=a.nextPos,a.result):((r=Bt())===i&&(r=Gt,(t=Kt())!==i&&(wt=r,e=t,t=n.nodeBlock([e],Pt())),r=t),Ft[o]={nextPos:Gt,result:r},r)}function Bt(){var t,e,o,a,u,s,l,m,p=76*Gt+4,v=Ft[p];return v?(Gt=v.nextPos,v.result):(t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),(o=Xt())!==i?(a=Gt,(u=Me())!==i&&(s=Kt())!==i?a=s:(Gt=a,a=i),a!==i?(u=De(),125===r.charCodeAt(Gt)?(s=c,Gt++):(s=i,0===Mt&&jt(U)),s!==i?(wt=t,l=o,(m=a)&&l.push(m),t=n.nodeBlock(l,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),(o=Kt())!==i?(a=De(),125===r.charCodeAt(Gt)?(u=c,Gt++):(u=i,0===Mt&&jt(U)),u!==i?(wt=t,t=function(r){return n.nodeBlock([r],Pt())}(o)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)),Ft[p]={nextPos:Gt,result:t},t)}function Xt(){var r,t,e,n,o,a=76*Gt+5,u=Ft[a];return u?(Gt=u.nextPos,u.result):(r=Gt,(t=Wt())!==i?(e=Gt,Me()!==i&&(n=Xt())!==i?e=n:(Gt=e,e=i),e!==i?(wt=r,o=e,r=[t,...o]):(Gt=r,r=i)):(Gt=r,r=i),r===i&&(r=Gt,(t=Wt())!==i&&(wt=r,t=[t]),r=t),Ft[a]={nextPos:Gt,result:r},r)}function Wt(){var t,e=76*Gt+6,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var r,t,e,o,a,u=76*Gt+8,s=Ft[u];return s?(Gt=s.nextPos,s.result):(r=Gt,(t=ye())!==i?(we(),zt()!==i?(De(),(e=Ut())!==i?(wt=r,o=t,a=e,r=n.nodeLetStatement(o,a,Pt())):(Gt=r,r=i)):(Gt=r,r=i)):(Gt=r,r=i),Ft[u]={nextPos:Gt,result:r},r)}(),t===i&&(t=function(){var t,e,o,a,u,s,f,c,l,v,d=76*Gt+9,_=Ft[d];return _?(Gt=_.nextPos,_.result):(t=Gt,(e=ye())!==i?(40===r.charCodeAt(Gt)?(o=m,Gt++):(o=i,0===Mt&&jt(B)),o!==i?(De(),(a=Yt())!==i?(De(),41===r.charCodeAt(Gt)?(u=p,Gt++):(u=i,0===Mt&&jt(X)),u!==i?(we(),zt()!==i?(De(),(s=qt())!==i?(wt=t,f=e,c=a,l=s,v=n.nodeLambda(c,l,Pt(),f),t=n.nodeLetStatement(f,v,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Ft[d]={nextPos:Gt,result:t},t)}(),t===i&&(t=function(){var t,e,o,a,u,s=76*Gt+7,f=Ft[s];return f?(Gt=f.nextPos,f.result):(t=Gt,r.substr(Gt,4)===l?(e=l,Gt+=4):(e=i,0===Mt&&jt(q)),e!==i?(De(),(o=Ut())!==i?(wt=t,a=o,u=n.nodeIdentifier("_",Pt()),t=n.nodeLetStatement(u,a,Pt())):(Gt=t,t=i)):(Gt=t,t=i),Ft[s]={nextPos:Gt,result:t},t)}())),Ft[e]={nextPos:Gt,result:t},t)}function zt(){var t,e=76*Gt+10,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,61===r.charCodeAt(Gt)?(t="=",Gt++):(t=i,0===Mt&&jt(z)),Mt--,t===i&&0===Mt&&jt(W),Ft[e]={nextPos:Gt,result:t},t)}function Yt(){var t,e,o,a,u,s,f,c=76*Gt+11,l=Ft[c];if(l)return Gt=l.nextPos,l.result;if(t=Gt,(e=be())!==i){for(o=[],a=Gt,we(),44===r.charCodeAt(Gt)?(u=v,Gt++):(u=i,0===Mt&&jt(Y)),u!==i?(De(),(s=be())!==i?a=s:(Gt=a,a=i)):(Gt=a,a=i);a!==i;)o.push(a),a=Gt,we(),44===r.charCodeAt(Gt)?(u=v,Gt++):(u=i,0===Mt&&jt(Y)),u!==i?(De(),(s=be())!==i?a=s:(Gt=a,a=i)):(Gt=a,a=i);wt=t,f=o,t=[e,...f]}else Gt=t,t=i;return t===i&&(e="",wt=t=Gt,t=e=[n.nodeIdentifier("_",Pt())]),Ft[c]={nextPos:Gt,result:t},t}function Kt(){var r,t=76*Gt+12,e=Ft[t];return e?(Gt=e.nextPos,e.result):((r=Ht())===i&&(r=Zt())===i&&(r=Jt()),Ft[t]={nextPos:Gt,result:r},r)}function Ht(){var t,e,o,a,u,s,f,c,l,m,p=76*Gt+13,v=Ft[p];return v?(Gt=v.nextPos,v.result):(t=Gt,"if"===r.substr(Gt,2)?(e="if",Gt+=2):(e=i,0===Mt&&jt(K)),e!==i&&Oe()!==i&&(o=Jt())!==i&&Oe()!==i?(r.substr(Gt,4)===d?(a=d,Gt+=4):(a=i,0===Mt&&jt(H)),a!==i&&Oe()!==i&&(u=qt())!==i&&Oe()!==i?(r.substr(Gt,4)===_?(s=_,Gt+=4):(s=i,0===Mt&&jt(Z)),s!==i&&Oe()!==i?((f=Ht())===i&&(f=qt()),f!==i?(wt=t,c=o,l=u,m=f,t=n.nodeTernary(c,l,m,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Ft[p]={nextPos:Gt,result:t},t)}function Zt(){var t,e,o,a,u,s,f,c,l,m=76*Gt+14,p=Ft[m];return p?(Gt=p.nextPos,p.result):(t=Gt,(e=Jt())!==i?(we(),63===r.charCodeAt(Gt)?(o="?",Gt++):(o=i,0===Mt&&jt(J)),o!==i?(De(),(a=Jt())!==i?(we(),58===r.charCodeAt(Gt)?(u=":",Gt++):(u=i,0===Mt&&jt(Q)),u!==i?(De(),(s=Zt())===i&&(s=Jt()),s!==i?(wt=t,f=e,c=a,l=s,t=n.nodeTernary(f,c,l,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Ft[m]={nextPos:Gt,result:t},t)}function Jt(){var r,t,e,o,a,u,s,f=76*Gt+15,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=re())!==i){for(e=[],o=Gt,we(),(a=Qt())!==i?(De(),(u=re())!==i?(wt=o,o=vt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,we(),(a=Qt())!==i?(De(),(u=re())!==i?(wt=o,o=vt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function Qt(){var t,e=76*Gt+16,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,"||"===r.substr(Gt,2)?(t="||",Gt+=2):(t=i,0===Mt&&jt(tr)),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function re(){var r,t,e,o,a,u,s,f=76*Gt+17,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=ee())!==i){for(e=[],o=Gt,we(),(a=te())!==i?(De(),(u=ee())!==i?(wt=o,o=dt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,we(),(a=te())!==i?(De(),(u=ee())!==i?(wt=o,o=dt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function te(){var t,e=76*Gt+18,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,"&&"===r.substr(Gt,2)?(t="&&",Gt+=2):(t=i,0===Mt&&jt(er)),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function ee(){var t,e,o,a,u,s,f,c=76*Gt+19,l=Ft[c];return l?(Gt=l.nextPos,l.result):(t=Gt,(e=ne())!==i?(we(),o=function(){var t,e=76*Gt+20,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,"=="===r.substr(Gt,2)?(t="==",Gt+=2):(t=i,0===Mt&&jt(nr)),t===i&&("!="===r.substr(Gt,2)?(t="!=",Gt+=2):(t=i,0===Mt&&jt(or))),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}(),o!==i?(De(),(a=ne())!==i?(wt=t,u=e,s=o,f=a,t=n.makeFunctionCall(n.toFunction[s],[u,f],Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=ne()),Ft[c]={nextPos:Gt,result:t},t)}function ne(){var t,e,o,a,u,s,f,c=76*Gt+21,l=Ft[c];return l?(Gt=l.nextPos,l.result):(t=Gt,(e=oe())!==i?(we(),o=function(){var t,e=76*Gt+22,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,"<="===r.substr(Gt,2)?(t="<=",Gt+=2):(t=i,0===Mt&&jt(ir)),t===i&&(60===r.charCodeAt(Gt)?(t="<",Gt++):(t=i,0===Mt&&jt(ar)),t===i&&(">="===r.substr(Gt,2)?(t=">=",Gt+=2):(t=i,0===Mt&&jt(ur)),t===i&&(62===r.charCodeAt(Gt)?(t=">",Gt++):(t=i,0===Mt&&jt(sr))))),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}(),o!==i?(De(),(a=oe())!==i?(wt=t,u=e,s=o,f=a,t=n.makeFunctionCall(n.toFunction[s],[u,f],Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=oe()),Ft[c]={nextPos:Gt,result:t},t)}function oe(){var r,t,e,o,a,u,s,f=76*Gt+23,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=ae())!==i){for(e=[],o=Gt,ke()!==i&&(a=ie())!==i&&Oe()!==i&&(u=ae())!==i?(wt=o,o=_t(0,a,u)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,ke()!==i&&(a=ie())!==i&&Oe()!==i&&(u=ae())!==i?(wt=o,o=_t(0,a,u)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function ie(){var t,e=76*Gt+24,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,"to"===r.substr(Gt,2)?(t="to",Gt+=2):(t=i,0===Mt&&jt(fr)),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function ae(){var r,t,e,o,a,u,s,f=76*Gt+25,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=se())!==i){for(e=[],o=Gt,we(),(a=ue())!==i?(De(),(u=se())!==i?(wt=o,o=gt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,we(),(a=ue())!==i?(De(),(u=se())!==i?(wt=o,o=gt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function ue(){var t,e=76*Gt+26,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,43===r.charCodeAt(Gt)?(t="+",Gt++):(t=i,0===Mt&&jt(cr)),t===i&&(45===r.charCodeAt(Gt)?(t="-",Gt++):(t=i,0===Mt&&jt(lr)),t===i&&(".+"===r.substr(Gt,2)?(t=".+",Gt+=2):(t=i,0===Mt&&jt(mr)),t===i&&(r.substr(Gt,2)===g?(t=g,Gt+=2):(t=i,0===Mt&&jt(pr))))),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function se(){var r,t,e,o,a,u,s,f=76*Gt+27,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=ce())!==i){for(e=[],o=Gt,we(),(a=fe())!==i?(De(),(u=ce())!==i?(wt=o,o=ht(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,we(),(a=fe())!==i?(De(),(u=ce())!==i?(wt=o,o=ht(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function fe(){var t,e=76*Gt+28,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,42===r.charCodeAt(Gt)?(t="*",Gt++):(t=i,0===Mt&&jt(vr)),t===i&&(47===r.charCodeAt(Gt)?(t="/",Gt++):(t=i,0===Mt&&jt(dr)),t===i&&(".*"===r.substr(Gt,2)?(t=".*",Gt+=2):(t=i,0===Mt&&jt(_r)),t===i&&("./"===r.substr(Gt,2)?(t="./",Gt+=2):(t=i,0===Mt&&jt(gr))))),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function ce(){var r,t,e,o,a,u,s,f=76*Gt+29,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(r=Gt,(t=me())!==i){for(e=[],o=Gt,we(),(a=le())!==i?(De(),(u=me())!==i?(wt=o,o=yt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);o!==i;)e.push(o),o=Gt,we(),(a=le())!==i?(De(),(u=me())!==i?(wt=o,o=yt(0,a,u)):(Gt=o,o=i)):(Gt=o,o=i);wt=r,s=t,r=e.reduce((function(r,t){return n.makeFunctionCall(n.toFunction[t.operator],[r,t.right],Pt())}),s)}else Gt=r,r=i;return Ft[f]={nextPos:Gt,result:r},r}function le(){var t,e=76*Gt+30,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,94===r.charCodeAt(Gt)?(t="^",Gt++):(t=i,0===Mt&&jt(hr)),t===i&&(".^"===r.substr(Gt,2)?(t=".^",Gt+=2):(t=i,0===Mt&&jt(yr))),Mt--,t===i&&0===Mt&&jt(rr),Ft[e]={nextPos:Gt,result:t},t)}function me(){var t,e,o,a,u,s,f,c=76*Gt+31,l=Ft[c];if(l)return Gt=l.nextPos,l.result;if(t=Gt,(e=de())!==i){for(o=[],a=Gt,we(),r.substr(Gt,2)===h?(u=h,Gt+=2):(u=i,0===Mt&&jt(br)),u===i&&(r.substr(Gt,2)===y?(u=y,Gt+=2):(u=i,0===Mt&&jt(Ar))),u!==i?(De(),(s=pe())!==i?(wt=a,a=bt(0,s)):(Gt=a,a=i)):(Gt=a,a=i);a!==i;)o.push(a),a=Gt,we(),r.substr(Gt,2)===h?(u=h,Gt+=2):(u=i,0===Mt&&jt(br)),u===i&&(r.substr(Gt,2)===y?(u=y,Gt+=2):(u=i,0===Mt&&jt(Ar))),u!==i?(De(),(s=pe())!==i?(wt=a,a=bt(0,s)):(Gt=a,a=i)):(Gt=a,a=i);wt=t,f=e,t=o.reduce((function(r,t){return n.makeFunctionCall(n.postOperatorToFunction["()"],[t.callable,r,...t.args],Pt())}),f)}else Gt=t,t=i;return Ft[c]={nextPos:Gt,result:t},t}function pe(){var t,e,n,o,a,u=76*Gt+32,s=Ft[u];return s?(Gt=s.nextPos,s.result):(t=Gt,(e=ve())!==i?(40===r.charCodeAt(Gt)?(n=m,Gt++):(n=i,0===Mt&&jt(B)),n!==i?(De(),(o=ge())!==i?(De(),41===r.charCodeAt(Gt)?(a=p,Gt++):(a=i,0===Mt&&jt(X)),a!==i?(wt=t,t={callable:e,args:o}):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,(e=ve())!==i?(40===r.charCodeAt(Gt)?(n=m,Gt++):(n=i,0===Mt&&jt(B)),n!==i?(De(),41===r.charCodeAt(Gt)?(o=p,Gt++):(o=i,0===Mt&&jt(X)),o!==i?(wt=t,t={callable:e,args:[]}):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,(e=ve())!==i&&(wt=t,e=function(r){return{callable:r,args:[]}}(e)),t=e)),Ft[u]={nextPos:Gt,result:t},t)}function ve(){var t,e=76*Gt+33,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var t,e,o,a,u,s,f,c,l,m,p,v=76*Gt+37,d=Ft[v];if(d)return Gt=d.nextPos,d.result;if(t=Gt,(e=he())!==i)if(o=Gt,Mt++,91===r.charCodeAt(Gt)?(a=b,Gt++):(a=i,0===Mt&&jt(Er)),a===i&&(46===r.charCodeAt(Gt)?(a=A,Gt++):(a=i,0===Mt&&jt(xr))),Mt--,a!==i?(Gt=o,o=void 0):o=i,o!==i){for(a=[],u=Gt,s=we(),91===r.charCodeAt(Gt)?(f=b,Gt++):(f=i,0===Mt&&jt(Er)),f!==i?(c=De(),(l=Kt())!==i?(De(),93===r.charCodeAt(Gt)?(m=S,Gt++):(m=i,0===Mt&&jt(Gr)),m!==i?(wt=u,u=At(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,46===r.charCodeAt(Gt)?(s=A,Gt++):(s=i,0===Mt&&jt(xr)),s!==i?(f=Gt,(f=(c=be())!==i?r.substring(f,Gt):c)!==i?(wt=u,u=St(0,f)):(Gt=u,u=i)):(Gt=u,u=i));u!==i;)a.push(u),u=Gt,s=we(),91===r.charCodeAt(Gt)?(f=b,Gt++):(f=i,0===Mt&&jt(Er)),f!==i?(c=De(),(l=Kt())!==i?(De(),93===r.charCodeAt(Gt)?(m=S,Gt++):(m=i,0===Mt&&jt(Gr)),m!==i?(wt=u,u=At(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,46===r.charCodeAt(Gt)?(s=A,Gt++):(s=i,0===Mt&&jt(xr)),s!==i?(f=Gt,(f=(c=be())!==i?r.substring(f,Gt):c)!==i?(wt=u,u=St(0,f)):(Gt=u,u=i)):(Gt=u,u=i));wt=t,p=e,t=a.reduce((function(r,t){return n.makeFunctionCall(t.fn,[r,...t.args],Pt())}),p)}else Gt=t,t=i;else Gt=t,t=i;return Ft[v]={nextPos:Gt,result:t},t}(),t===i&&(t=Ee())===i&&(t=ye()),Ft[e]={nextPos:Gt,result:t},t)}function de(){var t,e,o,a,u,s=76*Gt+34,f=Ft[s];return f?(Gt=f.nextPos,f.result):(t=Gt,e=function(){var t,e=76*Gt+35,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,45===r.charCodeAt(Gt)?(t="-",Gt++):(t=i,0===Mt&&jt(lr)),t===i&&(r.substr(Gt,2)===g?(t=g,Gt+=2):(t=i,0===Mt&&jt(pr)),t===i&&(33===r.charCodeAt(Gt)?(t="!",Gt++):(t=i,0===Mt&&jt(Tr)))),Mt--,t===i&&0===Mt&&jt(Sr),Ft[e]={nextPos:Gt,result:t},t)}(),e!==i?(De(),(o=de())===i&&(o=_e()),o!==i?(wt=t,a=e,u=o,t=n.makeFunctionCall(n.unaryToFunction[a],[u],Pt())):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=_e()),Ft[s]={nextPos:Gt,result:t},t)}function _e(){var t,e=76*Gt+36,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var t,e,o,a,u,s,f,c,l,v,d,_=76*Gt+38,g=Ft[_];if(g)return Gt=g.nextPos,g.result;if(t=Gt,(e=he())!==i)if(o=Gt,Mt++,91===r.charCodeAt(Gt)?(a=b,Gt++):(a=i,0===Mt&&jt(Er)),a===i&&(40===r.charCodeAt(Gt)?(a=m,Gt++):(a=i,0===Mt&&jt(B)),a===i&&(46===r.charCodeAt(Gt)?(a=A,Gt++):(a=i,0===Mt&&jt(xr)))),Mt--,a!==i?(Gt=o,o=void 0):o=i,o!==i){for(a=[],u=Gt,s=we(),40===r.charCodeAt(Gt)?(f=m,Gt++):(f=i,0===Mt&&jt(B)),f!==i?(c=De(),(l=ge())!==i?(De(),41===r.charCodeAt(Gt)?(v=p,Gt++):(v=i,0===Mt&&jt(X)),v!==i?(wt=u,u=Tt(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,s=we(),91===r.charCodeAt(Gt)?(f=b,Gt++):(f=i,0===Mt&&jt(Er)),f!==i?(c=De(),(l=Kt())!==i?(De(),93===r.charCodeAt(Gt)?(v=S,Gt++):(v=i,0===Mt&&jt(Gr)),v!==i?(wt=u,u=Et(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,46===r.charCodeAt(Gt)?(s=A,Gt++):(s=i,0===Mt&&jt(xr)),s!==i?(f=Gt,(f=(c=be())!==i?r.substring(f,Gt):c)!==i?(wt=u,u=xt(0,f)):(Gt=u,u=i)):(Gt=u,u=i)));u!==i;)a.push(u),u=Gt,s=we(),40===r.charCodeAt(Gt)?(f=m,Gt++):(f=i,0===Mt&&jt(B)),f!==i?(c=De(),(l=ge())!==i?(De(),41===r.charCodeAt(Gt)?(v=p,Gt++):(v=i,0===Mt&&jt(X)),v!==i?(wt=u,u=Tt(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,s=we(),91===r.charCodeAt(Gt)?(f=b,Gt++):(f=i,0===Mt&&jt(Er)),f!==i?(c=De(),(l=Kt())!==i?(De(),93===r.charCodeAt(Gt)?(v=S,Gt++):(v=i,0===Mt&&jt(Gr)),v!==i?(wt=u,u=Et(0,l)):(Gt=u,u=i)):(Gt=u,u=i)):(Gt=u,u=i),u===i&&(u=Gt,46===r.charCodeAt(Gt)?(s=A,Gt++):(s=i,0===Mt&&jt(xr)),s!==i?(f=Gt,(f=(c=be())!==i?r.substring(f,Gt):c)!==i?(wt=u,u=xt(0,f)):(Gt=u,u=i)):(Gt=u,u=i)));wt=t,d=e,t=a.reduce((function(r,t){return n.makeFunctionCall(t.fn,[r,...t.args],Pt())}),d)}else Gt=t,t=i;else Gt=t,t=i;return Ft[_]={nextPos:Gt,result:t},t}(),t===i&&(t=he()),Ft[e]={nextPos:Gt,result:t},t)}function ge(){var t,e,o,a,u,s,f,c=76*Gt+39,l=Ft[c];if(l)return Gt=l.nextPos,l.result;if(t=Gt,(e=Kt())!==i){for(o=[],a=Gt,we(),44===r.charCodeAt(Gt)?(u=v,Gt++):(u=i,0===Mt&&jt(Y)),u!==i?(De(),(s=Kt())!==i?a=s:(Gt=a,a=i)):(Gt=a,a=i);a!==i;)o.push(a),a=Gt,we(),44===r.charCodeAt(Gt)?(u=v,Gt++):(u=i,0===Mt&&jt(Y)),u!==i?(De(),(s=Kt())!==i?a=s:(Gt=a,a=i)):(Gt=a,a=i);wt=t,f=o,t=[e,...f]}else Gt=t,t=i;return t===i&&(e="",wt=t=Gt,t=e=[n.nodeVoid(Pt())]),Ft[c]={nextPos:Gt,result:t},t}function he(){var t,e,o,a,u=76*Gt+40,s=Ft[u];return s?(Gt=s.nextPos,s.result):(t=Gt,40===r.charCodeAt(Gt)?(e=m,Gt++):(e=i,0===Mt&&jt(B)),e!==i?(De(),(o=Kt())!==i?(De(),41===r.charCodeAt(Gt)?(a=p,Gt++):(a=i,0===Mt&&jt(X)),a!==i?(wt=t,t=o):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=function(){var t,e=76*Gt+41,o=Ft[e];return o?(Gt=o.nextPos,o.result):((t=Ee())===i&&(t=function(){var t,e=76*Gt+42,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var t,e,o,a,u,s,f=76*Gt+50,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(Mt++,t=Gt,e=Gt,39===r.charCodeAt(Gt)?(o="'",Gt++):(o=i,0===Mt&&jt(Cr)),o!==i){for(a=[],M.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Lr));u!==i;)a.push(u),M.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Lr));39===r.charCodeAt(Gt)?(u="'",Gt++):(u=i,0===Mt&&jt(Cr)),u!==i?e=a:(Gt=e,e=i)}else Gt=e,e=i;if(e!==i&&(wt=t,s=e,e=n.nodeString(s.join(""),Pt())),(t=e)===i){if(t=Gt,e=Gt,34===r.charCodeAt(Gt)?(o='"',Gt++):(o=i,0===Mt&&jt(Vr)),o!==i){for(a=[],F.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(jr));u!==i;)a.push(u),F.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(jr));34===r.charCodeAt(Gt)?(u='"',Gt++):(u=i,0===Mt&&jt(Vr)),u!==i?e=a:(Gt=e,e=i)}else Gt=e,e=i;e!==i&&(wt=t,e=function(r){return n.nodeString(r.join(""),Pt())}(e)),t=e}return Mt--,t===i&&(e=i,0===Mt&&jt(Rr)),Ft[f]={nextPos:Gt,result:t},t}(),t===i&&(t=function(){var t,e,o,a,u,s=76*Gt+51,f=Ft[s];return f?(Gt=f.nextPos,f.result):(t=Gt,e=function(){var t,e,o,a,u,s,f,c,l=76*Gt+53,m=Ft[l];if(m)return Gt=m.nextPos,m.result;if(Mt++,t=Gt,e=Gt,o=Gt,a=Gt,u=[],(s=Te())!==i)for(;s!==i;)u.push(s),s=Te();else u=i;if(u!==i)if(46===r.charCodeAt(Gt)?(s=A,Gt++):(s=i,0===Mt&&jt(xr)),s!==i){for(f=[],c=Te();c!==i;)f.push(c),c=Te();a=u=[u,s,f]}else Gt=a,a=i;else Gt=a,a=i;if(a===i)if(a=Gt,46===r.charCodeAt(Gt)?(u=A,Gt++):(u=i,0===Mt&&jt(xr)),u!==i){if(s=[],(f=Te())!==i)for(;f!==i;)s.push(f),f=Te();else s=i;s!==i?a=u=[u,s]:(Gt=a,a=i)}else Gt=a,a=i;if(a!==i?((u=Se())===i&&(u=null),o=a=[a,u]):(Gt=o,o=i),o===i){if(o=Gt,a=[],(u=Te())!==i)for(;u!==i;)a.push(u),u=Te();else a=i;a!==i&&(u=Se())!==i?o=a=[a,u]:(Gt=o,o=i)}return(e=o!==i?r.substring(e,Gt):o)!==i&&(wt=t,e=n.nodeFloat(parseFloat(It()),Pt())),Mt--,(t=e)===i&&(e=i,0===Mt&&jt(qr)),Ft[l]={nextPos:Gt,result:t},t}(),e===i&&(e=function(){var t,e,o,a,u,s=76*Gt+52,f=Ft[s];if(f)return Gt=f.nextPos,f.result;if(Mt++,t=Gt,e=[],(o=Te())!==i)for(;o!==i;)e.push(o),o=Te();else e=i;return e!==i?(o=Gt,Mt++,46===r.charCodeAt(Gt)?(a=A,Gt++):(a=i,0===Mt&&jt(xr)),Mt--,a===i?o=void 0:(Gt=o,o=i),o!==i?(a=Gt,Mt++,I.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Ur)),Mt--,u===i?a=void 0:(Gt=a,a=i),a!==i?(wt=t,t=n.nodeInteger(parseInt(It()),Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Mt--,t===i&&(e=i,0===Mt&&jt($r)),Ft[s]={nextPos:Gt,result:t},t}()),e!==i?(o=function(){var t,e,o,a,u,s=76*Gt+47,f=Ft[s];if(f)return Gt=f.nextPos,f.result;if(Mt++,t=Gt,e=Gt,o=[],w.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Mr)),a!==i)for(;a!==i;)o.push(a),w.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Mr));else o=i;if(o!==i){for(a=[],G.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Or));u!==i;)a.push(u),G.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Or));e=o=[o,a]}else Gt=e,e=i;return e!==i&&(wt=t,e=n.nodeIdentifier(It(),Pt())),Mt--,(t=e)===i&&(e=i,0===Mt&&jt(kr)),Ft[s]={nextPos:Gt,result:t},t}(),o===i&&(o=null),wt=t,a=e,t=null===(u=o)?a:n.makeFunctionCall("fromUnit_"+u.value,[a],Pt())):(Gt=t,t=i),Ft[s]={nextPos:Gt,result:t},t)}(),t===i&&(t=function(){var t,e,o,a,u,s=76*Gt+56,f=Ft[s];return f?(Gt=f.nextPos,f.result):(Mt++,t=Gt,r.substr(Gt,4)===T?(e=T,Gt+=4):(e=i,0===Mt&&jt(Wr)),e===i&&(r.substr(Gt,5)===E?(e=E,Gt+=5):(e=i,0===Mt&&jt(zr))),e!==i?(o=Gt,Mt++,N.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Yr)),Mt--,a===i?o=void 0:(Gt=o,o=i),o!==i?(a=Gt,Mt++,R.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Kr)),Mt--,u===i?a=void 0:(Gt=a,a=i),a!==i?(wt=t,t=n.nodeBoolean("true"===It(),Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Mt--,t===i&&(e=i,0===Mt&&jt(Xr)),Ft[s]={nextPos:Gt,result:t},t)}(),t===i&&(t=ye())===i&&(t=function(){var t,e,o=76*Gt+43,a=Ft[o];return a?(Gt=a.nextPos,a.result):(Mt++,t=Gt,"()"===r.substr(Gt,2)?(e="()",Gt+=2):(e=i,0===Mt&&jt(Dr)),e!==i&&(wt=t,e=n.nodeVoid(Pt())),Mt--,(t=e)===i&&(e=i,0===Mt&&jt(wr)),Ft[o]={nextPos:Gt,result:t},t)}()))),Ft[e]={nextPos:Gt,result:t},t)}()),Ft[e]={nextPos:Gt,result:t},t)}()),Ft[u]={nextPos:Gt,result:t},t)}function ye(){var t,e=76*Gt+44,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var t,e,o,a,u,s,f,c,l=76*Gt+45,m=Ft[l];if(m)return Gt=m.nextPos,m.result;if(Mt++,t=Gt,e=Gt,(e=(o=Ae())!==i?r.substring(e,Gt):o)!==i){for(o=[],a=Gt,46===r.charCodeAt(Gt)?(u=A,Gt++):(u=i,0===Mt&&jt(xr)),u!==i?(s=De(),f=Gt,(f=(c=Ae())!==i?r.substring(f,Gt):c)!==i?a=f:(Gt=a,a=i)):(Gt=a,a=i);a!==i;)o.push(a),a=Gt,46===r.charCodeAt(Gt)?(u=A,Gt++):(u=i,0===Mt&&jt(xr)),u!==i?(s=De(),f=Gt,(f=(c=Ae())!==i?r.substring(f,Gt):c)!==i?a=f:(Gt=a,a=i)):(Gt=a,a=i);46===r.charCodeAt(Gt)?(a=A,Gt++):(a=i,0===Mt&&jt(xr)),a!==i?(u=De(),s=Gt,(s=(f=be())!==i?r.substring(s,Gt):f)!==i?(wt=t,t=function(r,t,e){let o=[...t];o.unshift(r),o.push(e);let i=o.join(".");return n.nodeIdentifier(i,Pt())}(e,o,s)):(Gt=t,t=i)):(Gt=t,t=i)}else Gt=t,t=i;return Mt--,t===i&&(e=i,0===Mt&&jt(kr)),Ft[l]={nextPos:Gt,result:t},t}(),t===i&&(t=be()),Ft[e]={nextPos:Gt,result:t},t)}function be(){var t,e,o,a,u,s=76*Gt+48,f=Ft[s];if(f)return Gt=f.nextPos,f.result;if(Mt++,t=Gt,e=Gt,o=[],D.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Ir)),a!==i)for(;a!==i;)o.push(a),D.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Ir));else o=i;if(o!==i){for(a=[],k.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Pr));u!==i;)a.push(u),k.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Pr));e=o=[o,a]}else Gt=e,e=i;return e!==i&&(wt=t,e=n.nodeIdentifier(It(),Pt())),Mt--,(t=e)===i&&(e=i,0===Mt&&jt(Fr)),Ft[s]={nextPos:Gt,result:t},t}function Ae(){var t,e,o,a,u,s=76*Gt+49,f=Ft[s];if(f)return Gt=f.nextPos,f.result;if(Mt++,t=Gt,e=Gt,o=[],O.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Nr)),a!==i)for(;a!==i;)o.push(a),O.test(r.charAt(Gt))?(a=r.charAt(Gt),Gt++):(a=i,0===Mt&&jt(Nr));else o=i;if(o!==i){for(a=[],G.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Or));u!==i;)a.push(u),G.test(r.charAt(Gt))?(u=r.charAt(Gt),Gt++):(u=i,0===Mt&&jt(Or));e=o=[o,a]}else Gt=e,e=i;return e!==i&&(wt=t,e=n.nodeModuleIdentifier(It(),Pt())),Mt--,(t=e)===i&&(e=i,0===Mt&&jt(kr)),Ft[s]={nextPos:Gt,result:t},t}function Se(){var t,e,n,o,a,u=76*Gt+54,s=Ft[u];if(s)return Gt=s.nextPos,s.result;if(t=Gt,I.test(r.charAt(Gt))?(e=r.charAt(Gt),Gt++):(e=i,0===Mt&&jt(Ur)),e!==i){if(45===r.charCodeAt(Gt)?(n="-",Gt++):(n=i,0===Mt&&jt(lr)),n===i&&(n=null),o=[],(a=Te())!==i)for(;a!==i;)o.push(a),a=Te();else o=i;o!==i?t=e=[e,n,o]:(Gt=t,t=i)}else Gt=t,t=i;return Ft[u]={nextPos:Gt,result:t},t}function Te(){var t,e=76*Gt+55,n=Ft[e];return n?(Gt=n.nextPos,n.result):(P.test(r.charAt(Gt))?(t=r.charAt(Gt),Gt++):(t=i,0===Mt&&jt(Br)),Ft[e]={nextPos:Gt,result:t},t)}function Ee(){var t,e=76*Gt+57,o=Ft[e];return o?(Gt=o.nextPos,o.result):(t=function(){var t,e,o,a,u,s=76*Gt+61,l=Ft[s];return l?(Gt=l.nextPos,l.result):(Mt++,t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),125===r.charCodeAt(Gt)?(o=c,Gt++):(o=i,0===Mt&&jt(U)),o!==i?(wt=t,t=n.constructRecord([],Pt())):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),o=function(){var t,e,n,o,a,u,s,f=76*Gt+63,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(t=Gt,(e=Ge())!==i){for(n=[],o=Gt,we(),44===r.charCodeAt(Gt)?(a=v,Gt++):(a=i,0===Mt&&jt(Y)),a!==i?(De(),(u=Ge())!==i?o=u:(Gt=o,o=i)):(Gt=o,o=i);o!==i;)n.push(o),o=Gt,we(),44===r.charCodeAt(Gt)?(a=v,Gt++):(a=i,0===Mt&&jt(Y)),a!==i?(De(),(u=Ge())!==i?o=u:(Gt=o,o=i)):(Gt=o,o=i);wt=t,s=n,t=[e,...s]}else Gt=t,t=i;return Ft[f]={nextPos:Gt,result:t},t}(),o!==i?(De(),a=function(){var t,e,n,o,a=76*Gt+62,u=Ft[a];return u?(Gt=u.nextPos,u.result):(125===r.charCodeAt(Gt)?(t=c,Gt++):(t=i,0===Mt&&jt(U)),t===i&&(t=Gt,44===r.charCodeAt(Gt)?(e=v,Gt++):(e=i,0===Mt&&jt(Y)),e!==i?(n=De(),125===r.charCodeAt(Gt)?(o=c,Gt++):(o=i,0===Mt&&jt(U)),o!==i?t=e=[e,n,o]:(Gt=t,t=i)):(Gt=t,t=i)),Ft[a]={nextPos:Gt,result:t},t)}(),a!==i?(wt=t,u=o,t=n.constructRecord(u,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)),Mt--,t===i&&(e=i,0===Mt&&jt(Jr)),Ft[s]={nextPos:Gt,result:t},t)}(),t===i&&(t=function(){var t,e,o,a,u,s=76*Gt+59,f=Ft[s];return f?(Gt=f.nextPos,f.result):(Mt++,t=Gt,91===r.charCodeAt(Gt)?(e=b,Gt++):(e=i,0===Mt&&jt(Er)),e!==i?(De(),93===r.charCodeAt(Gt)?(o=S,Gt++):(o=i,0===Mt&&jt(Gr)),o!==i?(wt=t,t=n.constructArray([],Pt())):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,91===r.charCodeAt(Gt)?(e=b,Gt++):(e=i,0===Mt&&jt(Er)),e!==i?(De(),o=function(){var t,e,n,o,a,u,s,f=76*Gt+60,c=Ft[f];if(c)return Gt=c.nextPos,c.result;if(t=Gt,(e=Kt())!==i){for(n=[],o=Gt,we(),44===r.charCodeAt(Gt)?(a=v,Gt++):(a=i,0===Mt&&jt(Y)),a!==i?(De(),(u=Kt())!==i?o=u:(Gt=o,o=i)):(Gt=o,o=i);o!==i;)n.push(o),o=Gt,we(),44===r.charCodeAt(Gt)?(a=v,Gt++):(a=i,0===Mt&&jt(Y)),a!==i?(De(),(u=Kt())!==i?o=u:(Gt=o,o=i)):(Gt=o,o=i);wt=t,s=n,t=[e,...s]}else Gt=t,t=i;return Ft[f]={nextPos:Gt,result:t},t}(),o!==i?(De(),93===r.charCodeAt(Gt)?(a=S,Gt++):(a=i,0===Mt&&jt(Gr)),a!==i?(wt=t,u=o,t=n.constructArray(u,Pt())):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)),Mt--,t===i&&(e=i,0===Mt&&jt(Zr)),Ft[s]={nextPos:Gt,result:t},t)}(),t===i&&(t=xe())===i&&(t=Bt())),Ft[e]={nextPos:Gt,result:t},t)}function xe(){var t,e,o,a,u,s,l,m,p,v,d,_,g=76*Gt+58,h=Ft[g];return h?(Gt=h.nextPos,h.result):(t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),124===r.charCodeAt(Gt)?(o=x,Gt++):(o=i,0===Mt&&jt(Hr)),o!==i?(De(),(a=Yt())!==i?(De(),124===r.charCodeAt(Gt)?(u=x,Gt++):(u=i,0===Mt&&jt(Hr)),u!==i?(De(),(s=Xt())!==i?(l=Gt,(m=Me())!==i&&(p=Kt())!==i?l=p:(Gt=l,l=i),l!==i?(m=De(),125===r.charCodeAt(Gt)?(p=c,Gt++):(p=i,0===Mt&&jt(U)),p!==i?(wt=t,v=a,_=l,(d=s).push(_),t=n.nodeLambda(v,n.nodeBlock(d,Pt()),Pt(),void 0)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),t===i&&(t=Gt,123===r.charCodeAt(Gt)?(e=f,Gt++):(e=i,0===Mt&&jt($)),e!==i?(De(),124===r.charCodeAt(Gt)?(o=x,Gt++):(o=i,0===Mt&&jt(Hr)),o!==i?(De(),(a=Yt())!==i?(De(),124===r.charCodeAt(Gt)?(u=x,Gt++):(u=i,0===Mt&&jt(Hr)),u!==i?(De(),(s=Kt())!==i?(l=De(),125===r.charCodeAt(Gt)?(m=c,Gt++):(m=i,0===Mt&&jt(U)),m!==i?(wt=t,t=function(r,t){return n.nodeLambda(r,t,Pt(),void 0)}(a,s)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i)),Ft[g]={nextPos:Gt,result:t},t)}function Ge(){var t,e,o,a,u=76*Gt+64,s=Ft[u];return s?(Gt=s.nextPos,s.result):(t=Gt,(e=Kt())!==i?(we(),58===r.charCodeAt(Gt)?(o=":",Gt++):(o=i,0===Mt&&jt(Q)),o!==i?(De(),(a=Kt())!==i?(wt=t,t=function(r,t){return n.nodeKeyValue(r,t,Pt())}(e,a)):(Gt=t,t=i)):(Gt=t,t=i)):(Gt=t,t=i),Ft[u]={nextPos:Gt,result:t},t)}function we(){var r,t,e=76*Gt+65,n=Ft[e];if(n)return Gt=n.nextPos,n.result;for(Mt++,r=[],t=Pe();t!==i;)r.push(t),t=Pe();return Mt--,t=i,0===Mt&&jt(Qr),Ft[e]={nextPos:Gt,result:r},r}function De(){var r,t,e=76*Gt+66,n=Ft[e];if(n)return Gt=n.nextPos,n.result;for(Mt++,r=[],(t=Pe())===i&&(t=Fe());t!==i;)r.push(t),(t=Pe())===i&&(t=Fe());return Mt--,t=i,0===Mt&&jt(rt),Ft[e]={nextPos:Gt,result:r},r}function ke(){var r,t,e=76*Gt+67,n=Ft[e];if(n)return Gt=n.nextPos,n.result;if(Mt++,r=[],(t=Pe())!==i)for(;t!==i;)r.push(t),t=Pe();else r=i;return Mt--,r===i&&(t=i,0===Mt&&jt(Qr)),Ft[e]={nextPos:Gt,result:r},r}function Oe(){var r,t,e=76*Gt+68,n=Ft[e];if(n)return Gt=n.nextPos,n.result;if(Mt++,r=[],(t=Pe())===i&&(t=Fe()),t!==i)for(;t!==i;)r.push(t),(t=Pe())===i&&(t=Fe());else r=i;return Mt--,r===i&&(t=i,0===Mt&&jt(rt)),Ft[e]={nextPos:Gt,result:r},r}function Me(){var t,e,n,o,a=76*Gt+69,u=Ft[a];if(u)return Gt=u.nextPos,u.result;if(Mt++,t=Gt,e=we(),n=[],59===r.charCodeAt(Gt)?(o=";",Gt++):(o=i,0===Mt&&jt(et)),o===i&&(o=Fe()),o!==i)for(;o!==i;)n.push(o),59===r.charCodeAt(Gt)?(o=";",Gt++):(o=i,0===Mt&&jt(et)),o===i&&(o=Fe());else n=i;return n!==i?t=e=[e,n,o=De()]:(Gt=t,t=i),Mt--,t===i&&(e=i,0===Mt&&jt(tt)),Ft[a]={nextPos:Gt,result:t},t}function Fe(){var t,e,n,o=76*Gt+70,a=Ft[o];return a?(Gt=a.nextPos,a.result):(t=Gt,(e=Ie())===i&&(e=null),n=function(){var t,e=76*Gt+75,n=Ft[e];return n?(Gt=n.nextPos,n.result):(Mt++,j.test(r.charAt(Gt))?(t=r.charAt(Gt),Gt++):(t=i,0===Mt&&jt(pt)),Mt--,t===i&&0===Mt&&jt(mt),Ft[e]={nextPos:Gt,result:t},t)}(),n!==i?t=e=[e,n]:(Gt=t,t=i),Ft[o]={nextPos:Gt,result:t},t)}function Ie(){var t,e,n,o,a=76*Gt+71,u=Ft[a];if(u)return Gt=u.nextPos,u.result;if(Mt++,t=Gt,we(),"//"===r.substr(Gt,2)?(e="//",Gt+=2):(e=i,0===Mt&&jt(ot)),e===i&&(35===r.charCodeAt(Gt)?(e="#",Gt++):(e=i,0===Mt&&jt(it))),e!==i){for(n=[],C.test(r.charAt(Gt))?(o=r.charAt(Gt),Gt++):(o=i,0===Mt&&jt(at));o!==i;)n.push(o),C.test(r.charAt(Gt))?(o=r.charAt(Gt),Gt++):(o=i,0===Mt&&jt(at));t=n}else Gt=t,t=i;return Mt--,t===i&&0===Mt&&jt(nt),Ft[a]={nextPos:Gt,result:t},t}function Pe(){var t,e=76*Gt+72,n=Ft[e];return n?(Gt=n.nextPos,n.result):(t=function(){var t,e=76*Gt+74,n=Ft[e];return n?(Gt=n.nextPos,n.result):(V.test(r.charAt(Gt))?(t=r.charAt(Gt),Gt++):(t=i,0===Mt&&jt(lt)),Ft[e]={nextPos:Gt,result:t},t)}(),t===i&&(t=function(){var t,e,n,o,a=76*Gt+73,u=Ft[a];if(u)return Gt=u.nextPos,u.result;if(Mt++,t=Gt,"/*"===r.substr(Gt,2)?(e="/*",Gt+=2):(e=i,0===Mt&&jt(st)),e!==i){for(n=[],L.test(r.charAt(Gt))?(o=r.charAt(Gt),Gt++):(o=i,0===Mt&&jt(ft));o!==i;)n.push(o),L.test(r.charAt(Gt))?(o=r.charAt(Gt),Gt++):(o=i,0===Mt&&jt(ft));"*/"===r.substr(Gt,2)?(o="*/",Gt+=2):(o=i,0===Mt&&jt(ct)),o!==i?t=n:(Gt=t,t=i)}else Gt=t,t=i;return Mt--,t===i&&(e=i,0===Mt&&jt(ut)),Ft[a]={nextPos:Gt,result:t},t}()),Ft[e]={nextPos:Gt,result:t},t)}if((e=s())!==i&&Gt===r.length)return e;throw e!==i&&Gt<r.length&&jt({type:"end"}),function(r,t,e){return new o(o.buildMessage(r,t),r,t,e)}(Ot,kt<r.length?r.charAt(kt):null,kt<r.length?Vt(kt,kt+1):Vt(kt,kt))}}},42687:(r,t,e)=>{"use strict";var n=e(11126),o=e(41724),i=e(23025),a=e(22525),u=e(20114),s=e(62751),f=e(68154),c=e(71396),l=a.create("Reducer_Peggy_Parse-QuriSquiggleLang.UnsupportedPeggyNodeType");function m(r){var t;switch(r.type){case"Array":t={TAG:2,_0:r,[Symbol.for("name")]:"ASTArray"};break;case"Block":t={TAG:0,_0:r,[Symbol.for("name")]:"ASTBlock"};break;case"Boolean":t={TAG:4,_0:r,[Symbol.for("name")]:"ASTBoolean"};break;case"Call":t={TAG:6,_0:r,[Symbol.for("name")]:"ASTCall"};break;case"Float":t={TAG:5,_0:r,[Symbol.for("name")]:"ASTFloat"};break;case"Identifier":t={TAG:7,_0:r,[Symbol.for("name")]:"ASTIdentifier"};break;case"Integer":t={TAG:8,_0:r,[Symbol.for("name")]:"ASTInteger"};break;case"KeyValue":t={TAG:9,_0:r,[Symbol.for("name")]:"ASTKeyValue"};break;case"Lambda":t={TAG:10,_0:r,[Symbol.for("name")]:"ASTLambda"};break;case"LetStatement":t={TAG:11,_0:r,[Symbol.for("name")]:"ASTLetStatement"};break;case"ModuleIdentifier":t={TAG:12,_0:r,[Symbol.for("name")]:"ASTModuleIdentifier"};break;case"Program":t={TAG:1,_0:r,[Symbol.for("name")]:"ASTProgram"};break;case"Record":t={TAG:3,_0:r,[Symbol.for("name")]:"ASTRecord"};break;case"String":t={TAG:13,_0:r,[Symbol.for("name")]:"ASTString"};break;case"Ternary":t={TAG:14,_0:r,[Symbol.for("name")]:"ASTTernary"};break;case"Void":t={TAG:15,_0:r,[Symbol.for("name")]:"ASTVoid"};break;default:throw{RE_EXN_ID:l,_1:r.type,Error:new Error}}return{location:r.location,content:t}}function p(r){return{location:r.location,content:{TAG:7,_0:r,[Symbol.for("name")]:"ASTIdentifier"}}}function v(r){return{location:r.location,content:{TAG:9,_0:r,[Symbol.for("name")]:"ASTKeyValue"}}}function d(r){var t,e,n=function(r,t){return o.concatMany(c.intersperse(s.fmap(r,_),t),"")},i=r.content;switch(0|i.TAG){case 0:case 1:break;case 2:return"["+n(i._0.elements,"; ")+"]";case 3:return"{"+(e=s.fmap(i._0.elements,v),", ",o.concatMany(c.intersperse(s.fmap(e,d),", "),"")+"}");case 6:var a=i._0;return"("+d(m(a.fn))+" "+n(a.args," ")+")";case 7:return":"+i._0.value;case 9:var u=i._0,f=u.key,l=u.value;return d(m(f))+": "+d(m(l));case 10:var g=i._0,h=g.body;return"{|"+(t=g.args,s.fmap(t,(function(r){return d(p(r))})).toString()+"| ")+d(m(h))+"}";case 11:var y=i._0,b=y.value;return d(p(y.variable))+" = "+d(m(b));case 12:return"@"+i._0.value;case 13:return"'"+String(i._0.value)+"'";case 14:var A=i._0,S=A.condition,T=A.trueExpression,E=A.falseExpression;return"(::$$_ternary_$$ "+d(m(S))+" "+d(m(T))+" "+d(m(E))+")";case 15:return"()";default:return String(i._0.value)}return"{"+n(i._0.statements,"; ")+"}"}function _(r){return d(m(r))}function g(r){return"Syntax Error: "+r._0+"}"}t.Extra=void 0,t.ParseError={getMessage:function(r){return r._0},getLocation:function(r){return r._1}},t.parse__=function(r,t){return f.parse(r,t)},t.syntaxErrorToLocation=function(r){return r.location},t.parse=function(r,t){try{return{TAG:0,_0:f.parse(r,{grammarSource:t}),[Symbol.for("name")]:"Ok"}}catch(r){var e=u.internalToOCamlException(r);if(e.RE_EXN_ID===n.$$Error){var o=e._1;return{TAG:1,_0:{_0:i.getExn(o.message),_1:o.location,[Symbol.for("name")]:"SyntaxError"},[Symbol.for("name")]:"Error"}}throw e}},t.UnsupportedPeggyNodeType=l,t.nodeToAST=m,t.nodeIdentifierToAST=p,t.nodeKeyValueToAST=v,t.pgToString=d,t.toString=_,t.toStringError=g,t.toStringResult=function(r){return 0===r.TAG?d(m(r._0)):"Error("+g(r._0)+")"}},66231:(r,t,e)=>{"use strict";var n=e(42687),o=e(4464);t.ExpressionBuilder=void 0,t.ExpressionT=void 0,t.Parse=void 0,t.fromNode=function r(t){var e,i,a,u,s,f,c=n.nodeToAST(t),l=c.content;switch(0|l.TAG){case 0:e=function(t){return o.eBlock(t.statements.map(r))}(l._0);break;case 1:f=l._0,e=o.eProgram(f.statements.map(r));break;case 2:e=o.eArray(l._0.elements.map(r));break;case 3:s=l._0,e=o.eRecord(s.elements.map((function(t){return[r(t.key),r(t.value)]})));break;case 4:e=o.eBool(l._0.value);break;case 6:var m=l._0;e=o.eCall(r(m.fn),m.args.map(r));break;case 7:e=o.eSymbol(l._0.value);break;case 5:case 8:e=o.eNumber(l._0.value);break;case 9:var p=l._0;e=o.eArray([r(p.key),r(p.value)]);break;case 10:a=(i=l._0).args.map((function(r){return r.value})),u=r(i.body),e=o.eLambda(a,u,i.name);break;case 11:var v=l._0;e=o.eLetStatement(v.variable.value,r(v.value));break;case 12:e=o.eIdentifier(l._0.value);break;case 13:e=o.eString(l._0.value);break;case 14:var d=l._0;e=o.eTernary(r(d.condition),r(d.trueExpression),r(d.falseExpression));break;case 15:e=o.eVoid}return{ast:c,content:e}}},11844:(r,t)=>{"use strict";t.topFrameName="<top>"},91638:(r,t,e)=>{"use strict";var n=e(71307),o=e(5777),i=e(40321),a=e(58199),u=e(73539);function s(r){if("number"==typeof r)return v;switch(0|r.TAG){case 0:return m(r._0);case 2:return i.$$Date.toString(r._0);case 3:return c(r._0);case 4:return u.toString(r._0);case 5:return p(r._0);case 1:case 6:return String(r._0);case 7:return f(r._0);case 8:return l(r._0);case 9:return i.Duration.toString(r._0)}}function f(r){return"{"+n.toArray(r).map((function(r){return r[0]+": "+s(r[1])})).toString()+"}"}function c(r){return a.toString(r,(function(r){return s({TAG:5,_0:r,[Symbol.for("name")]:"IEvLambda"})}))}function l(r){return"'"+r+"'"}function m(r){return"["+r.map(s).toString()+"]"}function p(r){return 0===r.TAG?"lambda("+r.parameters.toString()+"=>internal code)":"Builtin function"}var v="()",d=u.toString,_=f;function g(r){return r.map(s).toString()}function h(r){if("number"==typeof r)return 10;switch(0|r.TAG){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;case 7:return 7;case 8:return 8;case 9:return 9}}function y(r){switch(r){case 0:return"Array";case 1:return"Bool";case 2:return"Date";case 3:return"Declaration";case 4:return"Distribution";case 5:return"Lambda";case 6:return"Number";case 7:return"Record";case 8:return"String";case 9:return"Duration";case 10:return"Void"}}var b=n.toArray;t.T=void 0,t.toString=s,t.toStringArray=m,t.toStringBool=function(r){return String(r)},t.toStringCall=function(r){return":"+r},t.toStringDate=function(r){return i.$$Date.toString(r)},t.toStringDeclaration=c,t.toStringDistribution=d,t.toStringLambda=p,t.toStringNumber=function(r){return String(r)},t.toStringRecord=_,t.toStringString=l,t.toStringSymbol=function(r){return":"+r},t.toStringTimeDuration=function(r){return i.Duration.toString(r)},t.toStringVoid=v,t.toStringMap=f,t.toStringWithType=function(r){if("number"==typeof r)return"Void";switch(0|r.TAG){case 0:return"Array::"+s(r);case 1:return"Bool::"+s(r);case 3:return"Declaration::"+s(r);case 4:return"Distribution::"+s(r);case 5:return"Lambda::"+s(r);case 6:return"Number::"+s(r);case 7:return"Record::"+s(r);case 8:return"String::"+s(r);case 2:case 9:return"Date::"+s(r)}},t.argsToString=g,t.toStringFunctionCall=function(r){return r[0]+"("+g(r[1])+")"},t.toStringResult=function(r){return 0===r.TAG?"Ok("+s(r._0)+")":"Error("+o.toString(r._0)+")"},t.toStringResultOkless=function(r){return 0===r.TAG?s(r._0):"Error("+o.toString(r._0)+")"},t.valueToValueType=h,t.functionCallToCallSignature=function(r){return{_0:r[0],_1:r[1].map(h),[Symbol.for("name")]:"CallSignature"}},t.valueTypeToString=y,t.functionCallSignatureToString=function(r){return r._0+"("+r._1.map(y).toString()+")"},t.arrayToValueArray=function(r){return r},t.resultToValue=function(r){return 0===r.TAG?r._0:o.Message.$$throw(r._0)},t.recordToKeyValuePairs=b},51489:(r,t,e)=>{"use strict";var n=e(23025),o=e(62751),i=e(91377),a=e(5777),u=e(92162),s=e(21272),f=e(86119),c=e(26459),l=e(35128),m=e(75275);function p(r){return{items:i.make(void 0),stdLib:c.stdLib,environment:u.defaultEnvironment,previousRunOrder:[]}}function v(r,t,e){i.set(r.items,t,e)}function d(r,t){var e=s.getItem(r,t);v(r,t,m.touchSource(e))}function _(r,t){var e=l.getDependents(r,t);o.forEach(e,(function(t){d(r,t)}))}function g(r,t){d(r,t),_(r,t)}function h(r){var t=r.previousRunOrder,e=l.getRunOrder(r),n=l.runOrderDiff(e,t);o.forEach(n,(function(t){g(r,t)})),r.previousRunOrder=e}function y(r,t,e){v(r,t,m.setSource(s.getItem(r,t),e)),_(r,t)}function b(r,t){v(r,t,m.clean(s.getItem(r,t)))}function A(r,t){v(r,t,m.cleanResults(s.getItem(r,t)))}function S(r,t){var e=m.getResult(s.getItem(r,t));return void 0!==e?e:{TAG:1,_0:a.fromMessage(2),[Symbol.for("name")]:"Error"}}function T(r,t,e){v(r,t,m.setResult(s.getItem(r,t),e))}function E(r,t){var e=m.getPastChain(s.getItem(r,t)),n=f.mergeMany(o.concatMany([[r.stdLib],o.fmap(e,(function(t){return m.getContinuation(s.getItem(r,t))})),o.fmap(e,(function(t){var e,n=S(r,t);return e=0===n.TAG?n._0:a.$$throw(n._0),f.fromArray([["__result__",e]])}))])),i=m.getIncludesAsVariables(s.getItem(r,t));return o.reduce(i,n,(function(t,e){return f.set(t,e[0],f.toRecord(m.getContinuation(s.getItem(r,e[1]))))}))}function x(r,t){var e=u.createContext(E(r,t),r.environment);v(r,t,m.run(s.getItem(r,t),e))}function G(r,t,e){var o=m.getResult(s.getItem(r,t));if(void 0!==o)return o;if(0===e.TAG)return x(r,t),n.getWithDefault(m.getResult(s.getItem(r,t)),e);var i=e._0;return T(r,t,{TAG:1,_0:i,[Symbol.for("name")]:"Error"}),{TAG:1,_0:i,[Symbol.for("name")]:"Error"}}function w(r){var t=l.getRunOrder(r);o.reduce(t,{TAG:0,_0:0,[Symbol.for("name")]:"Ok"},(function(t,e){return G(r,e,t)}))}var D=s.getItem,k=s.getSourceIds,O=l.getDependents,M=l.getDependencies,F=l.getRunOrder,I=l.getRunOrderFor;t.Bindings=void 0,t.ProjectItem=void 0,t.T=void 0,t.Topology=void 0,t.getItem=D,t.getSourceIds=k,t.getDependents=O,t.getDependencies=M,t.getRunOrder=F,t.getRunOrderFor=I,t.createProject=p,t.setItem=v,t.touchSource_=d,t.touchDependents=_,t.touchSource=g,t.handleNewTopology=h,t.getSource=function(r,t){return n.map(i.get(r.items,t),m.getSource)},t.setSource=y,t.removeSource=function(r,t){i.remove(r.items,t)},t.clean=b,t.cleanAll=function(r){o.forEach(s.getSourceIds(r),(function(t){b(r,t)}))},t.cleanResults=A,t.cleanAllResults=function(r){o.forEach(s.getSourceIds(r),(function(t){A(r,t)}))},t.getIncludes=function(r,t){return m.getIncludes(s.getItem(r,t))},t.getPastChain=function(r,t){return m.getPastChain(s.getItem(r,t))},t.getIncludesAsVariables=function(r,t){return m.getIncludesAsVariables(s.getItem(r,t))},t.getDirectIncludes=function(r,t){return m.getDirectIncludes(s.getItem(r,t))},t.setContinues=function(r,t,e){v(r,t,m.setContinues(s.getItem(r,t),e)),h(r)},t.getContinues=function(r,t){return m.getContinues(s.getItem(r,t))},t.removeContinues=function(r,t){v(r,t,m.removeContinues(s.getItem(r,t))),h(r)},t.setContinuation=function(r,t,e){v(r,t,m.setContinuation(s.getItem(r,t),e))},t.getResultOption=function(r,t){return m.getResult(s.getItem(r,t))},t.getResult=S,t.setResult=T,t.parseIncludes=function(r,t){v(r,t,m.parseIncludes(s.getItem(r,t))),h(r)},t.rawParse=function(r,t){v(r,t,m.rawParse(s.getItem(r,t)))},t.getStdLib=function(r){return r.stdLib},t.setStdLib=function(r,t){r.stdLib=t},t.getEnvironment=function(r){return r.environment},t.setEnvironment=function(r,t){r.environment=t},t.getBindings=function(r,t){return m.getContinuation(s.getItem(r,t))},t.getBindingsAsRecord=function(r,t){return f.toRecord(m.getContinuation(s.getItem(r,t)))},t.getContinuationsBefore=function(r,t){return o.fmap(m.getPastChain(s.getItem(r,t)),(function(t){return m.getContinuation(s.getItem(r,t))}))},t.linkDependencies=E,t.doLinkAndRun=x,t.tryRunWithResult=G,t.runAll=w,t.run=function(r,t){var e=l.getRunOrderFor(r,t);o.reduce(e,{TAG:0,_0:0,[Symbol.for("name")]:"Ok"},(function(t,e){return G(r,e,t)}))},t.evaluate=function(r){var t=p();return y(t,"main",r),w(t),[n.getWithDefault(m.getResult(s.getItem(t,"main")),{TAG:0,_0:0,[Symbol.for("name")]:"Ok"}),f.toMap(m.getContinuation(s.getItem(t,"main")))]}},97007:r=>{"use strict";function t(r,e,n,o){var i=Error.call(this,r);return Object.setPrototypeOf&&Object.setPrototypeOf(i,t.prototype),i.expected=e,i.found=n,i.location=o,i.name="SyntaxError",i}function e(r,t,e){return e=e||" ",r.length>t?r:(t-=r.length,r+(e+=e.repeat(t)).slice(0,t))}!function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(t,Error),t.prototype.format=function(r){var t="Error: "+this.message;if(this.location){var n,o=null;for(n=0;n<r.length;n++)if(r[n].source===this.location.source){o=r[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,a=this.location.source+":"+i.line+":"+i.column;if(o){var u=this.location.end,s=e("",i.line.toString().length," "),f=o[i.line-1],c=(i.line===u.line?u.column:f.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+s+" |\n"+i.line+" | "+f+"\n"+s+" | "+e("",i.column-1," ")+e("",c,"^")}else t+="\n at "+a}return t},t.buildMessage=function(r,t){var e={literal:function(r){return'"'+o(r.text)+'"'},class:function(r){var t=r.parts.map((function(r){return Array.isArray(r)?i(r[0])+"-"+i(r[1]):i(r)}));return"["+(r.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function o(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function i(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function a(r){return e[r.type](r)}return"Expected "+function(r){var t,e,n=r.map(a);if(n.sort(),n.length>0){for(t=1,e=1;t<n.length;t++)n[t-1]!==n[t]&&(n[e]=n[t],e++);n.length=e}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(r)+" but "+function(r){return r?'"'+o(r)+'"':"end of input"}(t)+" found."},r.exports={SyntaxError:t,parse:function(r,e){var n,o,i,a,u={},s=(e=void 0!==e?e:{}).grammarSource,f={start:tr},c=tr,l="#include",m=/^[^']/,p=/^[^"]/,v=/^[^*]/,d=/^[ \t]/,_=/^[\n\r]/,g=/^[^\r\n]/,h=/^[_a-z]/,y=/^[_a-z0-9]/i,b=K("#",!1),A=K("#include",!1),S=K("as",!1),T=Z("string"),E=K("'",!1),x=H(["'"],!0,!1),G=K('"',!1),w=H(['"'],!0,!1),D=Z("comment"),k=K("//",!1),O=K("/*",!1),M=H(["*"],!0,!1),F=K("*/",!1),I=Z("white space"),P=H([" ","\t"],!1,!1),N=Z("newline"),R=H(["\n","\r"],!1,!1),C=Z("code"),L=H(["\r","\n"],!0,!1),V=Z("identifier"),j=H(["_",["a","z"]],!1,!1),$=H(["_",["a","z"],["0","9"]],!1,!0),U=0,q=0,B=[{line:1,column:1}],X=0,W=[],z=0,Y={};if("startRule"in e){if(!(e.startRule in f))throw new Error("Can't start parsing from rule \""+e.startRule+'".');c=f[e.startRule]}function K(r,t){return{type:"literal",text:r,ignoreCase:t}}function H(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function Z(r){return{type:"other",description:r}}function J(t){var e,n=B[t];if(n)return n;for(e=t-1;!B[e];)e--;for(n={line:(n=B[e]).line,column:n.column};e<t;)10===r.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return B[t]=n,n}function Q(r,t){var e=J(r),n=J(t);return{source:s,start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function rr(r){U<X||(U>X&&(X=U,W=[]),W.push(r))}function tr(){var t,e,n,o,i,a=12*U+0,s=Y[a];if(s)return U=s.nextPos,s.result;for(t=U,e=[],(n=ar())===u&&(n=ir())===u&&(n=nr())===u&&(n=or());n!==u;)e.push(n),(n=ar())===u&&(n=ir())===u&&(n=nr())===u&&(n=or());if(n=function(){var t,e,n,o,i,a,s,f=12*U+1,c=Y[f];if(c)return U=c.nextPos,c.result;if(t=U,(e=er())!==u){if(n=[],o=U,i=[],(a=ar())!==u)for(;a!==u;)i.push(a),a=ar();else i=u;for(i!==u&&(a=er())!==u?o=a:(U=o,o=u);o!==u;){if(n.push(o),o=U,i=[],(a=ar())!==u)for(;a!==u;)i.push(a),a=ar();else i=u;i!==u&&(a=er())!==u?o=a:(U=o,o=u)}q=t,s=n,t=[e,...s].filter((r=>""!=r))}else U=t,t=u;return t===u&&(t=U,e=U,z++,35===r.charCodeAt(U)?(n="#",U++):(n=u,0===z&&rr(b)),z--,n===u?e=void 0:(U=e,e=u),e!==u&&(q=t,e=[]),t=e),Y[f]={nextPos:U,result:t},t}(),n!==u){for(o=[],i=ar();i!==u;)o.push(i),i=ar();i=function(){var r,t,e=12*U+5,n=Y[e];if(n)return U=n.nextPos,n.result;for(r=[],(t=ur())===u&&(t=ar())===u&&(t=ir());t!==u;)r.push(t),(t=ur())===u&&(t=ar())===u&&(t=ir());return Y[e]={nextPos:U,result:r},r}(),t=n}else U=t,t=u;return Y[a]={nextPos:U,result:t},t}function er(){var t,e=12*U+2,n=Y[e];return n?(U=n.nextPos,n.result):(t=function(){var t,e,n,o,i,a,s,f,c,v,d=12*U+3,_=Y[d];if(_)return U=_.nextPos,_.result;for(t=U,e=[],n=ir();n!==u;)e.push(n),n=ir();if(r.substr(U,8)===l?(n=l,U+=8):(n=u,0===z&&rr(A)),n!==u){if(o=[],(i=ir())!==u)for(;i!==u;)o.push(i),i=ir();else o=u;if(o!==u)if(i=function(){var t,e,n,o,i,a=12*U+4,s=Y[a];if(s)return U=s.nextPos,s.result;if(z++,t=U,e=U,39===r.charCodeAt(U)?(n="'",U++):(n=u,0===z&&rr(E)),n!==u){for(o=[],m.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr(x));i!==u;)o.push(i),m.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr(x));39===r.charCodeAt(U)?(i="'",U++):(i=u,0===z&&rr(E)),i!==u?e=o:(U=e,e=u)}else U=e,e=u;if(e!==u&&(q=t,e=e.join("")),(t=e)===u){if(t=U,e=U,34===r.charCodeAt(U)?(n='"',U++):(n=u,0===z&&rr(G)),n!==u){for(o=[],p.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr(w));i!==u;)o.push(i),p.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr(w));34===r.charCodeAt(U)?(i='"',U++):(i=u,0===z&&rr(G)),i!==u?e=o:(U=e,e=u)}else U=e,e=u;e!==u&&(q=t,e=e.join("")),t=e}return z--,t===u&&(e=u,0===z&&rr(T)),Y[a]={nextPos:U,result:t},t}(),i!==u){if(a=U,s=[],(f=ir())!==u)for(;f!==u;)s.push(f),f=ir();else s=u;if(s!==u)if("as"===r.substr(U,2)?(f="as",U+=2):(f=u,0===z&&rr(S)),f!==u){if(c=[],(v=ir())!==u)for(;v!==u;)c.push(v),v=ir();else c=u;c!==u?(v=function(){var t,e,n,o,i,a=12*U+11,s=Y[a];if(s)return U=s.nextPos,s.result;if(z++,t=U,e=U,n=[],h.test(r.charAt(U))?(o=r.charAt(U),U++):(o=u,0===z&&rr(j)),o!==u)for(;o!==u;)n.push(o),h.test(r.charAt(U))?(o=r.charAt(U),U++):(o=u,0===z&&rr(j));else n=u;if(n!==u){for(o=[],y.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr($));i!==u;)o.push(i),y.test(r.charAt(U))?(i=r.charAt(U),U++):(i=u,0===z&&rr($));e=n=[n,o]}else U=e,e=u;return e!==u&&(q=t,e=r.substring(q,U)),z--,(t=e)===u&&(e=u,0===z&&rr(V)),Y[a]={nextPos:U,result:t},t}(),v!==u?a=v:(U=a,a=u)):(U=a,a=u)}else U=a,a=u;else U=a,a=u;for(a===u&&(a=null),s=[],f=ir();f!==u;)s.push(f),f=ir();f=U,z++,c=ar(),z--,c!==u?(U=f,f=void 0):f=u,f!==u?(q=t,t=[a||"",i]):(U=t,t=u)}else U=t,t=u;else U=t,t=u}else U=t,t=u;return Y[d]={nextPos:U,result:t},t}(),t===u&&(t=nr())===u&&(t=or()),Y[e]={nextPos:U,result:t},t)}function nr(){var t,e,n,o,i,a=12*U+6,s=Y[a];if(s)return U=s.nextPos,s.result;if(z++,t=U,"//"===r.substr(U,2)?(e="//",U+=2):(e=u,0===z&&rr(k)),e!==u){for(n=[],o=ur();o!==u;)n.push(o),o=ur();o=U,z++,i=ar(),z--,i!==u?(U=o,o=void 0):o=u,o!==u?(q=t,t=""):(U=t,t=u)}else U=t,t=u;return z--,t===u&&(e=u,0===z&&rr(D)),Y[a]={nextPos:U,result:t},t}function or(){var t,e,n,o,i=12*U+7,a=Y[i];if(a)return U=a.nextPos,a.result;if(z++,t=U,"/*"===r.substr(U,2)?(e="/*",U+=2):(e=u,0===z&&rr(O)),e!==u){for(n=[],v.test(r.charAt(U))?(o=r.charAt(U),U++):(o=u,0===z&&rr(M));o!==u;)n.push(o),v.test(r.charAt(U))?(o=r.charAt(U),U++):(o=u,0===z&&rr(M));"*/"===r.substr(U,2)?(o="*/",U+=2):(o=u,0===z&&rr(F)),o!==u?(q=t,t=""):(U=t,t=u)}else U=t,t=u;return z--,t===u&&(e=u,0===z&&rr(D)),Y[i]={nextPos:U,result:t},t}function ir(){var t,e=12*U+8,n=Y[e];return n?(U=n.nextPos,n.result):(z++,d.test(r.charAt(U))?(t=r.charAt(U),U++):(t=u,0===z&&rr(P)),z--,t===u&&0===z&&rr(I),Y[e]={nextPos:U,result:t},t)}function ar(){var t,e=12*U+9,n=Y[e];return n?(U=n.nextPos,n.result):(z++,_.test(r.charAt(U))?(t=r.charAt(U),U++):(t=u,0===z&&rr(R)),z--,t===u&&0===z&&rr(N),Y[e]={nextPos:U,result:t},t)}function ur(){var t,e=12*U+10,n=Y[e];return n?(U=n.nextPos,n.result):(z++,g.test(r.charAt(U))?(t=r.charAt(U),U++):(t=u,0===z&&rr(L)),z--,t===u&&0===z&&rr(C),Y[e]={nextPos:U,result:t},t)}if((n=c())!==u&&U===r.length)return n;throw n!==u&&U<r.length&&rr({type:"end"}),o=W,i=X<r.length?r.charAt(X):null,a=X<r.length?Q(X,X+1):Q(X,X),new t(t.buildMessage(o,i),o,i,a)}}},61083:(r,t,e)=>{"use strict";var n=e(11126),o=e(9438),i=e(23025),a=e(20114),u=e(62751),s=e(5777),f=e(97007),c=e(68034),l=e(42687);t.parse__=function(r){return f.parse(r)},t.parseIncludes=function(r){try{var t=f.parse(r);return{TAG:0,_0:u.fmap(t,(function(r){return[o.get(r,0),o.get(r,1)]})),[Symbol.for("name")]:"Ok"}}catch(r){var e=a.internalToOCamlException(r);if(e.RE_EXN_ID===n.$$Error){var m=e._1;return{TAG:1,_0:s.fromMessageWithFrameStack({TAG:12,_0:i.getExn(m.message),[Symbol.for("name")]:"RESyntaxError"},c.makeSingleFrameStack(l.syntaxErrorToLocation(m))),[Symbol.for("name")]:"Error"}}throw e}}},75275:(r,t,e)=>{"use strict";var n=e(23025),o=e(17978),i=e(20114),a=e(62751),u=e(17646),s=e(21374),f=e(5777),c=e(37151),l=e(86119),m=e(10277),p=e(42687),v=e(66231),d=e(61083);function _(r){return{source:"",sourceId:r,rawParse:void 0,expression:void 0,continuation:l.make(void 0),result:void 0,continues:[],includes:{TAG:0,_0:[],[Symbol.for("name")]:"Ok"},includeAsVariables:[],directIncludes:[]}}function g(r){var t=_(r.sourceId);return{source:r.source,sourceId:t.sourceId,rawParse:t.rawParse,expression:t.expression,continuation:t.continuation,result:t.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function h(r){var t=_(r.sourceId);return{source:r.source,sourceId:t.sourceId,rawParse:r.rawParse,expression:t.expression,continuation:t.continuation,result:t.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function y(r){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function b(r){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:{TAG:0,_0:[],[Symbol.for("name")]:"Ok"},includeAsVariables:[],directIncludes:[]}}function A(r,t){return h({source:r.source,sourceId:r.sourceId,rawParse:t,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes})}function S(r,t){return y({source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:t,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes})}function T(r,t){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:t,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function E(r,t){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:t,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function x(r,t){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:t,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}}function G(r){return s.errMap(p.parse(r.source,r.sourceId),f.fromParseError)}function w(r){return A(r,u.defaultFn(r.rawParse,(function(t){return G(r)})))}function D(r){return n.map(r.rawParse,(function(r){return o.map(r,v.fromNode)}))}function k(r){var t=w(r);return void 0!==t.expression?t:u.defaultFn(n.map(D(t),(function(r){return S(t,r)})),(function(r){return t}))}function O(r,t){return T(E(r,{TAG:1,_0:t,[Symbol.for("name")]:"Error"}),l.make(void 0))}function M(r,t){var e=r.expression;if(void 0===e)return O(r,f.fromMessage({TAG:13,_0:"attempt to run without expression",[Symbol.for("name")]:"RETodo"}));if(0!==e.TAG)return O(r,e._0);try{var n=m.evaluate(e._0,t);return T(E(r,{TAG:0,_0:n[0],[Symbol.for("name")]:"Ok"}),c.locals(n[1].bindings))}catch(t){var o=i.internalToOCamlException(t);return O(r,f.fromException(o))}}var F=y;t.T=void 0,t.emptyItem=_,t.getSource=function(r){return r.source},t.getSourceId=function(r){return r.sourceId},t.getRawParse=function(r){return r.rawParse},t.getExpression=function(r){return r.expression},t.getContinuation=function(r){return r.continuation},t.getResult=function(r){return r.result},t.getContinues=function(r){return r.continues},t.getIncludes=function(r){return r.includes},t.getDirectIncludes=function(r){return r.directIncludes},t.getIncludesAsVariables=function(r){return r.includeAsVariables},t.touchSource=g,t.touchRawParse=h,t.touchExpression=y,t.resetIncludes=b,t.setSource=function(r,t){return g(b({source:t,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}))},t.setRawParse=A,t.setExpression=S,t.setContinuation=T,t.setResult=E,t.cleanResults=F,t.clean=function(r){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes}},t.getImmediateDependencies=function(r){return o.map(r.includes,(function(t){return t.concat(r.continues)}))},t.getPastChain=function(r){return r.directIncludes.concat(r.continues)},t.setContinues=function(r,t){return g({source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:t,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes})},t.removeContinues=function(r){return g({source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:[],includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:r.directIncludes})},t.setIncludes=x,t.setImportAsVariables=function(r,t){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:t,directIncludes:r.directIncludes}},t.setDirectImports=function(r,t){return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:r.includes,includeAsVariables:r.includeAsVariables,directIncludes:t}},t.parseIncludes=function(r){var t=d.parseIncludes(r.source);if(0!==t.TAG)return x(b(r),{TAG:1,_0:t._0,[Symbol.for("name")]:"Error"});var e=t._0,n={TAG:0,_0:a.fmap(e,(function(r){return r[1]})),[Symbol.for("name")]:"Ok"},o=a.filter(e,(function(r){return""!==r[0]})),i=a.fmap(a.filter(e,(function(r){return""===r[0]})),(function(r){return r[1]}));return{source:r.source,sourceId:r.sourceId,rawParse:r.rawParse,expression:r.expression,continuation:r.continuation,result:r.result,continues:r.continues,includes:n,includeAsVariables:o,directIncludes:i}},t.doRawParse=G,t.rawParse=w,t.doBuildExpression=D,t.buildExpression=k,t.failRun=O,t.doRun=M,t.run=function(r,t){var e=k(r);return void 0!==e.result?e:M(e,t)}},21272:(r,t,e)=>{"use strict";var n=e(91377),o=e(75275);t.ProjectItem=void 0,t.getSourceIds=function(r){return n.keysToArray(r.items)},t.getItem=function(r,t){return n.getWithDefault(r.items,t,o.emptyItem(t))}},35128:(r,t,e)=>{"use strict";var n=e(30776),o=e(43924),i=e(17978),a=e(71307),u=e(62751),s=e(21272),f=e(75275);function c(r,t,e){var n=i.getWithDefault(f.getImmediateDependencies(s.getItem(r,t)),[]),o=a.set(e[0],t,!0),l=u.reduce(n,[o,e[1]],(function(t,e){var n=t[1],o=t[0];return a.getWithDefault(o,e,!1)?[o,n]:c(r,e,[o,n])}));return[l[0],{hd:t,tl:l[1]}]}function l(r){var t=u.reduce(s.getSourceIds(r),[void 0,0],(function(t,e){var n=t[1],o=t[0];return a.getWithDefault(o,e,!1)?[o,n]:c(r,e,[o,n])}));return n.toArray(n.reverse(t[1]))}var m=s.getSourceIds,p=s.getItem,v=l;t.ProjectItem=void 0,t.T=void 0,t.getSourceIds=m,t.getItem=p,t.getImmediateDependencies=function(r,t){return f.getImmediateDependencies(s.getItem(r,t))},t.topologicalSortUtil=c,t.getTopologicalSort=l,t.getRunOrder=v,t.getRunOrderFor=function(r,t){var e=c(r,t,[void 0,0]);return n.toArray(n.reverse(e[1]))},t.getDependencies=function(r,t){var e=l(r),n=e.indexOf(t);return e.slice(0,n)},t.getDependents=function(r,t){var e=l(r),n=e.indexOf(t);return o.sliceToEnd(e,n+1|0)},t.runOrderDiff=function(r,t){var e=u.length(r)>u.length(t)?u.length(r)-u.length(t)|0:0,n=t.slice(0),i=o.make(e,"");u.forEach(i,(function(r){n.push("")}));var a=u.zip(r,n);return u.reduce(a,[!0,[]],(function(r,t){var e=t[0],n=r[1];return r[0]&&e===t[1]?[!0,n]:[!1,u.concat(n,[e])]}))[1]}},5777:(r,t,e)=>{"use strict";var n=e(10456),o=e(11126),i=e(22525),a=e(20114),u=e(70749),s=e(72540),f=e(68034),c=i.create("SqError-QuriSquiggleLang.Message.MessageException");function l(r){if("number"==typeof r)switch(r){case 0:return"Assignment expected";case 1:return"Expression expected";case 2:return"Need to run"}else switch(0|r.TAG){case 0:return String(r._1)+" arguments expected. Instead "+String(r._2)+" argument(s) were passed.";case 1:return r._0+": "+String(r._1);case 2:return"Distribution Math Error: "+s.$$Error.toString(r._0);case 3:return"Expected type: "+r._0+" but got: "+r._1;case 4:return"Function expected: "+r._0;case 5:return"Function not found: "+r._0;case 6:var t=r._1,e=r._0,n="JS Exception:",o=void 0!==t?n+" "+t:n;return void 0!==e?o+": "+e:o;case 7:return"Macro not found: "+r._0;case 8:return r._0+" is not a function";case 9:return"Math Error: "+u.$$Error.toString(r._0);case 10:return r._0+": "+r._1;case 11:return r._0+" is not defined";case 12:return"Syntax Error: "+r._0;case 13:return"TODO: "+r._0;case 14:return"Unit not found: "+r._0;case 15:return"Error: "+r._0}}var m={MessageException:c,toString:l,fromException:function(r){if(r.RE_EXN_ID===c)return r._1;if(r.RE_EXN_ID!==o.$$Error)return{TAG:15,_0:"Unknown error",[Symbol.for("name")]:"REOther"};var t=r._1,e=t.message;if(void 0!==e)return{TAG:15,_0:e,[Symbol.for("name")]:"REOther"};var n=t.name;return void 0!==n?{TAG:15,_0:n,[Symbol.for("name")]:"REOther"}:{TAG:15,_0:"Unknown error",[Symbol.for("name")]:"REOther"}},$$throw:function(r){throw{RE_EXN_ID:c,_1:r,Error:new Error}}},p=i.create("SqError-QuriSquiggleLang.SqException");t.Message=m,t.SqException=p,t.fromMessageWithFrameStack=function(r,t){return{message:r,frameStack:t}},t.fromMessage=function(r){return{message:r,frameStack:f.make(void 0)}},t.fromParseError=function(r){return{message:{TAG:12,_0:r._0,[Symbol.for("name")]:"RESyntaxError"},frameStack:f.makeSingleFrameStack(r._1)}},t.getTopFrame=function(r){return f.getTopFrame(r.frameStack)},t.getFrameStack=function(r){return r.frameStack},t.toString=function(r){return l(r.message)},t.createOtherError=function(r){return{message:{TAG:15,_0:r,[Symbol.for("name")]:"REOther"},frameStack:f.make(void 0)}},t.getFrameArray=function(r){return f.toFrameArray(r.frameStack)},t.toStringWithStackTrace=function(r){return l(r.message)+(f.isEmpty(r.frameStack)?"\nStack trace:\n"+f.toString(r.frameStack):"")},t.$$throw=function(r){throw{RE_EXN_ID:p,_1:r,Error:new Error}},t.throwMessageWithFrameStack=function(r,t){throw{RE_EXN_ID:p,_1:{message:r,frameStack:t},Error:new Error}},t.fromException=function(r){if(r.RE_EXN_ID===p)return r._1;if(r.RE_EXN_ID===c)return{message:r._1,frameStack:f.make(void 0)};if(r.RE_EXN_ID!==o.$$Error)return{message:{TAG:15,_0:"Unknown exception",[Symbol.for("name")]:"REOther"},frameStack:f.make(void 0)};var t=r._1;return{message:{TAG:6,_0:t.message,_1:t.name,[Symbol.for("name")]:"REJavaScriptExn"},frameStack:f.make(void 0)}},t.rethrowWithFrameStack=function(r,t){try{return n._1(r,void 0)}catch(r){var e=a.internalToOCamlException(r);if(e.RE_EXN_ID===p)throw{RE_EXN_ID:p,_1:e._1,Error:new Error};if(e.RE_EXN_ID===c)throw{RE_EXN_ID:p,_1:{message:e._1,frameStack:t},Error:new Error};if(e.RE_EXN_ID===o.$$Error){var i=e._1,u={TAG:6,_0:i.message,_1:i.name,[Symbol.for("name")]:"REJavaScriptExn"};throw{RE_EXN_ID:p,_1:{message:u,frameStack:t},Error:new Error}}throw{RE_EXN_ID:p,_1:{message:{TAG:15,_0:"Unknown exception",[Symbol.for("name")]:"REOther"},frameStack:t},Error:new Error}}}},64677:(r,t,e)=>{"use strict";var n=e(62751),o=e(86119),i=[["Math.pi",Math.PI],["Math.e",Math.E],["Math.ln2",Math.LN2],["Math.ln10",Math.LN10],["Math.log2e",Math.LOG2E],["Math.log10e",Math.LOG10E],["Math.sqrt2",Math.SQRT2],["Math.sqrt1_2",Math.SQRT1_2],["Math.phi",1.618033988749895],["Math.tau",6.283185307179586]];t.availableNumbers=i,t.make=function(r){return o.fromArray(n.fmap(i,(function(r){return[r[0],{TAG:6,_0:r[1],[Symbol.for("name")]:"IEvNumber"}]})))}},26459:(r,t,e)=>{"use strict";var n=e(71307),o=e(62751),i=e(5777),a=e(1578),u=e(86119),s=e(64677),f=e(65416),c=e(51324),l=e(80657),m=u.mergeFrom(u.mergeFrom(u.make(void 0),s.make(void 0)),l.make(void 0)),p=u.set(m,"$_atIndex_$",{TAG:5,_0:a.makeFFILambda("$_atIndex_$",(function(r,t,e){if(2!==r.length)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});var a=r[0];if("number"==typeof a)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});switch(0|a.TAG){case 0:var u=r[1];if("number"==typeof u)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});if(6!==u.TAG)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});var s=0|u._0,f=o.get(a._0,s);return void 0!==f?f:i.Message.$$throw({TAG:1,_0:"Array index not found",_1:s,[Symbol.for("name")]:"REArrayIndexNotFound"});case 7:var c=r[1];if("number"==typeof c)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});if(8!==c.TAG)return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"});var l=c._0,m=n.get(a._0,l);return void 0!==m?m:i.Message.$$throw({TAG:10,_0:"Record property not found",_1:l,[Symbol.for("name")]:"RERecordPropertyNotFound"});default:return i.Message.$$throw({TAG:15,_0:"Trying to access key on wrong value",[Symbol.for("name")]:"REOther"})}})),[Symbol.for("name")]:"IEvLambda"}),v=o.reduce(c.nonRegistryLambdas,p,(function(r,t){return u.set(r,t[0],{TAG:5,_0:t[1],[Symbol.for("name")]:"IEvLambda"})})),d=o.reduce(f.Registry.allNames(c.registry),v,(function(r,t){return u.set(r,t,{TAG:5,_0:a.makeFFILambda(t,(function(r,e,n){var o=c.call(t,r,e,n);return 0===o.TAG?o._0:i.Message.$$throw(o._0)})),[Symbol.for("name")]:"IEvLambda"})}));t.stdLib=d},80657:(r,t,e)=>{"use strict";var n=e(86119);t.make=function(r){return n.fromArray([["System.version",{TAG:8,_0:"0.4.0-dev",[Symbol.for("name")]:"IEvString"}]])}},40321:(r,t,e)=>{"use strict";var n=e(10456),o=e(21374),i=e(46366),a=315576e5,u={minute:6e4,hour:36e5,day:864e5,year:a,fromFloat:function(r){return r},toFloat:function(r){return r},fromMinutes:function(r){return 6e4*r},fromHours:function(r){return 36e5*r},fromDays:function(r){return 864e5*r},fromYears:function(r){return r*a},toMinutes:function(r){return r/6e4},toHours:function(r){return r/36e5},toDays:function(r){return r/864e5},toYears:function(r){return r/a},toString:function(r){var t=function(r,t){return i.with3DigitsPrecision(r)+" "+t+(1!==r?"s":"")},e=Math.abs(r);return e>=a?t(r/a,"year"):e>=864e5?t(r/864e5,"day"):e>=36e5?t(r/36e5,"hour"):e>=6e4?t(r/6e4,"minute"):i.toFixed(r)+"ms"},add:function(r,t){return r+t},subtract:function(r,t){return r-t},multiply:function(r,t){return r*t},divide:function(r,t){return r/t}};function s(r,t){return new Date(r.getTime()+t)}function f(r){return r<100?{TAG:1,_0:"Year must be over 100",[Symbol.for("name")]:"Error"}:r>2e5?{TAG:1,_0:"Year must be less than 200000",[Symbol.for("name")]:"Error"}:{TAG:0,_0:new Date(r,0),[Symbol.for("name")]:"Ok"}}var c={toFloat:function(r){return r.getTime()},getFullYear:function(r){return r.getFullYear()},toString:function(r){return r.toDateString()},fromFloat:function(r){return new Date(r)},fmap:function(r,t){return new Date(n._1(t,r.getTime()))},subtract:function(r,t){var e=r.getTime()-t.getTime();return e<0?{TAG:1,_0:"Cannot subtract a date by one that is in its future",[Symbol.for("name")]:"Error"}:{TAG:0,_0:e,[Symbol.for("name")]:"Ok"}},addDuration:s,subtractDuration:function(r,t){return new Date(r.getTime()-t)},makeWithYearInt:f,makeFromYear:function(r){var t=Math.floor(r);return o.fmap(f(0|t),(function(e){return s(e,(r-t)*a)}))}};t.Duration=u,t.$$Date=c},58199:(r,t,e)=>{"use strict";var n=e(10456),o=e(62751),i=e(46366),a=e(40321),u={make:function(r,t){return{TAG:0,min:r,max:t,[Symbol.for("name")]:"Float"}}},s={make:function(r,t){return{TAG:1,min:r,max:t,[Symbol.for("name")]:"Date"}}};function f(r){return 0===r.TAG?"Float({min: "+i.with2DigitsPrecision(r.min)+", max: "+i.with2DigitsPrecision(r.max)+"})":"Date({min: "+a.$$Date.toString(r.min)+", max: "+a.$$Date.toString(r.max)+"})"}var c={toString:f};t.ContinuousFloatArg=u,t.ContinuousTimeArg=s,t.Arg=c,t.make=function(r,t){return{fn:r,args:t}},t.toString=function(r,t){var e=o.joinWith(o.fmap(r.args,f),", ");return"fn: "+n._1(t,r.fn)+", args: ["+e+"]"}},62751:(r,t,e)=>{"use strict";var n=e(51958),o=e(10456),i=e(43925),a=e(65436),u=e(91413),s=e(30776),f=e(43924),c=e(9438),l=e(17978),m=e(5890),p=e(54178),v=e(22525),d=e(89875),_=e(17646),g=e(21374);function h(r){return f.get(r,r.length-1|0)}function y(r){return f.get(r,0)}function b(r,t,e){for(var n,i=0,a=r.length;i<a&&void 0===n;){var u=o._1(t,r[i]);o._1(e,u)&&(n=m.some(u)),i=i+1|0}return n}function A(r,t){var e=r.length,n=f.make(e,r[0]);return f.forEachWithIndex(r,(function(r,e){var i=0!==r?o._2(t,e,n[r-1|0]):e;f.set(n,r,i)})),n}function S(r,t){return f.zipBy(r,f.sliceToEnd(r,1),t)}function T(r){return f.map(f.keep(r,_.isSome),(function(r){return _.toExn(r,"Warning: This should not have happened")}))}function E(r){return _.flatten(b(r,(function(r){return o._1(r,void 0)}),_.isSome))}var x={concatSomes:T,defaultEmpty:function(r){return void 0!==r?r:[]},arrSomeToSomeArr:function(r){for(;;){var t=r,e=s.fromArray(t);if(!e)return[];if(void 0===e.hd)return;r=s.toArray(e.tl)}},firstSome:function(r){return f.getBy(r,_.isSome)},firstSomeFn:E,firstSomeFnWithDefault:function(r,t){return _.$$default(E(r),t)},openIfAllSome:function(r){if(f.every(r,_.isSome))return f.map(r,(function(r){return _.toExn(r,"Warning: This should not have happened")}))}};function G(r){var t=f.getBy(r,l.isError),e=void 0!==t&&0!==t.TAG?{TAG:1,_0:t._0,[Symbol.for("name")]:"Error"}:{TAG:0,_0:r,[Symbol.for("name")]:"Ok"};return l.map(e,(function(r){return f.map(r,l.getExn)}))}var w={firstErrorOrOpen:G,filterOk:function(r){return T(f.map(r,g.toOption))},forM:function(r,t){return G(f.map(r,t))},foldM:function(r,t,e){for(var n=t,i={TAG:0,_0:void 0,[Symbol.for("name")]:"Ok"},a=!1,u=0;!0!==a&&u<r.length;){var s=o._2(e,n,c.get(r,u));0===s.TAG?n=s._0:(i={TAG:1,_0:s._0,[Symbol.for("name")]:"Error"},a=!0),u=u+1|0}var f=i;return 0===f.TAG?{TAG:0,_0:n,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:f._0,[Symbol.for("name")]:"Error"}}},D=n.float_compare;function k(r){var t,e=new Float64Array(r);return e.sort(),t=e,Array.from(t)}var O=v.create("E_A-QuriSquiggleLang.Floats.RangeError"),M={min:y,max:h,range:function(r,t,e){var n=void 0!==r?r:y,i=void 0!==t?t:h,a=o._1(n,e),u=o._1(i,e);if(void 0!==a&&void 0!==u)return u-a},binarySearchFirstElementGreaterIndex:function(r,t){var e=p.binarySearchBy(r,t,D),n=e<0?Math.imul(e,-1)-1|0:e;return n>=r.length?"overMax":0===n?"underMin":{NAME:"firstHigher",VAL:n}},concat:function(r,t){return k(f.concat(r,t))},concatMany:function(r){return k(f.concatMany(r))},makeIncrementalUp:function(r,t){return f.makeBy(1+(t-r|0)|0,(function(t){return r+t|0}))},makeIncrementalDown:function(r,t){return f.makeBy(1+(r-t|0)|0,(function(t){return r-t|0}))}},F={mean:function(r){return i.mean(r)},geomean:function(r){return i.geomean(r)},mode:function(r){return i.mode(r)},variance:function(r){return i.variance(r)},stdev:function(r){return i.stdev(r)},sum:function(r){return i.sum(r)},product:function(r){return i.product(r)},random:a.random_int,floatCompare:D,sort:k,getNonFinite:function(r){return f.getBy(r,(function(r){return!Number.isFinite(r)}))},getBelowZero:function(r){return f.getBy(r,(function(r){return r<0}))},isSorted:function(r){return r.length<1||f.every(S(r,(function(r,t){return r<t})),(function(r){return r}))},percentile:function(r,t){return i.percentile(r,t,!1)},diff:function(r){return S(r,(function(r,t){return t-r}))},cumSum:function(r){return A(r,(function(r,t){return r+t}))},cumProd:function(r){return A(r,(function(r,t){return r*t}))},$$RangeError:O,range:function(r,t,e){switch(e){case 0:return[];case 1:return[r];case 2:return[r,t];default:if(r===t)return f.make(e,r);if(e<0)throw{RE_EXN_ID:O,_1:"n must be greater than 0",Error:new Error};if(r>t)throw{RE_EXN_ID:O,_1:"Min value is less then max value",Error:new Error};var n=(t-r)/(e-1|0);return f.makeBy(e,(function(t){return r+t*n}))}},min:function(r){return d.spliceApply(Math.min,[r])},max:function(r){return d.spliceApply(Math.max,[r])},Sorted:M},I=f.map,P=f.mapWithIndex,N=f.forEach,R=f.forEachWithIndex,C=f.get,L=f.getBy,V=f.getIndexBy,j=f.concat,$=f.concatMany,U=f.makeBy,q=f.slice,B=f.reduce,X=f.reduceReverse,W=f.reduceWithIndex,z=f.reduce,Y=f.some,K=f.every,H=p.stableSortBy,Z=f.zip,J=f.unzip,Q=s.fromArray,rr=f.keep;t.fmap=I,t.fmapi=P,t.forEach=N,t.forEachI=R,t.length=function(r){return r.length},t.unsafe_get=function(r,t){return r[t]},t.get=C,t.getBy=L,t.getIndexBy=V,t.last=h,t.first=y,t.concat=j,t.concatMany=$,t.makeBy=U,t.slice=q,t.reduce=B,t.reduceReverse=X,t.reducei=W,t.fold_left=z,t.some=Y,t.every=K,t.isEmpty=function(r){return r.length<1},t.stableSortBy=H,t.getByFmap=b,t.zip=Z,t.unzip=J,t.zip3=function(r,t,e){return f.map(f.zip(f.zip(r,t),e),(function(r){var t=r[0];return[t[0],t[1],r[1]]}))},t.to_list=Q,t.uniq=function(r){return f.reduce(r,[],(function(r,t){return f.some(r,(function(r){return t===r}))?r:f.concat([t],r)}))},t.intersperse=function(r,t){var e=f.concatMany(f.zipBy(r,t,(function(r,t){return[r,t]})));return f.concat(e,f.sliceToEnd(r,t.length))},t.accumulate=A,t.tail=function(r){return f.sliceToEnd(r,1)},t.pairwise=S,t.toRanges=function(r){return r.length>1?{TAG:0,_0:f.zip(r,f.sliceToEnd(r,1)),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:"Must be at least 2 elements",[Symbol.for("name")]:"Error"}},t.filter=rr,t.joinWith=function(r,t){return r.join(t)},t.transpose=function(r){for(var t=[],e=0,n=r.length;e<n;++e)for(var o=0,i=c.get(r,e).length;o<i;++o)t.length<=o?u.push([c.get(c.get(r,e),o)],t):u.push(c.get(c.get(r,e),o),c.get(t,o));return t},t.O=x,t.R=w,t.Floats=F,t.Sorted=void 0},46366:(r,t)=>{"use strict";t.with2DigitsPrecision=function(r){return r.toPrecision(2)},t.with3DigitsPrecision=function(r){return r.toPrecision(3)},t.toFixed=function(r){return r.toFixed()},t.toString=function(r){return r.toString()},t.$$isFinite=function(r){return Number.isFinite(r)},t.toInt=function(r){return 0|r}},53767:(r,t,e)=>{"use strict";var n=e(51958),o=e(71167),i=e(61769),a=n.float_compare,u=o.MakeComparable({cmp:a}),s=i.toArray;t.Id=u,t.empty=function(r){return i.make(u)},t.get=function(r,t){return i.get(t,r)},t.toArray=s},69129:(r,t)=>{"use strict";t.increment=function(r){return r+1|0},t.decrement=function(r){return r-1|0},t.toString=function(r){return r.toString()},t.toFloat=function(r){return r}},17646:(r,t,e)=>{"use strict";var n=e(10456),o=e(5890);function i(r,t){if(void 0!==r)return n._1(t,o.valFromOption(r))}function a(r,t){return void 0!==r?o.valFromOption(r):t}function u(r,t){if(void 0!==r)return o.valFromOption(r);throw{RE_EXN_ID:"Failure",_1:t,Error:new Error}}function s(r){if(void 0!==r)return o.valFromOption(r)}function f(r,t){if(void 0!==r)return i(t,(function(t){return o.some(n._1(r,t))}))}function c(r,t,e){return void 0!==t?void 0!==e?n._2(r,t,e)?t:e:t:void 0!==e?e:void 0}var l=u;t.dimap=function(r,t,e){return void 0!==r?n._1(t,o.valFromOption(r)):n._1(e,void 0)},t.fmap=function(r,t){if(void 0!==r)return o.some(n._1(t,o.valFromOption(r)))},t.bind=i,t.$$default=a,t.default=a,t.__esModule=!0,t.defaultFn=function(r,t){return void 0!==r?o.valFromOption(r):n._1(t,void 0)},t.isSome=function(r){return void 0!==r},t.isNone=function(r){return void 0===r},t.toExn=u,t.some=function(r){return o.some(r)},t.firstSome=function(r,t){return void 0!==r?r:t},t.toExt=l,t.flatten=s,t.apply=f,t.flatApply=function(r,t){return s(f(r,o.some(t)))},t.toBool=function(r){return void 0!==r},t.ffmap=function(r,t){if(void 0!==t)return n._1(r,o.valFromOption(t))},t.toString=function(r){return void 0!==r?r:""},t.toResult=function(r,t){return void 0!==r?{TAG:0,_0:o.valFromOption(r),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:t,[Symbol.for("name")]:"Error"}},t.compare=c,t.min=function(r,t){return c((function(r,t){return r<t}),r,t)},t.max=function(r,t){return c((function(r,t){return r>t}),r,t)}},21374:(r,t,e)=>{"use strict";var n=e(10456),o=e(17978),i=e(5890),a=e(22525).create("E_R-QuriSquiggleLang.Assertion");function u(r,t){return 0===r.TAG?{TAG:0,_0:n._1(t,r._0),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:r._0,[Symbol.for("name")]:"Error"}}function s(r,t){return 0===r.TAG?n._1(t,r._0):{TAG:1,_0:r._0,[Symbol.for("name")]:"Error"}}function f(r,t){return 0===t.TAG?t._0:r}function c(r,t){return 0===r.TAG?u(t,r._0):{TAG:1,_0:r._0,[Symbol.for("name")]:"Error"}}function l(r,t,e){return c(u(t,r),e)}var m=o.isOk;t.Assertion=a,t.result=function(r,t,e){return 0===e.TAG?n._1(r,e._0):n._1(t,e._0)},t.isOk=m,t.getError=function(r){return 0===r.TAG?void 0:i.some(r._0)},t.fmap=u,t.bind=s,t.toExn=function(r,t){if(0===r.TAG)return r._0;throw{RE_EXN_ID:a,_1:t,Error:new Error}},t.toExnFnString=function(r,t){if(0===t.TAG)return t._0;throw{RE_EXN_ID:a,_1:n._1(r,t._0),Error:new Error}},t.$$default=f,t.default=f,t.__esModule=!0,t.merge=function(r,t){return 0===r.TAG?0===t.TAG?{TAG:0,_0:[r._0,t._0],[Symbol.for("name")]:"Ok"}:{TAG:1,_0:t._0,[Symbol.for("name")]:"Error"}:{TAG:1,_0:r._0,[Symbol.for("name")]:"Error"}},t.toOption=function(r){if(0===r.TAG)return i.some(r._0)},t.errorIfCondition=function(r,t,e){return n._1(r,e)?{TAG:1,_0:t,[Symbol.for("name")]:"Error"}:{TAG:0,_0:e,[Symbol.for("name")]:"Ok"}},t.ap=function(r,t){return 0===r.TAG?{TAG:0,_0:n._1(r._0,t),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:r._0,[Symbol.for("name")]:"Error"}},t.ap$p=c,t.liftM2=l,t.liftJoin2=function(r,t,e){return s(l(r,t,e),(function(r){return r}))},t.fmap2=function(r,t){return 0===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:n._1(t,r._0),[Symbol.for("name")]:"Error"}},t.unify=function(r,t){return 0===r.TAG?r._0:n._1(t,r._0)},t.errMap=function(r,t){return 0===r.TAG?{TAG:0,_0:r._0,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:n._1(t,r._0),[Symbol.for("name")]:"Error"}}},40884:(r,t,e)=>{"use strict";var n=e(10456);t.first=function(r){return r[0]},t.second=function(r){return r[1]},t.toFnCall=function(r,t){return n._2(r,t[0],t[1])}},92421:(r,t,e)=>{"use strict";var n=e(10456);t.toFnCall=function(r,t){return n._3(r,t[0],t[1],t[2])}},70749:(r,t,e)=>{"use strict";var n=e(17646);function o(r){return"object"==typeof r||"Divide"===r||"Power"===r||"Logarithm"===r?void 0:"Multiply"===r?"Multiply":"Add"===r?"Add":"Subtract"}var i={fromAlgebraicOperation:o,canDoAlgebraicOperation:function(r){return n.isSome(o(r))},toFn:function(r){return"Multiply"===r?function(r,t){return r*t}:"Add"===r?function(r,t){return r+t}:function(r,t){return r-t}}};function a(r,t){return r>=0?{TAG:0,_0:Math.pow(r,t),[Symbol.for("name")]:"Ok"}:{TAG:1,_0:1,[Symbol.for("name")]:"Error"}}function u(r,t){return 0!==t?{TAG:0,_0:r/t,[Symbol.for("name")]:"Ok"}:{TAG:1,_0:0,[Symbol.for("name")]:"Error"}}function s(r,t){return 1===t?{TAG:1,_0:0,[Symbol.for("name")]:"Error"}:0===t?{TAG:0,_0:0,[Symbol.for("name")]:"Ok"}:r>0&&t>0?{TAG:0,_0:Math.log(r)/Math.log(t),[Symbol.for("name")]:"Ok"}:0===r?{TAG:1,_0:3,[Symbol.for("name")]:"Error"}:{TAG:1,_0:1,[Symbol.for("name")]:"Error"}}function f(r){return"object"==typeof r||"Logarithm"===r?"log":"Power"===r?"**":"Divide"===r?"/":"Multiply"===r?"*":"Add"===r?"+":"-"}var c={toFn:function(r,t,e){return"object"==typeof r?t<r.VAL?{TAG:0,_0:0,[Symbol.for("name")]:"Ok"}:s(t,e):"Logarithm"===r?s(t,e):"Power"===r?a(t,e):"Divide"===r?u(t,e):"Multiply"===r?{TAG:0,_0:t*e,[Symbol.for("name")]:"Ok"}:"Add"===r?{TAG:0,_0:t+e,[Symbol.for("name")]:"Ok"}:{TAG:0,_0:t-e,[Symbol.for("name")]:"Ok"}},toString:f,format:function(r,t,e){return t+" "+f(r)+" "+e}};function l(r){return"Multiply"===r?"*":"Add"===r?"+":"**"}var m={toString:l,format:function(r,t,e){return t+" "+l(r)+" "+e}},p={toFn:function(r,t,e){return"object"==typeof r?t<r.VAL?{TAG:0,_0:0,[Symbol.for("name")]:"Ok"}:s(t,e):"Power"===r?a(t,e):"Divide"===r?u(t,e):"Multiply"===r?{TAG:0,_0:t*e,[Symbol.for("name")]:"Ok"}:s(t,e)},format:function(r,t,e){return"object"==typeof r?"verticalLog("+t+", "+e+", epsilon="+r.VAL+") ":"Power"===r?"verticalPower("+t+", "+e+") ":"Divide"===r?"verticalDivide("+t+", "+e+") ":"Multiply"===r?"verticalMultiply("+t+", "+e+") ":"verticalLog("+t+", "+e+") "},toIntegralSumCacheFn:function(r){if("object"!=typeof r){if("Divide"===r)return function(r,t){return r/t};if("Multiply"===r)return function(r,t){return r*t}}return function(r,t){}},toIntegralCacheFn:function(r){return function(r,t){}}},v={toString:function(r,t,e){return"truncate("+e+", "+n.dimap(r,(function(r){return r.toString()}),(function(r){return"-inf"}))+", "+n.dimap(t,(function(r){return r.toString()}),(function(r){return"inf"}))+")"}};t.Convolution=i,t.$$Error={toString:function(r){if("number"!=typeof r)return r._0;switch(r){case 0:return"Cannot divide by zero";case 1:return"Operation returned complex result";case 2:return"Operation returned positive infinity";case 3:return"Operation returned negative infinity";case 4:return"SampleMap needs a function that converts a number to a number";case 5:return"This Pdf is invalid";case 6:return"This pathway is not yet implemented"}}},t.power=a,t.divide=u,t.logarithm=s,t.Algebraic=c,t.Pointwise=m,t.DistToFloat={format:function(r,t){if("object"!=typeof r)return"Mean"===r?"mean($value)":"sample($value)";var e=r.NAME;return"Inv"===e?"inv(x="+r.VAL+","+t+")":"Pdf"===e?"pdf(x="+r.VAL+","+t+")":"cdf(x="+r.VAL+","+t+")"}},t.Scale=p,t.Truncate=v},98:(r,t,e)=>{"use strict";var n=e(65436),o=e(62751),i=e(17646),a=["▁","▂","▃","▄","▅","▆","▇","█"],u=o.length(a);function s(r,t){var e=n.ceil_int(t/r*u)-1|0;return e>0?e:0}t.ticks=a,t._ticksLength=u,t._heightToTickIndex=s,t.create=function(r,t,e){if(0===o.length(r))return"";var n=i.$$default(t,o.Floats.max(r));return o.joinWith(o.fmap(o.fmap(r,(function(r){return s(n,r)})),(function(r){return i.toExn(o.get(a,r),"")})),"")}},18305:(r,t,e)=>{"use strict";var n=e(40054),o=e(72621),i=e(64136),a=e(47541),u=e(8170),s=e(6114),f=e(89145),c=e(38296),l=e(98073),m=e(5427),p=e(85853),v=e(53356),d=e(9279),_={cdf:function(r,t){return a(r,t)},pmf:function(r,t){return u(r,t)},quantile:function(r,t){return v(r,t)},mean:function(r){return f(r)},stdev:function(r){return l(r)},variance:function(r){return d(r)}},g={cdf:function(r,t,e){return o(r,t,e)},pdf:function(r,t,e){return i(r,t,e)},quantile:function(r,t,e){return m(r,t,e)},mean:function(r,t){return s(r,t)},stdev:function(r,t){return c(r,t)},variance:function(r,t){return p(r,t)}},h={sample:function(r,t){return n(r,t)}};t.Bernoulli=_,t.Logistic=g,t.Random=h,t.$$Math={}},52017:(r,t,e)=>{"use strict";var n=e(10456),o=e(91413),i=e(43924),a=e(9438),u=e(17266),s=e(24417),f=e(23025),c=e(62751),l=e(69129),m=e(17646),p=e(21374),v=e(46366),d=e(85659);function _(r){var t=r.length;return 1!==t?0!==t?{TAG:4,_0:r,[Symbol.for("name")]:"MultipleErrors"}:void 0:r[0]}var g={mapErrorArrayToError:_,toString:function r(t){switch(0|t.TAG){case 0:return t._0+" is not sorted";case 1:return t._0+" is empty";case 2:return t._0+" is not finite. Example value: "+v.toString(t._1);case 3:var e=t.p2Name,n=t.p1Name;return n+" and "+e+" have different lengths. "+n+" has length "+l.toString(t.p1Length)+" and "+e+" has length "+l.toString(t.p2Length);case 4:return"Multiple Errors: "+c.joinWith(c.fmap(c.fmap(t._0,r),(function(r){return"["+r+"]"})),", ")}}};function h(r,t,e,n,o){return e*((t-o)/(t-r))+n*((o-r)/(t-r))}function y(r){return r.xs}var b={xs:[],ys:[]};function A(r){return m.toExt(n._1(c.Floats.Sorted.min,r.xs),"Tried to perform an operation on an empty XYShape.")}function S(r){return m.toExt(n._1(c.Floats.Sorted.max,r.xs),"Tried to perform an operation on an empty XYShape.")}function T(r){return m.toExt(c.first(r.ys),"Tried to perform an operation on an empty XYShape.")}function E(r){return m.toExt(c.last(r.ys),"Tried to perform an operation on an empty XYShape.")}function x(r){return S(r)-A(r)}function G(r,t){return{xs:c.fmap(r.xs,t),ys:r.ys}}function w(r){return c.zip(r.xs,r.ys)}function D(r){return{xs:r[0],ys:r[1]}}function k(r){return D(c.unzip(r))}function O(r,t){return c.Floats.range(A(r),S(r),t)}function M(r,t){for(var e=c.length(r),n=[],i=[],u=0;u<e;++u){var s=a.get(t,u);0===s.TAG&&(o.push(a.get(r,u),n),o.push(s._0,i))}return{xs:n,ys:i}}function F(r){return{TAG:3,p1Name:"Xs",p2Name:"Ys",p1Length:c.length(r.xs),p2Length:c.length(r.ys),[Symbol.for("name")]:"DifferentLengths"}}function I(r){return 0===c.length(r.xs)}function P(r){var t=c.Floats.isSorted(r.xs)?void 0:{TAG:0,_0:"Xs",[Symbol.for("name")]:"NotSorted"},e=I(r)?{TAG:1,_0:"Xs",[Symbol.for("name")]:"IsEmpty"}:void 0,n=c.length(r.xs)!==c.length(r.ys)?F(r):void 0,o=m.fmap(c.Floats.getNonFinite(r.xs),(function(r){return{TAG:2,_0:"Xs",_1:r,[Symbol.for("name")]:"NotFinite"}})),i=m.fmap(c.Floats.getNonFinite(r.ys),(function(r){return{TAG:2,_0:"Ys",_1:r,[Symbol.for("name")]:"NotFinite"}}));return _(c.O.concatSomes([t,e,n,o,i]))}function N(r,t){var e={xs:r,ys:t},n=P(e);return void 0!==n?{TAG:1,_0:n,[Symbol.for("name")]:"Error"}:{TAG:0,_0:e,[Symbol.for("name")]:"Ok"}}var R={toXyShape:function(r){return r},xs:y,ys:function(r){return r.ys},length:function(r){return c.length(r.xs)},empty:b,isEmpty:function(r){return 0===c.length(r.xs)},minX:A,maxX:S,firstY:T,lastY:E,xTotalRange:x,mapX:G,mapY:function(r,t){return{xs:r.xs,ys:c.fmap(r.ys,t)}},mapYResult:function(r,t){var e=c.fmap(r.ys,t);return p.fmap(c.R.firstErrorOrOpen(e),(function(t){return{xs:r.xs,ys:t}}))},square:function(r){return G(r,(function(r){return Math.pow(r,2)}))},zip:w,fromArray:D,fromArrays:function(r,t){return{xs:r,ys:t}},accumulateYs:function(r,t){return D([r.xs,c.accumulate(r.ys,t)])},concat:function(r,t){return{xs:c.concat(r.xs,t.xs),ys:c.concat(r.ys,t.ys)}},fromZippedArray:k,equallyDividedXs:O,toJs:function(r){return{xs:r.xs,ys:r.ys}},filterYValues:function(r,t){var e=c.filter(w(r),(function(r){return n._1(t,r[1])}));return D(c.unzip(e))},filterOkYs:M,Validator:{fnName:"XYShape validate",notSortedError:function(r){return{TAG:0,_0:r,[Symbol.for("name")]:"NotSorted"}},notFiniteError:function(r,t){return{TAG:2,_0:r,_1:t,[Symbol.for("name")]:"NotFinite"}},isEmptyError:function(r){return{TAG:1,_0:r,[Symbol.for("name")]:"IsEmpty"}},differentLengthsError:F,areXsSorted:function(r){return c.Floats.isSorted(r.xs)},areXsEmpty:I,getNonFiniteXs:function(r){return c.Floats.getNonFinite(r.xs)},getNonFiniteYs:function(r){return c.Floats.getNonFinite(r.ys)},validate:P},make:N,makeFromZipped:function(r){var t=c.unzip(r);return N(t[0],t[1])}};function C(r){return c.Floats.min(c.fmap(r,A))}function L(r){return c.Floats.max(c.fmap(r,S))}function V(r,t){return c.Floats.range(C(r),L(r),t)}var j={minX:C,maxX:L,equallyDividedXs:V,allXs:function(r){return n._1(c.Floats.Sorted.concatMany,c.fmap(r,y))}};function $(r){return r[1]}function U(r,t){var e=w(r),n=c.getIndexBy(e,(function(r){return r[0]>t})),o=void 0!==n?0!==n?n-1|0:void 0:c.length(e)-1|0;return f.flatMap(o,(function(r){return c.get(e,r)}))}var q={x:function(r){return r[0]},y:$,first:function(r){return[A(r),T(r)]},last:function(r){return[S(r),E(r)]},getBy:function(r,t){return c.getBy(w(r),t)},firstAtOrBeforeXValue:U};function B(r,t){var e=n._2(c.Floats.Sorted.binarySearchFirstElementGreaterIndex,r.ys,t);if("object"!=typeof e)return"overMax"===e?S(r):A(r);var o=e.VAL,i=(o-1|0)<0?0:o-1|0,u=r.xs,s=r.ys;return a.get(s,i)!==t?h(a.get(s,i),a.get(s,o),a.get(u,i),a.get(u,o),t):a.get(u,i)}var X={linear:B};function W(r,t){var e=n._2(c.Floats.Sorted.binarySearchFirstElementGreaterIndex,r.xs,t);if("object"!=typeof e)return"overMax"===e?E(r):T(r);var o=e.VAL,i=(o-1|0)<0?0:o-1|0,u=r.xs,s=r.ys;return a.get(u,i)!==t?h(a.get(u,i),a.get(u,o),a.get(s,i),a.get(s,o),t):a.get(s,i)}var z={stepwiseIncremental:function(r,t){return m.fmap(U(r,t),$)},stepwiseIfAtX:function(r,t){return m.fmap(c.getBy(w(r),(function(r){return r[0]===t})),$)},linear:W,continuousInterpolator:function(r,t){return"Linear"===r?"UseZero"===t?function(r,t,e){if(t<0)return 0;if(t>=(c.length(r.xs)-1|0))return 0;var n=a.get(r.xs,t),o=(e-n)/(a.get(r.xs,t+1|0)-n);return a.get(r.ys,t)*(1-o)+a.get(r.ys,t+1|0)*o}:function(r,t,e){if(t<0)return a.get(r.ys,0);if(t>=(c.length(r.xs)-1|0))return a.get(r.ys,c.length(r.xs)-1|0);var n=a.get(r.xs,t),o=(e-n)/(a.get(r.xs,t+1|0)-n);return a.get(r.ys,t)*(1-o)+a.get(r.ys,t+1|0)*o}:"UseZero"===t?function(r,t,e){return t<0||t>=(c.length(r.xs)-1|0)?0:a.get(r.ys,t)}:function(r,t,e){return t<0?a.get(r.ys,0):t>=(c.length(r.xs)-1|0)?a.get(r.ys,c.length(r.xs)-1|0):a.get(r.ys,t)}},discreteInterpolator:function(r,t,e){return 0}};function Y(r,t){return{xs:r,ys:c.fmap(r,(function(r){return W(t,r)}))}}function K(r,t){return c.fmap(c.Floats.range(0,1,t),(function(t){return B(r,t)}))}var H={_replaceWithXs:Y,equallyDivideXByMass:K,proportionEquallyOverX:function(r,t){return Y(O(r,t),r)},proportionByProbabilityMass:function(r,t,e){return Y(K(e,t),r)}};function Z(r,t){return r[1]>t[1]?1:0}function J(r,t){return r[0]>t[0]?1:0}var Q={compareYs:Z,compareXs:J,sortByY:function(r){return c.stableSortBy(r,Z)},sortByX:function(r){return c.stableSortBy(r,J)},filterByX:function(r,t){return c.filter(r,(function(r){return n._1(t,r[0])}))}},rr=function(r,t,e,n){let o=e.xs.length,i=n.xs.length,a=[],u=[],s=-1,f=-1;for(;s<=o-1&&f<=i-1;){let c,l,m;if(f==i-1&&s<o-1||e.xs[s+1]<n.xs[f+1])s++,c=e.xs[s],l=e.ys[s],m=r(n,f,c);else if(s==o-1&&f<i-1||e.xs[s+1]>n.xs[f+1])f++,c=n.xs[f],m=n.ys[f],l=r(e,s,c);else if(s<o-1&&f<i&&e.xs[s+1]===n.xs[f+1])s++,f++,c=e.xs[s],l=e.ys[s],m=n.ys[f];else{if(s===o-1&&f===i-1){s=o,f=i;continue}console.log("PointwiseCombination Error",s,f)}a.push(c);let p=t(l,m);if(0!==p.TAG)return p;u.push(p._0)}return{TAG:0,_0:{xs:a,ys:u},[Symbol.for("name")]:"Ok"}};function tr(r,t){var e=c.intersperse(w(r),w(t));return D(c.unzip(e))}var er={combine:rr,combineAlongSupportOfSecondArgument0:function(r,t,e,i){for(var u=[],s=[],f=c.length(e.xs),l=c.length(i.xs),m=0,p=0,v=a.get(i.xs,0),d=a.get(i.xs,l-1|0);p<(l-1|0)&&m<(f-1|0);){var _,g=a.get(e.xs,m+1|0),h=a.get(i.xs,p+1|0);m<(f-1|0)&&p<l&&g<h&&v<=g&&h<=d?(m=m+1|0,_=[g,a.get(e.ys,m),n._3(r,i,p,g)]):m<f&&p<(l-1|0)&&g>h&&h>=v&&d>=g?(p=p+1|0,_=[h,n._3(r,e,m,h),a.get(i.ys,p)]):(m=m+1|0)<(f-1|0)&&p<(l-1|0)&&g===h&&g>=v&&d>=h?(p=p+1|0,_=[g,a.get(e.ys,m),a.get(i.ys,p)]):_=void 0,void 0!==_&&(o.push(n._2(t,_[1],_[2]),u),o.push(_[0],s))}return{TAG:0,_0:M(s,u),[Symbol.for("name")]:"Ok"}},enrichXyShape:function(r){var t=c.length(r.xs),e=t<d.Environment.defaultXYPointLength?u.div(Math.imul(10,d.Environment.defaultXYPointLength),t):10,n=o.mapi((function(n,i){if(i<(t-2|0)){var u=a.get(r.xs,i+1|0);if(Math.abs(n-u)<2*d.Epsilon.seven)return[n];var s=c.makeBy(e-1|0,(function(r){return r}));return o.mapi((function(r,t){return 0===t?n:n*(e-r)/e+u*r/e}),s)}return[n]}),r.xs),i=c.concatMany(n);return{xs:i,ys:c.fmap(i,(function(t){return W(r,t)}))}},addCombine:function(r,t,e){return p.toExn(rr(r,(function(r,t){return{TAG:0,_0:r+t,[Symbol.for("name")]:"Ok"}}),t,e),"Add operation should never fail")},combineEvenXs:function(r,t,e,o,i){var a=c.length(o.xs),u=c.length(i.xs);if(0===a)return 0!==u?i:b;if(0===u)return o;var s=V([o,i],e);return{xs:s,ys:c.fmap(s,(function(e){return n._2(r,n._2(t,e,o),n._2(t,e,i))}))}},intersperse:tr};function nr(r){return r[1][0]}function or(r){return[r[1][0],r[0][1]]}function ir(r){var t=r[1],e=r[0];return(t[1]-e[1])/(t[0]-e[0])}function ar(r,t){return m.fmap(p.toOption(c.toRanges(c.zip(r.xs,r.ys))),(function(r){return c.fmap(r,(function(r){return[nr(r),n._1(t,r)]}))}))}var ur={toT:k,nextX:nr,rangePointAssumingSteps:or,rangeAreaAssumingTriangles:function(r){var t=r[1],e=r[0];return(t[0]-e[0])*(e[1]+t[1])/2},rangeAreaAssumingTrapezoids:function(r){var t=r[1],e=t[1],n=r[0],o=n[1];return(t[0]-n[0])*(Math.min(o,e)+(o+e)/2)},delta_y_over_delta_x:ir,mapYsBasedOnRanges:ar,integrateWithTriangles:function(r){for(var t=r.ys,e=r.xs,n=c.length(e),o=i.make(n,0),u=0,s=c.length(e)-2|0;u<=s;++u)i.set(o,u+1|0,(a.get(e,u+1|0)-a.get(e,u))*((a.get(t,u)+a.get(t,u+1|0))/2)+a.get(o,u));return{xs:e,ys:o}},derivative:function(r){return ar(r,ir)},stepwiseToLinear:function(r){var t=r.ys,e=r.xs,n=c.length(e),o=new Array(n<<1),u=new Array(n<<1);i.set(o,0,a.get(e,0)-s.epsilon_float),i.set(u,0,0),i.set(o,1,a.get(e,0)),i.set(u,1,a.get(t,0));for(var f=1,l=c.length(e);f<l;++f)i.set(o,f<<1,a.get(e,f)-s.epsilon_float),i.set(u,f<<1,a.get(t,f-1|0)),i.set(o,1+(f<<1)|0,a.get(e,f)),i.set(u,1+(f<<1)|0,a.get(t,f));return{xs:o,ys:u}},stepsToContinuous:function(r){var t,e=x(r)*d.Epsilon.five,n=c.toRanges(c.zip(r.xs,r.ys));if(0===n.TAG){var o=c.fmap(n._0,or),i=D(c.unzip(o));t=tr(G(r,(function(r){return r+e})),i)}else t=r;var a=m.bind(m.fmap(t,w),(function(r){return c.get(r,0)}));if(void 0!==t&&void 0!==a){var u=a[0];if(0===u)return t;var s=c.concat([[u,0]],w(t));return m.some(D(c.unzip(s)))}}},sr={getVarianceDangerously:function(r,t,e){var o=Math.pow(n._1(t,r),2);return n._1(e,r)-o}};t.$$Error=g,t.interpolate=h,t.extImp=function(r){return m.toExt(r,"Tried to perform an operation on an empty XYShape.")},t.T=R,t.Ts=j,t.Pairs=q,t.YtoX=X,t.XtoY=z,t.XsConversion=H,t.Zipped=Q,t.PointwiseCombination=er,t.$$Range=ur,t.Analysis=sr},13837:r=>{"use strict";r.exports=JSON.parse('["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"]')},56836:r=>{"use strict";r.exports=JSON.parse("[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368000,20922789888000,355687428096000,6402373705728000,121645100408832000,2432902008176640000,51090942171709440000,1.1240007277776077e+21,2.585201673888498e+22,6.204484017332394e+23,1.5511210043330986e+25,4.0329146112660565e+26,1.0888869450418352e+28,3.0488834461171387e+29,8.841761993739702e+30,2.6525285981219107e+32,8.222838654177922e+33,2.631308369336935e+35,8.683317618811886e+36,2.9523279903960416e+38,1.0333147966386145e+40,3.7199332678990125e+41,1.3763753091226346e+43,5.230226174666011e+44,2.0397882081197444e+46,8.159152832478977e+47,3.345252661316381e+49,1.40500611775288e+51,6.041526306337383e+52,2.658271574788449e+54,1.1962222086548019e+56,5.502622159812089e+57,2.5862324151116818e+59,1.2413915592536073e+61,6.082818640342675e+62,3.0414093201713376e+64,1.5511187532873822e+66,8.065817517094388e+67,4.2748832840600255e+69,2.308436973392414e+71,1.2696403353658276e+73,7.109985878048635e+74,4.0526919504877214e+76,2.3505613312828785e+78,1.3868311854568984e+80,8.32098711274139e+81,5.075802138772248e+83,3.146997326038794e+85,1.98260831540444e+87,1.2688693218588417e+89,8.247650592082472e+90,5.443449390774431e+92,3.647111091818868e+94,2.4800355424368305e+96,1.711224524281413e+98,1.1978571669969892e+100,8.504785885678623e+101,6.1234458376886085e+103,4.4701154615126844e+105,3.307885441519386e+107,2.48091408113954e+109,1.8854947016660504e+111,1.4518309202828587e+113,1.1324281178206297e+115,8.946182130782976e+116,7.156945704626381e+118,5.797126020747368e+120,4.753643337012842e+122,3.945523969720659e+124,3.314240134565353e+126,2.81710411438055e+128,2.4227095383672734e+130,2.107757298379528e+132,1.8548264225739844e+134,1.650795516090846e+136,1.4857159644817615e+138,1.352001527678403e+140,1.2438414054641308e+142,1.1567725070816416e+144,1.087366156656743e+146,1.032997848823906e+148,9.916779348709496e+149,9.619275968248212e+151,9.426890448883248e+153,9.332621544394415e+155,9.332621544394415e+157,9.42594775983836e+159,9.614466715035127e+161,9.90290071648618e+163,1.0299016745145628e+166,1.081396758240291e+168,1.1462805637347084e+170,1.226520203196138e+172,1.324641819451829e+174,1.4438595832024937e+176,1.588245541522743e+178,1.7629525510902446e+180,1.974506857221074e+182,2.2311927486598138e+184,2.5435597334721877e+186,2.925093693493016e+188,3.393108684451898e+190,3.969937160808721e+192,4.684525849754291e+194,5.574585761207606e+196,6.689502913449127e+198,8.094298525273444e+200,9.875044200833601e+202,1.214630436702533e+205,1.506141741511141e+207,1.882677176888926e+209,2.372173242880047e+211,3.0126600184576594e+213,3.856204823625804e+215,4.974504222477287e+217,6.466855489220474e+219,8.47158069087882e+221,1.1182486511960043e+224,1.4872707060906857e+226,1.9929427461615188e+228,2.6904727073180504e+230,3.659042881952549e+232,5.012888748274992e+234,6.917786472619489e+236,9.615723196941089e+238,1.3462012475717526e+241,1.898143759076171e+243,2.695364137888163e+245,3.854370717180073e+247,5.5502938327393044e+249,8.047926057471992e+251,1.1749972043909107e+254,1.727245890454639e+256,2.5563239178728654e+258,3.80892263763057e+260,5.713383956445855e+262,8.62720977423324e+264,1.3113358856834524e+267,2.0063439050956823e+269,3.0897696138473508e+271,4.789142901463394e+273,7.471062926282894e+275,1.1729568794264145e+278,1.853271869493735e+280,2.9467022724950384e+282,4.7147236359920616e+284,7.590705053947219e+286,1.2296942187394494e+289,2.0044015765453026e+291,3.287218585534296e+293,5.423910666131589e+295,9.003691705778438e+297,1.503616514864999e+300,2.5260757449731984e+302,4.269068009004705e+304,7.257415615307999e+306]")},21040:r=>{"use strict";r.exports=JSON.parse('{"mutate":false,"replace":true}')},38610:r=>{"use strict";r.exports=JSON.parse('["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"]')},81308:r=>{"use strict";r.exports=JSON.parse('["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]')}},t={};function e(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return r[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),e.nmd=r=>(r.paths=[],r.children||(r.children=[]),r);var n={};return(()=>{"use strict";var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.run=r.resultMap=r.parse=r.SqFrame=r.SqError=r.defaultEnvironment=r.SqValueTag=r.SqProject=r.SqLambda=r.SqRecord=r.SqDistributionError=r.SqDistributionTag=r.SqValueLocation=void 0;const t=e(27431);Object.defineProperty(r,"SqProject",{enumerable:!0,get:function(){return t.SqProject}});const o=e(12262);Object.defineProperty(r,"SqValueTag",{enumerable:!0,get:function(){return o.SqValueTag}});var i=e(62836);Object.defineProperty(r,"SqValueLocation",{enumerable:!0,get:function(){return i.SqValueLocation}});var a=e(44245);Object.defineProperty(r,"SqDistributionTag",{enumerable:!0,get:function(){return a.SqDistributionTag}});var u=e(94250);Object.defineProperty(r,"SqDistributionError",{enumerable:!0,get:function(){return u.SqDistributionError}});var s=e(94386);Object.defineProperty(r,"SqRecord",{enumerable:!0,get:function(){return s.SqRecord}});var f=e(69586);Object.defineProperty(r,"SqLambda",{enumerable:!0,get:function(){return f.SqLambda}});var c=e(97069);Object.defineProperty(r,"defaultEnvironment",{enumerable:!0,get:function(){return c.defaultEnvironment}});var l=e(58041);Object.defineProperty(r,"SqError",{enumerable:!0,get:function(){return l.SqError}}),Object.defineProperty(r,"SqFrame",{enumerable:!0,get:function(){return l.SqFrame}});var m=e(52955);Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return m.parse}});var p=e(71682);Object.defineProperty(r,"resultMap",{enumerable:!0,get:function(){return p.resultMap}}),r.run=(r,e)=>{const n=t.SqProject.create();return n.setSource("main",r),(null==e?void 0:e.environment)&&n.setEnvironment(e.environment),n.run("main"),{result:n.getResult("main"),bindings:n.getBindings("main")}}})(),n})())); |