squint-cljs 0.14.199 → 0.14.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +112 -112
- package/lib/cljs.pprint.js +199 -199
- package/lib/compiler.js +956 -957
- package/lib/compiler.node.js +45 -40
- package/lib/compiler.sci.js +1142 -1139
- package/lib/node.nrepl_server.js +29 -29
- package/lib/squint.core.umd.js +3 -3
- package/package.json +1 -1
- package/src/squint/core.js +27 -23
package/lib/node.nrepl_server.js
CHANGED
|
@@ -4,32 +4,32 @@ import "./node.js";
|
|
|
4
4
|
import "./compiler.node.js";
|
|
5
5
|
const shadow_esm_import = function(x) { return import(x) };
|
|
6
6
|
import*as esm_import$fs from"fs";import*as esm_import$net from"net";
|
|
7
|
-
var m7=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},n7=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},o7=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},p7=function(a){return console.debug($APP.
|
|
8
|
-
|
|
9
|
-
$APP.
|
|
10
|
-
$APP.hi,h=$APP.fi,k=$APP.x4;$APP.hi=b;$APP.fi=e;$APP.x4=a;try{return Promise.resolve(function(){var l=new $APP.Ba,n=$APP.Ca,q=$APP.Ea;$APP.Ca=!0;$APP.Ea=function(r){return l.append(r)};try{d.g?d.g(c):d.call(null,c)}finally{$APP.Ea=q,$APP.Ca=n}return""+$APP.I.g(l)}())}finally{$APP.x4=k,$APP.fi=h,$APP.hi=f}}else return p7($APP.A(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"],0)),$APP.
|
|
11
|
-
$APP.
|
|
12
|
-
"\n;return [undefined];";return $APP.
|
|
13
|
-
k=$APP.m(k)?"Open "+$APP.I.g(k)+" in a browser tab.":"Open the dev server URL in a browser tab.";k=Error("No response from the browser within "+$APP.I.g(8E3)+"ms. "+$APP.I.g(k)+" The REPL evaluates in the page.");return d.g?d.g(k):d.call(null,k)}return null},8E3);var f=$APP.Gb(x7);if($APP.m(f)){var h={op:"eval",code:a,id:e,session:q7.g(b)};return f.g?f.g(h):f.call(null,h)}$APP.Ri.j(z7,$APP.Vk,e);f=Error("No browser transport connected");return d.g?d.g(f):d.call(null,f)})},
|
|
14
|
-
new Set;;)if(a!=null){for(var c=$APP.v(Object.getOwnPropertyNames(a)),d=null,e=0,f=0;;)if(f<e){var h=d.da(null,f);b.add(h);f+=1}else if(c=$APP.v(c))d=c,$APP.Pd(d)?(c=$APP.
|
|
15
|
-
Array.from(a));if(c==null)return[];var d="js/"+$APP.I.g(a.length>0?""+$APP.I.g(a.join("."))+".":null);return $APP.
|
|
16
|
-
setTimeout(function(){if($APP.m($APP.Yd.h($APP.Gb(z7),d))){$APP.Ri.j(z7,$APP.Vk,d);var h=[];return c.g?c.g(h):c.call(null,h)}return null},8E3);var e=$APP.Gb(x7);if($APP.m(e)){var f={op:"complete-js",prefix:a,id:d,session:q7.g(b)};return e.g?e.g(f):e.call(null,f)}$APP.Ri.j(z7,$APP.Vk,d);e=[];return c.g?c.g(e):c.call(null,e)})},C7=function(a,b){return Promise.resolve(a).then(function(c){return
|
|
17
|
-
b){var c=$APP.$e(a);$APP.Yd.h(c,$APP.
|
|
18
|
-
b.h(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"status",new $APP.
|
|
19
|
-
e:""+$APP.I.g(v7()));var f=$APP.m($APP.m(a)?a.indexOf("/")==-1:a)?$APP.Np.h(F7(),new $APP.
|
|
20
|
-
p)},k),$APP.A(["type",$APP.m(k)?"function":"variable"],0));return $APP.m(l)?$APP.Jh.j(u,"docstring",l):u;default:return u=$APP.m(k)?$APP.Jh.j(r,"arglists-str",$APP.
|
|
21
|
-
"done"],null)}a=new $APP.H(null,1,["status",a],null);return b.h?b.h(c,a):b.call(null,c,a)},
|
|
22
|
-
0));b.setNoDelay(!0);var c=
|
|
23
|
-
n),c(k,d),n+=1;else if(f=$APP.v(f))h=f,$APP.Pd(h)?(f=$APP.
|
|
24
|
-
"lookup","lookup",1225356838),
|
|
25
|
-
"print","nrepl.middleware.print/print",-1616742548),
|
|
26
|
-
$APP.I.g(o7(d,1)),"e"))return new $APP.
|
|
27
|
-
e+=1;else break;return J7.l(arguments[0],1<c.length?new $APP.Nc(c.slice(1),0,null):null)};J7.l=function(a,b){try{return K7(a,b)}catch(c){if(c instanceof Error)return new $APP.
|
|
28
|
-
var I7=function I7(a){for(;;){if(typeof a==="string")return""+$APP.I.g(Buffer.from(a).length)+":"+$APP.I.g(a);if(a instanceof $APP.C||a instanceof $APP.t)a=""+$APP.I.g(function(){var c=$APP.De(a);return $APP.m(c)?""+$APP.I.g(c)+"/":null}())+$APP.I.g($APP.Th(a));else return typeof a==="number"?"i"+$APP.I.g(a)+"e":$APP.Kd(a)||$APP.Od(a)||a==null?"l"+$APP.I.g($APP.
|
|
29
|
-
c=$APP.z.j(c,1,null);return""+$APP.I.g(I7.g?I7.g(d):I7.call(null,d))+$APP.I.g(I7.g?I7.g(c):I7.call(null,c))}}(a),$APP.
|
|
30
|
-
var x7=$APP.Qi.g(null),A7=$APP.Qi.g(null),z7=$APP.Qi.g($APP.Ze),B7=$APP.Qi.g(y7),H7=$APP.ph([
|
|
31
|
-
null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.H(null,4,["versions",new $APP.H(null,2,["nbb-nrepl",s7("TODO"),"node",s7(process.version)],null),"aux",$APP.Ze,"ops",$APP.Uh($APP.hk.h($APP.Th,$APP.Eh(H7)),$APP.al.g($APP.Ze)),"status",new $APP.
|
|
32
|
-
a=$APP.Ci.g($APP.m(a)?a:""+$APP.I.g(v7()));a=$APP.Yd.h(F7(),a);a=$APP.J.l($APP.Zk.h($APP.Ic,$APP.Eh(a)),$APP.Eh($APP.
|
|
33
|
-
Array.from(f)))));f=new $APP.H(null,2,["completions",f,"status",new $APP.
|
|
34
|
-
$APP.Ze));$APP.m(e)&&$APP.Bf(u7,e);$APP.m(d)?($APP.Bf(x7,d.send),$APP.Bf(A7,d.url),$APP.Bf(B7,
|
|
35
|
-
export const handleBrowserMessage=function(a){a=typeof a==="string"?JSON.parse(a):a;var b=a.id,c=$APP.Yd.h($APP.Gb(z7),b);if($APP.m(c)){$APP.Ri.j(z7,$APP.Vk,b);b=a.ex;if(b==null)return c=c.resolve,c.g?c.g(a):c.call(null,a);a=Error(""+$APP.I.g(b));c=c.reject;return c.g?c.g(a):c.call(null,a)}return null};export const evalString=function(a){return C7(a,new $APP.H(null,2,[$APP.
|
|
7
|
+
var m7=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},n7=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},o7=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},p7=function(a){return console.debug($APP.sq.h(" ",a))},gpa=function(a){return function(b,c){b=$APP.$e(b);var d=$APP.Yd.h(b,$APP.rt),e=$APP.Yd.h(b,q7);c=$APP.Jh.j(c,"id",d);c=$APP.m(e)?$APP.Jh.j(c,"session",e):c;return a.h?a.h(b,c):a.call(null,b,c)}},ipa=function(){var a=
|
|
8
|
+
hpa;return function(b,c){b=$APP.wn.j(b,r7,$APP.si);return a.h?a.h(b,c):a.call(null,b,c)}},kpa=function(){var a=jpa();return function(b,c){p7($APP.A(["request",b],0));return a.h?a.h(b,c):a.call(null,b,c)}},lpa=function(a){return function(b,c){p7($APP.A(["response",c],0));return a.h?a.h(b,c):a.call(null,b,c)}},jpa=function(){var a=ipa();return function(b,c){return a.h?a.h(b,c):a.call(null,b,c)}},s7=function(a){return $APP.Jh.j($APP.Uh(new $APP.D(null,3,5,$APP.G,["major","minor","incremental"],null),
|
|
9
|
+
$APP.Cv.g(a.split("."))),"version-string",a)},v7=function(){var a=function(){var b=$APP.Gb(t7);b=b==null?null:$APP.Qn.g(b);b=b==null?null:$APP.Gb(b);return b==null?null:$APP.pl.g(b)}();if($APP.m(a))return a;a=function(){var b=$APP.Gb(u7);b=b==null?null:$APP.Gb(b);return b==null?null:$APP.pl.g(b)}();return $APP.m(a)?a:$APP.Sq},mpa=function(a,b,c){if($APP.m(a)){var d=w7.g?w7.g(a):w7.call(null,a);if($APP.m(d)){var e=$APP.$e(b);a=$APP.Yd.h(e,$APP.V6);b=$APP.Yd.h(e,$APP.P6);e=$APP.Yd.h(e,$APP.X6);var f=
|
|
10
|
+
$APP.hi,h=$APP.fi,k=$APP.x4;$APP.hi=b;$APP.fi=e;$APP.x4=a;try{return Promise.resolve(function(){var l=new $APP.Ba,n=$APP.Ca,q=$APP.Ea;$APP.Ca=!0;$APP.Ea=function(r){return l.append(r)};try{d.g?d.g(c):d.call(null,c)}finally{$APP.Ea=q,$APP.Ca=n}return""+$APP.I.g(l)}())}finally{$APP.x4=k,$APP.fi=h,$APP.hi=f}}else return p7($APP.A(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"],0)),$APP.dG(c)}else return $APP.dG(c)},npa=function(a,b){var c=function(){var f=$APP.wF();f=f==null?null:
|
|
11
|
+
$APP.zr.g(f);return f==null?null:$APP.Jh.j(f,$APP.zv,!0)}(),d=$APP.m(b)?$APP.Ci.g(b):null;b=function(){var f=new $APP.H(null,5,[$APP.tq,$APP.tv,$APP.yv,!0,$APP.ws,!0,$APP.Cq,!0,$APP.js,$APP.m($APP.Gb(x7))?null:$APP.ZF],null);f=$APP.m(c)?$APP.Jh.j(f,$APP.zr,c):f;f=$APP.m($APP.Gb(u7))?$APP.Jh.j(f,$APP.Qn,$APP.Gb(u7)):f;f=$APP.m(d)?$APP.Jh.j(f,$APP.V,d):f;var h=$APP.Gb(t7);return $APP.wv?$APP.wv(a,f,h):$APP.tF.call(null,a,f,h)}();b=$APP.$e(b);var e=$APP.Yd.h(b,$APP.Bv);$APP.Bf(t7,b);b=""+$APP.I.g(e)+
|
|
12
|
+
"\n;return [undefined];";return $APP.br("(async function () {\n%s\n}) ()","%s",b)},y7=function(a,b){return Promise.resolve(eval(a)).then(function(c){c=c[0];return mpa(opa.g(b),ppa.g(b),c)})},qpa=function(a,b){return new Promise(function(c,d){var e=$APP.rt.g(b);$APP.Ri.A(z7,$APP.Jh,e,{resolve:function(k){k=k.value;return c.g?c.g(k):c.call(null,k)},reject:d});setTimeout(function(){if($APP.m($APP.Yd.h($APP.Gb(z7),e))){$APP.Ri.j(z7,$APP.Vk,e);var k=$APP.Gb(A7);k=$APP.m(k)?k.o?k.o():k.call(null):null;
|
|
13
|
+
k=$APP.m(k)?"Open "+$APP.I.g(k)+" in a browser tab.":"Open the dev server URL in a browser tab.";k=Error("No response from the browser within "+$APP.I.g(8E3)+"ms. "+$APP.I.g(k)+" The REPL evaluates in the page.");return d.g?d.g(k):d.call(null,k)}return null},8E3);var f=$APP.Gb(x7);if($APP.m(f)){var h={op:"eval",code:a,id:e,session:q7.g(b)};return f.g?f.g(h):f.call(null,h)}$APP.Ri.j(z7,$APP.Vk,e);f=Error("No browser transport connected");return d.g?d.g(f):d.call(null,f)})},rpa=function(a){for(var b=
|
|
14
|
+
new Set;;)if(a!=null){for(var c=$APP.v(Object.getOwnPropertyNames(a)),d=null,e=0,f=0;;)if(f<e){var h=d.da(null,f);b.add(h);f+=1}else if(c=$APP.v(c))d=c,$APP.Pd(d)?(c=$APP.jc(d),f=$APP.lc(d),d=c,e=$APP.od(c),c=f):(c=$APP.w(d),b.add(c),c=$APP.x(d),d=null,e=0),f=0;else break;a=Object.getPrototypeOf(a)}else break;return Array.from(b)},spa=function(a){if($APP.la(a,"js/")){a=$APP.di.h(a,3).split(".");var b=a[a.length-1];a=a.slice(0,a.length-1);var c=$APP.ge.j(function(e,f){return e!=null?e[f]:null},globalThis,
|
|
15
|
+
Array.from(a));if(c==null)return[];var d="js/"+$APP.I.g(a.length>0?""+$APP.I.g(a.join("."))+".":null);return $APP.Jv.g($APP.hk.h(function(e){return""+$APP.I.g(d)+$APP.I.g(e)},$APP.Ef.h(100,$APP.eG.g($APP.Zk.h(function(e){return $APP.la(e,b)},rpa(c))))))}return[]},tpa=function(a,b){return new Promise(function(c){var d=$APP.rt.g(b);$APP.Ri.A(z7,$APP.Jh,d,{resolve:function(h){h=h.completions;h=$APP.m(h)?h:[];return c.g?c.g(h):c.call(null,h)},reject:function(){var h=[];return c.g?c.g(h):c.call(null,h)}});
|
|
16
|
+
setTimeout(function(){if($APP.m($APP.Yd.h($APP.Gb(z7),d))){$APP.Ri.j(z7,$APP.Vk,d);var h=[];return c.g?c.g(h):c.call(null,h)}return null},8E3);var e=$APP.Gb(x7);if($APP.m(e)){var f={op:"complete-js",prefix:a,id:d,session:q7.g(b)};return e.g?e.g(f):e.call(null,f)}$APP.Ri.j(z7,$APP.Vk,d);e=[];return c.g?c.g(e):c.call(null,e)})},C7=function(a,b){return Promise.resolve(a).then(function(c){return npa(c,$APP.V.g(b))}).then(function(c){var d=$APP.Gb(B7);return d.h?d.h(c,b):d.call(null,c,b)})},E7=function(a,
|
|
17
|
+
b){var c=$APP.$e(a);$APP.Yd.h(c,$APP.V);a=$APP.Yd.h(c,D7);$APP.Yd.h(c,$APP.O);$APP.Yd.h(c,upa);$APP.Yd.h(c,vpa);return C7(a,c).then(function(d){d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"value",d],null);return b.h?b.h(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.Vu.g($APP.qj(d));e=$APP.m(e)?e:d.message;$APP.m(e)&&(e=new $APP.H(null,1,["err",""+$APP.I.g(e)+"\n"],null),b.h?b.h(c,e):b.call(null,c,e));d=new $APP.H(null,2,["ex",""+$APP.I.g(d),"ns",""+$APP.I.g(v7())],null);return b.h?
|
|
18
|
+
b.h(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,d):b.call(null,c,d)})},F7=function(){var a=$APP.Gb(t7);a=a==null?null:$APP.Qn.g(a);a=a==null?null:$APP.Gb(a);if($APP.m(a))return a;a=$APP.Gb(u7);return a==null?null:$APP.Gb(a)},G7=function(a,b){var c=$APP.$e(a),d=$APP.Yd.h(c,r7),e=$APP.Yd.h(c,$APP.V);a=function(){var u=$APP.Gea.g(c);return $APP.m(u)?u:$APP.Im.g(c)}();e=$APP.Ci.g($APP.m(e)?
|
|
19
|
+
e:""+$APP.I.g(v7()));var f=$APP.m($APP.m(a)?a.indexOf("/")==-1:a)?$APP.Np.h(F7(),new $APP.D(null,2,5,$APP.G,[e,$APP.Ci.g(a)],null)):null,h=$APP.$e(f),k=$APP.Yd.h(h,$APP.rr),l=$APP.Yd.h(h,$APP.K),n=$APP.Yd.h(h,$APP.S),q=$APP.Yd.h(h,$APP.O);if($APP.m(f)){var r=new $APP.H(null,3,["ns",""+$APP.I.g(e),"name",""+$APP.I.g(a),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);a=function(){switch(d instanceof $APP.C?d.$:null){case "eldoc":var u=$APP.Jh.l(r,"eldoc",$APP.pu.h(function(p){return $APP.pu.h($APP.I,
|
|
20
|
+
p)},k),$APP.A(["type",$APP.m(k)?"function":"variable"],0));return $APP.m(l)?$APP.Jh.j(u,"docstring",l):u;default:return u=$APP.m(k)?$APP.Jh.j(r,"arglists-str",$APP.sq.h("\n",$APP.hk.h($APP.Mi,k))):r,u=$APP.m(l)?$APP.Jh.j(u,"doc",l):u,u=$APP.m(q)?$APP.Jh.j(u,"file",q):u,$APP.m(n)?$APP.Jh.j(u,"line",n):u}}();return b.h?b.h(c,a):b.call(null,c,a)}a:switch(d instanceof $APP.C?d.$:null){case "eldoc":a=new $APP.D(null,2,5,$APP.G,["no-eldoc","done"],null);break a;default:a=new $APP.D(null,2,5,$APP.G,["no-info",
|
|
21
|
+
"done"],null)}a=new $APP.H(null,1,["status",a],null);return b.h?b.h(c,a):b.call(null,c,a)},hpa=function(a,b){a=$APP.$e(a);var c=$APP.Yd.h(a,r7),d=$APP.Yd.h(H7,c);if($APP.m(d))return d.h?d.h(a,b):d.call(null,a,b);console.warn($APP.sq.h(" ",$APP.A(["Unhandled operation",c],0)));c=new $APP.H(null,1,["status",new $APP.D(null,3,5,$APP.G,["error","unknown-op","done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},wpa=function(a){return function(b,c){return a.write(I7(c))}},xpa=function(a,b){p7($APP.A(["Connection accepted"],
|
|
22
|
+
0));b.setNoDelay(!0);var c=kpa(),d=gpa(lpa(wpa(b))),e=$APP.Qi.g(null);b.on("data",function(f){var h=$APP.Gb(e);if($APP.m(h)){f=""+$APP.I.g(h)+$APP.I.g(f);$APP.Bf(e,null);var k=f}else k=f;a:{f=$APP.A([$APP.Dv,!0],0);for(h=$APP.bg;;){var l=$APP.xf.j(J7,k,f);k=$APP.z.j(l,0,null);l=$APP.z.j(l,1,null);if(k==null){h=new $APP.D(null,2,5,$APP.G,[h,l],null);break a}h=$APP.we.h(h,k);k=l}h=void 0}f=$APP.z.j(h,0,null);h=$APP.z.j(h,1,null);$APP.lk(h)||$APP.Bf(e,h);f=$APP.v(f);h=null;for(var n=l=0;;)if(n<l)k=h.da(null,
|
|
23
|
+
n),c(k,d),n+=1;else if(f=$APP.v(f))h=f,$APP.Pd(h)?(f=$APP.jc(h),l=$APP.lc(h),h=f,k=$APP.od(f),f=l,l=k):(k=$APP.w(h),c(k,d),f=$APP.x(h),h=null,l=0),n=0;else return null});return b.on("close",function(f){return $APP.m(f)?p7($APP.A(["Connection lost"],0)):p7($APP.A(["Connection closed"],0))})},vpa=new $APP.C(null,"_line","_line",232847719),ppa=new $APP.C("nrepl.middleware.print","options","nrepl.middleware.print/options",868480159),q7=new $APP.C(null,"session","session",1008279103),ypa=new $APP.C(null,
|
|
24
|
+
"lookup","lookup",1225356838),zpa=new $APP.C(null,"browser-transport","browser-transport",-653558483),Apa=new $APP.C(null,"load-file","load-file",-424586670),upa=new $APP.C(null,"_load-file?","_load-file?",-1198848711),r7=new $APP.C(null,"op","op",-1882987955),Bpa=new $APP.C(null,"describe","describe",1369790582),D7=new $APP.C(null,"code","code",1586293142),Cpa=new $APP.C(null,"eldoc","eldoc",-1321421900),Dpa=new $APP.C(null,"log_level","log_level",-1756736313),opa=new $APP.C("nrepl.middleware.print",
|
|
25
|
+
"print","nrepl.middleware.print/print",-1616742548),Epa=new $APP.C(null,"clone","clone",711747572),Fpa=new $APP.C(null,"close","close",1835149582),Gpa=new $APP.C(null,"info","info",-317069002),Hpa=new $APP.C(null,"load-file?","load-file?",1892536169);var K7=function K7(a,b){switch(""+$APP.I.g(o7(a,1))){case "i":return a=n7(a,1),b=m7(a,"e"),new $APP.D(null,2,5,$APP.G,[parseInt(o7(a,b)),n7(a,b+1)],null);case "l":var d=a=n7(a,1);for(a=$APP.cc($APP.bg);;){if($APP.y.h(""+$APP.I.g(o7(d,1)),"e"))return new $APP.D(null,2,5,$APP.G,[$APP.ec(a),n7(d,1)],null);var e=K7.h?K7.h(d,b):K7.call(null,d,b),f=$APP.z.j(e,0,null),h=$APP.z.j(e,1,null);e=h;a=$APP.Xf.h(a,f);d=e}break;case "d":a=n7(a,1);f=$APP.$e(b);f=$APP.Yd.h(f,$APP.Dv);d=a;for(e=$APP.cc($APP.Ze);;){if($APP.y.h(""+
|
|
26
|
+
$APP.I.g(o7(d,1)),"e"))return new $APP.D(null,2,5,$APP.G,[$APP.ec(e),n7(d,1)],null);a=K7.h?K7.h(d,b):K7.call(null,d,b);d=$APP.z.j(a,0,null);h=$APP.z.j(a,1,null);h=K7.h?K7.h(h,b):K7.call(null,h,b);a=$APP.z.j(h,0,null);h=$APP.z.j(h,1,null);d=$APP.m(f)?$APP.si.g(d):d;a=$APP.Og.j(e,d,a);d=h;e=a}break;default:return b=m7(a,":"),f=parseInt(o7(a,b)),a=n7(a,b+1),new $APP.D(null,2,5,$APP.G,[""+$APP.I.g(o7(a,f)),n7(a,f)],null)}},J7=function J7(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),
|
|
27
|
+
e+=1;else break;return J7.l(arguments[0],1<c.length?new $APP.Nc(c.slice(1),0,null):null)};J7.l=function(a,b){try{return K7(a,b)}catch(c){if(c instanceof Error)return new $APP.D(null,2,5,$APP.G,[null,a],null);throw c;}};J7.m=1;J7.v=function(a){var b=$APP.w(a);a=$APP.x(a);return this.l(b,a)};
|
|
28
|
+
var I7=function I7(a){for(;;){if(typeof a==="string")return""+$APP.I.g(Buffer.from(a).length)+":"+$APP.I.g(a);if(a instanceof $APP.C||a instanceof $APP.t)a=""+$APP.I.g(function(){var c=$APP.De(a);return $APP.m(c)?""+$APP.I.g(c)+"/":null}())+$APP.I.g($APP.Th(a));else return typeof a==="number"?"i"+$APP.I.g(a)+"e":$APP.Kd(a)||$APP.Od(a)||a==null?"l"+$APP.I.g($APP.xf.h($APP.I,$APP.hk.h(I7,a)))+"e":$APP.Md(a)?"d"+$APP.I.g($APP.xf.h($APP.I,$APP.hk.h(function(){return function(c){var d=$APP.z.j(c,0,null);
|
|
29
|
+
c=$APP.z.j(c,1,null);return""+$APP.I.g(I7.g?I7.g(d):I7.call(null,d))+$APP.I.g(I7.g?I7.g(c):I7.call(null,c))}}(a),$APP.fG.h($APP.w,a))))+"e":null}};var t7=$APP.Qi.g(null),u7=$APP.Qi.g(null),w7=new $APP.H(null,1,["cider.nrepl.pprint/pprint",$APP.d7],null);$APP.Qi.g(!1);
|
|
30
|
+
var x7=$APP.Qi.g(null),A7=$APP.Qi.g(null),z7=$APP.Qi.g($APP.Ze),B7=$APP.Qi.g(y7),H7=$APP.ph([ypa,Fpa,Apa,Cpa,Epa,Bpa,Gpa,$APP.nG,$APP.yga],[G7,function(a,b){var c=new $APP.H(null,1,["status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){a=$APP.$e(a);var c=$APP.Yd.h(a,$APP.O);return E7($APP.Jh.l(a,D7,c,$APP.A([Hpa,!0],0)),b)},G7,function(a,b){var c=new $APP.H(null,2,["new-session",""+$APP.I.g($APP.jF()),"status",new $APP.D(null,1,5,$APP.G,["done"],
|
|
31
|
+
null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.H(null,4,["versions",new $APP.H(null,2,["nbb-nrepl",s7("TODO"),"node",s7(process.version)],null),"aux",$APP.Ze,"ops",$APP.Uh($APP.hk.h($APP.Th,$APP.Eh(H7)),$APP.al.g($APP.Ze)),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},G7,function(a,b){var c=$APP.$e(a);a=$APP.Yd.h(c,$APP.V);var d=function(){var f=$APP.Q6.g(c);if($APP.m(f))return f;f=$APP.Im.g(c);return $APP.m(f)?f:""}();
|
|
32
|
+
a=$APP.Ci.g($APP.m(a)?a:""+$APP.I.g(v7()));a=$APP.Yd.h(F7(),a);a=$APP.J.l($APP.Zk.h($APP.Ic,$APP.Eh(a)),$APP.Eh($APP.Ls.g(a)),$APP.A([$APP.Eh($APP.rl.g(a))],0));var e=$APP.Zk.h(function(f){return $APP.la(f,d)},$APP.Ns.h(function(f){return f.indexOf("_DOT_")!=-1},$APP.hk.h($APP.I,a)));return($APP.la(d,"js/")?$APP.m($APP.Gb(x7))?tpa(d,c):Promise.resolve(spa(d)):Promise.resolve([])).then(function(f){f=$APP.pu.h(function(h){return new $APP.H(null,1,["candidate",h],null)},$APP.eG.g($APP.AF.g($APP.J.h(e,
|
|
33
|
+
Array.from(f)))));f=new $APP.H(null,2,["completions",f,"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,f):b.call(null,c,f)}).catch(function(){var f=new $APP.H(null,2,["completions",$APP.pu.h(function(h){return new $APP.H(null,1,["candidate",h],null)},$APP.eG.g(e)),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,f):b.call(null,c,f)})},function(a,b){a=$APP.$e(a);var c=$APP.Yd.h(a,$APP.V);return E7($APP.Jh.j(a,$APP.V,$APP.m(c)?c:v7()),b)}]),Ipa=$APP.Qi.g(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var h=$APP.Ma(a)?a.port:$APP.iG.g(a);return $APP.m(h)?h:0}(),c=function(){var h=$APP.Ma(a)?a.host:$APP.mG.g(a);return $APP.m(h)?h:"127.0.0.1"}();(function(){var h=$APP.Ma(a)?a.log_level:Dpa.g(a);return $APP.m(h)?h:"info"})();var d=function(){var h=zpa.g(a);return $APP.m(h)?h:$APP.Ma(a)?a.browserTransport:null}(),e=function(){var h=$APP.Qn.g(a);return $APP.m(h)?h:$APP.Ma(a)?a.nsState:null}(),f=esm_import$net.createServer($APP.Al.h(xpa,
|
|
34
|
+
$APP.Ze));$APP.m(e)&&$APP.Bf(u7,e);$APP.m(d)?($APP.Bf(x7,d.send),$APP.Bf(A7,d.url),$APP.Bf(B7,qpa)):$APP.Bf(B7,y7);f.listen(b,c,function(){var h=f.address(),k=h.port;h=h.address;$APP.hG.l($APP.A(["nREPL server started on port "+$APP.I.g(k)+" on host "+$APP.I.g(h)+" - nrepl://"+$APP.I.g(h)+":"+$APP.I.g(k)],0));try{return esm_import$fs.writeFileSync(".nrepl-port",""+$APP.I.g(k))}catch(l){return console.warn($APP.sq.h(" ",$APP.A(["Could not write .nrepl-port",l],0)))}});return $APP.Bf(Ipa,f)})};
|
|
35
|
+
export const handleBrowserMessage=function(a){a=typeof a==="string"?JSON.parse(a):a;var b=a.id,c=$APP.Yd.h($APP.Gb(z7),b);if($APP.m(c)){$APP.Ri.j(z7,$APP.Vk,b);b=a.ex;if(b==null)return c=c.resolve,c.g?c.g(a):c.call(null,a);a=Error(""+$APP.I.g(b));c=c.reject;return c.g?c.g(a):c.call(null,a)}return null};export const evalString=function(a){return C7(a,new $APP.H(null,2,[$APP.rt,""+$APP.I.g($APP.jF()),q7,"http"],null)).then(function(b){return{value:b,ns:""+$APP.I.g(v7())}})};
|
package/lib/squint.core.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var squint;(squint||={}).core=(()=>{var vt=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var cn=Object.prototype.hasOwnProperty;var fn=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},ln=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of sn(e))!cn.call(t,u)&&u!==n&&vt(t,u,{get:()=>e[u],enumerable:!(r=on(e,u))||r.enumerable});return t};var an=t=>ln(vt({},"__esModule",{value:!0}),t);var ri={};fn(ri,{Atom:()=>me,Cons:()=>ye,Delay:()=>un,IIterable:()=>he,IIterable__iterator:()=>Gn,LazySeq:()=>fu,NaN_QMARK_:()=>Cu,PROTOCOL_SENTINEL:()=>er,UUID:()=>Mt,_:()=>mn,_EQ_:()=>Z,_GT_:()=>Jt,_GT__EQ_:()=>Zt,_LT_:()=>dn,_LT__EQ_:()=>xn,_PLUS_:()=>yn,_STAR_:()=>gn,_STAR_print_err_fn_STAR_:()=>jn,_STAR_print_fn_STAR_:()=>P,_STAR_print_newline_STAR_:()=>Nt,__protocol_satisfies:()=>An,__toFn:()=>l,_iterator:()=>_e,abs:()=>Oo,aclone:()=>Su,add_watch:()=>Ru,alength:()=>bu,any_QMARK_:()=>Gu,apply:()=>we,array:()=>pr,array_QMARK_:()=>zt,array_map:()=>vn,aset:()=>Mu,assoc:()=>D,assoc_BANG_:()=>T,assoc_in:()=>ne,assoc_in_BANG_:()=>re,atom:()=>nr,boolean$:()=>yu,boolean_QMARK_:()=>_o,bounded_count:()=>xo,butlast:()=>lu,cat:()=>en,clj__GT_js:()=>Ho,coll_QMARK_:()=>no,comp:()=>ue,compare:()=>Q,compare_and_set_BANG_:()=>ir,complement:()=>nt,concat:()=>mr,conj:()=>Rn,conj_BANG_:()=>W,cons:()=>Fn,constantly:()=>yr,contains_QMARK_:()=>se,count:()=>it,counted_QMARK_:()=>Fe,cycle:()=>Br,dec:()=>Kn,dedupe:()=>Fr,deref:()=>Y,disj:()=>En,disj_BANG_:()=>ie,dissoc:()=>Nn,dissoc_BANG_:()=>Qn,distinct:()=>Dr,distinct_QMARK_:()=>Bu,doall:()=>ku,dorun:()=>vu,double$:()=>Go,double_QMARK_:()=>co,drop:()=>wt,drop_last:()=>au,drop_while:()=>Ie,empty:()=>gt,empty_QMARK_:()=>nu,ensure_reduced:()=>je,es6_iterator:()=>b,even_QMARK_:()=>be,every_QMARK_:()=>Te,every_pred:()=>Nu,ex_cause:()=>io,ex_data:()=>uo,ex_info:()=>so,ex_message:()=>oo,false_QMARK_:()=>du,ffirst:()=>qn,filter:()=>ht,filterv:()=>Yn,find:()=>yo,first:()=>O,flatten:()=>ko,float$:()=>$o,fn_QMARK_:()=>Pt,fnil:()=>qt,frequencies:()=>cu,get:()=>S,get_in:()=>Bt,group_by:()=>su,hash_map:()=>te,identical_QMARK_:()=>jr,identity:()=>ve,ifn_QMARK_:()=>$u,inc:()=>ce,inst_QMARK_:()=>Vo,int_QMARK_:()=>V,integer_QMARK_:()=>fo,interleave:()=>ke,interpose:()=>br,into:()=>Ke,into_array:()=>Be,iterable:()=>a,iterate:()=>ju,js_keys:()=>Lu,js_obj:()=>wu,juxt:()=>Iu,keep:()=>Hr,keep_indexed:()=>Zn,key:()=>Qe,keys:()=>Le,keyword:()=>Wu,keyword_QMARK_:()=>Ju,last:()=>Cn,lazy:()=>g,list:()=>Me,list_QMARK_:()=>Ot,list_STAR_:()=>gr,long$:()=>zo,map:()=>F,map_QMARK_:()=>Ge,map_entry_QMARK_:()=>$n,map_indexed:()=>Wn,mapcat:()=>Ar,mapv:()=>dt,max:()=>$e,max_key:()=>Ao,memoize:()=>Co,merge:()=>Qr,merge_with:()=>Nr,meta:()=>De,min:()=>Qu,min_key:()=>mo,mod:()=>go,name:()=>Xn,namespace:()=>Vu,nat_int_QMARK_:()=>ao,neg_QMARK_:()=>mu,neg_int_QMARK_:()=>po,next:()=>st,nil_QMARK_:()=>tr,nnext:()=>Tu,not:()=>Tt,not_EQ_:()=>Zo,not_any_QMARK_:()=>tu,not_empty:()=>vo,not_every_QMARK_:()=>Vr,nth:()=>le,number_QMARK_:()=>Ce,object_QMARK_:()=>ee,odd_QMARK_:()=>xr,parse_double:()=>bo,parse_long:()=>wo,partial:()=>Gr,partition:()=>Re,partition_all:()=>Se,partition_by:()=>Er,partitionv:()=>kr,partitionv_all:()=>Sr,peek:()=>Lo,persistent_BANG_:()=>Ro,pop:()=>Do,pos_QMARK_:()=>Au,pos_int_QMARK_:()=>lo,pr:()=>Tn,pr_str:()=>Ut,print:()=>fe,println:()=>In,prn:()=>ni,qualified_keyword_QMARK_:()=>eo,quot:()=>Ve,rand:()=>ru,rand_int:()=>ze,rand_nth:()=>uu,random_uuid:()=>Fo,range:()=>sr,re_find:()=>fr,re_matches:()=>cr,re_pattern:()=>lr,re_seq:()=>qu,realized_QMARK_:()=>Wo,reduce:()=>B,reduce_kv:()=>Dt,reduced:()=>at,reduced_QMARK_:()=>q,reductions:()=>Dn,regexp_QMARK_:()=>ro,rem:()=>nn,remove:()=>Un,remove_watch:()=>Eu,repeat:()=>Gt,repeatedly:()=>iu,replace:()=>eu,reset_BANG_:()=>Ae,reset_vals_BANG_:()=>or,rest:()=>H,reverse:()=>Jr,run_BANG_:()=>Jo,satisfies_QMARK_:()=>wn,second:()=>Bn,select_keys:()=>Mr,seq:()=>R,seq_QMARK_:()=>On,seqable_QMARK_:()=>zn,sequential_QMARK_:()=>Rt,set:()=>_r,set_QMARK_:()=>dr,shuffle:()=>Xr,simple_keyword_QMARK_:()=>to,some:()=>Oe,some_QMARK_:()=>xu,some_fn:()=>Ku,sort:()=>ot,sort_by:()=>Zr,sorted_map:()=>No,sorted_map_by:()=>Ko,sorted_set:()=>Eo,sorted_set_by:()=>Qo,split_at:()=>pu,split_with:()=>hu,str:()=>It,string_QMARK_:()=>bt,subs:()=>qe,subseq:()=>To,subvec:()=>ar,swap_BANG_:()=>rr,swap_vals_BANG_:()=>ur,symbol:()=>Hu,symbol_QMARK_:()=>Zu,system_time:()=>Kr,t:()=>zu,take:()=>mt,take_last:()=>Tr,take_nth:()=>$r,take_while:()=>At,to_array:()=>Ou,trampoline:()=>We,transduce:()=>Yt,transient$:()=>So,tree_seq:()=>He,true_QMARK_:()=>_u,truth_:()=>x,type:()=>Bo,unchecked_add_int:()=>Uu,unchecked_dec_int:()=>Yu,unchecked_inc_int:()=>Fu,unchecked_int:()=>Pu,unreduced:()=>$t,update:()=>Yr,update_BANG_:()=>Lt,update_in:()=>Ur,update_keys:()=>Po,update_vals:()=>rn,uuid:()=>Yo,uuid_QMARK_:()=>Uo,val:()=>Ne,vals:()=>Du,var_QMARK_:()=>Xu,vary_meta:()=>ho,vec:()=>U,vector:()=>_t,vector_QMARK_:()=>hr,volatile_BANG_:()=>ti,vreset_BANG_:()=>ei,warn_on_lazy_reusage_BANG_:()=>Pn,with_meta:()=>Pe,zero_QMARK_:()=>gu,zipmap:()=>Mo});function l(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>S(n,t,r):e==="object"?(n,r)=>S(t,n,r):t}var St=Object.prototype.hasOwnProperty;function Vt(t,e,n){for(n of t.keys())if(j(n,e))return n}function Wt(t){return t!=null&&t[ct]===!0&&t[_]===h}function pn(t){return t!=null&&typeof t=="object"&&(t.constructor===Object||t instanceof Map||t[_]===h)}function hn(t,e){return t instanceof Map||t[_]===h?t.has(e):St.call(t,e)}function _n(t,e){return t instanceof Map||t[_]===h?t.get(e):t[e]}function Ht(t){return t instanceof Map||t[_]===h?t.size:Object.keys(t).length}function j(t,e){if(t===e)return!0;if(t==null)return e==null;var n,r,u;const o=Wt(t);if(o||Wt(e)){const i=o?t:e,s=i===t?e:t;if(!pn(s)||Ht(i)!==Ht(s))return!1;for(const c of i.keys())if(!hn(s,c)||!j(i.get(c),_n(s,c)))return!1;return!0}if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===Array){if((r=t.length)===e.length)for(;r--&&j(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(const i of t)if(u=i,u&&typeof u=="object"&&(u=Vt(e,u),!u)||!e.has(u))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(const i of t)if(u=i[0],u&&typeof u=="object"&&(u=Vt(e,u),!u)||!j(i[1],e.get(u)))return!1;return!0}if((!n||typeof t=="object")&&t[_]!==k){r=0;for(const i in t)if(St.call(t,i)&&++r&&!St.call(e,i)||!(i in e)||!j(t[i],e[i]))return!1;return Object.keys(e).length===r}}if(t&&e&&(Array.isArray(t)||t[_]===k)&&(Array.isArray(e)||e[_]===k)){const i=t[Symbol.iterator](),s=e[Symbol.iterator]();for(;;){const c=i.next(),f=s.next();if(c.done||f.done)return!!(c.done&&f.done);if(!j(c.value,f.value))return!1}}return!1}function J(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Z(...t){return J(t,(e,n)=>j(e,n))}function Jt(...t){return J(t,(e,n)=>e>n)}function Zt(...t){return J(t,(e,n)=>e>=n)}function dn(...t){return J(t,(e,n)=>e<n)}function xn(...t){return J(t,(e,n)=>e<=n)}function yn(...t){return t.reduce((e,n)=>e+n,0)}function gn(...t){return t.reduce((e,n)=>e*n,1)}function mn(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const An={};function wn(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function bn(t,e,n){return t.set(e,n),t}function Mn(t,e,n){return t[e]=n,t}function Xt(t){switch(d(t)){case h:return bn;case w:case M:return Mn}}function T(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(d(t)){case h:t.set(e,n);for(let u=0;u<r.length;u+=2)t.set(r[u],r[u+1]);break;case w:case M:t[e]=n;for(let u=0;u<r.length;u+=2)t[r[u]]=r[u+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}const L=Symbol("meta");function A(t,e){const n=t?.[L];return n!==void 0&&(e[L]=n),e}function I(t){switch(d(t)){case h:return A(t,new t.constructor(t));case m:return A(t,new t.constructor(t));case w:return A(t,[...t]);case M:return A(t,{...t});case E:return A(t,new et(...t));default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function D(t,e,n,...r){t||(t={});const u=I(t);return T(u,e,n,...r),u}function te(...t){return t.length===0?{}:D({},...t)}const vn=te,h=1,w=2,M=3,E=4,m=5,k=6,_=Symbol("squint.lang.type"),ct=Symbol("squint.lang.sorted");function kn(t,e){return t.squint$lang$variadic=e,t}function ft(t){switch(t){case h:return new Map;case w:return[];case M:return{};case E:return new et;case m:return new Set;case k:return g(function*(){})}}function lt(t){return t.constructor===Object}function X(t){return Array.isArray(t)&&t[_]!==E}function ee(t){return t!=null&<(t)}function d(t){if(t==null)return;if(lt(t))return M;if(t instanceof Map)return h;if(t instanceof Set)return m;const e=t[_];if(e!==void 0)return e;if(X(t))return w}function Sn(t,e,n,r,u){r=U(r),n=n||{};const o=d(n);if(o!==h&&o!==w&&o!==M)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let s=n;for(let c=0;c<r.length-1;c+=1){const f=r[c];let p;s instanceof Map?p=s.get(f):p=s[f],p||(p=ft(o)),i.push(p),s=p}i.push(u);for(let c=i.length-2;c>=0;c-=1)i[c]=t(i[c],r[c],i[c+1]);return i[0]}function ne(t,e,n){return Sn(D,"assoc-in",t,e,n)}function re(t,e,n){e=U(e);var r=t;const u=d(t);for(const o of e.splice(0,e.length-1)){let i=S(r,o);i===void 0&&(i=ft(u),T(r,o,i)),r=i}return T(r,e[e.length-1],n),t}function ue(...t){if(t=t.map(l),t.length===0)return ve;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let u=e(...r);for(const o of n)u=o(u);return u}}function oe(t,e){for(const n of e)t.add(n);return t}function W(...t){const e=t.length;if(e===0)return _t();let n=t[0];if(n==null&&(n=[]),e===2)switch(d(n)){case w:return n.push(t[1]),n;case m:return n.add(t[1]),n}const r=t.slice(1);switch(d(n)){case m:oe(n,r);break;case E:n.unshift(...r.reverse());break;case w:n.push(...r);break;case h:for(const u of r)Array.isArray(u)?n.set(u[0],u[1]):a(u).forEach(o=>{n.set(o[0],o[1])});break;case M:for(const u of r)Array.isArray(u)?n[u[0]]=u[1]:Object.assign(n,u);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return n}function Rn(...t){if(t.length===0)return _t();const[e,...n]=t;if(n.length===0)return e;let r=e;r==null&&(r=Me());let u,o;switch(d(r)){case m:return r[ct]?A(r,oe(new r.constructor(r),n)):A(r,new r.constructor([...r,...n]));case E:return A(r,new et(...n.reverse(),...r));case w:return A(r,[...r,...n]);case h:u=new Map(r);for(const i of n)Array.isArray(i)?u.set(i[0],i[1]):a(i).forEach(s=>{u.set(s[0],s[1])});return A(r,u);case k:return g(function*(){yield*n,yield*r});case M:o={...r};for(const i of n)Array.isArray(i)?o[i[0]]=i[1]:Object.assign(o,i);return A(r,o);default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function ie(t,...e){for(const n of e)t.delete(n);return t}function En(t,...e){if(t==null)return t;const n=new t.constructor(t);return ie(n,...e)}function se(t,e){if(typeof t=="string")return V(e)&&e>=0&&e<t.length;switch(d(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function Qn(t,...e){for(const n of e)delete t[n];return t}function Nn(t,...e){if(!t)return;if(e.length===0)return t;if(d(t)===h){let u=!1;for(const i of e)if(t.has(i)){u=!0;break}if(!u)return t;const o=I(t);for(const i of e)o.delete(i);return o}let n=!1;for(const u of e)if(u in t){n=!0;break}if(!n)return t;const r=I(t);for(const u of e)delete r[u];return r}function ce(t){return t+1}function Kn(t){return t-1}const Nt={val:!1},P={val:t=>console.log(t)},jn={val:t=>console.error(t)};function fe(...t){P.val(t.map(e=>K(e,void 0,!1)).join(" "))}function In(...t){fe(...t),Nt.val&&P.val(`
|
|
2
|
-
`)}function Tn(...t){P.val(Ut(...t))}function le(t,e,n){const r=arguments.length>2;if(t==null)return r?n:null;if(Array.isArray(t)){if(e>=0&&e<t.length)return t[e]}else if(e>=0){const u=$(t);let o=0,i;for(;(i=u())!==null;){if(e<o+i.length)return i[e-o];o+=i.length}}if(r)return n;throw new Error("Index out of bounds: "+e)}function S(t,e,n=void 0){if(t==null)return n;let r;if(lt(t))return r=t[e],r===void 0?n:r;let u;switch(d(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case w:r=t[e];break;default:if(u=t.get,typeof u=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function On(t){return t!=null&&!!t[Symbol.iterator]}function Rt(t){return Array.isArray(t)||t?.[_]===k}function zn(t){return t==null||ee(t)||!!t[Symbol.iterator]}const ae=Symbol("squint.lang.map-entry");function pe(t){return t[ae]=!0,t}function $n(t){return Array.isArray(t)&&t[ae]===!0}function a(t){if(t==null)return[];if(t[Symbol.iterator])return t;if(t instanceof Object)return Object.entries(t).map(pe);throw new TypeError(`${t} is not iterable`)}const he=Symbol("Iterable"),Gn=Symbol.iterator;function _e(t){return t[Symbol.iterator]()}const b=_e;function R(t){if(t==null)return t;if(typeof t=="string")return t.length?[...t]:null;const e=a(t);return e.length===0||e.size===0?null:e instanceof Set||e[_]===m?[...e]:e[Symbol.iterator]().next().done?null:e}function O(t){if(t==null)return;if(Array.isArray(t))return t[0];if(t instanceof y)return t.force(),t.chunk===null?void 0:t.chunk[0];const[e]=a(t);return e}function Bn(t){if(t instanceof y){t.force();const r=t.chunk;return r===null?void 0:r.length>1?r[1]:O(t._rest)}const[e,n]=a(t);return n}function qn(t){return O(O(t))}function H(t){const e=jt(t);e.force();const n=e.chunk;if(n===null)return e;if(n.length>1){const r=new y(null);return r.realized=!0,r.chunk=n.slice(1),r._rest=e._rest,r}return e._rest}class C{value;constructor(e){this.value=e}_deref(){return this.value}}function Cn(t){if(t=a(t),Array.isArray(t))return t[t.length-1];const e=$(t);let n,r;for(;(r=e())!==null;)n=r[r.length-1];return n}function at(t){return new C(t)}function q(t){return t instanceof C}function B(t,e,n){t=l(t);const r=arguments.length!==2,u=r?n:e;let o=r?e:void 0;if(Array.isArray(u)){let f=0;if(!r){if(u.length===0)return t();o=u[0],f=1}if(o instanceof C)return o.value;for(;f<u.length;f++)if(o=t(o,u[f]),o instanceof C)return o.value;return o}const i=$(u);let s=i(),c=0;if(!r){if(s===null)return t();o=s[0],c=1}if(o instanceof C)return o.value;for(;s!==null;){for(;c<s.length;c++)if(o=t(o,s[c]),o instanceof C)return o.value;s=i(),c=0}return o}function*Ln(t,e){const n=e.next();n.done?yield t():yield*de(t,n.value,e)}function*de(t,e,n){let r=e;const u=n;for(;;){if(q(r)){yield r.value;return}else yield r;const o=u.next();if(o.done)break;r=t(r,o.value)}}function Dn(t,e,n){if(t=l(t),arguments.length===2){const u=b(a(e));return g(function*(){yield*Ln(t,u)})}const r=b(a(n));return g(function*(){yield*de(t,e,r)})}function Pn(){console.warn("warn-on-lazy-reusage! is deprecated and does nothing: lazy values are now cached.")}const pt=32,y=class xe{constructor(e){this[_]=k,this[he]=!0,this.step=e,this.realized=!1,this.chunk=null,this._rest=null}force(){if(!this.realized){this.realized=!0;const e=this.step();this.step=null,e!=null&&(this.chunk=e[0],this._rest=new xe(e[1]))}return this}[Symbol.iterator](){let e=this,n=0;return{next(){for(;;){e.force();const r=e.chunk;if(r===null)return{value:void 0,done:!0};if(n<r.length)return{value:r[n++],done:!1};e=e._rest,n=0}},[Symbol.iterator](){return this}}}indexOf(e,n=0){let r=0;for(const u of this){if(r>=n&&j(u,e))return r;r++}return-1}};function Kt(t){const e=()=>{const n=t.next();return n.done?null:[[n.value],e]};return e}function g(t){return new y(Kt(t()))}function z(t,e){const n=b(a(t));return g(()=>e(n))}function jt(t){if(t instanceof y)return t;if(Array.isArray(t)){const e=n=>()=>{if(n>=t.length)return null;const r=Math.min(n+pt,t.length);return[t.slice(n,r),e(r)]};return new y(e(0))}return new y(Kt(b(a(t))))}function $(t){if(t instanceof y){let n=t;return()=>{if(n===null)return null;n.force();const r=n.chunk;return n=r===null?null:n._rest,r}}const e=b(a(t));return()=>{const n=[];for(let r=0;r<pt;r++){const u=e.next();if(u.done)break;n.push(u.value)}return n.length===0?null:n}}function tt(t,e){const n=jt(t),r=(u,o)=>()=>{let i=u,s=o;for(;;){i.force();const c=i.chunk;if(c===null)return null;const f=e(c,s),p=i._rest;if(s+=c.length,f.length!==0)return[f,r(p,s)];i=p}};return new y(r(n,0))}const ye=class{constructor(e,n){this[_]=k,this.x=e,this.coll=n}[Symbol.iterator](){const e=this.x;let n=this.coll,r=!1,u=null;return{next(){return r?(u||(u=b(a(n)),n=null),u.next()):(r=!0,{value:e,done:!1})},[Symbol.iterator](){return this}}}};function Fn(t,e){return new ye(t,e)}function F(t,...e){switch(t=l(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return tt(e[0],n=>{const r=new Array(n.length);for(let u=0;u<n.length;u++)r[u]=t(n[u]);return r});default:{const n=e.map(r=>b(a(r)));return g(function*(){for(;;){const r=[];for(const u of n){const o=u.next();if(o.done)return;r.push(o.value)}yield t(...r)}})}}}function v(t){return e=>{const n=t(e);return(...r)=>r.length===0?e():r.length===1?e(r[0]):n(r[0],r[1])}}function ge(t){return v(e=>(n,r)=>x(t(r))?e(n,r):n)}function ht(t,e){return arguments.length===1?ge(t):(t=l(t),tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=n[u];x(t(o))&&r.push(o)}return r}))}function Yn(t,e){return xt([],ht(t,e))}function Un(t,e){return arguments.length===1?ge(nt(t)):ht(nt(t),e)}function Vn(t){return v(e=>{let n=-1;return(r,u)=>e(r,t(++n,u))})}function Wn(t,e){return t=l(t),arguments.length===1?Vn(t):tt(e,(n,r)=>{const u=new Array(n.length);for(let o=0;o<n.length;o++)u[o]=t(r+o,n[o]);return u})}function Hn(t,e){return t=l(t),tt(e,(n,r)=>{const u=[];for(let o=0;o<n.length;o++){const i=t(r+o,n[o]);x(i)&&u.push(i)}return u})}function Jn(t){return v(e=>{let n=-1;return(r,u)=>{const o=t(++n,u);return o==null?r:e(r,o)}})}function Zn(t,e){return arguments.length===1?Jn(t):Hn(t,e)}function It(...t){return t.join("")}function Xn(t){if(typeof t=="string"){const e=t.indexOf("/");return e>=1?t.slice(e+1):t}throw new Error("Doesn't support name: "+typeof t)}function Tt(t){return!x(t)}function tr(t){return t==null}const er={};class me{constructor(e){this.val=e,this._watches={},this._deref=()=>this.val,this._hasWatches=!1,this._reset_BANG_=n=>{const r=this.val;if(this.val=n,this._hasWatches)for(const u of Object.entries(this._watches)){const o=u[0],i=u[1];i(o,this,r,n)}return n},this._add_watch=(n,r)=>{this._watches[n]=r,this._hasWatches=!0},this._remove_watch=n=>{delete this._watches[n]}}}function nr(t){return new me(t)}function Y(t){return t._deref()}function Ae(t,e){t._reset_BANG_(e)}function rr(t,e,...n){e=l(e);const r=e(Y(t),...n);return Ae(t,r),r}function ur(t,e,...n){const r=Y(t);e=l(e);const u=e(r,...n);return t._reset_BANG_(u),[r,u]}function or(t,e){const n=Y(t);return t._reset_BANG_(e),[n,e]}function ir(t,e,n){return Y(t)===e?(t._reset_BANG_(n),!0):!1}function sr(t,e,n){let r=t,u=e,o=n;e===void 0&&(r=0,u=t);const i=r||0;o=n??1;const s=o>=0,c=p=>u===void 0||s&&p<u||!s&&u<p,f=p=>()=>{if(!c(p))return null;const N=[];let G=p;for(;N.length<pt&&c(G);)N.push(G),G+=o;return[N,f(G)]};return new y(f(i))}function cr(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function fr(t,e){if(bt(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function lr(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function ar(t,e,n){if(!X(t))throw new Error("subvec: argument must be a vector");if(n===void 0&&(n=t.length),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>t.length)throw new Error("subvec: index out of bounds");return t.slice(e,n)}function _t(...t){return t}const pr=_t;function hr(t){return X(t)}function dt(...t){if(t.length===2){const[n,r]=t,u=l(n),o=a(r);if(Array.isArray(o)){const i=new Array(o.length);for(var e=0;e<o.length;e++)i[e]=u(o[e]);return i}else{const i=[],s=$(o);let c;for(;(c=s())!==null;)for(let f=0;f<c.length;f++)i.push(u(c[f]));return i}}return[...F(...t)]}function xt(t,e){if(e instanceof y){let n=e;for(;;){n.force();const r=n.chunk;if(r===null)return t;Array.prototype.push.apply(t,r),n=n._rest}}for(const n of a(e))t.push(n);return t}function yt(t){return t instanceof y?xt([],t):[...a(t)]}function U(t){return X(t)?t:xt([],t)}function _r(t){return new Set(a(t))}function dr(t){return d(t)===m}function we(t,...e){t=l(t);const n=e.slice(0,e.length-1),r=e[e.length-1],u=t.squint$lang$variadic;if(u){const o=u.length-1,i=[];let s=0,c;for(;s<o&&s<n.length;s++)i.push(n[s]);if(s<o){let f=R(r);for(;s<o&&f!=null;s++)i.push(O(f)),f=st(f);c=f}else c=s<n.length?rt([n.slice(s),r]):r;return c=c==null?null:R(c),c==null?t(...i):u(...i,c)}return t(...n,...a(r))}function be(t){if(!Number.isInteger(t))throw new Error(`Argument must be an integer: ${t}`);return t%2==0}function xr(t){return!be(t)}function nt(t){return t=l(t),(...e)=>Tt(t(...e))}function yr(t){return(...e)=>t}class et extends Array{constructor(...e){super(),this[_]=E,this.push(...e)}}function Ot(t){return t?.[_]===E}function Me(...t){return new et(...t)}function gr(...t){const e=t.pop();return new et(...t,...a(e))}function zt(t){return Array.isArray(t)}const kt=Symbol("concat-done");function rt(t){const e=Array.isArray(t),n=e?t.slice():null,r=e?null:b(a(t));let u=0;const o=()=>{if(e){if(u>=n.length)return kt;const c=n[u];return n[u]=null,u++,c}const s=r.next();return s.done?kt:s.value},i=s=>()=>{for(;;){if(s!==null)if(s instanceof y){if(s.force(),s.chunk!==null)return[s.chunk,i(s._rest)];s=null}else{const f=s.a,p=s.pos;if(p<f.length){const N=Math.min(p+pt,f.length);return[f.slice(p,N),i({a:f,pos:N})]}s=null}const c=o();if(c===kt)return null;s=c instanceof y?c:Array.isArray(c)?{a:c,pos:0}:jt(c)}};return new y(i(null))}const mr=kn((...t)=>rt(t),t=>rt(t));function Ar(t,...e){return e.length===0?ue(F(t),en):rt(F(t,...e))}function ve(t){return t}function ke(...t){const e=t.map(n=>b(a(n)));return g(function*(){for(;;){const n=[];for(const r of e){const u=r.next();if(u.done)return;n.push(u.value)}yield*n}})}function wr(t){return v(e=>{let n=!1;return(r,u)=>{if(!n)return n=!0,e(r,u);const o=e(r,t);return q(o)?o:e(o,u)}})}function br(t,e){return arguments.length===1?wr(t):wt(1,ke(Gt(t),e))}function Mr(t,e){const n=d(t),r=ft(n)||{};for(const u of e){const o=S(t,u);o!==void 0&&T(r,u,o)}return r}function $t(t){return q(t)?Y(t):t}function vr(t){return e=>{let n=[];return(...r)=>{let u,o;switch(r.length){case 0:return e();case 1:return u=r[0],n.length!==0&&(o=[...n],n=[],u=$t(e(u,o))),e(u);case 2:return u=r[0],n.push(r[1]),t===n.length?(o=[...n],n=[],e(u,o)):u}}}}function Se(t,...e){if(arguments.length===1)return vr(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Ee(t,n,[],r,!0)}function Re(t,...e){let n=t,r,u=e[0];return e.length===2?[n,u]=e:e.length>2&&([n,r,u]=e),Ee(t,n,r,u,!1)}const kr=Re,Sr=Se;function Ee(t,e,n,r,u){return z(r,function*(o){let i=[],s=0;for(const c of o)s<t&&(i.push(c),i.length===t&&(yield i,i=e<t?i.slice(e):[])),s++,s===e&&(s=0);i.length>0&&(i.length===t||u?yield i:n!==void 0&&(n!=null&&i.push(...[...a(n)].slice(0,t-i.length)),yield i))})}function Rr(t){return e=>{let n=[];const r={};let u=r;return(...o)=>{const i=o.length;if(i===0)return e();if(i===1){let s=o[0];if(n.length!==0){const c=[...n];n=[],s=$t(e(s,c))}return e(s)}if(i===2){const s=o[0],c=o[1],f=u,p=t(c);if(u=p,f===r||p===f)return n.push(c),s;{const N=[...n];n=[];const G=e(s,N);return q(G)||n.push(c),G}}}}}function Er(t,e){if(t=l(t),arguments.length===1)return Rr(t);const n=b(e);return g(function*(){const r=n.next();r.done&&(yield*null);const u=r.value;let o=t(u),i=[u],s=[];for(;;){const c=n.next();if(c.done){yield i;break}const f=c.value,p=t(f);o==p?i.push(f):(yield i,s.push(f),i=s,o=p,s=[])}})}function gt(t){const e=d(t);if(e!=null)return A(t,ft(e));throw new Error(`Can't create empty of ${typeof t}`)}function Qr(...t){if(!t.some(x))return null;const e=t[0];let n;return e==null?n={}:n=Ke(gt(e),e),W(n,...t.slice(1))}function Qe(t){return t[0]}function Ne(t){return t[1]}function Nr(t,...e){t=l(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(o,i)=>{const s=Qe(i),c=Ne(i);return se(o,s)?D(o,s,t(S(o,s),c)):D(o,s,c)};return B((o,i)=>B(r,o||{},R(i)),e)}else return null}function Kr(){return performance.now()}function Ke(...t){let e,n,r,u,o;switch(t.length){case 0:return[];case 1:return t[0];case 2:return e=t[0]??[],X(e)?xt(I(e),t[1]):B(W,I(e),t[1]);case 3:return e=t[0],n=t[1],r=t[2],u=I(e),o=(i,s)=>s===void 0?i:W(i,s),Yt(n,o,u,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function jr(t,e){return t===e}function Gt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);if(t.length==1){const r=t[0];return g(function*(){for(;;)yield r})}const[e,n]=t;return g(function*(){for(var r=0;r<e;r++)yield n})}function je(t){return q(t)?t:at(t)}function Ir(t){return v(e=>{let n=t;return(r,u)=>{const o=--n+1;return o>0&&(r=e(r,u)),o>1?r:je(r)}})}function mt(t,e){return arguments.length===1?Ir(t):z(e,function*(n){let r=t-1;for(const u of n)if(r-->=0&&(yield u),r<0)return})}function Tr(t,e){if(t<=0)return null;if(Array.isArray(e))return R(e.slice(-t));{const n=new Array(t);let r=0;for(const u of a(e))n[r%t]=u,r++;return r===0?null:r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Or(t){return v(e=>(n,r)=>x(t(r))?e(n,r):at(n))}function At(t,e){return t=l(t),arguments.length===1?Or(t):z(e,function*(n){for(const r of n)if(x(t(r)))yield r;else return})}function zr(t){return v(e=>{let n=-1;return(r,u)=>nn(++n,t)===0?e(r,u):r})}function $r(t,e){return arguments.length===1?zr(t):t<=0?Gt(O(e)):z(e,function*(n){let r=0;for(const u of n)r%t===0&&(yield u),r++})}function Gr(t,...e){return t=l(t),function(...n){return t(...e,...n)}}function Br(t){return g(function*(){for(;;)yield*t})}function qr(t){return v(e=>{let n=t;return(r,u)=>n-- >0?r:e(r,u)})}function wt(t,e){return arguments.length===1?qr(t):z(e,function*(n){for(let r=0;r<t;r++)n.next();yield*n})}function Cr(t){return v(e=>{let n=!0;return(r,u)=>n&&x(t(u))?r:(n=!1,e(r,u))})}function Ie(t,e){return t=l(t),arguments.length===1?Cr(t):z(e,function*(n){for(;;){const r=n.next();if(r.done)break;const u=r.value;if(!x(t(u))){yield u;break}}yield*n})}function Lr(){return v(t=>{const e=new Set;return(n,r)=>e.has(r)?n:(e.add(r),t(n,r))})}function Dr(t){return arguments.length===0?Lr():z(t,function*(e){const n=new Set;for(const r of e)n.has(r)||(yield r),n.add(r)})}const ut=Symbol("dedupe-none");function Pr(){return v(t=>{let e=ut;return(n,r)=>{const u=e!==ut&&x(Z(e,r));return e=r,u?n:t(n,r)}})}function Fr(t){return arguments.length===0?Pr():z(t,function*(e){let n=ut;for(const r of e)(n===ut||!x(Z(n,r)))&&(yield r),n=r})}function Yr(t,e,n,...r){return n=l(n),D(t,e,n(S(t,e),...r))}function Bt(t,e,n){let r=t;for(const u of e)r=S(r,u);return r===void 0?n:r}function Ur(t,e,n,...r){return n=l(n),ne(t,e,n(Bt(t,e),...r))}function qt(t,...e){t=l(t);const n=e.length;return function(...r){for(let u=0;u<n;u++)r[u]==null&&(r[u]=e[u]);return t(...r)}}function Te(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++)if(!t(e[u]))return!1;return!0}const n=$(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++)if(!t(r[u]))return!1;return!0}function Vr(t,e){return!Te(t,e)}function Wr(t){return v(e=>(n,r)=>{const u=t(r);return u==null?n:e(n,u)})}function Hr(t,e){return t=l(t),arguments.length===1?Wr(t):tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=t(n[u]);x(o)&&r.push(o)}return r})}function Jr(t){return yt(t).reverse()}function ot(t,e){return arguments.length===1&&(e=t,t=void 0),t=l(t),yt(e).sort(t||Q)}function Ct(t){return t===Q?t:(e,n)=>{const r=t(e,n);return Ce(r)?r:r?-1:t(n,e)?1:0}}function Zr(t,e,n){return arguments.length===2&&(n=e,e=Q),t=l(t),e=l(e),ot((r,u)=>{const o=Ct(e),i=t(r),s=t(u);return o(i,s)},n)}function Xr(t){const e=yt(t);let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),u=e[n];e[n]=e[r],e[r]=u}return e}function Oe(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++){const o=t(e[u]);if(x(o))return o}return}const n=$(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++){const o=t(r[u]);if(x(o))return o}}function tu(t,e){return t=l(t),!Oe(t,e)}function eu(t,e){return(Array.isArray(e)?dt:F)(r=>{const u=t[r];return u!==void 0?u:r},e)}function nu(t){return!R(t)}function ru(t){return t===void 0&&(t=1),Math.random()*t}function ze(t){return Math.floor(Math.random()*t)}function uu(t){const e=ze(it(t));return le(t,e)}function ou(t){return g(function*(){for(;;)yield t()})}function iu(t,e){arguments.length===1&&(e=t,t=void 0);const n=ou(e);if(t!==void 0){if(typeof t!="number")throw new Error("repeatedly: count must be a number, got: "+It(t));return mt(t,n)}else return n}function Lt(t,e,n,...r){n=l(n);const u=S(t,e);return T(t,e,n(u,...r))}function su(t,e){t=l(t);const n={};for(const r of a(e)){const u=t(r);Lt(n,u,qt(W,[]),r)}return n}function cu(t){const e={},n=qt(ce,0);for(const r of a(t))Lt(e,r,n);return e}class fu extends y{static[Symbol.hasInstance](e){return e instanceof y}constructor(e){super(()=>Kt(b(a(e())))())}}function lu(t){const e=yt(t);return e.pop(),e.length>0?e:null}function au(...t){const[e,n]=t.length>1?t:[1,t[0]];return F((r,u)=>r,n,wt(e,n))}function pu(t,e){return[mt(t,e),wt(t,e)]}function hu(t,e){return[At(t,e),Ie(t,e)]}function it(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;const n=$(t);let r=0,u;for(;(u=n())!==null;)r+=u.length;return r}function _u(t){return t===!0}function du(t){return t===!1}function xu(t){return t!=null}function yu(t){return x(t)}function gu(t){return t===0}function mu(t){return t<0}function Au(t){return t>0}function wu(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function bu(t){return t.length}function Mu(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const u=[e,n,...r],o=u[u.length-1];let i=t,s=0;const c=u.length-2;for(;s<c;s++)i=i[u[s]];return i[u[s]]=o,n}}function vu(t){if(t instanceof y){const e=$(t);for(;e()!==null;);return null}for(const e of a(t));return null}function ku(t){return U(t)}function Su(t){return[...t]}function Ru(t,e,n){return t._add_watch(e,n),t}function Eu(t,e){return t._remove_watch(e),t}function Dt(t,e,n){if(!n)return e;var r=e;for(const u of a(n))r=t(r,u[0],u[1]);return r}function $e(t,...e){let n=t;for(const r of e)n=n>r?n:r;return n}function Qu(t,...e){let n=t;for(const r of e)n=n<r?n:r;return n}function Ge(t){return t==null?!1:!!(lt(t)||t instanceof Map||t[_]===h)}function Nu(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Ku(...t){return(...e)=>{for(const n of t)for(const r of e){const u=n(r);if(u)return u}}}function Be(t,e){return U(e||t)}function ju(t,e){var n=e;return g(function*(){for(;;)yield n,n=t(n)})}function Iu(...t){return t=t.map(l),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function st(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return R(H(t))}function Tu(t){return st(st(t))}function Q(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string"||n==="boolean"&&r==="boolean")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let u=0;u<t.length;u++){const o=Q(t[u],e[u]);if(o!=0)return o}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function Ou(t){return Be(t)}function x(t){return t!=null&&t!==!1}const zu=x;function qe(t,e,n){return t.substring(e,n)}function Pt(t){return typeof t=="function"}function $u(t){return Pt(t)}function Gu(t){return!0}function Bu(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const u of n)if(x(Z(u,r)))return!1;n.push(r)}return!0}function qu(t,e){return g(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:U(n);const o=n.index+$e(1,r.length);if(o>e.length)break;e=qe(e,o)}else break}})}function Cu(t){return Number.isNaN(t)}function Ce(t){return typeof t=="number"}function Le(t){if(t==null)return;switch(d(t)){case M:{const n=Object.keys(t);return n.length?n:void 0}case h:return t.size?Array.from(t.keys()):void 0}}function Lu(t){return Le(t)??[]}function Du(t){if(t==null)return;switch(d(t)){case M:{const n=Object.values(t);return n.length?n:void 0}case h:return t.size?Array.from(t.values()):void 0}}function bt(t){return typeof t=="string"}function Pu(t){return Math.trunc(t)}function Fu(t){return t+1}function Yu(t){return t-1}function Uu(t,e){return t+e}function Vu(t){const e=t.indexOf("/");return e>=1?t.slice(0,e):null}function Wu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Hu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Ju(t){return typeof t=="string"}function Zu(t){return typeof t=="string"}function Xu(t){return!1}function to(t){return typeof t=="string"&&!t.includes("/")}function eo(t){return typeof t=="string"&&t.includes("/")}function no(t){return d(t)!=null}function ro(t){return t instanceof RegExp}class Ft extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function uo(t){return t instanceof Ft?t._data:null}function oo(t){return t instanceof Error?t.message:null}function io(t){return t instanceof Ft?t._cause:null}function so(t,e,n){return new Ft(t,e,n)}function V(t){return Number.isInteger(t)}function co(t){return typeof t=="number"}const fo=V;function lo(t){return V(t)&&t>0}function ao(t){return V(t)&&t>-1}function po(t){return V(t)&&t<0}function De(t){return t instanceof Object?t[L]:null}function Pe(t,e){if(typeof t=="function"){const r=function(...u){return t.apply(this,u)};return r[L]=e,r}if(t?.[_]===k){const r=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return r[L]=e,r}const n=I(t);return n[L]=e,n}function ho(t,e,...n){return Pe(t,e(De(t),...n))}function _o(t){return t===!0||t===!1}function Fe(t){switch(d(t)){case w:case h:case M:case E:case m:return!0}return!1}function xo(t,e){return Fe(e)?it(e):it(mt(t,e))}function yo(t,e){const n=S(t,e);if(n!==void 0)return pe([e,n])}function go(t,e){return(t%e+e)%e}function mo(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i<=r&&(r=i,u=o)}),u}function Ao(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i>=r&&(r=i,u=o)}),u}function Ye(t){throw new Error(`Expected string, got: ${typeof t}`)}function wo(t){if(bt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER)return e}return null}return Ye(t)}function bo(t){return bt(t)?/^[\x00-\x20]*[+-]?NaN[\x00-\x20]*$/.test(t)?NaN:/^[\x00-\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\x00-\x20]*$/.test(t)?parseFloat(t):null:Ye(t)}function Ue(t){return t>=0?Math.floor(t):Math.ceil(t)}function Ve(t,e){const n=t%e;return Ue((t-n)/e)}function We(t,...e){if(e.length==0)for(;;){const n=t();if(x(Pt(n))){t=n;continue}else return n}else return We(function(){return we(t,e)})}function Yt(t,...e){if(e.length===2){const n=e[0],r=e[1];return Yt(t,n,n(),r)}else{let n=e[0];const r=e[1],u=e[2];n=t(n);const o=B(n,r,u);return n(o)}}function Mo(t,e){const n={},r=a(t)[Symbol.iterator](),u=a(e)[Symbol.iterator]();let o,i;for(;o=r.next(),!(o.done||(i=u.next(),i.done));)n[o.value]=i.value;return n}function vo(t){return R(t)?t:null}function He(t,e,n){const r=function*(u){if(yield u,x(t(u)))for(const o of a(e(u)))yield*r(o)};return g(function*(){yield*r(n)})}function ko(t){return ht(nt(Rt),H(He(Rt,R,t)))}function So(t){return I(t)}function Ro(t){return t}const Je=class Ze{constructor(e,n){this[_]=m,this[ct]=!0,this._cmp=n??e?._cmp,e instanceof Ze&&e._cmp===this._cmp||(e=this._cmp?ot(this._cmp,e):ot(e));const u=new Set(e);this._elts=[...u],this._set=u}add(e){if(this._set.has(e))return this;const n=this._elts,r=this._cmp;let u=!1;for(let o=0;o<n.length;o++)if((r?r(e,n[o]):Q(e,n[o]))<=0){n.splice(o,0,e),u=!0;break}return u?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}};function Eo(...t){return new Je(t)}function Qo(t,...e){return new Je(e,Ct(l(t)))}const Xe=class{constructor(e,n){if(this[_]=h,this[ct]=!0,this._cmp=n??e?._cmp,this._map=new Map,this._keys=[],this.size=0,e)for(const[r,u]of e)this.set(r,u)}set(e,n){if(!this._map.has(e)){const r=this._keys,u=this._cmp;let o=0;for(;o<r.length&&(u?u(e,r[o]):Q(e,r[o]))>0;)o++;r.splice(o,0,e)}return this._map.set(e,n),this.size=this._map.size,this}get(e){return this._map.get(e)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)&&(this._keys.splice(this._keys.indexOf(e),1),this.size=this._map.size),this}*keys(){yield*this._keys}*values(){for(const e of this._keys)yield this._map.get(e)}*entries(){for(const e of this._keys)yield[e,this._map.get(e)]}forEach(e){for(const n of this._keys)e(this._map.get(n),n,this)}clear(){this._map.clear(),this._keys=[],this.size=0}[Symbol.iterator](){return this.entries()}};function No(...t){const e=new Xe;for(let n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}function Ko(t,...e){const n=new Xe(null,Ct(l(t)));for(let r=0;r<e.length;r+=2)n.set(e[r],e[r+1]);return n}function Et(t,e,n){return r=>e(Q(r,n),0)}function tn(t,e,n=!0){let r=0;for(;r<t.length&&Q(e,t[r])>0;r++);return r}function jo([t,e,n]){const r=Et(t,e,n);if(e===Jt||e===Zt){const u=[...t],o=tn(u,n,!0);return u.splice(0,o),r(u[0])||u.splice(0,1),u}else return[...At(r,t)]}function Io([t,e,n,r,u]){const o=[...t],i=tn(o,n,!0);o.splice(0,i);const s=Et(t,r,u);return Et(t,e,n)(o[0])||o.splice(0,1),[...At(s,o)]}function To(...t){if(t.length===3)return jo(t);if(t.length===5)return Io(t)}function Oo(t){return Math.abs(t)}function zo(t){return Ue(t)}function $o(t){return t}function Go(t){return t}function Bo(t){return t!=null&&t.constructor}function qo(t){return(e,n)=>{const r=t(e,n);return q(r)?at(r):r}}function en(t){const e=qo(t);return(...n)=>{switch(n.length){case 0:return t();case 1:return t(n[0]);case 2:return B(e,n[0],n[1])}}}function nn(t,e){const n=Ve(t,e);return t-e*n}function Co(t){const e=new Map;return(...n)=>{const r=[n.length,...n],u=Bt(e,r);if(u===void 0){const o=t(...n);return re(e,r,o),o}else return u}}function Lo(t){return Ot(t)?O(t):zt(t)?t[t.length-1]:O(t)}function Do(t){if(t==null)return null;if(Ot(t)){if(t.length===0)throw new Error("Can't pop empty list");return H(t)}else if(zt(t)){if(t.length===0)throw new Error("Can't pop empty vector");const e=[...t];return e.pop(),e}else return H(t)}function Po(t,e){const n=gt(t),r=Xt(t)||T;return Dt((u,o,i)=>r(u,e(o),i),n,t),n}function rn(t,e){const n=gt(t),r=Xt(t)||T;return Dt((u,o,i)=>r(u,o,e(i)),n,t),n}function Fo(){return crypto.randomUUID()}class Mt{constructor(e){this.uuid=e}toString(){return this.uuid}}function Yo(t){return new Mt(t)}function Uo(t){return t instanceof Mt}function Vo(t){return t instanceof Date}class un{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function Wo(t){if(t instanceof un||t instanceof y)return t.realized===!0;throw new Error("realized? not supported on: "+It(t))}function Qt(t,e){if(e.has(t))return t;if(e.add(t),Ge(t))return rn(t,r=>Qt(r,e));const n=d(t);return n&&n!=M?dt(r=>Qt(r,e),t):t}function Ho(t){return Qt(t,new Set)}function Jo(t,e){B((n,r)=>t(r),null,e)}function Zo(...t){return Tt(Z(...t))}class Xo{constructor(e){this.v=e}_deref(){return this.v}}function ti(t){return new Xo(t)}function ei(t,e){return t.v=e,e}function K(t,e=new WeakSet,n=!0){if(t==null)return"nil";if(typeof t=="number")return t===1/0?"##Inf":t===-1/0?"##-Inf":Number.isNaN(t)?"##NaN":String(t);if(typeof t=="boolean")return String(t);if(typeof t=="string")return n?JSON.stringify(t):t;if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(t instanceof Mt)return n?`#uuid "${t.uuid}"`:t.uuid;if(e.has(t))return"#object[circular]";e.add(t);const r=d(t);let u,o;switch(r){case w:o=`[${t.map(i=>K(i,e,n)).join(" ")}]`;break;case m:o=`#{${Array.from(t).map(i=>K(i,e,n)).join(" ")}}`;break;case h:o=`#js/Map {${Array.from(t.entries()).map(([i,s])=>`${K(i,e,n)} ${K(s,e,n)}`).join(", ")}}`;break;case k:case E:o=`(${dt(i=>`${K(i,e,n)}`,t).join(", ")})`;break;default:if(t.constructor&&t.constructor!==Object)return e.delete(t),`#<${t.constructor.name}>`;u=Object.keys(t),o=`{${u.map(i=>`:${i} ${K(t[i],e,n)}`).join(", ")}}`}return e.delete(t),o}return`#object[${t.constructor.name}]`}function Ut(...t){return t.map((e,n)=>K(e)).join(" ")}function ni(...t){P.val(Ut(...t)),Nt.val&&P.val(`
|
|
3
|
-
`)}return
|
|
1
|
+
var squint;(squint||={}).core=(()=>{var vt=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var fn=Object.prototype.hasOwnProperty;var ln=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},an=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of cn(e))!fn.call(t,u)&&u!==n&&vt(t,u,{get:()=>e[u],enumerable:!(r=sn(e,u))||r.enumerable});return t};var pn=t=>an(vt({},"__esModule",{value:!0}),t);var ui={};ln(ui,{Atom:()=>Ae,Cons:()=>ge,Delay:()=>on,IIterable:()=>_e,IIterable__iterator:()=>Bn,LazySeq:()=>lu,NaN_QMARK_:()=>Lu,PROTOCOL_SENTINEL:()=>nr,UUID:()=>kt,_:()=>An,_EQ_:()=>Z,_GT_:()=>Zt,_GT__EQ_:()=>Xt,_LT_:()=>xn,_LT__EQ_:()=>yn,_PLUS_:()=>gn,_STAR_:()=>mn,_STAR_print_err_fn_STAR_:()=>In,_STAR_print_fn_STAR_:()=>P,_STAR_print_newline_STAR_:()=>Kt,__protocol_satisfies:()=>wn,__toFn:()=>l,_iterator:()=>de,abs:()=>zo,aclone:()=>Ru,add_watch:()=>Eu,alength:()=>Mu,any_QMARK_:()=>Bu,apply:()=>be,array:()=>hr,array_QMARK_:()=>$t,array_map:()=>vn,aset:()=>ku,assoc:()=>D,assoc_BANG_:()=>I,assoc_in:()=>re,assoc_in_BANG_:()=>ue,atom:()=>rr,boolean$:()=>gu,boolean_QMARK_:()=>xo,bounded_count:()=>yo,butlast:()=>au,cat:()=>nn,clj__GT_js:()=>Jo,coll_QMARK_:()=>ro,comp:()=>oe,compare:()=>N,compare_and_set_BANG_:()=>sr,complement:()=>rt,concat:()=>Ar,conj:()=>En,conj_BANG_:()=>W,cons:()=>Yn,constantly:()=>gr,contains_QMARK_:()=>ce,count:()=>st,counted_QMARK_:()=>Ye,cycle:()=>qr,dec:()=>jn,dedupe:()=>Yr,deref:()=>Y,disj:()=>Nn,disj_BANG_:()=>se,dissoc:()=>Kn,dissoc_BANG_:()=>Qn,distinct:()=>Pr,distinct_QMARK_:()=>qu,doall:()=>Su,dorun:()=>vu,double$:()=>Bo,double_QMARK_:()=>fo,drop:()=>bt,drop_last:()=>pu,drop_while:()=>Te,empty:()=>mt,empty_QMARK_:()=>ru,ensure_reduced:()=>Ie,es6_iterator:()=>M,even_QMARK_:()=>Me,every_QMARK_:()=>Oe,every_pred:()=>Ku,ex_cause:()=>so,ex_data:()=>oo,ex_info:()=>co,ex_message:()=>io,false_QMARK_:()=>xu,ffirst:()=>Cn,filter:()=>_t,filterv:()=>Un,find:()=>go,first:()=>T,flatten:()=>So,float$:()=>Go,fn_QMARK_:()=>Ft,fnil:()=>Ct,frequencies:()=>fu,get:()=>S,get_in:()=>qt,group_by:()=>cu,hash_map:()=>ee,identical_QMARK_:()=>Ir,identity:()=>ve,ifn_QMARK_:()=>Gu,inc:()=>fe,inst_QMARK_:()=>Wo,int_QMARK_:()=>V,integer_QMARK_:()=>lo,interleave:()=>Se,interpose:()=>Mr,into:()=>je,into_array:()=>qe,iterable:()=>a,iterate:()=>Iu,js_keys:()=>Du,js_obj:()=>bu,juxt:()=>Tu,keep:()=>Jr,keep_indexed:()=>Xn,key:()=>Qe,keys:()=>De,keyword:()=>Hu,keyword_QMARK_:()=>Zu,last:()=>Ln,lazy:()=>g,list:()=>ke,list_QMARK_:()=>zt,list_STAR_:()=>mr,long$:()=>$o,map:()=>F,map_QMARK_:()=>Be,map_entry_QMARK_:()=>Gn,map_indexed:()=>Hn,mapcat:()=>wr,mapv:()=>xt,max:()=>Ge,max_key:()=>wo,memoize:()=>Lo,merge:()=>Qr,merge_with:()=>Kr,meta:()=>Pe,min:()=>Qu,min_key:()=>Ao,mod:()=>mo,name:()=>tr,namespace:()=>Wu,nat_int_QMARK_:()=>po,neg_QMARK_:()=>Au,neg_int_QMARK_:()=>ho,next:()=>ct,nil_QMARK_:()=>er,nnext:()=>Ou,not:()=>Ot,not_EQ_:()=>Xo,not_any_QMARK_:()=>eu,not_empty:()=>vo,not_every_QMARK_:()=>Wr,nth:()=>ae,number_QMARK_:()=>Le,object_QMARK_:()=>ne,odd_QMARK_:()=>yr,parse_double:()=>Mo,parse_long:()=>bo,partial:()=>Br,partition:()=>Ee,partition_all:()=>Re,partition_by:()=>Nr,partitionv:()=>Sr,partitionv_all:()=>Rr,peek:()=>Do,persistent_BANG_:()=>Eo,pop:()=>Po,pos_QMARK_:()=>wu,pos_int_QMARK_:()=>ao,pr:()=>On,pr_str:()=>Vt,print:()=>le,println:()=>Tn,prn:()=>ri,qualified_keyword_QMARK_:()=>no,quot:()=>We,rand:()=>uu,rand_int:()=>$e,rand_nth:()=>ou,random_uuid:()=>Yo,range:()=>cr,re_find:()=>lr,re_matches:()=>fr,re_pattern:()=>ar,re_seq:()=>Cu,realized_QMARK_:()=>Ho,reduce:()=>B,reduce_kv:()=>Pt,reduced:()=>pt,reduced_QMARK_:()=>q,reductions:()=>Pn,regexp_QMARK_:()=>uo,rem:()=>rn,remove:()=>Vn,remove_watch:()=>Nu,repeat:()=>Bt,repeatedly:()=>su,replace:()=>nu,reset_BANG_:()=>we,reset_vals_BANG_:()=>ir,rest:()=>H,reverse:()=>Zr,run_BANG_:()=>Zo,satisfies_QMARK_:()=>bn,second:()=>qn,select_keys:()=>kr,seq:()=>R,seq_QMARK_:()=>zn,seqable_QMARK_:()=>$n,sequential_QMARK_:()=>Et,set:()=>dr,set_QMARK_:()=>xr,shuffle:()=>tu,simple_keyword_QMARK_:()=>eo,some:()=>ze,some_QMARK_:()=>yu,some_fn:()=>ju,sort:()=>it,sort_by:()=>Xr,sorted_map:()=>Ko,sorted_map_by:()=>jo,sorted_set:()=>No,sorted_set_by:()=>Qo,split_at:()=>hu,split_with:()=>_u,str:()=>Tt,string_QMARK_:()=>Mt,subs:()=>Ce,subseq:()=>Oo,subvec:()=>pr,swap_BANG_:()=>ur,swap_vals_BANG_:()=>or,symbol:()=>Ju,symbol_QMARK_:()=>Xu,system_time:()=>jr,t:()=>$u,take:()=>At,take_last:()=>Or,take_nth:()=>Gr,take_while:()=>wt,to_array:()=>zu,trampoline:()=>He,transduce:()=>Ut,transient$:()=>Ro,tree_seq:()=>Je,true_QMARK_:()=>du,truth_:()=>x,type:()=>qo,unchecked_add_int:()=>Vu,unchecked_dec_int:()=>Uu,unchecked_inc_int:()=>Yu,unchecked_int:()=>Fu,unreduced:()=>Gt,update:()=>Ur,update_BANG_:()=>Dt,update_in:()=>Vr,update_keys:()=>Fo,update_vals:()=>un,uuid:()=>Uo,uuid_QMARK_:()=>Vo,val:()=>Ke,vals:()=>Pu,var_QMARK_:()=>to,vary_meta:()=>_o,vec:()=>U,vector:()=>dt,vector_QMARK_:()=>_r,volatile_BANG_:()=>ei,vreset_BANG_:()=>ni,warn_on_lazy_reusage_BANG_:()=>Fn,with_meta:()=>Fe,zero_QMARK_:()=>mu,zipmap:()=>ko});function l(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>S(n,t,r):e==="object"?(n,r)=>S(t,n,r):t}var Rt=Object.prototype.hasOwnProperty;function Wt(t,e,n){for(n of t.keys())if(G(n,e))return n}function Ht(t){return t!=null&&t[ft]===!0&&t[_]===h}function nt(t){return t!=null&&(t instanceof Set||t[_]===m)}function hn(t){return t!=null&&typeof t=="object"&&(t.constructor===Object||t instanceof Map||t[_]===h)}function _n(t,e){return t instanceof Map||t[_]===h?t.has(e):Rt.call(t,e)}function dn(t,e){return t instanceof Map||t[_]===h?t.get(e):t[e]}function Jt(t){return t instanceof Map||t[_]===h?t.size:Object.keys(t).length}function G(t,e){if(t===e)return!0;if(t==null)return e==null;var n,r,u;const o=Ht(t);if(o||Ht(e)){const i=o?t:e,s=i===t?e:t;if(!hn(s)||Jt(i)!==Jt(s))return!1;for(const c of i.keys())if(!_n(s,c)||!G(i.get(c),dn(s,c)))return!1;return!0}if(nt(t)||nt(e)){if(!nt(t)||!nt(e)||t.size!==e.size)return!1;for(let i of t)if(i&&typeof i=="object"&&(i=Wt(e,i),!i)||!e.has(i))return!1;return!0}if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===Array){if((r=t.length)===e.length)for(;r--&&G(t[r],e[r]););return r===-1}if(n===Map){if(t.size!==e.size)return!1;for(const i of t)if(u=i[0],u&&typeof u=="object"&&(u=Wt(e,u),!u)||!G(i[1],e.get(u)))return!1;return!0}if((!n||typeof t=="object")&&t[_]!==v){r=0;for(const i in t)if(Rt.call(t,i)&&++r&&!Rt.call(e,i)||!(i in e)||!G(t[i],e[i]))return!1;return Object.keys(e).length===r}}if(t&&e&&(Array.isArray(t)||t[_]===v)&&(Array.isArray(e)||e[_]===v)){const i=t[Symbol.iterator](),s=e[Symbol.iterator]();for(;;){const c=i.next(),f=s.next();if(c.done||f.done)return!!(c.done&&f.done);if(!G(c.value,f.value))return!1}}return!1}function J(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Z(...t){return J(t,(e,n)=>G(e,n))}function Zt(...t){return J(t,(e,n)=>e>n)}function Xt(...t){return J(t,(e,n)=>e>=n)}function xn(...t){return J(t,(e,n)=>e<n)}function yn(...t){return J(t,(e,n)=>e<=n)}function gn(...t){return t.reduce((e,n)=>e+n,0)}function mn(...t){return t.reduce((e,n)=>e*n,1)}function An(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const wn={};function bn(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function Mn(t,e,n){return t.set(e,n),t}function kn(t,e,n){return t[e]=n,t}function te(t){switch(d(t)){case h:return Mn;case b:case A:return kn}}function I(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(d(t)){case h:t.set(e,n);for(let u=0;u<r.length;u+=2)t.set(r[u],r[u+1]);break;case b:case A:t[e]=n;for(let u=0;u<r.length;u+=2)t[r[u]]=r[u+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}const L=Symbol("meta");function w(t,e){const n=t?.[L];return n!==void 0&&(e[L]=n),e}function j(t){switch(d(t)){case h:return w(t,new t.constructor(t));case m:return w(t,new t.constructor(t));case b:return w(t,[...t]);case A:return w(t,{...t});case E:return w(t,new et(...t));default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function D(t,e,n,...r){t||(t={});const u=j(t);return I(u,e,n,...r),u}function ee(...t){return t.length===0?{}:D({},...t)}const vn=ee,h=1,b=2,A=3,E=4,m=5,v=6,_=Symbol("squint.lang.type"),ft=Symbol("squint.lang.sorted");function Sn(t,e){return t.squint$lang$variadic=e,t}function lt(t){switch(t){case h:return new Map;case b:return[];case A:return{};case E:return new et;case m:return new Set;case v:return g(function*(){})}}function at(t){return t.constructor===Object}function X(t){return Array.isArray(t)&&t[_]!==E}function ne(t){return t!=null&&at(t)}function d(t){if(t==null)return;if(at(t))return A;if(t instanceof Map)return h;if(t instanceof Set)return m;const e=t[_];if(e!==void 0)return e;if(X(t))return b;if(typeof t=="object")return A}function Rn(t,e,n,r,u){r=U(r),n=n||{};const o=d(n);if(o!==h&&o!==b&&o!==A)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let s=n;for(let c=0;c<r.length-1;c+=1){const f=r[c];let p;s instanceof Map?p=s.get(f):p=s[f],p||(p=lt(o)),i.push(p),s=p}i.push(u);for(let c=i.length-2;c>=0;c-=1)i[c]=t(i[c],r[c],i[c+1]);return i[0]}function re(t,e,n){return Rn(D,"assoc-in",t,e,n)}function ue(t,e,n){e=U(e);var r=t;const u=d(t);for(const o of e.splice(0,e.length-1)){let i=S(r,o);i===void 0&&(i=lt(u),I(r,o,i)),r=i}return I(r,e[e.length-1],n),t}function oe(...t){if(t=t.map(l),t.length===0)return ve;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let u=e(...r);for(const o of n)u=o(u);return u}}function ie(t,e){for(const n of e)t.add(n);return t}function W(...t){const e=t.length;if(e===0)return dt();let n=t[0];if(n==null&&(n=[]),e===2)switch(d(n)){case b:return n.push(t[1]),n;case m:return n.add(t[1]),n}const r=t.slice(1);switch(d(n)){case m:ie(n,r);break;case E:n.unshift(...r.reverse());break;case b:n.push(...r);break;case h:for(const u of r)Array.isArray(u)?n.set(u[0],u[1]):a(u).forEach(o=>{n.set(o[0],o[1])});break;case A:for(const u of r)Array.isArray(u)?n[u[0]]=u[1]:Object.assign(n,u);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return n}function En(...t){if(t.length===0)return dt();const[e,...n]=t;if(n.length===0)return e;let r=e;r==null&&(r=ke());let u,o;switch(d(r)){case m:return r[ft]?w(r,ie(new r.constructor(r),n)):w(r,new r.constructor([...r,...n]));case E:return w(r,new et(...n.reverse(),...r));case b:return w(r,[...r,...n]);case h:u=new Map(r);for(const i of n)Array.isArray(i)?u.set(i[0],i[1]):a(i).forEach(s=>{u.set(s[0],s[1])});return w(r,u);case v:return g(function*(){yield*n,yield*r});case A:o={...r};for(const i of n)Array.isArray(i)?o[i[0]]=i[1]:Object.assign(o,i);return w(r,o);default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function se(t,...e){for(const n of e)t.delete(n);return t}function Nn(t,...e){if(t==null)return t;const n=new t.constructor(t);return se(n,...e)}function ce(t,e){if(typeof t=="string")return V(e)&&e>=0&&e<t.length;switch(d(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function Qn(t,...e){for(const n of e)delete t[n];return t}function Kn(t,...e){if(!t)return;if(e.length===0)return t;if(d(t)===h){let u=!1;for(const i of e)if(t.has(i)){u=!0;break}if(!u)return t;const o=j(t);for(const i of e)o.delete(i);return o}let n=!1;for(const u of e)if(u in t){n=!0;break}if(!n)return t;const r=j(t);for(const u of e)delete r[u];return r}function fe(t){return t+1}function jn(t){return t-1}const Kt={val:!1},P={val:t=>console.log(t)},In={val:t=>console.error(t)};function le(...t){P.val(t.map(e=>K(e,void 0,!1)).join(" "))}function Tn(...t){le(...t),Kt.val&&P.val(`
|
|
2
|
+
`)}function On(...t){P.val(Vt(...t))}function ae(t,e,n){const r=arguments.length>2;if(t==null)return r?n:null;if(Array.isArray(t)){if(e>=0&&e<t.length)return t[e]}else if(e>=0){const u=z(t);let o=0,i;for(;(i=u())!==null;){if(e<o+i.length)return i[e-o];o+=i.length}}if(r)return n;throw new Error("Index out of bounds: "+e)}function S(t,e,n=void 0){if(t==null)return n;let r;if(at(t))return r=t[e],r===void 0?n:r;let u;switch(d(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case b:r=t[e];break;default:if(u=t.get,typeof u=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function zn(t){return t!=null&&!!t[Symbol.iterator]}function Et(t){return Array.isArray(t)||t?.[_]===v}function $n(t){return t==null||ne(t)||!!t[Symbol.iterator]}const pe=Symbol("squint.lang.map-entry");function he(t){return t[pe]=!0,t}function Gn(t){return Array.isArray(t)&&t[pe]===!0}function a(t){if(t==null)return[];if(t[Symbol.iterator])return t;if(t instanceof Object)return Object.entries(t).map(he);throw new TypeError(`${t} is not iterable`)}const _e=Symbol("Iterable"),Bn=Symbol.iterator;function de(t){return t[Symbol.iterator]()}const M=de;function R(t){if(t==null)return t;if(typeof t=="string")return t.length?[...t]:null;const e=a(t);return e.length===0||e.size===0?null:e instanceof Set||e[_]===m?[...e]:e[Symbol.iterator]().next().done?null:e}function T(t){if(t==null)return;if(Array.isArray(t))return t[0];if(t instanceof y)return t.force(),t.chunk===null?void 0:t.chunk[0];const[e]=a(t);return e}function qn(t){if(t instanceof y){t.force();const r=t.chunk;return r===null?void 0:r.length>1?r[1]:T(t._rest)}const[e,n]=a(t);return n}function Cn(t){return T(T(t))}function H(t){const e=It(t);e.force();const n=e.chunk;if(n===null)return e;if(n.length>1){const r=new y(null);return r.realized=!0,r.chunk=n.slice(1),r._rest=e._rest,r}return e._rest}class C{value;constructor(e){this.value=e}_deref(){return this.value}}function Ln(t){if(t=a(t),Array.isArray(t))return t[t.length-1];const e=z(t);let n,r;for(;(r=e())!==null;)n=r[r.length-1];return n}function pt(t){return new C(t)}function q(t){return t instanceof C}function B(t,e,n){t=l(t);const r=arguments.length!==2,u=r?n:e;let o=r?e:void 0;if(Array.isArray(u)){let f=0;if(!r){if(u.length===0)return t();o=u[0],f=1}if(o instanceof C)return o.value;for(;f<u.length;f++)if(o=t(o,u[f]),o instanceof C)return o.value;return o}const i=z(u);let s=i(),c=0;if(!r){if(s===null)return t();o=s[0],c=1}if(o instanceof C)return o.value;for(;s!==null;){for(;c<s.length;c++)if(o=t(o,s[c]),o instanceof C)return o.value;s=i(),c=0}return o}function*Dn(t,e){const n=e.next();n.done?yield t():yield*xe(t,n.value,e)}function*xe(t,e,n){let r=e;const u=n;for(;;){if(q(r)){yield r.value;return}else yield r;const o=u.next();if(o.done)break;r=t(r,o.value)}}function Pn(t,e,n){if(t=l(t),arguments.length===2){const u=M(a(e));return g(function*(){yield*Dn(t,u)})}const r=M(a(n));return g(function*(){yield*xe(t,e,r)})}function Fn(){console.warn("warn-on-lazy-reusage! is deprecated and does nothing: lazy values are now cached.")}const ht=32,y=class ye{constructor(e){this[_]=v,this[_e]=!0,this.step=e,this.realized=!1,this.chunk=null,this._rest=null}force(){if(!this.realized){this.realized=!0;const e=this.step();this.step=null,e!=null&&(this.chunk=e[0],this._rest=new ye(e[1]))}return this}[Symbol.iterator](){let e=this,n=0;return{next(){for(;;){e.force();const r=e.chunk;if(r===null)return{value:void 0,done:!0};if(n<r.length)return{value:r[n++],done:!1};e=e._rest,n=0}},[Symbol.iterator](){return this}}}indexOf(e,n=0){let r=0;for(const u of this){if(r>=n&&u===e)return r;r++}return-1}};function jt(t){const e=()=>{const n=t.next();return n.done?null:[[n.value],e]};return e}function g(t){return new y(jt(t()))}function O(t,e){const n=M(a(t));return g(()=>e(n))}function It(t){if(t instanceof y)return t;if(Array.isArray(t)){const e=n=>()=>{if(n>=t.length)return null;const r=Math.min(n+ht,t.length);return[t.slice(n,r),e(r)]};return new y(e(0))}return new y(jt(M(a(t))))}function z(t){if(t instanceof y){let n=t;return()=>{if(n===null)return null;n.force();const r=n.chunk;return n=r===null?null:n._rest,r}}const e=M(a(t));return()=>{const n=[];for(let r=0;r<ht;r++){const u=e.next();if(u.done)break;n.push(u.value)}return n.length===0?null:n}}function tt(t,e){const n=It(t),r=(u,o)=>()=>{let i=u,s=o;for(;;){i.force();const c=i.chunk;if(c===null)return null;const f=e(c,s),p=i._rest;if(s+=c.length,f.length!==0)return[f,r(p,s)];i=p}};return new y(r(n,0))}const ge=class{constructor(e,n){this[_]=v,this.x=e,this.coll=n}[Symbol.iterator](){const e=this.x;let n=this.coll,r=!1,u=null;return{next(){return r?(u||(u=M(a(n)),n=null),u.next()):(r=!0,{value:e,done:!1})},[Symbol.iterator](){return this}}}};function Yn(t,e){return new ge(t,e)}function F(t,...e){switch(t=l(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return tt(e[0],n=>{const r=new Array(n.length);for(let u=0;u<n.length;u++)r[u]=t(n[u]);return r});default:{const n=e.map(r=>M(a(r)));return g(function*(){for(;;){const r=[];for(const u of n){const o=u.next();if(o.done)return;r.push(o.value)}yield t(...r)}})}}}function k(t){return e=>{const n=t(e);return(...r)=>r.length===0?e():r.length===1?e(r[0]):n(r[0],r[1])}}function me(t){return k(e=>(n,r)=>x(t(r))?e(n,r):n)}function _t(t,e){return arguments.length===1?me(t):(t=l(t),tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=n[u];x(t(o))&&r.push(o)}return r}))}function Un(t,e){return yt([],_t(t,e))}function Vn(t,e){return arguments.length===1?me(rt(t)):_t(rt(t),e)}function Wn(t){return k(e=>{let n=-1;return(r,u)=>e(r,t(++n,u))})}function Hn(t,e){return t=l(t),arguments.length===1?Wn(t):tt(e,(n,r)=>{const u=new Array(n.length);for(let o=0;o<n.length;o++)u[o]=t(r+o,n[o]);return u})}function Jn(t,e){return t=l(t),tt(e,(n,r)=>{const u=[];for(let o=0;o<n.length;o++){const i=t(r+o,n[o]);x(i)&&u.push(i)}return u})}function Zn(t){return k(e=>{let n=-1;return(r,u)=>{const o=t(++n,u);return o==null?r:e(r,o)}})}function Xn(t,e){return arguments.length===1?Zn(t):Jn(t,e)}function Tt(...t){return t.join("")}function tr(t){if(typeof t=="string"){const e=t.indexOf("/");return e>=1?t.slice(e+1):t}throw new Error("Doesn't support name: "+typeof t)}function Ot(t){return!x(t)}function er(t){return t==null}const nr={};class Ae{constructor(e){this.val=e,this._watches={},this._deref=()=>this.val,this._hasWatches=!1,this._reset_BANG_=n=>{const r=this.val;if(this.val=n,this._hasWatches)for(const u of Object.entries(this._watches)){const o=u[0],i=u[1];i(o,this,r,n)}return n},this._add_watch=(n,r)=>{this._watches[n]=r,this._hasWatches=!0},this._remove_watch=n=>{delete this._watches[n]}}}function rr(t){return new Ae(t)}function Y(t){return t._deref()}function we(t,e){t._reset_BANG_(e)}function ur(t,e,...n){e=l(e);const r=e(Y(t),...n);return we(t,r),r}function or(t,e,...n){const r=Y(t);e=l(e);const u=e(r,...n);return t._reset_BANG_(u),[r,u]}function ir(t,e){const n=Y(t);return t._reset_BANG_(e),[n,e]}function sr(t,e,n){return Y(t)===e?(t._reset_BANG_(n),!0):!1}function cr(t,e,n){let r=t,u=e,o=n;e===void 0&&(r=0,u=t);const i=r||0;o=n??1;const s=o>=0,c=p=>u===void 0||s&&p<u||!s&&u<p,f=p=>()=>{if(!c(p))return null;const Q=[];let $=p;for(;Q.length<ht&&c($);)Q.push($),$+=o;return[Q,f($)]};return new y(f(i))}function fr(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function lr(t,e){if(Mt(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function ar(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function pr(t,e,n){if(!X(t))throw new Error("subvec: argument must be a vector");if(n===void 0&&(n=t.length),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>t.length)throw new Error("subvec: index out of bounds");return t.slice(e,n)}function dt(...t){return t}const hr=dt;function _r(t){return X(t)}function xt(...t){if(t.length===2){const[n,r]=t,u=l(n),o=a(r);if(Array.isArray(o)){const i=new Array(o.length);for(var e=0;e<o.length;e++)i[e]=u(o[e]);return i}else{const i=[],s=z(o);let c;for(;(c=s())!==null;)for(let f=0;f<c.length;f++)i.push(u(c[f]));return i}}return[...F(...t)]}function yt(t,e){if(e instanceof y){let n=e;for(;;){n.force();const r=n.chunk;if(r===null)return t;Array.prototype.push.apply(t,r),n=n._rest}}for(const n of a(e))t.push(n);return t}function gt(t){return t instanceof y?yt([],t):[...a(t)]}function U(t){return X(t)?t:yt([],t)}function dr(t){return new Set(a(t))}function xr(t){return d(t)===m}function be(t,...e){t=l(t);const n=e.slice(0,e.length-1),r=e[e.length-1],u=t.squint$lang$variadic;if(u){const o=u.length-1,i=[];let s=0,c;for(;s<o&&s<n.length;s++)i.push(n[s]);if(s<o){let f=R(r);for(;s<o&&f!=null;s++)i.push(T(f)),f=ct(f);c=f}else c=s<n.length?ut([n.slice(s),r]):r;return c=c==null?null:R(c),c==null?t(...i):u(...i,c)}return t(...n,...a(r))}function Me(t){if(!Number.isInteger(t))throw new Error(`Argument must be an integer: ${t}`);return t%2==0}function yr(t){return!Me(t)}function rt(t){return t=l(t),(...e)=>Ot(t(...e))}function gr(t){return(...e)=>t}class et extends Array{constructor(...e){super(),this[_]=E,this.push(...e)}}function zt(t){return t?.[_]===E}function ke(...t){return new et(...t)}function mr(...t){const e=t.pop();return new et(...t,...a(e))}function $t(t){return Array.isArray(t)}const St=Symbol("concat-done");function ut(t){const e=Array.isArray(t),n=e?t.slice():null,r=e?null:M(a(t));let u=0;const o=()=>{if(e){if(u>=n.length)return St;const c=n[u];return n[u]=null,u++,c}const s=r.next();return s.done?St:s.value},i=s=>()=>{for(;;){if(s!==null)if(s instanceof y){if(s.force(),s.chunk!==null)return[s.chunk,i(s._rest)];s=null}else{const f=s.a,p=s.pos;if(p<f.length){const Q=Math.min(p+ht,f.length);return[f.slice(p,Q),i({a:f,pos:Q})]}s=null}const c=o();if(c===St)return null;s=c instanceof y?c:Array.isArray(c)?{a:c,pos:0}:It(c)}};return new y(i(null))}const Ar=Sn((...t)=>ut(t),t=>ut(t));function wr(t,...e){return e.length===0?oe(F(t),nn):ut(F(t,...e))}function ve(t){return t}function Se(...t){const e=t.map(n=>M(a(n)));return g(function*(){for(;;){const n=[];for(const r of e){const u=r.next();if(u.done)return;n.push(u.value)}yield*n}})}function br(t){return k(e=>{let n=!1;return(r,u)=>{if(!n)return n=!0,e(r,u);const o=e(r,t);return q(o)?o:e(o,u)}})}function Mr(t,e){return arguments.length===1?br(t):bt(1,Se(Bt(t),e))}function kr(t,e){const n=d(t),r=lt(n)||{};for(const u of e){const o=S(t,u);o!==void 0&&I(r,u,o)}return r}function Gt(t){return q(t)?Y(t):t}function vr(t){return e=>{let n=[];return(...r)=>{let u,o;switch(r.length){case 0:return e();case 1:return u=r[0],n.length!==0&&(o=[...n],n=[],u=Gt(e(u,o))),e(u);case 2:return u=r[0],n.push(r[1]),t===n.length?(o=[...n],n=[],e(u,o)):u}}}}function Re(t,...e){if(arguments.length===1)return vr(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Ne(t,n,[],r,!0)}function Ee(t,...e){let n=t,r,u=e[0];return e.length===2?[n,u]=e:e.length>2&&([n,r,u]=e),Ne(t,n,r,u,!1)}const Sr=Ee,Rr=Re;function Ne(t,e,n,r,u){return O(r,function*(o){let i=[],s=0;for(const c of o)s<t&&(i.push(c),i.length===t&&(yield i,i=e<t?i.slice(e):[])),s++,s===e&&(s=0);i.length>0&&(i.length===t||u?yield i:n!==void 0&&(n!=null&&i.push(...[...a(n)].slice(0,t-i.length)),yield i))})}function Er(t){return e=>{let n=[];const r={};let u=r;return(...o)=>{const i=o.length;if(i===0)return e();if(i===1){let s=o[0];if(n.length!==0){const c=[...n];n=[],s=Gt(e(s,c))}return e(s)}if(i===2){const s=o[0],c=o[1],f=u,p=t(c);if(u=p,f===r||p===f)return n.push(c),s;{const Q=[...n];n=[];const $=e(s,Q);return q($)||n.push(c),$}}}}}function Nr(t,e){if(t=l(t),arguments.length===1)return Er(t);const n=M(e);return g(function*(){const r=n.next();r.done&&(yield*null);const u=r.value;let o=t(u),i=[u],s=[];for(;;){const c=n.next();if(c.done){yield i;break}const f=c.value,p=t(f);o==p?i.push(f):(yield i,s.push(f),i=s,o=p,s=[])}})}function mt(t){const e=d(t);if(e!=null)return w(t,lt(e));throw new Error(`Can't create empty of ${typeof t}`)}function Qr(...t){if(!t.some(x))return null;const e=t[0];let n;return e==null?n={}:n=je(mt(e),e),W(n,...t.slice(1))}function Qe(t){return t[0]}function Ke(t){return t[1]}function Kr(t,...e){t=l(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(o,i)=>{const s=Qe(i),c=Ke(i);return ce(o,s)?D(o,s,t(S(o,s),c)):D(o,s,c)};return B((o,i)=>B(r,o||{},R(i)),e)}else return null}function jr(){return performance.now()}function je(...t){let e,n,r,u,o;switch(t.length){case 0:return[];case 1:return t[0];case 2:return e=t[0]??[],X(e)?yt(j(e),t[1]):B(W,j(e),t[1]);case 3:return e=t[0],n=t[1],r=t[2],u=j(e),o=(i,s)=>s===void 0?i:W(i,s),Ut(n,o,u,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function Ir(t,e){return t===e}function Bt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);if(t.length==1){const r=t[0];return g(function*(){for(;;)yield r})}const[e,n]=t;return g(function*(){for(var r=0;r<e;r++)yield n})}function Ie(t){return q(t)?t:pt(t)}function Tr(t){return k(e=>{let n=t;return(r,u)=>{const o=--n+1;return o>0&&(r=e(r,u)),o>1?r:Ie(r)}})}function At(t,e){return arguments.length===1?Tr(t):O(e,function*(n){let r=t-1;for(const u of n)if(r-->=0&&(yield u),r<0)return})}function Or(t,e){if(t<=0)return null;if(Array.isArray(e))return R(e.slice(-t));{const n=new Array(t);let r=0;for(const u of a(e))n[r%t]=u,r++;return r===0?null:r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function zr(t){return k(e=>(n,r)=>x(t(r))?e(n,r):pt(n))}function wt(t,e){return t=l(t),arguments.length===1?zr(t):O(e,function*(n){for(const r of n)if(x(t(r)))yield r;else return})}function $r(t){return k(e=>{let n=-1;return(r,u)=>rn(++n,t)===0?e(r,u):r})}function Gr(t,e){return arguments.length===1?$r(t):t<=0?Bt(T(e)):O(e,function*(n){let r=0;for(const u of n)r%t===0&&(yield u),r++})}function Br(t,...e){return t=l(t),function(...n){return t(...e,...n)}}function qr(t){return g(function*(){for(;;)yield*t})}function Cr(t){return k(e=>{let n=t;return(r,u)=>n-- >0?r:e(r,u)})}function bt(t,e){return arguments.length===1?Cr(t):O(e,function*(n){for(let r=0;r<t;r++)n.next();yield*n})}function Lr(t){return k(e=>{let n=!0;return(r,u)=>n&&x(t(u))?r:(n=!1,e(r,u))})}function Te(t,e){return t=l(t),arguments.length===1?Lr(t):O(e,function*(n){for(;;){const r=n.next();if(r.done)break;const u=r.value;if(!x(t(u))){yield u;break}}yield*n})}function Dr(){return k(t=>{const e=new Set;return(n,r)=>e.has(r)?n:(e.add(r),t(n,r))})}function Pr(t){return arguments.length===0?Dr():O(t,function*(e){const n=new Set;for(const r of e)n.has(r)||(yield r),n.add(r)})}const ot=Symbol("dedupe-none");function Fr(){return k(t=>{let e=ot;return(n,r)=>{const u=e!==ot&&x(Z(e,r));return e=r,u?n:t(n,r)}})}function Yr(t){return arguments.length===0?Fr():O(t,function*(e){let n=ot;for(const r of e)(n===ot||!x(Z(n,r)))&&(yield r),n=r})}function Ur(t,e,n,...r){return n=l(n),D(t,e,n(S(t,e),...r))}function qt(t,e,n){let r=t;for(const u of e)r=S(r,u);return r===void 0?n:r}function Vr(t,e,n,...r){return n=l(n),re(t,e,n(qt(t,e),...r))}function Ct(t,...e){t=l(t);const n=e.length;return function(...r){for(let u=0;u<n;u++)r[u]==null&&(r[u]=e[u]);return t(...r)}}function Oe(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++)if(!t(e[u]))return!1;return!0}const n=z(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++)if(!t(r[u]))return!1;return!0}function Wr(t,e){return!Oe(t,e)}function Hr(t){return k(e=>(n,r)=>{const u=t(r);return u==null?n:e(n,u)})}function Jr(t,e){return t=l(t),arguments.length===1?Hr(t):tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=t(n[u]);x(o)&&r.push(o)}return r})}function Zr(t){return gt(t).reverse()}function it(t,e){return arguments.length===1&&(e=t,t=void 0),t=l(t),gt(e).sort(t||N)}function Lt(t){return t===N?t:(e,n)=>{const r=t(e,n);return Le(r)?r:r?-1:t(n,e)?1:0}}function Xr(t,e,n){return arguments.length===2&&(n=e,e=N),t=l(t),e=l(e),it((r,u)=>{const o=Lt(e),i=t(r),s=t(u);return o(i,s)},n)}function tu(t){const e=gt(t);let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),u=e[n];e[n]=e[r],e[r]=u}return e}function ze(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++){const o=t(e[u]);if(x(o))return o}return}const n=z(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++){const o=t(r[u]);if(x(o))return o}}function eu(t,e){return t=l(t),!ze(t,e)}function nu(t,e){return(Array.isArray(e)?xt:F)(r=>{const u=t[r];return u!==void 0?u:r},e)}function ru(t){return!R(t)}function uu(t){return t===void 0&&(t=1),Math.random()*t}function $e(t){return Math.floor(Math.random()*t)}function ou(t){const e=$e(st(t));return ae(t,e)}function iu(t){return g(function*(){for(;;)yield t()})}function su(t,e){arguments.length===1&&(e=t,t=void 0);const n=iu(e);if(t!==void 0){if(typeof t!="number")throw new Error("repeatedly: count must be a number, got: "+Tt(t));return At(t,n)}else return n}function Dt(t,e,n,...r){n=l(n);const u=S(t,e);return I(t,e,n(u,...r))}function cu(t,e){t=l(t);const n={};for(const r of a(e)){const u=t(r);Dt(n,u,Ct(W,[]),r)}return n}function fu(t){const e={},n=Ct(fe,0);for(const r of a(t))Dt(e,r,n);return e}class lu extends y{static[Symbol.hasInstance](e){return e instanceof y}constructor(e){super(()=>jt(M(a(e())))())}}function au(t){const e=gt(t);return e.pop(),e.length>0?e:null}function pu(...t){const[e,n]=t.length>1?t:[1,t[0]];return F((r,u)=>r,n,bt(e,n))}function hu(t,e){return[At(t,e),bt(t,e)]}function _u(t,e){return[wt(t,e),Te(t,e)]}function st(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;const n=z(t);let r=0,u;for(;(u=n())!==null;)r+=u.length;return r}function du(t){return t===!0}function xu(t){return t===!1}function yu(t){return t!=null}function gu(t){return x(t)}function mu(t){return t===0}function Au(t){return t<0}function wu(t){return t>0}function bu(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function Mu(t){return t.length}function ku(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const u=[e,n,...r],o=u[u.length-1];let i=t,s=0;const c=u.length-2;for(;s<c;s++)i=i[u[s]];return i[u[s]]=o,n}}function vu(t){if(t instanceof y){const e=z(t);for(;e()!==null;);return null}for(const e of a(t));return null}function Su(t){return U(t)}function Ru(t){return[...t]}function Eu(t,e,n){return t._add_watch(e,n),t}function Nu(t,e){return t._remove_watch(e),t}function Pt(t,e,n){if(!n)return e;var r=e;for(const u of a(n))r=t(r,u[0],u[1]);return r}function Ge(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n>r?n:r;return n}function Qu(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n<r?n:r;return n}function Be(t){return t==null?!1:!!(at(t)||t instanceof Map||t[_]===h)}function Ku(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function ju(...t){return(...e)=>{for(const n of t)for(const r of e){const u=n(r);if(u)return u}}}function qe(t,e){return U(e||t)}function Iu(t,e){var n=e;return g(function*(){for(;;)yield n,n=t(n)})}function Tu(...t){return t=t.map(l),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function ct(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return R(H(t))}function Ou(t){return ct(ct(t))}function N(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string"||n==="boolean"&&r==="boolean")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let u=0;u<t.length;u++){const o=N(t[u],e[u]);if(o!=0)return o}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function zu(t){return qe(t)}function x(t){return t!=null&&t!==!1}const $u=x;function Ce(t,e,n){return t.substring(e,n)}function Ft(t){return typeof t=="function"}function Gu(t){return Ft(t)}function Bu(t){return!0}function qu(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const u of n)if(x(Z(u,r)))return!1;n.push(r)}return!0}function Cu(t,e){return g(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:U(n);const o=n.index+Ge(1,r.length);if(o>e.length)break;e=Ce(e,o)}else break}})}function Lu(t){return Number.isNaN(t)}function Le(t){return typeof t=="number"}function De(t){if(t==null)return;switch(d(t)){case A:{const n=Object.keys(t);return n.length?n:void 0}case h:return t.size?Array.from(t.keys()):void 0}}function Du(t){return De(t)??[]}function Pu(t){if(t==null)return;switch(d(t)){case A:{const n=Object.values(t);return n.length?n:void 0}case h:return t.size?Array.from(t.values()):void 0}}function Mt(t){return typeof t=="string"}function Fu(t){return Math.trunc(t)}function Yu(t){return t+1}function Uu(t){return t-1}function Vu(t,e){return t+e}function Wu(t){const e=t.indexOf("/");return e>=1?t.slice(0,e):null}function Hu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Ju(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Zu(t){return typeof t=="string"}function Xu(t){return typeof t=="string"}function to(t){return!1}function eo(t){return typeof t=="string"&&!t.includes("/")}function no(t){return typeof t=="string"&&t.includes("/")}function ro(t){return d(t)!=null}function uo(t){return t instanceof RegExp}class Yt extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function oo(t){return t instanceof Yt?t._data:null}function io(t){return t instanceof Error?t.message:null}function so(t){return t instanceof Yt?t._cause:null}function co(t,e,n){return new Yt(t,e,n)}function V(t){return Number.isInteger(t)}function fo(t){return typeof t=="number"}const lo=V;function ao(t){return V(t)&&t>0}function po(t){return V(t)&&t>-1}function ho(t){return V(t)&&t<0}function Pe(t){return t instanceof Object?t[L]:null}function Fe(t,e){if(typeof t=="function"){const r=function(...u){return t.apply(this,u)};return r[L]=e,r}if(t?.[_]===v){const r=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return r[L]=e,r}const n=j(t);return n[L]=e,n}function _o(t,e,...n){return Fe(t,e(Pe(t),...n))}function xo(t){return t===!0||t===!1}function Ye(t){switch(d(t)){case b:case h:case A:case E:case m:return!0}return!1}function yo(t,e){return Ye(e)?st(e):st(At(t,e))}function go(t,e){const n=S(t,e);if(n!==void 0)return he([e,n])}function mo(t,e){return(t%e+e)%e}function Ao(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i<=r&&(r=i,u=o)}),u}function wo(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i>=r&&(r=i,u=o)}),u}function Ue(t){throw new Error(`Expected string, got: ${typeof t}`)}function bo(t){if(Mt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER)return e}return null}return Ue(t)}function Mo(t){return Mt(t)?/^[\x00-\x20]*[+-]?NaN[\x00-\x20]*$/.test(t)?NaN:/^[\x00-\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\x00-\x20]*$/.test(t)?parseFloat(t):null:Ue(t)}function Ve(t){return t>=0?Math.floor(t):Math.ceil(t)}function We(t,e){const n=t%e;return Ve((t-n)/e)}function He(t,...e){if(e.length==0)for(;;){const n=t();if(x(Ft(n))){t=n;continue}else return n}else return He(function(){return be(t,e)})}function Ut(t,...e){if(e.length===2){const n=e[0],r=e[1];return Ut(t,n,n(),r)}else{let n=e[0];const r=e[1],u=e[2];n=t(n);const o=B(n,r,u);return n(o)}}function ko(t,e){const n={},r=a(t)[Symbol.iterator](),u=a(e)[Symbol.iterator]();let o,i;for(;o=r.next(),!(o.done||(i=u.next(),i.done));)n[o.value]=i.value;return n}function vo(t){return R(t)?t:null}function Je(t,e,n){const r=function*(u){if(yield u,x(t(u)))for(const o of a(e(u)))yield*r(o)};return g(function*(){yield*r(n)})}function So(t){return _t(rt(Et),H(Je(Et,R,t)))}function Ro(t){return j(t)}function Eo(t){return t}const Ze=class Xe{constructor(e,n){this[_]=m,this[ft]=!0,this._cmp=n??e?._cmp,e instanceof Xe&&e._cmp===this._cmp||(e=this._cmp?it(this._cmp,e):it(e));const u=new Set(e);this._elts=[...u],this._set=u,this.size=this._elts.length}add(e){if(this._set.has(e))return this;const n=this._elts,r=this._cmp;let u=!1;for(let o=0;o<n.length;o++)if((r?r(e,n[o]):N(e,n[o]))<=0){n.splice(o,0,e),u=!0;break}return u?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}};function No(...t){return new Ze(t)}function Qo(t,...e){return new Ze(e,Lt(l(t)))}const tn=class{constructor(e,n){if(this[_]=h,this[ft]=!0,this._cmp=n??e?._cmp,this._map=new Map,this._keys=[],this.size=0,e)for(const[r,u]of e)this.set(r,u)}set(e,n){if(!this._map.has(e)){const r=this._keys,u=this._cmp;let o=0;for(;o<r.length&&(u?u(e,r[o]):N(e,r[o]))>0;)o++;r.splice(o,0,e)}return this._map.set(e,n),this.size=this._map.size,this}get(e){return this._map.get(e)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)&&(this._keys.splice(this._keys.indexOf(e),1),this.size=this._map.size),this}*keys(){yield*this._keys}*values(){for(const e of this._keys)yield this._map.get(e)}*entries(){for(const e of this._keys)yield[e,this._map.get(e)]}forEach(e){for(const n of this._keys)e(this._map.get(n),n,this)}clear(){this._map.clear(),this._keys=[],this.size=0}[Symbol.iterator](){return this.entries()}};function Ko(...t){const e=new tn;for(let n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}function jo(t,...e){const n=new tn(null,Lt(l(t)));for(let r=0;r<e.length;r+=2)n.set(e[r],e[r+1]);return n}function Nt(t,e,n){return r=>e(N(r,n),0)}function en(t,e,n=!0){let r=0;for(;r<t.length&&N(e,t[r])>0;r++);return r}function Io([t,e,n]){const r=Nt(t,e,n);if(e===Zt||e===Xt){const u=[...t],o=en(u,n,!0);return u.splice(0,o),r(u[0])||u.splice(0,1),u}else return[...wt(r,t)]}function To([t,e,n,r,u]){const o=[...t],i=en(o,n,!0);o.splice(0,i);const s=Nt(t,r,u);return Nt(t,e,n)(o[0])||o.splice(0,1),[...wt(s,o)]}function Oo(...t){if(t.length===3)return Io(t);if(t.length===5)return To(t)}function zo(t){return Math.abs(t)}function $o(t){return Ve(t)}function Go(t){return t}function Bo(t){return t}function qo(t){return t!=null&&t.constructor}function Co(t){return(e,n)=>{const r=t(e,n);return q(r)?pt(r):r}}function nn(t){const e=Co(t);return(...n)=>{switch(n.length){case 0:return t();case 1:return t(n[0]);case 2:return B(e,n[0],n[1])}}}function rn(t,e){const n=We(t,e);return t-e*n}function Lo(t){const e=new Map;return(...n)=>{const r=[n.length,...n],u=qt(e,r);if(u===void 0){const o=t(...n);return ue(e,r,o),o}else return u}}function Do(t){return zt(t)?T(t):$t(t)?t[t.length-1]:T(t)}function Po(t){if(t==null)return null;if(zt(t)){if(t.length===0)throw new Error("Can't pop empty list");return H(t)}else if($t(t)){if(t.length===0)throw new Error("Can't pop empty vector");const e=[...t];return e.pop(),e}else return H(t)}function Fo(t,e){const n=mt(t),r=te(t)||I;return Pt((u,o,i)=>r(u,e(o),i),n,t),n}function un(t,e){const n=mt(t),r=te(t)||I;return Pt((u,o,i)=>r(u,o,e(i)),n,t),n}function Yo(){return crypto.randomUUID()}class kt{constructor(e){this.uuid=e}toString(){return this.uuid}}function Uo(t){return new kt(t)}function Vo(t){return t instanceof kt}function Wo(t){return t instanceof Date}class on{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function Ho(t){if(t instanceof on||t instanceof y)return t.realized===!0;throw new Error("realized? not supported on: "+Tt(t))}function Qt(t,e){if(e.has(t))return t;if(e.add(t),Be(t))return un(t,r=>Qt(r,e));const n=d(t);return n&&n!=A?xt(r=>Qt(r,e),t):t}function Jo(t){return Qt(t,new Set)}function Zo(t,e){B((n,r)=>t(r),null,e)}function Xo(...t){return Ot(Z(...t))}class ti{constructor(e){this.v=e}_deref(){return this.v}}function ei(t){return new ti(t)}function ni(t,e){return t.v=e,e}function K(t,e=new WeakSet,n=!0){if(t==null)return"nil";if(typeof t=="number")return t===1/0?"##Inf":t===-1/0?"##-Inf":Number.isNaN(t)?"##NaN":String(t);if(typeof t=="boolean")return String(t);if(typeof t=="string")return n?JSON.stringify(t):t;if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(t instanceof kt)return n?`#uuid "${t.uuid}"`:t.uuid;if(e.has(t))return"#object[circular]";e.add(t);const r=d(t);let u,o;switch(r){case b:o=`[${t.map(i=>K(i,e,n)).join(" ")}]`;break;case m:o=`#{${Array.from(t).map(i=>K(i,e,n)).join(" ")}}`;break;case h:o=`#js/Map {${Array.from(t.entries()).map(([i,s])=>`${K(i,e,n)} ${K(s,e,n)}`).join(", ")}}`;break;case v:case E:o=`(${xt(i=>`${K(i,e,n)}`,t).join(", ")})`;break;default:if(t.constructor&&t.constructor!==Object)return e.delete(t),`#<${t.constructor.name}>`;u=Object.keys(t),o=`{${u.map(i=>`:${i} ${K(t[i],e,n)}`).join(", ")}}`}return e.delete(t),o}return`#object[${t.constructor.name}]`}function Vt(...t){return t.map((e,n)=>K(e)).join(" ")}function ri(...t){P.val(Vt(...t)),Kt.val&&P.val(`
|
|
3
|
+
`)}return pn(ui);})();
|
package/package.json
CHANGED
package/src/squint/core.js
CHANGED
|
@@ -23,6 +23,9 @@ function findKey(iter, tar, key) {
|
|
|
23
23
|
function isSortedMap(m) {
|
|
24
24
|
return m != null && m[SORTED_TAG] === true && m[TYPE_TAG] === MAP_TYPE;
|
|
25
25
|
}
|
|
26
|
+
function isSetLike(s) {
|
|
27
|
+
return s != null && (s instanceof Set || s[TYPE_TAG] === SET_TYPE);
|
|
28
|
+
}
|
|
26
29
|
function isMapLike(m) {
|
|
27
30
|
return (
|
|
28
31
|
m != null &&
|
|
@@ -62,6 +65,19 @@ function dequal(foo, bar) {
|
|
|
62
65
|
return true;
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
// Sets (hash or sorted) compare by elements, across concrete types.
|
|
69
|
+
if (isSetLike(foo) || isSetLike(bar)) {
|
|
70
|
+
if (!isSetLike(foo) || !isSetLike(bar) || foo.size !== bar.size) return false;
|
|
71
|
+
for (let e of foo) {
|
|
72
|
+
if (e && typeof e === 'object') {
|
|
73
|
+
e = findKey(bar, e);
|
|
74
|
+
if (!e) return false;
|
|
75
|
+
}
|
|
76
|
+
if (!bar.has(e)) return false;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
65
81
|
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
66
82
|
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
67
83
|
|
|
@@ -72,21 +88,6 @@ function dequal(foo, bar) {
|
|
|
72
88
|
return len === -1;
|
|
73
89
|
}
|
|
74
90
|
|
|
75
|
-
if (ctor === Set) {
|
|
76
|
-
if (foo.size !== bar.size) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
for (const elt of foo) {
|
|
80
|
-
tmp = elt;
|
|
81
|
-
if (tmp && typeof tmp === 'object') {
|
|
82
|
-
tmp = findKey(bar, tmp);
|
|
83
|
-
if (!tmp) return false;
|
|
84
|
-
}
|
|
85
|
-
if (!bar.has(tmp)) return false;
|
|
86
|
-
}
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
91
|
if (ctor === Map) {
|
|
91
92
|
if (foo.size !== bar.size) {
|
|
92
93
|
return false;
|
|
@@ -355,6 +356,8 @@ function typeConst(obj) {
|
|
|
355
356
|
const tag = obj[TYPE_TAG];
|
|
356
357
|
if (tag !== undefined) return tag;
|
|
357
358
|
if (isVectorArray(obj)) return ARRAY_TYPE;
|
|
359
|
+
// any remaining object (class instance, null-proto) is associative
|
|
360
|
+
if (typeof obj === 'object') return OBJECT_TYPE;
|
|
358
361
|
|
|
359
362
|
return undefined;
|
|
360
363
|
}
|
|
@@ -996,12 +999,12 @@ class LazyIterable {
|
|
|
996
999
|
},
|
|
997
1000
|
};
|
|
998
1001
|
}
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1002
|
+
// Mirrors Array.prototype.indexOf so lazy seqs support (.indexOf coll x):
|
|
1003
|
+
// reference equality, returns -1 when absent. Unlike cljs.core, not by value.
|
|
1001
1004
|
indexOf(x, fromIndex = 0) {
|
|
1002
1005
|
let i = 0;
|
|
1003
1006
|
for (const v of this) {
|
|
1004
|
-
if (i >= fromIndex &&
|
|
1007
|
+
if (i >= fromIndex && v === x) return i;
|
|
1005
1008
|
i++;
|
|
1006
1009
|
}
|
|
1007
1010
|
return -1;
|
|
@@ -1520,7 +1523,7 @@ export function apply(f, ...args) {
|
|
|
1520
1523
|
f = __toFn(f);
|
|
1521
1524
|
const xs = args.slice(0, args.length - 1);
|
|
1522
1525
|
const last = args[args.length - 1];
|
|
1523
|
-
// variadic impl hint; see doc/adr/0001
|
|
1526
|
+
// variadic impl hint; see doc/ai/adr/0001
|
|
1524
1527
|
const v = f.squint$lang$variadic;
|
|
1525
1528
|
if (v) {
|
|
1526
1529
|
// pull maxfa fixed args (bounded, lazy-safe); more left -> variadic, else fixed
|
|
@@ -2598,17 +2601,17 @@ export function reduce_kv(f, init, m) {
|
|
|
2598
2601
|
return ret;
|
|
2599
2602
|
}
|
|
2600
2603
|
|
|
2604
|
+
// CLJS reduce of (cond (NaN? x) x (NaN? y) y (> x y) x :else y): returns one of
|
|
2605
|
+
// the values, so nil acts like zero, and a NaN propagates. NaN? is js/isNaN.
|
|
2601
2606
|
export function max(x, ...more) {
|
|
2602
|
-
// (if (> a b) a b) reduce, like CLJS: returns one of the values, so nil acts
|
|
2603
|
-
// like zero and NaN propagates, instead of Math.max coercing nil to 0.
|
|
2604
2607
|
let m = x;
|
|
2605
|
-
for (const y of more) m = m > y ? m : y;
|
|
2608
|
+
for (const y of more) m = isNaN(m) ? m : isNaN(y) ? y : m > y ? m : y;
|
|
2606
2609
|
return m;
|
|
2607
2610
|
}
|
|
2608
2611
|
|
|
2609
2612
|
export function min(x, ...more) {
|
|
2610
2613
|
let m = x;
|
|
2611
|
-
for (const y of more) m = m < y ? m : y;
|
|
2614
|
+
for (const y of more) m = isNaN(m) ? m : isNaN(y) ? y : m < y ? m : y;
|
|
2612
2615
|
return m;
|
|
2613
2616
|
}
|
|
2614
2617
|
|
|
@@ -3202,6 +3205,7 @@ class SortedSet {
|
|
|
3202
3205
|
// we don't re-use xs since xs can contain duplicates
|
|
3203
3206
|
this._elts = [...s];
|
|
3204
3207
|
this._set = s;
|
|
3208
|
+
this.size = this._elts.length;
|
|
3205
3209
|
}
|
|
3206
3210
|
add(x) {
|
|
3207
3211
|
if (this._set.has(x)) return this;
|