@smartpy/timelock
Version:
Tezos Timelock
16 lines (14 loc) • 410 kB
JavaScript
var require$$0=require("crypto"),require$$1=require("fs"),require$$2=require("constants"),hacl=require("@smartpy/hacl-wasm");function _interopDefaultLegacy(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}function _interopNamespace(a){if(a&&a.__esModule)return a;var e=Object.create(null);return a&&Object.keys(a).forEach((function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:function(){return a[r]}})}})),e.default=a,Object.freeze(e)}var require$$0__default=_interopDefaultLegacy(require$$0),require$$1__default=_interopDefaultLegacy(require$$1),require$$2__default=_interopDefaultLegacy(require$$2),hacl__namespace=_interopNamespace(hacl);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __awaiter(a,e,r,t){return new(r||(r=Promise))((function(n,i){function o(a){try{c(t.next(a))}catch(a){i(a)}}function u(a){try{c(t.throw(a))}catch(a){i(a)}}function c(a){var e;a.done?n(a.value):(e=a.value,e instanceof r?e:new r((function(a){a(e)}))).then(o,u)}c((t=t.apply(a,e||[])).next())}))}function __generator(a,e){var r,t,n,i,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,t&&(n=2&i[0]?t.return:i[0]?t.throw||((n=t.return)&&n.call(t),0):t.next)&&!(n=n.call(t,i[1])).done)return n;switch(t=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,t=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){o.label=i[1];break}if(6===i[0]&&o.label<n[1]){o.label=n[1],n=i;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(i);break}n[2]&&o.ops.pop(),o.trys.pop();continue}i=e.call(a,o)}catch(a){i=[6,a],t=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var timelock_js_bc={};(function(exports){(function(aw){var pS=3603131,Di="@[(@[%a)@]@ %s@]",Tq=-178940859,Tr="Variable ",Cj="additionalItems",Ck="uniqueItems",Tn="Constructors do not match:",To=" =%a@;<1 2>%a",Tp="-D_FILE_OFFSET_BITS=64 -D_REENTRANT",Ci=192,Xl="A parameter has type",Dh="lor",et=123,Za=" doesn't.",Tm="pattern",bt=365180284,Xj="a list",Xk="!=.",Vk=":\n ",Y$="This class expression is not a class function, it cannot be applied",Ch="[]",Xh="None of the patterns in this 'match' expression match values.",Xi="A type parameter has type",Vj="This kind of expression is not allowed as right-hand side of `let rec'",es=255,Xf="Bytes",Xg="string.unsafe_get",Dg="title",BS="Unbound instance variable %s",Y_="String literal begins here",Tl=191,CI="always",u4=122,Tk="int_of_float",CH=" ->",u3=" (",Vh="The type parameter",Vi="This object is expected to have type",uM="constructor",Y7=181,Y8="record",Y9="In ",cE=128,ue="int",Tj="fd ",Ti=2571,Vf="<hov2>",pI="The module ",Xe="< ",jS=">",hj="typing/typeclass.ml",hm="float",Y6=1027,Ve="old",Xd="but is used here with type",CG="| ",Xc="caml_string_compare",eR=-1027682724,Xb="Int64",mk="Module ",Th="variant",Vd="it is mutable",Xa="Hint: The ",eQ="method",Tg="Their constraints differ.",W$="field_computed",uv="error",BR="of",uu="contains type variables that cannot be generalized",Vc="*.",jN=108,Y5="table",Va="(::)",Vb="<0>",Y4="<=.",CF="1",u2="e",pn="*extension*",Te="([^/]*)",a7="typing/ctype.ml",U$="minProperties",Df="Uint8",Tc="but on the right-hand side it has type",Y3=421,W_="funarg",uL="description",W9="external",Y2=": %s",Cg=-43,d5=332064784,Y1="found",u1="int32",uK="Float",CE="Out_of_memory",De=" ",BQ="(root-init)",W8="specialised",ut="$ref",W7="4",CD="index out of bounds",U9="minimum field required when exclusiveMinimum is true",U_="ocaml.unboxed",W6="maximum field required when exclusiveMaximum is true",W3="create_object_opt",W4="does not meet its constraint: it should be",W5="<hidden>",BP="))",Cf="Bool",W2="Unbound module %a",ud="this",cj="type",Ta="Their variances do not agree.",dz=980827423,S_="string.unsafe_get32",S$="This alias is bound to type",ip=65535,U8="This class should be virtual",S9="downto",W1="(# ",S8="imm",uc="layout",mq="module",S7=-911188600,WZ="Uninterpreted extension '",W0="Weak.set",Y0="!<=.",U7="The signature for this packaged module couldn't be inferred.",YZ="[float]",S5="ocaml.doc",YY="infinity",S4="parsing/location.ml",us=" .",WY="@[%s@ %a@ %s@]",YX="caml_string_notequal",pH=126,WX="bytes.unsafe_set",S3="int_of_hex_char",U6="arg",S2="ocaml.unrolled",U4="commuting this argument",U5=717,YW="immutable",WW="%identity",mj=124,aK="<1>",WV=282,S1="Their kinds differ.",YV="<here>",ub="*sth*",WU="/u",ua=252,BO="@}",u0="src/encoding.ml",be=".",uJ="A type parameter occurs several times",S0="<hov 2>",hg=" :",WT=240,cD="kind",t$="$",pz=110,SZ="isint",mi="max",WS="This module type is not a signature",YU="> ",py=-32,WR="bigarray.array1.set64",SY="It",U2=847,t_=" [",WQ="Invalid import of ",uI="multipleOf",pR="boolean",WP=" cannot become concrete",Dc="open",pG="unboxed",YT=605,SX="selfpat-*",YS="../",SW="bytes_of_string",BM="value",ev="%s",SV="bytes.get32",pm="has type",WO="to",Db="Assert_failure",WN="Some Fixed_private",uH="format",SU="&&",YQ="This object duplication occurs outside a method definition",uZ="typing/subst.ml",U0="opaque",U1="string.length",pl="null",WM="but an expression was expected of type",pQ="size",BL="additionalProperties",t9="The type ",ST="patternProperties",ur="but it was expected to have type",CC="module ",BK="lxor",WL="Command line: ",pP="lambda/translclass.ml",YP=1e14,t8='"',SS=819,mb=",",WK="ignore",CB=170,pF="<",SR=2048,UZ=" 2>",Da=">=",WJ="file",WI="JSON pointer w/o wildcards",UY="copy",d4=256,WH="%a(%a)",SQ=.012,UX="The constructor",BJ="integer",uq="The constructor ",YO="bigarray.array1.get32",SP="!>=.",UW="@[<v>%a%a@]",UV=127343600,it="is not compatible with type",dy="<hov1>",c6="The ",fs=331416730,SO="it is already bound to another variable",UU="@[<2>%a@ =@ %a@]",up=" None",WG=" was expected",YN="@[(# %a)@]",ac="<v>",UT="Invalid int",WF="bytes_to_string",mh="lsl",YM="set_var",US="the second",WE="session.",CA=15,UR="List too long",SN="data_kind",WD="ocaml.specialised",YL="get_meth",mp="lsr",UQ="bigarray.array1.unsafe_set32",eT=125,SM="cases",UO="int_as_pointer",UP="but was expected to be of type",C$="tailcall",YK=-32768,BI="Division_by_zero",Ce=-145160103,WC="In this definition, a type variable has a variance that",SL="==.",C_="String",UN="maxLength",Cd="but is used with type",UM="minLength",YJ="bytes.unsafe_get32",io=": ",C9="xor",WB="-.",WA="A class cannot be changed from virtual to concrete",iw="%d",UL="but a pattern was expected which matches values of type",l_="inline",YI="the signature of this functor application",Wz=795008922,SK="No case matched",l9="'",UK="buffer.ml",YG="<.",YH="Cygwin",SJ="This kind of recursive class expression is not allowed",Cc=" of",Wx=104,mg="<error>",Wy="@[<v>",SI=726666127,SH="Their internal representations differ:",bk="<hv>",YF="selfpat-",SG="This is a generative functor. It can only be applied to ()",Cz="Int",Cb="expects ",Wv=" virtual",Ww=102,UJ="Ancestor names can only be used to select inherited methods",UH="bytes.get",UI="revapply",Wt="The field ",Wu="/dev/null",YE="env_init",Ws="%reraise",pO="class type",SE=101,mf="min",Cy="@ %s",uF="noalloc",YD="Rabsent",SD="@[%s@ %s@ It",UG="src/binary_reader.ml",uE=" has type",hf=-783416531,uY="int64",gi="but is expected to have type",SC="This type",t7="val",BH=" >",Wr="Invalid syntax for sub-message of extension '",jU=1e7,BG="lib/core.ml",im=254,UF="Only type synonyms are allowed on the right of :=",d6=100,UE="%s %i-%i",Wq=" cannot be hidden",YC=851,Wp=" : flags Open_text and Open_binary are not compatible",uX="*",SB="ocaml.alert",UD="3",uC="<warning>",C8="module type ",YB="Invalid syntax for sub-message of extension '%s'.",SA="string.get",Sz=" when ",uo="properties",Yy="Int32",Yz="does not match that of type",YA="begin matrix\n",jW="deprecated",Wo="but is mixed here with fields of type",UC="These bindings have type",Sy="maxProperties",Wn="bytes.unsafe_get",Wm=-891636250,UB="field",Yx="declaration",UA="which is less general than",Yw="Unix.Unix_error",jR="instance variable",pw="propertyDependencies",Uy="bigarray.array1.get16",Uz="This variant or record definition",Ca="Stack_overflow",Cx="The type of this class,",C7="#modulepat",g="@ ",Yv="ptr",t6=-97,Sx=" ( ",Ux=253,t5=65599,Uw="it escapes its scope",C6="Not_found",BE="Parmatch.get_variant_constructors",Sw="Unbound module type ",Wl="bigarray.array1.unsafe_get32",Uv="as ",Wk="Format",Cw="does not match",BD="minItems",Wi="app_",Wj=" never_inline",Uu="anyOf",dk="lambda/translcore.ml",un="ocaml.inline",C5="./",Yu="ocaml.error",Ut=" has no valid type if ",Wg="http",Wh="float_of_int",Yt="External identifiers must be functions",Wf=141,gk="typing/btype.ml",Su="@?",Sv=1073741823,St="ocaml.specialise",pv="typing/includemod.ml",Us=1026,We="it cannot be closed",BC="typing/printtyp.ml",B$="fields",Ur="Json_encoding.construct: ",Ss="but is used as an instance of type",BB="%a@ %a",pt="?",pu="false",uW="Invalid integer: ",Ys="abs.",hi="string",B_=186,ma="mod",d3=128,a3=1e8,Wd=2593,uB="specialise",Wc="%f",Sr=":",Uq="String literal not terminated",Sq="typing/persistent_env.ml",Up="bytes.unsafe_set32",Sp="expected tailcall",Yq=493,uV="The types are not equal.",Yr="Map.disjoint_union ",So=-1008610421,pk="env",V$="bigarray.array1.get64",Wa="bytes.set",Yp="ocaml.warn_on_literal_pattern",cT="_",B9="compare: functional value",Sn=-128,BA="(heap-init)",ps="id",Uo=114,V_="regular",Bz="true",Yo="all",Sm="<loc>",V9="%ignore",Sk="new_variable",Sl=" always_specialise",pr="lambda/switch.ml",Un="Illegal recursive module reference",uU="A private type would be revealed.",Sj=" is too large for shifting.",B7=-764103652,B8="Invalid_argument",V8="this open statement shadows the ",t4="Map.bal",Si="@[",V7="functor (",Sh=1000000010,Um="%ni",Se="bigarray.array1.unsafe_set64",Sf=2505,t3="is not included in",Sg="ml_z_overflow",B6="mutable",Ym="bigarray.array1.unsafe_set16",C4="label",Sd=620821490,By=" type",pE="'.",Yl="The public method ",Yk=">.",pN=892015045,Uk="%raise",Yj="!<.",Uj=" is only present in ",b9="0",V6="Padding",jV=": at character number ",uA=" <",Cv="Sys_blocked_io",t2="The instance variable ",Sc="Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.",gf="invalid format ",uz="_none_",Yi="This constructor is not an extension constructor.",B=248,me="*predef*",Bx="@;",B5=867153157,Yh="its constructor has more than one argument",V5="The method ",fr=255,Ui="The operator %s has type",l8=926224370,Sb="This class type should be virtual",V4="{id=",pM="items",Sa=870035731,um="nativeint",C3="`%s",R$="but actually has type",Bw="definition",a2="<hov>",Yg="sig end",a1=246,V3="@[The type of this class,@ %a,@ contains type variables that cannot be generalized@]",R_="%u",fw="object",Uh="'*'",B4="Ill-formed list of alert settings",V2="The type variable ",t1="exclusiveMinimum",Bv="%S",Yf="ref",Ye="A type variable is unbound in this extension constructor",jQ=-784200974,Yd="Rpresent None",Yc=32767,C2="extension constructor",il=127,B3="tag",he=1024,R9="@{",R8=" : flags Open_rdonly and Open_wronly are not compatible",Ug="oneOf",V1="constraint ",V0=" always_inline",cC="-",gj="@ %a",R7="%makemutable",Uf=" len=",md="asr",C1="Change one of them.",pL=" and ",R5=216,R6=" : file already exists",gh=16777215,mn="self-",iv="::",Yb="bytes.set32",VZ="case",C0="Illegal permutation of runtime components in a module type.",eU="@;<1 -2>",R3="%raise_notrace",Ue="Recursive modules require an explicit module type.",t0="self",R2="bigarray.array1.set32",is="maximum",uy="ocaml.inlined",Ya="Unbound module type %a",iu="Type",Ud="CamlinternalFormatBasics",bK=57067359,Uc=244,VY="empty object",Ub="enum",CZ=2147483647,uT="in",Ua=", characters ",ag="lambda/matching.ml",X$="[| |]",R1="RangedFloat",VX=837,X9="hex conversion: invalid hex string",R0=12520,T$="%s%a",VW="Invalid float",Bu=-91,aF="typing/parmatch.ml",T9="schemaDependencies",T_=" are incompatible",VV="Size limit exceeded",X8="bigarray.array1.set16",T8="second",RZ="\nThe first one was selected. Please disambiguate if this is wrong.",T7="The record field ",VU="' '",tZ="Win32",VS="bool",mc=1e3,RY="default",T6=578,X7="Uninterpreted extension '%s'.",B2="type ",VQ="but is here used with type",VR="the first",l="",X6=224,dM=737456202,Ct="^",CY=" `",T5=" argument(s)",T4="string.unsafe_get16",ul=223,Bt=" *",l7=63,RX="field value",RW="setfield_",T3="Unbound module ",ik=672226188,Bs="Match_failure",X5="%C",X4=" (which is later used)",eS="+",ir="minimum",T2="@[<hv 2>type %t +=%s@;<1 2>%a@]",pD=" : ",B0="mod_unsafe",B1="Unbound instance variable ",X="@,",hh="param",X3="mutable ",Br="!=",VN="empty array",VO="Unreachable expression was reached",VP="%li",tY="They have different arities.",RV="ocaml.text",gg="array",VM="bytes.unsafe_get64",X2="This type constructor expands to type",BZ="Error",RU="The class type",T1=" )",BY=65536,X1="should be an instance of type",T0="Ref",X0="This comment contains an unterminated string literal",XZ="alert",RT="lazy",pq=")",TZ="let",RS="bytes.set16",TX="expected",TY="Syntax error: ",BX="nan",CX="#default",XY="untagged",TW="Expected declaration",uS=" out of range",RR="bytes.unsafe_set16",XX="0123456789abcdef",RQ=224,TV="The operator ",XW=57343,tX="exclusiveMaximum",bA="/",VL=" is not mutable",RO=", which is missing",hc="#",XV="'#'",VJ="globalThis.exports = globalThis.exports || {}",VK="bigarray.array1.unsafe_get64",mm=1073741823,cA=250,l$="number",aS="@;<1 2>",Cs="(%a)",RL="without label",RM="versions",XU="Zero_width",RJ="+.",RK=" argument(s),",Bo="required",Bp="@[%a@ %s@]",VI="inlined(unboxed)",Cr="precision",RI="RangedInt",RH="unrolled",Bn="land",TU=" not found.",Cq=1255,dj=255,ml="#row",RG="Primitive ",Cp="jsError",fv=32768,tW=407121086,RF="virtual ",XT="typing/path.ml",CW="%t",RE="unboxed]/[",ux="//",uR="This expression has type",CV="|",BW="End_of_file",TT=852405675,d2="<hv 1>",VH="Cannot merge two ",XS="allOf",jP="..",BV="Failure",RD="Array too long",CU="local",RC="constructor ",az="typing/typecore.ml",TS="with",pC="*opt*",VG="Found",RB="string.get32",TR=453,tV="exn",CT=247,Rz="bytes.get16",RA="@;<1 -1>",XR=" have different names, ",Ry="~",TP="type, type array or operator",TQ="@[%s@ %a@]",Rx="Internal path",eP=980827863,VF="Enum",TN=56320,fu=-48,ha="and",hb=815034505,XP="but bindings were expected of type",ij="typing/typetexp.ml",bZ="camlinternalFormat.ml",XO="Modules are not allowed in this pattern.",bB="<hv 2>",CS="Sys_error",Rw="Cstruct.blit_from_string src=",TM="The type constructor",bf=332360020,XN="Value declarations are only allowed in signatures",VD="Some Rigid",CR="warning",uk="module type",VC="Subst.modtype_path",XM=" is never used to build values.\n(However, this constructor appears in patterns.)",XL="lambda/translprim.ml",Bm="toplevel",VB="envs",Rv=121,XK="This type cannot be unboxed because",BU="never",ft="None",hd="int_of_string",VA="Unix",XJ="/definitions/",TL=" 2>&1",pp="name",XH="A type variable is unbound in this type declaration",XI="Comment not terminated",Ru=120,Vz="Only variables are allowed as left-hand side of `let rec'",uQ=103,Co=512,XG="include",Rt="bytes.get64",TK="functor",XD=257,XE="dirapply",Rr="Variable",Rs=32752,Vx="!>.",Vy="typing/ident.ml",TJ="@[<hv 1>default:@ %a@]",po="or",XC="but is here applied to ",Vw="This `with' constraint on ",jT="utils/warnings.ml",CQ="Uint16",Bl="//toplevel//",Ro=-730718166,Rp="This pattern matches values of type",Rq=" +=",Bk="0x",uP="@]",Rn="Tnil",tU="\n",pB="Some",XA="Stdlib.",XB="Weak.create",uj="end",pK="not",Xz="%Li",Rm="string.get16",Xy=65535,Vv="The classes do not have the same number of type parameters",Xx="Dynamic",Vu="This type is recursive",TH="string.get64",ui=" private",Bj="is not compatible with:",BT="init_class",TG="[int]",CP="/%i",TF="Pkg",Vt="@[<1>[%a]@]@ ",a8="typing/env.ml",Xw="Did you try to redefine them?",Xv="||",TE="Within this type",jO="lambda/translmod.ml",uh="_z",Rk="Seq",pj="'+'",Rj="ocaml.tailcall",Xt="bytes.set64",Xu="Syntax error",TD=63,CO="obj_init",Bi="*match*",eu="typing/typemod.ml",eO=" =",tT="inlined",w="<2>",TC=" of ",TB="Re.repn",pA=",@ ",Cn="sig",CN="typing/typedecl_variance.ml",dL=", ",iq="%a",Vr="~.",Vs="extension_constructor",CM="<=",TA="static/",Tz=">=.",Cm="(module ",Ri="cannot be accessed from the definition of an instance variable",Vp="/.",Vq=" never_specialise",Rh="Some toplevel values still refer to",uO="<v 0>",Xs="isout",Vo="bytes.unsafe_set64",hl="class",Rf="self-*",Xr="bswap16",hk=870828711,Vn="string.unsafe_get64",pJ="...",Cl="maxItems",Ty=" dst=",Xq=251,Re="The tag ",CL="is not yet completely defined",Xp="first",bb=" ",CK="Undefined_recursive_module",Tx="<v 2>",Bh="==",Tw=884,Xo="send_",Rd=2508,Tv="@ | ",uw="the ",Rc="@[<1>{@[%a@ @]}@]",bz=-976970511,Xn="bigarray.array1.unsafe_get16",uN="Set.bal",ug="()",l6="v",Tu="@.",uf="%i",Vm="would escape its scope",Bg=-783416972,Xm="`",Tt="bytes.length",CJ="exception",er=919245630,Ts="default:",cB="typing/typedecl.ml",Vl="bytes.unsafe_get16";function bg(a,e){switch(6&a.t){default:if(e>=a.c.length)return 0;case 0:return a.c.charCodeAt(e);case 4:return a.c[e]}}function iy(a){var e=a.l,r=new Uint8Array(e),t=0;for(t=0;t<e;t++){var n=bg(a,t);r[t]=n}return r}function u6(a){if(aw.Uint8Array)var e=new aw.Uint8Array(a.l);else e=new Array(a.l);for(var r=a.c,t=r.length,n=0;n<t;n++)e[n]=r.charCodeAt(n);for(t=a.l;n<t;n++)e[n]=0;return a.c=e,a.t=4,e}function aV(a,e,r){if(r&=es,4!=a.t){if(e==a.c.length)return a.c+=String.fromCharCode(r),e+1==a.l&&(a.t=0),0;u6(a)}return a.c[e]=r,0}function bos(a,e,r){return aV(a,e,r)}function pU(a,e){return a.forEach((function(a,r){bos(e,r,a)})),0}function bne(a,e,r,t){var n=iy(a),i=iy(e);return pU(_HACL.Blake2.blake2b(r,i,n)[0],t),0}function bnf(a,e,r,t){var n=iy(e),i=iy(r),o=iy(t),u=_HACL.NaCl.secretbox_easy(n,i,o);return pU(u[1],a),0===u[0]}function bng(a,e,r,t){var n=iy(e),i=iy(r),o=iy(t),u=_HACL.NaCl.secretbox_open_easy(n,i,o);return pU(u[1],a),0===u[0]}function bnh(a){return("undefined"!=typeof self&&(self.crypto||self.msCrypto)?function(){var e=self.crypto||self.msCrypto,r=BY;return function(t){for(var n=new Uint8Array(t),i=0;i<t;i+=r)e.getRandomValues(n.subarray(i,i+Math.min(t-i,r)));return pU(n,a),!0}}:function(){return pU(require$$0__default.default.randomBytes(60),a),!0})()}function bni(a,e){var r=a.length,t=r+e.length-1,n=new Array(t);n[0]=0;for(var i=1,o=1;i<r;i++)n[i]=a[i];for(;i<t;i++,o++)n[i]=e[o];return n}function bnj(a,e,r,t,n){if(t<=e)for(var i=1;i<=n;i++)r[t+i]=a[e+i];else for(i=n;i>=1;i--)r[t+i]=a[e+i];return 0}function bnk(a,e,r,t){for(var n=0;n<r;n++)a[e+n+1]=t;return 0}function Dj(a,e,r){var t=new Array(r+1);t[0]=0;for(var n=1,i=e+1;n<=r;n++,i++)t[n]=a[i];return t}function boo(a,e){throw[0,a,e]}function mz(a,e){if(0==a)return l;if(e.repeat)return e.repeat(a);for(var r=l,t=0;;){if(1&a&&(r+=e),0==(a>>=1))return r;e+=e,9==++t&&e.slice(0,1)}}function vc(a,e,r){var t=String.fromCharCode;if(0==e&&r<=4096&&r==a.length)return t.apply(null,a);for(var n=l;0<r;e+=he,r-=he)n+=t.apply(null,a.slice(e,e+Math.min(r,he)));return n}function fy(a){2==a.t?a.c+=mz(a.l-a.c.length,"\0"):a.c=vc(a.c,0,a.c.length),a.t=0}function ZG(a){if(a.length<24){for(var e=0;e<a.length;e++)if(a.charCodeAt(e)>il)return!1;return!0}return!/[^\x00-\x7f]/.test(a)}function DH(a){for(var e,r,t,n,i=l,o=l,u=0,c=a.length;u<c;u++){if((r=a.charCodeAt(u))<d3){for(var f=u+1;f<c&&(r=a.charCodeAt(f))<d3;f++);if(f-u>Co?(o.substr(0,1),i+=o,o=l,i+=a.slice(u,f)):o+=a.slice(u,f),f==c)break;u=f}n=1,++u<c&&(-64&(t=a.charCodeAt(u)))==cE&&(e=t+(r<<6),r<RQ?(n=e-12416)<d3&&(n=1):(n=2,++u<c&&(-64&(t=a.charCodeAt(u)))==cE&&(e=t+(e<<6),r<WT?((n=e-925824)<SR||n>=55295&&n<57344)&&(n=2):(n=3,++u<c&&(-64&(t=a.charCodeAt(u)))==cE&&r<245&&((n=t-63447168+(e<<6))<65536||n>1114111)&&(n=3))))),n<4?(u-=n,o+="�"):o+=n>ip?String.fromCharCode(55232+(n>>10),TN+(1023&n)):String.fromCharCode(n),o.length>he&&(o.substr(0,1),i+=o,o=l)}return i+o}function ix(a,e,r){this.t=a,this.c=e,this.l=r}function Zj(a){return new ix(0,a,a.length)}function a(a){return Zj(a)}function DF(e,r){boo(e,a(r))}ix.prototype.toString=function(){switch(this.t){case 9:return this.c;default:fy(this);case 0:if(ZG(this.c))return this.t=9,this.c;this.t=8;case 8:return DH(this.c)}},ix.prototype.slice=function(){var a=4==this.t?this.c.slice():this.c;return new ix(this.t,a,this.l)};var b1=[0];function bC(a){DF(b1.Invalid_argument,a)}function Zg(a){switch(a){case 7:case 10:case 11:return 2;default:return 1}}function Ze(a,e){var r,t=aw;switch(a){case 0:case 10:r=t.Float32Array;break;case 1:case 11:r=t.Float64Array;break;case 2:r=t.Int8Array;break;case 3:case 12:r=t.Uint8Array;break;case 4:r=t.Int16Array;break;case 5:r=t.Uint16Array;break;case 6:case 7:case 8:case 9:r=t.Int32Array}return r||bC("Bigarray.create: unsupported kind"),new r(e*Zg(a))}function u5(a){for(var e=a.length,r=1,t=0;t<e;t++)a[t]<0&&bC("Bigarray.create: negative dimension"),r*=a[t];return r}var Zs=Math.pow(2,-24);function DE(a){throw a}function hp(){DE(b1.Division_by_zero)}function an(a,e,r){this.lo=a&gh,this.mi=e&gh,this.hi=r&ip}function bnW(a,e){return new an(a&gh,a>>>24&es|(e&ip)<<8,e>>>16&ip)}function Dv(a){return a.hi32()}function Dw(a){return a.lo32()}function jX(){bC(CD)}function iz(a,e,r,t){this.kind=a,this.layout=e,this.dims=r,this.data=t}function mr(a,e,r,t){this.kind=a,this.layout=e,this.dims=r,this.data=t}function Dk(a,e,r,t){var n=Zg(a);return u5(r)*n!=t.length&&bC("length doesn't match dims"),0==e&&1==r.length&&1==n?new mr(a,e,r,t):new iz(a,e,r,t)}function Zt(a){return a.slice(1)}function bnn(a,e,r){var t=Zt(r);return Dk(a,e,t,Ze(a,u5(t)))}function bnp(a,e){return(e<0||e>=a.dims.length)&&bC("Bigarray.dim"),a.dims[e]}function Zf(a){return bnp(a,0)}function bnq(a,e){return a.get(a.offset(e))}function hn(a,e,r,t,n){if(0==n)return 0;if(0==t&&(n>=r.l||2==r.t&&n>=r.c.length))r.c=4==a.t?vc(a.c,e,n):0==e&&a.c.length==n?a.c:a.c.substr(e,n),r.t=r.c.length==r.l?0:2;else if(2==r.t&&t==r.c.length)r.c+=4==a.t?vc(a.c,e,n):0==e&&a.c.length==n?a.c:a.c.substr(e,n),r.t=r.c.length==r.l?0:2;else{4!=r.t&&u6(r);var i=a.c,o=r.c;if(4==a.t)if(t<=e)for(var u=0;u<n;u++)o[t+u]=i[e+u];else for(u=n-1;u>=0;u--)o[t+u]=i[e+u];else{var c=Math.min(n,i.length-e);for(u=0;u<c;u++)o[t+u]=i.charCodeAt(e+u);for(;u<n;u++)o[t+u]=0}}return 0}function b0(a){return a}function fx(a,e,r,t,n){return hn(b0(a),e,r,t,n),0}function bc(a){return a.l}function t(a){return bc(a)}function ck(a,e){return bg(a,e)}function Zd(a){for(var e=t(a),r=new Array(e),n=0;n<e;n++)r[n]=ck(a,n);return r}function bnt(a,e,r,n,i){if(12!=r.kind&&bC("caml_bigstring_blit_string_to_ba: kind mismatch"),0==i)return 0;var o=r.offset(n);e+i>t(a)&&jX(),o+i>r.data.length&&jX();var u=Zd(a).slice(e,e+i);return r.data.set(u,o),0}an.prototype.caml_custom="_j",an.prototype.copy=function(){return new an(this.lo,this.mi,this.hi)},an.prototype.ucompare=function(a){return this.hi>a.hi?1:this.hi<a.hi?-1:this.mi>a.mi?1:this.mi<a.mi?-1:this.lo>a.lo?1:this.lo<a.lo?-1:0},an.prototype.compare=function(a){var e=this.hi<<16,r=a.hi<<16;return e>r?1:e<r?-1:this.mi>a.mi?1:this.mi<a.mi?-1:this.lo>a.lo?1:this.lo<a.lo?-1:0},an.prototype.neg=function(){var a=-this.lo,e=-this.mi+(a>>24);return new an(a,e,-this.hi+(e>>24))},an.prototype.add=function(a){var e=this.lo+a.lo,r=this.mi+a.mi+(e>>24);return new an(e,r,this.hi+a.hi+(r>>24))},an.prototype.sub=function(a){var e=this.lo-a.lo,r=this.mi-a.mi+(e>>24);return new an(e,r,this.hi-a.hi+(r>>24))},an.prototype.mul=function(a){var e=this.lo*a.lo,r=(e*Zs|0)+this.mi*a.lo+this.lo*a.mi;return new an(e,r,(r*Zs|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi)},an.prototype.isZero=function(){return 0==(this.lo|this.mi|this.hi)},an.prototype.isNeg=function(){return this.hi<<16<0},an.prototype.and=function(a){return new an(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)},an.prototype.or=function(a){return new an(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)},an.prototype.xor=function(a){return new an(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)},an.prototype.shift_left=function(a){return 0==(a&=63)?this:a<24?new an(this.lo<<a,this.mi<<a|this.lo>>24-a,this.hi<<a|this.mi>>24-a):a<48?new an(0,this.lo<<a-24,this.mi<<a-24|this.lo>>48-a):new an(0,0,this.lo<<a-48)},an.prototype.shift_right_unsigned=function(a){return 0==(a&=63)?this:a<24?new an(this.lo>>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a):a<48?new an(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0):new an(this.hi>>a-48,0,0)},an.prototype.shift_right=function(a){if(0==(a&=63))return this;var e=this.hi<<16>>16;if(a<24)return new an(this.lo>>a|this.mi<<24-a,this.mi>>a|e<<24-a,this.hi<<16>>a>>>16);var r=this.hi<<16>>31;return a<48?new an(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,r&ip):new an(this.hi<<16>>a-32,r,r)},an.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&gh,this.lo=this.lo<<1&gh},an.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&gh,this.mi=(this.mi>>>1|this.hi<<23)&gh,this.hi=this.hi>>>1},an.prototype.udivmod=function(a){for(var e=0,r=this.copy(),t=a.copy(),n=new an(0,0,0);r.ucompare(t)>0;)e++,t.lsl1();for(;e>=0;)e--,n.lsl1(),r.ucompare(t)>=0&&(n.lo++,r=r.sub(t)),t.lsr1();return{quotient:n,modulus:r}},an.prototype.div=function(a){var e=this;a.isZero()&&hp();var r=e.hi^a.hi;e.hi&fv&&(e=e.neg()),a.hi&fv&&(a=a.neg());var t=e.udivmod(a).quotient;return r&fv&&(t=t.neg()),t},an.prototype.mod=function(a){var e=this;a.isZero()&&hp();var r=e.hi;e.hi&fv&&(e=e.neg()),a.hi&fv&&(a=a.neg());var t=e.udivmod(a).modulus;return r&fv&&(t=t.neg()),t},an.prototype.toInt=function(){return this.lo|this.mi<<24},an.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},an.prototype.toArray=function(){return[this.hi>>8,this.hi&es,this.mi>>16,this.mi>>8&es,this.mi&es,this.lo>>16,this.lo>>8&es,this.lo&es]},an.prototype.lo32=function(){return this.lo|(this.mi&es)<<24},an.prototype.hi32=function(){return this.mi>>>8&ip|this.hi<<16},iz.prototype.caml_custom="_bigarray",iz.prototype.offset=function(a){var e=0;if("number"==typeof a&&(a=[a]),a instanceof Array||bC("bigarray.js: invalid offset"),this.dims.length!=a.length&&bC("Bigarray.get/set: bad number of dimensions"),0==this.layout)for(var r=0;r<this.dims.length;r++)(a[r]<0||a[r]>=this.dims[r])&&jX(),e=e*this.dims[r]+a[r];else for(r=this.dims.length-1;r>=0;r--)(a[r]<1||a[r]>this.dims[r])&&jX(),e=e*this.dims[r]+(a[r]-1);return e},iz.prototype.get=function(a){switch(this.kind){case 7:return bnW(this.data[2*a+0],this.data[2*a+1]);case 10:case 11:var e=this.data[2*a+0],r=this.data[2*a+1];return[im,e,r];default:return this.data[a]}},iz.prototype.set=function(a,e){switch(this.kind){case 7:this.data[2*a+0]=Dw(e),this.data[2*a+1]=Dv(e);break;case 10:case 11:this.data[2*a+0]=e[1],this.data[2*a+1]=e[2];break;default:this.data[a]=e}return 0},iz.prototype.fill=function(a){switch(this.kind){case 7:var e=Dw(a),r=Dv(a);if(e==r)this.data.fill(e);else for(var t=0;t<this.data.length;t++)this.data[t]=t%2==0?e:r;break;case 10:case 11:var n=a[1],i=a[2];if(n==i)this.data.fill(n);else for(t=0;t<this.data.length;t++)this.data[t]=t%2==0?n:i;break;default:this.data.fill(a)}},iz.prototype.compare=function(a,e){if(this.layout!=a.layout||this.kind!=a.kind){var r=this.kind|this.layout<<8;return(a.kind|a.layout<<8)-r}if(this.dims.length!=a.dims.length)return a.dims.length-this.dims.length;for(var t=0;t<this.dims.length;t++)if(this.dims[t]!=a.dims[t])return this.dims[t]<a.dims[t]?-1:1;switch(this.kind){case 0:case 1:case 10:case 11:var n,i;for(t=0;t<this.data.length;t++){if((n=this.data[t])<(i=a.data[t]))return-1;if(n>i)return 1;if(n!=i){if(!e)return NaN;if(n==n)return 1;if(i==i)return-1}}break;case 7:for(t=0;t<this.data.length;t+=2){if(this.data[t+1]<a.data[t+1])return-1;if(this.data[t+1]>a.data[t+1])return 1;if(this.data[t]>>>0<a.data[t]>>>0)return-1;if(this.data[t]>>>0>a.data[t]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(t=0;t<this.data.length;t++){if(this.data[t]<a.data[t])return-1;if(this.data[t]>a.data[t])return 1}}return 0},mr.prototype=new iz,mr.prototype.offset=function(a){return"number"!=typeof a&&(a instanceof Array&&1==a.length?a=a[0]:bC("Ml_Bigarray_c_1_1.offset")),(a<0||a>=this.dims[0])&&jX(),a},mr.prototype.get=function(a){return this.data[a]},mr.prototype.set=function(a,e){return this.data[a]=e,0},mr.prototype.fill=function(a){return this.data.fill(a),0};var bnu=bnt;function Zh(a){return(255&a)<<8|(65280&a)>>8}function iA(){bC(CD)}function c7(a,e){return e>>>0>=a.l&&iA(),bg(a,e)}function bnw(a,e){e>>>0>=a.l-1&&iA();var r=bg(a,e);return bg(a,e+1)<<8|r}function bnx(a,e){e>>>0>=a.l-3&&iA();var r=bg(a,e),t=bg(a,e+1),n=bg(a,e+2);return bg(a,e+3)<<24|n<<16|t<<8|r}function iB(a){return new an(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function bny(a,e){e>>>0>=a.l-7&&iA();for(var r=new Array(8),t=0;t<8;t++)r[7-t]=bg(a,e+t);return iB(r)}function cr(a,e,r){return e>>>0>=a.l&&iA(),aV(a,e,r)}function bnC(a,e,r){e>>>0>=a.l-1&&iA();var t=fr&r>>8;return aV(a,e+0,fr&r),aV(a,e+1,t),0}function bnD(a,e,r){e>>>0>=a.l-3&&iA();var t=fr&r>>24,n=fr&r>>16,i=fr&r>>8;return aV(a,e+0,fr&r),aV(a,e+1,i),aV(a,e+2,n),aV(a,e+3,t),0}function iC(a){return a.toArray()}function bnE(a,e,r){e>>>0>=a.l-7&&iA();for(var t=iC(r),n=0;n<8;n++)aV(a,e+7-n,t[n]);return 0}function c8(a,e){if(a.fun)return c8(a.fun,e);if("function"!=typeof a)return a;var r=0|a.length;if(0===r)return a.apply(null,e);var t=r-(0|e.length)|0;return 0==t?a.apply(null,e):t<0?c8(a.apply(null,e.slice(0,r)),e.slice(r)):function(){for(var r=0==arguments.length?1:arguments.length,t=new Array(e.length+r),n=0;n<e.length;n++)t[n]=e[n];for(n=0;n<arguments.length;n++)t[e.length+n]=arguments[n];return c8(a,t)}}function o(a,e){return e>>>0>=a.length-1&&jX(),a}function bnF(a){return isFinite(a)?Math.abs(a)>=22250738585072014e-324?0:0!=a?1:2:isNaN(a)?4:3}function dN(a){return 0!=(6&a.t)&&fy(a),a.c}var boK=Math.log2&&1020==Math.log2(11235582092889474e291);function boJ(a){if(boK)return Math.floor(Math.log2(a));var e=0;if(0==a)return-1/0;if(a>=1)for(;a>=2;)a/=2,e++;else for(;a<1;)a*=2,e--;return e}function Dt(a){var e=new aw.Float32Array(1);return e[0]=a,0|new aw.Int32Array(e.buffer)[0]}function jZ(a,e,r){return new an(a,e,r)}function mv(a){if(!isFinite(a))return isNaN(a)?jZ(1,0,Rs):jZ(0,0,a>0?Rs:65520);var e=0==a&&1/a==-1/0?fv:a>=0?0:fv;e&&(a=-a);var r=boJ(a)+1023;r<=0?(r=0,a/=Math.pow(2,-Us)):((a/=Math.pow(2,r-Y6))<16&&(a*=2,r-=1),0==r&&(a/=2));var t=Math.pow(2,24),n=0|a,i=0|(a=(a-n)*t);return jZ(0|(a=(a-i)*t),i,n=n&CA|e|r<<4)}function bns(a,e,r){a.write(32,e.dims.length),a.write(32,e.kind|e.layout<<8);for(var t=0;t<e.dims.length;t++)a.write(32,e.dims[t]);switch(e.kind){case 2:case 3:case 12:for(t=0;t<e.data.length;t++)a.write(8,e.data[t]);break;case 4:case 5:for(t=0;t<e.data.length;t++)a.write(16,e.data[t]);break;case 6:for(t=0;t<e.data.length;t++)a.write(32,e.data[t]);break;case 8:case 9:a.write(8,0);for(t=0;t<e.data.length;t++)a.write(32,e.data[t]);break;case 7:for(t=0;t<e.data.length/2;t++)for(var n=iC(e.get(t)),i=0;i<8;i++)a.write(8,n[i]);break;case 1:for(t=0;t<e.data.length;t++)for(n=iC(mv(e.get(t))),i=0;i<8;i++)a.write(8,n[i]);break;case 0:for(t=0;t<e.data.length;t++){n=Dt(e.get(t));a.write(32,n)}break;case 10:for(t=0;t<e.data.length/2;t++){i=e.get(t);a.write(32,Dt(i[1])),a.write(32,Dt(i[2]))}break;case 11:for(t=0;t<e.data.length/2;t++){var o=e.get(t);for(n=iC(mv(o[1])),i=0;i<8;i++)a.write(8,n[i]);for(n=iC(mv(o[2])),i=0;i<8;i++)a.write(8,n[i])}}r[0]=4*(4+e.dims.length),r[1]=8*(4+e.dims.length)}function Du(a){var e=new aw.Int32Array(1);return e[0]=a,new aw.Float32Array(e.buffer)[0]}function pW(a){var e=a.lo,r=a.mi,t=a.hi,n=(32767&t)>>4;if(2047==n)return 0==(e|r|t&CA)?t&fv?-1/0:1/0:NaN;var i=Math.pow(2,-24),o=(e*i+r)*i+(t&CA);return n>0?(o+=16,o*=Math.pow(2,n-Y6)):o*=Math.pow(2,-Us),t&fv&&(o=-o),o}function bl(a){DF(b1.Failure,a)}function bno(a,e){var r=a.read32s();(r<0||r>16)&&bl("input_value: wrong number of bigarray dimensions");for(var t=a.read32s(),n=t&es,i=t>>8&1,o=[],u=0;u<r;u++)o.push(a.read32u());var c=u5(o),f=Ze(n,c),s=Dk(n,i,o,f);switch(n){case 2:for(u=0;u<c;u++)f[u]=a.read8s();break;case 3:case 12:for(u=0;u<c;u++)f[u]=a.read8u();break;case 4:for(u=0;u<c;u++)f[u]=a.read16s();break;case 5:for(u=0;u<c;u++)f[u]=a.read16u();break;case 6:for(u=0;u<c;u++)f[u]=a.read32s();break;case 8:case 9:a.read8u()&&bl("input_value: cannot read bigarray with 64-bit OCaml ints");for(u=0;u<c;u++)f[u]=a.read32s();break;case 7:var b=new Array(8);for(u=0;u<c;u++){for(var l=0;l<8;l++)b[l]=a.read8u();var v=iB(b);s.set(u,v)}break;case 1:for(b=new Array(8),u=0;u<c;u++){for(l=0;l<8;l++)b[l]=a.read8u();var h=pW(iB(b));s.set(u,h)}break;case 0:for(u=0;u<c;u++){h=Du(a.read32s());s.set(u,h)}break;case 10:for(u=0;u<c;u++){var d=Du(a.read32s()),p=Du(a.read32s());s.set(u,[im,d,p])}break;case 11:for(b=new Array(8),u=0;u<c;u++){for(l=0;l<8;l++)b[l]=a.read8u();for(d=pW(iB(b)),l=0;l<8;l++)b[l]=a.read8u();p=pW(iB(b));s.set(u,[im,d,p])}}return e[0]=4*(4+r),Dk(n,i,o,f)}function bnm(a,e,r){return a.compare(e,r)}function pX(a,e){return Math.imul(a,e)}function cV(a,e){return e=pX(e,-862048943),((a=(a^=e=pX(e=e<<15|e>>>17,461845907))<<13|a>>>19)+(a<<2)|0)-430675100|0}function bnO(a,e){return a=cV(a,Dw(e)),a=cV(a,Dv(e))}function Dq(a,e){return bnO(a,mv(e))}function bnr(a){var e=u5(a.dims),r=0;switch(a.kind){case 2:case 3:case 12:e>d4&&(e=d4);var t=0,n=0;for(n=0;n+4<=a.data.length;n+=4)r=cV(r,t=a.data[n+0]|a.data[n+1]<<8|a.data[n+2]<<16|a.data[n+3]<<24);switch(t=0,3&e){case 3:t=a.data[n+2]<<16;case 2:t|=a.data[n+1]<<8;case 1:r=cV(r,t|=a.data[n+0])}break;case 4:case 5:e>cE&&(e=cE);t=0,n=0;for(n=0;n+2<=a.data.length;n+=2)r=cV(r,t=a.data[n+0]|a.data[n+1]<<16);0!=(1&e)&&(r=cV(r,a.data[n]));break;case 6:e>64&&(e=64);for(n=0;n<e;n++)r=cV(r,a.data[n]);break;case 8:case 9:e>64&&(e=64);for(n=0;n<e;n++)r=cV(r,a.data[n]);break;case 7:e>32&&(e=32),e*=2;for(n=0;n<e;n++)r=cV(r,a.data[n]);break;case 10:e*=2;case 0:e>64&&(e=64);for(n=0;n<e;n++)r=Dq(r,a.data[n]);break;case 11:e*=2;case 1:e>32&&(e=32);for(n=0;n<e;n++)r=Dq(r,a.data[n])}return r}function bnU(a,e){return e[0]=4,a.read32s()}function bog(a,e){switch(a.read8u()){case 1:return e[0]=4,a.read32s();case 2:bl("input_value: native integer value too large");default:bl("input_value: ill-formed native integer")}}function bn4(a,e){for(var r=new Array(8),t=0;t<8;t++)r[t]=a.read8u();return e[0]=8,iB(r)}function bn0(a,e,r){for(var t=iC(e),n=0;n<8;n++)a.write(8,t[n]);r[0]=8,r[1]=8}function bnV(a,e,r){return a.compare(e)}function bnX(a){return a.lo32()^a.hi32()}var fz={_j:{deserialize:bn4,serialize:bn0,fixed_length:8,compare:bnV,hash:bnX},_i:{deserialize:bnU,fixed_length:4},_n:{deserialize:bog,fixed_length:4},_bigarray:{deserialize:bno,serialize:bns,compare:bnm,hash:bnr}};function Dl(a){return fz[a.caml_custom]&&fz[a.caml_custom].compare}function Zk(a,e,r,t){var n=Dl(e);if(n){var i=r>0?n(e,a,t):n(a,e,t);if(t&&i!=i)return r;if(+i!=+i)return+i;if(0!=(0|i))return 0|i}return r}function iD(a){return a instanceof ix}function mw(a){return iD(a)}function Zl(a){if("number"==typeof a)return mc;if(iD(a))return ua;if(mw(a))return 1252;if(a instanceof Array&&a[0]===a[0]>>>0&&a[0]<=dj){var e=0|a[0];return e==im?0:e}return a instanceof String||"string"==typeof a?R0:a instanceof Number?mc:a&&a.caml_custom?Cq:a&&a.compare?1256:"function"==typeof a?1247:"symbol"==typeof a?1251:1001}function u_(a,e){return a<e?-1:a==e?0:1}function Zi(a,e){return 6&a.t&&fy(a),6&e.t&&fy(e),a.c<e.c?-1:a.c>e.c?1:0}function cF(a,e){return Zi(a,e)}function jY(a,e,r){for(var t=[];;){if(!r||a!==e){var n=Zl(a);if(n==cA){a=a[1];continue}var i=Zl(e);if(i==cA){e=e[1];continue}if(n!==i)return n==mc?i==Cq?Zk(a,e,-1,r):-1:i==mc?n==Cq?Zk(e,a,1,r):1:n<i?-1:1;switch(n){case 247:case 249:case 1247:bC(B9);break;case 248:if(0!=(u=u_(a[2],e[2])))return 0|u;break;case 250:bC("equal: got Forward_tag, should not happen");break;case 251:bC("equal: abstract value");break;case 252:if(a!==e)if(0!=(u=Zi(a,e)))return 0|u;break;case 253:bC("equal: got Double_tag, should not happen");break;case 254:bC("equal: got Double_array_tag, should not happen");break;case 255:bC("equal: got Custom_tag, should not happen");break;case 1255:var o=Dl(a);if(o!=Dl(e))return a.caml_custom<e.caml_custom?-1:1;if(o||bC("compare: abstract value"),(u=o(a,e,r))!=u)return r?-1:u;if(u!==(0|u))return-1;if(0!=u)return 0|u;break;case 1256:var u;if((u=a.compare(e,r))!=u)return r?-1:u;if(u!==(0|u))return-1;if(0!=u)return 0|u;break;case 1e3:if((a=+a)<(e=+e))return-1;if(a>e)return 1;if(a!=e){if(!r)return NaN;if(a==a)return 1;if(e==e)return-1}break;case 1001:if(a<e)return-1;if(a>e)return 1;if(a!=e){if(!r)return NaN;if(a==a)return 1;if(e==e)return-1}break;case 1251:if(a!==e)return r?1:NaN;break;case 1252:if((a=dN(a))!==(e=dN(e))){if(a<e)return-1;if(a>e)return 1}break;case 12520:if((a=a.toString())!==(e=e.toString())){if(a<e)return-1;if(a>e)return 1}break;default:if(a.length!=e.length)return a.length<e.length?-1:1;a.length>1&&t.push(a,e,1)}}if(0==t.length)return 0;var c=t.pop();e=t.pop(),c+1<(a=t.pop()).length&&t.push(a,e,c+1),a=a[c],e=e[c]}}function aW(a,e){return jY(a,e,!0)}function aG(a){return a<0&&bC("Bytes.create"),new ix(a?2:9,l,a)}var ms=3;function ZF(a,e,r){return(e<0||ms+e>=a.length)&&bC(W0),a[ms+e]=r,0}function bnG(a,e,r){return ZF(a,e,[0,r])}function bnH(a,e){return ZF(a,e,0)}function I(a,e){return+(0==jY(a,e,!1))}function bnI(a,e,r,t){if(r>0)if(0==e&&(r>=a.l||2==a.t&&r>=a.c.length))0==t?(a.c=l,a.t=2):(a.c=mz(r,String.fromCharCode(t)),a.t=r==a.l?0:2);else for(4!=a.t&&u6(a),r+=e;e<r;e++)a.c[e]=t;return 0}function u7(a){var e;if(e=+(a=dN(a)),a.length>0&&e==e)return e;if(e=+(a=a.replace(/_/g,l)),a.length>0&&e==e||/^[+-]?nan$/i.test(a))return e;var r=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)p([+-]?[0-9]+)/i.exec(a);if(r){var t=r[3].replace(/0+$/,l),n=parseInt(r[1]+r[2]+t,16),i=(0|r[4])-4*t.length;return e=n*Math.pow(2,i)}return/^\+?inf(inity)?$/i.test(a)?1/0:/^-inf(inity)?$/i.test(a)?-1/0:void bl("float_of_string")}function DD(a){var e=(a=dN(a)).length;e>31&&bC("format_int: format too long");for(var r={justify:eS,signstyle:cC,filler:bb,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},t=0;t<e;t++){var n=a.charAt(t);switch(n){case"-":r.justify=cC;break;case"+":case" ":r.signstyle=n;break;case"0":r.filler=b9;break;case"#":r.alternate=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(r.width=0;(n=a.charCodeAt(t)-48)>=0&&n<=9;)r.width=10*r.width+n,t++;t--;break;case".":for(r.prec=0,t++;(n=a.charCodeAt(t)-48)>=0&&n<=9;)r.prec=10*r.prec+n,t++;t--;case"d":case"i":r.signedconv=!0;case"u":r.base=10;break;case"x":r.base=16;break;case"X":r.base=16,r.uppercase=!0;break;case"o":r.base=8;break;case"e":case"f":case"g":r.signedconv=!0,r.conv=n;break;case"E":case"F":case"G":r.signedconv=!0,r.uppercase=!0,r.conv=n.toLowerCase()}}return r}function Dm(e,r){e.uppercase&&(r=r.toUpperCase());var t=r.length;e.signedconv&&(e.sign<0||e.signstyle!=cC)&&t++,e.alternate&&(8==e.base&&(t+=1),16==e.base&&(t+=2));var n=l;if(e.justify==eS&&e.filler==bb)for(var i=t;i<e.width;i++)n+=bb;if(e.signedconv&&(e.sign<0?n+=cC:e.signstyle!=cC&&(n+=e.signstyle)),e.alternate&&8==e.base&&(n+=b9),e.alternate&&16==e.base&&(n+=Bk),e.justify==eS&&e.filler==b9)for(i=t;i<e.width;i++)n+=b9;if(n+=r,e.justify==cC)for(i=t;i<e.width;i++)n+=bb;return a(n)}function Dn(a,e){var r=DD(a),t=r.prec<0?6:r.prec;if((e<0||0==e&&1/e==-1/0)&&(r.sign=-1,e=-e),isNaN(e))n=BX,r.filler=bb;else if(isFinite(e))switch(r.conv){case"e":var n,i=(n=e.toExponential(t)).length;n.charAt(i-3)==u2&&(n=n.slice(0,i-1)+b9+n.slice(i-1));break;case"f":n=function(a,e){if(Math.abs(a)<1)return a.toFixed(e);var r=parseInt(a.toString().split(eS)[1]);return r>20?(r-=20,a/=Math.pow(10,r),a+=new Array(r+1).join(b9),e>0&&(a=a+be+new Array(e+1).join(b9)),a):a.toFixed(e)}(e,t);break;case"g":t=t||1;var o=(n=e.toExponential(t-1)).indexOf(u2),u=+n.slice(o+1);if(u<-4||e>=1e21||e.toFixed(0).length>t){for(i=o-1;n.charAt(i)==b9;)i--;n.charAt(i)==be&&i--,i=(n=n.slice(0,i+1)+n.slice(o)).length,n.charAt(i-3)==u2&&(n=n.slice(0,i-1)+b9+n.slice(i-1));break}var c=t;if(u<0)c-=u+1,n=e.toFixed(c);else for(;(n=e.toFixed(c)).length>t+1;)c--;if(c){for(i=n.length-1;n.charAt(i)==b9;)i--;n.charAt(i)==be&&i--,n=n.slice(0,i+1)}}else n="inf",r.filler=bb;return Dm(r,n)}function mu(e,r){if(dN(e)==iw)return a(l+r);var t=DD(e);r<0&&(t.signedconv?(t.sign=-1,r=-r):r>>>=0);var n=r.toString(t.base);if(t.prec>=0){t.filler=bb;var i=t.prec-n.length;i>0&&(n=mz(i,b9)+n)}return Dm(t,n)}var boj=0;function y(){return boj++}function u$(a){return a.toString()}if(aw.process&&aw.process.cwd)var pV=aw.process.cwd().replace(/\\/g,bA);else var pV="/static";function bn_(a){47!=(a=u$(a)).charCodeAt(0)&&(a=pV+a);for(var e=a.split(bA),r=[],t=0;t<e.length;t++)switch(e[t]){case"..":r.length>1&&r.pop();break;case".":break;case"":0==r.length&&r.push(l);break;default:r.push(e[t])}return r.orig=a,r}function bnA(a){return new ix(4,a,a.length)}function boB(a){for(var e,r,t=l,n=t,i=0,o=a.length;i<o;i++){if((e=a.charCodeAt(i))<d3){for(var u=i+1;u<o&&(e=a.charCodeAt(u))<d3;u++);if(u-i>Co?(n.substr(0,1),t+=n,n=l,t+=a.slice(i,u)):n+=a.slice(i,u),u==o)break;i=u}e<SR?(n+=String.fromCharCode(192|e>>6),n+=String.fromCharCode(d3|e&l7)):e<55296||e>=XW?n+=String.fromCharCode(RQ|e>>12,d3|e>>6&l7,d3|e&l7):e>=56319||i+1==o||(r=a.charCodeAt(i+1))<TN||r>XW?n+="�":(i++,e=(e<<10)+r-56613888,n+=String.fromCharCode(WT|e>>18,d3|e>>12&l7,d3|e>>6&l7,d3|e&l7)),n.length>he&&(n.substr(0,1),t+=n,n=l)}return t+n}function bnB(a){var e=9;return ZG(a)||(e=8,a=boB(a)),new ix(e,a,a.length)}function ex(a){return bnB(a)}function bT(a){DF(b1.Sys_error,a)}function bom(a){bT((a=dN(a))+": No such file or directory")}function Zb(){}function cU(a){this.data=a}function eV(a,e){this.content={},this.root=a,this.lookupFun=e}function bnl(a){return 4!=a.t&&u6(a),a.c}function gm(a){this.fs=require$$1__default.default,this.fd=a}function gl(a){this.fs=require$$1__default.default,this.root=a}pV.slice(-1)!==bA&&(pV+=bA),cU.prototype=new Zb,cU.prototype.truncate=function(a){var e=this.data;this.data=aG(0|a),hn(e,0,this.data,0,a)},cU.prototype.length=function(){return bc(this.data)},cU.prototype.write=function(a,e,r,t){var n=this.length();if(a+t>=n){var i=aG(a+t),o=this.data;this.data=i,hn(o,0,this.data,0,n)}return fx(e,r,this.data,a,t),0},cU.prototype.read=function(a,e,r,t){return this.length(),hn(this.data,a,e,r,t),0},cU.prototype.read_one=function(a){return c7(this.data,a)},cU.prototype.close=function(){},cU.prototype.constructor=cU,eV.prototype.nm=function(a){return this.root+a},eV.prototype.lookup=function(e){if(!this.content[e]&&this.lookupFun){var r=this.lookupFun(a(this.root),a(e));0!==r&&(this.content[e]=new cU(b0(r[1])))}},eV.prototype.exists=function(a){if(a==l)return 1;var e=new RegExp(Ct+(a+bA));for(var r in this.content)if(r.match(e))return 1;return this.lookup(a),this.content[a]?1:0},eV.prototype.readdir=function(a){var e=new RegExp(Ct+(a==l?l:a+bA)+Te),r={},t=[];for(var n in this.content){var i=n.match(e);i&&!r[i[1]]&&(r[i[1]]=!0,t.push(i[1]))}return t},eV.prototype.is_dir=function(a){var e=new RegExp(Ct+(a==l?l:a+bA)+Te);for(var r in this.content){if(r.match(e))return 1}return 0},eV.prototype.unlink=function(a){var e=!!this.content[a];return delete this.content[a],e},eV.prototype.open=function(a,e){if(e.rdonly&&e.wronly&&bT(this.nm(a)+R8),e.text&&e.binary&&bT(this.nm(a)+Wp),this.lookup(a),this.content[a]){this.is_dir(a)&&bT(this.nm(a)+" : is a directory"),e.create&&e.excl&&bT(this.nm(a)+R6);var r=this.content[a];return e.truncate&&r.truncate(),r}if(e.create)return this.content[a]=new cU(aG(0)),this.content[a];bom(this.nm(a))},eV.prototype.register=function(a,e){if(this.content[a]&&bT(this.nm(a)+R6),iD(e)&&(this.content[a]=new cU(e)),mw(e))this.content[a]=new cU(b0(e));else if(e instanceof Array)this.content[a]=new cU(bnA(e));else if("string"==typeof e)this.content[a]=new cU(Zj(e));else if(e.toString){var r=b0(ex(e.toString()));this.content[a]=new cU(r)}else bT(this.nm(a)+" : registering file with invalid content type")},eV.prototype.constructor=eV,gm.prototype=new Zb,gm.prototype.truncate=function(a){try{this.fs.ftruncateSync(this.fd,0|a)}catch(a){bT(a.toString())}},gm.prototype.length=function(){try{return this.fs.fstatSync(this.fd).size}catch(a){bT(a.toString())}},gm.prototype.write=function(a,e,r,t){var n=Zd(e);n instanceof aw.Uint8Array||(n=new aw.Uint8Array(n));var i=aw.Buffer.from(n);try{this.fs.writeSync(this.fd,i,r,t,a)}catch(n){bT(n.toString())}return 0},gm.prototype.read=function(a,e,r,t){var n=bnl(e);n instanceof aw.Uint8Array||(n=new aw.Uint8Array(n));var i=aw.Buffer.from(n);try{this.fs.readSync(this.fd,i,r,t,a)}catch(n){bT(n.toString())}for(var o=0;o<t;o++)cr(e,r+o,i[r+o]);return 0},gm.prototype.read_one=function(a){var e=new aw.Uint8Array(1),r=aw.Buffer.from(e);try{this.fs.readSync(this.fd,r,0,1,a)}catch(r){bT(r.toString())}return r[0]},gm.prototype.close=function(){try{this.fs.closeSync(this.fd)}catch(a){bT(a.toString())}},gm.prototype.constructor=gm,gl.prototype.nm=function(a){return this.root+a},gl.prototype.exists=function(a){try{return this.fs.existsSync(this.nm(a))?1:0}catch(a){bT(a.toString())}},gl.prototype.readdir=function(a){try{return this.fs.readdirSync(this.nm(a))}catch(a){bT(a.toString())}},gl.prototype.is_dir=function(a){try{return this.fs.statSync(this.nm(a)).isDirectory()?1:0}catch(a){bT(a.toString())}},gl.prototype.unlink=function(a){try{var e=this.fs.existsSync(this.nm(a))?1:0;this.fs.unlinkSync(this.nm(a))}catch(a){bT(a.toString())}return e},gl.prototype.open=function(a,e){var r=require$$2__default.default,t=0;for(var n in e)switch(n){case"rdonly":t|=r.O_RDONLY;break;case"wronly":t|=r.O_WRONLY;break;case"append":t|=r.O_WRONLY|r.O_APPEND;break;case"create":t|=r.O_CREAT;break;case"truncate":t|=r.O_TRUNC;break;case"excl":t|=r.O_EXCL;break;case"binary":t|=r.O_BINARY;break;case"text":t|=r.O_TEXT;break;case"nonblock":t|=r.O_NONBLOCK}try{return new gm(this.fs.openSync(this.nm(a),t))}catch(r){bT(r.toString())}},gl.prototype.rename=function(a,e){try{this.fs.renameSync(this.nm(a),this.nm(e))}catch(e){bT(e.toString())}},gl.prototype.constructor=gl;var my=pV.match(/[^\/]*\//)[0];function boG(){return void 0!==aw.process&&void 0!==aw.process.versions&&void 0!==aw.process.versions.node&&"browser"!==aw.process.platform}var pY=[];function DK(a){for(var e,r=(a=bn_(a).join(bA))+bA,t=0;t<pY.length;t++){var n=pY[t];0==r.search(n.path)&&(!e||e.path.length<n.path.length)&&(e={path:n.path,device:n.device,rest:a.substring(n.path.length,a.length)})}return e}function Zm(a,e){var r=DK(a);return r.device.register||bl("cannot register file"),r.device.register(r.rest,e),0}function bnK(){var a=aw.caml_fs_tmp;if(a)for(var e=0;e<a.length;e++)Zm(a[e].name,a[e].content);return aw.caml_create_file=Zm,aw.caml_fs_tmp=[],0}function Zn(a,e){return+(jY(a,e,!1)>=0)}function Dp(a,e){return+(jY(a,e,!1)>0)}function Dr(a,e){var r,t,n=e.length;for(r=0;r+4<=n;r+=4)a=cV(a,t=e.charCodeAt(r)|e.charCodeAt(r+1)<<8|e.charCodeAt(r+2)<<16|e.charCodeAt(r+3)<<24);switch(t=0,3&n){case 3:t=e.charCodeAt(r+2)<<16;case 2:t|=e.charCodeAt(r+1)<<8;case 1:a=cV(a,t|=e.charCodeAt(r))}return a^=n}function bnP(a,e){return Dr(a,dN(e))}function bnM(a,e){var r,t,n=e.length;for(r=0;r+4<=n;r+=4)a=cV(a,t=e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24);switch(t=0,3&n){case 3:t=e[r+2]<<16;case 2:t|=e[r+1]<<8;case 1:a=cV(a,t|=e[r])}return a^=n}function bnL(a,e){switch(6&e.t){default:fy(e);case 0:a=Dr(a,e.c);break;case 2:a=bnM(a,e.c)}return a}function bnN(a){return a=pX(a^=a>>>16,-2048144789),a=pX(a^=a>>>13,-1028477387),a^=a>>>16}function u8(a,e,r,t){var n,i,o,u,c,f,s,b,l;for(((u=e)<0||u>d4)&&(u=d4),c=a,f=r,n=[t],i=0,o=1;i<o&&c>0;){if((s=n[i++])&&s.caml_custom){if(fz[s.caml_custom]&&fz[s.caml_custom].hash)f=cV(f,fz[s.caml_custom].hash(s)),c--}else if(s instanceof Array&&s[0]===(0|s[0]))switch(s[0]){case 248:f=cV(f,s[2]),c--;break;case 250:n[--i]=s[1];break;default:for(f=cV(f,s.length-1<<10|s[0]),b=1,l=s.length;b<l&&!(o>=u);b++)n[o++]=s[b]}else iD(s)?(f=bnL(f,s),c--):mw(s)?(f=bnP(f,s),c--):"string"==typeof s?(f=Dr(f,s),c--):s===(0|s)?(f=cV(f,s+s+1),c--):s===+s&&(f=Dq(f,s),c--)}return(f=bnN(f))&Sv}function bnQ(a,e,r){var t=0;return function r(n){if(e--,!(a<0||e<0))if(n instanceof Array&&n[0]===(0|n[0]))switch(n[0]){case 248:a--,t=t*t5+n[2]|0;break;case 250:e++,r(n);break;default:a--,t=19*t+n[0]|0;for(var i=n.length-1;i>0;i--)r(n[i])}else if(iD(n))switch(a--,6&n.t){default:fy(n);case 0:var o=n.c,u=bc(n);for(i=0;i<u;i++)t=19*t+o.charCodeAt(i)|0;break;case 2:var c=n.c;for(u=bc(n),i=0;i<u;i++)t=19*t+c[i]|0}else if(mw(n)){var f=dN(n);for(o=f,u=f.length,i=0;i<u;i++)t=19*t+o.charCodeAt(i)|0}else if("string"==typeof n)for(o=n,u=n.length,i=0;i<u;i++)t=19*t+o.charCodeAt(i)|0;else if(n===(0|n))a--,t=t*t5+n|0;else if(n===+n){a--;var s=iC(mv(n));for(i=7;i>=0;i--)t=19*t+s[i]|0}else if(n&&n.caml_custom&&fz[n.caml_custom]&&fz[n.caml_custom].hash){var b=0|fz[n.caml_custom].hash(n);t=t*t5+b|0}}(r),t&Sv}function bnR(a,e,r){if(!isFinite(a))ret