├── figwheel-main.edn ├── .gitignore ├── resources └── public │ ├── ohno.png │ ├── oops.gif │ ├── yay.png │ ├── welcome.png │ ├── good-luck.png │ ├── you-did-it.gif │ ├── math.html │ ├── migration.html │ ├── style.css │ ├── index.html │ └── js │ └── prod2.js ├── .dir-locals.el ├── prod.cljs.edn ├── dev.cljs.edn ├── deps.edn └── src └── kittycatmeowmeow ├── main.cljs ├── migration.cljs └── math.cljs /figwheel-main.edn: -------------------------------------------------------------------------------- 1 | {:css-dirs ["resources/public"] 2 | :ring-server-options {:port 8765}} 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.cpcache/ 2 | /.nrepl-port 3 | /resources/public/js/dev.js 4 | /resources/public/js/dev 5 | -------------------------------------------------------------------------------- /resources/public/ohno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/ohno.png -------------------------------------------------------------------------------- /resources/public/oops.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/oops.gif -------------------------------------------------------------------------------- /resources/public/yay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/yay.png -------------------------------------------------------------------------------- /resources/public/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/welcome.png -------------------------------------------------------------------------------- /resources/public/good-luck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/good-luck.png -------------------------------------------------------------------------------- /resources/public/you-did-it.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magnars/kittycatmeowmeow/master/resources/public/you-did-it.gif -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((nil 2 | (cider-clojure-cli-global-options . "-A:dev") 3 | (cider-default-cljs-repl . figwheel-main) 4 | (cider-figwheel-main-default-options . ":dev"))) 5 | -------------------------------------------------------------------------------- /prod.cljs.edn: -------------------------------------------------------------------------------- 1 | {:main kittycatmeowmeow.main 2 | :optimizations :advanced 3 | :asset-path "/js/prod2" 4 | :output-to "resources/public/js/prod2.js" 5 | :output-dir "resources/public/js/prod2"} 6 | -------------------------------------------------------------------------------- /dev.cljs.edn: -------------------------------------------------------------------------------- 1 | {:main kittycatmeowmeow.main 2 | :optimizations :none 3 | :pretty-print true 4 | :source-map true 5 | :asset-path "/js/dev" 6 | :output-to "resources/public/js/dev.js" 7 | :output-dir "resources/public/js/dev"} 8 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | {:paths ["src"] 2 | :deps {org.clojure/clojure {:mvn/version "1.10.0"} 3 | org.clojure/clojurescript {:mvn/version "1.10.439"} 4 | cjohansen/dumdom {:mvn/version "2019.02.03-3"} 5 | org.clojure/core.async {:mvn/version "0.4.490"}} 6 | :aliases {:dev {:extra-paths ["resources"] 7 | :extra-deps {com.bhauman/figwheel-main {:mvn/version "0.2.0-SNAPSHOT"}}}}} 8 | -------------------------------------------------------------------------------- /resources/public/math.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Math Game | KittyCatMeowMeow 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/public/migration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Migration quiz | KittyCatMeowMeow 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/kittycatmeowmeow/main.cljs: -------------------------------------------------------------------------------- 1 | (ns kittycatmeowmeow.main 2 | (:require kittycatmeowmeow.math 3 | kittycatmeowmeow.migration)) 4 | 5 | (defonce start-the-app 6 | (do 7 | (when-let [container (js/document.getElementById "math")] 8 | (kittycatmeowmeow.math/start! container)) 9 | (when-let [container (js/document.getElementById "migration")] 10 | (kittycatmeowmeow.migration/start! container)) 11 | :started)) 12 | 13 | -------------------------------------------------------------------------------- /resources/public/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: black; 3 | color: white; 4 | } 5 | img {max-width: 100%;} 6 | a {color: lightblue;} 7 | 8 | button { 9 | background: #ccc; 10 | font-size: 24px; 11 | padding: 5px; 12 | width: 45%; 13 | max-width: 180px; 14 | margin: 5px; 15 | } 16 | 17 | button.correct { 18 | background: #6c6; 19 | transition: background 500ms; 20 | } 21 | 22 | .right-img {width: 30%; float: right;} 23 | -------------------------------------------------------------------------------- /resources/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | KittyCatMeowMeow 7 | 8 | 9 | 10 | 11 |

KittyCatMeowMeow

12 |

Welcome!

13 | I hope you enjoy my KITTYCAT MATH game!
14 | I hope you will enjoy The Kitty's Migration Quiz! 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/kittycatmeowmeow/migration.cljs: -------------------------------------------------------------------------------- 1 | (ns kittycatmeowmeow.migration 2 | (:require [cljs.core.async :refer [ current-question 1) 22 | "correct")} "Sad"] 23 | [:button {:onClick #(question-answered 1)} "Angry"] 24 | [:button {:onClick #(question-answered 1)} "Emotionless"]] 25 | (when (>= current-question 2) 26 | [:div 27 | [:p "How did people migrate far away in the old days?"] 28 | [:button {:onClick #(question-answered 2) 29 | :className (when (> current-question 2) 30 | "correct")} "Boat"] 31 | [:button {:onClick #(question-answered 2)} "Walk"] 32 | [:button {:onClick #(question-answered 2)} "Plane"] 33 | [:button {:onClick #(question-answered 2)} "Car"]]) 34 | (when (>= current-question 3) 35 | [:div 36 | [:p "How do most people migrate now?"] 37 | [:button {:onClick #(question-answered 3)} "Walk"] 38 | [:button {:onClick #(question-answered 3)} "Car"] 39 | [:button {:onClick #(question-answered 3)} "Boat"] 40 | [:button {:onClick #(question-answered 3) 41 | :className (when (> current-question 3) 42 | "correct")} "Plane"]]) 43 | (when (>= current-question 4) 44 | [:div 45 | [:p "What is another way to say migrating to another country?"] 46 | [:button {:onClick #(question-answered 4)} "Moving To Another Place"] 47 | [:button {:onClick #(question-answered 4) 48 | :className (when (> current-question 4) 49 | "correct")} "External Migration"] 50 | [:button {:onClick #(question-answered 4)} "Internal Migration"] 51 | [:button {:onClick #(question-answered 4)} "Extreme Migration"]]) 52 | (when (>= current-question 5) 53 | [:div 54 | [:p "What is another way to say migrating but you stay in the country"] 55 | [:button {:onClick #(question-answered 5)} "External Migration"] 56 | [:button {:onClick #(question-answered 5)} "Dangerous Migration"] 57 | [:button {:onClick #(question-answered 5)} "Closeby Migration"] 58 | [:button {:onClick #(question-answered 5) 59 | :className (when (> current-question 5) 60 | "correct")} "Internal Migration"]])]) 61 | 62 | (defn render [state container] 63 | (dumdom/render [quiz state] container)) 64 | 65 | (defn start! [container] 66 | (add-watch status ::me (fn [_ _ _ new-state] 67 | (render new-state container))) 68 | (render @status container)) 69 | 70 | (swap! status update ::reload (fnil inc 0)) 71 | -------------------------------------------------------------------------------- /src/kittycatmeowmeow/math.cljs: -------------------------------------------------------------------------------- 1 | (ns kittycatmeowmeow.math 2 | (:require [cljs.core.async :refer [ % 50 | (assoc :hermione-img "good-luck.png") 51 | (assoc :current-question (create-addition-question)) 52 | (assoc :show-correct-answer? false) 53 | (cond-> correct-answer? 54 | (update :questions-left dec)) 55 | (cond-> (not correct-answer?) 56 | (update :remaining-lives dec)) 57 | )))))) 58 | 59 | (defcomponent game [status] 60 | (let [question (:current-question status)] 61 | [:div 62 | [:img.right-img {:src (:hermione-img status)}] 63 | [:h1 "KittyCat­MeowMeow Math Game"] 64 | (when (:won-the-game!!!!! status) 65 | [:p "You did it! Congratulations! You are really good at math!"]) 66 | (when (:lost-the-game!!!!!!!!!!!! status) 67 | [:p "Oh, no! You lost the game! Maybe you want to try again?"]) 68 | (when question 69 | [:div 70 | [:p 71 | (if (= 1 (:remaining-lives status)) 72 | [:span "This is your last life! Don't get wrong! "] 73 | [:span "You have " (:remaining-lives status) " lives. "]) 74 | (if (= 1 (:questions-left status)) 75 | [:span "This is the final question!"] 76 | [:span "There are " (:questions-left status) " questions left."])] 77 | [:h2 78 | "What is " 79 | (:first-number question) 80 | (:operation question) 81 | (:second-number question) 82 | "?"] 83 | (for [answer (:possible-answers question)] 84 | [:button {:className (when (and (:show-correct-answer? status) 85 | (= answer (:correct-answer question))) 86 | "correct") 87 | :onClick #(check-answer question answer)} 88 | answer])]) 89 | (when (not question) 90 | [:button {:onClick start-game} 91 | "Play Again"]) 92 | 93 | ])) 94 | 95 | (defn render [state container] 96 | (dumdom/render [game state] container)) 97 | 98 | (defn start! [container] 99 | (start-game) 100 | (add-watch status ::me (fn [_ _ _ new-state] 101 | (render new-state container))) 102 | (render @status container)) 103 | 104 | (swap! status update ::reload (fnil inc 0)) 105 | -------------------------------------------------------------------------------- /resources/public/js/prod2.js: -------------------------------------------------------------------------------- 1 | if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { 2 | Math.imul = function (a, b) { 3 | var ah = (a >>> 16) & 0xffff; 4 | var al = a & 0xffff; 5 | var bh = (b >>> 16) & 0xffff; 6 | var bl = b & 0xffff; 7 | // the shift by 0 fixes the sign on the high part 8 | // the final |0 converts the unsigned value into a signed value 9 | return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); 10 | } 11 | } 12 | 13 | !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.snabbdom=a()}}(function(){return function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=d;++d)null!=(f=a[d])&&void 0!==(e=f.key)&&(g[e]=d);return g}function k(a,b){function c(a){var b=a.id?"#"+a.id:"",c=a.className?"."+a.className.split(" ").join("."):"";return l["default"](w.tagName(a).toLowerCase()+b+c,{},[],void 0,a)}function d(a,b){return function(){if(0==--b){var c=w.parentNode(a);w.removeChild(c,a)}}}function e(a,b){var c,d=a.data;void 0!==d&&g(c=d.hook)&&g(c=c.init)&&(c(a),d=a.data);var h=a.children,i=a.sel;if("!"===i)f(a.text)&&(a.text=""),a.elm=w.createComment(a.text);else if(void 0!==i){var j=i.indexOf("#"),k=i.indexOf(".",j),l=j>0?j:i.length,n=k>0?k:i.length,o=-1!==j||-1!==k?i.slice(0,Math.min(l,n)):i,p=a.elm=g(d)&&g(c=d.ns)?w.createElementNS(c,o):w.createElement(o);for(n>l&&p.setAttribute("id",i.slice(l+1,n)),k>0&&p.setAttribute("class",i.slice(n+1).replace(/\./g," ")),c=0;c=d;++d){var h=c[d];null!=h&&w.insertBefore(a,e(h,g),b)}}function o(a){var b,c,d=a.data;if(void 0!==d){for(g(b=d.hook)&&g(b=b.destroy)&&b(a),b=0;b=c;++c){var f=void 0,h=void 0,i=void 0,j=b[c];if(null!=j)if(g(j.sel)){for(o(j),h=v.remove.length+1,i=d(j.elm,h),f=0;f=m&&t>=n;)null==q?q=b[++m]:null==r?r=b[--o]:null==u?u=c[++n]:null==v?v=c[--t]:h(q,u)?(s(q,u,d),q=b[++m],u=c[++n]):h(r,v)?(s(r,v,d),r=b[--o],v=c[--t]):h(q,v)?(s(q,v,d),w.insertBefore(a,q.elm,w.nextSibling(r.elm)),q=b[++m],v=c[--t]):h(r,u)?(s(r,u,d),w.insertBefore(a,r.elm,q.elm),r=b[--o],u=c[++n]):(void 0===g&&(g=j(b,m,o)),f(i=g[u.key])?(w.insertBefore(a,e(u,d),q.elm),u=c[++n]):((l=b[i]).sel!==u.sel?w.insertBefore(a,e(u,d),q.elm):(s(l,u,d),b[i]=void 0,w.insertBefore(a,l.elm,q.elm)),u=c[++n]));(o>=m||t>=n)&&(m>o?k(a,null==c[t+1]?null:c[t+1].elm,c,n,t,d):p(a,b,m,o))}(l,m,n,c):g(n)?(g(a.text)&&w.setTextContent(l,""),k(l,null,n,0,n.length-1,c)):g(m)?p(l,m,0,m.length-1):g(a.text)&&w.setTextContent(l,""):a.text!==b.text&&(g(m)&&p(l,m,0,m.length-1),w.setTextContent(l,b.text)),g(i)&&g(d=i.postpatch)&&d(a,b)}}var t,u,v={},w=void 0!==b?b:n["default"];for(t=0;t>>0),da=0;function ea(a,c,b){return a.call.apply(a.bind,arguments)}function fa(a,c,b){if(!a)throw Error();if(2a){var c=la[a];if(c)return c}c=new ka([a|0],0>a?-1:0);-128<=a&&128>a&&(la[a]=c);return c}function oa(a){if(isNaN(a)||!isFinite(a))return pa;if(0>a)return qa(oa(-a));for(var c=[],b=1,d=0;a>=b;d++)c[d]=a/b|0,b*=ra;return new ka(c,0)}var ra=4294967296,pa=ma(0),sa=ma(1),ta=ma(16777216); 18 | function wa(a){if(-1==a.R)return-wa(qa(a));for(var c=0,b=1,d=0;da||36>>0).toString(a);b=e;if(ya(b))return f+d;for(;6>f.length;)f="0"+f;d=""+f+d}}; 19 | function xa(a,c){return 0>c?0:c>>16)+(xa(this,e)>>>16)+(xa(a,e)>>>16);d=h>>>16;f&=65535;h&=65535;b[e]=h<<16|f}return new ka(b,b[b.length-1]&-2147483648?-1:0)}; 21 | g.multiply=function(a){if(ya(this)||ya(a))return pa;if(-1==this.R)return-1==a.R?qa(this).multiply(qa(a)):qa(qa(this).multiply(a));if(-1==a.R)return qa(this.multiply(qa(a)));if(0>this.compare(ta)&&0>a.compare(ta))return oa(wa(this)*wa(a));for(var c=this.M.length+a.M.length,b=[],d=0;d<2*c;d++)b[d]=0;for(d=0;d>>16,h=xa(this,d)&65535,l=xa(a,e)>>>16,m=xa(a,e)&65535;b[2*d+2*e]+=h*m;Ba(b,2*d+2*e);b[2*d+2*e+1]+=f*m;Ba(b,2*d+2*e+1);b[2*d+2* 22 | e+1]+=h*l;Ba(b,2*d+2*e+1);b[2*d+2*e+2]+=f*l;Ba(b,2*d+2*e+2)}for(d=0;d>>16,a[c]&=65535,c++} 23 | function Aa(a,c){if(ya(c))throw Error("division by zero");if(ya(a))return pa;if(-1==a.R)return-1==c.R?Aa(qa(a),qa(c)):qa(Aa(qa(a),c));if(-1==c.R)return qa(Aa(a,qa(c)));if(30=c.compare(a);)b=b.shiftLeft(1),c=c.shiftLeft(1);var d=Da(b,1),e=Da(c,1);c=Da(c,2);for(b=Da(b,2);!ya(c);){var f=e.add(c);0>=f.compare(a)&&(d=d.add(b),e=f);c=Da(c,1);b=Da(b,1)}return d}for(b=pa;0<=a.compare(c);){d=Math.max(1, 24 | Math.floor(wa(a)/wa(c)));e=Math.ceil(Math.log(d)/Math.LN2);e=48>=e?1:Math.pow(2,e-48);f=oa(d);for(var h=f.multiply(c);-1==h.R||0>5;a%=32;for(var b=this.M.length+c+(0>>32-a:xa(this,e-c);return new ka(d,this.R)};function Da(a,c){var b=c>>5;c%=32;for(var d=a.M.length-b,e=[],f=0;f>>c|xa(a,f+b+1)<<32-c:xa(a,f+b);return new ka(e,a.R)};function Ea(a,c){null!=a&&this.append.apply(this,arguments)}g=Ea.prototype;g.Ta="";g.set=function(a){this.Ta=""+a};g.append=function(a,c,b){this.Ta+=String(a);if(null!=c)for(var d=1;d>>16&65535)*d+b*(c>>>16&65535)<<16>>>0)|0};function gc(a){a=fc(a|0,-862048943);return fc(a<<15|a>>>-15,461845907)} 51 | function hc(a,c){a=(a|0)^(c|0);return fc(a<<13|a>>>-13,5)+-430675100|0}function ic(a,c){a=(a|0)^c;a=fc(a^a>>>16,-2048144789);a=fc(a^a>>>13,-1028477387);return a^a>>>16}function jc(a){a:{var c=1;for(var b=0;;)if(c>2)} 54 | function qc(a,c,b,d,e){this.mb=a;this.name=c;this.Sa=b;this.Ya=d;this.fa=e;this.m=2154168321;this.A=4096}g=qc.prototype;g.toString=function(){return this.Sa};g.equiv=function(a){return this.C(null,a)};g.C=function(a,c){return c instanceof qc?this.Sa===c.Sa:!1}; 55 | g.call=function(){var a=null;a=function(a,b,d){switch(arguments.length){case 2:return F.c(b,this);case 3:return F.j(b,this,d)}throw Error("Invalid arity: "+(arguments.length-1));};a.c=function(a,b){return F.c(b,this)};a.j=function(a,b,d){return F.j(b,this,d)};return a}();g.apply=function(a,c){return this.call.apply(this,[this].concat(bb(c)))};g.b=function(a){return F.c(a,this)};g.c=function(a,c){return F.j(a,this,c)};g.O=function(){return this.fa}; 56 | g.T=function(a,c){return new qc(this.mb,this.name,this.Sa,this.Ya,c)};g.U=function(){var a=this.Ya;return null!=a?a:this.Ya=a=pc(jc(this.name),nc(this.mb))};g.S=function(a,c){return E(c,this.Sa)};function rc(a){return null!=a?a.A&131072||n===a.yc?!0:a.A?!1:u(bc,a):u(bc,a)} 57 | function J(a){if(null==a)return null;if(null!=a&&(a.m&8388608||n===a.gc))return a.P(null);if(Ya(a)||"string"===typeof a)return 0===a.length?null:new K(a,0,null);if(u(Hb,a))return Ib(a);throw Error([y.b(a)," is not ISeqable"].join(""));}function L(a){if(null==a)return null;if(null!=a&&(a.m&64||n===a.qa))return a.ia(null);a=J(a);return null==a?null:D(a)}function sc(a){return null!=a?null!=a&&(a.m&64||n===a.qa)?a.ja(null):(a=J(a))?a.ja(null):tc:tc} 58 | function M(a){return null==a?null:null!=a&&(a.m&128||n===a.qb)?a.ha():J(sc(a))}var N=function N(a){switch(arguments.length){case 1:return N.b(arguments[0]);case 2:return N.c(arguments[0],arguments[1]);default:for(var b=[],d=arguments.length,e=0;;)if(e=d)return-1;!(0b&&(b+=d,b=0>b?0:b);for(;;)if(bb?d+b:b;for(;;)if(0<=b){if(N.c(Jc(a,b),c))return b;--b}else return-1}function Kc(a,c){this.f=a;this.s=c}Kc.prototype.ka=function(){return this.sa?0:a};g.U=function(){return xc(this)};g.C=function(a,c){return Lc(this,c)};g.ga=function(){return tc};g.ca=function(a,c){return Gc(this.f,c,this.f[this.s],this.s+1)};g.da=function(a,c,b){return Gc(this.f,c,b,this.s)};g.ia=function(){return this.f[this.s]};g.ja=function(){return this.s+1c)throw Error("Index out of bounds");a:for(;;){if(null==a)throw Error("Index out of bounds"); 72 | if(0===c){if(J(a)){a=L(a);break a}throw Error("Index out of bounds");}if(Ic(a)){a=z.c(a,c);break a}if(J(a))a=M(a),--c;else throw Error("Index out of bounds");}return a}if(u(jb,a))return z.c(a,c);throw Error(["nth not supported on this type ",y.b($a(null==a?null:a.constructor))].join(""));} 73 | function Rc(a,c){if("number"!==typeof c)throw Error("Index argument to nth must be a number.");if(null==a)return null;if(null!=a&&(a.m&16||n===a.Ib))return a.aa(null,c,null);if(Ya(a))return 0<=c&&cc?null:Qc(a,c);if(u(jb,a))return z.j(a,c,null);throw Error(["nth not supported on this type ",y.b($a(null==a?null:a.constructor))].join(""));} 74 | var F=function F(a){switch(arguments.length){case 2:return F.c(arguments[0],arguments[1]);case 3:return F.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",y.b(arguments.length)].join(""));}};F.c=function(a,c){return null==a?null:null!=a&&(a.m&256||n===a.$b)?a.V(null,c):Ya(a)?null!=c&&c>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24}var y=function y(a){switch(arguments.length){case 0:return y.u();case 1:return y.b(arguments[0]);default:for(var b=[],d=arguments.length,e=0;;)if(ea?0:a-1>>>5<<5}function ne(a,c,b){for(;;){if(0===c)return b;var d=le(a);d.f[0]=b;b=d;c-=5}}var oe=function oe(a,c,b,d){var f=new ke(b.K,bb(b.f)),h=a.o-1>>>c&31;5===c?f.f[h]=d:(b=b.f[h],null!=b?(c-=5,a=oe.w?oe.w(a,c,b,d):oe.call(null,a,c,b,d)):a=ne(null,c-5,d),f.f[h]=a);return f}; 165 | function pe(a,c){throw Error(["No item ",y.b(a)," in vector of length ",y.b(c)].join(""));}function qe(a,c){if(c>=me(a))return a.J;var b=a.root;for(a=a.shift;;)if(0>>a&31];a=d}else return b.f}var re=function re(a,c,b,d,e){var h=new ke(b.K,bb(b.f));if(0===c)h.f[d&31]=e;else{var l=d>>>c&31;c-=5;b=b.f[l];a=re.W?re.W(a,c,b,d,e):re.call(null,a,c,b,d,e);h.f[l]=a}return h};function se(a,c,b){this.vb=this.s=0;this.f=a;this.rc=c;this.start=0;this.end=b} 166 | se.prototype.ka=function(){return this.s=this.o)a=new K(this.J,0,null);else{a:{a=this.root;for(var c=this.shift;;)if(0this.o-me(this)){a=this.J.length;for(var b=Array(a+1),d=0;;)if(d>>5>1<c)a=new W(null,c,5,Y,a,null);else for(var b=32,d=(new W(null,32,5,Y,a.slice(0,32),null)).bb(null);;)if(b>>c&31;if(5===c)a=d;else{var h=b.f[f];null!=h?(c-=5,a=Ae.w?Ae.w(a,c,h,d):Ae.call(null,a,c,h,d)):a=ne(a.root.K,c-5,d)}b.f[f]=a;return b};function ve(a,c,b,d){this.o=a;this.shift=c;this.root=b;this.J=d;this.A=88;this.m=275}g=ve.prototype; 184 | g.cb=function(a,c){if(this.root.K){if(32>this.o-me(this))this.J[this.o&31]=c;else{a=new ke(this.root.K,this.J);var b=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];b[0]=c;this.J=b;this.o>>>5>1<>>d&31;d=l(d-5,h.f[f]);h.f[f]=d}return h}}(a)(a.shift,a.root)}();a.root=d}return a}if(c===a.o)return a.cb(null,b);throw Error(["Index ",y.b(c)," out of bounds for TransientVector of length",y.b(a.o)].join(""));}throw Error("assoc! after persistent!");} 188 | g.$=function(){if(this.root.K)return this.o;throw Error("count after persistent!");};g.N=function(a,c){if(this.root.K)return(0<=c&&c=a)return new r(this.v,this.o-1,b,null);N.c(c,this.f[d])?d+=2:(b[e]=this.f[d],b[e+1]=this.f[d+1],e+=2,d+=2)}}else return this}; 207 | g.xa=function(a,c,b){a=Sc(this.f,c);if(-1===a){if(this.oc?4:2*(c+1));dd(this.f,0,b,0,2*c);return new We(a,this.L,b)};g.ib=function(){return Xe(this.f,0,null)};g.kb=function(a,c){return Te(this.f,a,c)};g.Wa=function(a,c,b,d){var e=1<<(c>>>a&31);if(0===(this.L&e))return d;var f=sd(this.L&e-1);e=this.f[2*f];f=this.f[2*f+1];return null==e?f.Wa(a+5,c,b,d):Pe(b,e)?f:d}; 218 | g.sa=function(a,c,b,d,e,f){var h=1<<(b>>>c&31),l=sd(this.L&h-1);if(0===(this.L&h)){var m=sd(this.L);if(2*m>>c&31]=Ye.sa(a,c+5,b,d,e,f);for(e=d=0;;)if(32>d)0=== 219 | (this.L>>>d&1)?d+=1:(l[d]=null!=this.f[e]?Ye.sa(a,c+5,oc(this.f[e]),this.f[e],this.f[e+1],f):this.f[e+1],e+=2,d+=1);else break;return new Ze(a,m+1,l)}c=Array(2*(m+4));dd(this.f,0,c,0,2*l);c[2*l]=d;c[2*l+1]=e;dd(this.f,2*l,c,2*(l+1),2*(m-l));f.I=!0;a=this.Va(a);a.f=c;a.L|=h;return a}m=this.f[2*l];h=this.f[2*l+1];if(null==m)return m=h.sa(a,c+5,b,d,e,f),m===h?this:Se(this,a,2*l+1,m);if(Pe(d,m))return e===h?this:Se(this,a,2*l+1,e);f.I=!0;f=c+5;c=oc(m);if(c===b)e=new $e(null,c,2,[m,h,d,e]);else{var p= 220 | new Oe;e=Ye.sa(a,f,c,m,h,p).sa(a,f,b,d,e,p)}d=2*l;l=2*l+1;a=this.Va(a);a.f[d]=null;a.f[l]=e;return a}; 221 | g.ra=function(a,c,b,d,e){var f=1<<(c>>>a&31),h=sd(this.L&f-1);if(0===(this.L&f)){var l=sd(this.L);if(16<=l){h=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];h[c>>>a&31]=Ye.ra(a+5,c,b,d,e);for(d=b=0;;)if(32>b)0===(this.L>>>b&1)?b+=1:(h[b]=null!=this.f[d]?Ye.ra(a+5,oc(this.f[d]),this.f[d],this.f[d+1],e):this.f[d+1],d+=2,b+=1);else break;return new Ze(null,l+1,h)}a=Array(2*(l+1));dd(this.f, 222 | 0,a,0,2*h);a[2*h]=b;a[2*h+1]=d;dd(this.f,2*h,a,2*(h+1),2*(l-h));e.I=!0;return new We(null,this.L|f,a)}var m=this.f[2*h];f=this.f[2*h+1];if(null==m)return l=f.ra(a+5,c,b,d,e),l===f?this:new We(null,this.L,Qe(this.f,2*h+1,l));if(Pe(b,m))return d===f?this:new We(null,this.L,Qe(this.f,2*h+1,d));e.I=!0;e=this.L;l=this.f;a+=5;var p=oc(m);if(p===c)b=new $e(null,p,2,[m,f,b,d]);else{var q=new Oe;b=Ye.ra(a,p,m,f,q).ra(a,c,b,d,q)}a=2*h;h=2*h+1;d=bb(l);d[a]=null;d[h]=b;return new We(null,e,d)}; 223 | g.jb=function(a,c,b){var d=1<<(c>>>a&31);if(0===(this.L&d))return this;var e=sd(this.L&d-1),f=this.f[2*e],h=this.f[2*e+1];return null==f?(a=h.jb(a+5,c,b),a===h?this:null!=a?new We(null,this.L,Qe(this.f,2*e+1,a)):this.L===d?null:new We(null,this.L^d,Re(this.f,e))):Pe(b,f)?new We(null,this.L^d,Re(this.f,e)):this};g.Ma=function(){return new Ve(this.f)};var Ye=new We(null,0,[]);function af(a){this.f=a;this.s=0;this.ua=null} 224 | af.prototype.ka=function(){for(var a=this.f.length;;){if(null!=this.ua&&this.ua.ka())return!0;if(this.s>>a&31];return null!=e?e.Wa(a+5,c,b,d):d};g.sa=function(a,c,b,d,e,f){var h=b>>>c&31,l=this.f[h];if(null==l)return a=Se(this,a,h,Ye.sa(a,c+5,b,d,e,f)),a.o+=1,a;c=l.sa(a,c+5,b,d,e,f);return c===l?this:Se(this,a,h,c)}; 226 | g.ra=function(a,c,b,d,e){var f=c>>>a&31,h=this.f[f];if(null==h)return new Ze(null,this.o+1,Qe(this.f,f,Ye.ra(a+5,c,b,d,e)));a=h.ra(a+5,c,b,d,e);return a===h?this:new Ze(null,this.o,Qe(this.f,f,a))}; 227 | g.jb=function(a,c,b){var d=c>>>a&31,e=this.f[d];if(null!=e){a=e.jb(a+5,c,b);if(a===e)d=this;else if(null==a)if(8>=this.o)a:{e=this.f;a=e.length;c=Array(2*(this.o-1));b=0;for(var f=1,h=0;;)if(ba?d:Pe(b,this.f[a])?this.f[a+1]:d}; 229 | g.sa=function(a,c,b,d,e,f){if(b===this.Na){c=cf(this.f,this.o,d);if(-1===c){if(this.f.length>2*this.o)return c=2*this.o,b=2*this.o+1,a=this.Va(a),a.f[c]=d,a.f[b]=e,f.I=!0,a.o+=1,a;b=this.f.length;c=Array(b+2);dd(this.f,0,c,0,b);c[b]=d;c[b+1]=e;f.I=!0;d=this.o+1;a===this.K?(this.f=c,this.o=d,a=this):a=new $e(this.K,this.Na,d,c);return a}return this.f[c+1]===e?this:Se(this,a,c+1,e)}return(new We(a,1<<(this.Na>>>c&31),[null,this,null,null])).sa(a,c,b,d,e,f)}; 230 | g.ra=function(a,c,b,d,e){return c===this.Na?(a=cf(this.f,this.o,b),-1===a?(a=2*this.o,c=Array(a+2),dd(this.f,0,c,0,a),c[a]=b,c[a+1]=d,e.I=!0,new $e(null,this.Na,this.o+1,c)):N.c(this.f[a+1],d)?this:new $e(null,this.Na,this.o,Qe(this.f,a+1,d))):(new We(null,1<<(this.Na>>>a&31),[null,this])).ra(a,c,b,d,e)};g.jb=function(a,c,b){a=cf(this.f,this.o,b);return-1===a?this:1===this.o?null:new $e(null,this.Na,this.o-1,Re(this.f,rd(a)))};g.Ma=function(){return new Ve(this.f)}; 231 | function df(a,c,b,d,e){this.v=a;this.va=c;this.s=b;this.H=d;this.B=e;this.m=32374988;this.A=0}g=df.prototype;g.toString=function(){return ec(this)};g.equiv=function(a){return this.C(null,a)};g.indexOf=function(){var a=null;a=function(a,b){switch(arguments.length){case 1:return O(this,a,0);case 2:return O(this,a,b)}throw Error("Invalid arity: "+arguments.length);};a.b=function(a){return O(this,a,0)};a.c=function(a,b){return O(this,a,b)};return a}(); 232 | g.lastIndexOf=function(){function a(a){return R(this,a,P(this))}var c=null;c=function(b,c){switch(arguments.length){case 1:return a.call(this,b);case 2:return R(this,b,c)}throw Error("Invalid arity: "+arguments.length);};c.b=a;c.c=function(a,c){return R(this,a,c)};return c}();g.O=function(){return this.v};g.ha=function(){return null==this.H?Xe(this.va,this.s+2,null):Xe(this.va,this.s,M(this.H))};g.U=function(){var a=this.B;return null!=a?a:this.B=a=xc(this)};g.C=function(a,c){return Lc(this,c)}; 233 | g.ga=function(){return Ab(tc,this.v)};g.ca=function(a,c){return hd(c,this)};g.da=function(a,c,b){return jd(c,b,this)};g.ia=function(){return null==this.H?new Ge(this.va[this.s],this.va[this.s+1]):L(this.H)};g.ja=function(){var a=null==this.H?Xe(this.va,this.s+2,null):Xe(this.va,this.s,M(this.H));return null!=a?a:tc};g.P=function(){return this};g.T=function(a,c){return new df(c,this.va,this.s,this.H,this.B)};g.Y=function(a,c){return S(c,this)};df.prototype[ab]=function(){return vc(this)}; 234 | function Xe(a,c,b){if(null==b)for(b=a.length;;)if(cNa)return E(a,"#");E(a,b);if(0===Wa.b(f))J(h)&&E(a,function(){var a=tf.b(f);return t(a)?a:"..."}());else{if(J(h)){var m=L(h);c.j?c.j(m,a,f):c.call(null,m,a,f)}for(var p=M(h),q=Wa.b(f)-1;;)if(!p||null!=q&&0===q){J(p)&&0===q&&(E(a,d),E(a,function(){var a=tf.b(f);return t(a)?a:"..."}()));break}else{E(a,d);var v=L(p);b=a;h=f;c.j?c.j(v,b,h):c.call(null,v,b,h);var x=M(p);b=q-1;p=x;q=b}}return E(a,e)}finally{Na=l}} 260 | function uf(a,c){c=J(c);for(var b=null,d=0,e=0;;)if(ethis.head?(ok(this.f,this.J,a,0,this.f.length-this.J),ok(this.f,0,a,this.f.length-this.J,this.head),this.J=0,this.head=this.length,this.f=a):this.J===this.head?(this.head=this.J=0,this.f=a):null};function rk(a,c){for(var b=a.length,d=0;;)if(da)){a+=1;continue}break}Ck=!1;return 0a.wa.length))throw Error(["Assert failed: ",y.b(["No more than ",y.b(1024)," pending puts are allowed on a single channel. Consider using a windowed buffer."].join("")), 403 | "\n(\x3c (.-length puts) impl/MAX-QUEUE-SIZE)"].join(""));qk(a.wa,new Lk(b,c))}} 404 | function Qk(a,c){if(null!=a.F&&0a.Xa.length))throw Error(["Assert failed: ",y.b(["No more than ",y.b(1024)," pending takes are allowed on a single channel."].join("")),"\n(\x3c (.-length takes) impl/MAX-QUEUE-SIZE)"].join(""));qk(a.Xa,c)}return null} 407 | Nk.prototype.eb=function(){var a=this;if(!a.closed)for(a.closed=!0,t(function(){var b=a.F;return t(b)?0===a.wa.length:b}())&&(a.na.b?a.na.b(a.F):a.na.call(null,a.F));;){var c=a.Xa.pop();if(null!=c){var b=c.oa,d=t(function(){var b=a.F;return t(b)?0b)return a;a:for(;;){var e=bMath.random()&&15>d)d+=1;else break a;if(d>this.level){for(var e=this.level+1;;)if(e<=d+1)b[e]=this.Ra,e+=1;else break;this.level=d}for(a=bl(a,c,Array(d));;)return 0<=this.level?(b=b[0].forward,a.forward[0]=b[0],b[0]=a):null}; 417 | dl.prototype.remove=function(a){var c=Array(15),b=cl(this.Ra,a,this.level,c);b=0===b.forward.length?null:b.forward[0];if(null!=b&&b.key===a){for(a=0;;)if(a<=this.level){var d=c[a].forward;b===(ad)return b===c.Ra?null:b;var e;a:for(e=b;;){e=d=a)break a}null!=e?(--d,b=e):--d}}dl.prototype.P=function(){return function(a){return function d(b){return new yd(null,function(){return function(){return null==b?null:S(new W(null,2,5,Y,[b.key,b.I],null),d(b.forward[0]))}}(a),null)}}(this)(this.Ra.forward[0])}; 419 | dl.prototype.S=function(a,c,b){return rf(c,function(){return function(a){return rf(c,zf,""," ","",b,a)}}(this),"{",", ","}",b,this)};var fl=new dl;function gl(a){var c=(new Date).valueOf()+a,b=el(c),d=t(t(b)?b.key