Compare commits

..

No commits in common. "master" and "gh-pages" have entirely different histories.

9 changed files with 346 additions and 749 deletions

1
.gitignore vendored
View File

@ -7,6 +7,5 @@ pom.xml.asc
*.class *.class
/.lein-* /.lein-*
/.nrepl-port /.nrepl-port
/resources/public/js
/out /out
/repl /repl

View File

@ -1,86 +0,0 @@
# Gravity Pong
Gravity Pong is the famous [Pong][pong] game with a twist, written in [ClojureScript][cljs] using the
[core.async][coreasync] library. It can be played [here][demo] (only works on Google Chrome for now).
Along with the usual Pong ball and the paddles on both sides of the screen, there is also a mass at
the center of the screen which exerts a gravitational force on the ball causing it to change its path
from a usual straight line to a curve. And the user can control the gravitational force using the
keyboard to shape the ball's path as they want.
## Details for Programmers
It is written in the [Flow-based Programming][fbprog] paradigm where calculations of ball's position,
velocity etc are done by separate modular components running in their own threads of computation
(in this case, core.async go processes). These components are connected using signals (implemented
using core.async channels) to form a network - like an electronic circuit - to build the complete game.
The signals have values which change over time. [`window.requestAnimationFrame`][raf] is used as a
clock to generate the time ticks to run the game.
The very [loose coupling][coupling] (data coupling) caused by the modular design allows one to add
new components in the network without changing other parts of it. In fact, this was first developed
as a usual Pong game and gravitation was added only as an afterthought, with very minimal changes
to the existing code.
Here is how the network of components interconnected with signals looks like:
<pre>
+-d-----------+--------------------------+
v | |
keyboard +-e-> sampler +---k---> paddle-postnr +-d-+ +-> gravitation +--+ |
^ | p a |
t | | | |
| | | | |
+-------+ +-p----------+-|---+ | d
| | +-a-------|-|------+---------------+ |
| v v | | | v
browser +-b--> ticker +-+--t--> ball-postnr +-p-+-|------|------------p-> renderer
^ | ^ | | | ^ ^
| | +-----|---------+ | | | |
s | | l +--d--+ | s t
| | | +-+-----|-------+ | | |
| | p l +-a-|-------|----+ | |
| | v v v v +-l--+ | |
| +---t-> collision-detr | |
| | ^ +-s--+-----------------------+ |
| | s | |
+-----|-------------+-------------+ |
| |
+------------------------------------------------------+
</pre>
Signals
- *b*: ticks from browser
- *t*: game ticks
- *e*: keyboard events
- *k*: keydowns
- *p*: ball position
- *l*: ball velocity
- *a*: ball acceleration
- *d*: paddle positions
- *s*: game state
Components
- *keyboard*: keyboard for user input
- *browser*: browser as the primary source of ticks
- *ticker*: generates game ticks from browser ticks
- *sampler*: samples input signal based on a sampling signal
- *paddle-postnr*: paddle positioner, calculates the position of paddles
- *ball-postnr*: ball positioner, calculates the position of the ball
- *collision-detr*: collision detector, detects collision of the ball with the paddles and the
walls, also calculates the velocity of the ball
- *gravitation*: calculates the acceleration of the ball due to gravitation
- *renderer*: renders the game on screen
This project has been written as an experiment to play with the core.async library and can serve as
a medium sized example project for the same. The main source can be found [here][src].
[pong]: https://en.wikipedia.org/wiki/Pong
[cljs]: https://github.com/clojure/clojurescript
[coreasync]: https://github.com/clojure/core.async
[demo]: http://abhinavsarkar.net/frpong
[fbprog]: https://en.wikipedia.org/wiki/Flow-based_programming
[coupling]: https://en.wikipedia.org/wiki/Coupling_(computer_programming)
[src]: https://github.com/abhin4v/frpong/blob/master/src/cljs/frpong/core.cljs
[raf]: https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame

346
js/frpong.js Normal file
View File

@ -0,0 +1,346 @@
function e(a){throw a;}var h=void 0,m=!0,n=null,r=!1;function aa(){return function(a){return a}}function s(a){return function(){return this[a]}}function ba(a){return function(){return a}}var v,ca=this;function da(a,b){var c=a.split("."),d=ca;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&b!==h?d[f]=b:d=d[f]?d[f]:d[f]={}}function ea(a){for(var a=a.split("."),b=ca,c;c=a.shift();)if(b[c]!=n)b=b[c];else return n;return b}function fa(){}
function w(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ga(a){return"array"==w(a)}function ha(a){var b=w(a);return"array"==b||"object"==b&&"number"==typeof a.length}function y(a){return"string"==typeof a}function ja(a){return"function"==w(a)}function ka(a){var b=typeof a;return"object"==b&&a!=n||"function"==b}function la(a){return a[ma]||(a[ma]=++na)}var ma="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),na=0;
function oa(a,b,c){return a.call.apply(a.bind,arguments)}function pa(a,b,c){a||e(Error());if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function qa(a,b,c){qa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?oa:pa;return qa.apply(n,arguments)}
function ra(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}}var sa=Date.now||function(){return+new Date};function ta(a,b){function c(){}c.prototype=b.prototype;a.na=b.prototype;a.prototype=new c;a.prototype.constructor=a};function ua(a){Error.captureStackTrace?Error.captureStackTrace(this,ua):this.stack=Error().stack||"";a&&(this.message=String(a))}ta(ua,Error);ua.prototype.name="CustomError";function wa(a,b){for(var c=1;c<arguments.length;c++)var d=String(arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function xa(a){if(!za.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(Aa,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(Ba,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(Ca,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(Da,"&quot;"));return a}var Aa=/&/g,Ba=/</g,Ca=/>/g,Da=/\"/g,za=/[&<>\"]/;
function Ea(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=4294967296;return b};function Ga(a,b){b.unshift(a);ua.call(this,wa.apply(n,b));b.shift();this.Ag=a}ta(Ga,ua);Ga.prototype.name="AssertionError";function Ha(a,b){e(new Ga("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1)))};var Ia=Array.prototype,Ja=Ia.indexOf?function(a,b,c){return Ia.indexOf.call(a,b,c)}:function(a,b,c){c=c==n?0:0>c?Math.max(0,a.length+c):c;if(y(a))return!y(b)||1!=b.length?-1:a.indexOf(b,c);for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Ka=Ia.forEach?function(a,b,c){Ia.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,f=y(a)?a.split(""):a,g=0;g<d;g++)g in f&&b.call(c,f[g],g,a)},La=Ia.filter?function(a,b,c){return Ia.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,f=[],g=0,
i=y(a)?a.split(""):a,k=0;k<d;k++)if(k in i){var l=i[k];b.call(c,l,k,a)&&(f[g++]=l)}return f},Ma=Ia.some?function(a,b,c){return Ia.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,f=y(a)?a.split(""):a,g=0;g<d;g++)if(g in f&&b.call(c,f[g],g,a))return m;return r};function Na(a,b){var c=Ja(a,b);0<=c&&Ia.splice.call(a,c,1)}function Oa(a){return Ia.concat.apply(Ia,arguments)}function Pa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};function Qa(a,b){for(var c in a)b.call(h,a[c],c,a)}function Ra(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Sa(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}var Ta="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ua(a,b){for(var c,d,f=1;f<arguments.length;f++){d=arguments[f];for(c in d)a[c]=d[c];for(var g=0;g<Ta.length;g++)c=Ta[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function Va(a,b){var c=Array.prototype.slice.call(arguments),d=c.shift();"undefined"==typeof d&&e(Error("[goog.string.format] Template required"));return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,k,l,q,p,u){if("%"==q)return"%";var t=c.shift();"undefined"==typeof t&&e(Error("[goog.string.format] Not enough arguments"));arguments[0]=t;return Va.Ja[q].apply(n,arguments)})}Va.Ja={};
Va.Ja.s=function(a,b,c){return isNaN(c)||""==c||a.length>=c?a:a=-1<b.indexOf("-",0)?a+Array(c-a.length+1).join(" "):Array(c-a.length+1).join(" ")+a};
Va.Ja.f=function(a,b,c,d,f){d=a.toString();isNaN(f)||""==f||(d=a.toFixed(f));var g;g=0>a?"-":0<=b.indexOf("+")?"+":0<=b.indexOf(" ")?" ":"";0<=a&&(d=g+d);if(isNaN(c)||d.length>=c)return d;d=isNaN(f)?Math.abs(a).toString():Math.abs(a).toFixed(f);a=c-d.length-g.length;return d=0<=b.indexOf("-",0)?g+d+Array(a+1).join(" "):g+Array(a+1).join(0<=b.indexOf("0",0)?"0":" ")+d};Va.Ja.d=function(a,b,c,d,f,g,i,k){return Va.Ja.f(parseInt(a,10),b,c,d,0,g,i,k)};Va.Ja.i=Va.Ja.d;Va.Ja.u=Va.Ja.d;function Wa(a,b){a!=n&&this.append.apply(this,arguments)}Wa.prototype.qb="";Wa.prototype.set=function(a){this.qb=""+a};Wa.prototype.append=function(a,b,c){this.qb+=a;if(b!=n)for(var d=1;d<arguments.length;d++)this.qb+=arguments[d];return this};Wa.prototype.toString=s("qb");var Xa;da("cljs.core.set_print_fn_BANG_",aa());function Ya(){return Za(["\ufdd0:flush-on-newline",m,"\ufdd0:readably",m,"\ufdd0:meta",r,"\ufdd0:dup",r],m)}function z(a){return a!=n&&a!==r}function ab(a){return z(a)?r:m}function bb(a){var b=y(a);return b?"\ufdd0"!==a.charAt(0):b}function A(a,b){return a[w(b==n?n:b)]?m:a._?m:r}function B(a,b){var c=b==n?n:b.constructor,c=z(z(c)?c.za:c)?c.Ga:w(b);return Error(["No protocol method ",a," defined for type ",c,": ",b].join(""))}
function cb(a){return Array.prototype.slice.call(arguments)}var db={},eb={};function fb(a){if(a?a.K:a)return a.K(a);var b;var c=fb[w(a==n?n:a)];c?b=c:(c=fb._)?b=c:e(B("ICounted.-count",a));return b.call(n,a)}function gb(a){if(a?a.W:a)return a.W(a);var b;var c=gb[w(a==n?n:a)];c?b=c:(c=gb._)?b=c:e(B("IEmptyableCollection.-empty",a));return b.call(n,a)}var hb={};
function ib(a,b){if(a?a.S:a)return a.S(a,b);var c;var d=ib[w(a==n?n:a)];d?c=d:(d=ib._)?c=d:e(B("ICollection.-conj",a));return c.call(n,a,b)}var jb={},C,kb=n;function lb(a,b){if(a?a.A:a)return a.A(a,b);var c;var d=C[w(a==n?n:a)];d?c=d:(d=C._)?c=d:e(B("IIndexed.-nth",a));return c.call(n,a,b)}function mb(a,b,c){if(a?a.X:a)return a.X(a,b,c);var d;var f=C[w(a==n?n:a)];f?d=f:(f=C._)?d=f:e(B("IIndexed.-nth",a));return d.call(n,a,b,c)}
kb=function(a,b,c){switch(arguments.length){case 2:return lb.call(this,a,b);case 3:return mb.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};kb.b=lb;kb.c=mb;C=kb;var nb={};function ob(a){if(a?a.$:a)return a.$(a);var b;var c=ob[w(a==n?n:a)];c?b=c:(c=ob._)?b=c:e(B("ISeq.-first",a));return b.call(n,a)}function pb(a){if(a?a.ca:a)return a.ca(a);var b;var c=pb[w(a==n?n:a)];c?b=c:(c=pb._)?b=c:e(B("ISeq.-rest",a));return b.call(n,a)}var qb={},rb={},sb,tb=n;
function ub(a,b){if(a?a.V:a)return a.V(a,b);var c;var d=sb[w(a==n?n:a)];d?c=d:(d=sb._)?c=d:e(B("ILookup.-lookup",a));return c.call(n,a,b)}function vb(a,b,c){if(a?a.L:a)return a.L(a,b,c);var d;var f=sb[w(a==n?n:a)];f?d=f:(f=sb._)?d=f:e(B("ILookup.-lookup",a));return d.call(n,a,b,c)}tb=function(a,b,c){switch(arguments.length){case 2:return ub.call(this,a,b);case 3:return vb.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};tb.b=ub;tb.c=vb;sb=tb;
function wb(a,b){if(a?a.Tc:a)return a.Tc(a,b);var c;var d=wb[w(a==n?n:a)];d?c=d:(d=wb._)?c=d:e(B("IAssociative.-contains-key?",a));return c.call(n,a,b)}function xb(a,b,c){if(a?a.Ea:a)return a.Ea(a,b,c);var d;var f=xb[w(a==n?n:a)];f?d=f:(f=xb._)?d=f:e(B("IAssociative.-assoc",a));return d.call(n,a,b,c)}var yb={};function zb(a,b){if(a?a.jd:a)return a.jd(a,b);var c;var d=zb[w(a==n?n:a)];d?c=d:(d=zb._)?c=d:e(B("IMap.-dissoc",a));return c.call(n,a,b)}var Ab={};
function Bb(a){if(a?a.kd:a)return a.kd(a);var b;var c=Bb[w(a==n?n:a)];c?b=c:(c=Bb._)?b=c:e(B("IMapEntry.-key",a));return b.call(n,a)}function Cb(a){if(a?a.de:a)return a.de(a);var b;var c=Cb[w(a==n?n:a)];c?b=c:(c=Cb._)?b=c:e(B("IMapEntry.-val",a));return b.call(n,a)}var Db={};function Eb(a,b){if(a?a.fe:a)return a.fe(0,b);var c;var d=Eb[w(a==n?n:a)];d?c=d:(d=Eb._)?c=d:e(B("ISet.-disjoin",a));return c.call(n,a,b)}var Fb={};
function Gb(a,b,c){if(a?a.md:a)return a.md(a,b,c);var d;var f=Gb[w(a==n?n:a)];f?d=f:(f=Gb._)?d=f:e(B("IVector.-assoc-n",a));return d.call(n,a,b,c)}function Hb(a){if(a?a.Vc:a)return a.Vc(a);var b;var c=Hb[w(a==n?n:a)];c?b=c:(c=Hb._)?b=c:e(B("IDeref.-deref",a));return b.call(n,a)}var Ib={};function Jb(a){if(a?a.F:a)return a.F(a);var b;var c=Jb[w(a==n?n:a)];c?b=c:(c=Jb._)?b=c:e(B("IMeta.-meta",a));return b.call(n,a)}var Kb={};
function Lb(a,b){if(a?a.G:a)return a.G(a,b);var c;var d=Lb[w(a==n?n:a)];d?c=d:(d=Lb._)?c=d:e(B("IWithMeta.-with-meta",a));return c.call(n,a,b)}var Mb={},Nb,Ob=n;function Pb(a,b){if(a?a.Va:a)return a.Va(a,b);var c;var d=Nb[w(a==n?n:a)];d?c=d:(d=Nb._)?c=d:e(B("IReduce.-reduce",a));return c.call(n,a,b)}function Qb(a,b,c){if(a?a.Wa:a)return a.Wa(a,b,c);var d;var f=Nb[w(a==n?n:a)];f?d=f:(f=Nb._)?d=f:e(B("IReduce.-reduce",a));return d.call(n,a,b,c)}
Ob=function(a,b,c){switch(arguments.length){case 2:return Pb.call(this,a,b);case 3:return Qb.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Ob.b=Pb;Ob.c=Qb;Nb=Ob;function Rb(a,b){if(a?a.P:a)return a.P(a,b);var c;var d=Rb[w(a==n?n:a)];d?c=d:(d=Rb._)?c=d:e(B("IEquiv.-equiv",a));return c.call(n,a,b)}function Sb(a){if(a?a.U:a)return a.U(a);var b;var c=Sb[w(a==n?n:a)];c?b=c:(c=Sb._)?b=c:e(B("IHash.-hash",a));return b.call(n,a)}var Ub={};
function Vb(a){if(a?a.N:a)return a.N(a);var b;var c=Vb[w(a==n?n:a)];c?b=c:(c=Vb._)?b=c:e(B("ISeqable.-seq",a));return b.call(n,a)}var Wb={};function D(a,b){if(a?a.he:a)return a.he(0,b);var c;var d=D[w(a==n?n:a)];d?c=d:(d=D._)?c=d:e(B("IWriter.-write",a));return c.call(n,a,b)}function Xb(a){if(a?a.sf:a)return n;var b;var c=Xb[w(a==n?n:a)];c?b=c:(c=Xb._)?b=c:e(B("IWriter.-flush",a));return b.call(n,a)}var Yb={};
function Zb(a,b,c){if(a?a.M:a)return a.M(a,b,c);var d;var f=Zb[w(a==n?n:a)];f?d=f:(f=Zb._)?d=f:e(B("IPrintWithWriter.-pr-writer",a));return d.call(n,a,b,c)}function $b(a,b,c){if(a?a.ge:a)return a.ge(a,b,c);var d;var f=$b[w(a==n?n:a)];f?d=f:(f=$b._)?d=f:e(B("IWatchable.-notify-watches",a));return d.call(n,a,b,c)}function ac(a){if(a?a.Kb:a)return a.Kb(a);var b;var c=ac[w(a==n?n:a)];c?b=c:(c=ac._)?b=c:e(B("IEditableCollection.-as-transient",a));return b.call(n,a)}
function bc(a,b){if(a?a.gb:a)return a.gb(a,b);var c;var d=bc[w(a==n?n:a)];d?c=d:(d=bc._)?c=d:e(B("ITransientCollection.-conj!",a));return c.call(n,a,b)}function cc(a){if(a?a.tb:a)return a.tb(a);var b;var c=cc[w(a==n?n:a)];c?b=c:(c=cc._)?b=c:e(B("ITransientCollection.-persistent!",a));return b.call(n,a)}function dc(a,b,c){if(a?a.sb:a)return a.sb(a,b,c);var d;var f=dc[w(a==n?n:a)];f?d=f:(f=dc._)?d=f:e(B("ITransientAssociative.-assoc!",a));return d.call(n,a,b,c)}
function ec(a){if(a?a.$d:a)return a.$d();var b;var c=ec[w(a==n?n:a)];c?b=c:(c=ec._)?b=c:e(B("IChunk.-drop-first",a));return b.call(n,a)}function fc(a){if(a?a.Uc:a)return a.Uc(a);var b;var c=fc[w(a==n?n:a)];c?b=c:(c=fc._)?b=c:e(B("IChunkedSeq.-chunked-first",a));return b.call(n,a)}function gc(a){if(a?a.lc:a)return a.lc(a);var b;var c=gc[w(a==n?n:a)];c?b=c:(c=gc._)?b=c:e(B("IChunkedSeq.-chunked-rest",a));return b.call(n,a)}function hc(a){this.Zf=a;this.t=0;this.j=1073741824}
hc.prototype.he=function(a,b){return this.Zf.append(b)};hc.prototype.sf=ba(n);function ic(a){var b=new Wa,c=new hc(b);a.M(a,c,Ya());Xb(c);return""+E(b)}function F(a,b,c,d,f){this.Db=a;this.name=b;this.nb=c;this.hc=d;this.oa=f;this.j=2154168321;this.t=4096}F.prototype.M=function(a,b){return D(b,this.nb)};
F.prototype.U=function(){-1===this.hc&&(this.hc=jc.b?jc.b(G.a?G.a(this.Db):G.call(n,this.Db),G.a?G.a(this.name):G.call(n,this.name)):jc.call(n,G.a?G.a(this.Db):G.call(n,this.Db),G.a?G.a(this.name):G.call(n,this.name)));return this.hc};F.prototype.G=function(a,b){return new F(this.Db,this.name,this.nb,this.hc,b)};F.prototype.F=s("oa");var kc=n,kc=function(a,b,c){switch(arguments.length){case 2:return sb.c(b,this,n);case 3:return sb.c(b,this,c)}e(Error("Invalid arity: "+arguments.length))};
F.prototype.call=kc;F.prototype.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};F.prototype.P=function(a,b){return b instanceof F?this.nb===b.nb:r};F.prototype.toString=s("nb");function I(a){if(a==n)return n;var b;if(b=a)b=(b=a.j&8388608)?b:a.nc;if(b)return a.N(a);if(a instanceof Array||bb(a))return 0===a.length?n:new lc(a,0);if(A(rb,a))return Vb(a);e(Error([E(a),E("is not ISeqable")].join("")))}
function J(a){if(a==n)return n;var b;if(b=a)b=(b=a.j&64)?b:a.ld;if(b)return a.$(a);a=I(a);return a==n?n:ob(a)}function K(a){if(a!=n){var b;if(b=a)b=(b=a.j&64)?b:a.ld;if(b)return a.ca(a);a=I(a);return a!=n?pb(a):mc}return mc}function L(a){if(a==n)a=n;else{var b;if(b=a)b=(b=a.j&128)?b:a.ee;a=b?a.ha(a):I(K(a))}return a}var M,nc=n;function oc(a,b){var c=a===b;return c?c:Rb(a,b)}function pc(a,b,c){for(;;)if(z(nc.b(a,b)))if(L(c))a=b,b=J(c),c=L(c);else return nc.b(b,J(c));else return r}
function qc(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return pc.call(this,a,b,d)}qc.r=2;qc.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return pc(b,c,a)};qc.g=pc;nc=function(a,b,c){switch(arguments.length){case 1:return m;case 2:return oc.call(this,a,b);default:return qc.g(a,b,N(arguments,2))}e(Error("Invalid arity: "+arguments.length))};nc.r=2;nc.l=qc.l;nc.a=ba(m);nc.b=oc;nc.g=qc.g;M=nc;Sb["null"]=ba(0);qb["null"]=m;Db["null"]=m;Eb["null"]=ba(n);
eb["null"]=m;fb["null"]=ba(0);Rb["null"]=function(a,b){return b==n};Kb["null"]=m;Lb["null"]=ba(n);Ib["null"]=m;Jb["null"]=ba(n);gb["null"]=ba(n);yb["null"]=m;zb["null"]=ba(n);Date.prototype.P=function(a,b){var c=b instanceof Date;return c?a.toString()===b.toString():c};Sb.number=function(a){return Math.floor(a)%2147483647};Rb.number=function(a,b){return a===b};Sb["boolean"]=function(a){return a===m?1:0};Ib["function"]=m;Jb["function"]=ba(n);db["function"]=m;Sb._=function(a){return la(a)};
var rc,sc=n;function tc(a,b){var c=fb(a);if(0===c)return b.h?b.h():b.call(n);for(var d=C.b(a,0),f=1;;)if(f<c)d=b.b?b.b(d,C.b(a,f)):b.call(n,d,C.b(a,f)),f+=1;else return d}function uc(a,b,c){for(var d=fb(a),f=0;;)if(f<d)c=b.b?b.b(c,C.b(a,f)):b.call(n,c,C.b(a,f)),f+=1;else return c}function vc(a,b,c,d){for(var f=fb(a);;)if(d<f)c=b.b?b.b(c,C.b(a,d)):b.call(n,c,C.b(a,d)),d+=1;else return c}
sc=function(a,b,c,d){switch(arguments.length){case 2:return tc.call(this,a,b);case 3:return uc.call(this,a,b,c);case 4:return vc.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};sc.b=tc;sc.c=uc;sc.n=vc;rc=sc;var wc,xc=n;function yc(a,b){var c=a.length;if(0===a.length)return b.h?b.h():b.call(n);for(var d=a[0],f=1;;)if(f<c)d=b.b?b.b(d,a[f]):b.call(n,d,a[f]),f+=1;else return d}function zc(a,b,c){for(var d=a.length,f=0;;)if(f<d)c=b.b?b.b(c,a[f]):b.call(n,c,a[f]),f+=1;else return c}
function Ac(a,b,c,d){for(var f=a.length;;)if(d<f)c=b.b?b.b(c,a[d]):b.call(n,c,a[d]),d+=1;else return c}xc=function(a,b,c,d){switch(arguments.length){case 2:return yc.call(this,a,b);case 3:return zc.call(this,a,b,c);case 4:return Ac.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};xc.b=yc;xc.c=zc;xc.n=Ac;wc=xc;function Bc(a){if(a)var b=a.j&2,a=(b?b:a.mc)?m:a.j?r:A(eb,a);else a=A(eb,a);return a}function Cc(a){if(a)var b=a.j&16,a=(b?b:a.Mb)?m:a.j?r:A(jb,a);else a=A(jb,a);return a}
function lc(a,b){this.e=a;this.p=b;this.t=0;this.j=166199550}v=lc.prototype;v.U=function(a){return Dc.a?Dc.a(a):Dc.call(n,a)};v.ha=function(){return this.p+1<this.e.length?new lc(this.e,this.p+1):n};v.S=function(a,b){return O.b?O.b(b,a):O.call(n,b,a)};v.toString=function(){return ic(this)};v.Va=function(a,b){return wc.n(this.e,b,this.e[this.p],this.p+1)};v.Wa=function(a,b,c){return wc.n(this.e,b,c,this.p)};v.N=aa();v.K=function(){return this.e.length-this.p};v.$=function(){return this.e[this.p]};
v.ca=function(){return this.p+1<this.e.length?new lc(this.e,this.p+1):Ec.h?Ec.h():Ec.call(n)};v.P=function(a,b){return Fc.b?Fc.b(a,b):Fc.call(n,a,b)};v.A=function(a,b){var c=b+this.p;return c<this.e.length?this.e[c]:n};v.X=function(a,b,c){a=b+this.p;return a<this.e.length?this.e[a]:c};v.W=function(){return mc};var Gc,Hc=n;function Ic(a){return Hc.b(a,0)}function Jc(a,b){return b<a.length?new lc(a,b):n}
Hc=function(a,b){switch(arguments.length){case 1:return Ic.call(this,a);case 2:return Jc.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};Hc.a=Ic;Hc.b=Jc;Gc=Hc;var N,Kc=n;function Lc(a){return Gc.b(a,0)}function Mc(a,b){return Gc.b(a,b)}Kc=function(a,b){switch(arguments.length){case 1:return Lc.call(this,a);case 2:return Mc.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};Kc.a=Lc;Kc.b=Mc;N=Kc;Mb.array=m;Nb.array=function(a,b){return wc.b(a,b)};
Nb.array=function(a,b,c){return wc.c(a,b,c)};function Nc(a){return J(L(a))}Rb._=function(a,b){return a===b};var Oc,Pc=n;function Qc(a,b){return a!=n?ib(a,b):Ec.a?Ec.a(b):Ec.call(n,b)}function Rc(a,b,c){for(;;)if(z(c))a=Pc.b(a,b),b=J(c),c=L(c);else return Pc.b(a,b)}function Sc(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return Rc.call(this,a,b,d)}Sc.r=2;Sc.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return Rc(b,c,a)};Sc.g=Rc;
Pc=function(a,b,c){switch(arguments.length){case 2:return Qc.call(this,a,b);default:return Sc.g(a,b,N(arguments,2))}e(Error("Invalid arity: "+arguments.length))};Pc.r=2;Pc.l=Sc.l;Pc.b=Qc;Pc.g=Sc.g;Oc=Pc;function P(a){if(a!=n){var b;if(b=a)b=(b=a.j&2)?b:a.mc;if(b)a=a.K(a);else if(a instanceof Array)a=a.length;else if(bb(a))a=a.length;else if(A(eb,a))a=fb(a);else a:{a=I(a);for(b=0;;){if(Bc(a)){a=b+fb(a);break a}a=L(a);b+=1}a=h}}else a=0;return a}var Vc,Wc=n;
function Xc(a,b){for(;;){a==n&&e(Error("Index out of bounds"));if(0===b){if(I(a))return J(a);e(Error("Index out of bounds"))}if(Cc(a))return C.b(a,b);if(I(a))var c=L(a),d=b-1,a=c,b=d;else e(Error("Index out of bounds"))}}function Yc(a,b,c){for(;;){if(a==n)return c;if(0===b)return I(a)?J(a):c;if(Cc(a))return C.c(a,b,c);if(I(a))a=L(a),b-=1;else return c}}Wc=function(a,b,c){switch(arguments.length){case 2:return Xc.call(this,a,b);case 3:return Yc.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};
Wc.b=Xc;Wc.c=Yc;Vc=Wc;var R,Zc=n;function $c(a,b){var c;if(a==n)c=n;else{if(c=a)c=(c=a.j&16)?c:a.Mb;c=c?a.A(a,Math.floor(b)):a instanceof Array?b<a.length?a[b]:n:bb(a)?b<a.length?a[b]:n:A(jb,a)?C.b(a,b):Vc.b(a,Math.floor(b))}return c}function ad(a,b,c){if(a!=n){var d;if(d=a)d=(d=a.j&16)?d:a.Mb;a=d?a.X(a,Math.floor(b),c):a instanceof Array?b<a.length?a[b]:c:bb(a)?b<a.length?a[b]:c:A(jb,a)?C.b(a,b):Vc.c(a,Math.floor(b),c)}else a=c;return a}
Zc=function(a,b,c){switch(arguments.length){case 2:return $c.call(this,a,b);case 3:return ad.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Zc.b=$c;Zc.c=ad;R=Zc;var bd,cd=n;function dd(a,b){var c;if(a==n)c=n;else{if(c=a)c=(c=a.j&256)?c:a.hd;c=c?a.V(a,b):a instanceof Array?b<a.length?a[b]:n:bb(a)?b<a.length?a[b]:n:A(rb,a)?sb.b(a,b):n}return c}
function ed(a,b,c){if(a!=n){var d;if(d=a)d=(d=a.j&256)?d:a.hd;a=d?a.L(a,b,c):a instanceof Array?b<a.length?a[b]:c:bb(a)?b<a.length?a[b]:c:A(rb,a)?sb.c(a,b,c):c}else a=c;return a}cd=function(a,b,c){switch(arguments.length){case 2:return dd.call(this,a,b);case 3:return ed.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};cd.b=dd;cd.c=ed;bd=cd;var fd,gd=n;function hd(a,b,c){return a!=n?xb(a,b,c):id.b?id.b(b,c):id.call(n,b,c)}
function jd(a,b,c,d){for(;;)if(a=gd.c(a,b,c),z(d))b=J(d),c=Nc(d),d=L(L(d));else return a}function kd(a,b,c,d){var f=n;3<arguments.length&&(f=N(Array.prototype.slice.call(arguments,3),0));return jd.call(this,a,b,c,f)}kd.r=3;kd.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=K(a);return jd(b,c,d,a)};kd.g=jd;gd=function(a,b,c,d){switch(arguments.length){case 3:return hd.call(this,a,b,c);default:return kd.g(a,b,c,N(arguments,3))}e(Error("Invalid arity: "+arguments.length))};gd.r=3;gd.l=kd.l;
gd.c=hd;gd.g=kd.g;fd=gd;function ld(a){var b=ja(a);return b?b:a?z(z(n)?n:a.mf)?m:a.tf?r:A(db,a):A(db,a)}
var od=function md(b,c){var d;if(d=ld(b))d=b?((d=b.j&262144)?d:b.wg)||(b.j?0:A(Kb,b)):A(Kb,b),d=!d;if(d){if(h===Xa){Xa={};Xa=function(b,c,d,f){this.m=b;this.Bd=c;this.fg=d;this.Lf=f;this.t=0;this.j=393217};Xa.za=m;Xa.Ga="cljs.core/t8080";Xa.Fa=function(b,c){return D(c,"cljs.core/t8080")};var f=function(b,c){return nd.b?nd.b(b.Bd,c):nd.call(n,b.Bd,c)};d=function(b,c){var b=this,d=n;1<arguments.length&&(d=N(Array.prototype.slice.call(arguments,1),0));return f.call(this,b,d)};d.r=1;d.l=function(b){var c=
J(b),b=K(b);return f(c,b)};d.g=f;Xa.prototype.call=d;Xa.prototype.apply=function(b,c){b=this;return b.call.apply(b,[b].concat(c.slice()))};Xa.prototype.mf=m;Xa.prototype.F=s("Lf");Xa.prototype.G=function(b,c){return new Xa(this.m,this.Bd,this.fg,c)}}d=new Xa(c,b,md,n);d=md(d,c)}else d=Lb(b,c);return d};function pd(a){var b;b=a?((b=a.j&131072)?b:a.pf)||(a.j?0:A(Ib,a)):A(Ib,a);return b?Jb(a):n}var qd,rd=n;function sd(a,b,c){for(;;)if(a=rd.b(a,b),z(c))b=J(c),c=L(c);else return a}
function td(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return sd.call(this,a,b,d)}td.r=2;td.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return sd(b,c,a)};td.g=sd;rd=function(a,b,c){switch(arguments.length){case 1:return a;case 2:return Eb(a,b);default:return td.g(a,b,N(arguments,2))}e(Error("Invalid arity: "+arguments.length))};rd.r=2;rd.l=td.l;rd.a=aa();rd.b=function(a,b){return Eb(a,b)};rd.g=td.g;qd=rd;var ud={},vd=0,G,wd=n;
function xd(a){return wd.b(a,m)}function yd(a,b){var c;((c=y(a))?b:c)?(255<vd&&(ud={},vd=0),c=ud[a],"number"!==typeof c&&(c=Ea(a),ud[a]=c,vd+=1)):c=Sb(a);return c}wd=function(a,b){switch(arguments.length){case 1:return xd.call(this,a);case 2:return yd.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};wd.a=xd;wd.b=yd;G=wd;function zd(a){if(a)var b=a.j&16384,a=(b?b:a.vg)?m:a.j?r:A(Fb,a);else a=A(Fb,a);return a}function Ad(a){if(a)var b=a.t&512,a=(b?b:a.pg)?m:r;else a=r;return a}
function Bd(a,b,c,d,f){for(;0!==f;)c[d]=a[b],d+=1,f-=1,b+=1}var Cd={};function Dd(a){if(a==n)a=r;else if(a)var b=a.j&64,a=(b?b:a.ld)?m:a.j?r:A(nb,a);else a=A(nb,a);return a}function Ed(a){var b=y(a);return b?"\ufdd0"===a.charAt(0):b}function Fd(a,b){return bd.c(a,b,Cd)===Cd?r:m}
function Gd(a,b){if(a===b)return 0;if(a==n)return-1;if(b==n)return 1;if((a==n?n:a.constructor)===(b==n?n:b.constructor)){var c;if(c=a)c=(c=a.t&2048)?c:a.be;return c?a.ce(a,b):a>b?1:a<b?-1:0}e(Error("compare on non-nil objects of different types"))}var Hd,Id=n;function Jd(a,b){var c=P(a),d=P(b);return c<d?-1:c>d?1:Id.n(a,b,c,0)}function Kd(a,b,c,d){for(;;){var f=Gd(R.b(a,d),R.b(b,d)),g=0===f;if(g?d+1<c:g)d+=1;else return f}}
Id=function(a,b,c,d){switch(arguments.length){case 2:return Jd.call(this,a,b);case 4:return Kd.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};Id.b=Jd;Id.n=Kd;Hd=Id;var Ld,Md=n;function Nd(a,b){var c=I(b);return c?Od.c?Od.c(a,J(c),L(c)):Od.call(n,a,J(c),L(c)):a.h?a.h():a.call(n)}function Pd(a,b,c){for(c=I(c);;)if(c)b=a.b?a.b(b,J(c)):a.call(n,b,J(c)),c=L(c);else return b}
Md=function(a,b,c){switch(arguments.length){case 2:return Nd.call(this,a,b);case 3:return Pd.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Md.b=Nd;Md.c=Pd;Ld=Md;var Od,Qd=n;function Rd(a,b){var c;if(c=b)c=(c=b.j&524288)?c:b.rf;return c?b.Va(b,a):b instanceof Array?wc.b(b,a):bb(b)?wc.b(b,a):A(Mb,b)?Nb.b(b,a):Ld.b(a,b)}function Sd(a,b,c){var d;if(d=c)d=(d=c.j&524288)?d:c.rf;return d?c.Wa(c,a,b):c instanceof Array?wc.c(c,a,b):bb(c)?wc.c(c,a,b):A(Mb,c)?Nb.c(c,a,b):Ld.c(a,b,c)}
Qd=function(a,b,c){switch(arguments.length){case 2:return Rd.call(this,a,b);case 3:return Sd.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Qd.b=Rd;Qd.c=Sd;Od=Qd;function Td(a){return a-1}function Ud(a){return 0<=a?Math.floor.a?Math.floor.a(a):Math.floor.call(n,a):Math.ceil.a?Math.ceil.a(a):Math.ceil.call(n,a)}function Vd(a){return Ud((a-a%2)/2)}var Wd,Xd=n;function Yd(){return Math.random.h?Math.random.h():Math.random.call(n)}function Zd(a){return a*Xd.h()}
Xd=function(a){switch(arguments.length){case 0:return Yd.call(this);case 1:return Zd.call(this,a)}e(Error("Invalid arity: "+arguments.length))};Xd.h=Yd;Xd.a=Zd;Wd=Xd;function $d(a){return Ud(Wd.a(a))}function ae(a){a-=a>>1&1431655765;a=(a&858993459)+(a>>2&858993459);return 16843009*(a+(a>>4)&252645135)>>24}var be,ce=n;function de(a){return a==n?"":a.toString()}
function ee(a,b){return function(a,b){for(;;)if(z(b))var f=a.append(ce.a(J(b))),g=L(b),a=f,b=g;else return ce.a(a)}.call(n,new Wa(ce.a(a)),b)}function fe(a,b){var c=n;1<arguments.length&&(c=N(Array.prototype.slice.call(arguments,1),0));return ee.call(this,a,c)}fe.r=1;fe.l=function(a){var b=J(a),a=K(a);return ee(b,a)};fe.g=ee;ce=function(a,b){switch(arguments.length){case 0:return"";case 1:return de.call(this,a);default:return fe.g(a,N(arguments,1))}e(Error("Invalid arity: "+arguments.length))};
ce.r=1;ce.l=fe.l;ce.h=ba("");ce.a=de;ce.g=fe.g;be=ce;var E,ge=n;function he(a){return Ed(a)?be.g(":",N([a.substring(2,a.length)],0)):a==n?"":a.toString()}function ie(a,b){return function(a,b){for(;;)if(z(b))var f=a.append(ge.a(J(b))),g=L(b),a=f,b=g;else return be.a(a)}.call(n,new Wa(ge.a(a)),b)}function je(a,b){var c=n;1<arguments.length&&(c=N(Array.prototype.slice.call(arguments,1),0));return ie.call(this,a,c)}je.r=1;je.l=function(a){var b=J(a),a=K(a);return ie(b,a)};je.g=ie;
ge=function(a,b){switch(arguments.length){case 0:return"";case 1:return he.call(this,a);default:return je.g(a,N(arguments,1))}e(Error("Invalid arity: "+arguments.length))};ge.r=1;ge.l=je.l;ge.h=ba("");ge.a=he;ge.g=je.g;E=ge;var ke,le=n,le=function(a,b,c){switch(arguments.length){case 2:return a.substring(b);case 3:return a.substring(b,c)}e(Error("Invalid arity: "+arguments.length))};le.b=function(a,b){return a.substring(b)};le.c=function(a,b,c){return a.substring(b,c)};ke=le;var me,ne=n;
function oe(a){return Ed(a)?a:a instanceof F?be.g("\ufdd0",N([":",pe.a?pe.a(a):pe.call(n,a)],0)):be.g("\ufdd0",N([":",a],0))}function qe(a,b){return ne.a(be.g(a,N(["/",b],0)))}ne=function(a,b){switch(arguments.length){case 1:return oe.call(this,a);case 2:return qe.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};ne.a=oe;ne.b=qe;me=ne;
function Fc(a,b){var c;c=b?((c=b.j&16777216)?c:b.tg)||(b.j?0:A(Wb,b)):A(Wb,b);if(c)a:{c=I(a);for(var d=I(b);;){if(c==n){c=d==n;break a}if(d!=n&&M.b(J(c),J(d)))c=L(c),d=L(d);else{c=r;break a}}c=h}else c=n;return z(c)?m:r}function jc(a,b){return a^b+2654435769+(a<<6)+(a>>2)}function Dc(a){return Od.c(function(a,c){return jc(a,G.b(c,r))},G.b(J(a),r),L(a))}
function re(a){for(var b=0,a=I(a);;)if(a)var c=J(a),b=(b+(G.a(se.a?se.a(c):se.call(n,c))^G.a(te.a?te.a(c):te.call(n,c))))%4503599627370496,a=L(a);else return b}function ue(a,b,c,d,f){this.m=a;this.Qb=b;this.Sa=c;this.count=d;this.q=f;this.t=0;this.j=65937646}v=ue.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.ha=function(){return 1===this.count?n:this.Sa};v.S=function(a,b){return new ue(this.m,b,a,this.count+1,n)};v.toString=function(){return ic(this)};
v.Va=function(a,b){return Ld.b(b,a)};v.Wa=function(a,b,c){return Ld.c(b,c,a)};v.N=aa();v.K=s("count");v.$=s("Qb");v.ca=function(){return 1===this.count?mc:this.Sa};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new ue(b,this.Qb,this.Sa,this.count,this.q)};v.F=s("m");v.W=function(){return mc};function ve(a){this.m=a;this.t=0;this.j=65413326}v=ve.prototype;v.U=ba(0);v.ha=ba(n);v.S=function(a,b){return new ue(this.m,b,n,1,n)};v.toString=function(){return ic(this)};v.N=ba(n);v.K=ba(0);
v.$=ba(n);v.ca=function(){return mc};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new ve(b)};v.F=s("m");v.W=aa();var mc=new ve(n),Ec;function we(a){var b;if(a instanceof lc)b=a.e;else a:{for(b=[];;)if(a!=n)b.push(a.$(a)),a=a.ha(a);else break a;b=h}for(var a=b.length,c=mc;;)if(0<a)var d=a-1,c=c.S(c,b[a-1]),a=d;else return c}function xe(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return we.call(this,b)}xe.r=0;xe.l=function(a){a=I(a);return we(a)};
xe.g=we;Ec=xe;function ye(a,b,c,d){this.m=a;this.Qb=b;this.Sa=c;this.q=d;this.t=0;this.j=65405164}v=ye.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.ha=function(){return this.Sa==n?n:Vb(this.Sa)};v.S=function(a,b){return new ye(n,b,a,this.q)};v.toString=function(){return ic(this)};v.N=aa();v.$=s("Qb");v.ca=function(){return this.Sa==n?mc:this.Sa};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new ye(b,this.Qb,this.Sa,this.q)};v.F=s("m");
v.W=function(){return od(mc,this.m)};function O(a,b){var c=b==n;if(!c&&(c=b))c=(c=b.j&64)?c:b.ld;return c?new ye(n,a,b,n):new ye(n,a,I(b),n)}Sb.string=function(a){return Ea(a)};function ze(a){this.Ie=a;this.t=0;this.j=1}
var Ae=n,Ae=function(a,b,c){switch(arguments.length){case 2:var d=a,d=this;if(b==n)d=n;else{var f;f=b?((f=b.j&256)?f:b.hd)||(b.j?0:A(rb,b)):A(rb,b);d=f?sb.c(b,d.Ie,n):n}return d;case 3:return d=a,d=this,b==n?d=c:(f=b?((f=b.j&256)?f:b.hd)||(b.j?0:A(rb,b)):A(rb,b),d=f?sb.c(b,d.Ie,c):n),d}e(Error("Invalid arity: "+arguments.length))};ze.prototype.call=Ae;ze.prototype.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};
var Be=n,Be=function(a,b,c){switch(arguments.length){case 2:return bd.b(b,this.toString());case 3:return bd.c(b,this.toString(),c)}e(Error("Invalid arity: "+arguments.length))};String.prototype.call=Be;String.prototype.apply=function(a,b){return a.call.apply(a,[a].concat(b.slice()))};String.prototype.apply=function(a,b){return 2>b.length?bd.b(b[0],a):bd.c(b[0],a,b[1])};function Ce(a){var b=a.x;if(a.Gd)return b;a.x=b.h?b.h():b.call(n);a.Gd=m;return a.x}
function De(a,b,c,d){this.m=a;this.Gd=b;this.x=c;this.q=d;this.t=0;this.j=31850700}v=De.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.ha=function(a){return Vb(a.ca(a))};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=function(a){return I(Ce(a))};v.$=function(a){return J(Ce(a))};v.ca=function(a){return K(Ce(a))};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new De(b,this.Gd,this.x,this.q)};v.F=s("m");v.W=function(){return od(mc,this.m)};
function Ee(a,b){this.J=a;this.end=b;this.t=0;this.j=2}Ee.prototype.K=s("end");Ee.prototype.add=function(a){this.J[this.end]=a;return this.end+=1};Ee.prototype.pa=function(){var a=new Fe(this.J,0,this.end);this.J=n;return a};function Fe(a,b,c){this.e=a;this.I=b;this.end=c;this.t=0;this.j=524306}v=Fe.prototype;v.Va=function(a,b){return wc.n(this.e,b,this.e[this.I],this.I+1)};v.Wa=function(a,b,c){return wc.n(this.e,b,c,this.I)};
v.$d=function(){this.I===this.end&&e(Error("-drop-first of empty chunk"));return new Fe(this.e,this.I+1,this.end)};v.A=function(a,b){return this.e[this.I+b]};v.X=function(a,b,c){return((a=0<=b)?b<this.end-this.I:a)?this.e[this.I+b]:c};v.K=function(){return this.end-this.I};var Ge,He=n;function Ie(a){return new Fe(a,0,a.length)}function Je(a,b){return new Fe(a,b,a.length)}function Ke(a,b,c){return new Fe(a,b,c)}
He=function(a,b,c){switch(arguments.length){case 1:return Ie.call(this,a);case 2:return Je.call(this,a,b);case 3:return Ke.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};He.a=Ie;He.b=Je;He.c=Ke;Ge=He;function Le(a,b,c,d){this.pa=a;this.$a=b;this.m=c;this.q=d;this.j=31850604;this.t=1536}v=Le.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=aa();v.$=function(){return C.b(this.pa,0)};
v.ca=function(){return 1<fb(this.pa)?new Le(ec(this.pa),this.$a,this.m,n):this.$a==n?mc:this.$a};v.ae=function(){return this.$a==n?n:this.$a};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new Le(this.pa,this.$a,b,this.q)};v.F=s("m");v.W=function(){return od(mc,this.m)};v.Uc=s("pa");v.lc=function(){return this.$a==n?mc:this.$a};function Me(a,b){return 0===fb(a)?b:new Le(a,b,n,n)}function Ne(a){for(var b=[];;)if(I(a))b.push(J(a)),a=L(a);else return b}
function Oe(a,b){if(Bc(a))return P(a);for(var c=a,d=b,f=0;;){var g;g=(g=0<d)?I(c):g;if(z(g))c=L(c),d-=1,f+=1;else return f}}var Qe=function Pe(b){return b==n?n:L(b)==n?I(J(b)):O(J(b),Pe(L(b)))},Re,Se=n;function Te(a,b,c){return O(a,O(b,c))}function Ue(a,b,c,d){return O(a,O(b,O(c,d)))}function Ve(a,b,c,d,f){return O(a,O(b,O(c,O(d,Qe(f)))))}function We(a,b,c,d,f){var g=n;4<arguments.length&&(g=N(Array.prototype.slice.call(arguments,4),0));return Ve.call(this,a,b,c,d,g)}We.r=4;
We.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=L(a),f=J(a),a=K(a);return Ve(b,c,d,f,a)};We.g=Ve;Se=function(a,b,c,d,f){switch(arguments.length){case 1:return I(a);case 2:return O(a,b);case 3:return Te.call(this,a,b,c);case 4:return Ue.call(this,a,b,c,d);default:return We.g(a,b,c,d,N(arguments,4))}e(Error("Invalid arity: "+arguments.length))};Se.r=4;Se.l=We.l;Se.a=function(a){return I(a)};Se.b=function(a,b){return O(a,b)};Se.c=Te;Se.n=Ue;Se.g=We.g;Re=Se;
function Xe(a,b,c){var d=I(c);if(0===b)return a.h?a.h():a.call(n);var c=ob(d),f=pb(d);if(1===b)return a.a?a.a(c):a.a?a.a(c):a.call(n,c);var d=ob(f),g=pb(f);if(2===b)return a.b?a.b(c,d):a.b?a.b(c,d):a.call(n,c,d);var f=ob(g),i=pb(g);if(3===b)return a.c?a.c(c,d,f):a.c?a.c(c,d,f):a.call(n,c,d,f);var g=ob(i),k=pb(i);if(4===b)return a.n?a.n(c,d,f,g):a.n?a.n(c,d,f,g):a.call(n,c,d,f,g);i=ob(k);k=pb(k);if(5===b)return a.T?a.T(c,d,f,g,i):a.T?a.T(c,d,f,g,i):a.call(n,c,d,f,g,i);var a=ob(k),l=pb(k);if(6===b)return a.ga?
a.ga(c,d,f,g,i,a):a.ga?a.ga(c,d,f,g,i,a):a.call(n,c,d,f,g,i,a);var k=ob(l),q=pb(l);if(7===b)return a.rb?a.rb(c,d,f,g,i,a,k):a.rb?a.rb(c,d,f,g,i,a,k):a.call(n,c,d,f,g,i,a,k);var l=ob(q),p=pb(q);if(8===b)return a.Lb?a.Lb(c,d,f,g,i,a,k,l):a.Lb?a.Lb(c,d,f,g,i,a,k,l):a.call(n,c,d,f,g,i,a,k,l);var q=ob(p),u=pb(p);if(9===b)return a.gd?a.gd(c,d,f,g,i,a,k,l,q):a.gd?a.gd(c,d,f,g,i,a,k,l,q):a.call(n,c,d,f,g,i,a,k,l,q);var p=ob(u),t=pb(u);if(10===b)return a.Wc?a.Wc(c,d,f,g,i,a,k,l,q,p):a.Wc?a.Wc(c,d,f,g,i,a,
k,l,q,p):a.call(n,c,d,f,g,i,a,k,l,q,p);var u=ob(t),x=pb(t);if(11===b)return a.Xc?a.Xc(c,d,f,g,i,a,k,l,q,p,u):a.Xc?a.Xc(c,d,f,g,i,a,k,l,q,p,u):a.call(n,c,d,f,g,i,a,k,l,q,p,u);var t=ob(x),j=pb(x);if(12===b)return a.Yc?a.Yc(c,d,f,g,i,a,k,l,q,p,u,t):a.Yc?a.Yc(c,d,f,g,i,a,k,l,q,p,u,t):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t);var x=ob(j),H=pb(j);if(13===b)return a.Zc?a.Zc(c,d,f,g,i,a,k,l,q,p,u,t,x):a.Zc?a.Zc(c,d,f,g,i,a,k,l,q,p,u,t,x):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x);var j=ob(H),U=pb(H);if(14===b)return a.$c?
a.$c(c,d,f,g,i,a,k,l,q,p,u,t,x,j):a.$c?a.$c(c,d,f,g,i,a,k,l,q,p,u,t,x,j):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j);var H=ob(U),Q=pb(U);if(15===b)return a.ad?a.ad(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H):a.ad?a.ad(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H);var U=ob(Q),va=pb(Q);if(16===b)return a.bd?a.bd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U):a.bd?a.bd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U);var Q=ob(va),Fa=pb(va);if(17===b)return a.cd?a.cd(c,d,f,g,i,a,k,l,
q,p,u,t,x,j,H,U,Q):a.cd?a.cd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q);var va=ob(Fa),Tb=pb(Fa);if(18===b)return a.dd?a.dd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va):a.dd?a.dd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va);Fa=ob(Tb);Tb=pb(Tb);if(19===b)return a.ed?a.ed(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa):a.ed?a.ed(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa);var $a=ob(Tb);pb(Tb);
if(20===b)return a.fd?a.fd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa,$a):a.fd?a.fd(c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa,$a):a.call(n,c,d,f,g,i,a,k,l,q,p,u,t,x,j,H,U,Q,va,Fa,$a);e(Error("Only up to 20 arguments supported on functions"))}var nd,Ye=n;function Ze(a,b){var c=a.r;if(a.l){var d=Oe(b,c+1);return d<=c?Xe(a,d,b):a.l(b)}return a.apply(a,Ne(b))}function $e(a,b,c){b=Re.b(b,c);c=a.r;if(a.l){var d=Oe(b,c+1);return d<=c?Xe(a,d,b):a.l(b)}return a.apply(a,Ne(b))}
function af(a,b,c,d){b=Re.c(b,c,d);c=a.r;return a.l?(d=Oe(b,c+1),d<=c?Xe(a,d,b):a.l(b)):a.apply(a,Ne(b))}function bf(a,b,c,d,f){b=Re.n(b,c,d,f);c=a.r;return a.l?(d=Oe(b,c+1),d<=c?Xe(a,d,b):a.l(b)):a.apply(a,Ne(b))}function cf(a,b,c,d,f,g){b=O(b,O(c,O(d,O(f,Qe(g)))));c=a.r;return a.l?(d=Oe(b,c+1),d<=c?Xe(a,d,b):a.l(b)):a.apply(a,Ne(b))}function df(a,b,c,d,f,g){var i=n;5<arguments.length&&(i=N(Array.prototype.slice.call(arguments,5),0));return cf.call(this,a,b,c,d,f,i)}df.r=5;
df.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=L(a),f=J(a),a=L(a),g=J(a),a=K(a);return cf(b,c,d,f,g,a)};df.g=cf;Ye=function(a,b,c,d,f,g){switch(arguments.length){case 2:return Ze.call(this,a,b);case 3:return $e.call(this,a,b,c);case 4:return af.call(this,a,b,c,d);case 5:return bf.call(this,a,b,c,d,f);default:return df.g(a,b,c,d,f,N(arguments,5))}e(Error("Invalid arity: "+arguments.length))};Ye.r=5;Ye.l=df.l;Ye.b=Ze;Ye.c=$e;Ye.n=af;Ye.T=bf;Ye.g=df.g;nd=Ye;var ef,ff=n;
function gf(a,b){return!M.b(a,b)}function hf(a,b,c){return ab(nd.n(M,a,b,c))}function jf(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return hf.call(this,a,b,d)}jf.r=2;jf.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return hf(b,c,a)};jf.g=hf;ff=function(a,b,c){switch(arguments.length){case 1:return r;case 2:return gf.call(this,a,b);default:return jf.g(a,b,N(arguments,2))}e(Error("Invalid arity: "+arguments.length))};ff.r=2;ff.l=jf.l;ff.a=ba(r);ff.b=gf;
ff.g=jf.g;ef=ff;function kf(a,b){for(;;){if(I(b)==n)return m;if(z(a.a?a.a(J(b)):a.call(n,J(b))))var c=a,d=L(b),a=c,b=d;else return r}}function lf(a){return a}function mf(a){function b(b){0<arguments.length&&N(Array.prototype.slice.call(arguments,0),0);return a}b.r=0;b.l=function(b){I(b);return a};b.g=function(){return a};return b}var nf,of=n;
function pf(a,b){return new De(n,r,function(){var c=I(b);if(c){if(Ad(c)){for(var d=fc(c),f=P(d),g=new Ee(Array(f),0),i=0;;)if(i<f){var k=a.a?a.a(C.b(d,i)):a.call(n,C.b(d,i));g.add(k);i+=1}else break;return Me(g.pa(),of.b(a,gc(c)))}return O(a.a?a.a(J(c)):a.call(n,J(c)),of.b(a,K(c)))}return n},n)}function qf(a,b,c){return new De(n,r,function(){var d=I(b),f=I(c);return(d?f:d)?O(a.b?a.b(J(d),J(f)):a.call(n,J(d),J(f)),of.c(a,K(d),K(f))):n},n)}
function rf(a,b,c,d){return new De(n,r,function(){var f=I(b),g=I(c),i=I(d);return(f?g?i:g:f)?O(a.c?a.c(J(f),J(g),J(i)):a.call(n,J(f),J(g),J(i)),of.n(a,K(f),K(g),K(i))):n},n)}function sf(a,b,c,d,f){return of.b(function(b){return nd.b(a,b)},function i(a){return new De(n,r,function(){var b=of.b(I,a);return kf(lf,b)?O(of.b(J,b),i(of.b(K,b))):n},n)}(Oc.g(f,d,N([c,b],0))))}
function tf(a,b,c,d,f){var g=n;4<arguments.length&&(g=N(Array.prototype.slice.call(arguments,4),0));return sf.call(this,a,b,c,d,g)}tf.r=4;tf.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=L(a),f=J(a),a=K(a);return sf(b,c,d,f,a)};tf.g=sf;of=function(a,b,c,d,f){switch(arguments.length){case 2:return pf.call(this,a,b);case 3:return qf.call(this,a,b,c);case 4:return rf.call(this,a,b,c,d);default:return tf.g(a,b,c,d,N(arguments,4))}e(Error("Invalid arity: "+arguments.length))};of.r=4;of.l=tf.l;
of.b=pf;of.c=qf;of.n=rf;of.g=tf.g;nf=of;var vf=function uf(b,c){return new De(n,r,function(){if(0<b){var d=I(c);return d?O(J(d),uf(b-1,K(d))):n}return n},n)},wf,xf=n;function yf(a){return new De(n,r,function(){return O(a.h?a.h():a.call(n),xf.a(a))},n)}function zf(a,b){return vf(a,xf.a(b))}xf=function(a,b){switch(arguments.length){case 1:return yf.call(this,a);case 2:return zf.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};xf.a=yf;xf.b=zf;wf=xf;
function Af(a,b){var c;if(a!=n){if(c=a)c=(c=a.t&4)?c:a.rg;c?(c=Od.c(bc,ac(a),b),c=cc(c)):c=Od.c(ib,a,b)}else c=Od.c(Oc,mc,b);return c}function Bf(a,b){this.w=a;this.e=b}function Cf(a){a=a.k;return 32>a?0:a-1>>>5<<5}function Df(a,b,c){for(;;){if(0===b)return c;var d=new Bf(a,Array(32));d.e[0]=c;c=d;b-=5}}var Ff=function Ef(b,c,d,f){var g=new Bf(d.w,d.e.slice()),i=b.k-1>>>c&31;5===c?g.e[i]=f:(d=d.e[i],b=d!=n?Ef(b,c-5,d,f):Df(n,c-5,f),g.e[i]=b);return g};
function Gf(a,b){e(Error([E("No item "),E(a),E(" in vector of length "),E(b)].join("")))}function Hf(a,b){var c=0<=b;if(c?b<a.k:c){if(b>=Cf(a))return a.z;for(var c=a.root,d=a.shift;;)if(0<d)var f=d-5,c=c.e[b>>>d&31],d=f;else return c.e}else return Gf(b,a.k)}var Jf=function If(b,c,d,f,g){var i=new Bf(d.w,d.e.slice());if(0===c)i.e[f&31]=g;else{var k=f>>>c&31,b=If(b,c-5,d.e[k],f,g);i.e[k]=b}return i};
function Kf(a,b,c,d,f,g){this.m=a;this.k=b;this.shift=c;this.root=d;this.z=f;this.q=g;this.t=4;this.j=167668511}v=Kf.prototype;v.Kb=function(){return new Lf(this.k,this.shift,Mf.a?Mf.a(this.root):Mf.call(n,this.root),Nf.a?Nf.a(this.z):Nf.call(n,this.z))};v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.V=function(a,b){return a.X(a,b,n)};v.L=function(a,b,c){return a.X(a,b,c)};
v.Ea=function(a,b,c){var d=0<=b;if(d?b<this.k:d)return Cf(a)<=b?(a=this.z.slice(),a[b&31]=c,new Kf(this.m,this.k,this.shift,this.root,a,n)):new Kf(this.m,this.k,this.shift,Jf(a,this.shift,this.root,b,c),this.z,n);if(b===this.k)return a.S(a,c);e(Error([E("Index "),E(b),E(" out of bounds [0,"),E(this.k),E("]")].join("")))};var Of=n,Of=function(a,b,c){switch(arguments.length){case 2:return this.A(this,b);case 3:return this.X(this,b,c)}e(Error("Invalid arity: "+arguments.length))};v=Kf.prototype;
v.call=Of;v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.S=function(a,b){if(32>this.k-Cf(a)){var c=this.z.slice();c.push(b);return new Kf(this.m,this.k+1,this.shift,this.root,c,n)}var d=this.k>>>5>1<<this.shift,c=d?this.shift+5:this.shift;if(d){d=new Bf(n,Array(32));d.e[0]=this.root;var f=Df(n,this.shift,new Bf(n,this.z));d.e[1]=f}else d=Ff(a,this.shift,this.root,new Bf(n,this.z));return new Kf(this.m,this.k+1,c,d,[b],n)};v.kd=function(a){return a.A(a,0)};
v.de=function(a){return a.A(a,1)};v.toString=function(){return ic(this)};v.Va=function(a,b){return rc.b(a,b)};v.Wa=function(a,b,c){return rc.c(a,b,c)};v.N=function(a){return 0===this.k?n:32>this.k?N.a(this.z):Pf.c?Pf.c(a,0,0):Pf.call(n,a,0,0)};v.K=s("k");v.md=function(a,b,c){return a.Ea(a,b,c)};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new Kf(b,this.k,this.shift,this.root,this.z,this.q)};v.F=s("m");v.A=function(a,b){return Hf(a,b)[b&31]};
v.X=function(a,b,c){var d=0<=b;return(d?b<this.k:d)?a.A(a,b):c};v.W=function(){return od(Qf,this.m)};var Rf=new Bf(n,Array(32)),Qf=new Kf(n,0,5,Rf,[],0);function S(a){var b=a.length;if(32>b)return new Kf(n,b,5,Rf,a,n);for(var c=a.slice(0,32),d=32,f=ac(new Kf(n,32,5,Rf,c,n));;)if(d<b)c=d+1,f=bc(f,a[d]),d=c;else return cc(f)}function Sf(a){return cc(Od.c(bc,ac(Qf),a))}function Tf(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return Sf(b)}Tf.r=0;
Tf.l=function(a){a=I(a);return Sf(a)};Tf.g=function(a){return Sf(a)};function Uf(a,b,c,d,f,g){this.R=a;this.la=b;this.p=c;this.I=d;this.m=f;this.q=g;this.j=32243948;this.t=1536}v=Uf.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.ha=function(a){return this.I+1<this.la.length?(a=Pf.n?Pf.n(this.R,this.la,this.p,this.I+1):Pf.call(n,this.R,this.la,this.p,this.I+1),a==n?n:a):a.ae(a)};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};
v.Va=function(a,b){return rc.b(Vf.c?Vf.c(this.R,this.p+this.I,P(this.R)):Vf.call(n,this.R,this.p+this.I,P(this.R)),b)};v.Wa=function(a,b,c){return rc.c(Vf.c?Vf.c(this.R,this.p+this.I,P(this.R)):Vf.call(n,this.R,this.p+this.I,P(this.R)),b,c)};v.N=aa();v.$=function(){return this.la[this.I]};v.ca=function(a){return this.I+1<this.la.length?(a=Pf.n?Pf.n(this.R,this.la,this.p,this.I+1):Pf.call(n,this.R,this.la,this.p,this.I+1),a==n?mc:a):a.lc(a)};
v.ae=function(){var a=this.la.length,a=this.p+a<fb(this.R)?Pf.c?Pf.c(this.R,this.p+a,0):Pf.call(n,this.R,this.p+a,0):n;return a==n?n:a};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return Pf.T?Pf.T(this.R,this.la,this.p,this.I,b):Pf.call(n,this.R,this.la,this.p,this.I,b)};v.W=function(){return od(Qf,this.m)};v.Uc=function(){return Ge.b(this.la,this.I)};v.lc=function(){var a=this.la.length,a=this.p+a<fb(this.R)?Pf.c?Pf.c(this.R,this.p+a,0):Pf.call(n,this.R,this.p+a,0):n;return a==n?mc:a};
var Pf,Wf=n;function Xf(a,b,c){return new Uf(a,Hf(a,b),b,c,n,n)}function Yf(a,b,c,d){return new Uf(a,b,c,d,n,n)}function Zf(a,b,c,d,f){return new Uf(a,b,c,d,f,n)}Wf=function(a,b,c,d,f){switch(arguments.length){case 3:return Xf.call(this,a,b,c);case 4:return Yf.call(this,a,b,c,d);case 5:return Zf.call(this,a,b,c,d,f)}e(Error("Invalid arity: "+arguments.length))};Wf.c=Xf;Wf.n=Yf;Wf.T=Zf;Pf=Wf;function $f(a,b,c,d,f){this.m=a;this.Da=b;this.start=c;this.end=d;this.q=f;this.t=0;this.j=32400159}
$f.prototype.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};$f.prototype.V=function(a,b){return a.X(a,b,n)};$f.prototype.L=function(a,b,c){return a.X(a,b,c)};$f.prototype.Ea=function(a,b,c){var d=this,f=d.start+b;return ag.T?ag.T(d.m,fd.c(d.Da,f,c),d.start,function(){var a=d.end,b=f+1;return a>b?a:b}(),n):ag.call(n,d.m,fd.c(d.Da,f,c),d.start,function(){var a=d.end,b=f+1;return a>b?a:b}(),n)};
var bg=n,bg=function(a,b,c){switch(arguments.length){case 2:return this.A(this,b);case 3:return this.X(this,b,c)}e(Error("Invalid arity: "+arguments.length))};v=$f.prototype;v.call=bg;v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.S=function(a,b){return ag.T?ag.T(this.m,Gb(this.Da,this.end,b),this.start,this.end+1,n):ag.call(n,this.m,Gb(this.Da,this.end,b),this.start,this.end+1,n)};v.toString=function(){return ic(this)};v.Va=function(a,b){return rc.b(a,b)};
v.Wa=function(a,b,c){return rc.c(a,b,c)};v.N=function(){var a=this;return function c(d){return d===a.end?n:O(C.b(a.Da,d),new De(n,r,function(){return c(d+1)},n))}(a.start)};v.K=function(){return this.end-this.start};v.md=function(a,b,c){return a.Ea(a,b,c)};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return ag.T?ag.T(b,this.Da,this.start,this.end,this.q):ag.call(n,b,this.Da,this.start,this.end,this.q)};v.F=s("m");
v.A=function(a,b){var c=0>b;return(c?c:this.end<=this.start+b)?Gf(b,this.end-this.start):C.b(this.Da,this.start+b)};v.X=function(a,b,c){return((a=0>b)?a:this.end<=this.start+b)?c:C.c(this.Da,this.start+b,c)};v.W=function(){return od(Qf,this.m)};function ag(a,b,c,d,f){for(;;)if(b instanceof $f)var g=b.start+c,i=b.start+d,b=b.Da,c=g,d=i;else{var k=P(b);(function(){var a=0>c;return a||(a=0>d)?a:(a=c>k)?a:d>k})()&&e(Error("Index out of bounds"));return new $f(a,b,c,d,f)}}var Vf,cg=n;
function dg(a,b){return cg.c(a,b,P(a))}function eg(a,b,c){return ag(n,a,b,c,n)}cg=function(a,b,c){switch(arguments.length){case 2:return dg.call(this,a,b);case 3:return eg.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};cg.b=dg;cg.c=eg;Vf=cg;function Mf(a){return new Bf({},a.e.slice())}function Nf(a){var b=Array(32);Bd(a,0,b,0,a.length);return b}
var gg=function fg(b,c,d,f){var d=b.root.w===d.w?d:new Bf(b.root.w,d.e.slice()),g=b.k-1>>>c&31;if(5===c)b=f;else var i=d.e[g],b=i!=n?fg(b,c-5,i,f):Df(b.root.w,c-5,f);d.e[g]=b;return d};function Lf(a,b,c,d){this.k=a;this.shift=b;this.root=c;this.z=d;this.j=275;this.t=88}var hg=n,hg=function(a,b,c){switch(arguments.length){case 2:return this.V(this,b);case 3:return this.L(this,b,c)}e(Error("Invalid arity: "+arguments.length))};v=Lf.prototype;v.call=hg;
v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.V=function(a,b){return a.X(a,b,n)};v.L=function(a,b,c){return a.X(a,b,c)};v.A=function(a,b){if(this.root.w)return Hf(a,b)[b&31];e(Error("nth after persistent!"))};v.X=function(a,b,c){var d=0<=b;return(d?b<this.k:d)?a.A(a,b):c};v.K=function(){if(this.root.w)return this.k;e(Error("count after persistent!"))};
v.sb=function(a,b,c){var d;a:{if(a.root.w){var f=0<=b;if(f?b<a.k:f){Cf(a)<=b?a.z[b&31]=c:(d=function i(d,f){var q=a.root.w===f.w?f:new Bf(a.root.w,f.e.slice());if(0===d)q.e[b&31]=c;else{var p=b>>>d&31,u=i(d-5,q.e[p]);q.e[p]=u}return q}.call(n,a.shift,a.root),a.root=d);d=a;break a}if(b===a.k){d=a.gb(a,c);break a}e(Error([E("Index "),E(b),E(" out of bounds for TransientVector of length"),E(a.k)].join("")))}e(Error("assoc! after persistent!"))}return d};
v.gb=function(a,b){if(this.root.w){if(32>this.k-Cf(a))this.z[this.k&31]=b;else{var c=new Bf(this.root.w,this.z),d=Array(32);d[0]=b;this.z=d;if(this.k>>>5>1<<this.shift){var d=Array(32),f=this.shift+5;d[0]=this.root;d[1]=Df(this.root.w,this.shift,c);this.root=new Bf(this.root.w,d);this.shift=f}else this.root=gg(a,this.shift,this.root,c)}this.k+=1;return a}e(Error("conj! after persistent!"))};
v.tb=function(a){if(this.root.w){this.root.w=n;var a=this.k-Cf(a),b=Array(a);Bd(this.z,0,b,0,a);return new Kf(n,this.k,this.shift,this.root,b,n)}e(Error("persistent! called twice"))};function ig(){this.t=0;this.j=2097152}ig.prototype.P=ba(r);var jg=new ig;function kg(a,b){var c;c=b==n?0:b?((c=b.j&1024)?c:b.sg)||(b.j?0:A(yb,b)):A(yb,b);c=c?P(a)===P(b)?kf(lf,nf.b(function(a){return M.b(bd.c(b,J(a),jg),Nc(a))},a)):n:n;return z(c)?m:r}
function lg(a,b){var c=a.e,d=y(b);if(d?d:"number"===typeof b)a:{for(var d=c.length,f=0;;){if(d<=f){c=-1;break a}if(b===c[f]){c=f;break a}f+=2}c=h}else if(b instanceof F)a:{for(var d=c.length,f=b.nb,g=0;;){if(d<=g){c=-1;break a}var i=c[g],k=i instanceof F;if(k?f===i.nb:k){c=g;break a}g+=2}c=h}else if(b==n)a:{d=c.length;for(f=0;;){if(d<=f){c=-1;break a}if(c[f]==n){c=f;break a}f+=2}c=h}else a:{d=c.length;for(f=0;;){if(d<=f){c=-1;break a}if(M.b(b,c[f])){c=f;break a}f+=2}c=h}return c}
function mg(a,b,c){this.e=a;this.p=b;this.oa=c;this.t=0;this.j=31850702}v=mg.prototype;v.U=function(a){return Dc(a)};v.ha=function(){return this.p<this.e.length-2?new mg(this.e,this.p+2,this.oa):n};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=aa();v.K=function(){return(this.e.length-this.p)/2};v.$=function(){return S([this.e[this.p],this.e[this.p+1]])};v.ca=function(){return this.p<this.e.length-2?new mg(this.e,this.p+2,this.oa):mc};v.P=function(a,b){return Fc(a,b)};
v.G=function(a,b){return new mg(this.e,this.p,b)};v.F=s("oa");v.W=function(){return od(mc,this.oa)};function ng(a,b,c,d){this.m=a;this.k=b;this.e=c;this.q=d;this.t=4;this.j=16123663}v=ng.prototype;v.Kb=function(){return new og({},this.e.length,this.e.slice())};v.U=function(a){var b=this.q;return b!=n?b:this.q=a=re(a)};v.V=function(a,b){return a.L(a,b,n)};v.L=function(a,b,c){a=lg(a,b);return-1===a?c:this.e[a+1]};
v.Ea=function(a,b,c){var d=lg(a,b);if(-1===d){if(this.k<pg){for(var d=a.e,a=d.length,f=Array(a+2),g=0;;)if(g<a)f[g]=d[g],g+=1;else break;f[a]=b;f[a+1]=c;return new ng(this.m,this.k+1,f,n)}return Lb(xb(Af(qg,a),b,c),this.m)}if(c===this.e[d+1])return a;b=this.e.slice();b[d+1]=c;return new ng(this.m,this.k,b,n)};v.Tc=function(a,b){return-1!==lg(a,b)};var rg=n,rg=function(a,b,c){switch(arguments.length){case 2:return this.V(this,b);case 3:return this.L(this,b,c)}e(Error("Invalid arity: "+arguments.length))};
v=ng.prototype;v.call=rg;v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.S=function(a,b){return zd(b)?a.Ea(a,C.b(b,0),C.b(b,1)):Od.c(ib,a,b)};v.toString=function(){return ic(this)};v.N=function(){return 0<=this.e.length-2?new mg(this.e,0,n):n};v.K=s("k");v.P=function(a,b){return kg(a,b)};v.G=function(a,b){return new ng(b,this.k,this.e,this.q)};v.F=s("m");v.W=function(){return Lb(sg,this.m)};
v.jd=function(a,b){if(0<=lg(a,b)){var c=this.e.length,d=c-2;if(0===d)return a.W(a);for(var d=Array(d),f=0,g=0;;){if(f>=c)return new ng(this.m,this.k-1,d,n);M.b(b,this.e[f])||(d[g]=this.e[f],d[g+1]=this.e[f+1],g+=2);f+=2}}else return a};var sg=new ng(n,0,[],n),pg=8;function Za(a,b){var c=b?a:a.slice();return new ng(n,c.length/2,c,n)}function og(a,b,c){this.vb=a;this.lb=b;this.e=c;this.t=56;this.j=258}v=og.prototype;
v.sb=function(a,b,c){if(z(this.vb)){var d=lg(a,b);if(-1===d){if(this.lb+2<=2*pg)return this.lb+=2,this.e.push(b),this.e.push(c),a;a=tg.b?tg.b(this.lb,this.e):tg.call(n,this.lb,this.e);return dc(a,b,c)}c!==this.e[d+1]&&(this.e[d+1]=c);return a}e(Error("assoc! after persistent!"))};
v.gb=function(a,b){if(z(this.vb)){var c;c=b?((c=b.j&2048)?c:b.of)||(b.j?0:A(Ab,b)):A(Ab,b);if(c)return a.sb(a,se.a?se.a(b):se.call(n,b),te.a?te.a(b):te.call(n,b));c=I(b);for(var d=a;;){var f=J(c);if(z(f))c=L(c),d=d.sb(d,se.a?se.a(f):se.call(n,f),te.a?te.a(f):te.call(n,f));else return d}}else e(Error("conj! after persistent!"))};v.tb=function(){if(z(this.vb))return this.vb=r,new ng(n,Vd(this.lb),this.e,n);e(Error("persistent! called twice"))};v.V=function(a,b){return a.L(a,b,n)};
v.L=function(a,b,c){if(z(this.vb))return a=lg(a,b),-1===a?c:this.e[a+1];e(Error("lookup after persistent!"))};v.K=function(){if(z(this.vb))return Vd(this.lb);e(Error("count after persistent!"))};function tg(a,b){for(var c=ac(qg),d=0;;)if(d<a)c=dc(c,b[d],b[d+1]),d+=2;else return c}function ug(){this.Z=r}function vg(a,b){return y(a)?a===b:M.b(a,b)}var wg,xg=n;function yg(a,b,c){a=a.slice();a[b]=c;return a}function zg(a,b,c,d,f){a=a.slice();a[b]=c;a[d]=f;return a}
xg=function(a,b,c,d,f){switch(arguments.length){case 3:return yg.call(this,a,b,c);case 5:return zg.call(this,a,b,c,d,f)}e(Error("Invalid arity: "+arguments.length))};xg.c=yg;xg.T=zg;wg=xg;function Ag(a,b){var c=Array(a.length-2);Bd(a,0,c,0,2*b);Bd(a,2*(b+1),c,2*b,c.length-2*b);return c}var Bg,Cg=n;function Dg(a,b,c,d){a=a.wb(b);a.e[c]=d;return a}function Eg(a,b,c,d,f,g){a=a.wb(b);a.e[c]=d;a.e[f]=g;return a}
Cg=function(a,b,c,d,f,g){switch(arguments.length){case 4:return Dg.call(this,a,b,c,d);case 6:return Eg.call(this,a,b,c,d,f,g)}e(Error("Invalid arity: "+arguments.length))};Cg.n=Dg;Cg.ga=Eg;Bg=Cg;function Fg(a,b,c){this.w=a;this.D=b;this.e=c}v=Fg.prototype;
v.sa=function(a,b,c,d,f,g){var i=1<<(c>>>b&31),k=ae(this.D&i-1);if(0===(this.D&i)){var l=ae(this.D);if(2*l<this.e.length){a=this.wb(a);b=a.e;g.Z=m;a:{c=2*(l-k);g=2*k+(c-1);for(l=2*(k+1)+(c-1);;){if(0===c)break a;b[l]=b[g];l-=1;c-=1;g-=1}}b[2*k]=d;b[2*k+1]=f;a.D|=i;return a}if(16<=l){k=Array(32);k[c>>>b&31]=Gg.sa(a,b+5,c,d,f,g);for(f=d=0;;)if(32>d)0!==(this.D>>>d&1)&&(k[d]=this.e[f]!=n?Gg.sa(a,b+5,G.a(this.e[f]),this.e[f],this.e[f+1],g):this.e[f+1],f+=2),d+=1;else break;return new Hg(a,l+1,k)}b=Array(2*
(l+4));Bd(this.e,0,b,0,2*k);b[2*k]=d;b[2*k+1]=f;Bd(this.e,2*k,b,2*(k+1),2*(l-k));g.Z=m;a=this.wb(a);a.e=b;a.D|=i;return a}l=this.e[2*k];i=this.e[2*k+1];if(l==n)return l=i.sa(a,b+5,c,d,f,g),l===i?this:Bg.n(this,a,2*k+1,l);if(vg(d,l))return f===i?this:Bg.n(this,a,2*k+1,f);g.Z=m;return Bg.ga(this,a,2*k,n,2*k+1,Ig.rb?Ig.rb(a,b+5,l,i,c,d,f):Ig.call(n,a,b+5,l,i,c,d,f))};v.Ub=function(){return Jg.a?Jg.a(this.e):Jg.call(n,this.e)};
v.wb=function(a){if(a===this.w)return this;var b=ae(this.D),c=Array(0>b?4:2*(b+1));Bd(this.e,0,c,0,2*b);return new Fg(a,this.D,c)};v.Vb=function(a,b,c){var d=1<<(b>>>a&31);if(0===(this.D&d))return this;var f=ae(this.D&d-1),g=this.e[2*f],i=this.e[2*f+1];return g==n?(a=i.Vb(a+5,b,c),a===i?this:a!=n?new Fg(n,this.D,wg.c(this.e,2*f+1,a)):this.D===d?n:new Fg(n,this.D^d,Ag(this.e,f))):vg(c,g)?new Fg(n,this.D^d,Ag(this.e,f)):this};
v.ra=function(a,b,c,d,f){var g=1<<(b>>>a&31),i=ae(this.D&g-1);if(0===(this.D&g)){var k=ae(this.D);if(16<=k){i=Array(32);i[b>>>a&31]=Gg.ra(a+5,b,c,d,f);for(d=c=0;;)if(32>c)0!==(this.D>>>c&1)&&(i[c]=this.e[d]!=n?Gg.ra(a+5,G.a(this.e[d]),this.e[d],this.e[d+1],f):this.e[d+1],d+=2),c+=1;else break;return new Hg(n,k+1,i)}a=Array(2*(k+1));Bd(this.e,0,a,0,2*i);a[2*i]=c;a[2*i+1]=d;Bd(this.e,2*i,a,2*(i+1),2*(k-i));f.Z=m;return new Fg(n,this.D|g,a)}k=this.e[2*i];g=this.e[2*i+1];if(k==n)return k=g.ra(a+5,b,c,
d,f),k===g?this:new Fg(n,this.D,wg.c(this.e,2*i+1,k));if(vg(c,k))return d===g?this:new Fg(n,this.D,wg.c(this.e,2*i+1,d));f.Z=m;return new Fg(n,this.D,wg.T(this.e,2*i,n,2*i+1,Ig.ga?Ig.ga(a+5,k,g,b,c,d):Ig.call(n,a+5,k,g,b,c,d)))};v.Za=function(a,b,c,d){var f=1<<(b>>>a&31);if(0===(this.D&f))return d;var g=ae(this.D&f-1),f=this.e[2*g],g=this.e[2*g+1];return f==n?g.Za(a+5,b,c,d):vg(c,f)?g:d};var Gg=new Fg(n,0,[]);function Hg(a,b,c){this.w=a;this.k=b;this.e=c}v=Hg.prototype;
v.sa=function(a,b,c,d,f,g){var i=c>>>b&31,k=this.e[i];if(k==n)return a=Bg.n(this,a,i,Gg.sa(a,b+5,c,d,f,g)),a.k+=1,a;b=k.sa(a,b+5,c,d,f,g);return b===k?this:Bg.n(this,a,i,b)};v.Ub=function(){return Kg.a?Kg.a(this.e):Kg.call(n,this.e)};v.wb=function(a){return a===this.w?this:new Hg(a,this.k,this.e.slice())};
v.Vb=function(a,b,c){var d=b>>>a&31,f=this.e[d];if(f!=n){a=f.Vb(a+5,b,c);if(a===f)d=this;else if(a==n)if(8>=this.k)a:{for(var f=this.e,a=2*(this.k-1),b=Array(a),c=0,g=1,i=0;;)if(c<a){var k=c!==d;if(k?f[c]!=n:k)b[g]=f[c],g+=2,i|=1<<c;c+=1}else{d=new Fg(n,i,b);break a}d=h}else d=new Hg(n,this.k-1,wg.c(this.e,d,a));else d=new Hg(n,this.k,wg.c(this.e,d,a));return d}return this};
v.ra=function(a,b,c,d,f){var g=b>>>a&31,i=this.e[g];if(i==n)return new Hg(n,this.k+1,wg.c(this.e,g,Gg.ra(a+5,b,c,d,f)));a=i.ra(a+5,b,c,d,f);return a===i?this:new Hg(n,this.k,wg.c(this.e,g,a))};v.Za=function(a,b,c,d){var f=this.e[b>>>a&31];return f!=n?f.Za(a+5,b,c,d):d};function Lg(a,b,c){for(var b=2*b,d=0;;)if(d<b){if(vg(c,a[d]))return d;d+=2}else return-1}function Mg(a,b,c,d){this.w=a;this.Ha=b;this.k=c;this.e=d}v=Mg.prototype;
v.sa=function(a,b,c,d,f,g){if(c===this.Ha){b=Lg(this.e,this.k,d);if(-1===b){if(this.e.length>2*this.k)return a=Bg.ga(this,a,2*this.k,d,2*this.k+1,f),g.Z=m,a.k+=1,a;c=this.e.length;b=Array(c+2);Bd(this.e,0,b,0,c);b[c]=d;b[c+1]=f;g.Z=m;g=this.k+1;a===this.w?(this.e=b,this.k=g,a=this):a=new Mg(this.w,this.Ha,g,b);return a}return this.e[b+1]===f?this:Bg.n(this,a,b+1,f)}return(new Fg(a,1<<(this.Ha>>>b&31),[n,this,n,n])).sa(a,b,c,d,f,g)};v.Ub=function(){return Jg.a?Jg.a(this.e):Jg.call(n,this.e)};
v.wb=function(a){if(a===this.w)return this;var b=Array(2*(this.k+1));Bd(this.e,0,b,0,2*this.k);return new Mg(a,this.Ha,this.k,b)};v.Vb=function(a,b,c){a=Lg(this.e,this.k,c);return-1===a?this:1===this.k?n:new Mg(n,this.Ha,this.k-1,Ag(this.e,Vd(a)))};
v.ra=function(a,b,c,d,f){return b===this.Ha?(a=Lg(this.e,this.k,c),-1===a?(a=this.e.length,b=Array(a+2),Bd(this.e,0,b,0,a),b[a]=c,b[a+1]=d,f.Z=m,new Mg(n,this.Ha,this.k+1,b)):M.b(this.e[a],d)?this:new Mg(n,this.Ha,this.k,wg.c(this.e,a+1,d))):(new Fg(n,1<<(this.Ha>>>a&31),[n,this])).ra(a,b,c,d,f)};v.Za=function(a,b,c,d){a=Lg(this.e,this.k,c);return 0>a?d:vg(c,this.e[a])?this.e[a+1]:d};var Ig,Ng=n;
function Og(a,b,c,d,f,g){var i=G.a(b);if(i===d)return new Mg(n,i,2,[b,c,f,g]);var k=new ug;return Gg.ra(a,i,b,c,k).ra(a,d,f,g,k)}function Pg(a,b,c,d,f,g,i){var k=G.a(c);if(k===f)return new Mg(n,k,2,[c,d,g,i]);var l=new ug;return Gg.sa(a,b,k,c,d,l).sa(a,b,f,g,i,l)}Ng=function(a,b,c,d,f,g,i){switch(arguments.length){case 6:return Og.call(this,a,b,c,d,f,g);case 7:return Pg.call(this,a,b,c,d,f,g,i)}e(Error("Invalid arity: "+arguments.length))};Ng.ga=Og;Ng.rb=Pg;Ig=Ng;
function Qg(a,b,c,d,f){this.m=a;this.ua=b;this.p=c;this.wa=d;this.q=f;this.t=0;this.j=31850572}v=Qg.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=aa();v.$=function(){return this.wa==n?S([this.ua[this.p],this.ua[this.p+1]]):J(this.wa)};v.ca=function(){return this.wa==n?Jg.c?Jg.c(this.ua,this.p+2,n):Jg.call(n,this.ua,this.p+2,n):Jg.c?Jg.c(this.ua,this.p,L(this.wa)):Jg.call(n,this.ua,this.p,L(this.wa))};
v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new Qg(b,this.ua,this.p,this.wa,this.q)};v.F=s("m");v.W=function(){return od(mc,this.m)};var Jg,Rg=n;function Sg(a){return Rg.c(a,0,n)}function Tg(a,b,c){if(c==n)for(c=a.length;;)if(b<c){if(a[b]!=n)return new Qg(n,a,b,n,n);var d=a[b+1];if(z(d)&&(d=d.Ub(),z(d)))return new Qg(n,a,b+2,d,n);b+=2}else return n;else return new Qg(n,a,b,c,n)}
Rg=function(a,b,c){switch(arguments.length){case 1:return Sg.call(this,a);case 3:return Tg.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Rg.a=Sg;Rg.c=Tg;Jg=Rg;function Ug(a,b,c,d,f){this.m=a;this.ua=b;this.p=c;this.wa=d;this.q=f;this.t=0;this.j=31850572}v=Ug.prototype;v.U=function(a){var b=this.q;return b!=n?b:this.q=a=Dc(a)};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=aa();v.$=function(){return J(this.wa)};
v.ca=function(){return Kg.n?Kg.n(n,this.ua,this.p,L(this.wa)):Kg.call(n,n,this.ua,this.p,L(this.wa))};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new Ug(b,this.ua,this.p,this.wa,this.q)};v.F=s("m");v.W=function(){return od(mc,this.m)};var Kg,Vg=n;function Wg(a){return Vg.n(n,a,0,n)}function Xg(a,b,c,d){if(d==n)for(d=b.length;;)if(c<d){var f=b[c];if(z(f)&&(f=f.Ub(),z(f)))return new Ug(a,b,c+1,f,n);c+=1}else return n;else return new Ug(a,b,c,d,n)}
Vg=function(a,b,c,d){switch(arguments.length){case 1:return Wg.call(this,a);case 4:return Xg.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};Vg.a=Wg;Vg.n=Xg;Kg=Vg;function Yg(a,b,c,d,f,g){this.m=a;this.k=b;this.root=c;this.aa=d;this.ea=f;this.q=g;this.t=4;this.j=16123663}v=Yg.prototype;v.Kb=function(){return new Zg({},this.root,this.k,this.aa,this.ea)};v.U=function(a){var b=this.q;return b!=n?b:this.q=a=re(a)};v.V=function(a,b){return a.L(a,b,n)};
v.L=function(a,b,c){return b==n?this.aa?this.ea:c:this.root==n?c:this.root.Za(0,G.a(b),b,c)};v.Ea=function(a,b,c){if(b==n){var d=this.aa;return(d?c===this.ea:d)?a:new Yg(this.m,this.aa?this.k:this.k+1,this.root,m,c,n)}d=new ug;c=(this.root==n?Gg:this.root).ra(0,G.a(b),b,c,d);return c===this.root?a:new Yg(this.m,d.Z?this.k+1:this.k,c,this.aa,this.ea,n)};v.Tc=function(a,b){return b==n?this.aa:this.root==n?r:this.root.Za(0,G.a(b),b,Cd)!==Cd};
var $g=n,$g=function(a,b,c){switch(arguments.length){case 2:return this.V(this,b);case 3:return this.L(this,b,c)}e(Error("Invalid arity: "+arguments.length))};v=Yg.prototype;v.call=$g;v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.S=function(a,b){return zd(b)?a.Ea(a,C.b(b,0),C.b(b,1)):Od.c(ib,a,b)};v.toString=function(){return ic(this)};v.N=function(){if(0<this.k){var a=this.root!=n?this.root.Ub():n;return this.aa?O(S([n,this.ea]),a):a}return n};v.K=s("k");
v.P=function(a,b){return kg(a,b)};v.G=function(a,b){return new Yg(b,this.k,this.root,this.aa,this.ea,this.q)};v.F=s("m");v.W=function(){return Lb(qg,this.m)};v.jd=function(a,b){if(b==n)return this.aa?new Yg(this.m,this.k-1,this.root,r,n,n):a;if(this.root==n)return a;var c=this.root.Vb(0,G.a(b),b);return c===this.root?a:new Yg(this.m,this.k-1,c,this.aa,this.ea,n)};var qg=new Yg(n,0,n,r,n,0);function Zg(a,b,c,d,f){this.w=a;this.root=b;this.count=c;this.aa=d;this.ea=f;this.t=56;this.j=258}v=Zg.prototype;
v.sb=function(a,b,c){return ah(a,b,c)};v.gb=function(a,b){var c;a:{if(a.w){c=b?((c=b.j&2048)?c:b.of)||(b.j?0:A(Ab,b)):A(Ab,b);if(c){c=ah(a,se.a?se.a(b):se.call(n,b),te.a?te.a(b):te.call(n,b));break a}c=I(b);for(var d=a;;){var f=J(c);if(z(f))c=L(c),d=ah(d,se.a?se.a(f):se.call(n,f),te.a?te.a(f):te.call(n,f));else{c=d;break a}}}else e(Error("conj! after persistent"));c=h}return c};v.tb=function(a){var b;a.w?(a.w=n,b=new Yg(n,a.count,a.root,a.aa,a.ea,n)):e(Error("persistent! called twice"));return b};
v.V=function(a,b){return b==n?this.aa?this.ea:n:this.root==n?n:this.root.Za(0,G.a(b),b)};v.L=function(a,b,c){return b==n?this.aa?this.ea:c:this.root==n?c:this.root.Za(0,G.a(b),b,c)};v.K=function(){if(this.w)return this.count;e(Error("count after persistent!"))};function ah(a,b,c){if(a.w){if(b==n)a.ea!==c&&(a.ea=c),a.aa||(a.count+=1,a.aa=m);else{var d=new ug,b=(a.root==n?Gg:a.root).sa(a.w,0,G.a(b),b,c,d);b!==a.root&&(a.root=b);d.Z&&(a.count+=1)}return a}e(Error("assoc! after persistent!"))}var id;
function bh(a){for(var b=I(a),c=ac(qg);;)if(b)var a=L(L(b)),d=J(b),b=Nc(b),c=dc(c,d,b),b=a;else return cc(c)}function ch(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return bh.call(this,b)}ch.r=0;ch.l=function(a){a=I(a);return bh(a)};ch.g=bh;id=ch;function dh(a){return new ng(n,Vd(P(a)),nd.b(cb,a),n)}function eh(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return dh.call(this,b)}eh.r=0;eh.l=function(a){a=I(a);return dh(a)};
eh.g=dh;function fh(a,b){this.ta=a;this.oa=b;this.t=0;this.j=31850700}v=fh.prototype;v.U=function(a){return Dc(a)};v.ha=function(){var a=this.ta;if(a)var b=a.j&128,a=(b?b:a.ee)||(a.j?0:A(qb,a));else a=A(qb,a);a=a?this.ta.ha(this.ta):L(this.ta);return a==n?n:new fh(a,this.oa)};v.S=function(a,b){return O(b,a)};v.toString=function(){return ic(this)};v.N=aa();v.$=function(){var a=this.ta.$(this.ta);return a.kd(a)};
v.ca=function(){var a=this.ta;if(a)var b=a.j&128,a=(b?b:a.ee)||(a.j?0:A(qb,a));else a=A(qb,a);a=a?this.ta.ha(this.ta):L(this.ta);return a!=n?new fh(a,this.oa):mc};v.P=function(a,b){return Fc(a,b)};v.G=function(a,b){return new fh(this.ta,b)};v.F=s("oa");v.W=function(){return od(mc,this.oa)};function gh(a){return(a=I(a))?new fh(a,n):n}function se(a){return Bb(a)}function te(a){return Cb(a)}
function hh(a){var b;a:{b=a;for(var c=lf;;)if(I(b)){var d=c.a?c.a(J(b)):c.call(n,J(b));if(z(d)){b=d;break a}b=L(b)}else{b=n;break a}b=h}return z(b)?Od.b(function(a,b){return Oc.b(z(a)?a:sg,b)},a):n}function ih(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return hh.call(this,b)}ih.r=0;ih.l=function(a){a=I(a);return hh(a)};ih.g=hh;function jh(a,b,c){this.m=a;this.jb=b;this.q=c;this.t=4;this.j=15077647}jh.prototype.Kb=function(){return new kh(ac(this.jb))};
jh.prototype.U=function(a){var b=this.q;if(b!=n)return b;a:{b=0;for(a=I(a);;)if(a)var c=J(a),b=(b+G.a(c))%4503599627370496,a=L(a);else break a;b=h}return this.q=b};jh.prototype.V=function(a,b){return a.L(a,b,n)};jh.prototype.L=function(a,b,c){return z(wb(this.jb,b))?b:c};var lh=n,lh=function(a,b,c){switch(arguments.length){case 2:return this.V(this,b);case 3:return this.L(this,b,c)}e(Error("Invalid arity: "+arguments.length))};v=jh.prototype;v.call=lh;
v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.S=function(a,b){return new jh(this.m,fd.c(this.jb,b,n),n)};v.toString=function(){return ic(this)};v.N=function(){return gh(this.jb)};v.fe=function(a,b){return new jh(this.m,zb(this.jb,b),n)};v.K=function(){return fb(this.jb)};v.P=function(a,b){var c;c=b==n?r:b?((c=b.j&4096)?c:b.ug)?m:b.j?r:A(Db,b):A(Db,b);return c?(c=P(a)===P(b))?kf(function(b){return Fd(a,b)},b):c:c};v.G=function(a,b){return new jh(b,this.jb,this.q)};
v.F=s("m");v.W=function(){return od(mh,this.m)};var mh=new jh(n,sg,0);function nh(a,b){var c=a.length;if(c/2<=pg)return c=b?a:a.slice(),new jh(n,Za.b?Za.b(c,m):Za.call(n,c,m),n);for(var d=0,f=ac(mh);;)if(d<c)var g=d+2,f=bc(f,a[d]),d=g;else return cc(f)}function kh(a){this.ob=a;this.j=259;this.t=136}var oh=n,oh=function(a,b,c){switch(arguments.length){case 2:return sb.c(this.ob,b,Cd)===Cd?n:b;case 3:return sb.c(this.ob,b,Cd)===Cd?c:b}e(Error("Invalid arity: "+arguments.length))};v=kh.prototype;
v.call=oh;v.apply=function(a,b){a=this;return a.call.apply(a,[a].concat(b.slice()))};v.V=function(a,b){return a.L(a,b,n)};v.L=function(a,b,c){return sb.c(this.ob,b,Cd)===Cd?c:b};v.K=function(){return P(this.ob)};v.gb=function(a,b){this.ob=dc(this.ob,b,n);return a};v.tb=function(){return new jh(n,cc(this.ob),n)};var ph,qh=n;
function rh(a){var b=a instanceof lc;if(b?a.e.length<pg:b)for(var a=a.e,b=a.length,c=Array(2*b),d=0;;)if(d<b){var f=2*d;c[f]=a[d];c[f+1]=n;d+=1}else return nh.b?nh.b(c,m):nh.call(n,c,m);else for(c=ac(mh);;)if(a!=n)b=a.ha(a),c=c.gb(c,a.$(a)),a=b;else return c.tb(c)}function sh(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return rh.call(this,b)}sh.r=0;sh.l=function(a){a=I(a);return rh(a)};sh.g=rh;
qh=function(a){switch(arguments.length){case 0:return mh;default:return sh.g(N(arguments,0))}e(Error("Invalid arity: "+arguments.length))};qh.r=0;qh.l=sh.l;qh.h=function(){return mh};qh.g=sh.g;ph=qh;function pe(a){var b;if(b=a)b=(b=a.t&4096)?b:a.qf;if(b)return a.name;if(bb(a))return a;if(Ed(a))return b=a.lastIndexOf("/",a.length-2),0>b?ke.b(a,2):ke.b(a,b+1);e(Error([E("Doesn't support name: "),E(a)].join("")))}
function th(a){var b;if(b=a)b=(b=a.t&4096)?b:a.qf;if(b)return a.Db;if(Ed(a))return b=a.lastIndexOf("/",a.length-2),-1<b?ke.c(a,2,b):n;e(Error([E("Doesn't support namespace: "),E(a)].join("")))}var uh,vh=n;function wh(a){for(;;)if(I(a))a=L(a);else return n}function xh(a,b){for(;;){var c=I(b);if(z(c?0<a:c))var c=a-1,d=L(b),a=c,b=d;else return n}}vh=function(a,b){switch(arguments.length){case 1:return wh.call(this,a);case 2:return xh.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};
vh.a=wh;vh.b=xh;uh=vh;var yh,zh=n;function Ah(a){uh.a(a);return a}function Bh(a,b){uh.b(a,b);return b}zh=function(a,b){switch(arguments.length){case 1:return Ah.call(this,a);case 2:return Bh.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};zh.a=Ah;zh.b=Bh;yh=zh;function Ch(a,b){var c=a.exec(b);return c==n?n:1===P(c)?J(c):Sf(c)}
function Dh(a,b,c,d,f,g,i){D(a,c);I(i)&&(b.c?b.c(J(i),a,g):b.call(n,J(i),a,g));for(var c=I(L(i)),i=n,k=0,l=0;;)if(l<k){var q=i.A(i,l);D(a,d);b.c?b.c(q,a,g):b.call(n,q,a,g);l+=1}else if(c=I(c))i=c,Ad(i)?(c=fc(i),l=gc(i),i=c,k=P(c),c=l):(c=J(i),D(a,d),b.c?b.c(c,a,g):b.call(n,c,a,g),c=L(i),i=n,k=0),l=0;else break;return D(a,f)}
function Eh(a,b){for(var c=I(b),d=n,f=0,g=0;;)if(g<f){var i=d.A(d,g);D(a,i);g+=1}else if(c=I(c))d=c,Ad(d)?(c=fc(d),f=gc(d),d=c,i=P(c),c=f,f=i):(i=J(d),D(a,i),c=L(d),d=n,f=0),g=0;else return n}function Fh(a,b){var c=n;1<arguments.length&&(c=N(Array.prototype.slice.call(arguments,1),0));return Eh.call(this,a,c)}Fh.r=1;Fh.l=function(a){var b=J(a),a=K(a);return Eh(b,a)};Fh.g=Eh;
var Gh={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Ih=function Hh(b,c,d){if(b==n)return D(c,"nil");if(h===b)return D(c,"#<undefined>");var f;f=bd.b(d,"\ufdd0:meta");z(f)&&(f=b?((f=b.j&131072)?f:b.pf)?m:b.j?r:A(Ib,b):A(Ib,b),f=z(f)?pd(b):f);z(f)&&(D(c,"^"),Hh(pd(b),c,d),D(c," "));if(b==n)return D(c,"nil");if(b.za)return b.Fa(b,c,d);if(f=b)f=(f=b.j&2147483648)?f:b.Y;if(f)return b.M(b,c,d);if((f=(b==n?n:b.constructor)===Boolean)?f:"number"===typeof b)return D(c,""+
E(b));if(b instanceof Array)return Dh(c,Hh,"#<Array [",", ","]>",d,b);if(y(b))return Ed(b)?(D(c,":"),d=th(b),z(d)&&Fh.g(c,N([""+E(d),"/"],0)),D(c,pe(b))):b instanceof F?(d=th(b),z(d)&&Fh.g(c,N([""+E(d),"/"],0)),D(c,pe(b))):z((new ze("\ufdd0:readably")).call(n,d))?D(c,[E('"'),E(b.replace(RegExp('[\\\\"\b\f\n\r\t]',"g"),function(b){return Gh[b]})),E('"')].join("")):D(c,b);if(ld(b))return Fh.g(c,N(["#<",""+E(b),">"],0));if(b instanceof Date)return d=function(b,c){for(var d=""+E(b);;)if(P(d)<c)d=[E("0"),
E(d)].join("");else return d},Fh.g(c,N(['#inst "',""+E(b.getUTCFullYear()),"-",d(b.getUTCMonth()+1,2),"-",d(b.getUTCDate(),2),"T",d(b.getUTCHours(),2),":",d(b.getUTCMinutes(),2),":",d(b.getUTCSeconds(),2),".",d(b.getUTCMilliseconds(),3),"-",'00:00"'],0));z(b instanceof RegExp)?b=Fh.g(c,N(['#"',b.source,'"'],0)):(f=b?((f=b.j&2147483648)?f:b.Y)||(b.j?0:A(Yb,b)):A(Yb,b),b=f?Zb(b,c,d):Fh.g(c,N(["#<",""+E(b),">"],0)));return b};
function Jh(a){var b=Ya(),c=a==n;if(c?c:ab(I(a)))b="";else{var c=E,d=new Wa,f=new hc(d);a:{Ih(J(a),f,b);for(var a=I(L(a)),g=n,i=0,k=0;;)if(k<i){var l=g.A(g,k);D(f," ");Ih(l,f,b);k+=1}else if(a=I(a))g=a,Ad(g)?(a=fc(g),i=gc(g),g=a,l=P(a),a=i,i=l):(l=J(g),D(f," "),Ih(l,f,b),a=L(g),g=n,i=0),k=0;else break a}Xb(f);b=""+c(d)}return b}function Kh(a){var b=n;0<arguments.length&&(b=N(Array.prototype.slice.call(arguments,0),0));return Jh(b)}Kh.r=0;Kh.l=function(a){a=I(a);return Jh(a)};Kh.g=function(a){return Jh(a)};
fh.prototype.Y=m;fh.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};lc.prototype.Y=m;lc.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};$f.prototype.Y=m;$f.prototype.M=function(a,b,c){return Dh(b,Ih,"["," ","]",c,a)};Le.prototype.Y=m;Le.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};ng.prototype.Y=m;ng.prototype.M=function(a,b,c){return Dh(b,function(a){return Dh(b,Ih,""," ","",c,a)},"{",", ","}",c,a)};De.prototype.Y=m;
De.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};Qg.prototype.Y=m;Qg.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};Uf.prototype.Y=m;Uf.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};Yg.prototype.Y=m;Yg.prototype.M=function(a,b,c){return Dh(b,function(a){return Dh(b,Ih,""," ","",c,a)},"{",", ","}",c,a)};jh.prototype.Y=m;jh.prototype.M=function(a,b,c){return Dh(b,Ih,"#{"," ","}",c,a)};Kf.prototype.Y=m;
Kf.prototype.M=function(a,b,c){return Dh(b,Ih,"["," ","]",c,a)};ue.prototype.Y=m;ue.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};mg.prototype.Y=m;mg.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};ve.prototype.Y=m;ve.prototype.M=function(a,b){return D(b,"()")};ye.prototype.Y=m;ye.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};Ug.prototype.Y=m;Ug.prototype.M=function(a,b,c){return Dh(b,Ih,"("," ",")",c,a)};Kf.prototype.be=m;
Kf.prototype.ce=function(a,b){return Hd.b(a,b)};$f.prototype.be=m;$f.prototype.ce=function(a,b){return Hd.b(a,b)};function Lh(a,b,c,d){this.state=a;this.m=b;this.dg=c;this.eg=d;this.j=2153938944;this.t=2}v=Lh.prototype;v.U=function(a){return la(a)};
v.ge=function(a,b,c){for(var d=I(this.eg),f=n,g=0,i=0;;)if(i<g){var k=f.A(f,i),l=R.c(k,0,n),k=R.c(k,1,n);k.n?k.n(l,a,b,c):k.call(n,l,a,b,c);i+=1}else if(d=I(d))Ad(d)?(f=fc(d),d=gc(d),l=f,g=P(f),f=l):(f=J(d),l=R.c(f,0,n),k=R.c(f,1,n),k.n?k.n(l,a,b,c):k.call(n,l,a,b,c),d=L(d),f=n,g=0),i=0;else return n};v.M=function(a,b,c){D(b,"#<Atom: ");Ih(this.state,b,c);return D(b,">")};v.F=s("m");v.Vc=s("state");v.P=function(a,b){return a===b};var Mh,Nh=n;function Oh(a){return new Lh(a,n,n,n)}
function Ph(a,b){var c=Dd(b)?nd.b(id,b):b,d=bd.b(c,"\ufdd0:validator"),c=bd.b(c,"\ufdd0:meta");return new Lh(a,c,d,n)}function Qh(a,b){var c=n;1<arguments.length&&(c=N(Array.prototype.slice.call(arguments,1),0));return Ph.call(this,a,c)}Qh.r=1;Qh.l=function(a){var b=J(a),a=K(a);return Ph(b,a)};Qh.g=Ph;Nh=function(a,b){switch(arguments.length){case 1:return Oh.call(this,a);default:return Qh.g(a,N(arguments,1))}e(Error("Invalid arity: "+arguments.length))};Nh.r=1;Nh.l=Qh.l;Nh.a=Oh;Nh.g=Qh.g;Mh=Nh;
function Rh(a,b){var c=a.dg;z(c)&&!z(c.a?c.a(b):c.call(n,b))&&e(Error([E("Assert failed: "),E("Validator rejected reference state"),E("\n"),E(Kh.g(N([Ec(new F(n,"validate","validate",1233162959,n),new F(n,"new-value","new-value",972165309,n))],0)))].join("")));c=a.state;a.state=b;$b(a,c,b);return b}var Sh,Th=n;function Uh(a,b){return Rh(a,b.a?b.a(a.state):b.call(n,a.state))}function Vh(a,b,c){return Rh(a,b.b?b.b(a.state,c):b.call(n,a.state,c))}
function Wh(a,b,c,d){return Rh(a,b.c?b.c(a.state,c,d):b.call(n,a.state,c,d))}function Xh(a,b,c,d,f){return Rh(a,b.n?b.n(a.state,c,d,f):b.call(n,a.state,c,d,f))}function Yh(a,b,c,d,f,g){return Rh(a,nd.g(b,a.state,c,d,f,N([g],0)))}function Zh(a,b,c,d,f,g){var i=n;5<arguments.length&&(i=N(Array.prototype.slice.call(arguments,5),0));return Yh.call(this,a,b,c,d,f,i)}Zh.r=5;Zh.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=L(a),f=J(a),a=L(a),g=J(a),a=K(a);return Yh(b,c,d,f,g,a)};Zh.g=Yh;
Th=function(a,b,c,d,f,g){switch(arguments.length){case 2:return Uh.call(this,a,b);case 3:return Vh.call(this,a,b,c);case 4:return Wh.call(this,a,b,c,d);case 5:return Xh.call(this,a,b,c,d,f);default:return Zh.g(a,b,c,d,f,N(arguments,5))}e(Error("Invalid arity: "+arguments.length))};Th.r=5;Th.l=Zh.l;Th.b=Uh;Th.c=Vh;Th.n=Wh;Th.T=Xh;Th.g=Zh.g;Sh=Th;var $h={};
function ai(a,b){if(a?a.nf:a)return a.nf(a,b);var c;var d=ai[w(a==n?n:a)];d?c=d:(d=ai._)?c=d:e(B("IEncodeClojure.-js->clj",a));return c.call(n,a,b)}var bi,ci=n;function di(a){return ci.g(a,N([Za(["\ufdd0:keywordize-keys",r],m)],0))}
function ei(a,b){if($h?z(z(n)?n:$h.xg)||($h.tf?0:A(a,$h)):A(a,$h))return ai(a,nd.b(eh,b));if(I(b)){var c=Dd(b)?nd.b(id,b):b,c=bd.b(c,"\ufdd0:keywordize-keys"),d=z(c)?me:E;return function g(a){var b;if(Dd(a))b=yh.a(nf.b(g,a));else if(b=a==n?r:a?((b=a.j&8)?b:a.qg)?m:a.j?r:A(hb,a):A(hb,a),b)b=Af(gb(a),nf.b(g,a));else if(a instanceof Array)b=Sf(nf.b(g,a));else if((a==n?n:a.constructor)===Object){b=sg;var c=[];Qa(a,function(a,b){return c.push(b)});b=Af(b,function p(b){return new De(n,r,function(){for(;;){var c=
I(b);if(c){if(Ad(c)){var k=fc(c),j=P(k),l=new Ee(Array(j),0);a:{for(var U=0;;)if(U<j){var Q=C.b(k,U),Q=S([d.a?d.a(Q):d.call(n,Q),g(a[Q])]);l.add(Q);U+=1}else{k=m;break a}k=h}return k?Me(l.pa(),p(gc(c))):Me(l.pa(),n)}l=J(c);return O(S([d.a?d.a(l):d.call(n,l),g(a[l])]),p(K(c)))}return n}},n)}(c))}else b=a;return b}(a)}return n}function fi(a,b){var c=n;1<arguments.length&&(c=N(Array.prototype.slice.call(arguments,1),0));return ei.call(this,a,c)}fi.r=1;fi.l=function(a){var b=J(a),a=K(a);return ei(b,a)};
fi.g=ei;ci=function(a,b){switch(arguments.length){case 1:return di.call(this,a);default:return fi.g(a,N(arguments,1))}e(Error("Invalid arity: "+arguments.length))};ci.r=1;ci.l=fi.l;ci.a=di;ci.g=fi.g;bi=ci;var gi=n;function hi(){return gi.a(1)}function ii(a){return(Math.random.h?Math.random.h():Math.random.call(n))*a}gi=function(a){switch(arguments.length){case 0:return hi.call(this);case 1:return ii.call(this,a)}e(Error("Invalid arity: "+arguments.length))};gi.h=hi;gi.a=ii;Wd=gi;
$d=function(a){return Math.floor.a?Math.floor.a((Math.random.h?Math.random.h():Math.random.call(n))*a):Math.floor.call(n,(Math.random.h?Math.random.h():Math.random.call(n))*a)};var ji,ki,li,mi;function ni(){return ca.navigator?ca.navigator.userAgent:n}mi=li=ki=ji=r;var oi;if(oi=ni()){var pi=ca.navigator;ji=0==oi.indexOf("Opera");ki=!ji&&-1!=oi.indexOf("MSIE");li=!ji&&-1!=oi.indexOf("WebKit");mi=!ji&&!li&&"Gecko"==pi.product}var qi=ji,ri=ki,si=mi,ti=li,ui=ca.navigator,vi=-1!=(ui&&ui.platform||"").indexOf("Mac"),wi;
a:{var xi="",yi;if(qi&&ca.opera)var zi=ca.opera.version,xi="function"==typeof zi?zi():zi;else if(si?yi=/rv\:([^\);]+)(\)|;)/:ri?yi=/MSIE\s+([^\);]+)(\)|;)/:ti&&(yi=/WebKit\/(\S+)/),yi)var Ai=yi.exec(ni()),xi=Ai?Ai[1]:"";if(ri){var Bi,Ci=ca.document;Bi=Ci?Ci.documentMode:h;if(Bi>parseFloat(xi)){wi=String(Bi);break a}}wi=xi}var Di={};
function Ei(a){var b;if(!(b=Di[a])){b=0;for(var c=String(wi).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=Math.max(c.length,d.length),g=0;0==b&&g<f;g++){var i=c[g]||"",k=d[g]||"",l=RegExp("(\\d*)(\\D*)","g"),q=RegExp("(\\d*)(\\D*)","g");do{var p=l.exec(i)||["","",""],u=q.exec(k)||["","",""];if(0==p[0].length&&0==u[0].length)break;b=((0==p[1].length?0:parseInt(p[1],10))<(0==u[1].length?0:parseInt(u[1],10))?-1:(0==p[1].length?0:parseInt(p[1],
10))>(0==u[1].length?0:parseInt(u[1],10))?1:0)||((0==p[2].length)<(0==u[2].length)?-1:(0==p[2].length)>(0==u[2].length)?1:0)||(p[2]<u[2]?-1:p[2]>u[2]?1:0)}while(0==b)}b=Di[a]=0<=b}return b}var Fi={};function Gi(){return Fi[9]||(Fi[9]=ri&&!!document.documentMode&&9<=document.documentMode)};!ri||Gi();var Hi=!ri||Gi(),Ii=ri&&!Ei("8");!ti||Ei("528");si&&Ei("1.9b")||ri&&Ei("8")||qi&&Ei("9.5")||ti&&Ei("528");si&&!Ei("8")||ri&&Ei("9");function Ji(){this.ia=r}Ji.prototype.td=function(){this.ia||(this.ia=m,this.H())};Ji.prototype.H=function(){this.Cf&&Ki.apply(n,this.Cf);if(this.Qe)for(;this.Qe.length;)this.Qe.shift()()};function Li(a){a&&"function"==typeof a.td&&a.td()}function Ki(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];ha(d)?Ki.apply(n,d):Li(d)}};function Mi(a,b){this.type=a;this.currentTarget=this.target=b}v=Mi.prototype;v.H=function(){};v.td=function(){};v.Eb=r;v.defaultPrevented=r;v.Gc=m;v.preventDefault=function(){this.defaultPrevented=m;this.Gc=r};function Ni(a){Ni[" "](a);return a}Ni[" "]=fa;function Oi(a,b){try{return Ni(a[b]),m}catch(c){}return r};function Pi(a,b){a&&this.wc(a,b)}ta(Pi,Mi);v=Pi.prototype;v.target=n;v.relatedTarget=n;v.offsetX=0;v.offsetY=0;v.clientX=0;v.clientY=0;v.screenX=0;v.screenY=0;v.button=0;v.keyCode=0;v.charCode=0;v.ctrlKey=r;v.altKey=r;v.shiftKey=r;v.metaKey=r;v.Uf=r;v.uc=n;
v.wc=function(a,b){var c=this.type=a.type;Mi.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;d?si&&(Oi(d,"nodeName")||(d=n)):"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=ti||a.offsetX!==h?a.offsetX:a.layerX;this.offsetY=ti||a.offsetY!==h?a.offsetY:a.layerY;this.clientX=a.clientX!==h?a.clientX:a.pageX;this.clientY=a.clientY!==h?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=
a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.Uf=vi?a.metaKey:a.ctrlKey;this.state=a.state;this.uc=a;a.defaultPrevented&&this.preventDefault();delete this.Eb};v.preventDefault=function(){Pi.na.preventDefault.call(this);var a=this.uc;if(a.preventDefault)a.preventDefault();else if(a.returnValue=r,Ii)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};
v.H=function(){};function Qi(){}var Ri=0;v=Qi.prototype;v.key=0;v.Fb=r;v.Rc=r;v.wc=function(a,b,c,d,f,g){ja(a)?this.He=m:a&&a.handleEvent&&ja(a.handleEvent)?this.He=r:e(Error("Invalid listener argument"));this.Xb=a;this.Te=b;this.src=c;this.type=d;this.capture=!!f;this.yb=g;this.Rc=r;this.key=++Ri;this.Fb=r};v.handleEvent=function(a){return this.He?this.Xb.call(this.yb||this.src,a):this.Xb.handleEvent.call(this.Xb,a)};var Si={},Ti={},Ui={},Vi={};
function Wi(a,b,c,d,f){if(b){if(ga(b)){for(var g=0;g<b.length;g++)Wi(a,b[g],c,d,f);return n}var d=!!d,i=Ti;b in i||(i[b]={B:0,ma:0});i=i[b];d in i||(i[d]={B:0,ma:0},i.B++);var i=i[d],k=la(a),l;i.ma++;if(i[k]){l=i[k];for(g=0;g<l.length;g++)if(i=l[g],i.Xb==c&&i.yb==f){if(i.Fb)break;return l[g].key}}else l=i[k]=[],i.B++;var q=Xi,p=Hi?function(a){return q.call(p.src,p.key,a)}:function(a){a=q.call(p.src,p.key,a);if(!a)return a},g=p;g.src=a;i=new Qi;i.wc(c,g,a,b,d,f);c=i.key;g.key=c;l.push(i);Si[c]=i;Ui[k]||
(Ui[k]=[]);Ui[k].push(i);a.addEventListener?(a==ca||!a.ue)&&a.addEventListener(b,g,d):a.attachEvent(b in Vi?Vi[b]:Vi[b]="on"+b,g);return c}e(Error("Invalid event type"))}function Yi(a,b,c,d,f){if(ga(b)){for(var g=0;g<b.length;g++)Yi(a,b[g],c,d,f);return n}a=Wi(a,b,c,d,f);Si[a].Rc=m;return a}
function Zi(a,b,c,d,f){if(ga(b))for(var g=0;g<b.length;g++)Zi(a,b[g],c,d,f);else{d=!!d;a:{g=Ti;if(b in g&&(g=g[b],d in g&&(g=g[d],a=la(a),g[a]))){a=g[a];break a}a=n}if(a)for(g=0;g<a.length;g++)if(a[g].Xb==c&&a[g].capture==d&&a[g].yb==f){$i(a[g].key);break}}}
function $i(a){if(!Si[a])return r;var b=Si[a];if(b.Fb)return r;var c=b.src,d=b.type,f=b.Te,g=b.capture;c.removeEventListener?(c==ca||!c.ue)&&c.removeEventListener(d,f,g):c.detachEvent&&c.detachEvent(d in Vi?Vi[d]:Vi[d]="on"+d,f);c=la(c);Ui[c]&&(f=Ui[c],Na(f,b),0==f.length&&delete Ui[c]);b.Fb=m;if(b=Ti[d][g][c])b.Ne=m,aj(d,g,c,b);delete Si[a];return m}
function aj(a,b,c,d){if(!d.xc&&d.Ne){for(var f=0,g=0;f<d.length;f++)d[f].Fb?d[f].Te.src=n:(f!=g&&(d[g]=d[f]),g++);d.length=g;d.Ne=r;0==g&&(delete Ti[a][b][c],Ti[a][b].B--,0==Ti[a][b].B&&(delete Ti[a][b],Ti[a].B--),0==Ti[a].B&&delete Ti[a])}}function bj(a,b,c,d,f){var g=1,b=la(b);if(a[b]){a.ma--;a=a[b];a.xc?a.xc++:a.xc=1;try{for(var i=a.length,k=0;k<i;k++){var l=a[k];l&&!l.Fb&&(g&=cj(l,f)!==r)}}finally{a.xc--,aj(c,d,b,a)}}return Boolean(g)}function cj(a,b){a.Rc&&$i(a.key);return a.handleEvent(b)}
function Xi(a,b){if(!Si[a])return m;var c=Si[a],d=c.type,f=Ti;if(!(d in f))return m;var f=f[d],g,i;if(!Hi){g=b||ea("window.event");var k=m in f,l=r in f;if(k){if(0>g.keyCode||g.returnValue!=h)return m;a:{var q=r;if(0==g.keyCode)try{g.keyCode=-1;break a}catch(p){q=m}if(q||g.returnValue==h)g.returnValue=m}}q=new Pi;q.wc(g,this);g=m;try{if(k){for(var u=[],t=q.currentTarget;t;t=t.parentNode)u.push(t);i=f[m];i.ma=i.B;for(var x=u.length-1;!q.Eb&&0<=x&&i.ma;x--)q.currentTarget=u[x],g&=bj(i,u[x],d,m,q);if(l){i=
f[r];i.ma=i.B;for(x=0;!q.Eb&&x<u.length&&i.ma;x++)q.currentTarget=u[x],g&=bj(i,u[x],d,r,q)}}else g=cj(c,q)}finally{u&&(u.length=0)}return g}d=new Pi(b,this);return g=cj(c,d)};var dj;!ri||Gi();var ej=!si&&!ri||ri&&Gi()||si&&Ei("1.9.1");ri&&Ei("9");function fj(a){return a?new gj(hj(a)):dj||(dj=new gj)}function ij(a,b){a.appendChild(b)}function jj(a){for(var b;b=a.firstChild;)a.removeChild(b)}function kj(a){a&&a.parentNode&&a.parentNode.removeChild(a)}function hj(a){return 9==a.nodeType?a:a.ownerDocument||a.document}
function lj(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else jj(a),a.appendChild(hj(a).createTextNode(b))}function gj(a){this.Ob=a||ca.document||document}v=gj.prototype;v.createElement=function(a){return this.Ob.createElement(a)};v.createTextNode=function(a){return this.Ob.createTextNode(a)};v.C=function(){return this.Ob.parentWindow||this.Ob.defaultView};v.appendChild=ij;
v.append=function(a,b){function c(a){a&&f.appendChild(y(a)?d.createTextNode(a):a)}for(var d=hj(a),f=a,g=arguments,i=1;i<g.length;i++){var k=g[i];if(ha(k)&&!(ka(k)&&0<k.nodeType)){var l=Ka,q;a:{if((q=k)&&"number"==typeof q.length){if(ka(q)){q="function"==typeof q.item||"string"==typeof q.item;break a}if(ja(q)){q="function"==typeof q.item;break a}}q=r}l(q?Pa(k):k,c)}else c(k)}};v.De=function(a){return ej&&a.children!=h?a.children:La(a.childNodes,function(a){return 1==a.nodeType})};var mj=document.createElement("div");mj.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var nj=M.b(mj.firstChild.nodeType,3),oj=M.b(mj.getElementsByTagName("tbody").length,0);M.b(mj.getElementsByTagName("link").length,0);function pj(a){if("function"==typeof a.Ma)return a.Ma();if(y(a))return a.split("");if(ha(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Ra(a)};function qj(a,b){this.Oa={};this.O=[];var c=arguments.length;if(1<c){c%2&&e(Error("Uneven number of arguments"));for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof qj?(c=a.xb(),d=a.Ma()):(c=Sa(a),d=Ra(a));for(var f=0;f<c.length;f++)this.set(c[f],d[f])}}v=qj.prototype;v.B=0;v.af=0;v.Ma=function(){rj(this);for(var a=[],b=0;b<this.O.length;b++)a.push(this.Oa[this.O[b]]);return a};v.xb=function(){rj(this);return this.O.concat()};v.Nb=function(a){return sj(this.Oa,a)};
v.remove=function(a){return sj(this.Oa,a)?(delete this.Oa[a],this.B--,this.af++,this.O.length>2*this.B&&rj(this),m):r};function rj(a){if(a.B!=a.O.length){for(var b=0,c=0;b<a.O.length;){var d=a.O[b];sj(a.Oa,d)&&(a.O[c++]=d);b++}a.O.length=c}if(a.B!=a.O.length){for(var f={},c=b=0;b<a.O.length;)d=a.O[b],sj(f,d)||(a.O[c++]=d,f[d]=1),b++;a.O.length=c}}v.get=function(a,b){return sj(this.Oa,a)?this.Oa[a]:b};v.set=function(a,b){sj(this.Oa,a)||(this.B++,this.O.push(a),this.af++);this.Oa[a]=b};v.qc=function(){return new qj(this)};
function sj(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function tj(a){var b=uj;if(bb(b))return a.replace(RegExp(String(b).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"),"g"),"<$1></$2>");if(z(b.hasOwnProperty("source")))return a.replace(RegExp(b.source,"g"),"<$1></$2>");e([E("Invalid match arg: "),E(b)].join(""))};function vj(a,b,c){a.style[String(c).replace(/\-([a-z])/g,function(a,b){return b.toUpperCase()})]=b};var wj=/<|&#?\w+;/,xj=/^\s+/,uj=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/i,yj=/<([\w:]+)/,zj=/<(?:script|style)/i,Aj=/<tbody/i,Bj=S([1,"<select multiple='multiple'>","</select>"]),Cj=S([1,"<table>","</table>"]),Dj=S([3,"<table><tbody><tr>","</tr></tbody></table>"]),Ej;
a:{for(var Fj="col \ufdd0:default tfoot caption optgroup legend area td thead th option tbody tr colgroup".split(" "),Gj=[S([2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]),S([0,"",""]),Cj,Cj,Bj,S([1,"<fieldset>","</fieldset>"]),S([1,"<map>","</map>"]),Dj,Cj,Dj,Bj,Cj,S([2,"<table><tbody>","</tbody></table>"]),Cj],Hj=Fj.length,Ij=0,Jj=ac(qg);;)if(Ij<Hj)var Kj=Ij+1,Lj=dc(Jj,Fj[Ij],Gj[Ij]),Ij=Kj,Jj=Lj;else{Ej=cc(Jj);break a}Ej=h}
function Mj(a){var a=tj(a),b=(""+E(Nc(Ch(yj,a)))).toLowerCase(),c=bd.c(Ej,b,(new ze("\ufdd0:default")).call(n,Ej)),d=R.c(c,0,n),f=R.c(c,1,n),c=R.c(c,2,n);a:{var g=document.createElement("div");g.innerHTML=[E(f),E(a),E(c)].join("");for(c=g;;)if(0<d)d-=1,c=c.lastChild;else{d=c;break a}d=h}if(z(oj))a:{c=d;g=ab(Ch(Aj,a));((b=M.b(b,"table"))?g:b)?(f=c.firstChild,f=z(f)?c.firstChild.childNodes:f):f=((f=M.b(f,"<table>"))?g:f)?divchildNodes:Qf;for(var f=I(f),c=n,i=g=0;;)if(i<g){var b=c.A(c,i),k=M.b(b.nodeName,
"tbody");(k?M.b(b.childNodes.length,0):k)&&b.parentNode.removeChild(b);i+=1}else if(f=I(f))Ad(f)?(c=fc(f),f=gc(f),b=c,g=P(c),c=b):(b=J(f),((c=M.b(b.nodeName,"tbody"))?M.b(b.childNodes.length,0):c)&&b.parentNode.removeChild(b),f=L(f),c=n,g=0),i=0;else break a}f=(f=ab(nj))?Ch(xj,a):f;z(f)&&d.insertBefore(document.createTextNode(J(Ch(xj,a))),d.firstChild);return d.childNodes}
function Nj(a){if(a?a.Ef:a)return a.Ef(a);var b;var c=Nj[w(a==n?n:a)];c?b=c:(c=Nj._)?b=c:e(B("DomContent.nodes",a));return b.call(n,a)}function Oj(a){a=pe(a);return y(a)?document.getElementById(a):a}function Pj(a,b,c){for(var d=I(Nj(a)),f=n,g=0,i=0;;)if(i<g){var k=f.A(f,i),l=pe(b),q=nd.b(E,c);y(l)?vj(k,q,l):Qa(l,ra(vj,k));i+=1}else if(d=I(d))Ad(d)?(g=fc(d),d=gc(d),f=g,g=P(g)):(f=J(d),g=pe(b),i=nd.b(E,c),y(g)?vj(f,i,g):Qa(g,ra(vj,f)),d=L(d),f=n,g=0),i=0;else break;return a}
function Qj(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return Pj.call(this,a,b,d)}Qj.r=2;Qj.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return Pj(b,c,a)};Qj.g=Pj;function Rj(a,b,c){for(var d=I(Nj(a)),f=n,g=0,i=0;;)if(i<g)f.A(f,i).setAttribute(pe(b),nd.b(E,c)),i+=1;else if(d=I(d))f=d,Ad(f)?(d=fc(f),i=gc(f),f=d,g=P(d),d=i):(J(f).setAttribute(pe(b),nd.b(E,c)),d=L(f),f=n,g=0),i=0;else break;return a}
function Sj(a,b,c){var d=n;2<arguments.length&&(d=N(Array.prototype.slice.call(arguments,2),0));return Rj.call(this,a,b,d)}Sj.r=2;Sj.l=function(a){var b=J(a),a=L(a),c=J(a),a=K(a);return Rj(b,c,a)};Sj.g=Rj;function Tj(a,b){for(var c=I(Nj(a)),d=n,f=0,g=0;;)if(g<f){var i=d.A(d,g);lj(i,b);g+=1}else if(c=I(c))d=c,Ad(d)?(c=fc(d),g=gc(d),d=c,f=P(c),c=g):(c=J(d),lj(c,b),c=L(d),d=n,f=0),g=0;else break;return a}function Uj(a,b){uh.a(nf.b(jj,Nj(a)));Vj.c?Vj.c(ij,a,b):Vj.call(n,ij,a,b);return a}
function Vj(a,b,c){for(var b=Nj(b),d=Nj(c),c=document.createDocumentFragment(),f=I(d),g=n,i=0,k=0;;)if(k<i){var l=g.A(g,k);c.appendChild(l);k+=1}else if(f=I(f))g=f,Ad(g)?(f=fc(g),k=gc(g),g=f,i=P(f),f=k):(f=J(g),c.appendChild(f),f=L(g),g=n,i=0),k=0;else break;d=yh.a(wf.b(P(b)-1,function(a,b,c){return function(){return c.cloneNode(m)}}(b,d,c)));return I(b)?(a.b?a.b(J(b),c):a.call(n,J(b),c),yh.a(nf.c(function(b,c){return a.b?a.b(b,c):a.call(n,b,c)},K(b),d))):n}var Wj,Xj=n;
function Yj(a){return Xj.b(a,0)}function Zj(a,b){return b<a.length?new De(n,r,function(){return O(a.item(b),Xj.b(a,b+1))},n):n}Xj=function(a,b){switch(arguments.length){case 1:return Yj.call(this,a);case 2:return Zj.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};Xj.a=Yj;Xj.b=Zj;Wj=Xj;var $j,ak=n;function bk(a){return ak.b(a,0)}function ck(a,b){return b<a.length?new De(n,r,function(){return O(a[b],ak.b(a,b+1))},n):n}
ak=function(a,b){switch(arguments.length){case 1:return bk.call(this,a);case 2:return ck.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};ak.a=bk;ak.b=ck;$j=ak;function dk(a){return z(a.item)?Wj.a(a):$j.a(a)}Nj._=function(a){if(a==n)a=mc;else{var b;b=a?((b=a.j&8388608)?b:a.nc)||(a.j?0:A(Ub,a)):A(Ub,a);b?a=I(a):(b=z(a)?(b=ab(a.nodeName))?a.length:b:a,a=z(b)?dk(a):I(S([a])))}return a};Nj.string=function(a){return yh.a(Nj(z(Ch(wj,a))?Mj(a):document.createTextNode(a)))};
z("undefined"!=typeof NodeList)&&(v=NodeList.prototype,v.nc=m,v.N=function(a){return dk(a)},v.Mb=m,v.A=function(a,b){return a.item(b)},v.X=function(a,b,c){return a.length<=b?c:R.b(a,b)},v.mc=m,v.K=function(a){return a.length});z("undefined"!=typeof StaticNodeList)&&(v=StaticNodeList.prototype,v.nc=m,v.N=function(a){return dk(a)},v.Mb=m,v.A=function(a,b){return a.item(b)},v.X=function(a,b,c){return a.length<=b?c:R.b(a,b)},v.mc=m,v.K=function(a){return a.length});
z("undefined"!=typeof HTMLCollection)&&(v=HTMLCollection.prototype,v.nc=m,v.N=function(a){return dk(a)},v.Mb=m,v.A=function(a,b){return a.item(b)},v.X=function(a,b,c){return a.length<=b?c:R.b(a,b)},v.mc=m,v.K=function(a){return a.length});var ek,fk=window.document.documentElement,hk=function gk(b){return function(c){b.a?b.a(function(){h===ek&&(ek={},ek=function(b,c,g,i){this.hb=b;this.La=c;this.rd=g;this.yd=i;this.t=0;this.j=393472},ek.za=m,ek.Ga="domina.events/t8861",ek.Fa=function(b,c){return D(c,"domina.events/t8861")},ek.prototype.V=function(b,c){var g=this.hb[c];return z(g)?g:this.hb[pe(c)]},ek.prototype.L=function(b,c,g){b=b.V(b,c);return z(b)?b:g},ek.prototype.F=s("yd"),ek.prototype.G=function(b,c){return new ek(this.hb,this.La,
this.rd,c)});return new ek(c,b,gk,n)}()):b.call(n,function(){h===ek&&(ek=function(b,c,g,i){this.hb=b;this.La=c;this.rd=g;this.yd=i;this.t=0;this.j=393472},ek.za=m,ek.Ga="domina.events/t8861",ek.Fa=function(b,c){return D(c,"domina.events/t8861")},ek.prototype.V=function(b,c){var g=this.hb[c];return z(g)?g:this.hb[pe(c)]},ek.prototype.L=function(b,c,g){b=b.V(b,c);return z(b)?b:g},ek.prototype.F=s("yd"),ek.prototype.G=function(b,c){return new ek(this.hb,this.La,this.rd,c)});return new ek(c,b,gk,n)}());
return m}};function ik(a,b,c,d){var f=hk(c),g=pe(b);return yh.a(function k(a){return new De(n,r,function(){for(;;){var b=I(a);if(b){if(Ad(b)){var c=fc(b),u=P(c),t=new Ee(Array(u),0);a:{for(var x=0;;)if(x<u){var j=C.b(c,x),j=z(d)?Yi(j,g,f,r):Wi(j,g,f,r);t.add(j);x+=1}else{c=m;break a}c=h}return c?Me(t.pa(),k(gc(b))):Me(t.pa(),n)}t=J(b);return O(z(d)?Yi(t,g,f,r):Wi(t,g,f,r),k(K(b)))}return n}},n)}(Nj(a)))}var jk,kk=n;function lk(a,b){return kk.c(fk,a,b)}function mk(a,b,c){return ik(a,b,c,r)}
kk=function(a,b,c){switch(arguments.length){case 2:return lk.call(this,a,b);case 3:return mk.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};kk.b=lk;kk.c=mk;jk=kk;var nk,ok=n;function pk(a,b){return ok.c(fk,a,b)}function qk(a,b,c){return ik(a,b,c,m)}ok=function(a,b,c){switch(arguments.length){case 2:return pk.call(this,a,b);case 3:return qk.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};ok.b=pk;ok.c=qk;nk=ok;var rk,sk,tk;function uk(a,b){if(a?a.pd:a)return a.pd(0,b);var c;var d=uk[w(a==n?n:a)];d?c=d:(d=uk._)?c=d:e(B("ReadPort.take!",a));return c.call(n,a,b)}function vk(a,b,c){if(a?a.pc:a)return a.pc(0,b,c);var d;var f=vk[w(a==n?n:a)];f?d=f:(f=vk._)?d=f:e(B("WritePort.put!",a));return d.call(n,a,b,c)}function wk(a){if(a?a.oc:a)return a.oc();var b;var c=wk[w(a==n?n:a)];c?b=c:(c=wk._)?b=c:e(B("Channel.close!",a));return b.call(n,a)}
function xk(a){if(a?a.ya:a)return a.ya(a);var b;var c=xk[w(a==n?n:a)];c?b=c:(c=xk._)?b=c:e(B("Handler.active?",a));return b.call(n,a)}function yk(a){if(a?a.da:a)return a.da(a);var b;var c=yk[w(a==n?n:a)];c?b=c:(c=yk._)?b=c:e(B("Handler.commit",a));return b.call(n,a)};var zk,Bk=function Ak(b){h===zk&&(zk={},zk=function(b,d,f){this.La=b;this.vd=d;this.Qf=f;this.t=0;this.j=393216},zk.za=m,zk.Ga="cljs.core.async.impl.ioc-helpers/t9538",zk.Fa=function(b,d){return D(d,"cljs.core.async.impl.ioc-helpers/t9538")},zk.prototype.ya=ba(m),zk.prototype.da=s("La"),zk.prototype.F=s("Qf"),zk.prototype.G=function(b,d){return new zk(this.La,this.vd,d)});return new zk(b,Ak,n)};function Ck(a){try{return a[0].call(n,a)}catch(b){b instanceof Object&&a[4].oc(),e(b)}}
function T(a,b,c){c=c.pd(0,Bk(function(c){a[2]=c;a[1]=b;return Ck(a)}));return z(c)?(a[2]=Hb(c),a[1]=b,"\ufdd0:recur"):n}function Dk(a,b,c,d){c=c.pc(0,d,Bk(function(){a[2]=n;a[1]=b;return Ck(a)}));return z(c)?(a[2]=Hb(c),a[1]=b,"\ufdd0:recur"):n}
function Ek(a,b,c,d){d=Dd(d)?nd.b(id,d):d;a[1]=b;a:{var f=function(b){a[2]=b;return Ck(a)},g=Fk(),b=P(c),i;b:{i=Array(b);for(var k=0;;)if(k<b)i[k]=0,k+=1;else break;for(k=1;;){if(M.b(k,b))break b;var l=$d(k);i[k]=i[l];i[l]=k;k+=1}i=h}k=(new ze("\ufdd0:priority")).call(n,d);b:{for(l=0;;)if(l<b){var q=z(k)?l:i[l],p=R.b(c,q),u=zd(p)?p.a?p.a(0):p.call(n,0):n,q=z(u)?function(){var a=p.a?p.a(1):p.call(n,1),b=u;return vk(u,a,Gk(g,function(){return f.a?f.a(S([n,b])):f.call(n,S([n,b]))}))}():uk(p,Gk(g,function(a,
b,c){return function(a){return f.a?f.a(S([a,c])):f.call(n,S([a,c]))}}(l,q,p,u,g,b,i,k)));if(z(q)){c=Hk;b=Hb(q);i=u;c=c(S([b,z(i)?i:p]));break b}l+=1}else{c=n;break b}c=h}if(z(c))d=c;else{if(Fd(d,"\ufdd0:default")&&(c=xk(g),c=z(c)?yk(g):c,z(c))){d=Hk(S([(new ze("\ufdd0:default")).call(n,d),"\ufdd0:default"]));break a}d=n}}return z(d)?(a[2]=Hb(d),"\ufdd0:recur"):n}function Ik(a,b,c,d){var f=n;3<arguments.length&&(f=N(Array.prototype.slice.call(arguments,3),0));return Ek.call(this,a,b,c,f)}Ik.r=3;
Ik.l=function(a){var b=J(a),a=L(a),c=J(a),a=L(a),d=J(a),a=K(a);return Ek(b,c,d,a)};Ik.g=Ek;function Jk(a,b){var c=a[4];b!=n&&c.pc(0,b,Bk(ba(n)));c.oc();return c};function Kk(a,b,c,d,f){for(var g=0;;)if(g<f)c[d+g]=a[b+g],g+=1;else break}function Lk(a,b,c,d){this.head=a;this.z=b;this.length=c;this.e=d}Lk.prototype.pop=function(){if(0===this.length)return n;var a=this.e[this.z];this.e[this.z]=n;this.z=(this.z+1)%this.e.length;this.length-=1;return a};Lk.prototype.unshift=function(a){this.e[this.head]=a;this.head=(this.head+1)%this.e.length;this.length+=1;return n};
function Mk(a,b){if(a.length+1===a.e.length){var c=Array(2*a.e.length);a.z<a.head?(Kk(a.e,a.z,c,0,a.length),a.z=0,a.head=a.length,a.e=c):a.z>a.head?(Kk(a.e,a.z,c,0,a.e.length-a.z),Kk(a.e,0,c,a.e.length-a.z,a.head),a.z=0,a.head=a.length,a.e=c):a.z===a.head&&(a.z=0,a.head=0,a.e=c)}a.unshift(b)}function Nk(a,b){for(var c=a.length,d=0;;)if(d<c){var f=a.pop();(b.a?b.a(f):b.call(n,f))&&a.unshift(f);d+=1}else break}
function Ok(a){0<a||e(Error([E("Assert failed: "),E("Can't create a ring buffer of size 0"),E("\n"),E(Kh.g(N([Ec(new F(n,">",">",-1640531465,n),new F(n,"n","n",-1640531417,n),0)],0)))].join("")));return new Lk(0,0,0,Array(a))}function Pk(a,b){this.J=a;this.Ad=b;this.t=0;this.j=2}Pk.prototype.K=function(){return this.J.length};Pk.prototype.nd=function(){return this.J.length===this.Ad};Pk.prototype.od=function(){return this.J.pop()};
Pk.prototype.ie=function(a,b){ab(a.nd(a))||e(Error([E("Assert failed: "),E("Can't add to a full buffer"),E("\n"),E(Kh.g(N([Ec(new F(n,"not","not",-1640422260,n),Ec(new F("impl","full?","impl/full?",-1337857039,n),new F(n,"this","this",-1636972457,n)))],0)))].join("")));return this.J.unshift(b)};function Qk(a,b){this.J=a;this.Ad=b;this.t=0;this.j=2}Qk.prototype.K=function(){return this.J.length};Qk.prototype.nd=ba(r);Qk.prototype.od=function(){return this.J.pop()};
Qk.prototype.ie=function(a,b){this.J.length===this.Ad&&a.od(a);return this.J.unshift(b)};var Rk=n,Sk=Ok(32),Tk=r,Uk=r;function Vk(){Tk=m;Uk=r;for(var a=0;;){var b=Sk.pop();if(b!=n&&(b.h?b.h():b.call(n),1024>a)){a+=1;continue}break}Tk=r;return 0<Sk.length?Wk.h?Wk.h():Wk.call(n):n}"undefined"!==typeof MessageChannel&&(Rk=new MessageChannel,Rk.port1.onmessage=function(){return Vk()});function Wk(){var a=Uk;if(z(z(a)?Tk:a))return n;Uk=m;return"undefined"!==typeof MessageChannel?Rk.port2.postMessage(0):"undefined"!==typeof setImmediate?setImmediate(Vk):setTimeout(Vk,0)}
function Xk(a){Mk(Sk,a);Wk()};var Yk,Hk=function Zk(b){h===Yk&&(Yk={},Yk=function(b,d,f){this.Z=b;this.gf=d;this.Pf=f;this.t=0;this.j=425984},Yk.za=m,Yk.Ga="cljs.core.async.impl.channels/t9527",Yk.Fa=function(b,d){return D(d,"cljs.core.async.impl.channels/t9527")},Yk.prototype.Vc=s("Z"),Yk.prototype.F=s("Pf"),Yk.prototype.G=function(b,d){return new Yk(this.Z,this.gf,d)});return new Yk(b,Zk,n)};function $k(a,b){this.yb=a;this.Z=b}function al(a){return xk(a.yb)}
function bl(a,b,c,d,f,g){this.cc=a;this.tc=b;this.Ec=c;this.sc=d;this.J=f;this.closed=g}bl.prototype.oc=function(){if(!this.closed)for(this.closed=m;;){var a=this.cc.pop();if(a!=n){if(a.ya(a)){var b=a.da(a);Xk(function(a){return function(){return a.a?a.a(n):a.call(n,n)}}(b,a))}}else break}return n};
bl.prototype.pd=function(a,b){if(b.ya(b)){var c=this.J!=n;if(c?0<P(this.J):c)return b.da(b),Hk(this.J.od(this.J));for(;;){var d=this.Ec.pop();if(d!=n){if(c=d.yb,d=d.Z,c.ya(c))return c=c.da(c),b.da(b),Xk(c),Hk(d)}else{if(this.closed)return b.da(b),Hk(n);64<this.tc?(this.tc=0,Nk(this.cc,xk)):this.tc+=1;1024>this.cc.length||e(Error([E("Assert failed: "),E([E("No more than "),E(1024),E(" pending takes are allowed on a single channel.")].join("")),E("\n"),E(Kh.g(N([Ec(new F(n,"<","<",-1640531467,n),Ec(new F(n,
".-length",".-length",1395928862,n),new F(n,"takes","takes",-1530407291,n)),new F("impl","MAX-QUEUE-SIZE","impl/MAX-QUEUE-SIZE",-1989946393,n))],0)))].join("")));Mk(this.cc,b);return n}}}else return n};
bl.prototype.pc=function(a,b,c){b==n&&e(Error([E("Assert failed: "),E("Can't put nil in on a channel"),E("\n"),E(Kh.g(N([Ec(new F(n,"not","not",-1640422260,n),Ec(new F(n,"nil?","nil?",-1637150201,n),new F(n,"val","val",-1640415014,n)))],0)))].join("")));if((a=this.closed)?a:!c.ya(c))return Hk(n);for(;;)if(a=this.cc.pop(),a!=n){if(a.ya(a)){var d=a.da(a),c=c.da(c);Xk(function(a){return function(){return a.a?a.a(b):a.call(n,b)}}(d,c,a));return Hk(n)}}else{if((a=this.J==n)?a:this.J.nd(this.J))return 64<
this.sc?(this.sc=0,Nk(this.Ec,al)):this.sc+=1,1024>this.Ec.length||e(Error([E("Assert failed: "),E([E("No more than "),E(1024),E(" pending puts are allowed on a single channel."),E(" Consider using a windowed buffer.")].join("")),E("\n"),E(Kh.g(N([Ec(new F(n,"<","<",-1640531467,n),Ec(new F(n,".-length",".-length",1395928862,n),new F(n,"puts","puts",-1637078787,n)),new F("impl","MAX-QUEUE-SIZE","impl/MAX-QUEUE-SIZE",-1989946393,n))],0)))].join(""))),Mk(this.Ec,new $k(c,b)),n;c=c.da(c);this.J.ie(this.J,
b);return Hk(n)}};function cl(a,b,c){this.key=a;this.Z=b;this.forward=c;this.t=0;this.j=2155872256}cl.prototype.M=function(a,b,c){return Dh(b,Ih,"["," ","]",c,a)};cl.prototype.N=function(){return Ec.g(N([this.key,this.Z],0))};var dl=n;function el(a){return dl.c(n,n,a)}function fl(a,b,c){for(var c=Array(c+1),d=0;;)if(d<c.length)c[d]=n,d+=1;else break;return new cl(a,b,c)}dl=function(a,b,c){switch(arguments.length){case 1:return el.call(this,a);case 3:return fl.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};
dl.a=el;dl.c=fl;dl.a(0);var hl=function gl(b){h===rk&&(rk={},rk=function(b,d,f){this.La=b;this.vd=d;this.Mf=f;this.t=0;this.j=393216},rk.za=m,rk.Ga="cljs.core.async/t9471",rk.Fa=function(b,d){return D(d,"cljs.core.async/t9471")},rk.prototype.ya=ba(m),rk.prototype.da=s("La"),rk.prototype.F=s("Mf"),rk.prototype.G=function(b,d){return new rk(this.La,this.vd,d)});return new rk(b,gl,n)},V,il=n;function jl(){return il.a(n)}function kl(a){a="number"===typeof a?new Pk(Ok(a),a):a;return new bl(Ok(32),0,Ok(32),0,a,n)}
il=function(a){switch(arguments.length){case 0:return jl.call(this);case 1:return kl.call(this,a)}e(Error("Invalid arity: "+arguments.length))};il.h=jl;il.a=kl;V=il;function ll(){return n}var ml,nl=n;function ol(a,b){return nl.c(a,b,ll)}function pl(a,b,c){return nl.n(a,b,c,m)}function ql(a,b,c,d){a=vk(a,b,hl(c));z(z(a)?ef.b(c,ll):a)&&(z(d)?c.h?c.h():c.call(n):Xk(c));return n}
nl=function(a,b,c,d){switch(arguments.length){case 2:return ol.call(this,a,b);case 3:return pl.call(this,a,b,c);case 4:return ql.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};nl.b=ol;nl.c=pl;nl.n=ql;ml=nl;
var Fk=function rl(){var b=Mh.a(m);h===sk&&(sk={},sk=function(b,d,f){this.ib=b;this.ef=d;this.Nf=f;this.t=0;this.j=393216},sk.za=m,sk.Ga="cljs.core.async/t9482",sk.Fa=function(b,d){return D(d,"cljs.core.async/t9482")},sk.prototype.ya=function(){return Hb(this.ib)},sk.prototype.da=function(){Rh(this.ib,n);return m},sk.prototype.F=s("Nf"),sk.prototype.G=function(b,d){return new sk(this.ib,this.ef,d)});return new sk(b,rl,n)},Gk=function sl(b,c){h===tk&&(tk={},tk=function(b,c,g,i){this.Xd=b;this.ib=c;
this.ff=g;this.Of=i;this.t=0;this.j=393216},tk.za=m,tk.Ga="cljs.core.async/t9488",tk.Fa=function(b,c){return D(c,"cljs.core.async/t9488")},tk.prototype.ya=function(){return xk(this.ib)},tk.prototype.da=function(){yk(this.ib);return this.Xd},tk.prototype.F=s("Of"),tk.prototype.G=function(b,c){return new tk(this.Xd,this.ib,this.ff,c)});return new tk(c,b,sl,n)};var tl,ul,vl=n;function wl(a){var b=V.h(),a=jk.b(a,function(a){return ml.b(b,a)}),c=R.c(a,0,n);return S([b,function(){$i(c);return wk(b)}])}function xl(a,b){var c=V.h(),d=jk.c(a,b,function(a){return ml.b(c,a)}),f=R.c(d,0,n);return S([c,function(){$i(f);return wk(c)}])}vl=function(a,b){switch(arguments.length){case 1:return wl.call(this,a);case 2:return xl.call(this,a,b)}e(Error("Invalid arity: "+arguments.length))};vl.a=wl;vl.b=xl;ul=vl;
function yl(a,b,c){if(a?a.Ce:a)return a.Ce(0,b,c);var d;var f=yl[w(a==n?n:a)];f?d=f:(f=yl._)?d=f:e(B("Mult.tap*",a));return d.call(n,a,b,c)}
var Al=function zl(b){var c=Mh.a(sg),d;h===tl&&(tl={},tl=function(b,c,d,f){this.se=b;this.ch=c;this.Sf=d;this.Kf=f;this.t=0;this.j=393216},tl.za=m,tl.Ga="frpong.signals/t6784",tl.Fa=function(b,c){return D(c,"frpong.signals/t6784")},tl.prototype.Ce=function(b,c,d){Sh.n(this.se,fd,c,d);return n},tl.prototype.F=s("Kf"),tl.prototype.G=function(b,c){return new tl(this.se,this.ch,this.Sf,c)});d=new tl(c,b,zl,n);var f=V.a(1),g=Mh.a(n),i;i=function(){return 0===Sh.b(g,Td)?ml.b(f,m):n};var k=V.a(1);Xk(function(){function d(b){for(;;){var c=
p(b);if("\ufdd0:recur"!==c)return c}}function q(){var b=Array(26);b[0]=t;b[1]=1;return b}function p(d){var j=d[1];if(32===j)return j=d,j[2]=d[2],j[1]=29,"\ufdd0:recur";if(1===j)return d[2]=n,d[1]=2,"\ufdd0:recur";if(33===j){var j=d[5],k=fc(j),j=gc(j),l=P(k),q;d[6]=j;d[7]=k;d[8]=l;d[9]=0;d[2]=n;d[1]=25;return"\ufdd0:recur"}if(2===j)return T(d,4,b);if(34===j){var j=d[5],p=d[10],k=J(j),k=ml.c(k,p,i),j=L(j);d[11]=k;d[6]=j;d[7]=n;d[8]=0;d[9]=0;d[2]=n;d[1]=25;return"\ufdd0:recur"}if(3===j)return j=d[2],
Jk(d,j);if(35===j)return j=d[2],d[2]=j,d[1]=32,"\ufdd0:recur";if(4===j)return j=d[2],d[10]=j,d[1]=z(j==n)?5:6,"\ufdd0:recur";if(36===j)return T(d,39,f);if(5===j)return j=Hb(c),j=I(j),d[12]=0,d[13]=n,d[14]=j,d[15]=0,d[2]=n,d[1]=8,"\ufdd0:recur";if(37===j)return d[2]=n,d[1]=38,"\ufdd0:recur";if(6===j)return k=d[16],j=Hb(c),k=gh(j),j=P(k),l=Rh(g,j),j=I(k),d[16]=k,d[17]=l,d[6]=j,d[7]=n,d[8]=0,d[9]=0,d[2]=n,d[1]=25,"\ufdd0:recur";if(38===j)return d[18]=d[2],d[2]=n,d[1]=2,"\ufdd0:recur";if(7===j)return j=
d[2],d[2]=j,d[1]=3,"\ufdd0:recur";if(39===j)return j=d[2],d[2]=j,d[1]=38,"\ufdd0:recur";if(8===j)return l=d[12],q=d[15],d[1]=z(q<l)?10:11,"\ufdd0:recur";if(9===j)return j=d[2],d[2]=j,d[1]=7,"\ufdd0:recur";if(10===j)return k=d[13],q=d[15],k=C.b(k,q),j=R.c(k,0,n),k=R.c(k,1,n),d[19]=j,d[1]=z(k)?13:14,"\ufdd0:recur";if(11===j)return k=d[20],j=d[14],j=I(j),d[20]=j,d[1]=j?16:17,"\ufdd0:recur";if(12===j)return j=d[2],d[2]=j,d[1]=9,"\ufdd0:recur";if(13===j)return j=d[19],j=wk(j),d[2]=j,d[1]=15,"\ufdd0:recur";
if(14===j)return d[2]=n,d[1]=15,"\ufdd0:recur";if(15===j)return l=d[12],k=d[13],j=d[14],q=d[15],p=d[2],d[12]=l,d[13]=k,d[14]=j,d[21]=p,d[15]=q+1,d[2]=n,d[1]=8,"\ufdd0:recur";if(16===j)return k=d[20],j=Ad(k),d[1]=j?19:20,"\ufdd0:recur";if(17===j)return d[2]=n,d[1]=18,"\ufdd0:recur";if(18===j)return j=d[2],d[2]=j,d[1]=12,"\ufdd0:recur";if(19===j)return k=d[20],j=fc(k),k=gc(k),l=P(j),d[12]=l,d[13]=j,d[14]=k,d[15]=0,d[2]=n,d[1]=8,"\ufdd0:recur";if(20===j)return k=d[20],k=J(k),j=R.c(k,0,n),k=R.c(k,1,n),
d[22]=j,d[1]=z(k)?22:23,"\ufdd0:recur";if(21===j)return j=d[2],d[2]=j,d[1]=18,"\ufdd0:recur";if(22===j)return j=d[22],j=wk(j),d[2]=j,d[1]=24,"\ufdd0:recur";if(23===j)return d[2]=n,d[1]=24,"\ufdd0:recur";if(24===j)return k=d[20],l=d[2],j=L(k),d[12]=0,d[23]=l,d[13]=n,d[14]=j,d[15]=0,d[2]=n,d[1]=8,"\ufdd0:recur";if(25===j)return l=d[8],k=d[9],j=k<l,d[1]=z(j)?27:28,"\ufdd0:recur";if(26===j)return k=d[16],j=d[2],k=I(k),d[24]=j,d[1]=k?36:37,"\ufdd0:recur";if(27===j){p=d[10];j=d[6];q=d[7];var l=d[8],k=d[9],
u=C.b(q,k),p=ml.c(u,p,i);d[25]=p;d[6]=j;d[7]=q;d[8]=l;d[9]=k+1;d[2]=n;d[1]=25;return"\ufdd0:recur"}return 28===j?(j=d[6],j=I(j),d[5]=j,d[1]=j?30:31,"\ufdd0:recur"):29===j?(j=d[2],d[2]=j,d[1]=26,"\ufdd0:recur"):30===j?(j=d[5],j=Ad(j),d[1]=j?33:34,"\ufdd0:recur"):31===j?(d[2]=n,d[1]=32,"\ufdd0:recur"):n}var u,t=n,t=function(b){switch(arguments.length){case 0:return q.call(this);case 1:return d.call(this,b)}e(Error("Invalid arity: "+arguments.length))};t.h=q;t.a=d;u=t;u=u.h?u.h():u.call(n);u[4]=k;return Ck(u)});
return d},W,Bl=n;function Cl(a){return Bl.b(a,V.h())}function Dl(a,b){return Bl.c(a,b,m)}function El(a,b,c){yl(a,b,c);return b}Bl=function(a,b,c){switch(arguments.length){case 1:return Cl.call(this,a);case 2:return Dl.call(this,a,b);case 3:return El.call(this,a,b,c)}e(Error("Invalid arity: "+arguments.length))};Bl.a=Cl;Bl.b=Dl;Bl.c=El;W=Bl;var Fl=document.body.scrollWidth-20,Gl=document.body.scrollHeight-130,Hl=S([Fl/2,Gl/2]),Il=S([35,55]),Jl=Gl-100,Kl=(Gl-100)/2,Ll=Mh.a(0.0050),Ol=function Ml(){return nk.b("\ufdd0:keypress",function(b){if(M.b((new ze("\ufdd0:keyCode")).call(n,b),32)){var c=V.h(),d=V.a(new Qk(Ok(1E3),1E3)),f=V.a(new Qk(Ok(10),10));window.requestAnimationFrame(function Fa(b){var c=window.requestAnimationFrame(Fa);ml.b(d,b);return ml.b(f,c)});var b=S([d,function(){var b=V.a(1);Xk(function(){function c(b){for(;;){var d=
g(b);if("\ufdd0:recur"!==d)return d}}function d(){var b=Array(7);b[0]=j;b[1]=1;return b}function g(b){var c=b[1];return 7===c?(c=b,c[2]=b[2],c[1]=3,"\ufdd0:recur"):6===c?(b[2]=n,b[1]=7,"\ufdd0:recur"):5===c?(c=window.cancelAnimationFrame(b[5]),b[6]=c,b[2]=n,b[1]=2,"\ufdd0:recur"):4===c?(c=b[2],b[5]=c,b[1]=z(c)?5:6,"\ufdd0:recur"):3===c?(c=b[2],Jk(b,c)):2===c?T(b,4,f):1===c?(b[2]=n,b[1]=2,"\ufdd0:recur"):n}var i,j=n,j=function(b){switch(arguments.length){case 0:return d.call(this);case 1:return c.call(this,
b)}e(Error("Invalid arity: "+arguments.length))};j.h=d;j.a=c;i=j;i=i.h?i.h():i.call(n);i[4]=b;return Ck(i)});wk(d);return wk(f)}]),g=R.c(b,0,n),b=R.c(b,1,n),i=V.h(),k=V.a(1);Xk(function(){function b(c){for(;;){var f=d(c);if("\ufdd0:recur"!==f)return f}}function c(){var b=Array(8);b[0]=j;b[1]=1;return b}function d(b){var c=b[1];if(9===c){var c=b[5],f=b[2];b[6]=c;b[7]=f;b[2]=n;b[1]=3;return"\ufdd0:recur"}return 8===c?(c=b[2],b[2]=c,b[1]=4,"\ufdd0:recur"):7===c?(c=wk(i),b[2]=c,b[1]=8,"\ufdd0:recur"):
6===c?(c=b[5],f=b[6],c-=f,Dk(b,9,i,c)):5===c?(c=b[2],b[5]=c,b[1]=z(c)?6:7,"\ufdd0:recur"):4===c?(c=b[2],Jk(b,c)):3===c?T(b,5,g):2===c?(f=b[2],b[6]=f,b[2]=n,b[1]=3,"\ufdd0:recur"):1===c?T(b,2,g):n}var f,j=n,j=function(d){switch(arguments.length){case 0:return c.call(this);case 1:return b.call(this,d)}e(Error("Invalid arity: "+arguments.length))};j.h=c;j.a=b;f=j;f=f.h?f.h():f.call(n);f[4]=k;return Ck(f)});var l=V.a(1);Xk(function(){function b(c){for(;;){var d=f(c);if("\ufdd0:recur"!==d)return d}}function d(){var b=
Array(8);b[0]=j;b[1]=1;return b}function f(b){var d=b[1];if(1===d)return T(b,2,i);if(2===d){var g=b[2];b[5]=g;b[2]=n;b[1]=3;return"\ufdd0:recur"}return 3===d?T(b,5,i):4===d?(d=b[2],Jk(b,d)):5===d?(d=b[6],d=b[2],b[6]=d,b[1]=z(d)?6:7,"\ufdd0:recur"):6===d?(d=b[6],g=b[5],b[1]=z(d<10*g)?9:10,"\ufdd0:recur"):7===d?(d=wk(c),b[2]=d,b[1]=8,"\ufdd0:recur"):8===d?(d=b[2],b[2]=d,b[1]=4,"\ufdd0:recur"):9===d?(d=b[6],Dk(b,12,c,d)):10===d?(b[2]=n,b[1]=11,"\ufdd0:recur"):11===d?(d=b[6],g=b[2],b[7]=g,b[5]=d,b[2]=
n,b[1]=3,"\ufdd0:recur"):12===d?(d=b[2],b[2]=d,b[1]=11,"\ufdd0:recur"):n}var g,j=n,j=function(c){switch(arguments.length){case 0:return d.call(this);case 1:return b.call(this,c)}e(Error("Invalid arity: "+arguments.length))};j.h=d;j.a=b;g=j;g=g.h?g.h():g.call(n);g[4]=l;return Ck(g)});var b=S([c,b]),q=V.a(1),p=V.a(1),u=V.a(1),t=V.a(1),x=V.a(1),j,H=R.c(Il,0,n),U=R.c(Il,1,n),H=3.141592653589793*((H+(U-H)*Wd.h())/180);j=nf.b(function(b){return 0.6*b},S([(0.5>Wd.h()?-1:1)*Math.sin(H),(0.5>Wd.h()?-1:1)*
Math.cos(H)]));Nl.ga?Nl.ga(b,x,q,p,u,t):Nl.call(n,b,x,q,p,u,t);var Q=V.a(1);Xk(function(){function b(c){for(;;){var f=d(c);if("\ufdd0:recur"!==f)return f}}function c(){var b=Array(8);b[0]=g;b[1]=1;return b}function d(b){var c=b[1];if(5===c)return Jk(b,b[2]);if(4===c){var c=b[2],f=Tf.g(N(["\ufdd0:moving",0],0));b[5]=c;return Dk(b,5,x,f)}return 3===c?(c=b[2],f=Tf.g(N([Kl,Kl],0)),b[6]=c,Dk(b,4,t,f)):2===c?(b[7]=b[2],Dk(b,3,p,j)):1===c?Dk(b,2,q,Hl):n}var f,g=n,g=function(d){switch(arguments.length){case 0:return c.call(this);
case 1:return b.call(this,d)}e(Error("Invalid arity: "+arguments.length))};g.h=c;g.a=b;f=g;f=f.h?f.h():f.call(n);f[4]=Q;return Ck(f)});b=Q}else b=Ml();return b})};
function Nl(a,b,c,d,f,g){var i=R.c(a,0,n),k=R.c(a,1,n),a=V.a(1),l=Al(a),q=Al(c),p=Al(d),u=Al(f),t=Al(g),x=Al(b),j,H=W.a(l),U=Za([83,"\ufdd0:s",87,"\ufdd0:w",38,"\ufdd0:up",40,"\ufdd0:down"],m),Q=ul.a("\ufdd0:keydown"),va=R.c(Q,0,n),Fa=R.c(Q,1,n),Q=ul.a("\ufdd0:keyup"),Tb=R.c(Q,0,n),$a=R.c(Q,1,n),ya=V.h(),$=Za([va,Oc,Tb,qd],m),X=V.a(1);Xk(function(){function a(b){for(;;){var d=c(b);if("\ufdd0:recur"!==d)return d}}function b(){var a=Array(11);a[0]=f;a[1]=1;return a}function c(a){var b=a[1];if(1===b)return b=
ph.h(),a[5]=b,a[2]=n,a[1]=2,"\ufdd0:recur";if(2===b)return b=Tf.g(N([va,Tb,H],0)),Ik.g(a,4,b,N(["\ufdd0:priority",m],0));if(3===b)return b=a[2],Jk(a,b);if(4===b){var b=a[6],d=a[2],b=R.c(d,0,n),d=R.c(d,1,n),f=ab(b==n);a[7]=d;a[6]=b;a[1]=f?5:6;return"\ufdd0:recur"}return 5===b?(d=a[7],b=a[8],b=M.b(d,va),a[8]=b,a[1]=b?8:9,"\ufdd0:recur"):6===b?(b=wk(ya),a[2]=b,a[1]=7,"\ufdd0:recur"):7===b?(b=a[2],a[2]=b,a[1]=3,"\ufdd0:recur"):8===b?(b=a[8],a[2]=b,a[1]=10,"\ufdd0:recur"):9===b?(d=a[7],b=M.b(d,Tb),a[2]=
b,a[1]=10,"\ufdd0:recur"):10===b?(b=a[2],a[1]=z(b)?11:12,"\ufdd0:recur"):11===b?(b=a[6],f=a[9],b=(new ze("\ufdd0:keyCode")).call(n,b),d=Fd(U,b),a[9]=b,a[1]=d?14:15,"\ufdd0:recur"):12===b?(b=a[5],Dk(a,17,ya,b)):13===b?(b=a[2],a[2]=b,a[1]=7,"\ufdd0:recur"):14===b?(d=a[7],f=a[9],b=a[5],d=$.a?$.a(d):$.call(n,d),f=U.a?U.a(f):U.call(n,f),b=d.b?d.b(b,f):d.call(n,b,f),a[5]=b,a[2]=n,a[1]=2,"\ufdd0:recur"):15===b?(b=a[5],a[5]=b,a[2]=n,a[1]=2,"\ufdd0:recur"):16===b?(b=a[2],a[2]=b,a[1]=13,"\ufdd0:recur"):17===
b?(b=a[5],d=a[2],a[10]=d,a[5]=b,a[2]=n,a[1]=2,"\ufdd0:recur"):n}var d,f=n,f=function(c){switch(arguments.length){case 0:return b.call(this);case 1:return a.call(this,c)}e(Error("Invalid arity: "+arguments.length))};f.h=b;f.a=a;d=f;d=d.h?d.h():d.call(n);d[4]=X;return Ck(d)});j=S([ya,function(){Fa.h?Fa.h():Fa.call(n);return $a.h?$a.h():$a.call(n)}]);var Q=R.c(j,0,n),ia=R.c(j,1,n);j=function(){k.h?k.h():k.call(n);return ia.h?ia.h():ia.call(n)};Pl.n?Pl.n(i,j,W.a(x),a):Pl.call(n,i,j,W.a(x),a);Ql.b?Ql.b(W.a(q),
f):Ql.call(n,W.a(q),f);Rl.T?Rl.T(W.a(l),W.a(q),W.a(p),W.a(u),c):Rl.call(n,W.a(l),W.a(q),W.a(p),W.a(u),c);Sl.c?Sl.c(Q,W.a(t),g):Sl.call(n,Q,W.a(t),g);Tl.Lb?Tl.Lb(W.a(l),W.a(q),W.a(p),W.a(u),W.a(t),W.a(x),b,d):Tl.call(n,W.a(l),W.a(q),W.a(p),W.a(u),W.a(t),W.a(x),b,d);return Ul.n?Ul.n(W.a(l),W.a(x),W.a(q),W.a(t)):Ul.call(n,W.a(l),W.a(x),W.a(q),W.a(t))}
function Pl(a,b,c,d){var f=V.a(1);Xk(function(){function g(a){for(;;){var b=k(a);if("\ufdd0:recur"!==b)return b}}function i(){var a=Array(8);a[0]=q;a[1]=1;return a}function k(f){var g=f[1];if(9===g)return g=f,g[2]=f[2],g[1]=3,"\ufdd0:recur";if(8===g)return g=b.h?b.h():b.call(n),f[2]=g,f[1]=9,"\ufdd0:recur";if(7===g)return f[2]=n,f[1]=2,"\ufdd0:recur";if(6===g)return g=f[2],Dk(f,5,d,g);if(5===g){var g=f[5],i=f[2],g=!M.b("\ufdd0:gameover",g);f[6]=i;f[1]=g?7:8;return"\ufdd0:recur"}return 4===g?(i=f[2],
g=R.c(i,0,n),i=R.c(i,1,n),f[7]=i,f[5]=g,T(f,6,a)):3===g?(g=f[2],Jk(f,g)):2===g?T(f,4,c):1===g?(f[2]=n,f[1]=2,"\ufdd0:recur"):n}var l,q=n,q=function(a){switch(arguments.length){case 0:return i.call(this);case 1:return g.call(this,a)}e(Error("Invalid arity: "+arguments.length))};q.h=i;q.a=g;l=q;l=l.h?l.h():l.call(n);l[4]=f;return Ck(l)});return f}
function Ql(a,b){var c=V.a(1);Xk(function(){function d(a){for(;;){var b=g(a);if("\ufdd0:recur"!==b)return b}}function f(){var a=Array(6);a[0]=k;a[1]=1;return a}function g(c){var d=c[1];if(8===d){var f=c[2],d=R.c(f,0,n),f=R.c(f,1,n),g=Hb(Ll),i=R.c(Hl,0,n),k=R.c(Hl,1,n),d=i-d,f=k-f,j=Math.sqrt(d*d+f*f),d=S([d/j,f/j]),d=M.b(j,0)?S([0,0]):nf.b(function(a){return g*a*(1/j)},d);return Dk(c,7,b,d)}return 7===d?(c[5]=c[2],c[2]=n,c[1]=2,"\ufdd0:recur"):6===d?(d=c[2],c[2]=d,c[1]=3,"\ufdd0:recur"):5===d?(c[2]=
n,c[1]=6,"\ufdd0:recur"):4===d?T(c,8,a):3===d?(d=c[2],Jk(c,d)):2===d?(c[1]=4,"\ufdd0:recur"):1===d?(c[2]=n,c[1]=2,"\ufdd0:recur"):n}var i,k=n,k=function(a){switch(arguments.length){case 0:return f.call(this);case 1:return d.call(this,a)}e(Error("Invalid arity: "+arguments.length))};k.h=f;k.a=d;i=k;i=i.h?i.h():i.call(n);i[4]=c;return Ck(i)});return c}function Vl(a,b,c,d){var f=R.c(a,0,n),a=R.c(a,1,n),g=R.c(b,0,n),b=R.c(b,1,n),i=R.c(c,0,n),c=R.c(c,1,n);return S([f+g*d+i*d*d,a+b*d+c*d*d])}
function Rl(a,b,c,d,f){var g=V.a(1);Xk(function(){function i(a){for(;;){var b=l(a);if("\ufdd0:recur"!==b)return b}}function k(){var a=Array(9);a[0]=p;a[1]=1;return a}function l(g){var i=g[1];if(1===i)return g[2]=n,g[1]=2,"\ufdd0:recur";if(2===i)return g[1]=4,"\ufdd0:recur";if(3===i)return i=g[2],Jk(g,i);if(4===i)return T(g,7,a);if(5===i)return g[2]=n,g[1]=6,"\ufdd0:recur";if(6===i)return i=g[2],g[2]=i,g[1]=3,"\ufdd0:recur";if(7===i)return i=g[2],g[5]=i,T(g,8,b);if(8===i){var k=g[2];g[6]=k;return T(g,
9,c)}if(9===i){var j=g[2];g[7]=j;return T(g,10,d)}return 10===i?(j=g[7],i=g[5],k=g[6],i=Vl(k,j,g[2],i),Dk(g,11,f,i)):11===i?(g[8]=g[2],g[2]=n,g[1]=2,"\ufdd0:recur"):n}var q,p=n,p=function(a){switch(arguments.length){case 0:return k.call(this);case 1:return i.call(this,a)}e(Error("Invalid arity: "+arguments.length))};p.h=k;p.a=i;q=p;q=q.h?q.h():q.call(n);q[4]=g;return Ck(q)});return g}
function Sl(a,b,c){var d=V.a(1);Xk(function(){function f(a){for(;;){var b=i(a);if("\ufdd0:recur"!==b)return b}}function g(){var a=Array(9);a[0]=l;a[1]=1;return a}function i(d){var f=d[1];if(9===f)return d[5]=d[2],d[2]=n,d[1]=2,"\ufdd0:recur";if(8===f){var f=d[7],g=d[8],i,k=d[2];i=function(a,b,c){return Fd(k,b)?(a-=8,0<a?a:0):Fd(k,c)?(a+=8,a<Jl?a:Jl):a};g=i.c?i.c(g,"\ufdd0:w","\ufdd0:s"):i.call(n,g,"\ufdd0:w","\ufdd0:s");f=i.c?i.c(f,"\ufdd0:up","\ufdd0:down"):i.call(n,f,"\ufdd0:up","\ufdd0:down");
f=Tf.g(N([g,f],0));return Dk(d,9,c,f)}return 7===f?(i=d[2],g=R.c(i,0,n),f=R.c(i,1,n),d[6]=i,d[7]=f,d[8]=g,T(d,8,a)):6===f?(f=d[2],d[2]=f,d[1]=3,"\ufdd0:recur"):5===f?(d[2]=n,d[1]=6,"\ufdd0:recur"):4===f?T(d,7,b):3===f?(f=d[2],Jk(d,f)):2===f?(d[1]=4,"\ufdd0:recur"):1===f?(d[2]=n,d[1]=2,"\ufdd0:recur"):n}var k,l=n,l=function(a){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,a)}e(Error("Invalid arity: "+arguments.length))};l.h=g;l.a=f;k=l;k=k.h?k.h():k.call(n);k[4]=d;return Ck(k)});
return d}function Wl(a,b){var c=a>b-5;return c?a<b+100+5:c}function Xl(a){var b=M.b(a,"\ufdd0:collision-left");return b?b:M.b(a,"\ufdd0:collision-right")}
function Yl(a,b){if(M.b?M.b("\ufdd0:collision-left",a):M.call(n,"\ufdd0:collision-left",a))return Math.abs(b);if(M.b?M.b("\ufdd0:collision-right",a):M.call(n,"\ufdd0:collision-right",a))return-Math.abs(b);if(M.b?M.b("\ufdd0:moving",a):M.call(n,"\ufdd0:moving",a))return b;if(M.b?M.b("\ufdd0:gameover",a):M.call(n,"\ufdd0:gameover",a))return 0;e(Error([E("No matching clause: "),E(a)].join("")))}function Zl(a){return a*(1+0.05*Wd.h())}
function Tl(a,b,c,d,f,g,i,k){var l=V.a(1);Xk(function(){function q(a){for(;;){var b=u(a);if("\ufdd0:recur"!==b)return b}}function p(){var a=Array(24);a[0]=x;a[1]=1;return a}function u(j){var l=j[1];if(32===l)return j[5]=j[2],j[2]=n,j[1]=2,"\ufdd0:recur";if(1===l)return j[2]=n,j[1]=2,"\ufdd0:recur";if(2===l)return j[1]=4,"\ufdd0:recur";if(3===l)return l=j[2],Jk(j,l);if(4===l)return T(j,7,a);if(5===l)return j[2]=n,j[1]=6,"\ufdd0:recur";if(6===l)return l=j[2],j[2]=l,j[1]=3,"\ufdd0:recur";if(7===l){var q=
j[2];j[6]=q;return T(j,8,c)}if(8===l){var l=j[2],p=R.c(l,0,n),u=R.c(l,1,n);j[7]=u;j[8]=p;return T(j,9,b)}if(9===l){var l=j[2],t=R.c(l,0,n),x=R.c(l,1,n);j[9]=t;j[10]=x;return T(j,10,d)}if(10===l){var l=j[2],$a=R.c(l,0,n),ya=R.c(l,1,n);j[11]=ya;j[12]=$a;return T(j,11,f)}if(11===l){var l=j[2],$=R.c(l,0,n),X=R.c(l,1,n);j[13]=X;j[14]=$;return T(j,12,g)}if(12===l){var q=j[6],X=j[13],$=j[14],ya=j[11],$a=j[12],t=j[9],u=j[7],x=j[10],p=j[8],l=j[2],ia=R.c(l,0,n),l=R.c(l,1,n),t=Tf.g(N([t,x],0)),x=Tf.g(N([p,u],
0)),Tc=Tf.g(N([$a,ya],0)),x=Vl(t,x,Tc,q),t=R.c(x,0,n),x=R.c(x,1,n),t=15>t?z(Wl(x,$))?"\ufdd0:collision-left":"\ufdd0:gameover":t>Fl-15?z(Wl(x,X))?"\ufdd0:collision-right":"\ufdd0:gameover":"\ufdd0:moving",x=5>x?"\ufdd0:collision-left":x>Gl-5?"\ufdd0:collision-right":"\ufdd0:moving",$=Xl(t),X=Xl(x),p=Yl(t,p)+$a*q,p=0.6<p?0.6:p,q=Yl(x,u)+ya*q,q=0.6<q?0.6:q,u=M.b(t,"\ufdd0:gameover");j[15]=l;j[16]=ia;j[17]=p;j[18]=$;j[19]=X;j[20]=q;j[1]=u?13:14;return"\ufdd0:recur"}return 13===l?(j[2]="\ufdd0:gameover",
j[1]=15,"\ufdd0:recur"):14===l?($=j[18],j[1]=z($)?16:17,"\ufdd0:recur"):15===l?($=j[18],l=j[2],j[21]=l,j[1]=z($)?25:26,"\ufdd0:recur"):16===l?($=j[18],j[2]=$,j[1]=18,"\ufdd0:recur"):17===l?(X=j[19],j[2]=X,j[1]=18,"\ufdd0:recur"):18===l?(l=j[2],j[1]=z(l)?19:20,"\ufdd0:recur"):19===l?(j[2]="\ufdd0:collision",j[1]=21,"\ufdd0:recur"):20===l?(j[1]=22,"\ufdd0:recur"):21===l?(l=j[2],j[2]=l,j[1]=15,"\ufdd0:recur"):22===l?(j[2]="\ufdd0:moving",j[1]=24,"\ufdd0:recur"):23===l?(j[2]=n,j[1]=24,"\ufdd0:recur"):
24===l?(l=j[2],j[2]=l,j[1]=21,"\ufdd0:recur"):25===l?(l=j[15],j[2]=l+1,j[1]=27,"\ufdd0:recur"):26===l?(l=j[15],j[2]=l,j[1]=27,"\ufdd0:recur"):27===l?($=j[18],ia=j[2],j[22]=ia,j[1]=z($)?28:29,"\ufdd0:recur"):28===l?(p=j[17],q=j[20],l=Tf.g(N([p,q],0)),l=nf.b(Zl,l),j[2]=l,j[1]=30,"\ufdd0:recur"):29===l?(p=j[17],q=j[20],l=Tf.g(N([p,q],0)),j[2]=l,j[1]=30,"\ufdd0:recur"):30===l?(ia=j[2],l=R.c(ia,0,n),ia=R.c(ia,1,n),l=Tf.g(N([l,ia],0)),Dk(j,31,k,l)):31===l?(ia=j[22],l=j[21],q=j[2],l=Tf.g(N([l,ia],0)),j[23]=
q,Dk(j,32,i,l)):n}var t,x=n,x=function(a){switch(arguments.length){case 0:return p.call(this);case 1:return q.call(this,a)}e(Error("Invalid arity: "+arguments.length))};x.h=p;x.a=q;t=x;t=t.h?t.h():t.call(n);t[4]=l;return Ck(t)});return l}
function Ul(a,b,c,d){var f=Oj("ball"),g=Oj("score"),i=Oj("lpaddle"),k=Oj("rpaddle"),l=Oj("fps"),q=Oj("msg");Qj.g(f,"fill",N(["orange"],0));Tj(q,"");var p=V.a(1);Xk(function(){function u(a){for(;;){var b=x(a);if("\ufdd0:recur"!==b)return b}}function t(){var a=Array(23);a[0]=H;a[1]=1;return a}function x(j){var p=j[1];if(1===p){var u,t;j[5]=n;j[6]=n;j[2]=n;j[1]=2;return"\ufdd0:recur"}if(2===p)return T(j,4,a);if(3===p)return p=j[2],Jk(j,p);if(4===p)return t=1E3/j[2]|0,j[7]=t,T(j,5,c);if(5===p){var p=
j[2],x=R.c(p,0,n),H=R.c(p,1,n);j[8]=x;j[9]=H;return T(j,6,d)}if(6===p){var p=j[2],ya=R.c(p,0,n),$=R.c(p,1,n);j[10]=$;j[11]=ya;return T(j,7,b)}if(7===p){x=j[8];H=j[9];t=j[7];$=j[10];ya=j[11];u=j[6];var p=j[2],X=R.c(p,0,n),p=R.c(p,1,n),x=Sj.g(f,"cx",N([x],0)),H=Sj.g(f,"cy",N([H],0)),ya=Sj.g(i,"y",N([ya],0)),$=Sj.g(k,"y",N([$],0));t=M.b(t,u);j[12]=x;j[13]=H;j[14]=ya;j[15]=$;j[16]=p;j[17]=X;j[1]=t?8:9;return"\ufdd0:recur"}if(8===p)return j[2]=n,j[1]=10,"\ufdd0:recur";if(9===p)return t=j[7],p=Tj(l,t),
j[2]=p,j[1]=10,"\ufdd0:recur";if(10===p)return p=j[16],t=j[5],X=j[2],p=M.b(p,t),j[18]=X,j[1]=p?11:12,"\ufdd0:recur";if(11===p)return j[2]=n,j[1]=13,"\ufdd0:recur";if(12===p)return p=j[16],p=Tj(g,p),j[2]=p,j[1]=13,"\ufdd0:recur";if(13===p)return X=j[17],p=j[2],X=M.b(X,"\ufdd0:gameover"),j[19]=p,j[1]=X?14:15,"\ufdd0:recur";if(14===p){p=Qj.g(f,"fill",N(["red"],0));if(bb("<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart")){var x=ab(Ch(zj,"<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart")),
H=Ch(xj,"<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart"),ia=(""+E(Nc(Ch(yj,"<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart")))).toLowerCase(),ia=Fd(Ej,ia);x&&(x=z(nj)?nj:ab(H),x=z(x)?!ia:x);if(z(x)){x=tj("<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart");try{for(var X=I(Nj(q)),H=n,Tc=ia=0;;)if(Tc<ia)H.A(H,Tc).innerHTML=x,Tc+=1;else if(t=I(X)){var Uc=t;Ad(Uc)?(u=fc(Uc),ya=gc(Uc),Uc=u,$=P(u),X=ya,H=Uc,ia=$):(J(Uc).innerHTML=x,X=L(Uc),
H=n,ia=0);Tc=0}else break}catch(em){em instanceof Error?Uj(q,x):e(em)}}else Uj(q,"<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart");X=q}else X=Uj(q,"<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart");t=X;X=Ol();j[20]=t;j[21]=p;j[2]=X;j[1]=16;return"\ufdd0:recur"}return 15===p?(j[2]=n,j[1]=16,"\ufdd0:recur"):16===p?(p=j[16],t=j[7],X=j[2],j[5]=p,j[22]=X,j[6]=t,j[2]=n,j[1]=2,"\ufdd0:recur"):n}var j,H=n,H=function(a){switch(arguments.length){case 0:return t.call(this);
case 1:return u.call(this,a)}e(Error("Invalid arity: "+arguments.length))};H.h=t;H.a=u;j=H;j=j.h?j.h():j.call(n);j[4]=p;return Ck(j)});return p}
da("frpong.core.frpong",function(){var a=J(ul.a("\ufdd0:keydown")),b=Za([37,function(a){return a-0.0050},39,function(a){return a+0.0050}],m),c=Oj("mass"),d=V.a(1);Xk(function(){function f(a){for(;;){var b=i(a);if("\ufdd0:recur"!==b)return b}}function g(){var a=Array(8);a[0]=l;a[1]=1;return a}function i(d){var f=d[1];if(1===f)return d[2]=n,d[1]=2,"\ufdd0:recur";if(2===f)return d[1]=4,"\ufdd0:recur";if(3===f)return f=d[2],Jk(d,f);if(4===f)return T(d,7,a);if(5===f)return d[2]=n,d[1]=6,"\ufdd0:recur";
if(6===f)return f=d[2],d[2]=f,d[1]=3,"\ufdd0:recur";if(7===f){var f=d[5],f=(new ze("\ufdd0:keyCode")).call(n,d[2]),g=Fd(b,f);d[5]=f;d[1]=g?8:9;return"\ufdd0:recur"}if(8===f){var k=f=d[5],f=Sh.b(Ll,function(a){a=(b.a?b.a(k):b.call(n,k)).call(n,a);a=0.1<a?0.1:a;return 0>a?0:a}),g=0+1E3*Hb(Ll),g=Sj.g(c,"r",N([g],0));d[6]=f;d[2]=g;d[1]=10;return"\ufdd0:recur"}return 9===f?(d[2]=n,d[1]=10,"\ufdd0:recur"):10===f?(d[7]=d[2],d[2]=n,d[1]=2,"\ufdd0:recur"):n}var k,l=n,l=function(a){switch(arguments.length){case 0:return g.call(this);
case 1:return f.call(this,a)}e(Error("Invalid arity: "+arguments.length))};l.h=g;l.a=f;k=l;k=k.h?k.h():k.call(n);k[4]=d;return Ck(k)});var f=Oj("canvas");Qj.g(f,"width",N([[E(Fl),E("px")].join("")],0));Qj.g(f,"height",N([[E(Gl),E("px")].join("")],0));f=Oj("ball");Sj.g(f,"r",N([8],0));Sj.g(f,"cx",N([J(Hl)],0));Sj.g(f,"cy",N([Nc(Hl)],0));f=Oj("mass");Sj.g(f,"r",N([0+1E3*Hb(Ll)],0));Sj.g(f,"cx",N([J(Hl)],0));Sj.g(f,"cy",N([Nc(Hl)],0));f=Oj("score");Sj.g(f,"x",N([J(Hl)],0));Sj.g(f,"y",N([Gl-50],0));for(var f=
I(S(["lpaddle","rpaddle"])),g=n,i=0,k=0;;)if(k<i){var l=g.A(g,k),l=Oj(l);Sj.g(l,"width",N([10],0));Sj.g(l,"height",N([100],0));Sj.g(l,"y",N([(Gl-100)/2],0));k+=1}else if(f=I(f))Ad(f)?(i=fc(f),f=gc(f),g=i,i=P(i)):(g=J(f),g=Oj(g),Sj.g(g,"width",N([10],0)),Sj.g(g,"height",N([100],0)),Sj.g(g,"y",N([(Gl-100)/2],0)),f=L(f),g=n,i=0),k=0;else break;Sj.g(Oj("lpaddle"),"x",N([0],0));Sj.g(Oj("rpaddle"),"x",N([Fl-10],0));return Ol()});function $l(){this.ia=r}ta($l,Ji);v=$l.prototype;v.ue=m;v.Dd=n;v.addEventListener=function(a,b,c,d){Wi(this,a,b,c,d)};v.removeEventListener=function(a,b,c,d){Zi(this,a,b,c,d)};
v.dispatchEvent=function(a){var b=a.type||a,c=Ti;if(b in c){if(y(a))a=new Mi(a,this);else if(a instanceof Mi)a.target=a.target||this;else{var d=a,a=new Mi(b,this);Ua(a,d)}var d=1,f,c=c[b],b=m in c,g;if(b){f=[];for(g=this;g;g=g.Dd)f.push(g);g=c[m];g.ma=g.B;for(var i=f.length-1;!a.Eb&&0<=i&&g.ma;i--)a.currentTarget=f[i],d&=bj(g,f[i],a.type,m,a)&&a.Gc!=r}if(r in c)if(g=c[r],g.ma=g.B,b)for(i=0;!a.Eb&&i<f.length&&g.ma;i++)a.currentTarget=f[i],d&=bj(g,f[i],a.type,r,a)&&a.Gc!=r;else for(f=this;!a.Eb&&f&&
g.ma;f=f.Dd)a.currentTarget=f,d&=bj(g,f,a.type,r,a)&&a.Gc!=r;a=Boolean(d)}else a=m;return a};v.H=function(){$l.na.H.call(this);var a,b=0,c=a==n;a=!!a;if(this==n)Qa(Ui,function(d){for(var f=d.length-1;0<=f;f--){var g=d[f];if(c||a==g.capture)$i(g.key),b++}});else{var d=la(this);if(Ui[d])for(var d=Ui[d],f=d.length-1;0<=f;f--){var g=d[f];if(c||a==g.capture)$i(g.key),b++}}this.Dd=n};function am(a,b){this.ia=r;this.Ab=a||1;this.dc=b||bm;this.Qc=qa(this.cg,this);this.wd=sa()}ta(am,$l);am.prototype.enabled=r;var bm=ca.window;v=am.prototype;v.Ta=n;v.cg=function(){if(this.enabled){var a=sa()-this.wd;0<a&&a<0.8*this.Ab?this.Ta=this.dc.setTimeout(this.Qc,this.Ab-a):(this.dispatchEvent(cm),this.enabled&&(this.Ta=this.dc.setTimeout(this.Qc,this.Ab),this.wd=sa()))}};v.start=function(){this.enabled=m;this.Ta||(this.Ta=this.dc.setTimeout(this.Qc,this.Ab),this.wd=sa())};
v.stop=function(){this.enabled=r;this.Ta&&(this.dc.clearTimeout(this.Ta),this.Ta=n)};v.H=function(){am.na.H.call(this);this.stop();delete this.dc};var cm="tick";function dm(a,b){ja(a)||(a&&"function"==typeof a.handleEvent?a=qa(a.handleEvent,a):e(Error("Invalid listener argument")));return 2147483647<b?-1:bm.setTimeout(a,b||0)};function fm(a){return gm(a||arguments.callee.caller,[])}
function gm(a,b){var c=[];if(0<=Ja(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(hm(a)+"(");for(var d=a.arguments,f=0;f<d.length;f++){0<f&&c.push(", ");var g;g=d[f];switch(typeof g){case "object":g=g?"object":"null";break;case "string":break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=hm(g))?g:"[fn]";break;default:g=typeof g}40<g.length&&(g=g.substr(0,40)+"...");c.push(g)}b.push(a);c.push(")\n");try{c.push(gm(a.caller,b))}catch(i){c.push("[exception trying to get caller]\n")}}else a?
c.push("[...long stack...]"):c.push("[end]");return c.join("")}function hm(a){if(im[a])return im[a];a=String(a);if(!im[a]){var b=/function ([^\(]+)/.exec(a);im[a]=b?b[1]:"[Anonymous]"}return im[a]}var im={};function jm(a,b,c,d,f){this.reset(a,b,c,d,f)}jm.prototype.$f=0;jm.prototype.ze=n;jm.prototype.ye=n;var km=0;jm.prototype.reset=function(a,b,c,d,f){this.$f="number"==typeof f?f:km++;this.Cg=d||sa();this.Wb=a;this.Rf=b;this.zg=c;delete this.ze;delete this.ye};jm.prototype.$e=function(a){this.Wb=a};function lm(a){this.Me=a}lm.prototype.va=n;lm.prototype.Wb=n;lm.prototype.Sc=n;lm.prototype.Ee=n;function mm(a,b){this.name=a;this.value=b}mm.prototype.toString=s("name");var nm=new mm("SEVERE",1E3),om=new mm("WARNING",900),pm=new mm("INFO",800),qm=new mm("CONFIG",700),rm=new mm("FINE",500),sm=new mm("FINEST",300);v=lm.prototype;v.getName=s("Me");v.getParent=s("va");v.De=function(){this.Sc||(this.Sc={});return this.Sc};v.$e=function(a){this.Wb=a};
function tm(a){if(a.Wb)return a.Wb;if(a.va)return tm(a.va);Ha("Root logger has no level set.");return n}v.log=function(a,b,c){if(a.value>=tm(this).value){a=this.Gf(a,b,c);b="log:"+a.Rf;ca.console&&(ca.console.timeStamp?ca.console.timeStamp(b):ca.console.markTimeline&&ca.console.markTimeline(b));ca.msWriteProfilerMark&&ca.msWriteProfilerMark(b);for(b=this;b;){var c=b,d=a;if(c.Ee)for(var f=0,g=h;g=c.Ee[f];f++)g(d);b=b.getParent()}}};
v.Gf=function(a,b,c){var d=new jm(a,String(b),this.Me);if(c){d.ze=c;var f;var g=arguments.callee.caller;try{var i;var k=ea("window.location.href");if(y(c))i={message:c,name:"Unknown error",lineNumber:"Not available",fileName:k,stack:"Not available"};else{var l,q,p=r;try{l=c.lineNumber||c.yg||"Not available"}catch(u){l="Not available",p=m}try{q=c.fileName||c.filename||c.sourceURL||k}catch(t){q="Not available",p=m}i=p||!c.lineNumber||!c.fileName||!c.stack?{message:c.message,name:c.name,lineNumber:l,
fileName:q,stack:c.stack||"Not available"}:c}f="Message: "+xa(i.message)+'\nUrl: <a href="view-source:'+i.fileName+'" target="_new">'+i.fileName+"</a>\nLine: "+i.lineNumber+"\n\nBrowser stack:\n"+xa(i.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+xa(fm(g)+"-> ")}catch(x){f="Exception trying to expose exception! You win, we lose. "+x}d.ye=f}return d};v.info=function(a,b){this.log(pm,a,b)};function um(a){Y.log(rm,a,h)}function vm(a){Y.log(sm,a,h)}var wm={},xm=n;
function ym(a){xm||(xm=new lm(""),wm[""]=xm,xm.$e(qm));var b;if(!(b=wm[a])){b=new lm(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=ym(a.substr(0,c));c.De()[d]=b;b.va=c;wm[a]=b}return b};function zm(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}e(Error("Invalid JSON string: "+a))}function Am(a){var b=[];Bm(new Cm,a,b);return b.join("")}function Cm(){this.Fc=h}
function Bm(a,b,c){switch(typeof b){case "string":Dm(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(b==n){c.push("null");break}if(ga(b)){var d=b.length;c.push("[");for(var f="",g=0;g<d;g++)c.push(f),f=b[g],Bm(a,a.Fc?a.Fc.call(b,String(g),f):f,c),f=",";c.push("]");break}c.push("{");d="";for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(f=b[g],"function"!=typeof f&&(c.push(d),Dm(g,c),c.push(":"),
Bm(a,a.Fc?a.Fc.call(b,g,f):f,c),d=","));c.push("}");break;case "function":break;default:e(Error("Unknown type: "+typeof b))}}var Em={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Fm=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Dm(a,b){b.push('"',a.replace(Fm,function(a){if(a in Em)return Em[a];var b=a.charCodeAt(0),f="\\u";16>b?f+="000":256>b?f+="00":4096>b&&(f+="0");return Em[a]=f+b.toString(16)}),'"')};var Gm=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Hm(a){var b=a.match(Gm),a=b[1],c=b[2],d=b[3],b=b[4],f=[];a&&f.push(a,":");d&&(f.push("//"),c&&f.push(c,"@"),f.push(d),b&&f.push(":",b));return f.join("")};ym("goog.net.XhrIo");var Im={1:"NativeMessagingTransport",2:"FrameElementMethodTransport",3:"IframeRelayTransport",4:"IframePollingTransport",5:"FlashTransport",6:"NixTransport"},Z={Pd:"cn",bf:"at",df:"rat",gc:"pu",Ua:"ifrid",Jb:"tp",Lc:"lru",fc:"pru",eb:"lpu",fb:"ppu",Nc:"ph",Mc:"osh",Oc:"role",cf:"nativeProtocolVersion"},Jm=[Z.gc,Z.Lc,Z.fc,Z.eb,Z.fb],Km={};function Lm(a){for(var b=Mm,c=b.length,d="";0<a--;)d+=b.charAt(Math.floor(Math.random()*c));return d}
var Mm="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",Y=ym("goog.net.xpc");/*
Portions of this code are from MochiKit, received by
The Closure Authors under the MIT license. All other code is Copyright
2005-2009 The Closure Authors. All Rights Reserved.
*/
function Nm(a,b){this.kc=[];this.Wd=a;this.ve=b||n}v=Nm.prototype;v.qa=r;v.Rb=r;v.Zb=0;v.Ld=r;v.lf=r;v.jc=0;v.cancel=function(a){if(this.qa)this.ac instanceof Nm&&this.ac.cancel();else{if(this.va){var b=this.va;delete this.va;a?b.cancel(a):(b.jc--,0>=b.jc&&b.cancel())}this.Wd?this.Wd.call(this.ve,this):this.Ld=m;this.qa||this.xe(new Om(this))}};v.re=function(a,b){Pm(this,a,b);this.Zb--;0==this.Zb&&this.qa&&Qm(this)};function Pm(a,b,c){a.qa=m;a.ac=c;a.Rb=!b;Qm(a)}
function Rm(a){a.qa&&(a.Ld||e(new Sm(a)),a.Ld=r)}v.xa=function(a){Rm(this);Pm(this,m,a)};v.xe=function(a){Rm(this);Pm(this,r,a)};function Tm(a,b,c,d){a.kc.push([b,c,d]);a.qa&&Qm(a)}function Um(a,b){var c=qa(b.hf,b);Tm(a,c,n,h)}v.hf=function(a){var b=new Nm;Tm(this,b.xa,b.xe,b);a&&(b.va=this,this.jc++);return b};function Vm(a){return Ma(a.kc,function(a){return ja(a[1])})}
function Qm(a){a.Od&&(a.qa&&Vm(a))&&(ca.clearTimeout(a.Od),delete a.Od);a.va&&(a.va.jc--,delete a.va);for(var b=a.ac,c=r,d=r;a.kc.length&&0==a.Zb;){var f=a.kc.shift(),g=f[0],i=f[1],f=f[2];if(g=a.Rb?i:g)try{var k=g.call(f||a.ve,b);k!==h&&(a.Rb=a.Rb&&(k==b||k instanceof Error),a.ac=b=k);b instanceof Nm&&(d=m,a.Zb++)}catch(l){b=l,a.Rb=m,Vm(a)||(c=m)}}a.ac=b;d&&a.Zb&&(Tm(b,qa(a.re,a,m),qa(a.re,a,r)),b.lf=m);c&&(a.Od=ca.setTimeout(function(){e(new Wm(b))},0))}function Sm(a){ua.call(this);this.zf=a}
ta(Sm,ua);Sm.prototype.message="Already called";function Om(a){ua.call(this);this.zf=a}ta(Om,ua);Om.prototype.message="Deferred was cancelled";function Wm(a){ua.call(this);this.og=a;this.message="Unhandled Error in Deferred: "+(a.message||"[No message]")}ta(Wm,ua);function Xm(a,b){var c;if(a instanceof Xm)this.ka=b!==h?b:a.ka,Ym(this,a.Gb),c=a.Kc,Zm(this),this.Kc=c,c=a.Pb,Zm(this),this.Pb=c,$m(this,a.Dc),c=a.Ac,Zm(this),this.Ac=c,an(this,a.Ra.qc()),c=a.vc,Zm(this),this.vc=c;else if(a&&(c=String(a).match(Gm))){this.ka=!!b;Ym(this,c[1]||"",m);var d=c[2]||"";Zm(this);this.Kc=d?decodeURIComponent(d):"";d=c[3]||"";Zm(this);this.Pb=d?decodeURIComponent(d):"";$m(this,c[4]);d=c[5]||"";Zm(this);this.Ac=d?decodeURIComponent(d):"";an(this,c[6]||"",m);c=c[7]||"";Zm(this);
this.vc=c?decodeURIComponent(c):""}else this.ka=!!b,this.Ra=new bn(n,0,this.ka)}v=Xm.prototype;v.Gb="";v.Kc="";v.Pb="";v.Dc=n;v.Ac="";v.vc="";v.Jf=r;v.ka=r;
v.toString=function(){var a=[],b=this.Gb;b&&a.push(cn(b,dn),":");if(b=this.Pb){a.push("//");var c=this.Kc;c&&a.push(cn(c,dn),"@");a.push(encodeURIComponent(String(b)));b=this.Dc;b!=n&&a.push(":",String(b))}if(b=this.Ac)this.Pb&&"/"!=b.charAt(0)&&a.push("/"),a.push(cn(b,"/"==b.charAt(0)?en:fn));(b=this.Ra.toString())&&a.push("?",b);(b=this.vc)&&a.push("#",cn(b,gn));return a.join("")};v.qc=function(){return new Xm(this)};
function Ym(a,b,c){Zm(a);a.Gb=c?b?decodeURIComponent(b):"":b;a.Gb&&(a.Gb=a.Gb.replace(/:$/,""))}function $m(a,b){Zm(a);b?(b=Number(b),(isNaN(b)||0>b)&&e(Error("Bad port number "+b)),a.Dc=b):a.Dc=n}function an(a,b,c){Zm(a);b instanceof bn?(a.Ra=b,a.Ra.Kd(a.ka)):(c||(b=cn(b,hn)),a.Ra=new bn(b,0,a.ka))}function Zm(a){a.Jf&&e(Error("Tried to modify a read-only Uri"))}v.Kd=function(a){this.ka=a;this.Ra&&this.Ra.Kd(a);return this};function cn(a,b){return y(a)?encodeURI(a).replace(b,jn):n}
function jn(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var dn=/[#\/\?@]/g,fn=/[\#\?:]/g,en=/[\#\?]/g,hn=/[\#\?@]/g,gn=/#/g;function bn(a,b,c){this.ja=a||n;this.ka=!!c}function kn(a){if(!a.Q&&(a.Q=new qj,a.B=0,a.ja))for(var b=a.ja.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),f=n,g=n;0<=d?(f=b[c].substring(0,d),g=b[c].substring(d+1)):f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));f=ln(a,f);a.add(f,g?decodeURIComponent(g.replace(/\+/g," ")):"")}}v=bn.prototype;
v.Q=n;v.B=n;v.add=function(a,b){kn(this);this.ja=n;var a=ln(this,a),c=this.Q.get(a);c||this.Q.set(a,c=[]);c.push(b);this.B++;return this};v.remove=function(a){kn(this);a=ln(this,a);return this.Q.Nb(a)?(this.ja=n,this.B-=this.Q.get(a).length,this.Q.remove(a)):r};v.Nb=function(a){kn(this);a=ln(this,a);return this.Q.Nb(a)};v.xb=function(){kn(this);for(var a=this.Q.Ma(),b=this.Q.xb(),c=[],d=0;d<b.length;d++)for(var f=a[d],g=0;g<f.length;g++)c.push(b[d]);return c};
v.Ma=function(a){kn(this);var b=[];if(a)this.Nb(a)&&(b=Oa(b,this.Q.get(ln(this,a))));else for(var a=this.Q.Ma(),c=0;c<a.length;c++)b=Oa(b,a[c]);return b};v.set=function(a,b){kn(this);this.ja=n;a=ln(this,a);this.Nb(a)&&(this.B-=this.Q.get(a).length);this.Q.set(a,[b]);this.B++;return this};v.get=function(a,b){var c=a?this.Ma(a):[];return 0<c.length?String(c[0]):b};
v.toString=function(){if(this.ja)return this.ja;if(!this.Q)return"";for(var a=[],b=this.Q.xb(),c=0;c<b.length;c++)for(var d=b[c],f=encodeURIComponent(String(d)),d=this.Ma(d),g=0;g<d.length;g++){var i=f;""!==d[g]&&(i+="="+encodeURIComponent(String(d[g])));a.push(i)}return this.ja=a.join("&")};v.qc=function(){var a=new bn;a.ja=this.ja;this.Q&&(a.Q=this.Q.qc());return a};function ln(a,b){var c=String(b);a.ka&&(c=c.toLowerCase());return c}
v.Kd=function(a){if(a&&!this.ka){kn(this);this.ja=n;var b=this.Q,c=function(a,b){var c=b.toLowerCase();b!=c&&(this.remove(b),this.remove(c),0<a.length&&(this.ja=n,this.Q.set(ln(this,c),Pa(a)),this.B+=a.length))};if("function"==typeof b.forEach)b.forEach(c,this);else if(ha(b)||y(b))Ka(b,c,this);else{var d;if("function"==typeof b.xb)d=b.xb();else if("function"!=typeof b.Ma)if(ha(b)||y(b)){d=[];for(var f=b.length,g=0;g<f;g++)d.push(g)}else d=Sa(b);else d=h;b=pj(b);f=b.length;for(g=0;g<f;g++)c.call(this,
b[g],d&&d[g])}}this.ka=a};function mn(a,b,c){this.ia=r;this.xd=a;this.Ab=b||0;this.Sb=c;this.jf=qa(this.Df,this)}ta(mn,Ji);v=mn.prototype;v.Tb=0;v.H=function(){mn.na.H.call(this);this.stop();delete this.xd;delete this.Sb};v.start=function(a){this.stop();this.Tb=dm(this.jf,a!==h?a:this.Ab)};v.stop=function(){this.Ge()&&bm.clearTimeout(this.Tb);this.Tb=0};v.Ge=function(){return 0!=this.Tb};v.Df=function(){this.Tb=0;this.xd&&this.xd.call(this.Sb)};function nn(a){this.ia=r;this.Ka=a||fj()}ta(nn,Ji);nn.prototype.Hb=0;nn.prototype.C=function(){return this.Ka.C()};nn.prototype.getName=function(){return Im[this.Hb]||""};function on(){this.ia=r;this.Jd={}}ta(on,Ji);on.prototype.yc=ym("goog.messaging.AbstractChannel");on.prototype.Aa=function(a){a&&a()};on.prototype.Ba=ba(m);on.prototype.H=function(){on.na.H.call(this);Li(this.yc);delete this.yc;delete this.Jd;delete this.we};function pn(a,b){nn.call(this,b);this.o=a;this.bc=this.o.v[Z.fb];this.Yf=this.o.v[Z.eb];this.Hc=[]}var qn,rn;ta(pn,nn);v=pn.prototype;v.Vf=5;v.Hb=4;v.Jc=0;v.Ib=r;v.kb=r;v.Xe=n;function sn(a){return"googlexpc_"+a.o.name+"_msg"}function tn(a){return"googlexpc_"+a.o.name+"_ack"}function un(a){try{if(!a.ia&&vn(a.o))return a.o.Qa.frames||{}}catch(b){um("error retrieving peer frames")}return{}}
v.Aa=function(){if(!this.ia&&vn(this.o)){um("transport connect called");if(!this.kb){um("initializing...");var a=sn(this);this.Cb=wn(this,a);this.zd=this.C().frames[a];a=tn(this);this.pb=wn(this,a);this.Pc=this.C().frames[a];this.kb=m}if(!xn(this,sn(this))||!xn(this,tn(this))){vm("foreign frames not (yet) present");if(1==yn(this.o))this.Xe||0<this.Vf--||(vm("Inner peer reconnect triggered."),this.o.name=Lm(10),vm("switching channels: "+this.o.name),zn(this),this.kb=r,this.Xe=wn(this,"googlexpc_reconnect_"+
this.o.name));else if(0==yn(this.o)){vm("outerPeerReconnect called");for(var a=un(this),b=a.length,c=0;c<b;c++){var d;try{a[c]&&a[c].name&&(d=a[c].name)}catch(f){}if(d){var g=d.split("_");if(3==g.length&&"googlexpc"==g[0]&&"reconnect"==g[1]){this.o.name=g[2];zn(this);this.kb=r;break}}}}this.C().setTimeout(qa(this.Aa,this),100)}else um("foreign frames present"),this.Ke=new An(this,un(this)[sn(this)],qa(this.Xf,this)),this.Qd=new An(this,un(this)[tn(this)],qa(this.Wf,this)),this.Zd()}};
function wn(a,b){vm("constructing sender frame: "+b);var c;c=document.createElement("iframe");var d=c.style;d.position="absolute";d.top="-10px";d.left="10px";d.width="1px";d.height="1px";c.id=c.name=b;c.src=a.bc+"#INITIAL";a.C().document.body.appendChild(c);return c}function zn(a){vm("deconstructSenderFrames called");a.Cb&&(a.Cb.parentNode.removeChild(a.Cb),a.Cb=n,a.zd=n);a.pb&&(a.pb.parentNode.removeChild(a.pb),a.pb=n,a.Pc=n)}
function xn(a,b){vm("checking for receive frame: "+b);try{var c=un(a)[b];if(!c||0!=c.location.href.indexOf(a.Yf))return r}catch(d){return r}return m}
v.Zd=function(){var a=un(this);!a[tn(this)]||!a[sn(this)]?(this.Yd||(this.Yd=qa(this.Zd,this)),this.C().setTimeout(this.Yd,100),um("local frames not (yet) present")):(this.Le=new Bn(this.bc,this.zd),this.ic=new Bn(this.bc,this.Pc),um("local frames ready"),this.C().setTimeout(qa(function(){this.Le.send("SETUP");this.Ib=this.Bg=m;um("SETUP sent")},this),100))};
function Cn(a){if(a.Id&&a.Ve){if(a.o.Pa(),a.ub){um("delivering queued messages ("+a.ub.length+")");for(var b=0,c;b<a.ub.length;b++)c=a.ub[b],a.o.Ia(c.ag,c.Fd);delete a.ub}}else vm("checking if connected: ack sent:"+a.Id+", ack rcvd: "+a.Ve)}
v.Xf=function(a){vm("msg received: "+a);if("SETUP"==a)this.ic&&(this.ic.send("SETUP_ACK"),vm("SETUP_ACK sent"),this.Id=m,Cn(this));else if(this.o.Ba()||this.Id){var b=a.indexOf("|"),c=a.substring(0,b),a=a.substring(b+1),b=c.indexOf(",");if(-1==b){var d;this.ic.send("ACK:"+c);Dn(this,a)}else d=c.substring(0,b),this.ic.send("ACK:"+d),c=c.substring(b+1).split("/"),b=parseInt(c[0],10),c=parseInt(c[1],10),1==b&&(this.Ed=[]),this.Ed.push(a),b==c&&(Dn(this,this.Ed.join("")),delete this.Ed)}else Y.log(om,
"received msg, but channel is not connected",h)};v.Wf=function(a){vm("ack received: "+a);"SETUP_ACK"==a?(this.Ib=r,this.Ve=m,Cn(this)):this.o.Ba()?this.Ib?parseInt(a.split(":")[1],10)==this.Jc?(this.Ib=r,En(this)):Y.log(om,"got ack with wrong sequence",h):Y.log(om,"got unexpected ack",h):Y.log(om,"received ack, but channel not connected",h)};function En(a){if(!a.Ib&&a.Hc.length){var b=a.Hc.shift();++a.Jc;a.Le.send(a.Jc+b);vm("msg sent: "+a.Jc+b);a.Ib=m}}
function Dn(a,b){var c=b.indexOf(":"),d=b.substr(0,c),c=b.substring(c+1);a.o.Ba()?a.o.Ia(d,c):((a.ub||(a.ub=[])).push({ag:d,Fd:c}),vm("queued delivery"))}v.ec=3800;v.send=function(a,b){var c=a+":"+b;if(!ri||b.length<=this.ec)this.Hc.push("|"+c);else for(var d=b.length,f=Math.ceil(d/this.ec),g=0,i=1;g<d;)this.Hc.push(","+i+"/"+f+"|"+c.substr(g,this.ec)),i++,g+=this.ec;En(this)};
v.H=function(){pn.na.H.call(this);var a=Fn;Na(a,this.Ke);Na(a,this.Qd);this.Ke=this.Qd=n;kj(this.Cb);kj(this.pb);this.zd=this.Pc=this.Cb=this.pb=n};
var Fn=[],Gn=qa(function(){var a=r;try{for(var b=0,c=Fn.length;b<c;b++){var d;if(!(d=a)){var f=Fn[b],g=f.Ue.location.href;if(g!=f.te){f.te=g;var i=g.split("#")[1];i&&(i=i.substr(1),f.kf(decodeURIComponent(i)));d=m}else d=r}a=d}}catch(k){if(Y.info("receive_() failed: "+k),b=Fn[b].ba.o,Y.info("Transport Error"),b.close(),!Fn.length)return}b=sa();a&&(qn=b);rn=window.setTimeout(Gn,1E3>b-qn?10:100)},pn);
function Hn(){um("starting receive-timer");qn=sa();rn&&window.clearTimeout(rn);rn=window.setTimeout(Gn,10)}function Bn(a,b){this.bc=a;this.Ze=b;this.sd=0}Bn.prototype.send=function(a){this.sd=++this.sd%2;a=this.bc+"#"+this.sd+encodeURIComponent(a);try{ti?this.Ze.location.href=a:this.Ze.location.replace(a)}catch(b){Y.log(nm,"sending failed",b)}Hn()};function An(a,b,c){this.ba=a;this.Ue=b;this.kf=c;this.te=this.Ue.location.href.split("#")[0]+"#INITIAL";Fn.push(this);Hn()};function In(a){this.ia=r;this.Sb=a;this.O=[]}ta(In,Ji);var Jn=[];function Kn(a,b,c,d,f,g){if(ga(c))for(var i=0;i<c.length;i++)Kn(a,b,c[i],d,f,g);else b=Yi(b,c,d||a,f,g||a.Sb||a),a.O.push(b)}In.prototype.H=function(){In.na.H.call(this);Ka(this.O,$i);this.O.length=0};In.prototype.handleEvent=function(){e(Error("EventHandler.handleEvent not implemented"))};function Ln(a,b){nn.call(this,b);this.o=a;this.$b=[];this.Af=qa(this.Bf,this)}ta(Ln,nn);v=Ln.prototype;v.Hb=2;v.Hd=r;v.Ta=0;v.Aa=function(){0==yn(this.o)?(this.Na=this.o.zb,this.Na.XPC_toOuter=qa(this.Fe,this)):this.Ud()};
v.Ud=function(){var a=m;try{this.Na||(this.Na=this.C().frameElement),this.Na&&this.Na.XPC_toOuter&&(this.Cd=this.Na.XPC_toOuter,this.Na.XPC_toOuter.XPC_toInner=qa(this.Fe,this),a=r,this.send("tp","SETUP_ACK"),this.o.Pa())}catch(b){Y.log(nm,"exception caught while attempting setup: "+b,h)}a&&(this.Td||(this.Td=qa(this.Ud,this)),this.C().setTimeout(this.Td,100))};v.Nd=function(a){0==yn(this.o)&&!this.o.Ba()&&"SETUP_ACK"==a?(this.Cd=this.Na.XPC_toOuter.XPC_toInner,this.o.Pa()):e(Error("Got unexpected transport message."))};
v.Fe=function(a,b){!this.Hd&&0==this.$b.length?this.o.Ia(a,b):(this.$b.push({bg:a,Fd:b}),1==this.$b.length&&(this.Ta=this.C().setTimeout(this.Af,1)))};v.Bf=function(){for(;this.$b.length;){var a=this.$b.shift();this.o.Ia(a.bg,a.Fd)}};v.send=function(a,b){this.Hd=m;this.Cd(a,b);this.Hd=r};v.H=function(){Ln.na.H.call(this);this.Na=this.Cd=n};function Mn(a,b){nn.call(this,b);this.o=a;this.Tf=this.o.v[Z.fc];this.Se=this.o.v[Z.Ua];ti&&(Nn||(Nn=window.setTimeout(function(){On()},1E3)))}ta(Mn,nn);if(ti)var Pn=[],Nn=0,On=function(a){for(var b=sa(),a=a||3E3;Pn.length&&b-Pn[0].timestamp>=a;){var c=Pn.shift().If;kj(c);vm("iframe removed")}Nn=window.setTimeout(Qn,1E3)},Qn=function(){On()};var Rn={};v=Mn.prototype;v.Hb=3;v.Aa=function(){this.C().xpcRelay||(this.C().xpcRelay=Sn);this.send("tp","SETUP")};
function Sn(a,b){var c=b.indexOf(":"),d=b.substr(0,c),f=b.substr(c+1);if(!ri||-1==(c=d.indexOf("|")))var g=d;else{var g=d.substr(0,c),d=d.substr(c+1),c=d.indexOf("+"),i=d.substr(0,c),c=parseInt(d.substr(c+1),10),k=Rn[i];k||(k=Rn[i]={Be:[],We:0,Ae:0});-1!=d.indexOf("++")&&(k.Ae=c+1);k.Be[c]=f;k.We++;if(k.We!=k.Ae)return;f=k.Be.join("");delete Rn[i]}Km[a].Ia(g,decodeURIComponent(f))}v.Nd=function(a){"SETUP"==a?(this.send("tp","SETUP_ACK"),this.o.Pa()):"SETUP_ACK"==a&&this.o.Pa()};
v.send=function(a,b){var c=encodeURIComponent(b),d=c.length;if(ri&&1800<d)for(var f=Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^sa()).toString(36),g=0,i=0;g<d;i++){var k=c.substr(g,1800),g=g+1800;Tn(this,a,k,f+(g>=d?"++":"+")+i)}else Tn(this,a,c)};
function Tn(a,b,c,d){if(ri){var f=a.C().document.createElement("div");f.innerHTML='<iframe onload="this.xpcOnload()"></iframe>';f=f.childNodes[0];f.xpcOnload=Un}else f=a.C().document.createElement("iframe"),ti?Pn.push({timestamp:sa(),If:f}):Wi(f,"load",Un);var g=f.style;g.visibility="hidden";g.width=f.style.height="0px";g.position="absolute";g=a.Tf;g+="#"+a.o.name;a.Se&&(g+=","+a.Se);g+="|"+b;d&&(g+="|"+d);g+=":"+c;f.src=g;a.C().document.body.appendChild(f);vm("msg sent: "+g)}
function Un(){vm("iframe-load");kj(this);this.Dg=n}v.H=function(){Mn.na.H.call(this);ti&&On(0)};function Vn(a,b,c,d,f){nn.call(this,c);this.o=a;this.mb=f||2;this.Re=b||"*";this.ud=new In(this);this.Yb=new am(100,this.C());this.zc=!!d;this.bb=new Nm;this.cb=new Nm;this.Xa=new Nm;this.Ff=Lm(10);this.Bc=n;this.zc?1==yn(this.o)?Um(this.Xa,this.bb):Um(this.Xa,this.cb):(Um(this.Xa,this.bb),2==this.mb&&Um(this.Xa,this.cb));Tm(this.Xa,this.Oe,n,this);this.Xa.xa(m);a=this.ud;b=this.Yb;c=this.Je;d=cm;ga(d)||(Jn[0]=d,d=Jn);for(f=0;f<d.length;f++){var g=Wi(b,d[f],c||a,r,a.Sb||a);a.O.push(g)}Y.info("NativeMessagingTransport created. protocolVersion="+
this.mb+", oneSidedHandshake="+this.zc+", role="+yn(this.o))}ta(Vn,nn);Vn.prototype.fa=n;Vn.prototype.kb=r;Vn.prototype.Hb=1;var Wn={};
function Xn(a){var b=a.uc.data;if(!y(b))return r;var c=b.indexOf("|"),d=b.indexOf(":");if(-1==c||-1==d)return r;var f=b.substring(0,c),c=b.substring(c+1,d),b=b.substring(d+1);um("messageReceived: channel="+f+", service="+c+", payload="+b);if(d=Km[f])return d.Ia(c,b,a.uc.origin),m;var a=Yn(b)[0],g;for(g in Km)if(d=Km[g],1==yn(d)&&!d.Ba()&&"tp"==c&&("SETUP"==a||"SETUP_NTPV2"==a))return um("changing channel name to "+f),d.name=f,delete Km[g],Km[f]=d,d.Ia(c,b),m;Y.info('channel name mismatch; message ignored"');
return r}v=Vn.prototype;v.Nd=function(a){var b=Yn(a),a=b[1];switch(b[0]){case "SETUP_ACK":Zn(this,1);this.bb.qa||this.bb.xa(m);break;case "SETUP_ACK_NTPV2":2==this.mb&&(Zn(this,2),this.bb.qa||this.bb.xa(m));break;case "SETUP":Zn(this,1);$n(this,1);break;case "SETUP_NTPV2":if(2==this.mb){b=this.fa;Zn(this,2);$n(this,2);if((1==b||this.Bc!=n)&&this.Bc!=a)Y.info("Sending SETUP and changing peer ID to: "+a),ao(this);this.Bc=a}}};
function ao(a){if(2==a.mb&&(a.fa==n||2==a.fa)){var b;b="SETUP_NTPV2,"+a.Ff;a.send("tp",b)}(a.fa==n||1==a.fa)&&a.send("tp","SETUP")}function $n(a,b){if(2==a.mb&&(a.fa==n||2==a.fa)&&2==b)a.send("tp","SETUP_ACK_NTPV2");else if((a.fa==n||1==a.fa)&&1==b)a.send("tp","SETUP_ACK");else return;a.cb.qa||a.cb.xa(m)}function Zn(a,b){b>a.fa&&(a.fa=b);1==a.fa&&(!a.cb.qa&&!a.zc&&a.cb.xa(m),a.Bc=n)}
v.Aa=function(){var a=this.C(),b=la(a),c=Wn[b];"number"==typeof c||(c=0);0==c&&Wi(a.postMessage?a:a.document,"message",Xn,r,Vn);Wn[b]=c+1;this.kb=m;this.Je()};v.Je=function(){var a=0==yn(this.o);this.zc&&a||this.o.Ba()||this.ia?this.Yb.stop():(this.Yb.start(),ao(this))};
v.send=function(a,b){var c=this.o.Qa;c?(this.send=function(a,b){var g=this,i=this.o.name;this.Ic=dm(function(){g.Ic=0;try{var k=c.postMessage?c:c.document;k.postMessage?(k.postMessage(i+"|"+a+":"+b,g.Re),um("send(): service="+a+" payload="+b+" to hostname="+g.Re)):Y.log(om,"Peer window had no postMessage function.",h)}catch(l){Y.log(om,"Error performing postMessage, ignoring.",l)}},0)},this.send(a,b)):um("send(): window not ready")};v.Oe=function(){this.o.Pa(1==this.mb||1==this.fa?200:h)};
v.H=function(){if(this.kb){var a=this.C(),b=la(a),c=Wn[b];Wn[b]=c-1;1==c&&Zi(a.postMessage?a:a.document,"message",Xn,r,Vn)}this.Ic&&(bm.clearTimeout(this.Ic),this.Ic=0);Li(this.ud);delete this.ud;Li(this.Yb);delete this.Yb;this.bb.cancel();delete this.bb;this.cb.cancel();delete this.cb;this.Xa.cancel();delete this.Xa;delete this.send;Vn.na.H.call(this)};function Yn(a){a=a.split(",");a[1]=a[1]||n;return a};function bo(a,b){nn.call(this,b);this.o=a;this.Vd=a[Z.bf]||"";this.Ye=a[Z.df]||"";var c=this.C();if(!c.nix_setup_complete){var d="Class GCXPC____NIXVBS_wrapper\n Private m_Transport\nPrivate m_Auth\nPublic Sub SetTransport(transport)\nIf isEmpty(m_Transport) Then\nSet m_Transport = transport\nEnd If\nEnd Sub\nPublic Sub SetAuth(auth)\nIf isEmpty(m_Auth) Then\nm_Auth = auth\nEnd If\nEnd Sub\nPublic Function GetAuthToken()\n GetAuthToken = m_Auth\nEnd Function\nPublic Sub SendMessage(service, payload)\n Call m_Transport."+
co+"(service, payload)\nEnd Sub\nPublic Sub CreateChannel(channel)\n Call m_Transport."+eo+"(channel)\nEnd Sub\nPublic Sub GCXPC____NIXVBS_container()\n End Sub\nEnd Class\n Function GCXPC____NIXVBS_get_wrapper(transport, auth)\nDim wrap\nSet wrap = New GCXPC____NIXVBS_wrapper\nwrap.SetTransport transport\nwrap.SetAuth auth\nSet GCXPC____NIXVBS_get_wrapper = wrap\nEnd Function";try{c.execScript(d,"vbscript"),c.nix_setup_complete=m}catch(f){Y.log(nm,"exception caught while attempting global setup: "+
f,h)}}this[co]=this.Hf;this[eo]=this.yf}ta(bo,nn);var co="GCXPC____NIXJS_handle_message",eo="GCXPC____NIXJS_create_channel";v=bo.prototype;v.Hb=6;v.Bb=r;v.ab=n;v.Aa=function(){0==yn(this.o)?this.Sd():this.Rd()};v.Sd=function(){if(!this.Bb){var a=this.o.zb;try{a.contentWindow.opener=this.C().GCXPC____NIXVBS_get_wrapper(this,this.Vd),this.Bb=m}catch(b){Y.log(nm,"exception caught while attempting setup: "+b,h)}this.Bb||this.C().setTimeout(qa(this.Sd,this),100)}};
v.Rd=function(){if(!this.Bb){try{var a=this.C().opener;if(a&&"GCXPC____NIXVBS_container"in a){this.ab=a;if(this.ab.GetAuthToken()!=this.Ye){Y.log(nm,"Invalid auth token from other party",h);return}this.ab.CreateChannel(this.C().GCXPC____NIXVBS_get_wrapper(this,this.Vd));this.Bb=m;this.o.Pa()}}catch(b){Y.log(nm,"exception caught while attempting setup: "+b,h);return}this.Bb||this.C().setTimeout(qa(this.Rd,this),100)}};
v.yf=function(a){("unknown"!=typeof a||!("GCXPC____NIXVBS_container"in a))&&Y.log(nm,"Invalid NIX channel given to createChannel_",h);this.ab=a;this.ab.GetAuthToken()!=this.Ye?Y.log(nm,"Invalid auth token from other party",h):this.o.Pa()};v.Hf=function(a,b){this.C().setTimeout(qa(function(){this.o.Ia(a,b,h)},this),1)};v.send=function(a,b){"unknown"!==typeof this.ab&&Y.log(nm,"NIX channel not connected",h);this.ab.SendMessage(a,b)};v.H=function(){bo.na.H.call(this);this.ab=n};function fo(a,b){on.call(this);for(var c=0,d;d=Jm[c];c++)d in a&&!/^https?:\/\//.test(a[d])&&e(Error("URI "+a[d]+" is invalid for field "+d));this.v=a;this.name=this.v[Z.Pd]||Lm(10);this.Ka=b||fj();this.rc=[];this.Cc=new In(this);a[Z.eb]=a[Z.eb]||Hm(this.Ka.C().location.href)+"/robots.txt";a[Z.fb]=a[Z.fb]||Hm(a[Z.gc]||"")+"/robots.txt";Km[this.name]=this;Wi(window,"unload",go);Y.info("CrossPageChannel created: "+this.name)}ta(fo,on);var ho=/^%*tp$/,io=/^%+tp$/;v=fo.prototype;v.Ya=n;v.Ca=n;v.ba=n;
v.Md=1;v.Ba=function(){return 2==this.Md};v.Qa=n;v.zb=n;function vn(a){try{return!!a.Qa&&!Boolean(a.Qa.closed)}catch(b){return r}}function jo(a){a.Ca&&(a.Ca.cancel(),a.Ca=n);a.rc.length=0;a=a.Cc;Ka(a.O,$i);a.O.length=0}v.Aa=function(a){this.qd=a||fa;this.Ca?Tm(this.Ca,this.qe,n,h):this.qe()};
v.qe=function(){Y.info("continueConnection_()");this.Ca=n;this.v[Z.Ua]&&(this.zb=y(this.v[Z.Ua])?this.Ka.Ob.getElementById(this.v[Z.Ua]):this.v[Z.Ua]);if(this.zb){var a=this.zb.contentWindow;a||(a=window.frames[this.v[Z.Ua]]);this.Qa=a}this.Qa||(window==window.top&&e(Error("CrossPageChannel: Can't connect, peer window-object not set.")),this.Qa=window.parent);if(!this.ba){if(!this.v[Z.Jb]){var a=this.v,b=Z.Jb,c;if(ja(document.postMessage)||ja(window.postMessage)||ri&&window.postMessage)c=1;else if(si)c=
2;else if(ri&&this.v[Z.fc])c=3;else{var d;if(d=ri){d=r;try{c=window.opener,window.opener={},d=Oi(window,"opener"),window.opener=c}catch(f){}}c=d?6:4}a[b]=c}switch(this.v[Z.Jb]){case 1:this.ba=new Vn(this,this.v[Z.Nc],this.Ka,!!this.v[Z.Mc],this.v[Z.cf]||2);break;case 6:this.ba=new bo(this,this.Ka);break;case 2:this.ba=new Ln(this,this.Ka);break;case 3:this.ba=new Mn(this,this.Ka);break;case 4:this.ba=new pn(this,this.Ka)}this.ba?Y.info("Transport created: "+this.ba.getName()):e(Error("CrossPageChannel: No suitable transport found!"))}for(this.ba.Aa();0<
this.rc.length;)this.rc.shift()()};v.close=function(){jo(this);this.Md=3;Li(this.ba);this.qd=this.ba=n;Li(this.Ya);this.Ya=n;Y.info('Channel "'+this.name+'" closed')};v.Pa=function(a){this.Ba()||this.Ya&&this.Ya.Ge()||(this.Md=2,Y.info('Channel "'+this.name+'" connected'),Li(this.Ya),a?(this.Ya=new mn(this.qd,a),this.Ya.start()):(this.Ya=n,this.qd()))};v.Oe=fo.prototype.Pa;
v.send=function(a,b){this.Ba()?vn(this)?(ka(b)&&(b=Am(b)),this.ba.send(ko(a),b)):(Y.log(nm,"Peer has disappeared.",h),this.close()):Y.log(nm,"Can't send. Channel not connected.",h)};
v.Ia=function(a,b,c){if(this.Ca)this.rc.push(qa(this.Ia,this,a,b,c));else{var d=this.v[Z.Nc];if(/^[\s\xa0]*$/.test(c==n?"":String(c))||/^[\s\xa0]*$/.test(d==n?"":String(d))||c==this.v[Z.Nc])if(this.ia)Y.log(om,"CrossPageChannel::deliver_(): Disposed.",h);else if(!a||"tp"==a)this.ba.Nd(b);else if(this.Ba()){if(a=a.replace(/%[0-9a-f]{2}/gi,decodeURIComponent),a=io.test(a)?a.substring(1):a,c=this.Jd[a],c||(this.we?c={xa:ra(this.we,a),Pe:ka(b)}:(this.yc.log(om,'Unknown service name "'+a+'"',h),c=n)),
c){var f;a:{if((d=c.Pe)&&y(b))try{f=zm(b);break a}catch(g){this.yc.log(om,"Expected JSON payload for "+a+', was "'+b+'"',h);f=n;break a}else if(!d&&!y(b)){f=Am(b);break a}f=b}f!=n&&c.xa(f)}}else Y.info("CrossPageChannel::deliver_(): Not connected.");else Y.log(om,'Message received from unapproved origin "'+c+'" - rejected.',h)}};function ko(a){ho.test(a)&&(a="%"+a);return a.replace(/[%:|]/g,encodeURIComponent)}function yn(a){var b=a.v[Z.Oc];return b?b:window.parent==a.Qa?1:0}
v.H=function(){this.close();this.zb=this.Qa=n;delete Km[this.name];Li(this.Cc);delete this.Cc;fo.na.H.call(this)};function go(){for(var a in Km)Li(Km[a])};Af(sg,nf.b(function(a){var b=R.c(a,0,n),a=R.c(a,1,n);return S([me.a(b.toLowerCase()),a])},ih.g(N([bi.a({hg:"complete",ng:"success",ig:"error",gg:"abort",lg:"ready",mg:"readystatechange",TIMEOUT:"timeout",jg:"incrementaldata",kg:"progress"})],0))));var lo,mo=n;function no(a){if(a?a.je:a)return a.je(a);var b;var c=lo[w(a==n?n:a)];c?b=c:(c=lo._)?b=c:e(B("IConnection.connect",a));return b.call(n,a)}
function oo(a,b){if(a?a.ke:a)return a.ke(a,b);var c;var d=lo[w(a==n?n:a)];d?c=d:(d=lo._)?c=d:e(B("IConnection.connect",a));return c.call(n,a,b)}function po(a,b,c){if(a?a.le:a)return a.le(a,b,c);var d;var f=lo[w(a==n?n:a)];f?d=f:(f=lo._)?d=f:e(B("IConnection.connect",a));return d.call(n,a,b,c)}function qo(a,b,c,d){if(a?a.me:a)return a.me(a,b,c,d);var f;var g=lo[w(a==n?n:a)];g?f=g:(g=lo._)?f=g:e(B("IConnection.connect",a));return f.call(n,a,b,c,d)}
mo=function(a,b,c,d){switch(arguments.length){case 1:return no.call(this,a);case 2:return oo.call(this,a,b);case 3:return po.call(this,a,b,c);case 4:return qo.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};mo.a=no;mo.b=oo;mo.c=po;mo.n=qo;lo=mo;var ro,so=n;function to(a,b){if(a?a.uf:a)return a.uf(a,b);var c;var d=ro[w(a==n?n:a)];d?c=d:(d=ro._)?c=d:e(B("IConnection.transmit",a));return c.call(n,a,b)}
function uo(a,b,c){if(a?a.ne:a)return a.ne(a,b,c);var d;var f=ro[w(a==n?n:a)];f?d=f:(f=ro._)?d=f:e(B("IConnection.transmit",a));return d.call(n,a,b,c)}function vo(a,b,c,d){if(a?a.vf:a)return a.vf(a,b,c,d);var f;var g=ro[w(a==n?n:a)];g?f=g:(g=ro._)?f=g:e(B("IConnection.transmit",a));return f.call(n,a,b,c,d)}function wo(a,b,c,d,f){if(a?a.wf:a)return a.wf(a,b,c,d,f);var g;var i=ro[w(a==n?n:a)];i?g=i:(i=ro._)?g=i:e(B("IConnection.transmit",a));return g.call(n,a,b,c,d,f)}
function xo(a,b,c,d,f,g){if(a?a.xf:a)return a.xf(a,b,c,d,f,g);var i;var k=ro[w(a==n?n:a)];k?i=k:(k=ro._)?i=k:e(B("IConnection.transmit",a));return i.call(n,a,b,c,d,f,g)}so=function(a,b,c,d,f,g){switch(arguments.length){case 2:return to.call(this,a,b);case 3:return uo.call(this,a,b,c);case 4:return vo.call(this,a,b,c,d);case 5:return wo.call(this,a,b,c,d,f);case 6:return xo.call(this,a,b,c,d,f,g)}e(Error("Invalid arity: "+arguments.length))};so.b=to;so.c=uo;so.n=vo;so.T=wo;so.ga=xo;ro=so;
var yo=Af(sg,nf.b(function(a){var b=R.c(a,0,n),a=R.c(a,1,n);return S([me.a(b.toLowerCase()),a])},bi.a(Z))),zo,Ao=n;function Bo(a,b,c){if(a?a.oe:a)return a.oe(a,b,c);var d;var f=zo[w(a==n?n:a)];f?d=f:(f=zo._)?d=f:e(B("ICrossPageChannel.register-service",a));return d.call(n,a,b,c)}function Co(a,b,c,d){if(a?a.pe:a)return a.pe(a,b,c,d);var f;var g=zo[w(a==n?n:a)];g?f=g:(g=zo._)?f=g:e(B("ICrossPageChannel.register-service",a));return f.call(n,a,b,c,d)}
Ao=function(a,b,c,d){switch(arguments.length){case 3:return Bo.call(this,a,b,c);case 4:return Co.call(this,a,b,c,d)}e(Error("Invalid arity: "+arguments.length))};Ao.c=Bo;Ao.n=Co;zo=Ao;v=fo.prototype;v.je=function(a){return lo.b(a,n)};v.ke=function(a,b){return a.Aa(b)};v.le=function(a,b,c){return lo.n(a,b,c,document.body)};
v.me=function(a,b,c,d){Y.info("createPeerIframe()");var f=a.v[Z.Ua];f||(f=a.v[Z.Ua]="xpcpeer"+Lm(4));var g=fj(d).createElement("IFRAME");g.id=g.name=f;c?c(g):g.style.width=g.style.height="100%";jo(a);a.Ca=new Nm(h,a);var i,c=a.v[Z.gc];y(c)&&(c=a.v[Z.gc]=new Xm(c));var k={};k[Z.Pd]=a.name;k[Z.Jb]=a.v[Z.Jb];k[Z.Mc]=a.v[Z.Mc];a.v[Z.Lc]&&(k[Z.fc]=a.v[Z.Lc]);a.v[Z.eb]&&(k[Z.fb]=a.v[Z.eb]);a.v[Z.fb]&&(k[Z.eb]=a.v[Z.fb]);var l=a.v[Z.Oc];l&&(k[Z.Oc]=1==l?0:1);l=c;k=Am(k);Zm(l);l.Ra.set("xpc",k);i=c;Kn(a.Cc,
g,"load",a.Ca.xa,r,a.Ca);si||ti?window.setTimeout(qa(function(){d.appendChild(g);g.src=i.toString();Y.info("peer iframe created ("+f+")")},a),1):(g.src=i.toString(),d.appendChild(g),Y.info("peer iframe created ("+f+")"));return a.Aa(b)};v.ne=function(a,b,c){return a.send(pe(b),c)};v.oe=function(a,b,c){return zo.n(a,b,c,r)};v.pe=function(a,b,c,d){b=pe(b);a.Jd[b]={xa:c,Pe:!!d}};var Do,Eo=n;function Fo(){var a=(new Xm(window.location.href)).Ra.get("xpc");return z(a)?new fo(zm(a)):n}
function Go(a){return new fo(Od.c(function(a,c){var d=R.c(c,0,n),f=R.c(c,1,n),d=bd.b(yo,d);z(d)&&(a[d]=f);return a},{},a))}Eo=function(a){switch(arguments.length){case 0:return Fo.call(this);case 1:return Go.call(this,a)}e(Error("Invalid arity: "+arguments.length))};Eo.h=Fo;Eo.a=Go;Do=Eo;var Ho=Mh.a(n);function Io(a){var b=function(){try{return Za(["\ufdd0:status","\ufdd0:success","\ufdd0:value",""+E(eval(a))],m)}catch(b){if(b instanceof Error)return Za(["\ufdd0:status","\ufdd0:exception","\ufdd0:value",Kh.g(N([b],0)),"\ufdd0:stacktrace",z(b.hasOwnProperty("stack"))?b.stack:"No stacktrace available."],m);e(b)}}();return Kh.g(N([b],0))}Mh.a(0);var Jo=Do.a(Za(["\ufdd0:peer_uri","http://localhost:9000/repl"],m));Sh.b(Ho,mf(Jo));zo.c(Jo,"\ufdd0:evaluate-javascript",function(a){return ro.c(Jo,"\ufdd0:send-result",Io(a))});lo.c(Jo,mf(n),function(a){return a.style.display="none"});

View File

@ -1,19 +0,0 @@
(defproject frpong "0.1.0-SNAPSHOT"
:description "FRP Pong in ClojureScript using core.async"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:source-paths ["src/clj"]
:dependencies [[org.clojure/clojure "1.5.1"]
[domina "1.0.2-SNAPSHOT"]
[org.clojure/clojurescript "0.0-1844"]
[org.clojure/core.async "0.1.222.0-83d0c2-alpha"]]
:plugins [[lein-cljsbuild "0.3.3"]]
:cljsbuild {:builds
[{:source-paths ["src/cljs"]
:compiler {:output-to "resources/public/js/frpong.js"
:optimizations :whitespace
:pretty-print true}}]})

View File

@ -1,12 +0,0 @@
(ns frpong.core)
(defmacro go [& body] `(cljs.core.async.macros/go ~@body))
(defmacro go-loop [& body]
`(cljs.core.async.macros/go
(while true
~@body)))
(defmacro rd [& body] `(cljs.core.async/<! ~@body))
(defmacro wt [& body] `(cljs.core.async/>! ~@body))

View File

@ -1,4 +0,0 @@
(ns modern-cljs.connect
(:require [clojure.browser.repl :as repl]))
(repl/connect "http://localhost:9000/repl")

View File

@ -1,355 +0,0 @@
(ns frpong.core
(:require [frpong.signals :refer (signal keyboard ticks dom-events mult tap)]
[domina :as dom :refer [log]]
[domina.events :as ev])
(:require-macros [frpong.core :refer (go go-loop rd wt)]))
;; * `signal` creates a new signal
;; * `keyboard`, `ticks` and `dom-events` create signals for keydown events, browser animation ticks and
;; JS DOM events repectively
;; * `mult` creates a mult(iple) of a signal which can then be tapped using `tap` to create a copy of the
;; original signal
;; * `rd` reads the current value of a signal
;; * `wt` sets the current value of a signal to the provided value
;; * `go` and `go-loop` start and run a component
;; Signal Diagram
;;
;; +-d-----------+--------------------------+
;; v | |
;; keyboard +-e-> sampler +---k---> paddle-postnr +-d-+ +-> gravitation +--+ |
;; ^ | p a |
;; t | | | |
;; | | | | |
;; +-------+ +-p----------+-|---+ | d
;; | | +-a-------|-|------+---------------+ |
;; | v v | | | v
;; browser +-b--> ticker +-+--t--> ball-postnr +-p-+-|------|------------p-> renderer
;; ^ | ^ | | | ^ ^
;; Signals | | +-----|---------+ | | | |
;; ------- s | | l +--d--+ | s t
;; b: browser ticks | | | +-+-----|-------+ | | |
;; t: game ticks | | p l +-a-|-------|----+ | |
;; e: keyboard events | | v v v v +-l--+ | |
;; k: keydowns (at rate of t) | +---t-> collision-detr | |
;; p: ball position | | ^ +-s--+-----------------------+ |
;; l: ball velocity | | s | |
;; a: ball acceleration +-----|-------------+-------------+ |
;; d: paddle positions | |
;; s: game state +------------------------------------------------------+
;;
;; All signals except the signal e are at the rate of the signal b. The signal e is at the rate
;; at which the keyboard issues events. The signal b is at the rate at which the browser supplies
;; animation frames.
(defn abs [x] (.abs js/Math x))
(defn sqrt [x] (.sqrt js/Math x))
(defn sq [x] (* x x))
(def PI 3.141592653589793)
(defn deg->rad [deg] (* (/ deg 180) PI))
(defn cos [x] (.cos js/Math x))
(defn sin [x] (.sin js/Math x))
;; Global settings
(def width (- (.-scrollWidth (.-body js/document)) 20))
(def height (- (.-scrollHeight (.-body js/document)) 130))
(def center [(/ width 2 ) (/ height 2)])
(def padding 5)
(def paddle-size 100)
(def ball-radius 8)
(def ball-speed 0.6)
(def init-vel-deg-lim [35 55])
(def perturb-factor 0.05)
(def init-mass-radius 0)
(def paddle-width 10)
(def paddle-step 8)
(def max-paddle-y (- height paddle-size))
(def ef-paddle-width (+ paddle-width padding))
(def init-paddle-pos (/ (- height paddle-size) 2))
(def gravity (atom 0.005))
(def gravity-step 0.005)
(defn mass-radius []
(+ init-mass-radius (* (deref gravity) 1000)))
(defn setup-gravity-controls
"Sets up keyboard controls for changing gravity."
[]
(let [keydowns (first (dom-events :keydown))
actions { 37 #(- % gravity-step) 39 #(+ % gravity-step) }
mass-el (dom/by-id "mass")]
(go-loop
(let [k (:keyCode (rd keydowns))]
(when (contains? actions k)
(do (swap! gravity #(max 0 (min 0.1 ((actions k) %))))
(dom/set-attr! mass-el "r" (mass-radius))))))))
(defn layout-game
"Lays out the game screen."
[]
(doto (dom/by-id "canvas")
(dom/set-style! "width" (str width "px"))
(dom/set-style! "height" (str height "px")))
(doto (dom/by-id "ball")
(dom/set-attr! "r" ball-radius)
(dom/set-attr! "cx" (first center))
(dom/set-attr! "cy" (second center)))
(doto (dom/by-id "mass")
(dom/set-attr! "r" (mass-radius))
(dom/set-attr! "cx" (first center))
(dom/set-attr! "cy" (second center)))
(doto (dom/by-id "score")
(dom/set-attr! "x" (first center))
(dom/set-attr! "y" (- height 50)))
(doseq [id ["lpaddle" "rpaddle"]]
(doto (dom/by-id id)
(dom/set-attr! "width" paddle-width)
(dom/set-attr! "height" paddle-size)
(dom/set-attr! "y" (/ (- height paddle-size) 2))))
(dom/set-attr! (dom/by-id "lpaddle") "x" 0)
(dom/set-attr! (dom/by-id "rpaddle") "x" (- width paddle-width)))
(defn initial-velocity
"Calculates a random initial ball velocity, randomly in any four quadrants, between
the limits of degrees specified by init-vel-deg-lim."
[]
(let [[l h] init-vel-deg-lim
sgn #(if (< % 0.5) -1 1)
deg (+ l (* (- h l) (rand)))
rad (deg->rad deg)]
(map #(* ball-speed %)
[(* (sgn (rand)) (sin rad)) (* (sgn (rand)) (cos rad))])))
(defn start-game
"Sets up the game by creating the signals and setting up the components and starts the game."
[]
(let [br-ticks (ticks) ;; ticks signal from the browser
pos (signal) ;; ball position signal
vel (signal) ;; ball velocity signal
acc (signal) ;; ball acceleration signal
pd-pos (signal) ;; paddles position signal
game-state (signal) ;; game state signal, the state of the game and the current score
init-vel (initial-velocity)]
(setup-components br-ticks game-state pos vel acc pd-pos)
;; start the game by setting the initial values of the signals
(go
(wt pos center)
(wt vel init-vel)
(wt pd-pos [init-paddle-pos init-paddle-pos])
(wt game-state [:moving 0]))))
(defn start-on-space []
(ev/listen-once! :keypress #(if (= (:keyCode %) 32) (start-game) (start-on-space))))
(defn setup-components
"Creates mult(iple)s of the signals and sets up the components by connecting them using
the signals tapped from the mults.
The signals and their stop functions are taken as parameters."
[[br-ticks stop-ticks] game-state pos vel acc pd-pos]
(let [ticks (signal) ;; game ticks signal
ticks-m (mult ticks) ;; mult(iple)s for all signals
pos-m (mult pos)
vel-m (mult vel)
acc-m (mult acc)
pd-pos-m (mult pd-pos)
game-state-m (mult game-state)
;; keyboard signal for w, s, up and down keys
[keyboard stop-keyboard] (keyboard (tap ticks-m) {83 :s 87 :w 38 :up 40 :down})
;; calling this will stop the ticks and the keyboard signals and hence stop the game
stop-game #(do (stop-ticks) (stop-keyboard))]
;; set up the components by tapping into mults
(ticker br-ticks stop-game (tap game-state-m) ticks)
(gravitation (tap pos-m) acc)
(ball-positioner (tap ticks-m) (tap pos-m) (tap vel-m) (tap acc-m) pos)
(paddle-positioner keyboard (tap pd-pos-m) pd-pos)
(collision-detector (tap ticks-m) (tap pos-m) (tap vel-m) (tap acc-m)
(tap pd-pos-m) (tap game-state-m) game-state vel)
(renderer (tap ticks-m) (tap game-state-m) (tap pos-m) (tap pd-pos-m))))
(defn ticker
"Ticker component.
Reads ticks generated by the browser from the `br-ticks` signal and outputs them to the
`game-ticks` signal as long as the `game-state` signal is not :gameover.
Once the `game-state` signal is :gameover, stops the game by calling the `stop-game` function.
Each tick is the number of milliseconds since the last tick was generated."
[br-ticks stop-game game-state game-ticks]
(go (loop []
(let [[state _] (rd game-state)]
(do (wt game-ticks (rd br-ticks))
(if-not (= :gameover state)
(recur)
(stop-game)))))))
(defn gravity-acc
"Calculates acceleration due to gravitation for the ball caused by the mass placed at the
center of the board."
[[x y]]
(let [grav (deref gravity)
[cx cy] center
x-dist (- cx x)
y-dist (- cy y)
distance (sqrt (+ (sq x-dist) (sq y-dist)))
bearing [(/ x-dist distance) (/ y-dist distance)]]
(if-not (= distance 0)
(map #(* grav % (/ 1 distance)) bearing)
[0 0])))
(defn gravitation
"Gravitation component.
Calculates acceleration due to gravitation using the pos from the `pos-in` signal and outputs
it to the `acc` signal."
[pos-in acc]
(go-loop
(wt acc (gravity-acc (rd pos-in)))))
(defn next-pos [[x y] [vel-x vel-y] [acc-x acc-y] tick]
[(+ x (* vel-x tick) (* acc-x (sq tick))) (+ y (* vel-y tick) (* acc-y (sq tick)))])
(defn ball-positioner
"Ball Positioner component.
Calculates the next ball position using the current ball position, velocity and acceleration
(from the `pos-in`, `vel` and `acc` signals respectively) and the current tick (from the
`ticks` signal) and outputs it to the `pos-out` signal."
[ticks pos-in vel acc pos-out]
(go-loop
(let [tick (rd ticks)
pos-next (next-pos (rd pos-in) (rd vel) (rd acc) tick)]
(wt pos-out pos-next))))
(defn paddle-positioner
"Paddle Positioner component.
Captures the keys signal for the provides keycodes and calculates the next paddle
positions using the current paddle positions (from the `pos-in` signal) and keys signal
and outputs it to the `pos-out` signal."
[keys pos-in pos-out]
(go-loop
(let [[lpos rpos] (rd pos-in)
ks (rd keys)
move (fn [pos up down]
(cond
(contains? ks up) (max (- pos paddle-step) 0)
(contains? ks down) (min (+ pos paddle-step) max-paddle-y)
:else pos))]
(wt pos-out [(move lpos :w :s) (move rpos :up :down)]))))
(defn in-y-range? [y paddle-y]
(and (> y (- paddle-y padding)) (< y (+ paddle-y paddle-size padding))))
(defn detect-x-collision [x y lpaddle-y rpaddle-y]
(cond
(< x ef-paddle-width)
(if (in-y-range? y lpaddle-y) :collision-left :gameover)
(> x (- width ef-paddle-width))
(if (in-y-range? y rpaddle-y) :collision-right :gameover)
:else :moving))
(defn detect-y-collision [y]
(cond
(< y padding) :collision-left
(> y (- height padding)) :collision-right
:else :moving))
(defn collision? [state]
(or (= state :collision-left) (= state :collision-right)))
(defn adjust-vel [state vel]
(condp = state
:collision-left (abs vel)
:collision-right (- (abs vel))
:moving vel
:gameover 0))
(defn perturb [v] (* v (+ 1 (* (rand) perturb-factor))))
(defn collision-detector [ticks pos vel-in acc pd-pos game-state-in game-state vel-out]
"Collision Detector component.
Detects the collision of the ball with the walls and the paddles and accordingly calculates
and outputs the next ball velocity and next game state to the `vel-out` and `game-state`
signals respectively.
Reads the current tick, ball position, ball velocity, ball acceleration, left and right paddle
positions and game state from the `ticks`, `pos`, `vel-in`, `acc`, `pd-pos` and `game-state`
signals respectively."
(go-loop
(let [;; read all current values
tick (rd ticks)
[vel-x vel-y] (rd vel-in)
[x y] (rd pos)
[gx gy] (rd acc)
[lpaddle-y rpaddle-y] (rd pd-pos)
[_ score] (rd game-state-in)
;; calculate next position and detect collision
[xn yn] (next-pos [x y] [vel-x vel-y] [gx gy] tick)
x-state (detect-x-collision xn yn lpaddle-y rpaddle-y)
y-state (detect-y-collision yn)
x-collision (collision? x-state)
y-collision (collision? y-state)
;; calculate next velocity and game state
vel-xn (min ball-speed (+ (adjust-vel x-state vel-x) (* gx tick)))
vel-yn (min ball-speed (+ (adjust-vel y-state vel-y) (* gy tick)))
state-n (cond
(= x-state :gameover) :gameover
(or x-collision y-collision) :collision
:else :moving)
score-n (if x-collision (inc score) score)
;; add a small random perturbation to the ball velocity on collision with paddles
[vel-xn vel-yn] (if x-collision
(map perturb [vel-xn vel-yn])
[vel-xn vel-yn])]
(wt vel-out [vel-xn vel-yn])
(wt game-state [state-n score-n]))))
(defn renderer
"Renderer component.
Renders the ball and paddle positions on the browser. Also shows the game state and stats.
Reads the current values from the signals supplied as parameters."
[ticks game-state pos pd-pos]
(let [ball-el (dom/by-id "ball")
score-el (dom/by-id "score")
lpaddle-el (dom/by-id "lpaddle")
rpaddle-el (dom/by-id "rpaddle")
fps-el (dom/by-id "fps")
msg-el (dom/by-id "msg")]
(dom/set-style! ball-el "fill" "orange")
(dom/set-text! msg-el "")
(go (loop [fps-p nil score-p nil]
(let [fps (int (/ 1000 (rd ticks)))
[x y] (rd pos)
[lpaddle-y rpaddle-y] (rd pd-pos)
[state score] (rd game-state)]
(doto ball-el
(dom/set-attr! "cx" x)
(dom/set-attr! "cy" y))
(dom/set-attr! lpaddle-el "y" lpaddle-y)
(dom/set-attr! rpaddle-el "y" rpaddle-y)
(when-not (= fps fps-p)
(dom/set-text! fps-el fps))
(when-not (= score score-p)
(dom/set-text! score-el score))
(when (= state :gameover)
(do (dom/set-style! ball-el "fill" "red")
(dom/set-html! msg-el "<span class='imp'>GAME OVER</span><br>press &lt;space&gt; to restart")
(start-on-space)))
(recur fps score))))))
;; Everything is ready now. Layout the game and start it on pressing <space>!
(defn ^:export frpong []
(setup-gravity-controls)
(layout-game)
(start-on-space))

View File

@ -1,272 +0,0 @@
(ns frpong.signals
(:require [cljs.core.async :as async
:refer [<! >! chan put! close! sliding-buffer dropping-buffer timeout]]
[domina :as dom :refer [log]]
[domina.events :as ev])
(:require-macros [cljs.core.async.macros :as m :refer [go]]
[frpong.core :refer (go-loop)]))
(defn now []
(.valueOf (js/Date.)))
(defn signal [] (chan 1))
(defn put-all! [cs x]
(doseq [c cs]
(put! c x)))
(defn probe [ch probe-name]
(let [c (chan)]
(go (loop []
(if-let [v (<! ch)]
(do (log (str (now) " " probe-name ": " v))
(>! c v)
(recur))
(close! c))))
c))
(defn smap [f source]
(let [c (chan)]
(go (loop []
(if-let [v (<! source)]
(do (>! c (f v)) (recur))
(close! c))))
c))
(defn sfilter [f source]
(let [c (chan)]
(go (loop []
(if-let [v (<! source)]
(do (when (f v) (>! c v)) (recur))
(close! c))))
c))
(defn interval-signal
([msecs]
(interval-signal msecs :leading))
([msecs type]
(let [c (chan (dropping-buffer 1))]
(condp = type
:leading (go-loop
(>! c (now))
(<! (timeout msecs)))
:falling (go-loop
(<! (timeout msecs))
(>! c (now))))
c)))
(defn throttle [source control]
(let [c (chan)]
(go
(loop [state ::init last nil]
(let [[v sc] (alts! [source control])]
(condp = sc
source (condp = state
::init (do (>! c v) (recur ::throttling last))
::throttling (recur state v))
control (if last
(do (>! c last) (recur state nil))
(recur ::init last))))))
c))
(defn sustain [source control]
(let [c (chan)]
(go
(loop [last nil]
(let [[v ch] (alts! [source control] :priority true)]
(if (nil? v)
(close! c)
(condp = ch
source (do (>! c v) (recur v))
control (do (when last (>! c last)) (recur last)))))))
c))
(defn debounce [source msecs]
(let [c (chan)]
(go
(loop [state ::init cs [source]]
(let [[_ threshold] cs]
(let [[v sc] (alts! cs)]
(condp = sc
source (condp = state
::init
(do (>! c v)
(recur ::debouncing
(conj cs (timeout msecs))))
::debouncing
(recur state
(conj (pop cs) (timeout msecs))))
threshold (recur ::init (pop cs)))))))
c))
(defn after-last [source msecs]
(let [c (chan)]
(go
(loop [cs [source]]
(let [[_ toc] cs]
(let [[v sc] (alts! cs :priority true)]
(recur
(condp = sc
source (conj (if toc (pop cs) cs)
(timeout msecs))
toc (do (>! c (now)) (pop cs))))))))
c))
(defn fan-in [ins]
(let [c (chan)]
(go-loop
(let [[x] (alts! ins)]
(>! c x)))
c))
(defn scounter [source]
(let [c (chan)]
(go
(loop [count 0]
(if-let [v (<! source)]
(do (>! c count) (recur (inc count)))
(close! c))))
c))
(defn sdiff [source]
(let [c (chan)]
(go
(let [start (<! source)]
(loop [start start]
(if-let [v (<! source)]
(do (>! c (- v start)) (recur v))
(close! c)))))
c))
(defn sampler [source n]
(let [c (chan)]
(go
(loop [count 0]
(if-let [v (<! source)]
(do (when (= count 0) (>! c v))
(recur (rem (inc count) n)))
(close! c))))
c))
(defn dom-events
([event-type]
(let [c (chan)
[lkey] (ev/listen! event-type #(put! c %))]
[c #(do (ev/unlisten-by-key! lkey) (close! c))]))
([node event-type]
(let [c (chan)
[lkey] (ev/listen! node event-type #(put! c %))]
[c #(do (ev/unlisten-by-key! lkey) (close! c))])))
(defn keyboard [sampler keycodes]
(let [[keydowns kd-stop-fn] (dom-events :keydown) ;; keydowns signal
[keyups ku-stop-fn] (dom-events :keyup) ;; keyups signal
c (chan)
ops { keydowns conj
keyups disj }]
(go (loop [keys #{}]
(let [[v ch] (alts! [keydowns keyups sampler] :priority true)]
(if-not (nil? v)
(if (or (= ch keydowns) (= ch keyups))
(let [k (:keyCode v)]
(if (contains? keycodes k)
(recur ((ops ch) keys (keycodes k)))
(recur keys)))
(do (>! c keys) (recur keys)))
(close! c)))))
[c #(do (kd-stop-fn) (ku-stop-fn))]))
(defn frames []
(let [fc (chan (sliding-buffer 1000))
rc (chan (sliding-buffer 10))
step (fn step [ts]
(let [req-id (.requestAnimationFrame js/window step)]
(put! fc ts)
(put! rc req-id)))
stop-fn (fn []
(go (loop []
(if-let [id (<! rc)]
(do (.cancelAnimationFrame js/window id) (recur)))))
(close! fc)
(close! rc))]
(.requestAnimationFrame js/window step)
[fc stop-fn]))
(defn ticks []
(let [c (chan)
[frames stop-fn] (frames)
frames-diff (sdiff frames)]
(go
(loop [prev (<! frames-diff)]
(if-let [t (<! frames-diff)]
(do (when (< t (* 10 prev)) (>! c t))
(recur t))
(close! c))))
[c stop-fn]))
(defprotocol Mux
(muxch* [_]))
(defprotocol Mult
(tap* [m ch close?])
(untap* [m ch])
(untap-all* [m]))
(defn mult
"Creates and returns a mult(iple) of the supplied channel. Channels
containing copies of the channel can be created with 'tap', and
detached with 'untap'.
Each item is distributed to all taps in parallel and synchronously,
i.e. each tap must accept before the next item is distributed. Use
buffering/windowing to prevent slow taps from holding up the mult.
Items received when there are no taps get dropped.
If a tap put throws an exception, it will be removed from the mult."
[ch]
(let [cs (atom {}) ;;ch->close?
m (reify
Mux
(muxch* [_] ch)
Mult
(tap* [_ ch close?] (swap! cs assoc ch close?) nil)
(untap* [_ ch] (swap! cs dissoc ch) nil)
(untap-all* [_] (reset! cs {}) nil))
dchan (chan 1)
dctr (atom nil)
done #(when (zero? (swap! dctr dec))
(put! dchan true))]
(go (loop []
(let [val (<! ch)]
(if (nil? val)
(doseq [[c close?] @cs]
(when close? (close! c)))
(let [chs (keys @cs)]
(reset! dctr (count chs))
(doseq [c chs]
(put! c val done))
;;wait for all
(when (seq chs)
(<! dchan))
(recur))))))
m))
(defn tap
"Copies the mult source onto the supplied channel.
By default the channel will be closed when the source closes,
but can be determined by the close? parameter."
([mult] (tap mult (chan)))
([mult ch] (tap mult ch true))
([mult ch close?] (tap* mult ch close?) ch))
(defn untap
"Disconnects a target channel from a mult"
[mult ch]
(untap* mult ch))
(defn untap-all
"Disconnects all target channels from a mult"
[mult] (untap-all* mult))