squint-cljs 0.8.148 → 0.8.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/cli.js +41 -41
- package/lib/cljs.pprint.js +176 -176
- package/lib/compiler.js +721 -720
- package/lib/compiler.node.js +15 -15
- package/lib/compiler.sci.js +1026 -1027
- package/lib/node.nrepl_server.js +15 -15
- package/lib/squint.core.umd.js +1 -1
- package/package.json +1 -1
- package/src/squint/core.js +20 -10
package/lib/node.nrepl_server.js
CHANGED
|
@@ -4,20 +4,20 @@ 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 H9=function(a,b){a=a.indexOf(b);if(0>a)throw Error("out of input");return a},I9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},J9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},K9=function(a){return console.debug($APP.lq.g(" ",a))},
|
|
8
|
-
|
|
9
|
-
"version-string",a)}
|
|
10
|
-
$APP.Si.l($APP.F([c]));else return $APP.Si.l($APP.F([c]))},
|
|
11
|
-
$APP.II.l($APP.F([d]));return eval(d)}).then(function(d){d=new $APP.n(null,2,["ns",$APP.t.h($APP.
|
|
12
|
-
new $APP.n(null,2,["ns",$APP.t.h($APP.
|
|
13
|
-
c):b.call(null,a,c)},
|
|
14
|
-
l);l=m}f=$APP.B.j(
|
|
15
|
-
"options","nrepl.middleware.print/options",868480159),
|
|
16
|
-
-1756736313),
|
|
17
|
-
1)),"e"))return new $APP.I(null,2,5,$APP.N,[$APP.pc(e),I9(d,1)],null);a=U9.g?U9.g(d,b):U9.call(null,d,b);d=$APP.B.j(a,0,null);
|
|
7
|
+
var H9=function(a,b){a=a.indexOf(b);if(0>a)throw Error("out of input");return a},I9=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},J9=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},K9=function(a){return console.debug($APP.lq.g(" ",a))},Uha=function(a){return function(b,c){b=$APP.kf(b);var d=$APP.fe.g(b,$APP.Ks),e=$APP.fe.g(b,Tha);c=$APP.Qh.j(c,"id",d);c=$APP.r(e)?$APP.Qh.j(c,"session",e):c;return a.g?a.g(b,c):a.call(null,b,c)}},Wha=function(){var a=
|
|
8
|
+
Vha;return function(b,c){b=$APP.Xm.j(b,L9,$APP.wi);return a.g?a.g(b,c):a.call(null,b,c)}},Yha=function(){var a=Xha();return function(b,c){K9($APP.F(["request",b]));return a.g?a.g(b,c):a.call(null,b,c)}},Zha=function(a){return function(b,c){K9($APP.F(["response",c]));return a.g?a.g(b,c):a.call(null,b,c)}},Xha=function(){var a=Wha();return function(b,c){return a.g?a.g(b,c):a.call(null,b,c)}},M9=function(a){return $APP.Qh.j($APP.ci(new $APP.I(null,3,5,$APP.N,["major","minor","incremental"],null),$APP.jv.h(a.split("."))),
|
|
9
|
+
"version-string",a)},$ha=function(a,b,c){if($APP.r(a))if(a=N9.h?N9.h(a):N9.call(null,a),$APP.r(a)){b=$APP.kf(b);var d=$APP.fe.g(b,$APP.p9),e=$APP.fe.g(b,$APP.i9),f=$APP.fe.g(b,$APP.r9);b=$APP.Qa;var k=$APP.mi,l=$APP.R6;$APP.Qa=e;$APP.mi=f;$APP.R6=d;try{var m=new $APP.Fa;d=$APP.Sa;e=$APP.Ta;$APP.Sa=!0;$APP.Ta=function(h){return m.append(h)};try{a.h?a.h(c):a.call(null,c)}finally{$APP.Ta=e,$APP.Sa=d}return $APP.t.h(m)}finally{$APP.R6=l,$APP.mi=k,$APP.Qa=b}}else return K9($APP.F(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"])),
|
|
10
|
+
$APP.Si.l($APP.F([c]));else return $APP.Si.l($APP.F([c]))},aia=function(a){a=$APP.iv(a,new $APP.n(null,4,[$APP.mq,$APP.rq,$APP.Zu,!0,$APP.Bu,!0,$APP.uq,!0],null),$APP.v(O9));var b=$APP.kf(a),c=$APP.fe.g(b,$APP.hv);a=$APP.fe.g(b,$APP.U);$APP.Kf(O9,b);b=$APP.ak("(async function () {\n%s\n}) ()","%s",c);$APP.Kf(P9,a);return b},gia=function(a,b){var c=$APP.kf(a);$APP.fe.g(c,$APP.U);a=$APP.fe.g(c,bia);$APP.fe.g(c,$APP.cl);$APP.fe.g(c,cia);$APP.fe.g(c,dia);return Promise.resolve(a).then(aia).then(function(d){$APP.II.l($APP.F(["About to eval:"]));
|
|
11
|
+
$APP.II.l($APP.F([d]));return eval(d)}).then(function(d){d=new $APP.n(null,2,["ns",$APP.t.h($APP.v(P9)),"value",$ha(eia.h(c),fia.h(c),d)],null);return b.g?b.g(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.LI.h($APP.qj(d));e=$APP.r(e)?e:d.message;$APP.r(e)&&(e=new $APP.n(null,1,["err",[$APP.t.h(e),"\n"].join("")],null),b.g?b.g(c,e):b.call(null,c,e));d=new $APP.n(null,2,["ex",$APP.t.h(d),"ns",$APP.t.h($APP.Qr)],null);return b.g?b.g(c,d):b.call(null,c,d)}).finally(function(){var d=
|
|
12
|
+
new $APP.n(null,2,["ns",$APP.t.h($APP.v(P9)),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(c,d):b.call(null,c,d)})},Q9=function(a){a=$APP.kf(a);$APP.fe.g(a,$APP.U);return null},Vha=function(a,b){a=$APP.kf(a);var c=$APP.fe.g(a,L9),d=$APP.fe.g(R9,c);if($APP.r(d))return d.g?d.g(a,b):d.call(null,a,b);console.warn($APP.lq.g(" ",$APP.F(["Unhandled operation",c])));c=new $APP.n(null,1,["status",new $APP.I(null,3,5,$APP.N,["error","unknown-op","done"],null)],null);return b.g?b.g(a,
|
|
13
|
+
c):b.call(null,a,c)},hia=function(a){return function(b,c){return a.write(S9(c))}},iia=function(a,b){K9($APP.F(["Connection accepted"]));b.setNoDelay(!0);var c=Yha(),d=Uha(Zha(hia(b))),e=$APP.Wi.h(null);b.on("data",function(f){var k=$APP.v(e);if($APP.r(k)){f=[$APP.t.h(k),$APP.t.h(f)].join("");$APP.Kf(e,null);var l=f}else l=f;a:for(f=$APP.F([$APP.kv,!0]),k=$APP.lg;;){var m=$APP.Hf.j(T9,l,f);l=$APP.B.j(m,0,null);m=$APP.B.j(m,1,null);if(null==l){k=new $APP.I(null,2,5,$APP.N,[k,m],null);break a}k=$APP.De.g(k,
|
|
14
|
+
l);l=m}f=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);$APP.hk(k)||$APP.Kf(e,k);f=$APP.x(f);k=null;for(var h=m=0;;)if(h<m)l=k.ca(null,h),c(l,d),h+=1;else if(f=$APP.x(f))k=f,$APP.Yd(k)?(f=$APP.uc(k),m=$APP.vc(k),k=f,l=$APP.xd(f),f=m,m=l):(l=$APP.y(k),c(l,d),f=$APP.z(k),k=null,m=0),h=0;else return null});return b.on("close",function(f){return $APP.r(f)?K9($APP.F(["Connection lost"])):K9($APP.F(["Connection closed"]))})},dia=new $APP.H(null,"_line","_line",232847719),fia=new $APP.H("nrepl.middleware.print",
|
|
15
|
+
"options","nrepl.middleware.print/options",868480159),Tha=new $APP.H(null,"session","session",1008279103),jia=new $APP.H(null,"lookup","lookup",1225356838),kia=new $APP.H(null,"load-file","load-file",-424586670),cia=new $APP.H(null,"_load-file?","_load-file?",-1198848711),L9=new $APP.H(null,"op","op",-1882987955),lia=new $APP.H(null,"describe","describe",1369790582),bia=new $APP.H(null,"code","code",1586293142),mia=new $APP.H(null,"eldoc","eldoc",-1321421900),nia=new $APP.H(null,"log_level","log_level",
|
|
16
|
+
-1756736313),eia=new $APP.H("nrepl.middleware.print","print","nrepl.middleware.print/print",-1616742548),oia=new $APP.H(null,"clone","clone",711747572),pia=new $APP.H(null,"close","close",1835149582),qia=new $APP.H(null,"info","info",-317069002),ria=new $APP.H(null,"host","host",-1558485167),sia=new $APP.H(null,"complete","complete",-500388775);var U9=function U9(a,b){switch($APP.t.h(J9(a,1))){case "i":return a=I9(a,1),b=H9(a,"e"),new $APP.I(null,2,5,$APP.N,[parseInt(J9(a,b)),I9(a,b+1)],null);case "l":var d=a=I9(a,1);for(a=$APP.nc($APP.lg);;){if($APP.A.g($APP.t.h(J9(d,1)),"e"))return new $APP.I(null,2,5,$APP.N,[$APP.pc(a),I9(d,1)],null);var e=U9.g?U9.g(d,b):U9.call(null,d,b),f=$APP.B.j(e,0,null),k=$APP.B.j(e,1,null);e=k;a=$APP.gg.g(a,f);d=e}case "d":for(a=I9(a,1),f=$APP.kf(b),f=$APP.fe.g(f,$APP.kv),d=a,e=$APP.nc($APP.jf);;){if($APP.A.g($APP.t.h(J9(d,
|
|
17
|
+
1)),"e"))return new $APP.I(null,2,5,$APP.N,[$APP.pc(e),I9(d,1)],null);a=U9.g?U9.g(d,b):U9.call(null,d,b);d=$APP.B.j(a,0,null);k=$APP.B.j(a,1,null);k=U9.g?U9.g(k,b):U9.call(null,k,b);a=$APP.B.j(k,0,null);k=$APP.B.j(k,1,null);d=$APP.r(f)?$APP.wi.h(d):d;a=$APP.Vg.j(e,d,a);d=k;e=a}default:return b=H9(a,":"),f=parseInt(J9(a,b)),a=I9(a,b+1),new $APP.I(null,2,5,$APP.N,[$APP.t.h(J9(a,f)),I9(a,f)],null)}},T9=function T9(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return T9.l(arguments[0],
|
|
18
18
|
1<c.length?new $APP.Xc(c.slice(1),0,null):null)};T9.l=function(a,b){try{return U9(a,b)}catch(c){if(c instanceof Error)return new $APP.I(null,2,5,$APP.N,[null,a],null);throw c;}};T9.m=1;T9.o=function(a){var b=$APP.y(a);a=$APP.z(a);return this.l(b,a)};
|
|
19
19
|
var S9=function S9(a){for(;;){if("string"===typeof a)return[$APP.t.h(Buffer.from(a).length),":",a].join("");if(a instanceof $APP.H||a instanceof $APP.w)a=[function(){var c=$APP.Le(a);return $APP.r(c)?[c,"/"].join(""):null}(),$APP.bi(a)].join("");else return"number"===typeof a?["i",$APP.t.h(a),"e"].join(""):$APP.Sd(a)||$APP.Xd(a)||null==a?["l",$APP.t.h($APP.Hf.g($APP.t,$APP.vi.g(S9,a))),"e"].join(""):$APP.Ud(a)?["d",$APP.t.h($APP.Hf.g($APP.t,$APP.vi.g(function(){return function(c){var d=$APP.B.j(c,
|
|
20
|
-
0,null);c=$APP.B.j(c,1,null);return[$APP.t.h(S9.h?S9.h(d):S9.call(null,d)),$APP.t.h(S9.h?S9.h(c):S9.call(null,c))].join("")}}(a),$APP.GI.g($APP.y,a)))),"e"].join(""):null}};var P9=$APP.Wi.h($APP.
|
|
21
|
-
var O9=$APP.Wi.h(null),R9=$APP.wh([
|
|
22
|
-
2,["nbb-nrepl",M9("TODO"),"node",M9(process.version)],null),"aux",$APP.jf,"ops",$APP.ci($APP.vi.g($APP.bi,$APP.Lh(R9)),$APP.Fn.h($APP.jf)),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},Q9,function(){return null},function(a,b){a=$APP.kf(a);var c=$APP.fe.g(a,$APP.U);$APP.HI.l($APP.F([$APP.U,c]));return
|
|
23
|
-
":",$APP.t.h(f)].join("")]));try{return esm_import$fs.writeFileSync(".nrepl-port",$APP.t.h(f))}catch(
|
|
20
|
+
0,null);c=$APP.B.j(c,1,null);return[$APP.t.h(S9.h?S9.h(d):S9.call(null,d)),$APP.t.h(S9.h?S9.h(c):S9.call(null,c))].join("")}}(a),$APP.GI.g($APP.y,a)))),"e"].join(""):null}};var P9=$APP.Wi.h($APP.Qr),N9=new $APP.n(null,1,["cider.nrepl.pprint/pprint",$APP.y9],null);$APP.Wi.h(!1);
|
|
21
|
+
var O9=$APP.Wi.h(null),R9=$APP.wh([jia,pia,kia,mia,oia,lia,qia,sia,$APP.MI],[Q9,function(a,b){var c=new $APP.n(null,1,["status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a){a=$APP.kf(a);$APP.fe.g(a,$APP.cl);return null},Q9,function(a,b){var c=new $APP.n(null,2,["new-session",$APP.t.h($APP.aI()),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.n(null,4,["versions",new $APP.n(null,
|
|
22
|
+
2,["nbb-nrepl",M9("TODO"),"node",M9(process.version)],null),"aux",$APP.jf,"ops",$APP.ci($APP.vi.g($APP.bi,$APP.Lh(R9)),$APP.Fn.h($APP.jf)),"status",new $APP.I(null,1,5,$APP.N,["done"],null)],null);return b.g?b.g(a,c):b.call(null,a,c)},Q9,function(){return null},function(a,b){a=$APP.kf(a);var c=$APP.fe.g(a,$APP.U);$APP.HI.l($APP.F([$APP.U,c]));return gia($APP.Qh.j(a,$APP.U,$APP.v(P9)),b)}]),tia=$APP.Wi.h(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var e=$APP.JI.h(a);return $APP.r(e)?e:0}(),c=function(){var e=ria.h(a);return $APP.r(e)?e:"127.0.0.1"}();(function(){var e=$APP.$a(a)?a.cg:nia.h(a);return $APP.r(e)?e:"info"})();var d=esm_import$net.createServer($APP.Wk.g(iia,$APP.jf));d.listen(b,c,function(){var e=d.address(),f=e.port;e=e.address;$APP.II.l($APP.F([["nREPL server started on port ",$APP.t.h(f)," on host ",$APP.t.h(e)," - nrepl://",$APP.t.h(e),
|
|
23
|
+
":",$APP.t.h(f)].join("")]));try{return esm_import$fs.writeFileSync(".nrepl-port",$APP.t.h(f))}catch(k){return console.warn($APP.lq.g(" ",$APP.F(["Could not write .nrepl-port",k])))}});return $APP.Kf(tia,d)})};
|
package/lib/squint.core.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var squint;(squint||={}).core=(()=>{var Z=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Se=Object.prototype.hasOwnProperty;var ke=(t,e)=>{for(var n in e)Z(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Re(e))!Se.call(t,o)&&o!==n&&Z(t,o,{get:()=>e[o],enumerable:!(r=Ee(e,o))||r.enumerable});return t};var Ke=t=>Qe(Z({},"__esModule",{value:!0}),t);var Io={};ke(Io,{Atom:()=>Pt,Cons:()=>zt,Delay:()=>ko,IIterable:()=>rt,IIterable__iterator:()=>Ot,LazySeq:()=>_r,NaN_QMARK_:()=>Yr,PROTOCOL_SENTINEL:()=>ln,_:()=>Ge,_EQ_:()=>Ie,_GT_:()=>gt,_GT__EQ_:()=>At,_LT_:()=>je,_LT__EQ_:()=>Ne,_PLUS_:()=>Te,_STAR_:()=>Oe,__protocol_satisfies:()=>qe,_iterator:()=>$,abs:()=>go,aclone:()=>Ir,add_watch:()=>jr,alength:()=>Sr,apply:()=>vn,array_QMARK_:()=>V,aset:()=>kr,assoc:()=>Q,assoc_BANG_:()=>A,assoc_in:()=>vt,assoc_in_BANG_:()=>Mt,atom:()=>hn,boolean$:()=>br,boolean_QMARK_:()=>no,bounded_count:()=>ro,butlast:()=>dr,cat:()=>Ae,clj__GT_js:()=>Qo,coll_QMARK_:()=>Vr,comp:()=>Et,compare:()=>b,complement:()=>O,concat:()=>Wt,conj:()=>St,conj_BANG_:()=>L,cons:()=>He,constantly:()=>En,contains_QMARK_:()=>Qt,count:()=>G,counted_QMARK_:()=>xe,cycle:()=>Dn,dec:()=>De,deref:()=>ut,disj:()=>Pe,disj_BANG_:()=>kt,dissoc:()=>Ce,dissoc_BANG_:()=>Ye,distinct:()=>Un,doall:()=>Kr,dorun:()=>Qr,drop:()=>X,drop_last:()=>xr,drop_while:()=>oe,empty:()=>W,empty_QMARK_:()=>sr,ensure_reduced:()=>re,es6_iterator:()=>F,even_QMARK_:()=>Dt,every_QMARK_:()=>ue,every_pred:()=>Or,ex_cause:()=>Xr,ex_data:()=>Jr,ex_info:()=>Zr,ex_message:()=>Ur,false_QMARK_:()=>gr,ffirst:()=>We,filter:()=>C,filterv:()=>tn,find:()=>oo,first:()=>K,flatten:()=>po,fn_QMARK_:()=>Fr,fnil:()=>pt,frequencies:()=>hr,get:()=>w,get_in:()=>at,group_by:()=>pr,identical_QMARK_:()=>zn,identity:()=>Jt,inc:()=>Kt,int_QMARK_:()=>_e,integer_QMARK_:()=>Hr,interleave:()=>Ut,interpose:()=>Qn,into:()=>ne,into_array:()=>le,iterable:()=>s,iterate:()=>qr,js_keys:()=>Cr,js_obj:()=>Rr,juxt:()=>Br,keep:()=>er,keep_indexed:()=>cn,key:()=>te,keys:()=>he,last:()=>Je,lazy:()=>a,list:()=>Vt,list_QMARK_:()=>Rn,long$:()=>Ao,map:()=>R,map_QMARK_:()=>fe,map_indexed:()=>rn,mapcat:()=>Sn,mapv:()=>ct,max:()=>se,max_key:()=>co,memoize:()=>Mo,merge:()=>Gn,merge_with:()=>qn,meta:()=>to,min:()=>Tr,min_key:()=>io,mod:()=>uo,neg_QMARK_:()=>Mr,next:()=>tt,nil_QMARK_:()=>fn,nnext:()=>zr,not:()=>$t,not_any_QMARK_:()=>ir,not_empty:()=>ao,not_every_QMARK_:()=>Hn,nth:()=>jt,number_QMARK_:()=>pe,object_QMARK_:()=>$e,odd_QMARK_:()=>Mn,parse_long:()=>fo,partial:()=>Cn,partition:()=>Zt,partition_all:()=>Xt,partition_by:()=>On,partitionv:()=>jn,partitionv_all:()=>Nn,peek:()=>Eo,persistent_BANG_:()=>_o,pop:()=>Ro,pos_QMARK_:()=>Er,pr_str:()=>Ft,println:()=>It,prn:()=>pn,quot:()=>me,rand_int:()=>ce,rand_nth:()=>fr,range:()=>dn,re_find:()=>yn,re_matches:()=>xn,re_pattern:()=>mn,re_seq:()=>Pr,reduce:()=>E,reduce_kv:()=>dt,reduced:()=>Y,reduced_QMARK_:()=>M,reductions:()=>Xe,regexp_QMARK_:()=>Wr,rem:()=>be,remove:()=>en,remove_watch:()=>Nr,repeat:()=>lt,repeatedly:()=>ar,replace:()=>cr,reset_BANG_:()=>Yt,rest:()=>P,reverse:()=>nr,run_BANG_:()=>Ko,satisfies_QMARK_:()=>Be,second:()=>Ve,select_keys:()=>Kn,seq:()=>v,seq_QMARK_:()=>Nt,seqable_QMARK_:()=>Tt,sequential_QMARK_:()=>H,set:()=>An,set_QMARK_:()=>bn,shuffle:()=>ur,some:()=>ie,some_QMARK_:()=>Ar,some_fn:()=>Gr,sort:()=>ht,sort_by:()=>or,sorted_set:()=>xo,split_at:()=>yr,split_with:()=>mr,str:()=>sn,string_QMARK_:()=>xt,subs:()=>ae,subseq:()=>wo,subvec:()=>wn,swap_BANG_:()=>_n,system_time:()=>Bn,t:()=>$r,take:()=>J,take_last:()=>$n,take_nth:()=>Yn,take_while:()=>U,to_array:()=>Lr,transduce:()=>mt,transient$:()=>ho,tree_seq:()=>we,true_QMARK_:()=>wr,truth_:()=>_,type:()=>bo,unreduced:()=>ft,update:()=>Xn,update_BANG_:()=>_t,update_in:()=>Zn,update_keys:()=>So,update_vals:()=>ve,val:()=>ee,vals:()=>Dr,vec:()=>k,vector:()=>it,vector_QMARK_:()=>gn,warn_on_lazy_reusage_BANG_:()=>Ze,with_meta:()=>eo,zero_QMARK_:()=>vr,zipmap:()=>lo});function f(t){if(t==null||t instanceof Function)return t;const e=typeof t;return e==="string"?(n,r)=>w(n,t,r):e==="object"?(n,r)=>w(t,n,r):t}function I(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Ie(...t){return I(t,(e,n)=>e===n)}function gt(...t){return I(t,(e,n)=>e>n)}function At(...t){return I(t,(e,n)=>e>=n)}function je(...t){return I(t,(e,n)=>e<n)}function Ne(...t){return I(t,(e,n)=>e<=n)}function Te(...t){return t.reduce((e,n)=>e+n,0)}function Oe(...t){return t.reduce((e,n)=>e*n,1)}function Ge(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const qe={};function Be(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function ze(t,e,n){return t.set(e,n),t}function Le(t,e,n){return t[e]=n,t}function bt(t){switch(p(t)){case h:return ze;case x:case y:return Le}}function A(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(p(t)){case h:t.set(e,n);for(let o=0;o<r.length;o+=2)t.set(r[o],r[o+1]);break;case x:case y:t[e]=n;for(let o=0;o<r.length;o+=2)t[r[o]]=r[o+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}function j(t){switch(p(t)){case h:return new Map(t);case m:return new t.constructor(t);case x:return[...t];case y:return{...t};default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function Q(t,e,n,...r){t||(t={});const o=j(t);return A(o,e,n,...r),o}const h=1,x=2,y=3,S=4,m=5,q=6;function B(t){switch(t){case h:return new Map;case x:return[];case y:return{};case S:return new D;case m:return new Set;case q:return a(function*(){})}}function z(t){return t.constructor===Object}function $e(t){return t!=null&&z(t)}function p(t){if(t!=null){if(z(t))return y;if(t instanceof Map)return h;if(t instanceof Set)return m;if(t instanceof D)return S;if(Array.isArray(t))return x;if(t instanceof ot)return q;if(t instanceof N)return m;if(t instanceof Object)return y}}function Fe(t,e,n,r,o){r=k(r);const u=p(n);if(u!==h&&u!==x&&u!==y)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let c=n;for(let l=0;l<r.length-1;l+=1){const g=r[l];let d;c instanceof Map?d=c.get(g):d=c[g],d||(d=B(u)),i.push(d),c=d}i.push(o);for(let l=i.length-2;l>=0;l-=1)i[l]=t(i[l],r[l],i[l+1]);return i[0]}function vt(t,e,n){return Fe(Q,"assoc-in",t,e,n)}function Mt(t,e,n){e=k(e);var r=t;const o=p(t);for(const u of e.splice(0,e.length-1)){let i=w(r,u);i===void 0&&(i=B(o),A(r,u,i)),r=i}return A(r,e[e.length-1],n),t}function Et(...t){if(t=t.map(f),t.length===0)return Jt;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let o=e(...r);for(const u of n)o=u(o);return o}}function Rt(t,e){for(const n of e)t.add(n);return t}function L(...t){if(t.length===0)return it();const[e,...n]=t;let r=e;switch(r==null&&(r=[]),p(r)){case m:Rt(r,n);break;case S:r.unshift(...n.reverse());break;case x:r.push(...n);break;case h:for(const o of n)Array.isArray(o)?r.set(o[0],o[1]):s(o).forEach(u=>{r.set(u[0],u[1])});break;case y:for(const o of n)Array.isArray(o)?r[o[0]]=o[1]:Object.assign(r,o);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return r}function St(...t){if(t.length===0)return it();const[e,...n]=t;let r=e;r==null&&(r=Vt());let o,u;switch(p(r)){case m:return r instanceof N?Rt(new r.constructor(r),n):new r.constructor([...r,...n]);case S:return new D(...n.reverse(),...r);case x:return[...r,...n];case h:o=new Map(r);for(const i of n)Array.isArray(i)?o.set(i[0],i[1]):s(i).forEach(c=>{o.set(c[0],c[1])});return o;case q:return a(function*(){yield*n,yield*r});case y:u={...r};for(const i of n)Array.isArray(i)?u[i[0]]=i[1]:Object.assign(u,i);return u;default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function kt(t,...e){for(const n of e)t.delete(n);return t}function Pe(t,...e){const n=new t.constructor([...t]);return kt(n,...e)}function Qt(t,e){switch(p(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function Ye(t,...e){for(const n of e)delete t[n];return t}function Ce(t,...e){if(e.length===0)return t;const n=j(t);switch(p(t)){case h:for(const r of e)n.delete(r);break;default:for(const r of e)delete n[r];break}return n}function Kt(t){return t+1}function De(t){return t-1}function It(...t){console.log(...t)}function jt(t,e,n){if(t){var r=void 0;if(Array.isArray(t))r=t[e];else{const o=s(t);let u=0;for(const i of o)if(u++==e){r=i;break}}if(r!==void 0)return r}return n}function w(t,e,n=void 0){if(t==null)return n;let r;if(z(t))return r=t[e],r===void 0?n:r;let o;switch(p(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case x:r=t[e];break;default:if(o=t.get,o instanceof Function)try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function Nt(t){return t!=null&&!!t[Symbol.iterator]}const H=Nt;function Tt(t){return t==null||!!t[Symbol.iterator]}function s(t){if(t==null)return[];if(Tt(t))return t;if(t instanceof Object)return Object.entries(t);throw new TypeError(`${t} is not iterable`)}const rt=Symbol("Iterable"),Ot=Symbol.iterator;function $(t){return t[Symbol.iterator]()}const F=$;function v(t){if(t==null)return t;const e=s(t);return e.length===0||e.size===0||e[Symbol.iterator]().next().done?null:e}function K(t){const[e]=s(t);return e}function Ve(t){const[e,n]=s(t);return n}function We(t){return K(K(t))}function P(t){return a(function*(){let e=!0;for(const n of s(t))e?e=!1:yield n})}class Gt{then(e,n){return e(this._deref())}}class T extends Gt{value;constructor(e){super(),this.value=e}_deref(){return this.value}}function Je(t){t=s(t);let e;switch(p(t)){case x:return t[t.length-1];default:for(const n of t)e=n;return e}}function Y(t){return new T(t)}function M(t){return t instanceof T}function E(t,e,n){t=f(t);let r,o;if(arguments.length===2){const u=s(e)[Symbol.iterator](),i=u.next();i.done?o=t():o=i.value,r=u}else o=e,r=s(n);if(o instanceof T)return o.value;for(const u of r)if(o=t(o,u),o instanceof T){o=o.value;break}return o}function*Ue(t,e){const n=e.next();n.done?yield t():yield*qt(t,n.value,e)}function*qt(t,e,n){let r=e,o=n;for(;;){if(M(r)){yield r.value;return}else yield r;const u=o.next();if(u.done)break;r=t(r,u.value)}}function Xe(t,e,n){return t=f(t),arguments.length===2?a(function*(){yield*Ue(t,s(e)[Symbol.iterator]())}):a(function*(){yield*qt(t,e,s(n)[Symbol.iterator]())})}var Bt=!1;function Ze(){Bt=!0}class ot{constructor(e){this.gen=e,this.usages=0}[Symbol.iterator](){if(this.usages++,this.usages>=2&&Bt)try{throw new Error}catch(e){console.warn("Re-use of lazy value",e.stack)}return this.gen()}}ot.prototype[rt]=!0;function a(t){return new ot(t)}class zt{constructor(e,n){this.x=e,this.coll=n}*[Symbol.iterator](){yield this.x,yield*s(this.coll)}}function He(t,e){return new zt(t,e)}function R(t,...e){switch(t=f(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 a(function*(){for(const n of s(e[0]))yield t(n)});default:return a(function*(){const n=e.map(r=>F(s(r)));for(;;){const r=[];for(const o of n){const u=o.next();if(u.done)return;r.push(u.value)}yield t(...r)}})}}function Lt(t){return e=>(...n)=>{switch(n.length){case 0:return e();case 1:return e(n[0]);case 2:{const r=n[0],o=n[1];return _(t(o))?e(r,o):r}}}}function C(t,e){return arguments.length===1?Lt(t):(t=f(t),a(function*(){for(const n of s(e))_(t(n))&&(yield n)}))}function tn(t,e){return[...C(t,e)]}function en(t,e){return arguments.length===1?Lt(O(t)):C(O(t),e)}function nn(t){return e=>{let n=-1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:return e(r[0],t((n=n+1,n),r[1]))}}}}function rn(t,e){if(t=f(t),arguments.length===1)return nn(t);const n=[];let r=0;for(const o of s(e))n.push(t(r,o)),r++;return n}function on(t,e){t=f(t);const n=[];let r=0;for(const o of s(e)){const u=t(r,o);_(u)&&n.push(u),r++}return n}function un(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];n++;const c=t(n,i);return c==null?u:e(u,c)}}}}function cn(t,e){return arguments.length===1?un(t):on(t,e)}function sn(...t){return t.join("")}function $t(t){return!_(t)}function fn(t){return t==null}const ln={};function an(t){return t===null?"null":JSON.stringify(t,(e,n)=>{switch(p(n)){case m:case q:return[...n];case h:return Object.fromEntries(n);default:return n}})}function Ft(...t){return t.map(an).join(" ")}function pn(...t){It(Ft(...t))}class Pt extends Gt{constructor(e){super(),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 o of Object.entries(this._watches)){const u=o[0],i=o[1];i(u,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 hn(t){return new Pt(t)}function ut(t){return t._deref()}function Yt(t,e){t._reset_BANG_(e)}function _n(t,e,...n){e=f(e);const r=e(ut(t),...n);return Yt(t,r),r}function dn(t,e,n){return a(function*(){let r=t,o=e,u=n;e===void 0&&(r=0,o=t);let i=r||0;u=n??1;const c=u>=0;for(;o===void 0||c&&i<o||!c&&o<i;)yield i,i+=u})}function xn(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function yn(t,e){if(xt(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 mn(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 wn(t,e,n){return t.slice(e,n)}function it(...t){return t}function gn(t){return p(t)===x}function ct(...t){if(t.length===2){const[r,o]=t,u=s(o);if(Array.isArray(u)){const i=new Array(u.length);for(var e=0;e<u.length;e++)i[e]=r(u[e]);return i}else{var n=[];for(const i of u)n.push(r(i));return n}}return[...R(...t)]}function k(t){return V(t)?t:[...s(t)]}function An(t){return new Set(s(t))}function bn(t){return p(t)===m}const Ct=Symbol("IApply__apply");function vn(t,...e){t=f(t);const n=e.slice(0,e.length-1),r=s(e[e.length-1]),o=t[Ct];return o?o(...n,r):t(...n,...r)}function Dt(t){return t%2==0}function Mn(t){return!Dt(t)}function O(t){return t=f(t),(...e)=>$t(t(...e))}function En(t){return(...e)=>t}class D extends Array{constructor(...e){super(),this.push(...e)}}function Rn(t){return p(t)===S}function Vt(...t){return new D(...t)}function V(t){return Array.isArray(t)}function st(t){return a(function*(){for(const e of t)yield*s(e)})}function Wt(...t){return st(t)}Wt[Ct]=t=>st(t);function Sn(t,...e){if(e.length===0)return Et(R(t),Ae);{const n=R(t,...e);return st(n)}}function Jt(t){return t}function Ut(...t){return a(function*(){const e=t.map(n=>F(s(n)));for(;;){const n=[];for(const r of e){const o=r.next();if(o.done)return;n.push(o.value)}yield*n}})}function kn(t){return e=>{let n=!1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:if(n){const o=e(r[0],t);return M(o)?o:e(o,r[1])}else return n=!0,e(r[0],r[1])}}}}function Qn(t,e){return arguments.length===1?kn(t):X(1,Ut(lt(t),e))}function Kn(t,e){const n=p(t),r=B(n)||{};for(const o of e){const u=w(t,o);u!=null&&A(r,o,u)}return r}function ft(t){return M(t)?ut(t):t}function In(t){return e=>{let n=[];return(...r)=>{let o,u;switch(r.length){case 0:return e();case 1:return o=r[0],n.length!==0&&(u=[...n],n=[],o=ft(e(o,u))),e(o);case 2:return o=r[0],n.push(r[1]),t===n.length?(u=[...n],n=[],e(o,u)):o}}}}function Xt(t,...e){if(arguments.length===1)return In(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Ht(t,n,[],r,!0)}function Zt(t,...e){let n=t,r=[],o=e[0];return e.length===2?[n,o]=e:e.length>2&&([n,r,o]=e),Ht(t,n,r,o,!1)}const jn=Zt,Nn=Xt;function Ht(t,e,n,r,o){return a(function*(){let u=[],i=0;for(const c of s(r))i<t&&(u.push(c),u.length===t&&(yield u,u=e<t?u.slice(e):[])),i++,i===e&&(i=0);u.length>0&&(u.length===t||o?yield u:n.length&&(u.push(...n.slice(0,t-u.length)),yield u))})}function Tn(t){return e=>{let n=[];const r={};let o=r;return(...u)=>{const i=u.length;if(i===0)return e();if(i===1){let c=u[0];if(n.length!==0){const l=[...n];n=[],c=ft(e(c,l))}return e(c)}if(i===2){const c=u[0],l=u[1],g=o,d=t(l);if(o=d,g===r||d===g)return n.push(l),c;{const Me=[...n];n=[];const wt=e(c,Me);return M(wt)||n.push(l),wt}}}}}function On(t,e){return t=f(t),arguments.length===1?Tn(t):a(function*(){const n=F(e),r=n.next();r.done&&(yield*null);const o=r.value;let u=t(o),i=[o],c=[];for(;;){const l=n.next();if(l.done){yield i;break}const g=l.value,d=t(g);u==d?i.push(g):(yield i,c.push(g),i=c,u=d,c=[])}})}function W(t){const e=p(t);if(e!=null)return B(e);throw new Error(`Can't create empty of ${typeof t}`)}function Gn(...t){const e=t[0];let n;return e==null?n={}:n=ne(W(e),e),L(n,...t.slice(1))}function te(t){return t[0]}function ee(t){return t[1]}function qn(t,...e){t=f(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(u,i)=>{const c=te(i),l=ee(i);return Qt(u,c)?Q(u,c,t(w(u,c),l)):Q(u,c,l)};return E((u,i)=>E(r,u||{},v(i)),e)}else return null}function Bn(){return performance.now()}function ne(...t){let e,n,r,o,u;switch(t.length){case 0:return[];case 1:return t[0];case 2:return St(t[0]??[],...s(t[1]));case 3:return e=t[0],n=t[1],r=t[2],o=j(e),u=(i,c)=>c===void 0?i:L(i,c),mt(n,u,o,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function zn(t,e){return t===e}function lt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);return{[rt]:!0,[Ot]:t.length==1?function*(){const e=t[0];for(;;)yield e}:function*(){const[e,n]=t;for(var r=0;r<e;r++)yield n}}}function re(t){return M(t)?t:Y(t)}function Ln(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1){const u=r[0];return e(u)}if(o===2){let u=r[0];const i=r[1],c=n,l=(n=n-1,n);return c>0&&(u=e(u,i)),l>0?u:re(u)}}}}function J(t,e){return arguments.length===1?Ln(t):a(function*(){let n=t-1;for(const r of s(e))if(n-->=0&&(yield r),n<0)return})}function $n(t,e){if(t==0)return null;if(Array.isArray(e))return v(e.slice(-Math.abs(t)));{let n=new Array(t),r=0;for(const o of s(e))n[r%t]=o,r++;return r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Fn(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1];return _(t(u))?e(o,u):Y(o)}}}function U(t,e){return t=f(t),arguments.length===1?Fn(t):a(function*(){for(const n of s(e))if(_(t(n)))yield n;else return})}function Pn(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];return n++,be(n,t)===0?e(u,i):u}}}}function Yn(t,e){return arguments.length===1?Pn(t):t<=0?lt(K(e)):a(function*(){let n=0;for(const r of s(e))n%t===0&&(yield r),n++})}function Cn(t,...e){return t=f(t),function(...n){return t(...e,...n)}}function Dn(t){return a(function*(){for(;;)yield*t})}function Vn(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1],c=n;return n--,c>0?u:e(u,i)}}}}function X(t,e){return arguments.length===1?Vn(t):a(function*(){const n=$(s(e));for(let r=0;r<t;r++)n.next();yield*n})}function Wn(t){return e=>{let n=!0;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=n,i=r[0],c=r[1];return u&&_(t(c))?i:(n=null,e(i,c))}}}}function oe(t,e){return t=f(t),arguments.length===1?Wn(t):a(function*(){const n=$(s(e));for(;;){const r=n.next();if(r.done)break;const o=r.value;if(!_(t(o))){yield o;break}}yield*n})}function Jn(){return t=>{const e=new Set;return(...n)=>{const r=n.length;if(r===0)return t();if(r===1)return t(n[0]);if(r===2){const o=n[0],u=n[1];return e.has(u)?o:(e.add(u),t(o,u))}}}}function Un(t){return arguments.length===0?Jn():a(function*(){const e=new Set;for(const n of s(t))e.has(n)||(yield n),e.add(n)})}function Xn(t,e,n,...r){return n=f(n),Q(t,e,n(w(t,e),...r))}function at(t,e,n){let r=t;for(const o of e)r=w(r,o);return r===void 0?n:r}function Zn(t,e,n,...r){return n=f(n),vt(t,e,n(at(t,e),...r))}function pt(t,e,...n){return t=f(t),function(r,...o){return r?t(r,...n,...o):t(e,...n,...o)}}function ue(t,e){t=f(t);for(const n of s(e))if(!t(n))return!1;return!0}function Hn(t,e){return!ue(t,e)}function tr(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1],i=t(u);return i==null?o:e(o,i)}}}function er(t,e){return t=f(t),arguments.length===1?tr(t):a(function*(){for(const n of s(e)){const r=t(n);_(r)&&(yield r)}})}function nr(t){return t=s(t),[...t].reverse()}function ht(t,e){return arguments.length===1&&(e=t,t=void 0),t=f(t),e=s(e),[...e].sort(t||b)}function rr(t){return t===b?t:(e,n)=>{const r=t(e,n);return pe(r)?r:r?-1:t(n,e)?1:0}}function or(t,e,n){return arguments.length===2&&(n=e,e=b),t=f(t),e=f(e),ht((r,o)=>{const u=rr(e),i=t(r),c=t(o);return u(i,c)},n)}function ur(t){const e=[...t];let n=t.length;for(;n;){const r=Math.floor(Math.random()*n--),o=e[n];e[n]=e[r],e[r]=o}return e}function ie(t,e){t=f(t);for(const n of s(e)){const r=t(n);if(_(r))return r}}function ir(t,e){return t=f(t),!ie(t,e)}function cr(t,e){return(Array.isArray(e)?ct:R)(r=>{const o=t[r];return o!==void 0?o:r},e)}function sr(t){return!v(t)}function ce(t){return Math.floor(Math.random()*t)}function fr(t){const e=ce(G(t));return jt(t,e)}function lr(t){return a(function*(){for(;;)yield t()})}function ar(t,e){arguments.length===1&&(e=t,t=void 0);const n=lr(e);return t?J(t,n):n}function _t(t,e,n,...r){const o=w(t,e);return A(t,e,n(o,...r))}function pr(t,e){t=f(t);const n={};for(const r of s(e)){const o=t(r);_t(n,o,pt(L,[]),r)}return n}function hr(t){const e={},n=pt(Kt,0);for(const r of s(t))_t(e,r,n);return e}class _r{constructor(e){this.f=e,this.res=void 0}*[Symbol.iterator](){this.res===void 0&&(this.res=this.f(),this.f=null),yield*s(this.res)}}function dr(t){const e=[...s(t)];return e.pop(),e.length>0?e:null}function xr(...t){const[e,n]=t.length>1?t:[1,t[0]];return R((r,o)=>r,n,X(e,n))}function yr(t,e){return[J(t,e),X(t,e)]}function mr(t,e){return[U(t,e),oe(t,e)]}function G(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;let n=0;for(const r of s(t))n++;return n}function wr(t){return t===!0}function gr(t){return t===!1}function Ar(t){return t!=null}function br(t){return!!t}function vr(t){return t===0}function Mr(t){return t<0}function Er(t){return t>0}function Rr(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function Sr(t){return t.length}function kr(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const o=[e,n,...r],u=o[o.length-1];let i=t,c=0;const l=o.length-2;for(;c<l;c++)i=i[o[c]];return i[o[c]]=u,n}}function Qr(t){for(const e of s(t));return null}function Kr(t){return k(t)}function Ir(t){return[...t]}function jr(t,e,n){return t._add_watch(e,n)}function Nr(t,e){return t._remove_watch(e)}function dt(t,e,n){if(!n)return e;var r=e;for(const o of s(n))r=t(r,o[0],o[1]);return r}function se(t,e,...n){return e==null?t:Math.max(t,e,...n)}function Tr(t,e,...n){return e==null?t:Math.min(t,e,...n)}function fe(t){return t==null?!1:!!(z(t)||t instanceof Map)}function Or(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Gr(...t){return(...e)=>{for(const n of t)for(const r of e){const o=n(r);if(o)return o}}}function le(t,e){return k(e||t)}function qr(t,e){var n=e;return a(function*(){for(;;)yield n,n=t(n)})}function Br(...t){return t=t.map(f),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function tt(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return v(P(t))}function zr(t){return tt(tt(t))}function b(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")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 o=0;o<t.length;o++){let u=b(t[o],e[o]);if(u!=0)return u}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function Lr(t){return le(t)}function _(t){return t!=null&&t!==!1}const $r=_;function ae(t,e,n){return t.substring(e,n)}function Fr(t){return typeof t=="function"}function Pr(t,e){return a(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:k(n);const u=n.index+se(1,r.length);if(u>e.length)break;e=ae(e,u)}else break}})}function Yr(t){return Number.isNaN(t)}function pe(t){return typeof t=="number"}function he(t){return t?Object.keys(t):null}function Cr(t){return he(t)}function Dr(t){return t?Object.values(t):null}function xt(t){return typeof t=="string"}function Vr(t){return p(t)!=null}function Wr(t){return t instanceof RegExp}class yt extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function Jr(t){return t instanceof yt?t._data:null}function Ur(t){return t instanceof Error?t.message:null}function Xr(t){return t instanceof yt?t._cause:null}function Zr(t,e,n){return new yt(t,e,n)}function _e(t){return Number.isInteger(t)}const Hr=_e,de=Symbol("meta");function to(t){return t instanceof Object?t[de]:null}function eo(t,e){const n=j(t);return n[de]=e,n}function no(t){return t===!0||t===!1}function xe(t){switch(p(t)){case x:case h:case y:case S:case m:return!0}return!1}function ro(t,e){return xe(e)?G(e):G(J(t,e))}function oo(t,e){const n=w(t,e);if(n!==void 0)return[e,n]}function uo(t,e){return(t%e+e)%e}function io(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i<=r&&(r=i,o=u)}),o}function co(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i>=r&&(r=i,o=u)}),o}function so(t){throw new Error(`Expected string, got: ${typeof t}`)}function fo(t){if(xt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e<=Number.MAX_SAFE_INTEGER)return e}return null}return so(t)}function ye(t){return t>=0?Math.floor(t):Math.ceil(t)}function me(t,e){const n=t%e;return ye((t-n)/e)}function mt(t,...e){switch(e.length){case 2:{const n=e[0],r=e[1];return mt(t,n,n(),r)}default:{let n=e[0];const r=e[1],o=e[2];n=t(n);const u=E(n,r,o);return n(u)}}}function lo(t,e){const n={},r=s(t)[Symbol.iterator](),o=s(e)[Symbol.iterator]();let u,i;for(;u=r.next(),!(u.done||(i=o.next(),i.done));)n[u.value]=i.value;return n}function ao(t){return v(t)?t:null}function we(t,e,n){const r=function*(o){if(yield o,_(t(o)))for(const u of s(e(o)))yield*r(u)};return a(function*(){yield*r(n)})}function po(t){return C(O(H),P(we(H,v,t)))}function ho(t){return j(t)}function _o(t){return Object.freeze(t)}class N{constructor(e){e instanceof N||(e=ht(e));const r=new Set(e);this._elts=[...r],this._set=r}add(e){if(this._set.has(e))return this;const n=this._elts;let r=!1;for(let o=0;o<n.length;o++)if(b(e,n[o])<=0){n.splice(o,0,e),r=!0;break}return r?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 xo(...t){return new N(t)}function et(t,e,n){return r=>e(b(r,n),0)}function ge(t,e,n=!0){let r=0;for(;r<t.length&&b(e,t[r])>0;r++);return r}function yo([t,e,n]){const r=et(t,e,n);if(e===gt||e===At){const o=[...t],u=ge(o,n,!0);return o.splice(0,u),r(o[0])||o.splice(0,1),o}else return[...U(r,t)]}function mo([t,e,n,r,o]){const u=[...t],i=ge(u,n,!0);u.splice(0,i);const c=et(t,r,o);return et(t,e,n)(u[0])||u.splice(0,1),[...U(c,u)]}function wo(...t){if(t.length===3)return yo(t);if(t.length===5)return mo(t)}function go(t){return Math.abs(t)}function Ao(t){return ye(t)}function bo(t){return t!=null&&t.constructor}function vo(t){return(e,n)=>{const r=t(e,n);return M(r)?Y(r):r}}function Ae(t){return t=vo(t),(...e)=>{switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return E(t,e[0],e[1])}}}function be(t,e){const n=me(t,e);return t-e*n}function Mo(t){const e=new Map;return(...n)=>{const r=[n.length,...n],o=at(e,r);if(o===void 0){const u=t(...n);return Mt(e,r,u),u}else return o}}function Eo(t){return V(t)?t[t.length-1]:K(t)}function Ro(t){if(V(t)){const e=[...t];return e.pop(),e}else return P(t)}function So(t,e){const n=W(t),r=bt(t)||A;return dt((o,u,i)=>r(o,e(u),i),n,t),n}function ve(t,e){const n=W(t),r=bt(t)||A;return dt((o,u,i)=>r(o,u,e(i)),n,t),n}class ko{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function nt(t,e){if(e.has(t))return t;if(e.add(t),fe(t))return ve(t,r=>nt(r,e));const n=p(t);return n&&n!=y?ct(r=>nt(r,e),t):t}function Qo(t){return nt(t,new Set)}function Ko(t,e){E((n,r)=>t(r),null,e)}return Ke(Io);})();
|
|
1
|
+
var squint;(squint||={}).core=(()=>{var Z=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var Ke=(t,e)=>{for(var n in e)Z(t,n,{get:e[n],enumerable:!0})},Ie=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ke(e))!Qe.call(t,o)&&o!==n&&Z(t,o,{get:()=>e[o],enumerable:!(r=Se(e,o))||r.enumerable});return t};var je=t=>Ie(Z({},"__esModule",{value:!0}),t);var Io={};Ke(Io,{Atom:()=>Ft,Cons:()=>Bt,Delay:()=>ko,IIterable:()=>rt,IIterable__iterator:()=>Ot,LazySeq:()=>dr,NaN_QMARK_:()=>Yr,PROTOCOL_SENTINEL:()=>pn,_:()=>Be,_EQ_:()=>Ne,_GT_:()=>gt,_GT__EQ_:()=>At,_LT_:()=>Te,_LT__EQ_:()=>Oe,_PLUS_:()=>Ge,_STAR_:()=>qe,__protocol_satisfies:()=>ze,_iterator:()=>$,abs:()=>go,aclone:()=>jr,add_watch:()=>Nr,alength:()=>kr,apply:()=>Ct,array_QMARK_:()=>D,aset:()=>Qr,assoc:()=>Q,assoc_BANG_:()=>A,assoc_in:()=>vt,assoc_in_BANG_:()=>Mt,atom:()=>dn,boolean$:()=>vr,boolean_QMARK_:()=>no,bounded_count:()=>ro,butlast:()=>xr,cat:()=>ve,clj__GT_js:()=>Qo,coll_QMARK_:()=>Dr,comp:()=>Et,compare:()=>b,complement:()=>O,concat:()=>Wt,conj:()=>St,conj_BANG_:()=>L,cons:()=>en,constantly:()=>Rn,contains_QMARK_:()=>Qt,count:()=>G,counted_QMARK_:()=>ye,cycle:()=>Dn,dec:()=>We,deref:()=>ut,disj:()=>Ce,disj_BANG_:()=>kt,dissoc:()=>De,dissoc_BANG_:()=>Ve,distinct:()=>Xn,doall:()=>Ir,dorun:()=>Kr,drop:()=>X,drop_last:()=>yr,drop_while:()=>oe,empty:()=>W,empty_QMARK_:()=>fr,ensure_reduced:()=>re,es6_iterator:()=>F,even_QMARK_:()=>Vt,every_QMARK_:()=>ue,every_pred:()=>Gr,ex_cause:()=>Xr,ex_data:()=>Jr,ex_info:()=>Zr,ex_message:()=>Ur,false_QMARK_:()=>Ar,ffirst:()=>Ue,filter:()=>C,filterv:()=>nn,find:()=>oo,first:()=>K,flatten:()=>po,fn_QMARK_:()=>pe,fnil:()=>pt,frequencies:()=>_r,get:()=>w,get_in:()=>at,group_by:()=>hr,identical_QMARK_:()=>Ln,identity:()=>Jt,inc:()=>Kt,int_QMARK_:()=>de,integer_QMARK_:()=>Hr,interleave:()=>Ut,interpose:()=>Kn,into:()=>ne,into_array:()=>le,iterable:()=>s,iterate:()=>Br,js_keys:()=>Cr,js_obj:()=>Sr,juxt:()=>zr,keep:()=>nr,keep_indexed:()=>fn,key:()=>te,keys:()=>_e,last:()=>Xe,lazy:()=>a,list:()=>Dt,list_QMARK_:()=>Sn,long$:()=>Ao,map:()=>R,map_QMARK_:()=>fe,map_indexed:()=>un,mapcat:()=>kn,mapv:()=>ct,max:()=>se,max_key:()=>co,memoize:()=>Mo,merge:()=>qn,merge_with:()=>Bn,meta:()=>to,min:()=>Or,min_key:()=>io,mod:()=>uo,neg_QMARK_:()=>Er,next:()=>tt,nil_QMARK_:()=>an,nnext:()=>Lr,not:()=>Lt,not_any_QMARK_:()=>cr,not_empty:()=>ao,not_every_QMARK_:()=>tr,nth:()=>jt,number_QMARK_:()=>he,object_QMARK_:()=>Pe,odd_QMARK_:()=>En,parse_long:()=>fo,partial:()=>Vn,partition:()=>Zt,partition_all:()=>Xt,partition_by:()=>Gn,partitionv:()=>Nn,partitionv_all:()=>Tn,peek:()=>Eo,persistent_BANG_:()=>_o,pop:()=>Ro,pos_QMARK_:()=>Rr,pr_str:()=>$t,println:()=>It,prn:()=>_n,quot:()=>we,rand_int:()=>ce,rand_nth:()=>lr,range:()=>yn,re_find:()=>wn,re_matches:()=>mn,re_pattern:()=>gn,re_seq:()=>Pr,reduce:()=>E,reduce_kv:()=>dt,reduced:()=>Y,reduced_QMARK_:()=>M,reductions:()=>He,regexp_QMARK_:()=>Wr,rem:()=>Me,remove:()=>rn,remove_watch:()=>Tr,repeat:()=>lt,repeatedly:()=>pr,replace:()=>sr,reset_BANG_:()=>Pt,rest:()=>P,reverse:()=>rr,run_BANG_:()=>Ko,satisfies_QMARK_:()=>Le,second:()=>Je,select_keys:()=>In,seq:()=>v,seq_QMARK_:()=>Nt,seqable_QMARK_:()=>Tt,sequential_QMARK_:()=>H,set:()=>vn,set_QMARK_:()=>Mn,shuffle:()=>ir,some:()=>ie,some_QMARK_:()=>br,some_fn:()=>qr,sort:()=>ht,sort_by:()=>ur,sorted_set:()=>xo,split_at:()=>mr,split_with:()=>wr,str:()=>ln,string_QMARK_:()=>xt,subs:()=>ae,subseq:()=>wo,subvec:()=>An,swap_BANG_:()=>xn,system_time:()=>zn,t:()=>Fr,take:()=>J,take_last:()=>Fn,take_nth:()=>Cn,take_while:()=>U,to_array:()=>$r,trampoline:()=>ge,transduce:()=>mt,transient$:()=>ho,tree_seq:()=>Ae,true_QMARK_:()=>gr,truth_:()=>h,type:()=>bo,unreduced:()=>ft,update:()=>Zn,update_BANG_:()=>_t,update_in:()=>Hn,update_keys:()=>So,update_vals:()=>Ee,val:()=>ee,vals:()=>Vr,vec:()=>k,vector:()=>it,vector_QMARK_:()=>bn,warn_on_lazy_reusage_BANG_:()=>tn,with_meta:()=>eo,zero_QMARK_:()=>Mr,zipmap:()=>lo});function f(t){if(t==null||t instanceof Function)return t;const e=typeof t;return e==="string"?(n,r)=>w(n,t,r):e==="object"?(n,r)=>w(t,n,r):t}function I(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Ne(...t){return I(t,(e,n)=>e===n)}function gt(...t){return I(t,(e,n)=>e>n)}function At(...t){return I(t,(e,n)=>e>=n)}function Te(...t){return I(t,(e,n)=>e<n)}function Oe(...t){return I(t,(e,n)=>e<=n)}function Ge(...t){return t.reduce((e,n)=>e+n,0)}function qe(...t){return t.reduce((e,n)=>e*n,1)}function Be(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const ze={};function Le(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function $e(t,e,n){return t.set(e,n),t}function Fe(t,e,n){return t[e]=n,t}function bt(t){switch(p(t)){case _:return $e;case x:case y:return Fe}}function A(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(p(t)){case _:t.set(e,n);for(let o=0;o<r.length;o+=2)t.set(r[o],r[o+1]);break;case x:case y:t[e]=n;for(let o=0;o<r.length;o+=2)t[r[o]]=r[o+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}function j(t){switch(p(t)){case _:return new Map(t);case m:return new t.constructor(t);case x:return[...t];case y:return{...t};default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function Q(t,e,n,...r){t||(t={});const o=j(t);return A(o,e,n,...r),o}const _=1,x=2,y=3,S=4,m=5,q=6;function B(t){switch(t){case _:return new Map;case x:return[];case y:return{};case S:return new V;case m:return new Set;case q:return a(function*(){})}}function z(t){return t.constructor===Object}function Pe(t){return t!=null&&z(t)}function p(t){if(t!=null){if(z(t))return y;if(t instanceof Map)return _;if(t instanceof Set)return m;if(t instanceof V)return S;if(Array.isArray(t))return x;if(t instanceof ot)return q;if(t instanceof N)return m;if(t instanceof Object)return y}}function Ye(t,e,n,r,o){r=k(r);const u=p(n);if(u!==_&&u!==x&&u!==y)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let c=n;for(let l=0;l<r.length-1;l+=1){const g=r[l];let d;c instanceof Map?d=c.get(g):d=c[g],d||(d=B(u)),i.push(d),c=d}i.push(o);for(let l=i.length-2;l>=0;l-=1)i[l]=t(i[l],r[l],i[l+1]);return i[0]}function vt(t,e,n){return Ye(Q,"assoc-in",t,e,n)}function Mt(t,e,n){e=k(e);var r=t;const o=p(t);for(const u of e.splice(0,e.length-1)){let i=w(r,u);i===void 0&&(i=B(o),A(r,u,i)),r=i}return A(r,e[e.length-1],n),t}function Et(...t){if(t=t.map(f),t.length===0)return Jt;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let o=e(...r);for(const u of n)o=u(o);return o}}function Rt(t,e){for(const n of e)t.add(n);return t}function L(...t){if(t.length===0)return it();const[e,...n]=t;let r=e;switch(r==null&&(r=[]),p(r)){case m:Rt(r,n);break;case S:r.unshift(...n.reverse());break;case x:r.push(...n);break;case _:for(const o of n)Array.isArray(o)?r.set(o[0],o[1]):s(o).forEach(u=>{r.set(u[0],u[1])});break;case y:for(const o of n)Array.isArray(o)?r[o[0]]=o[1]:Object.assign(r,o);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return r}function St(...t){if(t.length===0)return it();const[e,...n]=t;let r=e;r==null&&(r=Dt());let o,u;switch(p(r)){case m:return r instanceof N?Rt(new r.constructor(r),n):new r.constructor([...r,...n]);case S:return new V(...n.reverse(),...r);case x:return[...r,...n];case _:o=new Map(r);for(const i of n)Array.isArray(i)?o.set(i[0],i[1]):s(i).forEach(c=>{o.set(c[0],c[1])});return o;case q:return a(function*(){yield*n,yield*r});case y:u={...r};for(const i of n)Array.isArray(i)?u[i[0]]=i[1]:Object.assign(u,i);return u;default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function kt(t,...e){for(const n of e)t.delete(n);return t}function Ce(t,...e){const n=new t.constructor([...t]);return kt(n,...e)}function Qt(t,e){switch(p(t)){case m:case _:return t.has(e);case void 0:return!1;default:return e in t}}function Ve(t,...e){for(const n of e)delete t[n];return t}function De(t,...e){if(e.length===0)return t;const n=j(t);switch(p(t)){case _:for(const r of e)n.delete(r);break;default:for(const r of e)delete n[r];break}return n}function Kt(t){return t+1}function We(t){return t-1}function It(...t){console.log(...t)}function jt(t,e,n){if(t){var r=void 0;if(Array.isArray(t))r=t[e];else{const o=s(t);let u=0;for(const i of o)if(u++==e){r=i;break}}if(r!==void 0)return r}return n}function w(t,e,n=void 0){if(t==null)return n;let r;if(z(t))return r=t[e],r===void 0?n:r;let o;switch(p(t)){case m:t.has(e)&&(r=e);break;case _:r=t.get(e);break;case x:r=t[e];break;default:if(o=t.get,o instanceof Function)try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function Nt(t){return t!=null&&!!t[Symbol.iterator]}const H=Nt;function Tt(t){return t==null||!!t[Symbol.iterator]}function s(t){if(t==null)return[];if(Tt(t))return t;if(t instanceof Object)return Object.entries(t);throw new TypeError(`${t} is not iterable`)}const rt=Symbol("Iterable"),Ot=Symbol.iterator;function $(t){return t[Symbol.iterator]()}const F=$;function v(t){if(t==null)return t;const e=s(t);return e.length===0||e.size===0||e[Symbol.iterator]().next().done?null:e}function K(t){const[e]=s(t);return e}function Je(t){const[e,n]=s(t);return n}function Ue(t){return K(K(t))}function P(t){return a(function*(){let e=!0;for(const n of s(t))e?e=!1:yield n})}class T{value;constructor(e){this.value=e}_deref(){return this.value}}function Xe(t){t=s(t);let e;switch(p(t)){case x:return t[t.length-1];default:for(const n of t)e=n;return e}}function Y(t){return new T(t)}function M(t){return t instanceof T}function E(t,e,n){t=f(t);let r,o;if(arguments.length===2){const u=s(e)[Symbol.iterator](),i=u.next();i.done?o=t():o=i.value,r=u}else o=e,r=s(n);if(o instanceof T)return o.value;for(const u of r)if(o=t(o,u),o instanceof T){o=o.value;break}return o}function*Ze(t,e){const n=e.next();n.done?yield t():yield*Gt(t,n.value,e)}function*Gt(t,e,n){let r=e,o=n;for(;;){if(M(r)){yield r.value;return}else yield r;const u=o.next();if(u.done)break;r=t(r,u.value)}}function He(t,e,n){return t=f(t),arguments.length===2?a(function*(){yield*Ze(t,s(e)[Symbol.iterator]())}):a(function*(){yield*Gt(t,e,s(n)[Symbol.iterator]())})}var qt=!1;function tn(){qt=!0}class ot{constructor(e){this.gen=e,this.usages=0}[Symbol.iterator](){if(this.usages++,this.usages>=2&&qt)try{throw new Error}catch(e){console.warn("Re-use of lazy value",e.stack)}return this.gen()}}ot.prototype[rt]=!0;function a(t){return new ot(t)}class Bt{constructor(e,n){this.x=e,this.coll=n}*[Symbol.iterator](){yield this.x,yield*s(this.coll)}}function en(t,e){return new Bt(t,e)}function R(t,...e){switch(t=f(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 a(function*(){for(const n of s(e[0]))yield t(n)});default:return a(function*(){const n=e.map(r=>F(s(r)));for(;;){const r=[];for(const o of n){const u=o.next();if(u.done)return;r.push(u.value)}yield t(...r)}})}}function zt(t){return e=>(...n)=>{switch(n.length){case 0:return e();case 1:return e(n[0]);case 2:{const r=n[0],o=n[1];return h(t(o))?e(r,o):r}}}}function C(t,e){return arguments.length===1?zt(t):(t=f(t),a(function*(){for(const n of s(e))h(t(n))&&(yield n)}))}function nn(t,e){return[...C(t,e)]}function rn(t,e){return arguments.length===1?zt(O(t)):C(O(t),e)}function on(t){return e=>{let n=-1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:return e(r[0],t((n=n+1,n),r[1]))}}}}function un(t,e){if(t=f(t),arguments.length===1)return on(t);const n=[];let r=0;for(const o of s(e))n.push(t(r,o)),r++;return n}function cn(t,e){t=f(t);const n=[];let r=0;for(const o of s(e)){const u=t(r,o);h(u)&&n.push(u),r++}return n}function sn(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];n++;const c=t(n,i);return c==null?u:e(u,c)}}}}function fn(t,e){return arguments.length===1?sn(t):cn(t,e)}function ln(...t){return t.join("")}function Lt(t){return!h(t)}function an(t){return t==null}const pn={};function hn(t){return t===null?"null":JSON.stringify(t,(e,n)=>{switch(p(n)){case m:case q:return[...n];case _:return Object.fromEntries(n);default:return n}})}function $t(...t){return t.map(hn).join(" ")}function _n(...t){It($t(...t))}class Ft{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 o of Object.entries(this._watches)){const u=o[0],i=o[1];i(u,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 dn(t){return new Ft(t)}function ut(t){return t._deref()}function Pt(t,e){t._reset_BANG_(e)}function xn(t,e,...n){e=f(e);const r=e(ut(t),...n);return Pt(t,r),r}function yn(t,e,n){return a(function*(){let r=t,o=e,u=n;e===void 0&&(r=0,o=t);let i=r||0;u=n??1;const c=u>=0;for(;o===void 0||c&&i<o||!c&&o<i;)yield i,i+=u})}function mn(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function wn(t,e){if(xt(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 gn(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 An(t,e,n){return t.slice(e,n)}function it(...t){return t}function bn(t){return p(t)===x}function ct(...t){if(t.length===2){const[r,o]=t,u=s(o);if(Array.isArray(u)){const i=new Array(u.length);for(var e=0;e<u.length;e++)i[e]=r(u[e]);return i}else{var n=[];for(const i of u)n.push(r(i));return n}}return[...R(...t)]}function k(t){return D(t)?t:[...s(t)]}function vn(t){return new Set(s(t))}function Mn(t){return p(t)===m}const Yt=Symbol("IApply__apply");function Ct(t,...e){t=f(t);const n=e.slice(0,e.length-1),r=s(e[e.length-1]),o=t[Yt];return o?o(...n,r):t(...n,...r)}function Vt(t){return t%2==0}function En(t){return!Vt(t)}function O(t){return t=f(t),(...e)=>Lt(t(...e))}function Rn(t){return(...e)=>t}class V extends Array{constructor(...e){super(),this.push(...e)}}function Sn(t){return p(t)===S}function Dt(...t){return new V(...t)}function D(t){return Array.isArray(t)}function st(t){return a(function*(){for(const e of t)yield*s(e)})}function Wt(...t){return st(t)}Wt[Yt]=t=>st(t);function kn(t,...e){if(e.length===0)return Et(R(t),ve);{const n=R(t,...e);return st(n)}}function Jt(t){return t}function Ut(...t){return a(function*(){const e=t.map(n=>F(s(n)));for(;;){const n=[];for(const r of e){const o=r.next();if(o.done)return;n.push(o.value)}yield*n}})}function Qn(t){return e=>{let n=!1;return(...r)=>{switch(r.length){case 0:return e();case 1:return e(r[0]);case 2:if(n){const o=e(r[0],t);return M(o)?o:e(o,r[1])}else return n=!0,e(r[0],r[1])}}}}function Kn(t,e){return arguments.length===1?Qn(t):X(1,Ut(lt(t),e))}function In(t,e){const n=p(t),r=B(n)||{};for(const o of e){const u=w(t,o);u!=null&&A(r,o,u)}return r}function ft(t){return M(t)?ut(t):t}function jn(t){return e=>{let n=[];return(...r)=>{let o,u;switch(r.length){case 0:return e();case 1:return o=r[0],n.length!==0&&(u=[...n],n=[],o=ft(e(o,u))),e(o);case 2:return o=r[0],n.push(r[1]),t===n.length?(u=[...n],n=[],e(o,u)):o}}}}function Xt(t,...e){if(arguments.length===1)return jn(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Ht(t,n,[],r,!0)}function Zt(t,...e){let n=t,r=[],o=e[0];return e.length===2?[n,o]=e:e.length>2&&([n,r,o]=e),Ht(t,n,r,o,!1)}const Nn=Zt,Tn=Xt;function Ht(t,e,n,r,o){return a(function*(){let u=[],i=0;for(const c of s(r))i<t&&(u.push(c),u.length===t&&(yield u,u=e<t?u.slice(e):[])),i++,i===e&&(i=0);u.length>0&&(u.length===t||o?yield u:n.length&&(u.push(...n.slice(0,t-u.length)),yield u))})}function On(t){return e=>{let n=[];const r={};let o=r;return(...u)=>{const i=u.length;if(i===0)return e();if(i===1){let c=u[0];if(n.length!==0){const l=[...n];n=[],c=ft(e(c,l))}return e(c)}if(i===2){const c=u[0],l=u[1],g=o,d=t(l);if(o=d,g===r||d===g)return n.push(l),c;{const Re=[...n];n=[];const wt=e(c,Re);return M(wt)||n.push(l),wt}}}}}function Gn(t,e){return t=f(t),arguments.length===1?On(t):a(function*(){const n=F(e),r=n.next();r.done&&(yield*null);const o=r.value;let u=t(o),i=[o],c=[];for(;;){const l=n.next();if(l.done){yield i;break}const g=l.value,d=t(g);u==d?i.push(g):(yield i,c.push(g),i=c,u=d,c=[])}})}function W(t){const e=p(t);if(e!=null)return B(e);throw new Error(`Can't create empty of ${typeof t}`)}function qn(...t){const e=t[0];let n;return e==null?n={}:n=ne(W(e),e),L(n,...t.slice(1))}function te(t){return t[0]}function ee(t){return t[1]}function Bn(t,...e){t=f(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(u,i)=>{const c=te(i),l=ee(i);return Qt(u,c)?Q(u,c,t(w(u,c),l)):Q(u,c,l)};return E((u,i)=>E(r,u||{},v(i)),e)}else return null}function zn(){return performance.now()}function ne(...t){let e,n,r,o,u;switch(t.length){case 0:return[];case 1:return t[0];case 2:return St(t[0]??[],...s(t[1]));case 3:return e=t[0],n=t[1],r=t[2],o=j(e),u=(i,c)=>c===void 0?i:L(i,c),mt(n,u,o,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function Ln(t,e){return t===e}function lt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);return{[rt]:!0,[Ot]:t.length==1?function*(){const e=t[0];for(;;)yield e}:function*(){const[e,n]=t;for(var r=0;r<e;r++)yield n}}}function re(t){return M(t)?t:Y(t)}function $n(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1){const u=r[0];return e(u)}if(o===2){let u=r[0];const i=r[1],c=n,l=(n=n-1,n);return c>0&&(u=e(u,i)),l>0?u:re(u)}}}}function J(t,e){return arguments.length===1?$n(t):a(function*(){let n=t-1;for(const r of s(e))if(n-->=0&&(yield r),n<0)return})}function Fn(t,e){if(t==0)return null;if(Array.isArray(e))return v(e.slice(-Math.abs(t)));{let n=new Array(t),r=0;for(const o of s(e))n[r%t]=o,r++;return r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Pn(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1];return h(t(u))?e(o,u):Y(o)}}}function U(t,e){return t=f(t),arguments.length===1?Pn(t):a(function*(){for(const n of s(e))if(h(t(n)))yield n;else return})}function Yn(t){return e=>{let n=-1;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1];return n++,Me(n,t)===0?e(u,i):u}}}}function Cn(t,e){return arguments.length===1?Yn(t):t<=0?lt(K(e)):a(function*(){let n=0;for(const r of s(e))n%t===0&&(yield r),n++})}function Vn(t,...e){return t=f(t),function(...n){return t(...e,...n)}}function Dn(t){return a(function*(){for(;;)yield*t})}function Wn(t){return e=>{let n=t;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=r[0],i=r[1],c=n;return n--,c>0?u:e(u,i)}}}}function X(t,e){return arguments.length===1?Wn(t):a(function*(){const n=$(s(e));for(let r=0;r<t;r++)n.next();yield*n})}function Jn(t){return e=>{let n=!0;return(...r)=>{const o=r.length;if(o===0)return e();if(o===1)return e(r[0]);if(o===2){const u=n,i=r[0],c=r[1];return u&&h(t(c))?i:(n=null,e(i,c))}}}}function oe(t,e){return t=f(t),arguments.length===1?Jn(t):a(function*(){const n=$(s(e));for(;;){const r=n.next();if(r.done)break;const o=r.value;if(!h(t(o))){yield o;break}}yield*n})}function Un(){return t=>{const e=new Set;return(...n)=>{const r=n.length;if(r===0)return t();if(r===1)return t(n[0]);if(r===2){const o=n[0],u=n[1];return e.has(u)?o:(e.add(u),t(o,u))}}}}function Xn(t){return arguments.length===0?Un():a(function*(){const e=new Set;for(const n of s(t))e.has(n)||(yield n),e.add(n)})}function Zn(t,e,n,...r){return n=f(n),Q(t,e,n(w(t,e),...r))}function at(t,e,n){let r=t;for(const o of e)r=w(r,o);return r===void 0?n:r}function Hn(t,e,n,...r){return n=f(n),vt(t,e,n(at(t,e),...r))}function pt(t,e,...n){return t=f(t),function(r,...o){return r?t(r,...n,...o):t(e,...n,...o)}}function ue(t,e){t=f(t);for(const n of s(e))if(!t(n))return!1;return!0}function tr(t,e){return!ue(t,e)}function er(t){return e=>(...n)=>{const r=n.length;if(r===0)return e();if(r===1)return e(n[0]);if(r===2){const o=n[0],u=n[1],i=t(u);return i==null?o:e(o,i)}}}function nr(t,e){return t=f(t),arguments.length===1?er(t):a(function*(){for(const n of s(e)){const r=t(n);h(r)&&(yield r)}})}function rr(t){return t=s(t),[...t].reverse()}function ht(t,e){return arguments.length===1&&(e=t,t=void 0),t=f(t),e=s(e),[...e].sort(t||b)}function or(t){return t===b?t:(e,n)=>{const r=t(e,n);return he(r)?r:r?-1:t(n,e)?1:0}}function ur(t,e,n){return arguments.length===2&&(n=e,e=b),t=f(t),e=f(e),ht((r,o)=>{const u=or(e),i=t(r),c=t(o);return u(i,c)},n)}function ir(t){const e=[...t];let n=t.length;for(;n;){const r=Math.floor(Math.random()*n--),o=e[n];e[n]=e[r],e[r]=o}return e}function ie(t,e){t=f(t);for(const n of s(e)){const r=t(n);if(h(r))return r}}function cr(t,e){return t=f(t),!ie(t,e)}function sr(t,e){return(Array.isArray(e)?ct:R)(r=>{const o=t[r];return o!==void 0?o:r},e)}function fr(t){return!v(t)}function ce(t){return Math.floor(Math.random()*t)}function lr(t){const e=ce(G(t));return jt(t,e)}function ar(t){return a(function*(){for(;;)yield t()})}function pr(t,e){arguments.length===1&&(e=t,t=void 0);const n=ar(e);return t?J(t,n):n}function _t(t,e,n,...r){const o=w(t,e);return A(t,e,n(o,...r))}function hr(t,e){t=f(t);const n={};for(const r of s(e)){const o=t(r);_t(n,o,pt(L,[]),r)}return n}function _r(t){const e={},n=pt(Kt,0);for(const r of s(t))_t(e,r,n);return e}class dr{constructor(e){this.f=e,this.res=void 0}*[Symbol.iterator](){this.res===void 0&&(this.res=this.f(),this.f=null),yield*s(this.res)}}function xr(t){const e=[...s(t)];return e.pop(),e.length>0?e:null}function yr(...t){const[e,n]=t.length>1?t:[1,t[0]];return R((r,o)=>r,n,X(e,n))}function mr(t,e){return[J(t,e),X(t,e)]}function wr(t,e){return[U(t,e),oe(t,e)]}function G(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;let n=0;for(const r of s(t))n++;return n}function gr(t){return t===!0}function Ar(t){return t===!1}function br(t){return t!=null}function vr(t){return!!t}function Mr(t){return t===0}function Er(t){return t<0}function Rr(t){return t>0}function Sr(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function kr(t){return t.length}function Qr(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const o=[e,n,...r],u=o[o.length-1];let i=t,c=0;const l=o.length-2;for(;c<l;c++)i=i[o[c]];return i[o[c]]=u,n}}function Kr(t){for(const e of s(t));return null}function Ir(t){return k(t)}function jr(t){return[...t]}function Nr(t,e,n){return t._add_watch(e,n)}function Tr(t,e){return t._remove_watch(e)}function dt(t,e,n){if(!n)return e;var r=e;for(const o of s(n))r=t(r,o[0],o[1]);return r}function se(t,e,...n){return e==null?t:Math.max(t,e,...n)}function Or(t,e,...n){return e==null?t:Math.min(t,e,...n)}function fe(t){return t==null?!1:!!(z(t)||t instanceof Map)}function Gr(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function qr(...t){return(...e)=>{for(const n of t)for(const r of e){const o=n(r);if(o)return o}}}function le(t,e){return k(e||t)}function Br(t,e){var n=e;return a(function*(){for(;;)yield n,n=t(n)})}function zr(...t){return t=t.map(f),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function tt(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return v(P(t))}function Lr(t){return tt(tt(t))}function b(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")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 o=0;o<t.length;o++){let u=b(t[o],e[o]);if(u!=0)return u}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function $r(t){return le(t)}function h(t){return t!=null&&t!==!1}const Fr=h;function ae(t,e,n){return t.substring(e,n)}function pe(t){return typeof t=="function"}function Pr(t,e){return a(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:k(n);const u=n.index+se(1,r.length);if(u>e.length)break;e=ae(e,u)}else break}})}function Yr(t){return Number.isNaN(t)}function he(t){return typeof t=="number"}function _e(t){return t?Object.keys(t):null}function Cr(t){return _e(t)}function Vr(t){return t?Object.values(t):null}function xt(t){return typeof t=="string"}function Dr(t){return p(t)!=null}function Wr(t){return t instanceof RegExp}class yt extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function Jr(t){return t instanceof yt?t._data:null}function Ur(t){return t instanceof Error?t.message:null}function Xr(t){return t instanceof yt?t._cause:null}function Zr(t,e,n){return new yt(t,e,n)}function de(t){return Number.isInteger(t)}const Hr=de,xe=Symbol("meta");function to(t){return t instanceof Object?t[xe]:null}function eo(t,e){const n=j(t);return n[xe]=e,n}function no(t){return t===!0||t===!1}function ye(t){switch(p(t)){case x:case _:case y:case S:case m:return!0}return!1}function ro(t,e){return ye(e)?G(e):G(J(t,e))}function oo(t,e){const n=w(t,e);if(n!==void 0)return[e,n]}function uo(t,e){return(t%e+e)%e}function io(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i<=r&&(r=i,o=u)}),o}function co(t,e,...n){if(n.length==0)return e;var r=t(e),o=e;return n.forEach(u=>{var i=t(u);i>=r&&(r=i,o=u)}),o}function so(t){throw new Error(`Expected string, got: ${typeof t}`)}function fo(t){if(xt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e<=Number.MAX_SAFE_INTEGER)return e}return null}return so(t)}function me(t){return t>=0?Math.floor(t):Math.ceil(t)}function we(t,e){const n=t%e;return me((t-n)/e)}function ge(t,...e){if(e.length==0)for(;;){const n=t();if(h(pe(n))){t=n;continue}else return n}else return ge(function(){return Ct(t,e)})}function mt(t,...e){switch(e.length){case 2:{const n=e[0],r=e[1];return mt(t,n,n(),r)}default:{let n=e[0];const r=e[1],o=e[2];n=t(n);const u=E(n,r,o);return n(u)}}}function lo(t,e){const n={},r=s(t)[Symbol.iterator](),o=s(e)[Symbol.iterator]();let u,i;for(;u=r.next(),!(u.done||(i=o.next(),i.done));)n[u.value]=i.value;return n}function ao(t){return v(t)?t:null}function Ae(t,e,n){const r=function*(o){if(yield o,h(t(o)))for(const u of s(e(o)))yield*r(u)};return a(function*(){yield*r(n)})}function po(t){return C(O(H),P(Ae(H,v,t)))}function ho(t){return j(t)}function _o(t){return Object.freeze(t)}class N{constructor(e){e instanceof N||(e=ht(e));const r=new Set(e);this._elts=[...r],this._set=r}add(e){if(this._set.has(e))return this;const n=this._elts;let r=!1;for(let o=0;o<n.length;o++)if(b(e,n[o])<=0){n.splice(o,0,e),r=!0;break}return r?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 xo(...t){return new N(t)}function et(t,e,n){return r=>e(b(r,n),0)}function be(t,e,n=!0){let r=0;for(;r<t.length&&b(e,t[r])>0;r++);return r}function yo([t,e,n]){const r=et(t,e,n);if(e===gt||e===At){const o=[...t],u=be(o,n,!0);return o.splice(0,u),r(o[0])||o.splice(0,1),o}else return[...U(r,t)]}function mo([t,e,n,r,o]){const u=[...t],i=be(u,n,!0);u.splice(0,i);const c=et(t,r,o);return et(t,e,n)(u[0])||u.splice(0,1),[...U(c,u)]}function wo(...t){if(t.length===3)return yo(t);if(t.length===5)return mo(t)}function go(t){return Math.abs(t)}function Ao(t){return me(t)}function bo(t){return t!=null&&t.constructor}function vo(t){return(e,n)=>{const r=t(e,n);return M(r)?Y(r):r}}function ve(t){return t=vo(t),(...e)=>{switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return E(t,e[0],e[1])}}}function Me(t,e){const n=we(t,e);return t-e*n}function Mo(t){const e=new Map;return(...n)=>{const r=[n.length,...n],o=at(e,r);if(o===void 0){const u=t(...n);return Mt(e,r,u),u}else return o}}function Eo(t){return D(t)?t[t.length-1]:K(t)}function Ro(t){if(D(t)){const e=[...t];return e.pop(),e}else return P(t)}function So(t,e){const n=W(t),r=bt(t)||A;return dt((o,u,i)=>r(o,e(u),i),n,t),n}function Ee(t,e){const n=W(t),r=bt(t)||A;return dt((o,u,i)=>r(o,u,e(i)),n,t),n}class ko{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function nt(t,e){if(e.has(t))return t;if(e.add(t),fe(t))return Ee(t,r=>nt(r,e));const n=p(t);return n&&n!=y?ct(r=>nt(r,e),t):t}function Qo(t){return nt(t,new Set)}function Ko(t,e){E((n,r)=>t(r),null,e)}return je(Io);})();
|
package/package.json
CHANGED
package/src/squint/core.js
CHANGED
|
@@ -579,16 +579,9 @@ export function rest(coll) {
|
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
-
class
|
|
583
|
-
then(resolve, _reject) {
|
|
584
|
-
return resolve(this._deref());
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
class Reduced extends IDerefAsync {
|
|
582
|
+
class Reduced {
|
|
589
583
|
value;
|
|
590
584
|
constructor(x) {
|
|
591
|
-
super();
|
|
592
585
|
this.value = x;
|
|
593
586
|
}
|
|
594
587
|
_deref() {
|
|
@@ -946,9 +939,8 @@ export function prn(...xs) {
|
|
|
946
939
|
println(pr_str(...xs));
|
|
947
940
|
}
|
|
948
941
|
|
|
949
|
-
export class Atom
|
|
942
|
+
export class Atom {
|
|
950
943
|
constructor(init) {
|
|
951
|
-
super();
|
|
952
944
|
this.val = init;
|
|
953
945
|
this._watches = {};
|
|
954
946
|
this._deref = () => this.val;
|
|
@@ -2519,6 +2511,24 @@ export function quot(n, d) {
|
|
|
2519
2511
|
return fix((n - rem) / d);
|
|
2520
2512
|
}
|
|
2521
2513
|
|
|
2514
|
+
export function trampoline(f, ...args) {
|
|
2515
|
+
if (args.length == 0) {
|
|
2516
|
+
while (true) {
|
|
2517
|
+
const ret = f();
|
|
2518
|
+
if (truth_(fn_QMARK_(ret))) {
|
|
2519
|
+
f = ret;
|
|
2520
|
+
continue;
|
|
2521
|
+
} else {
|
|
2522
|
+
return ret;
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
} else {
|
|
2526
|
+
return trampoline(function() {
|
|
2527
|
+
return apply(f, args);
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2522
2532
|
export function transduce(xform, ...args) {
|
|
2523
2533
|
switch (args.length) {
|
|
2524
2534
|
case 2: {
|