diff --git a/french_law_js/allocations_familiales.js b/french_law_js/allocations_familiales.js index 31e2a89b..d79c026c 100644 --- a/french_law_js/allocations_familiales.js +++ b/french_law_js/allocations_familiales.js @@ -4,20 +4,20 @@ var suite = new Benchmark.Suite(); suite .add("AllocationFamiliales#benchmark", function () { - Law.computeAllocationsFamiliales({ - currentDate: new Date("2020-05-20"), + var result = Law.computeAllocationsFamiliales({ + currentDate: new Date(Date.UTC(2020, 04, 20)), children: [ { id: 0, remunerationMensuelle: 0, - dateNaissance: new Date("2003-03-02"), + dateNaissance: new Date(Date.UTC(2003, 02, 02)), priseEnCharge: "Effective et permanente", aDejaOuvertDroitAuxAllocationsFamiliales: true, }, { id: 1, remunerationMensuelle: 300, - dateNaissance: new Date("2013-10-30"), + dateNaissance: new Date(Date.UTC(2013, 09, 30)), priseEnCharge: "Garde alternée, partage des allocations", aDejaOuvertDroitAuxAllocationsFamiliales: true, }, @@ -27,7 +27,7 @@ suite personneQuiAssumeLaChargeEffectivePermanenteEstParent: true, personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true, }); - Law.resetLog(true); + Law.resetLog(); }) .on("cycle", function (event) { console.log(String(event.target)); diff --git a/french_law_js/french_law.js b/french_law_js/french_law.js index 3598f564..9c1f1db6 100644 --- a/french_law_js/french_law.js +++ b/french_law_js/french_law.js @@ -1,93 +1,93 @@ // Generated by js_of_ocaml 3.9.1 (function(q){"use strict";var -ir=219,cW=1582,hq="src/time_Zone.ml",h1=214,iq=1e14,hZ="Invalid_argument",h0=" is too large for shifting.",hY="0.08",dJ="Map.bal",ip="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",hp="allocations_familiales",e3=1255,dR="Instructions minist\xc3\xa9rielles",fd="<",b6=255,P="Code de la s\xc3\xa9curit\xc3\xa9 sociale",io=0x800,iO="Article L521-1",hX="577500",cG=2019,e2="jsError",a4=0x8000,hW="%ni",ho="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",$="droit_ouvert_majoration",cV=146097,iN=43200.,b9=256,e$="ml_z_overflow",il="Article L521-3",im=0.012,K=86400.,hn="End_of_file",a5=2020,hm="Failure",hV="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019\nrelative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources\nd\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole,\nen Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy,\n\xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",aG=0xff,hl=129,hU=-45,fm=-12,hk=218,fc=204,cU="conditions_hors_\xc3\xa2ge",iM="559500",bI="Article 1",dZ="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",b5="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3_m\xc3\xa9tropole",hS="582700",hT=167,iL=992015837,hR=274,s="0",dQ="EnfantLePlus\xc3\x82g\xc3\xa9",dI="date_courante",fb=0xf,fl="0.5",ca=128,dE=-48,hj=0xdc00,hQ="Sys_blocked_io",iK="fd ",cT="montant_initial_m\xc3\xa9tropole_majoration",e9="Chapitre 2 : Champ d'application",e_="0.0588",C=248,af="camlinternalFormat.ml",ik="Division_by_zero",dY=">",b$=153,iJ=1027,hi="Sys_error",hP="montant_vers\xc3\xa9",ij="x",iI="enfants_\xc3\xa0_charge",aW="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",hh=317,e1="Article D521-2",hO=193,bS="Article D755-5",e0="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",hN=246,bg=60.,hL="%u",hM="resetLog",ii="%d",f="AllocationsFamiliales",hK=3268,hg=32082,bH=1900,hJ="./securite_sociale_R.catala_fr",ih="buffer.ml",w="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",ig=119,bQ="2",cJ=127,cK=1024,cS="montant_avec_garde_altern\xc3\xa9e_majoration",ie="version_avril_2008",az="1",dX="e",dD=120,eZ=103,hI=" : flags Open_rdonly and Open_wronly are not compatible",dP=127686388,iH="ressources_m\xc3\xa9nage",hf="16",id=102,iG="([^/]*)",eY=512,hG="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",hH=240,an="-",he=0x7ff0,bF=803994948,bD="D\xc3\xa9crets divers",hF=" : file already exists",dO=101,iF="smic",hE=184,iE="Article D521-3",bl=0xffffff,hd="0x",iD=-43,O="./securite_sociale_D.catala_fr",dW=86400,iC="Out_of_memory",hc="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",bR=1e7,iB="inf",eX=354,cR=254,fk="index out of bounds",aP=100,dV="_bigarr02",hb="%Li",ic=" : flags Open_text and Open_binary are not compatible",cQ="3",N="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iA=0xffffffff,hD=168,ib="169.",hB=2147483647,hC=208,bG=0.5,aO="Article D521-1",a8=0xffff,ia=188,aN="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",dU=417088404,Y="input",ha="str.ml",hA=12520,iz=400,hz=-46,g$="personne_charge_effective_permanente_remplit_titre_I",cP="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3_outre_mer",at=3600,e8="AllocationFamilialesAvril2008",z="Chapitre 1er : Allocations familiales",h$="prestations_familiales",cO="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",hy="retrieveLog",g_="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",dC="_z",h9="Unix.Unix_error",h_="computeAllocationsFamiliales",h8="0.55",bo="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",iy="infinity",cN="droit_ouvert",aL=1000,hx=224,k="",h7="Stack_overflow",e7="^",bE=3600.,aa="Partie l\xc3\xa9gislative",hw=86400000,h6="Interface du programme",fj=264,bC="Titre 5 : D\xc3\xa9partements d'outre-mer",b7=0x3f,h5=-97,h4="Not_found",fi=124,aq="InterfaceAllocationsFamiliales",e6="./epilogue.catala_fr",cM=1461,fh="Article L512-3",aQ="./decrets_divers.catala_fr",A="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",hv="Match_failure",ix="enfants",g8=32044,g9=", ",dN="1.",g7="static/",iw="personne_charge_effective_permanente_est_parent",bk=2021,iv="enfant_le_plus_\xc3\xa2g\xc3\xa9",fg=252,bn=".",cI="montant_initial_majoration",bj="+",h3=2440588,iu=0xf0,g6="src/date.ml",b_="12.",Q="PrestationsFamiliales",cX=110,eW="\xc3\x89pilogue",hu="%li",h2=1026,bi="prise_en_compte",a6="Article L521-2",dT=365,cH="Smic",dM="Invalid integer: ",dL=2440587.5,ff=-32,bf=" ",aM=0x80,a7=1023,g5="Undefined_recursive_module",X="output",ab="./securite_sociale_L.catala_fr",dH=2299161,e5="nan",it=969837588,dK="src/calendar_builder.ml",ht=0xe0,hs=0xdfff,bm="compl\xc3\xa9ment_d\xc3\xa9gressif",bh="/",fa="compare: functional value",fe="Article L755-12",is="Assert_failure",aF="droit_ouvert_forfaitaire",g4="0.16",dG=2400000.5,cL="0.",g3="%i",e4=1073741823,b8=529348384,dS="r\xc3\xa9sidence",hr=225,dF=250;function -x7(d,b,e,c,f){if(c<=b)for(var +iI=219,c2=1582,hG="src/time_Zone.ml",ig=214,iH=1e14,id="Invalid_argument",ie=" is too large for shifting.",ic="0.08",dS="Map.bal",iG="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",hF="allocations_familiales",fh=1255,d0="Instructions minist\xc3\xa9rielles",ft="<",cd=255,Q="Code de la s\xc3\xa9curit\xc3\xa9 sociale",iF=0x800,i7="Article L521-1",ib="577500",cM=2019,fg="jsError",a5=0x8000,ia="%ni",hE="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",aa="droit_ouvert_majoration",c1=146097,i6=43200.,cg=256,fp="ml_z_overflow",iD="Article L521-3",iE=0.012,K=86400.,hD="End_of_file",a6=2020,hC="Failure",h$="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019\nrelative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources\nd\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole,\nen Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy,\n\xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",aJ=0xff,hB=129,h_=-45,fC=-12,hA=218,fs=204,c0="conditions_hors_\xc3\xa2ge",i5="559500",bL="Article 1",d8="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",cc="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3_m\xc3\xa9tropole",h8="582700",h9=167,i4=992015837,h7=274,s="0",dZ="EnfantLePlus\xc3\x82g\xc3\xa9",dR="date_courante",fr=0xf,fB="0.5",cj=128,dN=-48,hz=0xdc00,h6="Sys_blocked_io",i3="fd ",cZ="montant_initial_m\xc3\xa9tropole_majoration",fn="Chapitre 2 : Champ d'application",fo="0.0588",D=248,ag="camlinternalFormat.ml",iC="Division_by_zero",d7=">",ci=153,i2=1027,hy="Sys_error",h5="montant_vers\xc3\xa9",iB="x",i1="enfants_\xc3\xa0_charge",aY="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",hx=317,ff="Article D521-2",h4=193,bX="Article D755-5",fe="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",h3=246,bj=60.,h1="%u",h2="resetLog",iA="%d",e="AllocationsFamiliales",h0=3268,hw=32082,bK=1900,hZ="./securite_sociale_R.catala_fr",iz="buffer.ml",w="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",iy=119,bV="2",cP=127,cQ=1024,cY="montant_avec_garde_altern\xc3\xa9e_majoration",ix="version_avril_2008",aD="1",d6="e",dM=120,fd=103,hY=" : flags Open_rdonly and Open_wronly are not compatible",dY=127686388,i0="ressources_m\xc3\xa9nage",hv="16",iw=102,iZ="([^/]*)",fc=512,hW="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",hX=240,ao="-",hu=0x7ff0,bI=803994948,bG="D\xc3\xa9crets divers",hV=" : file already exists",dX=101,iY="smic",hU=184,iX="Article D521-3",bo=0xffffff,ht="0x",iW=-43,P="./securite_sociale_D.catala_fr",d5=86400,iV="Out_of_memory",hs="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",bW=1e7,iU="inf",fb=354,cX=254,fA="index out of bounds",aS=100,d4="_bigarr02",hr="%Li",iv=" : flags Open_text and Open_binary are not compatible",cW="3",O="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iT=0xffffffff,hT=168,iu="169.",hR=2147483647,hS=208,bJ=0.5,aR="Article D521-1",a9=0xffff,it=188,aQ="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",d3=417088404,Y="input",hq="str.ml",hQ=12520,iS=400,hP=-46,hp="personne_charge_effective_permanente_remplit_titre_I",cV="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3_outre_mer",aw=3600,fm="AllocationFamilialesAvril2008",z="Chapitre 1er : Allocations familiales",is="prestations_familiales",cU="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",hO="retrieveLog",ho="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",dL="_z",iq="Unix.Unix_error",ir="computeAllocationsFamiliales",ip="0.55",br="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",iR="infinity",cT="droit_ouvert",aO=1000,hN=224,k="",io="Stack_overflow",fl="^",bH=3600.,ab="Partie l\xc3\xa9gislative",hM=86400000,im="Interface du programme",fz=264,bF="Titre 5 : D\xc3\xa9partements d'outre-mer",ce=0x3f,il=-97,ik="Not_found",fy=124,at="InterfaceAllocationsFamiliales",fk="./epilogue.catala_fr",cS=1461,fx="Article L512-3",aT="./decrets_divers.catala_fr",A="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",hL="Match_failure",iQ="enfants",hm=32044,hn=", ",dW="1.",hl="static/",iP="personne_charge_effective_permanente_est_parent",bn=2021,iO="enfant_le_plus_\xc3\xa2g\xc3\xa9",fw=252,bq=".",cO="montant_initial_majoration",bm="+",ij=2440588,iN=0xf0,hk="src/date.ml",ii=32752,ch="12.",R="PrestationsFamiliales",c3=110,fa="\xc3\x89pilogue",hK="%li",ih=1026,bl="prise_en_compte",a7="Article L521-2",d2=365,cN="Smic",dV="Invalid integer: ",dU=2440587.5,fv=-32,bi=" ",aP=0x80,a8=1023,hj="Undefined_recursive_module",X="output",iM=-1080,ac="./securite_sociale_L.catala_fr",dQ=2299161,fj="nan",iL=969837588,dT="src/calendar_builder.ml",hJ=0xe0,iK=-1023,hI=0xdfff,bp="compl\xc3\xa9ment_d\xc3\xa9gressif",bk="/",fq="compare: functional value",fu="Article L755-12",iJ="Assert_failure",aI="droit_ouvert_forfaitaire",hi="0.16",dP=2400000.5,cR="0.",hh="%i",fi=1073741823,cf=529348384,d1="r\xc3\xa9sidence",hH=225,dO=250;function +yw(d,b,e,c,f){if(c<=b)for(var a=1;a<=f;a++)e[c+a]=d[b+a];else for(var a=f;a>=1;a--)e[c+a]=d[b+a];return 0}function -x_(e,f,d){var +yz(e,f,d){var a=new Array(d+1);a[0]=0;for(var b=1,c=f+1;b<=d;b++,c++)a[b]=e[c];return a}function -d9(c,b,a){var +ei(c,b,a){var d=String.fromCharCode;if(b==0&&a<=4096&&a==c.length)return d.apply(null,c);var -e=k;for(;0=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?d9(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else -if(b.t==2&&f==b.c.length){b.c+=d.t==4?d9(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)d0(b);var +bN(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?ei(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else +if(b.t==2&&f==b.c.length){b.c+=d.t==4?ei(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)d9(b);var g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var a=0;a=0;a--)h[f+a]=g[e+a];else{var i=Math.min(c,g.length-e);for(var a=0;a>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function -bN(a){if(a.t==2)a.c+=ch(a.l-a.c.length,"\0");else -a.c=d9(a.c,0,a.c.length);a.t=0}function -iY(a,b){if(a===b)return 1;a.t&6&&bN(a);b.t&6&&bN(b);return a.c==b.c?1:0}function -yQ(b,a){throw[0,b,a]}function -jf(a){if(a.length<24){for(var -b=0;bcJ)return false;return true}else +bQ(a){if(a.t==2)a.c+=cq(a.l-a.c.length,"\0");else +a.c=ei(a.c,0,a.c.length);a.t=0}function +jf(a,b){if(a===b)return 1;a.t&6&&bQ(a);b.t&6&&bQ(b);return a.c==b.c?1:0}function +zd(b,a){throw[0,b,a]}function +jx(a){if(a.length<24){for(var +b=0;bcP)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -fF(e){for(var -j=k,c=k,g,f,h,a,b=0,i=e.length;beY){c.substr(0,1);j+=c;c=k;j+=e.slice(b,d)}else -c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else -if(a>a8)c+=String.fromCharCode(0xd7c0+(a>>10),hj+(a&0x3FF));else -c+=String.fromCharCode(a);if(c.length>cK){c.substr(0,1);j+=c;c=k}}return j+c}function -bp(c,a,b){this.t=c;this.c=a;this.l=b}bp.prototype.toString=function(){switch(this.t){case -9:return this.c;default:bN(this);case -0:if(jf(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};bp.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return fF(a)};bp.prototype.slice=function(){var +fV(e){for(var +j=k,c=k,g,f,h,a,b=0,i=e.length;bfc){c.substr(0,1);j+=c;c=k;j+=e.slice(b,d)}else +c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else +if(a>a9)c+=String.fromCharCode(0xd7c0+(a>>10),hz+(a&0x3FF));else +c+=String.fromCharCode(a);if(c.length>cQ){c.substr(0,1);j+=c;c=k}}return j+c}function +bs(c,a,b){this.t=c;this.c=a;this.l=b}bs.prototype.toString=function(){switch(this.t){case +9:return this.c;default:bQ(this);case +0:if(jx(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};bs.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return fV(a)};bs.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -bp(this.t,a,this.l)};function -iZ(a){return new -bp(0,a,a.length)}function -a(a){return iZ(a)}function -fC(c,b){yQ(c,a(b))}var -T=[0];function -U(a){fC(T.Invalid_argument,a)}function -iW(){U(fk)}function -cZ(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +bs(this.t,a,this.l)};function +jg(a){return new +bs(0,a,a.length)}function +a(a){return jg(a)}function +fS(c,b){zd(c,a(b))}var +U=[0];function +V(a){fS(U.Invalid_argument,a)}function +jd(){V(fA)}function +c5(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -bM(b,a){if(a>>>0>=b.l)iW();return cZ(b,a)}function -R(a,c,b){b&=aG;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}d0(a)}a.c[c]=b;return 0}function -aS(b,a,c){if(a>>>0>=b.l)iW();return R(b,a,c)}function -br(c,a){if(c.fun)return br(c.fun,a);if(typeof +bP(b,a){if(a>>>0>=b.l)jd();return c5(b,a)}function +S(a,c,b){b&=aJ;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}d9(a)}a.c[c]=b;return 0}function +aV(b,a,c){if(a>>>0>=b.l)jd();return S(b,a,c)}function +bu(c,a){if(c.fun)return bu(c.fun,a);if(typeof c!=="function")return c;var b=c.length|0;if(b===0)return c.apply(null,a);var e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else -if(d<0)return br(c.apply(null,a.slice(0,b)),a.slice(b));else +if(d<0)return bu(c.apply(null,a.slice(0,b)),a.slice(b));else return function(){var e=arguments.length==0?1:arguments.length,d=new Array(a.length+e);for(var b=0;b>>0>=a.length-1)cY();return a}function -yd(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -aX(a){if((a.t&6)!=0)bN(a);return a.c}var -y7=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -y5(a){if(y7)return Math.floor(Math.log2(a));var +b=0;b>>0>=a.length-1)c4();return a}function +yE(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +aZ(a){if((a.t&6)!=0)bQ(a);return a.c}var +zu=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +zs(a){if(zu)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -fs(c){var +fI(c){var a=new(q.Float32Array)(1);a[0]=c;var b=new(q.Int32Array)(a.buffer);return b[0]|0}var -i8=Math.pow(2,-24);function -d8(a){throw a}function -cf(){d8(T.Division_by_zero)}function -m(b,c,a){this.lo=b&bl;this.mi=c&bl;this.hi=a&a8}m.prototype.caml_custom="_j";m.prototype.copy=function(){return new +jp=Math.pow(2,-24);function +eh(a){throw a}function +co(){eh(U.Division_by_zero)}function +m(b,c,a){this.lo=b&bo;this.mi=c&bo;this.hi=a&a9}m.prototype.caml_custom="_j";m.prototype.copy=function(){return new m(this.lo,this.mi,this.hi)};m.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new @@ -96,7 +96,7 @@ b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new m(b,c,d)};m.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new m(b,c,d)};m.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*i8|0)+this.mi*a.lo+this.lo*a.mi,d=(c*i8|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +b=this.lo*a.lo,c=(b*jp|0)+this.mi*a.lo+this.lo*a.mi,d=(c*jp|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new m(b,c,d)};m.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};m.prototype.isNeg=function(){return this.hi<<16<0};m.prototype.and=function(a){return new m(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};m.prototype.or=function(a){return new m(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};m.prototype.xor=function(a){return new @@ -110,27 +110,27 @@ m(this.hi>>a-48,0,0)};m.prototype.shift_right=function(a){a=a&63;if(a==0)return c=this.hi<<16>>16;if(a<24)return new m(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -m(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&a8);return new -m(this.hi<<16>>a-32,b,b)};m.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bl;this.lo=this.lo<<1&bl};m.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bl;this.mi=(this.mi>>>1|this.hi<<23)&bl;this.hi=this.hi>>>1};m.prototype.udivmod=function(e){var +m(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&a9);return new +m(this.hi<<16>>a-32,b,b)};m.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bo;this.lo=this.lo<<1&bo};m.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bo;this.mi=(this.mi>>>1|this.hi<<23)&bo;this.hi=this.hi>>>1};m.prototype.udivmod=function(e){var c=0,b=this.copy(),a=e.copy(),d=new m(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};m.prototype.div=function(a){var -b=this;if(a.isZero())cf();var -d=b.hi^a.hi;if(b.hi&a4)b=b.neg();if(a.hi&a4)a=a.neg();var -c=b.udivmod(a).quotient;if(d&a4)c=c.neg();return c};m.prototype.mod=function(b){var -a=this;if(b.isZero())cf();var -d=a.hi;if(a.hi&a4)a=a.neg();if(b.hi&a4)b=b.neg();var -c=a.udivmod(b).modulus;if(d&a4)c=c.neg();return c};m.prototype.toInt=function(){return this.lo|this.mi<<24};m.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};m.prototype.toArray=function(){return[this.hi>>8,this.hi&aG,this.mi>>16,this.mi>>8&aG,this.mi&aG,this.lo>>16,this.lo>>8&aG,this.lo&aG]};m.prototype.lo32=function(){return this.lo|(this.mi&aG)<<24};m.prototype.hi32=function(){return this.mi>>>8&a8|this.hi<<16};function -c1(b,c,a){return new +b=this;if(a.isZero())co();var +d=b.hi^a.hi;if(b.hi&a5)b=b.neg();if(a.hi&a5)a=a.neg();var +c=b.udivmod(a).quotient;if(d&a5)c=c.neg();return c};m.prototype.mod=function(b){var +a=this;if(b.isZero())co();var +d=a.hi;if(a.hi&a5)a=a.neg();if(b.hi&a5)b=b.neg();var +c=a.udivmod(b).modulus;if(d&a5)c=c.neg();return c};m.prototype.toInt=function(){return this.lo|this.mi<<24};m.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};m.prototype.toArray=function(){return[this.hi>>8,this.hi&aJ,this.mi>>16,this.mi>>8&aJ,this.mi&aJ,this.lo>>16,this.lo>>8&aJ,this.lo&aJ]};m.prototype.lo32=function(){return this.lo|(this.mi&aJ)<<24};m.prototype.hi32=function(){return this.mi>>>8&a9|this.hi<<16};function +bR(b,c,a){return new m(b,c,a)}function -d3(a){if(!isFinite(a)){if(isNaN(a))return c1(1,0,he);return a>0?c1(0,0,he):c1(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?a4:a>=0?0:a4;if(f)a=-a;var -b=y5(a)+a7;if(b<=0){b=0;a/=Math.pow(2,-h2)}else{a/=Math.pow(2,b-iJ);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +ea(a){if(!isFinite(a)){if(isNaN(a))return bR(1,0,hu);return a>0?bR(0,0,hu):bR(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?a5:a>=0?0:a5;if(f)a=-a;var +b=zs(a)+a8;if(b<=0){b=0;a/=Math.pow(2,-ih)}else{a/=Math.pow(2,b-i2);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&fb|f|b<<4;return c1(g,e,c)}function -c3(a){return a.toArray()}function -iV(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==dV)for(var -a=0;a>4;if(c==2047)return(f|g|b&fb)==0?b&a4?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),a=(f*e+g)*e+(b&fb);if(c>0){a+=16;a*=Math.pow(2,c-iJ)}else -a*=Math.pow(2,-h2);if(b&a4)a=-a;return a}function -fn(b){var +cn(d){var +f=d.lo,g=d.mi,b=d.hi,c=(b&0x7fff)>>4;if(c==2047)return(f|g|b&fr)==0?b&a5?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),a=(f*e+g)*e+(b&fr);if(c>0){a+=16;a*=Math.pow(2,c-i2)}else +a*=Math.pow(2,-ih);if(b&a5)a=-a;return a}function +fD(b){var d=b.length,c=1;for(var -a=0;a>>24&aG|(a&a8)<<8,a>>>16&a8)}function -fv(a){return a.hi32()}function -fw(a){return a.lo32()}var -ya=dV;function -bJ(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}bJ.prototype.caml_custom=ya;bJ.prototype.offset=function(b){var +a=0;a>>24&aJ|(a&a9)<<8,a>>>16&a9)}function +fK(a){return a.hi32()}function +fL(a){return a.lo32()}var +yB=d4;function +bM(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}bM.prototype.caml_custom=yB;bM.prototype.offset=function(b){var c=0;if(typeof b==="number")b=[b];if(!(b instanceof -Array))U("bigarray.js: invalid offset");if(this.dims.length!=b.length)U("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -a=0;a=this.dims[a])cY();c=c*this.dims[a]+b[a]}else +Array))V("bigarray.js: invalid offset");if(this.dims.length!=b.length)V("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +a=0;a=this.dims[a])c4();c=c*this.dims[a]+b[a]}else for(var -a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])cY();c=c*this.dims[a]+(b[a]-1)}return c};bJ.prototype.get=function(a){switch(this.kind){case +a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])c4();c=c*this.dims[a]+(b[a]-1)}return c};bM.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return i7(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return jo(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[cR,e,c];default:return this.data[a]}};bJ.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=fw(b);this.data[a*2+1]=fv(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[cX,e,c];default:return this.data[a]}};bM.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=fL(b);this.data[a*2+1]=fK(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bJ.prototype.fill=function(b){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bM.prototype.fill=function(b){switch(this.kind){case 7:var -c=fw(b),e=fv(b);if(c==e)this.data.fill(c);else +c=fL(b),e=fK(b);if(c==e)this.data.fill(c);else for(var a=0;ab.data[a])return 1}break}return 0};function -cb(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cb.prototype=new -bJ();cb.prototype.offset=function(a){if(typeof +ck(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}ck.prototype=new +bM();ck.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -U("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])cY();return a};cb.prototype.get=function(a){return this.data[a]};cb.prototype.set=function(a,b){this.data[a]=b;return 0};cb.prototype.fill=function(a){this.data.fill(a);return 0};function -iR(c,d,a,b){var -e=iT(c);if(fn(a)*e!=b.length)U("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new -cb(c,d,a,b);return new -bJ(c,d,a,b)}function -bT(a){fC(T.Failure,a)}function -iS(b,v,r){var -i=b.read32s();if(i<0||i>16)bT("input_value: wrong number of bigarray dimensions");var -p=b.read32s(),j=p&aG,o=p>>8&1,h=[];if(r==dV)for(var +V("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])c4();return a};ck.prototype.get=function(a){return this.data[a]};ck.prototype.set=function(a,b){this.data[a]=b;return 0};ck.prototype.fill=function(a){this.data.fill(a);return 0};function +i_(c,d,a,b){var +e=ja(c);if(fD(a)*e!=b.length)V("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new +ck(c,d,a,b);return new +bM(c,d,a,b)}function +bY(a){fS(U.Failure,a)}function +i$(b,v,r){var +i=b.read32s();if(i<0||i>16)bY("input_value: wrong number of bigarray dimensions");var +p=b.read32s(),j=p&aJ,o=p>>8&1,h=[];if(r==d4)for(var a=0;a>>32-15;a=ba(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function -yk(a,b){a=aj(a,fw(b));a=aj(a,fv(b));return a}function -fq(a,b){return yk(a,d3(b))}function -iU(c){var -b=fn(c.dims),d=0;switch(c.kind){case +l=cn(c7(e));g.set(a,[cX,m,l])}break}v[0]=(4+i)*4;return i_(j,o,h,f)}function +i9(a,b,c){return a.compare(b,c)}function +bb(a,b){return Math.imul(a,b)}function +ak(b,a){a=bb(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=bb(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function +yL(a,b){a=ak(a,fL(b));a=ak(a,fK(b));return a}function +fG(a,b){return yL(a,ea(b))}function +jb(c){var +b=fD(c.dims),d=0;switch(c.kind){case 2:case 3:case -12:if(b>b9)b=b9;var -e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=aj(d,e)}e=0;switch(b&3){case +12:if(b>cg)b=cg;var +e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=ak(d,e)}e=0;switch(b&3){case 3:e=c.data[a+2]<<16;case 2:e|=c.data[a+1]<<8;case -1:e|=c.data[a+0];d=aj(d,e)}break;case +1:e|=c.data[a+0];d=ak(d,e)}break;case 4:case -5:if(b>ca)b=ca;var -e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=aj(d,e)}if((b&1)!=0)d=aj(d,c.data[a]);break;case +5:if(b>cj)b=cj;var +e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=ak(d,e)}if((b&1)!=0)d=ak(d,c.data[a]);break;case 6:if(b>64)b=64;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;b*=2;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;for(var -a=0;a0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function -c4(a){return a +c9(a){return a instanceof -bp}function -d5(a){return c4(a)}function -i2(a){if(typeof -a==="number")return aL;else -if(c4(a))return fg;else -if(d5(a))return 1252;else +bs}function +ed(a){return c9(a)}function +jj(a){if(typeof +a==="number")return aO;else +if(c9(a))return fw;else +if(ed(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=b6){var -b=a[0]|0;return b==cR?0:b}else +Array&&a[0]===a[0]>>>0&&a[0]<=cd){var +b=a[0]|0;return b==cX?0:b}else if(a instanceof -String)return hA;else +String)return hQ;else if(typeof -a=="string")return hA;else +a=="string")return hQ;else if(a instanceof -Number)return aL;else -if(a&&a.caml_custom)return e3;else +Number)return aO;else +if(a&&a.caml_custom)return fh;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -d4(a,b){if(ab.c?1:0}function -fD(a,b){return iX(a,b)}function -cc(a,b,d){var +ec(a,b){if(ab.c?1:0}function +fT(a,b){return je(a,b)}function +cl(a,b,d){var e=[];for(;;){if(!(d&&a===b)){var -f=i2(a);if(f==dF){a=a[1];continue}var -g=i2(b);if(g==dF){b=b[1];continue}if(f!==g){if(f==aL){if(g==e3)return i1(a,b,-1,d);return-1}if(g==aL){if(f==e3)return i1(b,a,1,d);return 1}return fb)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!d)return NaN;return 1}break;case 1252:var -a=aX(a),b=aX(b);if(a!==b){if(ab)return 1}break;case +a=aZ(a),b=aZ(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case 254:default:if(a.length!=b.length)return a.length1)e.push(a,b,1);break}}if(e.length==0)return 0;var h=e.pop();b=e.pop();a=e.pop();if(h+10)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=k;a.t=2}else{a.c=ch(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)d0(a);for(b+=c;c31)U("format_int: format too long");var -a={justify:bj,signstyle:an,filler:bf,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +jh(a,b){return cl(a,b,true)}function +T(a){if(a<0)V("Bytes.create");return new +bs(a?2:9,k,a)}function +jl(b,a){if(a==0)co();return b/a|0}function +n(a,b){return+(cl(a,b,false)==0)}function +yF(a,c,b,d){if(b>0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=k;a.t=2}else{a.c=cq(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)d9(a);for(b+=c;c31)V("format_int: format too long");var +a={justify:bm,signstyle:ao,filler:bi,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var c=0;c=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function -fp(b,f){if(b.uppercase)f=f.toUpperCase();var -e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=an))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var -c=k;if(b.justify==bj&&b.filler==bf)for(var -d=e;d=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function +fF(b,f){if(b.uppercase)f=f.toUpperCase();var +e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=ao))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var +c=k;if(b.justify==bm&&b.filler==bi)for(var +d=e;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(s);if(b>0)a=a+bn+new +c=parseInt(a.toString().split(bm)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(s);if(b>0)a=a+bq+new Array(b+1).join(s);return a}else return a.toFixed(b)}}var -a,e=fB(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=e5;e.filler=bf}else -if(!isFinite(c)){a=iB;e.filler=bf}else +a,e=fR(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=fj;e.filler=bi}else +if(!isFinite(c)){a=iU;e.filler=bi}else switch(e.conv){case"e":var -a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==dX)a=a.slice(0,b-1)+s+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var -h=a.indexOf(dX),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var -b=h-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==dX)a=a.slice(0,b-1)+s+a.slice(b-1);break}else{var +a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==d6)a=a.slice(0,b-1)+s+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var +h=a.indexOf(d6),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var +b=h-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bq)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==d6)a=a.slice(0,b-1)+s+a.slice(b-1);break}else{var f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else while(a=c.toFixed(f),a.length>d+1)f--;if(f){var -b=a.length-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)}}break}return fp(e,a)}function -d1(e,c){if(aX(e)==ii)return a(k+c);var -b=fB(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else +b=a.length-1;while(a.charAt(b)==s)b--;if(a.charAt(b)==bq)b--;a=a.slice(0,b+1)}}break}return fF(e,a)}function +d_(e,c){if(aZ(e)==iA)return a(k+c);var +b=fR(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else c>>>=0;var -d=c.toString(b.base);if(b.prec>=0){b.filler=bf;var -f=b.prec-d.length;if(f>0)d=ch(f,s)+d}return fp(b,d)}var -jc=0;function -ag(){return jc++}function -ce(a){return a.toUtf16()}if(q.process&&q.process.cwd)var -c0=q.process.cwd().replace(/\\/g,bh);else +d=c.toString(b.base);if(b.prec>=0){b.filler=bi;var +f=b.prec-d.length;if(f>0)d=cq(f,s)+d}return fF(b,d)}var +ju=0;function +ah(){return ju++}function +bZ(a){return a.toUtf16()}if(q.process&&q.process.cwd)var +c6=q.process.cwd().replace(/\\/g,bk);else var -c0="/static";if(c0.slice(-1)!==bh)c0+=bh;function -yE(a){a=ce(a);if(a.charCodeAt(0)!=47)a=c0+a;var -d=a.split(bh),b=[];for(var +c6="/static";if(c6.slice(-1)!==bk)c6+=bk;function +y3(a){a=bZ(a);if(a.charCodeAt(0)!=47)a=c6+a;var +d=a.split(bk),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":if(b.length==0)b.push(k);break;default:b.push(d[c]);break}b.orig=a;return b}function -yb(a){return new -bp(4,a,a.length)}function -yZ(e){for(var -f=k,b=f,a,h,c=0,g=e.length;ceY){b.substr(0,1);f+=b;b=k;f+=e.slice(c,d)}else -b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(aM|a&b7)}else -if(a<0xd800||a>=hs)b+=String.fromCharCode(ht|a>>12,aM|a>>6&b7,aM|a&b7);else -if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))hs)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(iu|a>>18,aM|a>>12&b7,aM|a>>6&b7,aM|a&b7)}if(b.length>cK){b.substr(0,1);f+=b;b=k}}return f+b}function -yc(a){var -b=9;if(!jf(a))b=8,a=yZ(a);return new -bp(b,a,a.length)}function -aY(a){return yc(a)}function -L(a){fC(T.Sys_error,a)}function -yO(a){a=aX(a);L(a+": No such file or directory")}function -aH(a){return a.l}function -iP(){}function -ai(a){this.data=a}ai.prototype=new -iP();ai.prototype.truncate=function(a){var -b=this.data;this.data=S(a|0);bK(b,0,this.data,0,a)};ai.prototype.length=function(){return aH(this.data)};ai.prototype.write=function(b,d,g,a){var +yC(a){return new +bs(4,a,a.length)}function +zm(e){for(var +f=k,b=f,a,h,c=0,g=e.length;cfc){b.substr(0,1);f+=b;b=k;f+=e.slice(c,d)}else +b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(aP|a&ce)}else +if(a<0xd800||a>=hI)b+=String.fromCharCode(hJ|a>>12,aP|a>>6&ce,aP|a&ce);else +if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))hI)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(iN|a>>18,aP|a>>12&ce,aP|a>>6&ce,aP|a&ce)}if(b.length>cQ){b.substr(0,1);f+=b;b=k}}return f+b}function +yD(a){var +b=9;if(!jx(a))b=8,a=zm(a);return new +bs(b,a,a.length)}function +a0(a){return yD(a)}function +L(a){fS(U.Sys_error,a)}function +zb(a){a=aZ(a);L(a+": No such file or directory")}function +aK(a){return a.l}function +i8(){}function +aj(a){this.data=a}aj.prototype=new +i8();aj.prototype.truncate=function(a){var +b=this.data;this.data=T(a|0);bN(b,0,this.data,0,a)};aj.prototype.length=function(){return aK(this.data)};aj.prototype.write=function(b,d,g,a){var c=this.length();if(b+a>=c){var -e=S(b+a),f=this.data;this.data=e;bK(f,0,this.data,0,c)}bL(d,g,this.data,b,a);return 0};ai.prototype.read=function(c,a,d,b){var -e=this.length();bK(this.data,c,a,d,b);return 0};ai.prototype.read_one=function(a){return bM(this.data,a)};ai.prototype.close=function(){};ai.prototype.constructor=ai;function -aR(b,a){this.content={};this.root=b;this.lookupFun=a}aR.prototype.nm=function(a){return this.root+a};aR.prototype.lookup=function(b){if(!this.content[b]&&this.lookupFun){var +e=T(b+a),f=this.data;this.data=e;bN(f,0,this.data,0,c)}bO(d,g,this.data,b,a);return 0};aj.prototype.read=function(c,a,d,b){var +e=this.length();bN(this.data,c,a,d,b);return 0};aj.prototype.read_one=function(a){return bP(this.data,a)};aj.prototype.close=function(){};aj.prototype.constructor=aj;function +aU(b,a){this.content={};this.root=b;this.lookupFun=a}aU.prototype.nm=function(a){return this.root+a};aU.prototype.lookup=function(b){if(!this.content[b]&&this.lookupFun){var c=this.lookupFun(a(this.root),a(b));if(c!==0)this.content[b]=new -ai(bq(c[1]))}};aR.prototype.exists=function(a){if(a==k)return 1;var -c=a+bh,d=new -RegExp(e7+c);for(var +aj(bt(c[1]))}};aU.prototype.exists=function(a){if(a==k)return 1;var +c=a+bk,d=new +RegExp(fl+c);for(var b in -this.content)if(b.match(d))return 1;this.lookup(a);return this.content[a]?1:0};aR.prototype.readdir=function(c){var -f=c==k?k:c+bh,g=new -RegExp(e7+f+iG),d={},b=[];for(var +this.content)if(b.match(d))return 1;this.lookup(a);return this.content[a]?1:0};aU.prototype.readdir=function(c){var +f=c==k?k:c+bk,g=new +RegExp(fl+f+iZ),d={},b=[];for(var e in this.content){var -a=e.match(g);if(a&&!d[a[1]]){d[a[1]]=true;b.push(a[1])}}return b};aR.prototype.is_dir=function(a){var -d=a==k?k:a+bh,e=new -RegExp(e7+d+iG),f=[];for(var +a=e.match(g);if(a&&!d[a[1]]){d[a[1]]=true;b.push(a[1])}}return b};aU.prototype.is_dir=function(a){var +d=a==k?k:a+bk,e=new +RegExp(fl+d+iZ),f=[];for(var c in this.content){var -b=c.match(e);if(b)return 1}return 0};aR.prototype.unlink=function(a){var +b=c.match(e);if(b)return 1}return 0};aU.prototype.unlink=function(a){var b=this.content[a]?true:false;delete -this.content[a];return b};aR.prototype.open=function(a,b){if(b.rdonly&&b.wronly)L(this.nm(a)+hI);if(b.text&&b.binary)L(this.nm(a)+ic);this.lookup(a);if(this.content[a]){if(this.is_dir(a))L(this.nm(a)+" : is a directory");if(b.create&&b.excl)L(this.nm(a)+hF);var +this.content[a];return b};aU.prototype.open=function(a,b){if(b.rdonly&&b.wronly)L(this.nm(a)+hY);if(b.text&&b.binary)L(this.nm(a)+iv);this.lookup(a);if(this.content[a]){if(this.is_dir(a))L(this.nm(a)+" : is a directory");if(b.create&&b.excl)L(this.nm(a)+hV);var c=this.content[a];if(b.truncate)c.truncate();return c}else if(b.create){this.content[a]=new -ai(S(0));return this.content[a]}else -yO(this.nm(a))};aR.prototype.register=function(b,a){if(this.content[b])L(this.nm(b)+hF);if(c4(a))this.content[b]=new -ai(a);if(d5(a))this.content[b]=new -ai(bq(a));else +aj(T(0));return this.content[a]}else +zb(this.nm(a))};aU.prototype.register=function(b,a){if(this.content[b])L(this.nm(b)+hV);if(c9(a))this.content[b]=new +aj(a);if(ed(a))this.content[b]=new +aj(bt(a));else if(a instanceof Array)this.content[b]=new -ai(yb(a));else +aj(yC(a));else if(typeof a==="string")this.content[b]=new -ai(iZ(a));else +aj(jg(a));else if(a.toString){var -c=bq(aY(a.toString()));this.content[b]=new -ai(c)}else -L(this.nm(b)+" : registering file with invalid content type")};aR.prototype.constructor=aR;function -u(a){return aH(a)}function -ci(b,a){return cZ(b,a)}function -x9(d){var +c=bt(a0(a.toString()));this.content[b]=new +aj(c)}else +L(this.nm(b)+" : registering file with invalid content type")};aU.prototype.constructor=aU;function +u(a){return aK(a)}function +cr(b,a){return c5(b,a)}function +yy(d){var c=u(d),b=new -Array(c),a=0;for(;a>1|1;if(h=0)}function -fr(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=aj(d,c)}c=0;switch(e&3){case +a=c}ef[d]=a+1;return h==b[a+1]?b[a]:0}function +jn(a,b){return+(cl(a,b,false)>=0)}function +fH(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=ak(d,c)}c=0;switch(e&3){case 3:c=b.charCodeAt(a+2)<<16;case 2:c|=b.charCodeAt(a+1)<<8;case -1:c|=b.charCodeAt(a);d=aj(d,c)}d^=e;return d}function -yl(a,b){return fr(a,aX(b))}function -yi(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=aj(d,c)}c=0;switch(e&3){case +1:c|=b.charCodeAt(a);d=ak(d,c)}d^=e;return d}function +yM(a,b){return fH(a,aZ(b))}function +yJ(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=ak(d,c)}c=0;switch(e&3){case 3:c=b[a+2]<<16;case 2:c|=b[a+1]<<8;case -1:c|=b[a];d=aj(d,c)}d^=e;return d}function -yh(a,b){switch(b.t&6){default:bN(b);case -0:a=fr(a,b.c);break;case -2:a=yi(a,b.c)}return a}function -yj(a){a^=a>>>16;a=ba(a,0x85ebca6b|0);a^=a>>>13;a=ba(a,0xc2b2ae35|0);a^=a>>>16;return a}function -yg(j,l,n,m){var -f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>b9)d=b9;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cd[a.caml_custom]&&cd[a.caml_custom].hash){var -k=cd[a.caml_custom].hash(a);b=aj(b,k);c--}}else +1:c|=b[a];d=ak(d,c)}d^=e;return d}function +yI(a,b){switch(b.t&6){default:bQ(b);case +0:a=fH(a,b.c);break;case +2:a=yJ(a,b.c)}return a}function +yK(a){a^=a>>>16;a=bb(a,0x85ebca6b|0);a^=a>>>13;a=bb(a,0xc2b2ae35|0);a^=a>>>16;return a}function +yH(j,l,n,m){var +f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cg)d=cg;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cm[a.caml_custom]&&cm[a.caml_custom].hash){var +k=cm[a.caml_custom].hash(a);b=ak(b,k);c--}}else if(a instanceof Array&&a[0]===(a[0]|0))switch(a[0]){case -248:b=aj(b,a[2]);c--;break;case +248:b=ak(b,a[2]);c--;break;case 250:f[--g]=a[1];break;default:var -o=a.length-1<<10|a[0];b=aj(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else -if(c4(a)){b=yh(b,a);c--}else -if(d5(a)){b=yl(b,a);c--}else +o=a.length-1<<10|a[0];b=ak(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else +if(c9(a)){b=yI(b,a);c--}else +if(ed(a)){b=yM(b,a);c--}else if(typeof -a==="string"){b=fr(b,a);c--}else -if(a===(a|0)){b=aj(b,a+a+1);c--}else -if(a===+a){b=fq(b,a);c--}}b=yj(b);return b&0x3FFFFFFF}function -ym(a,c,l){if(!isFinite(a)){if(isNaN(a))return aY(e5);return aY(a>0?iy:"-infinity")}var +a==="string"){b=fH(b,a);c--}else +if(a===(a|0)){b=ak(b,a+a+1);c--}else +if(a===+a){b=fG(b,a);c--}}b=yK(b);return b&0x3FFFFFFF}function +yN(a,c,l){if(!isFinite(a)){if(isNaN(a))return a0(fj);return a0(a>0?iR:"-infinity")}var i=a==0&&1/a==-Infinity?1:a>=0?0:1;if(i)a=-a;var d=0;if(a==0);else if(a<1)while(a<1&&d>-1022){a*=2;d--}else while(a>=2){a/=2;d++}var -j=d<0?k:bj,e=k;if(i)e=an;else +j=d<0?k:bm,e=k;if(i)e=ao;else switch(l){case -43:e=bj;break;case -32:e=bf;break;default:break}if(c>=0&&c<13){var +43:e=bm;break;case +32:e=bi;break;default:break}if(c>=0&&c<13){var g=Math.pow(2,c*4);a=Math.round(a*g)/g}var b=a.toString(16);if(c>=0){var -h=b.indexOf(bn);if(h<0)b+=bn+ch(c,s);else{var -f=h+1+c;if(b.length>24&bl,a>>31&a8)}function -yx(a){return a.toInt()}function -yr(a){return+a.isNeg()}function -yu(a){return a.neg()}function -yp(g,c){var -a=fB(g);if(a.signedconv&&yr(c)){a.sign=-1;c=yu(c)}var -b=k,h=yv(a.base),f="0123456789abcdef";do{var -e=c.udivmod(h);c=e.quotient;b=f.charAt(yx(e.modulus))+b}while(!ys(c));if(a.prec>=0){a.filler=bf;var -d=a.prec-b.length;if(d>0)b=ch(d,s)+b}return fp(a,b)}function -yw(a,b){return a.or(b)}function -i9(a){return a.toFloat()}function -yz(){return typeof +h=b.indexOf(bq);if(h<0)b+=bq+cq(c,s);else{var +f=h+1+c;if(b.length>24&bo,a>>31&a9)}function +yY(a){return a.toInt()}function +yS(a){return+a.isNeg()}function +yV(a){return a.neg()}function +yQ(g,c){var +a=fR(g);if(a.signedconv&&yS(c)){a.sign=-1;c=yV(c)}var +b=k,h=yW(a.base),f="0123456789abcdef";do{var +e=c.udivmod(h);c=e.quotient;b=f.charAt(yY(e.modulus))+b}while(!yT(c));if(a.prec>=0){a.filler=bi;var +d=a.prec-b.length;if(d>0)b=cq(d,s)+b}return fF(a,b)}function +yX(a,b){return a.or(b)}function +eb(a){return a.toFloat()}function +y0(){return typeof module!=="undefined"&&module&&module.exports?module.exports:q}function -fx(a){return a.slice(1)}function -yA(c){var +fM(a){return a.slice(1)}function +y1(c){var d=c.length,b=new Array(d+1);b[0]=0;for(var a=0;a0){var c=new Array(b);for(var -a=0;aa7){a-=a7;b*=Math.pow(2,a7);if(a>a7){a-=a7;b*=Math.pow(2,a7)}}if(a<-a7){a+=a7;b*=Math.pow(2,-a7)}b*=Math.pow(2,a);return b}function -yD(a,b){return+(cc(a,b,false)<=0)}function -fz(a,b){return+(cc(a,b,false)<0)}function -bs(a,d){if(a<0)cY();var +a=0;aa8){a-=a8;b*=Math.pow(2,a8);if(a>a8){a-=a8;b*=Math.pow(2,a8)}}if(a<-a8){a+=a8;b*=Math.pow(2,-a8)}b*=Math.pow(2,a);return b}function +y2(a,b){return+(cl(a,b,false)<=0)}function +fP(a,b){return+(cl(a,b,false)<0)}function +bv(a,d){if(a<0)c4();var a=a+1|0,b=new Array(a);b[0]=0;for(var c=1;c>>32-b,c)}function g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function @@ -669,14 +669,14 @@ h(d,b,e,c,h,f,g){return a(b&c|e&~c,d,b,h,f,g)}function i(c,b,d,e,h,f,g){return a(b^d^e,c,b,h,f,g)}function j(c,b,d,e,h,f,g){return a(d^(b|~e),c,b,h,f,g)}function k(f,n){var -e=n;f[e>>2]|=aM<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var +e=n;f[e>>2]|=aP<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var k=[0x67452301,0xEFCDAB89,0x98BADCFE,0x10325476];for(e=0;e>8*m&0xFF;return o}return function(h,g,f){var -e=[];switch(h.t&6){default:bN(h);case +e=[];switch(h.t&6){default:bQ(h);case 0:var d=h.c;for(var a=0;a>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charC 4:var c=h.c;for(var a=0;a>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return yU(k(e,f))}}();function -yG(c,b,a){return yF(bq(c),b,a)}var -a$=new +b=a+g;e[a>>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return zh(k(e,f))}}();function +y5(c,b,a){return y4(bt(c),b,a)}var +ba=new Array();function -fA(c){var -a=a$[c];if(!a.opened)L("Cannot flush a closed channel");if(!a.buffer||a.buffer==k)return 0;if(a.fd&&T.fds[a.fd]&&T.fds[a.fd].output){var -b=T.fds[a.fd].output;switch(b.length){case +fQ(c){var +a=ba[c];if(!a.opened)L("Cannot flush a closed channel");if(!a.buffer||a.buffer==k)return 0;if(a.fd&&U.fds[a.fd]&&U.fds[a.fd].output){var +b=U.fds[a.fd].output;switch(b.length){case 2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=k;return 0}function -je(e,f){var -b=a$[e],d=a(f),c=u(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function -y3(a){var -a=fF(a),b=q;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +jw(e,f){var +b=ba[e],d=a(f),c=u(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function +zq(a){var +a=fV(a),b=q;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.error&&c.error(a)}}function -y4(a){var -a=fF(a),b=q;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +zr(a){var +a=fV(a),b=q;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.log&&c.log(a)}}function -d$(c,e,d,a){if(T.fds===undefined)T.fds=new +ek(c,e,d,a){if(U.fds===undefined)U.fds=new Array();a=a?a:{};var -b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;T.fds[c]=b;if(!T.fd_last_idx||c>T.fd_last_idx)T.fd_last_idx=c;return c}function -zi(c,b,g){var +b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;U.fds[c]=b;if(!U.fd_last_idx||c>U.fd_last_idx)U.fd_last_idx=c;return c}function +zH(c,b,g){var a={};while(b){switch(b[1]){case 0:a.rdonly=1;break;case 1:a.wronly=1;break;case @@ -713,89 +713,89 @@ a={};while(b){switch(b[1]){case 5:a.excl=1;break;case 6:a.binary=1;break;case 7:a.text=1;break;case -8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)L(aX(c)+hI);if(a.text&&a.binary)L(aX(c)+ic);var -d=jk(c),e=d.device.open(d.rest,a),f=T.fd_last_idx?T.fd_last_idx:0;return d$(f+1,je,e,a)}d$(0,je,new -ai(S(0)));d$(1,y4,new -ai(S(0)));d$(2,y3,new -ai(S(0)));function -yH(c){var -b=T.fds[c];if(b.flags.wronly)L(iK+c+" is writeonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:false,refill:null};a$[a.fd]=a;return a.fd}function -i_(c){var -b=T.fds[c];if(b.flags.rdonly)L(iK+c+" is readonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:k};a$[a.fd]=a;return a.fd}function -yI(){var +8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)L(aZ(c)+hY);if(a.text&&a.binary)L(aZ(c)+iv);var +d=jC(c),e=d.device.open(d.rest,a),f=U.fd_last_idx?U.fd_last_idx:0;return ek(f+1,jw,e,a)}ek(0,jw,new +aj(T(0)));ek(1,zr,new +aj(T(0)));ek(2,zq,new +aj(T(0)));function +y6(c){var +b=U.fds[c];if(b.flags.wronly)L(i3+c+" is writeonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:false,refill:null};ba[a.fd]=a;return a.fd}function +jq(c){var +b=U.fds[c];if(b.flags.rdonly)L(i3+c+" is readonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:k};ba[a.fd]=a;return a.fd}function +y7(){var b=0;for(var -a=0;a>>0)return a[0];else -if(c4(a))return fg;else -if(d5(a))return fg;else +if(c9(a))return fw;else +if(ed(a))return fw;else if(a instanceof Function||typeof a=="function")return 247;else -if(a&&a.caml_custom)return b6;else -return aL}function -aT(b,c,a){if(a&&q.toplevelReloc)b=q.toplevelReloc(a);T[b+1]=c;if(a)T[a]=c}var -i$={};function -yR(a,b){i$[aX(a)]=b;return 0}function -yS(a){a[2]=jc++;return a}function -fE(a,b){return iY(a,b)}function -yT(){U(fk)}function -p(b,a){if(a>>>0>=u(b))yT();return ci(b,a)}function -V(a,b){return 1-fE(a,b)}function -yV(){return[0,a("js_of_ocaml")]}function -yW(){return 0x7FFFFFFF/4|0}function -yX(){return[0,a("Unix"),32,0]}function -yP(){d8(T.Not_found)}function -d_(c){var -a=q,b=ce(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aY(a.process.env[b]);if(q.jsoo_static_env&&q.jsoo_static_env[b])return aY(q.jsoo_static_env[b]);yP()}function -yY(){var +if(a&&a.caml_custom)return cd;else +return aO}function +aW(b,c,a){if(a&&q.toplevelReloc)b=q.toplevelReloc(a);U[b+1]=c;if(a)U[a]=c}var +jr={};function +ze(a,b){jr[aZ(a)]=b;return 0}function +zf(a){a[2]=ju++;return a}function +fU(a,b){return jf(a,b)}function +zg(){V(fA)}function +p(b,a){if(a>>>0>=u(b))zg();return cr(b,a)}function +W(a,b){return 1-fU(a,b)}function +zi(){return[0,a("js_of_ocaml")]}function +zj(){return 0x7FFFFFFF/4|0}function +zk(){return[0,a("Unix"),32,0]}function +zc(){eh(U.Not_found)}function +ej(c){var +a=q,b=bZ(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return a0(a.process.env[b]);if(q.jsoo_static_env&&q.jsoo_static_env[b])return a0(q.jsoo_static_env[b]);zc()}function +zl(){var a=new -Date().getTime(),b=a^iA*Math.random();return[0,b]}function -c5(a){var +Date().getTime(),b=a^iT*Math.random();return[0,b]}function +c_(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function -ad(b,a){return{joo_tramp:b,joo_args:a}}function -jd(a){return a}function -d7(a){return i$[a]}function -e(a){if(a +ae(b,a){return{joo_tramp:b,joo_args:a}}function +jv(a){return a}function +eg(a){return jr[a]}function +d(a){if(a instanceof Array)return a;if(q.RangeError&&a instanceof -q.RangeError&&a.message&&a.message.match(/maximum call stack/i))return jd(T.Stack_overflow);if(q.InternalError&&a +q.RangeError&&a.message&&a.message.match(/maximum call stack/i))return jv(U.Stack_overflow);if(q.InternalError&&a instanceof -q.InternalError&&a.message&&a.message.match(/too much recursion/i))return jd(T.Stack_overflow);if(a +q.InternalError&&a.message&&a.message.match(/too much recursion/i))return jv(U.Stack_overflow);if(a instanceof -q.Error&&d7(e2))return[0,d7(e2),a];return[0,T.Failure,aY(String(a))]}var +q.Error&&eg(fg))return[0,eg(fg),a];return[0,U.Failure,a0(String(a))]}var l=function(B){"use strict";var -f=bR,ab=7,v=9007199254740992,J=r(v),O="0123456789abcdefghijklmnopqrstuvwxyz",g=q.BigInt,H=typeof +f=bW,ab=7,v=9007199254740992,J=r(v),O="0123456789abcdefghijklmnopqrstuvwxyz",g=q.BigInt,H=typeof g==="function";function d(a,b,c,f){if(typeof a==="undefined")return d[0];if(typeof b!=="undefined")return+b===10&&!c?e(a):af(a,b,c,f);return e(a)}function -a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=dC}a.prototype=Object.create(d.prototype);function -b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=dC}b.prototype=Object.create(d.prototype);function -c(a){this.value=a;this.caml_custom=dC}c.prototype=Object.create(d.prototype);function +a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=dL}a.prototype=Object.create(d.prototype);function +b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=dL}b.prototype=Object.create(d.prototype);function +c(a){this.value=a;this.caml_custom=dL}c.prototype=Object.create(d.prototype);function p(a){return-v0)a.push(0);return a.concat(c)}function E(b,c){var a=Math.max(b.length,c.length);if(a<=30)return N(b,c);a=Math.ceil(a/2);var f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=E(d,h),g=E(f,i),k=E(w(d,f),w(h,i)),j=w(w(e,Y(z(z(k,e),g),a)),Y(g,2*a));t(j);return j}function -ak(a,b){return-(im*a)-im*b+0.000015*a*b>0}a.prototype.multiply=function(j){var +ak(a,b){return-(iE*a)-iE*b+0.000015*a*b>0}a.prototype.multiply=function(j){var h=e(j),c=this.value,b=h.value,i=this.sign!==h.sign,g;if(h.isSmall){if(b===0)return d[0];if(b===1)return this;if(b===-1)return this.negate();g=Math.abs(b);if(g=y){b=b.multiply(j);a-=y-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var a,b=e(d).toJSNumber();if(!Z(b))throw new -Error(String(b)+h0);if(b<0)return this.shiftLeft(-b);var +Error(String(b)+ie);if(b<0)return this.shiftLeft(-b);var c=this;while(b>=y){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=y-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function K(h,a,r){a=e(a);var n=h.isNegative(),q=a.isNegative(),m=n?h.not():h,p=q?a.not():a,b=0,c=0,k=null,o=null,f=[];while(!m.isZero()||!p.isZero()){k=i(m,j);b=k[1].toJSNumber();if(n)b=j-1-b;o=i(p,j);c=o[1].toJSNumber();if(q)c=j-1-c;m=k[0];p=o[0];f.push(r(b,c))}var @@ -990,22 +990,22 @@ c=0;c=i){if(c===az&&i===1)continue;throw new -Error(c+" is not a valid digit in base "+g+bn)}}g=e(g);var -h=[],j=b[0]===an;for(a=j?1:0;a=i){if(c===aD&&i===1)continue;throw new +Error(c+" is not a valid digit in base "+g+bq)}}g=e(g);var +h=[],j=b[0]===ao;for(a=j?1:0;a=0;a--){b=b.add(e[a].times(c));c=c.times(f)}return g?b.negate():b}function -ai(b,a){a=a||O;if(b=0){e=c.divmod(b);c=e.quotient;var d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function $(d,c,b){var -a=A(d,c);return(a.isNegative?an:k)+a.value.map(function(a){return ai(a,b)}).join(k)}a.prototype.toArray=function(a){return A(this,a)};b.prototype.toArray=function(a){return A(this,a)};c.prototype.toArray=function(a){return A(this,a)};a.prototype.toString=function(a,f){if(a===B)a=10;if(a!==10)return $(this,a,f);var +a=A(d,c);return(a.isNegative?ao:k)+a.value.map(function(a){return ai(a,b)}).join(k)}a.prototype.toArray=function(a){return A(this,a)};b.prototype.toArray=function(a){return A(this,a)};c.prototype.toArray=function(a){return A(this,a)};a.prototype.toString=function(a,f){if(a===B)a=10;if(a!==10)return $(this,a,f);var d=this.value,c=d.length,e=String(d[--c]),h="0000000",b;while(--c>=0){b=String(d[c]);e+=h.slice(b.length)+b}var -g=this.sign?an:k;return g+e};b.prototype.toString=function(a,b){if(a===B)a=10;if(a!=10)return $(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function +g=this.sign?ao:k;return g+e};b.prototype.toString=function(a,b){if(a===B)a=10;if(a!=10)return $(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function X(d){if(p(+d)){var l=+d;if(l===u(l))return H?new c(g(l)):new b(l);throw new -Error(dM+d)}var -o=d[0]===an;if(o)d=d.slice(1);var +Error(dV+d)}var +o=d[0]===ao;if(o)d=d.slice(1);var h=d.split(/e/i);if(h.length>2)throw new -Error(dM+h.join(dX));if(h.length===2){var -e=h[1];if(e[0]===bj)e=e.slice(1);e=+e;if(e!==u(e)||!p(e))throw new -Error(dM+e+" is not a valid exponent.");var -f=h[0],i=f.indexOf(bn);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new +Error(dV+h.join(d6));if(h.length===2){var +e=h[1];if(e[0]===bm)e=e.slice(1);e=+e;if(e!==u(e)||!p(e))throw new +Error(dV+e+" is not a valid exponent.");var +f=h[0],i=f.indexOf(bq);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new Error("Cannot include negative exponent part for integers");f+=new Array(e+1).join(s);d=f}var q=/^([0-9][0-9]*)$/.test(d);if(!q)throw new -Error(dM+d);if(H)return new -c(g(o?an+d:d));var +Error(dV+d);if(H)return new +c(g(o?ao+d:d));var n=[],j=d.length,m=ab,k=j-m;while(j>0){n.push(+d.slice(k,j));k-=m;if(k<0)k=0;j-=m}t(n);return new a(n,o)}function ag(a){if(H)return new @@ -1043,119 +1043,123 @@ a==="number")return ag(a);if(typeof a==="string")return X(a);if(typeof a==="bigint")return new c(a);return a}for(var -m=0;m0)d[-m]=e(-m)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=U;d.min=M;d.gcd=R;d.lcm=ae;d.isInstance=function(d){return d +m=0;m0)d[-m]=e(-m)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=U;d.min=M;d.gcd=R;d.lcm=ae;d.isInstance=function(d){return d instanceof a||d instanceof b||d instanceof c};d.randBetween=ah;d.fromArray=function(b,a,c){return W(b.map(e),e(a||10),c)};return d}();function -aU(a){var +au(a){var b=a.toJSNumber()|0;if(a.equals(l(b)))return b;return a}function -W(a,b){return aU(l(a).add(l(b)))}function -cj(a,b){return l(a).compare(l(b))}function -jg(b,a){a=l(a);if(a.equals(l(0)))cf();return aU(l(b).divide(l(a)))}function -zd(b,a){a=l(a);if(a.equals(l(0)))cf();return aU(l(b).mod(a))}function -y8(a,b){return[0,jg(a,b),zd(a,b)]}function -jh(a,b){return jg(a,b)}function -y9(a,b){return l(a).equals(l(b))}function -y$(a,b){return aU(l.gcd(l(a),l(b)).abs())}function -y0(c,e,g){e=l(e);var +zv(a){return au(l(a).abs())}function +M(a,b){return au(l(a).add(l(b)))}function +b2(a,b){return l(a).compare(l(b))}function +jy(b,a){a=l(a);if(a.equals(l(0)))co();return au(l(b).divide(l(a)))}function +zD(b,a){a=l(a);if(a.equals(l(0)))co();return au(l(b).mod(a))}function +jz(a,b){return[0,jy(a,b),zD(a,b)]}function +jA(a,b){return jy(a,b)}function +zw(a,b){return l(a).equals(l(b))}function +zy(a,b){return au(l.gcd(l(a),l(b)).abs())}function +zn(c,e,g){e=l(e);var a=e.toArray(Math.pow(2,32));c.write(8,a.isNegative?1:0);var f=a.value.length,d=f*4;c.write(32,d);for(var -b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&aG);c.write(8,a.value[b]>>>8&aG);c.write(8,a.value[b]>>>16&aG);c.write(8,a.value[b]>>>24&aG)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function -y1(b,g){var +b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&aJ);c.write(8,a.value[b]>>>8&aJ);c.write(8,a.value[b]>>>16&aJ);c.write(8,a.value[b]>>>24&aJ)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function +zo(b,g){var e;switch(b.read8u()){case 1:e=true;break;case -0:e=false;break;default:bT("input_value: z (malformed input)")}var +0:e=false;break;default:bY("input_value: z (malformed input)")}var f=b.read32u(),c=l(0);for(var d=0;d>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aU(c)}function -za(d){var +a=l(b.read8u());a=a.add(b.read8u()<<8);a=a.add(b.read8u()<<16);a=a.add(b.read8u()<<24>>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return au(c)}function +zz(d){var b=l(d).toArray(Math.pow(2,32)),a=0;for(var -c=0;c=48&&a<=57)return a-48;if(a>=97&&a<=id)return a-97+10;if(a>=65&&a<=70)return a-65+10}var -e=0;if(a[e]==an)e++;for(;e=c)U("Z.of_substring_base: invalid digit")}return aU(l(a,c))}function -bW(d,a,b,c){a=aX(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function -jj(a){a=l(a);if(!y_(a))d8(d7(e$));var -b=l(iA),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=i7(d,c);return e}function -ea(){return new -Date().getTime()/aL}function -cm(e){var +if(d==iB||d=="X")c=16;else +if(d=="b"||d=="B")c=2;if(c!=10){a=a.substring(b+1);if(g==-1)a=ao+a}}}}if(a[0]==bm)a=a.substring(1);a=a.replace(/^0+/,k);if(a==ao||a==k)a=s;function +h(a){if(a>=48&&a<=57)return a-48;if(a>=97&&a<=iw)return a-97+10;if(a>=65&&a<=70)return a-65+10}var +e=0;if(a[e]==ao)e++;for(;e=c)V("Z.of_substring_base: invalid digit")}return au(l(a,c))}function +b3(d,a,b,c){a=aZ(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function +el(a){a=l(a);if(!zx(a))eh(eg(fp));var +b=l(iT),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=jo(d,c);return e}function +em(){return new +Date().getTime()/aO}function +ct(e){var a=new -Date(e*aL),b=a.getTime(),d=new -Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/hw);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-bH,a.getUTCDay(),c,false|0]}function -eb(){return 0}function -zh(h){var +Date(e*aO),b=a.getTime(),d=new +Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/hM);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-bK,a.getUTCDay(),c,false|0]}function +en(){return 0}function +zG(h){var a=new -Date(h*aL),b=a.getTime(),e=new -Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/hw),d=new +Date(h*aO),b=a.getTime(),e=new +Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/hM),d=new Date(a.getFullYear(),0,1),f=new -Date(a.getFullYear(),6,1),g=Math.max(d.getTimezoneOffset(),f.getTimezoneOffset());return[0,a.getSeconds(),a.getMinutes(),a.getHours(),a.getDate(),a.getMonth(),a.getFullYear()-bH,a.getDay(),c,a.getTimezoneOffset()>>0){if(!(25<(b+cJ|0)>>>0))c=1}else +a=c;continue}return 0}}return a(y7(0))}];function +jR(c){var +a=[0,0],d=eo[1];eo[1]=function(e){if(1-a[1]){a[1]=1;b(c,0)}return b(d,0)};return 0}function +jS(a){return b(eo[1],0)}function +b5(a){if(0<=a&&!(cd>>0){if(!(25<(b+cP|0)>>>0))c=1}else if(23!==b)c=1;return c?a+32|0:a}var -fM=yX(0)[1],fN=yW(0),cn=(4*fN|0)-1|0;ag(0);var -jC=yV(0);function -ed(d){var +f3=zk(0)[1],f4=zj(0),cu=(4*f4|0)-1|0;ah(0);var +j0=zi(0);function +df(d){var a=d,b=0;for(;;){if(a){var c=[0,a[1],b],a=a[2],b=c;continue}return b}}typeof -jC==="number";function -c$(c,a){if(a){var -d=a[2],e=b(c,a[1]);return[0,e,c$(c,d)]}return 0}function -aZ(a,c){var -b=S(a);ye(b,0,a,c);return b}function -fO(a){var -b=aH(a),c=S(b);bK(a,0,c,0,b);return c}function -da(a){return ao(fO(a))}function -fP(c,b,a){if(0<=b&&0<=a&&!((aH(c)-a|0)>>0))e=1}else +j=0;if(dM!==p(a,1)&&88!==p(a,1)){f=1;j=1}if(!j){aV(c,1,p(a,1));bd(a,2,c,(d-b|0)+2|0,b-2|0)}}else +f=1;if(f)bd(a,0,c,d-b|0,b)}}return ap(c)}function +b_(k,b){var +c=de(k),a=u(b),d=p(b,0),e=0;if(58<=d){if(71<=d){if(!(5<(d+il|0)>>>0))e=1}else if(65<=d)e=1}else{var -f=0;if(32!==d)if(43<=d)switch(d+iD|0){case +f=0;if(32!==d)if(43<=d)switch(d+iW|0){case 5:if(a<(c+2|0)&&1>>0){if(33<(n-61|0)>>>0)p=1}else +n=cr(k,j)+fv|0,p=0;if(59>>0){if(33<(n-61|0)>>>0)p=1}else if(2===n)p=1;if(!p){var j=j+1|0;continue}var -e=bq(k),a=[0,0],r=aH(e)-1|0,x=0;if(!(r<0)){var +e=bt(k),a=[0,0],r=aK(e)-1|0,x=0;if(!(r<0)){var i=x;for(;;){var -f=cZ(e,i),g=0;if(32<=f){var +f=c5(e,i),g=0;if(32<=f){var l=f-34|0,q=0;if(58>>0){if(93<=l)q=1}else if(56<(l-1|0)>>>0){g=1;q=1}if(!q){var m=1;g=2}}else @@ -1969,40 +1973,40 @@ m=4;break;case 1:var m=2;break}a[1]=a[1]+m|0;var A=i+1|0;if(r!==i){var -i=A;continue}break}}if(a[1]===aH(e))var -t=fO(e);else{var -b=S(a[1]);a[1]=0;var -s=aH(e)-1|0,y=0;if(!(s<0)){var +i=A;continue}break}}if(a[1]===aK(e))var +t=f5(e);else{var +b=T(a[1]);a[1]=0;var +s=aK(e)-1|0,y=0;if(!(s<0)){var h=y;for(;;){var -c=cZ(e,h),d=0;if(35<=c)if(92===c)d=2;else -if(cJ<=c)d=1;else +c=c5(e,h),d=0;if(35<=c)if(92===c)d=2;else +if(cP<=c)d=1;else d=3;else if(32<=c)if(34<=c)d=2;else d=3;else if(14<=c)d=1;else switch(c){case -8:R(b,a[1],92);a[1]++;R(b,a[1],98);break;case -9:R(b,a[1],92);a[1]++;R(b,a[1],116);break;case -10:R(b,a[1],92);a[1]++;R(b,a[1],cX);break;case -13:R(b,a[1],92);a[1]++;R(b,a[1],114);break;default:d=1}switch(d){case -1:R(b,a[1],92);a[1]++;R(b,a[1],48+(c/aP|0)|0);a[1]++;R(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;R(b,a[1],48+(c%10|0)|0);break;case -2:R(b,a[1],92);a[1]++;R(b,a[1],c);break;case -3:R(b,a[1],c);break}a[1]++;var +8:S(b,a[1],92);a[1]++;S(b,a[1],98);break;case +9:S(b,a[1],92);a[1]++;S(b,a[1],116);break;case +10:S(b,a[1],92);a[1]++;S(b,a[1],c3);break;case +13:S(b,a[1],92);a[1]++;S(b,a[1],114);break;default:d=1}switch(d){case +1:S(b,a[1],92);a[1]++;S(b,a[1],48+(c/aS|0)|0);a[1]++;S(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;S(b,a[1],48+(c%10|0)|0);break;case +2:S(b,a[1],92);a[1]++;S(b,a[1],c);break;case +3:S(b,a[1],c);break}a[1]++;var z=h+1|0;if(s!==h){var h=z;continue}break}}var t=b}var -o=ao(t)}var -v=u(o),w=aZ(v+2|0,34);bL(o,0,w,1,v);return ao(w)}}function -f2(d,f){var -g=c_(f),e=f3?f3[1]:70;switch(d[2]){case +o=ap(t)}var +v=u(o),w=a1(v+2|0,34);bO(o,0,w,1,v);return ap(w)}}function +gh(d,f){var +g=de(f),e=gi?gi[1]:70;switch(d[2]){case 0:var -b=id;break;case +b=iw;break;case 1:var -b=dO;break;case +b=dX;break;case 2:var b=69;break;case 3:var -b=eZ;break;case +b=fd;break;case 4:var b=71;break;case 5:var @@ -2012,210 +2016,210 @@ b=104;break;case 7:var b=72;break;default:var b=70}var -c=fZ(16);b1(c,37);switch(d[1]){case +c=ge(16);b9(c,37);switch(d[1]){case 0:break;case -1:b1(c,43);break;default:b1(c,32)}if(8<=d[2])b1(c,35);b1(c,46);ak(c,a(k+g));b1(c,b);return f1(c)}function -dg(m,a){if(13<=m){var +1:b9(c,43);break;default:b9(c,32)}if(8<=d[2])b9(c,35);b9(c,46);al(c,a(k+g));b9(c,b);return gg(c)}function +dn(m,a){if(13<=m){var g=[0,0],h=u(a)-1|0,n=0;if(!(h<0)){var -c=n;for(;;){if(!(9<(ci(a,c)+dE|0)>>>0))g[1]++;var +c=n;for(;;){if(!(9<(cr(a,c)+dN|0)>>>0))g[1]++;var q=c+1|0;if(h!==c){var c=q;continue}break}}var -i=g[1],j=S(u(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){aS(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=u(a)-1|0,o=0;if(!(l<0)){var +i=g[1],j=T(u(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){aV(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=u(a)-1|0,o=0;if(!(l<0)){var b=o;for(;;){var -f=ci(a,b);if(9<(f+dE|0)>>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var +f=cr(a,b);if(9<(f+dN|0)>>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var p=b+1|0;if(l!==b){var -b=p;continue}break}}return ao(j)}return a}function -lw(b,c){switch(b){case +b=p;continue}break}}return ap(j)}return a}function +lU(b,c){switch(b){case 1:var -a=kJ;break;case +a=k7;break;case 2:var -a=kK;break;case -4:var -a=kM;break;case -5:var -a=kN;break;case -6:var -a=kO;break;case -7:var -a=kP;break;case -8:var -a=kQ;break;case -9:var -a=kR;break;case -10:var -a=kS;break;case -11:var -a=kT;break;case -0:case -13:var -a=kI;break;case -3:case -14:var -a=kL;break;default:var -a=kU}return dg(b,d1(a,c))}function -lx(b,c){switch(b){case -1:var -a=k9;break;case -2:var -a=k_;break;case -4:var -a=la;break;case -5:var -a=lb;break;case -6:var -a=lc;break;case -7:var -a=ld;break;case -8:var -a=le;break;case -9:var -a=lf;break;case -10:var -a=lg;break;case -11:var -a=lh;break;case -0:case -13:var a=k8;break;case -3:case -14:var -a=k$;break;default:var -a=li}return dg(b,d1(a,c))}function -ly(b,c){switch(b){case -1:var -a=lk;break;case -2:var -a=ll;break;case 4:var -a=ln;break;case +a=k_;break;case 5:var -a=lo;break;case +a=k$;break;case 6:var -a=lp;break;case +a=la;break;case 7:var -a=lq;break;case +a=lb;break;case 8:var -a=lr;break;case +a=lc;break;case 9:var -a=ls;break;case +a=ld;break;case 10:var -a=lt;break;case +a=le;break;case 11:var -a=lu;break;case +a=lf;break;case 0:case 13:var -a=lj;break;case -3:case -14:var -a=lm;break;default:var -a=lv}return dg(b,d1(a,c))}function -lz(b,c){switch(b){case -1:var -a=kW;break;case -2:var -a=kX;break;case -4:var -a=kZ;break;case -5:var -a=k0;break;case -6:var -a=k1;break;case -7:var -a=k2;break;case -8:var -a=k3;break;case -9:var -a=k4;break;case -10:var -a=k5;break;case -11:var a=k6;break;case -0:case -13:var -a=kV;break;case 3:case 14:var -a=kY;break;default:var -a=k7}return dg(b,yp(a,c))}function -bc(c,i,b){function +a=k9;break;default:var +a=lg}return dn(b,d_(a,c))}function +lV(b,c){switch(b){case +1:var +a=lv;break;case +2:var +a=lw;break;case +4:var +a=ly;break;case +5:var +a=lz;break;case +6:var +a=lA;break;case +7:var +a=lB;break;case +8:var +a=lC;break;case +9:var +a=lD;break;case +10:var +a=lE;break;case +11:var +a=lF;break;case +0:case +13:var +a=lu;break;case +3:case +14:var +a=lx;break;default:var +a=lG}return dn(b,d_(a,c))}function +lW(b,c){switch(b){case +1:var +a=lI;break;case +2:var +a=lJ;break;case +4:var +a=lL;break;case +5:var +a=lM;break;case +6:var +a=lN;break;case +7:var +a=lO;break;case +8:var +a=lP;break;case +9:var +a=lQ;break;case +10:var +a=lR;break;case +11:var +a=lS;break;case +0:case +13:var +a=lH;break;case +3:case +14:var +a=lK;break;default:var +a=lT}return dn(b,d_(a,c))}function +lX(b,c){switch(b){case +1:var +a=li;break;case +2:var +a=lj;break;case +4:var +a=ll;break;case +5:var +a=lm;break;case +6:var +a=ln;break;case +7:var +a=lo;break;case +8:var +a=lp;break;case +9:var +a=lq;break;case +10:var +a=lr;break;case +11:var +a=ls;break;case +0:case +13:var +a=lh;break;case +3:case +14:var +a=lk;break;default:var +a=lt}return dn(b,yQ(a,c))}function +be(c,i,b){function j(d){switch(c[1]){case 0:var a=45;break;case 1:var a=43;break;default:var -a=32}return ym(b,i,a)}function +a=32}return yN(b,i,a)}function r(c){var -a=yd(b);return 3===a?b<0.?lB:lC:4<=a?lD:c}switch(c[2]){case +a=yE(b);return 3===a?b<0.?lZ:l0:4<=a?l1:c}switch(c[2]){case 5:var -e=i5(f2(c,i),b),d=0,w=u(e);for(;;){if(d===w)var +e=jm(gh(c,i),b),d=0,w=u(e);for(;;){if(d===w)var q=0;else{var -k=p(e,d)+hz|0,l=0;if(23>>0){if(55===k)l=1}else +k=p(e,d)+hP|0,l=0;if(23>>0){if(55===k)l=1}else if(21<(k-1|0)>>>0)l=1;if(!l){var d=d+1|0;continue}var q=1}var -x=q?e:bu(e,lA);return r(x)}case +x=q?e:bx(e,lY);return r(x)}case 6:return j(0);case 7:var -h=bq(j(0)),f=aH(h);if(0===f)var +h=bt(j(0)),f=aK(h);if(0===f)var o=h;else{var -m=S(f),n=f-1|0,s=0;if(!(n<0)){var +m=T(f),n=f-1|0,s=0;if(!(n<0)){var a=s;for(;;){var -g=cZ(h,a),t=25<(g+h5|0)>>>0?g:g+ff|0;R(m,a,t);var +g=c5(h,a),t=25<(g+il|0)>>>0?g:g+fv|0;S(m,a,t);var v=a+1|0;if(n!==a){var a=v;continue}break}}var -o=m}return ao(o);case -8:return r(j(0));default:return i5(f2(c,i),b)}}function -cF(e,C,A,z){var +o=m}return ap(o);case +8:return r(j(0));default:return jm(gh(c,i),b)}}function +cL(e,C,A,z){var c=C,a=A,d=z;for(;;)if(typeof d==="number")return b(c,a);else switch(d[0]){case 0:var -E=d[1];return function(b){return y(c,[5,a,b],E)};case +D=d[1];return function(b){return y(c,[5,a,b],D)};case 1:var F=d[1];return function(b){var e=0;if(40<=b)if(92===b)var -d=jw;else -if(cJ<=b)e=1;else +d=jU;else +if(cP<=b)e=1;else e=2;else if(32<=b)if(39<=b)var -d=jx;else +d=jV;else e=2;else if(14<=b)e=1;else switch(b){case 8:var -d=jy;break;case +d=jW;break;case 9:var -d=jz;break;case +d=jX;break;case 10:var -d=jA;break;case +d=jY;break;case 13:var -d=jB;break;default:e=1}switch(e){case +d=jZ;break;default:e=1}switch(e){case 1:var -f=S(4);R(f,0,92);R(f,1,48+(b/aP|0)|0);R(f,2,48+((b/10|0)%10|0)|0);R(f,3,48+(b%10|0)|0);var -d=ao(f);break;case +f=T(4);S(f,0,92);S(f,1,48+(b/aS|0)|0);S(f,2,48+((b/10|0)%10|0)|0);S(f,3,48+(b%10|0)|0);var +d=ap(f);break;case 2:var -g=S(1);R(g,0,b);var -d=ao(g);break}var -h=u(d),i=aZ(h+2|0,39);bL(d,0,i,1,h);return y(c,[4,a,ao(i)],F)};case +g=T(1);S(g,0,b);var +d=ap(g);break}var +h=u(d),i=a1(h+2|0,39);bO(d,0,i,1,h);return y(c,[4,a,ap(i)],F)};case 2:var -G=d[2],H=d[1];return ej(c,a,G,H,function(a){return a});case -3:return ej(c,a,d[2],d[1],kH);case -4:return dh(c,a,d[4],d[2],d[3],lw,d[1]);case -5:return dh(c,a,d[4],d[2],d[3],lx,d[1]);case -6:return dh(c,a,d[4],d[2],d[3],ly,d[1]);case -7:return dh(c,a,d[4],d[2],d[3],lz,d[1]);case +G=d[2],H=d[1];return eu(c,a,G,H,function(a){return a});case +3:return eu(c,a,d[2],d[1],k5);case +4:return dp(c,a,d[4],d[2],d[3],lU,d[1]);case +5:return dp(c,a,d[4],d[2],d[3],lV,d[1]);case +6:return dp(c,a,d[4],d[2],d[3],lW,d[1]);case +7:return dp(c,a,d[4],d[2],d[3],lX,d[1]);case 8:var -i=d[4],j=d[3],k=d[2],g=d[1];if(typeof +i=d[4],j=d[3],k=d[2],h=d[1];if(typeof k==="number"){if(typeof -j==="number")return j?function(d,b){return y(c,[4,a,bc(g,d,b)],i)}:function(b){return y(c,[4,a,bc(g,eh(g),b)],i)};var -ab=j[1];return function(b){return y(c,[4,a,bc(g,ab,b)],i)}}else{if(0===k[0]){var +j==="number")return j?function(d,b){return y(c,[4,a,be(h,d,b)],i)}:function(b){return y(c,[4,a,be(h,es(h),b)],i)};var +ab=j[1];return function(b){return y(c,[4,a,be(h,ab,b)],i)}}else{if(0===k[0]){var n=k[2],o=k[1];if(typeof -j==="number")return j?function(d,b){return y(c,[4,a,av(o,n,bc(g,d,b))],i)}:function(b){return y(c,[4,a,av(o,n,bc(g,eh(g),b))],i)};var -ac=j[1];return function(b){return y(c,[4,a,av(o,n,bc(g,ac,b))],i)}}var +j==="number")return j?function(d,b){return y(c,[4,a,ay(o,n,be(h,d,b))],i)}:function(b){return y(c,[4,a,ay(o,n,be(h,es(h),b))],i)};var +ac=j[1];return function(b){return y(c,[4,a,ay(o,n,be(h,ac,b))],i)}}var p=k[1];if(typeof -j==="number")return j?function(e,d,b){return y(c,[4,a,av(p,e,bc(g,d,b))],i)}:function(d,b){return y(c,[4,a,av(p,d,bc(g,eh(g),b))],i)};var -ae=j[1];return function(d,b){return y(c,[4,a,av(p,d,bc(g,ae,b))],i)}}case -9:return ej(c,a,d[2],d[1],jn);case +j==="number")return j?function(e,d,b){return y(c,[4,a,ay(p,e,be(h,d,b))],i)}:function(d,b){return y(c,[4,a,ay(p,d,be(h,es(h),b))],i)};var +ad=j[1];return function(d,b){return y(c,[4,a,ay(p,d,be(h,ad,b))],i)}}case +9:return eu(c,a,d[2],d[1],jL);case 10:var a=[7,a],d=d[1];continue;case 11:var @@ -2223,102 +2227,102 @@ a=[2,a,d[1]],d=d[2];continue;case 12:var a=[3,a,d[1]],d=d[2];continue;case 13:var -I=d[3],K=d[2],q=fZ(16);ei(q,K);var -x=f1(q);return function(b){return y(c,[4,a,x],I)};case +I=d[3],K=d[2],q=ge(16);et(q,K);var +x=gg(q);return function(b){return y(c,[4,a,x],I)};case 14:var -L=d[3],N=d[2];return function(d){var -e=d[1],b=D(e,M(_(N)));if(typeof -b[2]==="number")return y(c,a,J(b[1],L));throw ah};case +L=d[3],M=d[2];return function(d){var +e=d[1],b=E(e,N(_(M)));if(typeof +b[2]==="number")return y(c,a,J(b[1],L));throw ai};case 15:var -O=d[1];return function(d,b){return y(c,[6,a,function(a){return h(d,a,b)}],O)};case +O=d[1];return function(d,b){return y(c,[6,a,function(a){return g(d,a,b)}],O)};case 16:var P=d[1];return function(b){return y(c,[6,a,b],P)};case 17:var a=[0,a,d[1]],d=d[2];continue;case 18:var m=d[1];if(0===m[0]){var -Q=d[2],T=m[1][1],U=0,c=function(b,c,d){return function(a){return y(c,[1,b,[0,a]],d)}}(a,c,Q),a=U,d=T;continue}var +Q=d[2],R=m[1][1],U=0,c=function(b,c,d){return function(a){return y(c,[1,b,[0,a]],d)}}(a,c,Q),a=U,d=R;continue}var V=d[2],W=m[1][1],X=0,c=function(b,c,d){return function(a){return y(c,[1,b,[1,a]],d)}}(a,c,V),a=X,d=W;continue;case -19:throw[0,v,lF];case +19:throw[0,v,l3];case 20:var -Y=d[3],Z=[8,a,lG];return function(a){return y(c,Z,Y)};case +Y=d[3],Z=[8,a,l4];return function(a){return y(c,Z,Y)};case 21:var -$=d[2];return function(b){return y(c,[4,a,d1(lH,b)],$)};case +$=d[2];return function(b){return y(c,[4,a,d_(l5,b)],$)};case 22:var aa=d[1];return function(b){return y(c,[5,a,b],aa)};case 23:var f=d[2],l=d[1];if(typeof l==="number")switch(l){case -0:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -1:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -2:throw[0,v,lI];default:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f])}else +0:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +1:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +2:throw[0,v,l6];default:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f])}else switch(l[0]){case -0:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -1:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -2:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -3:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -4:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -5:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -6:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -7:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case -8:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);case +0:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +1:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +2:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +3:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +4:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +5:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +6:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +7:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case +8:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);case 9:var -w=l[2];return e<50?eT(e+1|0,c,a,w,f):ad(eT,[0,c,a,w,f]);case -10:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f]);default:return e<50?B(e+1|0,c,a,f):ad(B,[0,c,a,f])}default:var -r=d[3],s=d[1],t=b(d[2],0);return e<50?eS(e+1|0,c,a,r,s,t):ad(eS,[0,c,a,r,s,t])}}function -eT(e,d,c,a,b){if(typeof -a==="number")return e<50?B(e+1|0,d,c,b):ad(B,[0,d,c,b]);else +w=l[2];return e<50?e9(e+1|0,c,a,w,f):ae(e9,[0,c,a,w,f]);case +10:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f]);default:return e<50?B(e+1|0,c,a,f):ae(B,[0,c,a,f])}default:var +r=d[3],s=d[1],t=b(d[2],0);return e<50?e8(e+1|0,c,a,r,s,t):ae(e8,[0,c,a,r,s,t])}}function +e9(e,d,c,a,b){if(typeof +a==="number")return e<50?B(e+1|0,d,c,b):ae(B,[0,d,c,b]);else switch(a[0]){case 0:var -f=a[1];return function(a){return aB(d,c,f,b)};case +f=a[1];return function(a){return aE(d,c,f,b)};case 1:var -g=a[1];return function(a){return aB(d,c,g,b)};case +g=a[1];return function(a){return aE(d,c,g,b)};case 2:var -h=a[1];return function(a){return aB(d,c,h,b)};case +h=a[1];return function(a){return aE(d,c,h,b)};case 3:var -i=a[1];return function(a){return aB(d,c,i,b)};case +i=a[1];return function(a){return aE(d,c,i,b)};case 4:var -j=a[1];return function(a){return aB(d,c,j,b)};case +j=a[1];return function(a){return aE(d,c,j,b)};case 5:var -k=a[1];return function(a){return aB(d,c,k,b)};case +k=a[1];return function(a){return aE(d,c,k,b)};case 6:var -l=a[1];return function(a){return aB(d,c,l,b)};case +l=a[1];return function(a){return aE(d,c,l,b)};case 7:var -m=a[1];return function(a){return aB(d,c,m,b)};case +m=a[1];return function(a){return aE(d,c,m,b)};case 8:var -n=a[2];return function(a){return aB(d,c,n,b)};case +n=a[2];return function(a){return aE(d,c,n,b)};case 9:var -o=a[3],p=a[2],q=ae(_(a[1]),p);return function(a){return aB(d,c,ap(q,o),b)};case +o=a[3],p=a[2],q=af(_(a[1]),p);return function(a){return aE(d,c,ar(q,o),b)};case 10:var -r=a[1];return function(e,a){return aB(d,c,r,b)};case +r=a[1];return function(e,a){return aE(d,c,r,b)};case 11:var -s=a[1];return function(a){return aB(d,c,s,b)};case +s=a[1];return function(a){return aE(d,c,s,b)};case 12:var -t=a[1];return function(a){return aB(d,c,t,b)};case -13:throw[0,v,lJ];default:throw[0,v,lK]}}function +t=a[1];return function(a){return aE(d,c,t,b)};case +13:throw[0,v,l7];default:throw[0,v,l8]}}function B(d,b,e,a){var -c=[8,e,lL];return d<50?cF(d+1|0,b,c,a):ad(cF,[0,b,c,a])}function -eS(h,c,f,a,e,d){if(e){var -i=e[1];return function(e){return lE(c,f,a,i,b(d,e))}}var -g=[4,f,d];return h<50?cF(h+1|0,c,g,a):ad(cF,[0,c,g,a])}function -y(a,b,c){return c5(cF(0,a,b,c))}function -aB(a,b,c,d){return c5(eT(0,a,b,c,d))}function -lE(a,b,c,d,e){return c5(eS(0,a,b,c,d,e))}function -ej(f,e,d,a,c){if(typeof +c=[8,e,l9];return d<50?cL(d+1|0,b,c,a):ae(cL,[0,b,c,a])}function +e8(h,c,f,a,e,d){if(e){var +i=e[1];return function(e){return l2(c,f,a,i,b(d,e))}}var +g=[4,f,d];return h<50?cL(h+1|0,c,g,a):ae(cL,[0,c,g,a])}function +y(a,b,c){return c_(cL(0,a,b,c))}function +aE(a,b,c,d){return c_(e9(0,a,b,c,d))}function +l2(a,b,c,d,e){return c_(e8(0,a,b,c,d,e))}function +eu(f,e,d,a,c){if(typeof a==="number")return function(a){return y(f,[4,e,b(c,a)],d)};else{if(0===a[0]){var -g=a[2],h=a[1];return function(a){return y(f,[4,e,av(h,g,b(c,a))],d)}}var -i=a[1];return function(g,a){return y(f,[4,e,av(i,g,b(c,a))],d)}}}function -dh(f,e,d,g,c,b,a){if(typeof -g==="number"){if(typeof -c==="number")return c?function(g,c){return y(f,[4,e,b2(g,h(b,a,c))],d)}:function(c){return y(f,[4,e,h(b,a,c)],d)};var -l=c[1];return function(c){return y(f,[4,e,b2(l,h(b,a,c))],d)}}else{if(0===g[0]){var -i=g[2],j=g[1];if(typeof -c==="number")return c?function(g,c){return y(f,[4,e,av(j,i,b2(g,h(b,a,c)))],d)}:function(c){return y(f,[4,e,av(j,i,h(b,a,c))],d)};var -m=c[1];return function(c){return y(f,[4,e,av(j,i,b2(m,h(b,a,c)))],d)}}var -k=g[1];if(typeof -c==="number")return c?function(i,g,c){return y(f,[4,e,av(k,i,b2(g,h(b,a,c)))],d)}:function(g,c){return y(f,[4,e,av(k,g,h(b,a,c))],d)};var -n=c[1];return function(g,c){return y(f,[4,e,av(k,g,b2(n,h(b,a,c)))],d)}}}function -bv(c,h){var +g=a[2],h=a[1];return function(a){return y(f,[4,e,ay(h,g,b(c,a))],d)}}var +i=a[1];return function(g,a){return y(f,[4,e,ay(i,g,b(c,a))],d)}}}function +dp(f,e,d,h,c,b,a){if(typeof +h==="number"){if(typeof +c==="number")return c?function(h,c){return y(f,[4,e,b_(h,g(b,a,c))],d)}:function(c){return y(f,[4,e,g(b,a,c)],d)};var +l=c[1];return function(c){return y(f,[4,e,b_(l,g(b,a,c))],d)}}else{if(0===h[0]){var +i=h[2],j=h[1];if(typeof +c==="number")return c?function(h,c){return y(f,[4,e,ay(j,i,b_(h,g(b,a,c)))],d)}:function(c){return y(f,[4,e,ay(j,i,g(b,a,c))],d)};var +m=c[1];return function(c){return y(f,[4,e,ay(j,i,b_(m,g(b,a,c)))],d)}}var +k=h[1];if(typeof +c==="number")return c?function(i,h,c){return y(f,[4,e,ay(k,i,b_(h,g(b,a,c)))],d)}:function(h,c){return y(f,[4,e,ay(k,h,g(b,a,c))],d)};var +n=c[1];return function(h,c){return y(f,[4,e,ay(k,h,b_(n,g(b,a,c)))],d)}}}function +by(c,h){var a=h;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case @@ -2326,123 +2330,123 @@ switch(a[0]){case e=a[2],i=a[1];if(typeof e==="number")switch(e){case 0:var -d=j3;break;case +d=kp;break;case 1:var -d=j4;break;case +d=kq;break;case 2:var -d=j5;break;case +d=kr;break;case 3:var -d=j6;break;case +d=ks;break;case 4:var -d=j7;break;case +d=kt;break;case 5:var -d=j8;break;default:var -d=j9}else +d=ku;break;default:var +d=kv}else switch(e[0]){case 0:var d=e[1];break;case 1:var d=e[1];break;default:var -d=bu(j_,fS(1,e[1]))}bv(c,i);return cq(c,d);case +d=bx(kw,f9(1,e[1]))}by(c,i);return cx(c,d);case 1:var f=a[2],g=a[1];if(0===f[0]){var -j=f[1];bv(c,g);cq(c,lM);var +j=f[1];by(c,g);cx(c,l_);var a=j;continue}var -k=f[1];bv(c,g);cq(c,lN);var +k=f[1];by(c,g);cx(c,l$);var a=k;continue;case 6:var -n=a[2];bv(c,a[1]);return cq(c,b(n,0));case +n=a[2];by(c,a[1]);return cx(c,b(n,0));case 7:var a=a[1];continue;case 8:var -o=a[2];bv(c,a[1]);return Z(o);case +o=a[2];by(c,a[1]);return Z(o);case 2:case 4:var -l=a[2];bv(c,a[1]);return cq(c,l);default:var -m=a[2];bv(c,a[1]);return fY(c,m)}}function -f4(b){var +l=a[2];by(c,a[1]);return cx(c,l);default:var +m=a[2];by(c,a[1]);return gd(c,m)}}function +ev(b){var a=b[1];return y(function(b){var -a=ef(64);bv(a,b);return fX(a)},0,a)}var -f5=[0,0];function -ek(a){f5[1]=[0,a,f5[1]];return 0}try{var -x6=d_(x5),f7=x6}catch(a){a=e(a);if(a!==am)throw a;try{var -x4=d_(x3),f6=x4}catch(a){a=e(a);if(a!==am)throw a;var -f6=lP}var -f7=f6}var -lQ=jI(f7,82),di=[hN,function(z){var -n=yY(0),c=[0,bs(55,0),0],i=0===n.length-1?[0,0]:n,j=i.length-1,b=0;for(;;){ac(c[1],b)[1+b]=b;var +a=eq(64);by(a,b);return gc(a)},0,a)}var +gj=[0,0];function +ew(a){gj[1]=[0,a,gj[1]];return 0}try{var +yv=ej(yu),gl=yv}catch(a){a=d(a);if(a!==an)throw a;try{var +yt=ej(ys),gk=yt}catch(a){a=d(a);if(a!==an)throw a;var +gk=mb}var +gl=gk}var +mc=j6(gl,82),dq=[h3,function(z){var +n=zl(0),c=[0,bv(55,0),0],i=0===n.length-1?[0,0]:n,j=i.length-1,b=0;for(;;){ad(c[1],b)[1+b]=b;var y=b+1|0;if(54!==b){var b=y;continue}var -g=[0,lO],l=54+c9(55,j)|0,t=0;if(!(l<0)){var +g=[0,ma],l=54+dd(55,j)|0,t=0;if(!(l<0)){var d=t;for(;;){var -e=d%55|0,m=yL(d,j),v=ac(i,m)[1+m],h=bu(g[1],a(k+v));g[1]=yG(h,0,u(h));var -f=g[1],o=p(f,3)<<24,q=p(f,2)<<16,r=p(f,1)<<8,s=((p(f,0)+r|0)+q|0)+o|0,w=(ac(c[1],e)[1+e]^s)&e4;ac(c[1],e)[1+e]=w;var +e=d%55|0,m=y_(d,j),v=ad(i,m)[1+m],h=bx(g[1],a(k+v));g[1]=y5(h,0,u(h));var +f=g[1],o=p(f,3)<<24,q=p(f,2)<<16,r=p(f,1)<<8,s=((p(f,0)+r|0)+q|0)+o|0,w=(ad(c[1],e)[1+e]^s)&fi;ad(c[1],e)[1+e]=w;var x=d+1|0;if(l!==d){var d=x;continue}break}}c[2]=0;return c}}];function -lR(h,k){var -l=h?h[1]:lQ,b=16;for(;;){if(!(k<=b)&&!(fN<(b*2|0))){var +md(h,k){var +l=h?h[1]:mc,b=16;for(;;){if(!(k<=b)&&!(f4<(b*2|0))){var b=b*2|0;continue}if(l){var -i=jb(di),a=dF===i?di[1]:hN===i?jY(di):di;a[2]=(a[2]+1|0)%55|0;var -c=a[2],d=ac(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ac(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&e4,g=a[2];ac(a[1],g)[1+g]=f;var +i=jt(dq),a=dO===i?dq[1]:h3===i?kk(dq):dq;a[2]=(a[2]+1|0)%55|0;var +c=a[2],d=ad(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ad(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&fi,g=a[2];ad(a[1],g)[1+g]=f;var j=f}else var -j=0;return[0,0,bs(b,0),j,b]}}function -a0(a){return yg(10,aP,0,a)}var -f_=[C,lS,ag(0)],f8=0,f9=-1;function -dj(a,b){a[13]=a[13]+b[3]|0;return fW(b,a[28])}var -f$=1000000010;function -el(b,a){return F(b[17],a,0,u(a))}function -em(a){return b(a[19],0)}function -ga(a,c,b){a[9]=a[9]-c|0;el(a,b);a[11]=0;return 0}function -dk(c,a){var -b=V(a,lT);return b?ga(c,u(a),a):b}function -b3(a,c,f){var -g=c[3],h=c[2];dk(a,c[1]);em(a);a[11]=1;var -d=(a[6]-f|0)+h|0,e=a[8],i=yD(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;b(a[21],a[10]);return dk(a,g)}function -gb(b,a){return b3(b,lU,a)}function -cs(a,c){var -d=c[2],e=c[3];dk(a,c[1]);a[9]=a[9]-d|0;b(a[20],d);return dk(a,e)}function -gc(a){for(;;){var +j=0;return[0,0,bv(b,0),j,b]}}function +a2(a){return yH(10,aS,0,a)}var +go=[D,me,ah(0)],gm=0,gn=-1;function +dr(a,b){a[13]=a[13]+b[3]|0;return gb(b,a[28])}var +gp=1000000010;function +ex(b,a){return C(b[17],a,0,u(a))}function +ey(a){return b(a[19],0)}function +gq(a,c,b){a[9]=a[9]-c|0;ex(a,b);a[11]=0;return 0}function +ds(c,a){var +b=W(a,mf);return b?gq(c,u(a),a):b}function +b$(a,c,f){var +g=c[3],h=c[2];ds(a,c[1]);ey(a);a[11]=1;var +d=(a[6]-f|0)+h|0,e=a[8],i=y2(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;b(a[21],a[10]);return ds(a,g)}function +gr(b,a){return b$(b,mg,a)}function +cz(a,c){var +d=c[2],e=c[3];ds(a,c[1]);a[9]=a[9]-d|0;b(a[20],d);return ds(a,e)}function +gs(a){for(;;){var r=a[28][2],O=r?[0,r[1]]:0;if(O){var p=O[1],q=p[1],c=p[2],ac=0<=q?1:0,aa=p[3],ab=a[13]-a[12]|0,P=ac||(a[9]<=ab?1:0);if(P){var g=a[28],m=g[2];if(m){if(m[2]){var Q=m[2];g[1]=g[1]-1|0;g[2]=Q}else -ee(g);var -l=0<=q?q:f$;if(typeof +ep(g);var +l=0<=q?q:gp;if(typeof c==="number")switch(c){case 0:var -y=b0(a[3]);if(y){var +y=b8(a[3]);if(y){var z=y[1][1],A=function(b,a){if(a){var -c=a[1],d=a[2];return fz(b,c)?[0,b,a]:[0,c,A(b,d)]}return[0,b,0]};z[1]=A(a[6]-a[9]|0,z[1])}break;case -1:bZ(a[2]);break;case -2:bZ(a[3]);break;case +c=a[1],d=a[2];return fP(b,c)?[0,b,a]:[0,c,A(b,d)]}return[0,b,0]};z[1]=A(a[6]-a[9]|0,z[1])}break;case +1:b7(a[2]);break;case +2:b7(a[3]);break;case 3:var -B=b0(a[2]);if(B)gb(a,B[1][2]);else -em(a);break;case +B=b8(a[2]);if(B)gr(a,B[1][2]);else +ey(a);break;case 4:if(a[10]!==(a[6]-a[9]|0)){var e=a[28],h=e[2];if(h){var s=h[1];if(h[2]){var R=h[2];e[1]=e[1]-1|0;e[2]=R;var -i=[0,s]}else{ee(e);var +i=[0,s]}else{ep(e);var i=[0,s]}}else var i=0;if(i){var x=i[1],T=x[1];a[12]=a[12]-x[3]|0;a[9]=a[9]+T|0}}break;default:var -C=bZ(a[5]);if(C)el(a,b(a[25],C[1]))}else +C=b7(a[5]);if(C)ex(a,b(a[25],C[1]))}else switch(c[0]){case -0:ga(a,l,c[1]);break;case +0:gq(a,l,c[1]);break;case 1:var -d=c[2],j=c[1],D=d[1],U=d[2],E=b0(a[2]);if(E){var +d=c[2],j=c[1],D=d[1],U=d[2],E=b8(a[2]);if(E){var F=E[1],f=F[2];switch(F[1]){case -0:cs(a,j);break;case -1:b3(a,d,f);break;case -2:b3(a,d,f);break;case -3:if(a[9]<(l+u(D)|0))b3(a,d,f);else -cs(a,j);break;case -4:if(a[11]||!(a[9]<(l+u(D)|0)||((a[6]-f|0)+U|0)>>0))gb(a,w)}else -em(a)}var -_=a[9]-Z|0,$=1===M?1:a[9]>>0))gr(a,w)}else +ey(a)}var +_=a[9]-Z|0,$=1===M?1:a[9]>>3|0,bX(bM(b,a>>>3|0)|1<<(a&7)))}function -dp(b){var -a=es(0);ct(a,b);return a}function -dq(c){var -b=S(32),a=0;for(;;){aS(b,a,bX(bM(c,a)^b6));var +h=d[1],a=b(ev(nX),h);return[0,C(ev(mT),a,g,f)]}return 0});en(nY);en(nZ);try{en(yp)}catch(a){a=d(a);if(a[1]!==dc)throw a}try{en(yo)}catch(a){a=d(a);if(a[1]!==dc)throw a}md(0,7);function +n0(b,a){return di(b,0,a)}function +n1(b,a){return di(b,a,u(b)-a|0)}var +bf=a1(32,cd);function +eE(a){return a1(32,0)}function +cA(b,a){return aV(b,a>>>3|0,b5(bP(b,a>>>3|0)|1<<(a&7)))}function +dw(b){var +a=eE(0);cA(a,b);return a}function +dx(c){var +b=T(32),a=0;for(;;){aV(b,a,b5(bP(c,a)^cd));var d=a+1|0;if(31!==a){var a=d;continue}return b}}function -et(d,c){var -b=S(32),a=0;for(;;){var -e=bM(c,a);aS(b,a,bX(bM(d,a)|e));var +eF(d,c){var +b=T(32),a=0;for(;;){var +e=bP(c,a);aV(b,a,b5(bP(d,a)|e));var f=a+1|0;if(31!==a){var a=f;continue}return b}}function -nE(c,b){try{var +n2(c,b){try{var a=0;for(;;){var -f=bM(b,a);if(0!==(bM(c,a)&f))throw fI;var +f=bP(b,a);if(0!==(bP(c,a)&f))throw fZ;var g=a+1|0;if(31!==a){var a=g;continue}var -d=1;return d}}catch(a){a=e(a);if(a===fI)return 0;throw a}}function -go(f,e){var +e=1;return e}}catch(a){a=d(a);if(a===fZ)return 0;throw a}}function +gE(f,e){var a=0;for(;;){var -d=bM(e,a);if(0!==d){var -c=0;for(;;){if(0!==(d&1<>>0){if(!(25<(b+cJ|0)>>>0))d=1}else +c=eE(0);gE(function(a){cA(c,f2(a));var +b=a-224|0,d=0;if(30>>0){if(!(25<(b+cP|0)>>>0))d=1}else if(23!==b)d=1;var -e=d?a+ff|0:a;return ct(c,e)},b);var +e=d?a+fv|0:a;return cA(c,e)},b);var d=c}else var d=b;var -h=f?dq(d):d;return da(h)}throw[0,v,nT]}var -gs=S(b9),cE=0;for(;;){aS(gs,cE,fL(bX(cE)));var -xY=cE+1|0;if(b6!==cE){var -cE=xY;continue}da(gs);var -dt=de([0,fD]),gt=function(a){var -b=fX(a[1]);a[1][2]=0;var +h=f?dx(d):d;return dh(h)}throw[0,v,of]}var +gI=T(cg),cK=0;for(;;){aV(gI,cK,f2(b5(cK)));var +yn=cK+1|0;if(cd!==cK){var +cK=yn;continue}dh(gI);var +dA=dl([0,fT]),gJ=function(a){var +b=gc(a[1]);a[1][2]=0;var c=u(b);if(0===c)return 0;if(1===c){var -d=a[2];a[2]=[0,[0,p(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},nX=dq(dp(10)),ey=n,ez=i0,n3=function(b){var -f=u(b),C=[0,1];function +d=a[2];a[2]=[0,[0,p(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},oj=dx(dw(10)),eK=n,eL=jh,op=function(b){var +f=u(b),D=[0,1];function G(g){var -d=es(0),a=g;for(;;){if(f<=a)bt(n1);if(93===p(b,a)&&g>>0)if(9<=s)var -j=[0,[9,k+dE|0],g+1|0];else +j=[0,[9,k+dN|0],g+1|0];else l=1;else if(s)l=2;else{var -I=C[1];C[1]++;var -u=D(g+1|0),o=u[2],A=0,J=u[1];if((o+1|0)>>0))switch(b){case +e=k(i),f=e[2],h=e[1],d=0;if(cf<=b){if(bI===b)d=1}else +if(dY<=b)d=1;return d?l(h,g(a[29],f,b)):l(g(c[42],h,b),f)}return[0,c,a,m,u,o,w,x,y,n,i,h,B,D,E,F,G,H,I,z,A,J,L,M,dB,eM,a2,R,S,T,U,V,O,N,Q,P,t,d,j,[0,e,ac,ad,q,af,ae,a2,p,W,X,Y,Z,_,$,aa,ab,ah,ai,ag,aj,ak,al,am],s,ao,ap,an,aq,function(i,b){var +e=k(i),f=e[2],h=e[1],d=0;if(cf<=b){if(bI===b)d=1}else +if(dY<=b)d=1;return d?l(h,g(a[30],f,b)):l(g(c[43],h,b),f)}]},g6=function(a){return g5(aA,a)}(o5),qL=g6[1],qM=g6[2];(function(a){return g4(qL,a)}(qM));var +qN=function(a){return g5(aA,a)}(gR)[1];(function(a){return g4(qN,a)}(gR));op(qO);var +qQ=[D,qP,ah(0)];zA(0);eA(qR,qQ);var +as=aq(0),cb=aq(1),qS=aq(-1),g7=function(a){return b3(0,a,0,u(a))},qT=function(b,a){return b3(b,a,0,u(a))},eX=function(a){if(typeof +a==="number")return a;var +d=fW(a);if(63>>0))switch(b){case 0:return 2;case -1:break;default:return 1}return 3}return a[1]===as?0:4},qx=function(a){return[0,c7(a[1]),a[2]]},eM=function(b,a){if(b[2]!==as&&a[2]!==as)return cD(bO(b[1],a[1]),bO(b[2],a[2]));return[0,aA(ba(ck(b[1]),ck(a[1]))),as]},eN=function(a){switch(a){case +1:break;default:return 1}return 3}return a[1]===as?0:4},qV=function(a){return[0,da(a[1]),a[2]]},e0=function(b,a){if(b[2]!==as&&a[2]!==as)return cJ(bS(b[1],a[1]),bS(b[2],a[2]));return[0,aq(bb(bc(b[1]),bc(a[1]))),as]},e1=function(a){switch(a){case 0:return 2;case 1:return 8;case -2:return 10;default:return 16}},eO=function(f,e,d,c){var +2:return 10;default:return 16}},e2=function(f,e,d,c){var a=e;for(;;){if(d<=a)return 0;if(b(c,p(f,a)))return[0,a];var -a=a+1|0;continue}},qz=function(a){if(V(a,qA)){if(V(a,qB)){if(!V(a,qC))return gV;if(V(a,qD)){if(V(a,qE))try{var -l=fU(a,47),$=bW(0,a,l+1|0,(u(a)-l|0)-1|0),aa=gS(bW(0,a,0,l),$);return aa}catch(l){l=e(l);if(l===am){var +a=a+1|0;continue}},qX=function(a){if(W(a,qY)){if(W(a,qZ)){if(!W(a,q0))return g$;if(W(a,q1)){if(W(a,q2))try{var +l=f$(a,47),$=b3(0,a,l+1|0,(u(a)-l|0)-1|0),aa=g8(b3(0,a,0,l),$);return aa}catch(l){l=d(l);if(l===an){var j=u(a),A=0;if(j<1)var t=[0,0,A];else{var -P=p(a,0)+iD|0,S=0;if(!(2

>>0)){var +P=p(a,0)+iW|0,S=0;if(!(2

>>0)){var T=0;switch(P){case 0:var R=[0,0,1];break;case @@ -3323,7 +3330,7 @@ w=[0,2,c];else{var _=p(a,c),h=p(a,c+1|0),s=0;if(48===_){var i=0;if(89<=h){if(98===h)i=2;else if(111===h)i=1;else -if(dD!==h){s=1;i=3}}else +if(dM!==h){s=1;i=3}}else if(66===h)i=2;else if(79===h)i=1;else if(!(88<=h)){s=1;i=3}switch(i){case @@ -3336,173 +3343,174 @@ r=[0,0,c+2|0]}}else s=1;if(s)var r=[0,2,c];var w=r}var -d=w[2],b=w[1],U=2===b?function(a){if(69!==a&&dO!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&112!==a)return 0;return 1}:function(a){return 0},B=eO(a,d,j,U);if(B)var -C=B[1],D=C+1|0,f=C,E=zg(bW(10,a,D,j-D|0));else +e=w[2],b=w[1],U=2===b?function(a){if(69!==a&&dX!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&112!==a)return 0;return 1}:function(a){return 0},B=e2(a,e,j,U);if(B)var +C=B[1],D=C+1|0,f=C,E=db(b3(10,a,D,j-D|0));else var f=j,E=0;if(2<=b){var -F=eO(a,d,f,function(a){return 46===a?1:0});if(F){var +F=e2(a,e,f,function(a){return 46===a?1:0});if(F){var x=F[1];if(2===b)var -G=1;else{if(!(3<=b))throw[0,v,qG];var +G=1;else{if(!(3<=b))throw[0,v,q4];var G=4}var I=x+1|0,J=f-1|0,H=0;if(J if !Cli.trace_flag then ( match entry with - | VarDef -> + | VarDef _ -> Cli.log_print (Format.asprintf "%*s%a %a: %s" (!log_indent * 2) "" Print.format_log_entry entry Print.format_uid_list infos diff --git a/src/catala/dcalc/print.ml b/src/catala/dcalc/print.ml index 9b3f05db..0ad11025 100644 --- a/src/catala/dcalc/print.ml +++ b/src/catala/dcalc/print.ml @@ -129,7 +129,7 @@ let format_ternop (fmt : Format.formatter) (op : ternop Pos.marked) : unit = let format_log_entry (fmt : Format.formatter) (entry : log_entry) : unit = match entry with - | VarDef -> Format.fprintf fmt "%s" (Utils.Cli.print_with_style [ ANSITerminal.blue ] "≔ ") + | VarDef _ -> Format.fprintf fmt "%s" (Utils.Cli.print_with_style [ ANSITerminal.blue ] "≔ ") | BeginCall -> Format.fprintf fmt "%s" (Utils.Cli.print_with_style [ ANSITerminal.yellow ] "→ ") | EndCall -> Format.fprintf fmt "%s" (Utils.Cli.print_with_style [ ANSITerminal.yellow ] "← ") | PosRecordIfTrueBool -> diff --git a/src/catala/lcalc/to_ocaml.ml b/src/catala/lcalc/to_ocaml.ml index d3c5537e..ac05c07b 100644 --- a/src/catala/lcalc/to_ocaml.ml +++ b/src/catala/lcalc/to_ocaml.ml @@ -42,7 +42,7 @@ let format_op_kind (fmt : Format.formatter) (k : Dcalc.Ast.op_kind) = let format_log_entry (fmt : Format.formatter) (entry : Dcalc.Ast.log_entry) : unit = match entry with - | VarDef -> Format.fprintf fmt ":=" + | VarDef _ -> Format.fprintf fmt ":=" | BeginCall -> Format.fprintf fmt "→ " | EndCall -> Format.fprintf fmt "%s" "← " | PosRecordIfTrueBool -> Format.fprintf fmt "☛ " @@ -309,10 +309,19 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp (op, Pos.no_pos) format_with_parens arg2 | EApp ((EApp ((EOp (Unop (D.Log (D.BeginCall, info))), _), [ f ]), _), [ arg ]) when !Cli.trace_flag -> - Format.fprintf fmt "(log_begin_call@ %a@ %a@ unembeddable@ %a)" format_uid_list info - format_with_parens f format_with_parens arg - | EApp ((EOp (Unop (D.Log (D.VarDef, info))), _), [ arg1 ]) when !Cli.trace_flag -> - Format.fprintf fmt "(log_variable_definition@ %a@ unembeddable@ %a)" format_uid_list info + Format.fprintf fmt "(log_begin_call@ %a@ %a@ %a)" format_uid_list info format_with_parens f + format_with_parens arg + | EApp ((EOp (Unop (D.Log (D.VarDef tau, info))), _), [ arg1 ]) when !Cli.trace_flag -> + Format.fprintf fmt "(log_variable_definition@ %a@ %s@ %a)" format_uid_list info + (match tau with + | D.TLit D.TUnit -> "embed_unit" + | D.TLit D.TBool -> "embed_bool" + | D.TLit D.TInt -> "embed_integer" + | D.TLit D.TRat -> "embed_decimal" + | D.TLit D.TMoney -> "embed_money" + | D.TLit D.TDate -> "embed_date" + | D.TLit D.TDuration -> "embed_duration" + | _ -> "unembeddable") format_with_parens arg1 | EApp ((EOp (Unop (D.Log (D.PosRecordIfTrueBool, _))), pos), [ arg1 ]) when !Cli.trace_flag -> Format.fprintf fmt @@ -322,8 +331,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp (Pos.get_end_line pos) (Pos.get_end_column pos) format_string_list (Pos.get_law_info pos) format_with_parens arg1 | EApp ((EOp (Unop (D.Log (D.EndCall, info))), _), [ arg1 ]) when !Cli.trace_flag -> - Format.fprintf fmt "(log_end_call@ %a@ unembeddable@ %a)" format_uid_list info - format_with_parens arg1 + Format.fprintf fmt "(log_end_call@ %a@ %a)" format_uid_list info format_with_parens arg1 | EApp ((EOp (Unop (D.Log _)), _), [ arg1 ]) -> Format.fprintf fmt "%a" format_with_parens arg1 | EApp ((EOp (Unop op), _), [ arg1 ]) -> Format.fprintf fmt "@[%a@ %a@]" format_unop (op, Pos.no_pos) format_with_parens arg1 diff --git a/src/catala/runtime.ml b/src/catala/runtime.ml index 47ae6375..e18deff6 100644 --- a/src/catala/runtime.ml +++ b/src/catala/runtime.ml @@ -35,6 +35,8 @@ exception UncomparableDurations exception ImpossibleDate type runtime_value = + | Unit + | Bool of bool | Money of money | Integer of integer | Decimal of decimal @@ -46,6 +48,20 @@ type runtime_value = let unembeddable _ = Unembeddable +let embed_unit () = Unit + +let embed_bool x = Bool x + +let embed_money x = Money x + +let embed_integer x = Integer x + +let embed_decimal x = Decimal x + +let embed_date x = Date x + +let embed_duration x = Duration x + type source_position = { filename : string; start_line : int; @@ -56,8 +72,8 @@ type source_position = { } type event = - | BeginCall of string list * runtime_value - | EndCall of string list * runtime_value + | BeginCall of string list + | EndCall of string list | VariableDefinition of string list * runtime_value | DecisionTaken of source_position @@ -65,18 +81,18 @@ let log_ref : event list ref = ref [] let reset_log () = log_ref := [] -let retrieve_log () = !log_ref +let retrieve_log () = List.rev !log_ref -let log_begin_call info f _embed x = - log_ref := BeginCall (info, Unembeddable) :: !log_ref; +let log_begin_call info f x = + log_ref := BeginCall info :: !log_ref; f x -let log_end_call info _embed x = - log_ref := EndCall (info, Unembeddable) :: !log_ref; +let log_end_call info x = + log_ref := EndCall info :: !log_ref; x -let log_variable_definition (info : string list) _embed (x : 'a) = - log_ref := VariableDefinition (info, Unembeddable) :: !log_ref; +let log_variable_definition (info : string list) embed (x : 'a) = + log_ref := VariableDefinition (info, embed x) :: !log_ref; x let log_decision_taken pos x = diff --git a/src/catala/runtime.mli b/src/catala/runtime.mli index 3d9ad207..15b3fe4e 100644 --- a/src/catala/runtime.mli +++ b/src/catala/runtime.mli @@ -41,6 +41,8 @@ exception NoValueProvided (** {1 Value Embedding} *) type runtime_value = + | Unit + | Bool of bool | Money of money | Integer of integer | Decimal of decimal @@ -52,6 +54,20 @@ type runtime_value = val unembeddable : 'a -> runtime_value +val embed_unit : unit -> runtime_value + +val embed_bool : bool -> runtime_value + +val embed_money : money -> runtime_value + +val embed_integer : integer -> runtime_value + +val embed_decimal : decimal -> runtime_value + +val embed_date : date -> runtime_value + +val embed_duration : duration -> runtime_value + (** {1 Logging} *) type source_position = { @@ -64,8 +80,8 @@ type source_position = { } type event = - | BeginCall of string list * runtime_value - | EndCall of string list * runtime_value + | BeginCall of string list + | EndCall of string list | VariableDefinition of string list * runtime_value | DecisionTaken of source_position @@ -73,9 +89,9 @@ val reset_log : unit -> unit val retrieve_log : unit -> event list -val log_begin_call : string list -> ('a -> 'b) -> ('a -> runtime_value) -> 'a -> 'b +val log_begin_call : string list -> ('a -> 'b) -> 'a -> 'b -val log_end_call : string list -> ('a -> runtime_value) -> 'a -> 'a +val log_end_call : string list -> 'a -> 'a val log_variable_definition : string list -> ('a -> runtime_value) -> 'a -> 'a diff --git a/src/catala/scopelang/scope_to_dcalc.ml b/src/catala/scopelang/scope_to_dcalc.ml index af900fd0..d8104164 100644 --- a/src/catala/scopelang/scope_to_dcalc.ml +++ b/src/catala/scopelang/scope_to_dcalc.ml @@ -215,7 +215,7 @@ let rec translate_expr (ctx : ctx) (e : Ast.expr Pos.marked) : Dcalc.Ast.expr Po match (Pos.unmark e1, new_args) with | ELocation l, [ new_arg ] -> [ - tag_with_log_entry new_arg Dcalc.Ast.VarDef + tag_with_log_entry new_arg (Dcalc.Ast.VarDef Dcalc.Ast.TAny) (markings l @ [ Pos.same_pos_as "input" e ]); ] | _ -> new_args @@ -229,7 +229,7 @@ let rec translate_expr (ctx : ctx) (e : Ast.expr Pos.marked) : Dcalc.Ast.expr Po match Pos.unmark e1 with | ELocation l -> tag_with_log_entry - (tag_with_log_entry new_e Dcalc.Ast.VarDef + (tag_with_log_entry new_e (Dcalc.Ast.VarDef Dcalc.Ast.TAny) (markings l @ [ Pos.same_pos_as "output" e ])) Dcalc.Ast.EndCall (markings l) | _ -> new_e @@ -313,7 +313,9 @@ let rec translate_rule (ctx : ctx) (rule : Ast.rule) (rest : Ast.rule list) (merge_defaults a_expr new_e) in let merged_expr = - tag_with_log_entry merged_expr Dcalc.Ast.VarDef [ (sigma_name, pos_sigma); a_name ] + tag_with_log_entry merged_expr + (Dcalc.Ast.VarDef (Pos.unmark tau)) + [ (sigma_name, pos_sigma); a_name ] in let next_e = Dcalc.Ast.make_let_in a_var tau merged_expr next_e in @@ -356,7 +358,8 @@ let rec translate_rule (ctx : ctx) (rule : Ast.rule) (rest : Ast.rule list) (Pos.get_position e) in let new_e = - tag_with_log_entry (translate_expr ctx e) Dcalc.Ast.VarDef + tag_with_log_entry (translate_expr ctx e) + (Dcalc.Ast.VarDef (Pos.unmark tau)) [ (sigma_name, pos_sigma); a_name ] in let silent_var = Dcalc.Ast.Var.make ("_", Pos.no_pos) in diff --git a/src/french_law/api_web.ml b/src/french_law/api_web.ml index 22a11369..9d8a8bf0 100644 --- a/src/french_law/api_web.ml +++ b/src/french_law/api_web.ml @@ -83,125 +83,152 @@ class type log_event = method loggedValue : Js.Unsafe.any Js.prop end +let embed_to_js (v : runtime_value) : Js.Unsafe.any = + match v with + | Unit -> Js.Unsafe.inject Js.null + | Bool b -> Js.Unsafe.inject (Js.bool b) + | Integer i -> Js.Unsafe.inject (integer_to_int i) + | Decimal d -> Js.Unsafe.inject (decimal_to_float d) + | Money m -> Js.Unsafe.inject (money_to_float m) + | Date d -> + let date = new%js Js.date_now in + ignore (date##setUTCFullYear (integer_to_int @@ year_of_date d)); + ignore (date##setUTCMonth (integer_to_int @@ month_number_of_date d)); + ignore (date##setUTCDate (integer_to_int @@ day_of_month_of_date d)); + ignore (date##setUTCHours 0); + ignore (date##setUTCMinutes 0); + ignore (date##setUTCSeconds 0); + ignore (date##setUTCMilliseconds 0); + Js.Unsafe.inject date + | Duration d -> + let days, months, years = duration_to_days_months_years d in + Js.Unsafe.inject (Js.string (Printf.sprintf "%dD%dM%dY" days months years)) + | Struct _ -> Js.Unsafe.inject Js.null + | Enum _ -> Js.Unsafe.inject Js.null + | Unembeddable -> Js.Unsafe.inject Js.null + let _ = Js.export_all (object%js - method resetLog () : unit = reset_log () + method resetLog : (unit -> unit) Js.callback = Js.wrap_callback reset_log - method retrieveLog () : log_event Js.t Js.js_array Js.t = - Js.array - (Array.of_list - (List.map - (fun evt -> - object%js - val mutable eventType = - Js.string - (match evt with - | BeginCall _ -> "Begin call" - | EndCall _ -> "End call" - | VariableDefinition _ -> "Variable definition" - | DecisionTaken _ -> "Decision taken") + method retrieveLog : (unit -> log_event Js.t Js.js_array Js.t) Js.callback = + Js.wrap_callback (fun () -> + Js.array + (Array.of_list + (List.map + (fun evt -> + object%js + val mutable eventType = + Js.string + (match evt with + | BeginCall _ -> "Begin call" + | EndCall _ -> "End call" + | VariableDefinition _ -> "Variable definition" + | DecisionTaken _ -> "Decision taken") - val mutable information = - Js.array - (Array.of_list - (match evt with - | BeginCall (info, _) | EndCall (info, _) | VariableDefinition (info, _) - -> - List.map Js.string info - | DecisionTaken _ -> [])) + val mutable information = + Js.array + (Array.of_list + (match evt with + | BeginCall info | EndCall info | VariableDefinition (info, _) -> + List.map Js.string info + | DecisionTaken _ -> [])) - val mutable loggedValue = - match evt with - | BeginCall (_, v) | EndCall (_, v) | VariableDefinition (_, v) -> - Js.Unsafe.inject v - | DecisionTaken _ -> Js.Unsafe.inject Js.undefined + val mutable loggedValue = + match evt with + | VariableDefinition (_, v) -> embed_to_js v + | EndCall _ | BeginCall _ | DecisionTaken _ -> + Js.Unsafe.inject Js.undefined - val mutable sourcePosition = - match evt with - | DecisionTaken pos -> - Js.def - (object%js - val mutable fileName = Js.string pos.filename + val mutable sourcePosition = + match evt with + | DecisionTaken pos -> + Js.def + (object%js + val mutable fileName = Js.string pos.filename - val mutable startLine = pos.start_line + val mutable startLine = pos.start_line - val mutable endLine = pos.end_line + val mutable endLine = pos.end_line - val mutable startColumn = pos.start_column + val mutable startColumn = pos.start_column - val mutable endColumn = pos.end_column + val mutable endColumn = pos.end_column - val mutable lawHeadings = - Js.array (Array.of_list (List.map Js.string pos.law_headings)) - end) - | _ -> Js.undefined - end) - (retrieve_log ()))) + val mutable lawHeadings = + Js.array (Array.of_list (List.map Js.string pos.law_headings)) + end) + | _ -> Js.undefined + end) + (retrieve_log ())))) - method computeAllocationsFamiliales (input : allocations_familiales_input Js.t) : float = - let result = - AF.interface_allocations_familiales - { - AF.personne_charge_effective_permanente_est_parent_in = - (fun _ -> Js.to_bool input##.personneQuiAssumeLaChargeEffectivePermanenteEstParent); - AF.personne_charge_effective_permanente_remplit_titre_I_in = - (fun _ -> - Js.to_bool - input##.personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale); - AF.date_courante_in = - (fun _ -> - date_of_numbers - input##.currentDate##getFullYear - input##.currentDate##getMonth - input##.currentDate##getDay); - AF.enfants_in = - (fun _ -> - Array.map - (fun (child : enfant_entree Js.t) -> - { - AF.d_a_deja_ouvert_droit_aux_allocations_familiales = - Js.to_bool child##.aDejaOuvertDroitAuxAllocationsFamiliales; - AF.d_identifiant = integer_of_int child##.id; - AF.d_date_de_naissance = - date_of_numbers - child##.dateNaissance##getFullYear - child##.dateNaissance##getMonth - child##.dateNaissance##getDay; - AF.d_prise_en_charge = - (match Js.to_string child##.priseEnCharge with - | "Effective et permanente" -> EffectiveEtPermanente () - | "Garde alternée, allocataire unique" -> - GardeAlterneeAllocataireUnique () - | "Garde alternée, partage des allocations" -> - GardeAlterneePartageAllocations () - | "Confié aux service sociaux, allocation versée à la famille" -> - ServicesSociauxAllocationVerseeALaFamille () - | "Confié aux service sociaux, allocation versée aux services sociaux" - -> - ServicesSociauxAllocationVerseeAuxServicesSociaux () - | _ -> failwith "Unknown prise en charge"); - AF.d_remuneration_mensuelle = - money_of_units_int child##.remunerationMensuelle; - }) - (Js.to_array input##.children)); - AF.enfants_a_charge_in = no_input; - AF.ressources_menage_in = (fun _ -> money_of_units_int input##.income); - AF.residence_in = - (fun _ -> - match Js.to_string input##.residence with - | "Métropole" -> AF.Metropole () - | "Guyane" -> AF.Guyane () - | "Guadeloupe" -> AF.Guadeloupe () - | "Martinique" -> AF.Martinique () - | "La Réunion" -> AF.LaReunion () - | "Saint Barthélemy" -> AF.SaintBarthelemy () - | "Saint Pierre et Miquelon" -> AF.SaintPierreEtMiquelon () - | "Saint Martin" -> AF.SaintMartin () - | "Mayotte" -> AF.Mayotte () - | _ -> failwith "unknown collectivite!"); - AF.montant_verse_in = no_input; - } - in - money_to_float result.AF.montant_verse_out + method computeAllocationsFamiliales + : (allocations_familiales_input Js.t -> float) Js.callback = + Js.wrap_callback (fun input -> + let result = + AF.interface_allocations_familiales + { + AF.personne_charge_effective_permanente_est_parent_in = + (fun _ -> + Js.to_bool input##.personneQuiAssumeLaChargeEffectivePermanenteEstParent); + AF.personne_charge_effective_permanente_remplit_titre_I_in = + (fun _ -> + Js.to_bool + input##.personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale); + AF.date_courante_in = + (fun _ -> + date_of_numbers + input##.currentDate##getUTCFullYear + input##.currentDate##getUTCMonth + input##.currentDate##getUTCDate); + AF.enfants_in = + (fun _ -> + Array.map + (fun (child : enfant_entree Js.t) -> + { + AF.d_a_deja_ouvert_droit_aux_allocations_familiales = + Js.to_bool child##.aDejaOuvertDroitAuxAllocationsFamiliales; + AF.d_identifiant = integer_of_int child##.id; + AF.d_date_de_naissance = + date_of_numbers + child##.dateNaissance##getUTCFullYear + child##.dateNaissance##getUTCMonth + child##.dateNaissance##getUTCDate; + AF.d_prise_en_charge = + (match Js.to_string child##.priseEnCharge with + | "Effective et permanente" -> EffectiveEtPermanente () + | "Garde alternée, allocataire unique" -> + GardeAlterneeAllocataireUnique () + | "Garde alternée, partage des allocations" -> + GardeAlterneePartageAllocations () + | "Confié aux service sociaux, allocation versée à la famille" -> + ServicesSociauxAllocationVerseeALaFamille () + | "Confié aux service sociaux, allocation versée aux services \ + sociaux" -> + ServicesSociauxAllocationVerseeAuxServicesSociaux () + | _ -> failwith "Unknown prise en charge"); + AF.d_remuneration_mensuelle = + money_of_units_int child##.remunerationMensuelle; + }) + (Js.to_array input##.children)); + AF.enfants_a_charge_in = no_input; + AF.ressources_menage_in = (fun _ -> money_of_units_int input##.income); + AF.residence_in = + (fun _ -> + match Js.to_string input##.residence with + | "Métropole" -> AF.Metropole () + | "Guyane" -> AF.Guyane () + | "Guadeloupe" -> AF.Guadeloupe () + | "Martinique" -> AF.Martinique () + | "La Réunion" -> AF.LaReunion () + | "Saint Barthélemy" -> AF.SaintBarthelemy () + | "Saint Pierre et Miquelon" -> AF.SaintPierreEtMiquelon () + | "Saint Martin" -> AF.SaintMartin () + | "Mayotte" -> AF.Mayotte () + | _ -> failwith "unknown collectivite!"); + AF.montant_verse_in = no_input; + } + in + money_to_float result.AF.montant_verse_out) end) diff --git a/src/french_law/law_source/allocations_familiales.ml b/src/french_law/law_source/allocations_familiales.ml index f804978e..3638ab8b 100644 --- a/src/french_law/law_source/allocations_familiales.ml +++ b/src/french_law/law_source/allocations_familiales.ml @@ -211,7 +211,7 @@ let smic (smic_in : smic_in) = let residence_ : unit -> collectivite = smic_in.residence_in in let brut_horaire_ : unit -> money = smic_in.brut_horaire_in in let date_courante_ : date = - log_variable_definition [ "Smic"; "date_courante" ] unembeddable + log_variable_definition [ "Smic"; "date_courante" ] embed_date (try date_courante_ () with EmptyError -> raise NoValueProvided) in let residence_ : collectivite = @@ -219,7 +219,7 @@ let smic (smic_in : smic_in) = (try residence_ () with EmptyError -> raise NoValueProvided) in let brut_horaire_ : money = - log_variable_definition [ "Smic"; "brut_horaire" ] unembeddable + log_variable_definition [ "Smic"; "brut_horaire" ] embed_money (try try brut_horaire_ () with EmptyError -> @@ -398,7 +398,7 @@ let allocation_familiales_avril2008 let age_minimum_alinea_1_l521_3_metropole_ : integer = log_variable_definition [ "AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3_métropole" ] - unembeddable + embed_integer (try try age_minimum_alinea_1_l521_3_metropole_ () with EmptyError -> integer_of_string "16" with EmptyError -> raise NoValueProvided) in @@ -457,14 +457,14 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i let age_l512_3_2_ : integer = log_variable_definition [ "PrestationsFamiliales"; "âge_l512_3_2" ] - unembeddable + embed_integer (try try age_l512_3_2_ () with EmptyError -> integer_of_string "20" with EmptyError -> raise NoValueProvided) in let date_courante_ : date = log_variable_definition [ "PrestationsFamiliales"; "date_courante" ] - unembeddable + embed_date (try date_courante_ () with EmptyError -> raise NoValueProvided) in let prestation_courante_ : element_prestations_familiales = @@ -482,7 +482,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i let base_mensuelle_ : money = log_variable_definition [ "PrestationsFamiliales"; "base_mensuelle" ] - unembeddable + embed_money (try try base_mensuelle_ () with EmptyError -> @@ -554,7 +554,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i fun (_ : unit) -> log_variable_definition [ "PrestationsFamiliales"; "smic.date_courante" ] - unembeddable date_courante_ + embed_date date_courante_ in let smic_dot_residence_ : unit -> collectivite = fun (_ : unit) -> @@ -563,10 +563,9 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i let result_ : smic_out = log_end_call [ "PrestationsFamiliales"; "smic"; "Smic" ] - unembeddable (log_begin_call [ "PrestationsFamiliales"; "smic"; "Smic" ] - smic unembeddable + smic { date_courante_in = smic_dot_date_courante_; residence_in = smic_dot_residence_; @@ -579,7 +578,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i let regime_outre_mer_l751_1_ : bool = log_variable_definition [ "PrestationsFamiliales"; "régime_outre_mer_l751_1" ] - unembeddable + embed_bool (try try regime_outre_mer_l751_1_ () with EmptyError -> ( @@ -614,7 +613,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i let plafond_l512_3_2_ : money = log_variable_definition [ "PrestationsFamiliales"; "plafond_l512_3_2" ] - unembeddable + embed_money (try try plafond_l512_3_2_ () with EmptyError -> ( @@ -887,21 +886,21 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let personne_charge_effective_permanente_est_parent_ : bool = log_variable_definition [ "AllocationsFamiliales"; "personne_charge_effective_permanente_est_parent" ] - unembeddable + embed_bool (try try personne_charge_effective_permanente_est_parent_ () with EmptyError -> false with EmptyError -> raise NoValueProvided) in let personne_charge_effective_permanente_remplit_titre__i_ : bool = log_variable_definition [ "AllocationsFamiliales"; "personne_charge_effective_permanente_remplit_titre_I" ] - unembeddable + embed_bool (try try personne_charge_effective_permanente_remplit_titre__i_ () with EmptyError -> false with EmptyError -> raise NoValueProvided) in let ressources_menage_ : money = log_variable_definition [ "AllocationsFamiliales"; "ressources_ménage" ] - unembeddable + embed_money (try ressources_menage_ () with EmptyError -> raise NoValueProvided) in let residence_ : collectivite = @@ -913,7 +912,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let date_courante_ : date = log_variable_definition [ "AllocationsFamiliales"; "date_courante" ] - unembeddable + embed_date (try date_courante_ () with EmptyError -> raise NoValueProvided) in let enfants_a_charge_ : enfant array = @@ -1249,7 +1248,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let nombre_enfants_l521_1_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_l521_1" ] - unembeddable + embed_integer (try try nombre_enfants_l521_1_ () with EmptyError -> integer_of_string "3" with EmptyError -> raise NoValueProvided) in @@ -1267,17 +1266,16 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let nombre_enfants_alinea_2_l521_3_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3" ] - unembeddable + embed_integer (try try nombre_enfants_alinea_2_l521_3_ () with EmptyError -> integer_of_string "3" with EmptyError -> raise NoValueProvided) in let result_ : allocation_familiales_avril2008_out = log_end_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] - unembeddable (log_begin_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] - allocation_familiales_avril2008 unembeddable + allocation_familiales_avril2008 { age_minimum_alinea_1_l521_3_metropole_in = (fun (_ : unit) -> raise EmptyError) }) in let version_avril_2008_dot_age_minimum_alinea_1_l521_3_metropole_ : integer = @@ -1287,7 +1285,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i fun (_ : unit) -> log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.date_courante" ] - unembeddable date_courante_ + embed_date date_courante_ in let prestations_familiales_dot_prestation_courante_ : unit -> element_prestations_familiales = fun (_ : unit) -> @@ -1304,10 +1302,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let result_ : prestations_familiales_out = log_end_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] - unembeddable (log_begin_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] - prestations_familiales unembeddable + prestations_familiales { droit_ouvert_in = (fun (_ : unit) -> raise EmptyError); conditions_hors_age_in = (fun (_ : unit) -> raise EmptyError); @@ -1344,10 +1341,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let result_ : enfant_le_plus_age_out = log_end_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] - unembeddable (log_begin_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] - enfant_le_plus_age unembeddable + enfant_le_plus_age { enfants_in = enfant_le_plus_age_dot_enfants_; le_plus_age_in = (fun (_ : unit) -> raise EmptyError); @@ -1402,13 +1398,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (fun (enfant_ : _) -> log_end_call [ "PrestationsFamiliales"; "droit_ouvert" ] - unembeddable (log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert"; "output" ] unembeddable (log_begin_call [ "PrestationsFamiliales"; "droit_ouvert" ] - prestations_familiales_dot_droit_ouvert_ unembeddable + prestations_familiales_dot_droit_ouvert_ (log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] unembeddable enfant_)))) @@ -1458,7 +1453,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i then log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3_outre_mer" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; @@ -1468,7 +1462,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3_outre_mer" ] - age_minimum_alinea_1_l521_3_outre_mer_ unembeddable + age_minimum_alinea_1_l521_3_outre_mer_ (log_variable_definition [ "AllocationsFamiliales"; @@ -1480,7 +1474,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i with EmptyError -> log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3_métropole" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; @@ -1490,7 +1483,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3_métropole" ] - age_minimum_alinea_1_l521_3_metropole_ unembeddable + age_minimum_alinea_1_l521_3_metropole_ (log_variable_definition [ "AllocationsFamiliales"; @@ -1504,7 +1497,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let plafond__i_i_d521_3_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_II_d521_3" ] - unembeddable + embed_money (try try plafond__i_i_d521_3_ () with EmptyError -> @@ -1596,7 +1589,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let plafond__i_d521_3_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_I_d521_3" ] - unembeddable + embed_money (try try plafond__i_d521_3_ () with EmptyError -> @@ -1688,7 +1681,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let droit_ouvert_complement_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_complément" ] - unembeddable + embed_bool (try try droit_ouvert_complement_ () with EmptyError -> ( @@ -1782,13 +1775,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i && param_.a_deja_ouvert_droit_aux_allocations_familiales && log_end_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] - unembeddable (log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge"; "output" ] unembeddable (log_begin_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] - prestations_familiales_dot_conditions_hors_age_ unembeddable + prestations_familiales_dot_conditions_hors_age_ (log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge"; "input" ] unembeddable param_)))) @@ -1801,7 +1793,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let nombre_total_enfants_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_total_enfants" ] - unembeddable + embed_decimal (try try nombre_total_enfants_ () with EmptyError -> @@ -1811,7 +1803,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let nombre_moyen_enfants_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_moyen_enfants" ] - unembeddable + embed_decimal (try try nombre_moyen_enfants_ () with EmptyError -> @@ -1822,13 +1814,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i match log_end_call [ "AllocationsFamiliales"; "prise_en_compte" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_ unembeddable + prise_en_compte_ (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] unembeddable enfant_))) @@ -1842,7 +1833,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let droit_ouvert_base_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_base" ] - unembeddable + embed_bool (try try droit_ouvert_base_ () with EmptyError -> ( @@ -1932,7 +1923,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i && param_.age >=! log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; @@ -1942,7 +1932,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_ unembeddable + age_minimum_alinea_1_l521_3_ (log_variable_definition [ "AllocationsFamiliales"; @@ -1974,13 +1964,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i ((not (log_end_call [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - est_enfant_le_plus_age_ unembeddable + est_enfant_le_plus_age_ (log_variable_definition [ "AllocationsFamiliales"; @@ -1991,7 +1980,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i && param_.age >=! log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; @@ -2001,7 +1989,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_ unembeddable + age_minimum_alinea_1_l521_3_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2104,7 +2092,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_initial_base_troisieme_enfant_et_plus_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_et_plus" ] - unembeddable + embed_money (try try montant_initial_base_troisieme_enfant_et_plus_ () with EmptyError -> @@ -2219,7 +2207,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_initial_base_deuxieme_enfant_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant" ] - unembeddable + embed_money (try try montant_initial_base_deuxieme_enfant_ () with EmptyError -> @@ -2322,7 +2310,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_initial_base_premier_enfant_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant" ] - unembeddable + embed_money (try try montant_initial_base_premier_enfant_ () with EmptyError -> @@ -2442,7 +2430,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_forfaitaire_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire" ] - unembeddable + embed_money (try try montant_verse_forfaitaire_ () with EmptyError -> @@ -2475,7 +2463,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i if log_end_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output"; @@ -2483,7 +2470,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_ unembeddable + droit_ouvert_forfaitaire_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2523,7 +2510,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i if log_end_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output"; @@ -2531,7 +2517,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_ unembeddable + droit_ouvert_forfaitaire_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2570,7 +2556,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i if log_end_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output"; @@ -2578,7 +2563,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_ unembeddable + droit_ouvert_forfaitaire_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2608,7 +2593,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let rapport_enfants_total_moyen_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "rapport_enfants_total_moyen" ] - unembeddable + embed_decimal (try try rapport_enfants_total_moyen_ () with EmptyError -> @@ -2641,13 +2626,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (not (log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ unembeddable + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2678,13 +2662,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (ressources_menage_ >$ plafond__i_i_d521_3_ && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ unembeddable + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; @@ -2714,13 +2697,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i && ressources_menage_ <=$ plafond__i_i_d521_3_) && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ unembeddable + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; @@ -2749,13 +2731,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (ressources_menage_ <=$ plafond__i_d521_3_ && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ unembeddable + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; @@ -2782,7 +2763,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_initial_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base" ] - unembeddable + embed_money (try try montant_initial_base_ () with EmptyError -> ( @@ -2816,20 +2797,19 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_complement_pour_forfaitaire_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire" ] - unembeddable + embed_money (try try montant_verse_complement_pour_forfaitaire_ () with EmptyError -> if droit_ouvert_complement_ then log_end_call [ "AllocationsFamiliales"; "complément_dégressif" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "complément_dégressif" ] - complement_degressif_ unembeddable + complement_degressif_ (log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] unembeddable montant_verse_forfaitaire_))) @@ -2865,13 +2845,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i } (log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ unembeddable + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] unembeddable param_))) @@ -2887,13 +2866,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i with EmptyError -> log_end_call [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_métropole_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - montant_initial_metropole_majoration_ unembeddable + montant_initial_metropole_majoration_ (log_variable_definition [ "AllocationsFamiliales"; @@ -2907,7 +2885,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_avec_garde_alternee_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ] - unembeddable + embed_money (try try montant_avec_garde_alternee_base_ () with EmptyError -> montant_initial_base_ *$ rapport_enfants_total_moyen_ @@ -2924,13 +2902,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i try log_end_call [ "AllocationsFamiliales"; "montant_initial_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_majoration"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_initial_majoration" ] - montant_initial_majoration_ unembeddable + montant_initial_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] unembeddable param_))) @@ -2938,13 +2915,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i match log_end_call [ "AllocationsFamiliales"; "prise_en_compte" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_ unembeddable + prise_en_compte_ (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] unembeddable param_))) @@ -2958,7 +2934,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_base" ] - unembeddable + embed_money (try try montant_verse_base_ () with EmptyError -> @@ -2969,7 +2945,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_majoration" ] - unembeddable + embed_money (try try montant_verse_majoration_ () with EmptyError -> @@ -2979,7 +2955,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i acc_ +$ log_end_call [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; @@ -2989,7 +2964,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - montant_avec_garde_alternee_majoration_ unembeddable + montant_avec_garde_alternee_majoration_ (log_variable_definition [ "AllocationsFamiliales"; @@ -3004,7 +2979,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_base_complement_pour_base_et_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_base_complément_pour_base_et_majoration" ] - unembeddable + embed_money (try try montant_base_complement_pour_base_et_majoration_ () with EmptyError -> montant_verse_base_ +$ montant_verse_majoration_ @@ -3013,20 +2988,19 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_complement_pour_base_et_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_base_et_majoration" ] - unembeddable + embed_money (try try montant_verse_complement_pour_base_et_majoration_ () with EmptyError -> if droit_ouvert_complement_ then log_end_call [ "AllocationsFamiliales"; "complément_dégressif" ] - unembeddable (log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] unembeddable (log_begin_call [ "AllocationsFamiliales"; "complément_dégressif" ] - complement_degressif_ unembeddable + complement_degressif_ (log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] unembeddable montant_base_complement_pour_base_et_majoration_))) @@ -3036,7 +3010,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let montant_verse_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé" ] - unembeddable + embed_money (try try montant_verse_ () with EmptyError -> @@ -3127,7 +3101,7 @@ let interface_allocations_familiales let date_courante_ : date = log_variable_definition [ "InterfaceAllocationsFamiliales"; "date_courante" ] - unembeddable + embed_date (try date_courante_ () with EmptyError -> raise NoValueProvided) in let enfants_ : enfant_entree array = @@ -3139,7 +3113,7 @@ let interface_allocations_familiales let ressources_menage_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "ressources_ménage" ] - unembeddable + embed_money (try ressources_menage_ () with EmptyError -> raise NoValueProvided) in let residence_ : collectivite = @@ -3151,14 +3125,14 @@ let interface_allocations_familiales let personne_charge_effective_permanente_est_parent_ : bool = log_variable_definition [ "InterfaceAllocationsFamiliales"; "personne_charge_effective_permanente_est_parent" ] - unembeddable + embed_bool (try try personne_charge_effective_permanente_est_parent_ () with EmptyError -> false with EmptyError -> raise NoValueProvided) in let personne_charge_effective_permanente_remplit_titre__i_ : bool = log_variable_definition [ "InterfaceAllocationsFamiliales"; "personne_charge_effective_permanente_remplit_titre_I" ] - unembeddable + embed_bool (try try personne_charge_effective_permanente_remplit_titre__i_ () with EmptyError -> false with EmptyError -> raise NoValueProvided) in @@ -3199,7 +3173,7 @@ let interface_allocations_familiales "InterfaceAllocationsFamiliales"; "allocations_familiales.personne_charge_effective_permanente_est_parent"; ] - unembeddable + embed_bool (try if log_decision_taken @@ -3224,7 +3198,7 @@ let interface_allocations_familiales "InterfaceAllocationsFamiliales"; "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"; ] - unembeddable + embed_bool (try if log_decision_taken @@ -3245,7 +3219,7 @@ let interface_allocations_familiales fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.ressources_ménage" ] - unembeddable ressources_menage_ + embed_money ressources_menage_ in let allocations_familiales_dot_residence_ : unit -> collectivite = fun (_ : unit) -> @@ -3257,7 +3231,7 @@ let interface_allocations_familiales fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.date_courante" ] - unembeddable date_courante_ + embed_date date_courante_ in let allocations_familiales_dot_enfants_a_charge_ : unit -> enfant array = fun (_ : unit) -> @@ -3268,10 +3242,9 @@ let interface_allocations_familiales let result_ : allocations_familiales_out = log_end_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] - unembeddable (log_begin_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] - allocations_familiales unembeddable + allocations_familiales { personne_charge_effective_permanente_est_parent_in = allocations_familiales_dot_personne_charge_effective_permanente_est_parent_; @@ -3423,7 +3396,7 @@ let interface_allocations_familiales let montant_verse_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "montant_versé" ] - unembeddable + embed_money (try try montant_verse_ () with EmptyError -> allocations_familiales_dot_montant_verse_ with EmptyError -> raise NoValueProvided) in