UNPKG

motoko

Version:

Compile and run Motoko smart contracts in Node.js or the browser.

1 lines 3.01 MB
!function(r){function n(){var n=this||self;n.globalThis=n,delete r.prototype._T_}"object"!=typeof globalThis&&(this?n():(r.defineProperty(r.prototype,"_T_",{configurable:!0,get:n}),_T_))}(Object),function(r){"use strict";var n="object"==typeof module&&module.exports||r,t="could not perform ",e=320,u=289,a="Could not find %s\n",f="<imp>",i="canister_update ",c="misplaced stability modifier: allowed on var or simple let declarations only",v="opt_project",o="clos",A="offset",s="rts_max_live_size",b="msg_reply_data_append",B="put",l=232,j="obj_idx_ind<%d>",k="while",p="rts_stable_memory_size",_=787,d="mo_frontend/bi_match.ml",m="Add all imports before all functions!",h='" not defined',x="graph_stabilization_increment",y="box64",w="a shared function is only allowed as a public field of an actor",g="Out_of_memory",I="__run_post_upgrade",q=1079,E="@@value_numerator",D="tag",$="Failure",T="acc",N="cannot get self-actor-reference when running locally",P="text_iter",F="canister_subnet",G="%s%s",K=1348,U="UnboxedFloat64",O="closure",R="SwitchE",M=837731904,L="false",H=1e9,J="performance_counter",V="word",C="actor field ",S="done",z="Value.compare",Q="msg_arg_data_size",Z="anon_async",X="B+sub",W="Match_failure",Y="regionLoadInt64",rr="text_size",nr="M0017",tr="TupP",er="None",ur=460,ar="object",fr="regionLoadInt32",ir=438,cr="@deserialize_go<",vr="EEXIST",or="region_load_float64",Ar="__stablemem_%sread_%s",sr="overwrite field to resolve error",br=490,Br="moc_stabilization_instruction_limit",lr=224,jr="conv_Char_Text",kr="guarded_",pr=192,_r="expected function type, but expression produces type\n %s",dr="unexpected T.Typ",mr="abs",hr="IDL error: unexpected function reference",xr="arithmetic overflow",yr="asin",wr=": No such file or directory",gr="obj_idx<%d>",Ir="!",qr="EPFNOSUPPORT",Er="callbackTableCount",Dr="principal",$r=7950,Tr=")\n",Nr="bitwidth_mask_of_type",Pr="stream_write",Fr="__persistence_version",Gr="stable64_write",Kr="totalAllocation",Ur="<v 0>",Or="has_stable_actor",Rr=":",Mr="<float>",Lr=7983,Hr="T",Jr="Printexc.handle_uncaught_exception",Vr=247,Cr="reply_with_data",Sr=8040,zr="cannot perform ",Qr=937,Zr="start_graph_stabilization",Xr="settings",Wr="in_replicated_execution",Yr="actors cannot serve as bases in record extensions",rn="negative power",nn="amount",tn=65535,en="StableMem.mem_size non-zero",un="fasin",an="prelude",fn="heapSize",cn="Range overflow",vn="alloc_blob",on="$lambda",An=474,sn="_tuple",bn="Text.compare_eq",Bn=1058,ln=-2147483648,jn="List.nth",kn="compare: functional value",pn="stableMemoryStoreInt64",_n="@;<0 0>",dn=1e3,mn="get_maintyps_ptr",hn="Nat64Lit",xn="cannot burn cycles when running locally",yn="len",wn=" : ",gn="service constructor not supported",In="shared",qn="cost_create_canister",En="nan:0x",Dn="unvisited mutable data in serialize_go (Region)",$n="unbound label ",Tn="OCAMLRUNPARAM",Nn="ENOPROTOOPT",Pn="serialization overflow",Fn=7978,Gn="ENXIO",Kn="read_",Un="low_memory_exp",On="Unsupported persistence version. Use newer Motoko compiler version.",Rn="popcntInt8",Mn="Ill-typed intermediate code after ",Ln="ftan",Hn="moc_stable_mem_set_size",Jn="generational",Vn="cannot infer type of variable",Cn="as_tup",Sn="bigint_eq",zn="bad import: imported actor class cannot be anonymous",Qn="canister_status",Zn="EFAULT",Xn="dst",Wn="__candid_data_length",Yn="msg_arg_data_copy",rt="OptP",nt="Stable memory error: Aliased at wrong type, expected: ",tt=309,et="fsqrt",ut="stableMemoryLoadNat64",at="get",ft=" has cyclic bounds ",it="@motoko_async_destabilization",ct="serialize_go: unexpected variant",vt="region_load_word64",ot="switch_in",At="c",st="ESPIPE",bt="bigint_div",Bt="\n scope ",lt=144,jt="postupgrade",kt=" or ",pt="bigint_le",_t="Shared",dt="InInit",mt="@ ",ht="keep_memory_reserve",xt="log",yt="Invalid stack rep join (%s, %s)\n",wt=453,gt="this pattern is never matched",It="flexible",qt="compile_start_func: Cannot compile library",Et="ObjE",Dt="self call",$t="if_can_tag_i32",Tt="load_stable_actor",Nt=8042,Pt=-48,Ft="char_is_uppercase",Gt="set of bindings differ for alternative pattern",Kt="compile_unop",Ut="__stablemem_",Ot="Int->Int64",Rt="cost_http_request",Mt="misplaced await",Lt=16777215,Ht=400,Jt="stableMemoryStoreFloat",Vt="EPROTONOSUPPORT",Ct="lowering/desugar.ml",St="lib/lib.ml",zt="bigint_leb128_encode",Qt="Array.unsafe_idx",Zt="fatan2",Xt="__stablememory_store_word8",Wt="/",Yt="@deserialize_extended<",re="ir_def/construct.ml",ne="not a self-call",te="CharLit",ee="cycles_burn128",ue=3654863,ae="__frame_pointer",fe=1067124520,ie="start",ce=16777211,ve="region_store_float64",oe="AsyncE*",Ae="explode_Nat16",se="ic0_stable64_size",be="reserved",Be="__heap_base",le="root_key_size",je="B_lt",ke="debug_show",pe="not a self-call or call from controller",_e="payload_size",de="cycle_burn",me="#%s",he="tup_scrut",xe="async expressions are not supported",ye="unexpected ",we=768,ge=7944,Ie=7946,qe="shared function has non-shared parameter type%a",Ee="show is not defined for operand type",De=129,$e="mo_frontend/menhir_error_reporting.ml",Te="__stablemem_size",Ne="rts_reclaimed",Pe="ENAMETOOLONG",Fe="shared functions are not supported",Ge="variable ",Ke="ESOCKTNOSUPPORT",Ue="r",Oe="prim",Re="blob_copy_%s_%s",Me="bigint_ge",Le="ELOOP",He="B_rsh",Je="parsing",Ve="expected function type, but expression produces type\n ",Ce="var",Se="text_to_buf",ze="M0077",Qe="i",Ze="service",Xe=136,We="<= %s",Ye="{}",ru="len1",nu="@reset_refund",tu="+",eu="regionStoreInt32",uu="oneway function has non-unit return type",au="Actor",fu="btstInt32",iu="wpow_nat",cu="AllocHow.disjoint_union: %s",vu=125,ou="Blob index out of bounds",Au="canister_post_upgrade",su="<typ_item>",bu="explode_Nat64",Bu="k",lu="meth_pair",ju="res",ku=487,pu=1333,_u="init_region",du="buffer_size called on value of type None",mu=454,hu=175,xu="else",yu="M0212",wu="unclosed text literal",gu="EDEADLK",Iu="btst32",qu="Local",Eu="fmod",Du="error_code",$u="rtsVersion",Tu="M0169",Nu="_start",Pu="ic0",Fu="redundant empty parenthetical note",Gu="cannot get arg_data when running locally",Ku="e",Uu="wasm-exts/customModuleEncode.ml",Ou="mo_values/operator.ml",Ru="duplicate variable definition in block",Mu="{",Lu="Array",Hu="bigint_sleb128_decode_word64",Ju="Int->",Vu=325,Cu=" when running locally",Su="post_upgrade",zu="stableMemoryLoadBlob",Qu="region_load_word8",Zu=158,Xu="cycle_available",Wu="sort mismatch",Yu="__typtbl_idltyps",ra="write_with_barrier",na="send capability required, but not available\n (need an enclosing async expression or function body)",ta="text_compare",ea="flog",ua="cannot infer type of wildcard",aa="trans_state",fa="@@typtbl_size",ia=-976970511,ca="stableMemoryLoadNat8",va="arrayToBlob",oa="code",Aa="initialize_static_variables",sa="subnet_self_copy",ba=171,Ba=8047,la=-97,ja="EINVAL",ka="io_vec",pa="ctz64",_a="Text.compare_gt",da="@cleanup",ma="__stablememory_grow",ha=437,xa=150,ya="get_static_variable",wa="shared query function must have syntactic return type 'async <typ>'",ga="transient",Ia="Nat",qa=407,Ea="([^/]+)",Da="AssignE",$a="Object",Ta="canister_heartbeat",Na="\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\0\0\0\0\0\0\0\0",Pa="data_start",Fa="schedule",Ga="timer_exp",Ka="tan",Ua="\ndoes not match expected type",Oa=172,Ra="subnet_self_size",Ma="bigint_neg",La="czlcn3mi-a6z5mxxs-bycg8qcs-f9g0b8b1",Ha=" ",Ja="failed",Va="ic0_stable64_write",Ca=">_tag<",Sa="illegal escape",za="actor class configuration unsupported in interpreter",Qa="cannot infer type of primitive",Za="save_stable_actor",Xa="cannot compute intersection of types containing recursive or forward references to other type definitions",Wa="IDL error: unexpected variant tag",Ya="__mutator_instructions",rf="bigint_trap",nf="opt_inject",tf="M0215",ef=201,uf="canister_reject",af="@[%a@]",ff="ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\0\0",cf="continuation_count",vf="Not_found",of=-798940232,Af="__idl_types_length",sf="ensured",bf="add",Bf="M0200",lf="cannot get system time when running locally",jf="cycles out of bounds",kf="cast",pf="Text.compare_lt",_f=254,df="remember_continuation",mf="empty",hf="__stablemem_guard_range",xf="wasm-exts/customModuleDecode.ml",yf="label",wf="could not perform oneway",gf="value %s does not match pattern",If="mo_frontend/coverage.ml",qf="ENOBUFS",Ef="misplaced %s",Df="%s<%s>",$f="btst16",Tf="forall",Nf="IDL error: blob not a vector of nat8",Pf=", ",Ff=380,Gf="illegal T.Pre type",Kf=133,Uf="import",Of="`system` capability required, but not available\n (need an enclosing async expression or function body or explicit `system` type parameter)",Rf='compile_const_exp/VarE: "',Mf="<dec_field>",Lf="%.17g",Hf="curve",Jf="EDOM",Vf="@prim",Cf="get_total_allocations",Sf="stream_stable_dest",zf="bigint_sleb128_size",Qf=330,Zf="ffloor",Xf="B_le",Wf="region_init",Yf=-872313182,ri="\nright operand is",ni="convertee",ti="EAFNOSUPPORT",ei=7948,ui="regionStoreNat32",ai="__wasm_apply_data_relocs",fi=126,ii="TODO: ",ci="int64_of_big_int",vi="IDL error: incompatible actor type",oi=" : flags Open_text and Open_binary are not compatible",Ai=" <: ",si=": Not a directory",bi="canister_composite_query ",Bi=" }",li="contains_field",ji="idl_sub_buf_words",ki="error",pi="sleb128_decode",_i=302,di="name",mi="btst8",hi="ir_passes/await.ml",xi="StableMemory range out of bounds",yi="ir_passes/async.ml",wi="BlobLit",gi="expected object type, but expression produces type%a",Ii="num_wrap",qi="Win32",Ei="ERANGE",Di="__upgrade_instructions",$i=252,Ti="bigint_add",Ni="@reject_callback",Pi="-",Fi=": file descriptor already closed",Gi="var_scrut",Ki="as_ptr_size",Ui="bigint_leb128_stream_encode",Oi="@@global_typtbl_end",Ri="InPostUpgrade",Mi="ctz8",Li="text_lowercase",Hi="bigint_of_word64",Ji="mo_values/show.ml",Vi="remote call",Ci="Candid limit denominator cannot be zero",Si='"',zi="system",Qi="non-actor class cannot take a context pattern",Zi=105,Xi="canister_on_low_wasm_memory",Wi="Arr.ofBlobMut",Yi="obj_idx_ind<",rc="ic0_stable64_read",nc="__stablemem_%swrite_%s",tc="fd_write",ec="__motoko_stable_var_info",uc=12582912,ac="to_var_type: Unreachable",fc="blob_iter_next",ic="parse_idl_header",cc="rts_in_upgrade",vc="NullLit",oc="ETIMEDOUT",Ac="cannot import canister urls without --actor-idl param",sc="compile_const_dec: Unexpected VarD/RefD",bc="atan",Bc="bigint_of_float64",lc="fnearest",jc="@;<0 -2>",kc="canister_global_timer",pc=148,_c=1000000009,dc=11372,mc="operator may trap for inferred type",hc="no type can be inferred for actor reference",xc="__stablememory_store_word16",yc="(%s%s)",wc="__typtbl_size",gc="text_singleton",Ic="cannot get cycles refunded when running locally",qc="stableMemoryStoreNat16",Ec="region_load_blob",Dc="field names ",$c="int",Tc="Int64",Nc="misplaced stability declaration on field of non-actor",Pc="result",Fc="$",Gc="<2>",Kc="` of type",Uc="Map.bal",Oc="v",Rc="str_self",Mc="shared function must have syntactic return type '()' or 'async <typ>'",Lc="closedir",Hc="nat16",Jc="@reset_cycles",Vc="popcntInt64",Cc="Error",Sc="assertion failed at %s",zc="",Qc="@@global_typtbl",Zc="__stablemem_load_blob",Xc="nat",Wc="cannot reject when running locally",Yc="cannot get method_name when running locally",rv="timeout",nv="type_desc: unexpected type %s\n",tv="cannot infer return type",ev=107,uv="raw call",av="mo_types/expansive.ml",fv="rel_buf",iv="rts_memory_size",cv="param",vv="Undefined_recursive_module",ov=2147483647,Av=65280,sv="none",bv="\\t",Bv="array",lv="rts_trap",jv="data_size",kv="blob_of_principal",pv="__wasm_call_ctors",_v="accessing identifier before its definition",dv="E2BIG",mv="error_value",hv="Blob.compare_le",xv=113,yv="find_field",wv="replicated_execution",gv=" = a: 0x",Iv="bigint_of_word32",qv=256,Ev="assert_nonneg",Dv="call_perform_status",$v="PrimE",Tv="root_key",Nv="idl_sub_buf_init",Pv="call_raw",Fv="idl_limit_check",Gv="blob",Kv="region_store_word32",Uv="field ",Ov="rts_mutator_instructions",Rv=" in record",Mv="<case>",Lv="stableMemoryStoreNat64",Hv="array_len",Jv="schedule_",Vv="stream_reserve",Cv="EWOULDBLOCK",Sv=123,zv=834,Qv="closure_data",Zv="data_certificate_size",Xv="async expression",Wv="bigint_lsh",Yv="marker",ro="Array.tabulateVar",no="motoko:compiler",to="__typtbl",eo="certified_data_set",uo="regionNew",ao=">",fo="acos",io="object type",co="}",vo="clz64",oo='" not found',Ao="memory",so="Sys_blocked_io",bo="module",Bo="mo_frontend/parser.mly",lo=1/0,jo="get_static_roots",ko=373,po="mkdir",_o=" declared",mo="codegen/compile_enhanced.ml",ho="IDL error: out of bounds read",xo="PostPreUpgrade",yo="losing precision",wo="%s : %a",go="IDL error: variant index out of bounds",Io="cycle_accept",qo="Assert_failure",Eo="new",Do=497,$o="Int64Lit",To="atan2",No="nat64",Po="bigint_leb128_decode",Fo="explode_Int16",Go="unclosed comment",Ko="rts_collector_instructions",Uo="__stablememory_load_word16",Oo="moc_stable_mem_grow",Ro="different set of bindings in pattern alternatives",Mo="FuncT",Lo="CPSAwait bad cont",Ho="cannot send references on IC System API",Jo="as_func",Vo=" = ",Co="stableMemorySize",So="Char",zo="wildcard",Qo="meth_pair2",Zo="cost_call",Xo="unvisited mutable data in serialize_go (Array)",Wo="bigint_sleb128_stream_encode",Yo="get_max_live_size",rA="field name ",nA="<typ_tag>",tA="stableMemoryStoreNat8",eA="ftrunc",uA=120,aA=236,fA=1027,iA="(",cA="ref_buffer",vA="canister_self",oA="__stablememory_load_float64",AA="LetD",sA="stop_gc_before_stabilization",bA="call_cycles_add128",BA="arg%i",lA="env",jA="Fatal error: exception ",kA="Unknown stack_rep conversion %s -> %s\n",pA="GOT.mem",_A=181,dA=118,mA="__type_offsets_length",hA="blob_len",xA="camlinternalFormat.ml",yA="bigint_gt",wA="str_caller",gA="PostQuery",IA="Unreachable",qA="ic0_performance_counter",EA="ObjP",DA=1066,$A="Int8Lit",TA=913,NA="higher stable memory version (expected 1..",PA="relop",FA="ECONNABORTED",GA=151,KA="write_",UA="unexpected %s, expected one of token or <phrase> sequence:\n %s",OA="logicalStableMemorySize",RA="buffer_size overflow",MA="Stack_overflow",LA="if_can_tag_i64",HA="@;<0 1>",JA="to_%i_tuple",VA=153,CA=" is PublicMethod",SA="assertion failure",zA="shared function has non-shared return type",QA="arg_typ",ZA="No global named %s declared",XA=1061,WA=189,YA=65535,rs="EACCES",ns="VariantT",ts="redundant ignore, operand already has type ()",es="copying",us="Function import not declared: %s\n",as="EINTR",fs=1836278016,is="costCreateCanister",cs=145,vs="duplicate binding for %s in pattern",os=921,As="algorithm",ss="message result is not sharable:\n %s",bs="fexp",Bs="explode_Nat32",ls=162,js="bigint_2complement_bits",ks="__call_perform_message",ps="system_unknown",_s="ENOEXEC",ds="stableMemoryStoreBlob",ms="ptr",hs="__motoko_gc_trigger",xs="multi-memory",ys="bulk-memory",ws="int16",gs=115,Is=" :: ",qs="serialize",Es="msg_cycles_available128",Ds=104,$s="M0059",Ts="set_val: %s is PublicMethod",Ns="await",Ps="shared function has non-async result type",Fs="message result is not sharable:\n ",Gs="stable64_size",Ks="@@data_buf",Us="register_stable_type",Os="n",Rs="shared function with async result type has non-async body",Ms="vals",Ls="type",Hs="__stablemem_store_blob",Js="stableMemoryStoreInt32",Vs=467,Cs=1049,Ss="%Lx",zs="region_store_word8",Qs="_clos",Zs="B_rem",Xs="End_of_file",Ws="boxed_i64",Ys="lib/pack/menhirLib.ml",rb="caller",nb="AllocHow.disjoint_union: ",tb="<- await",eb="@[<1>(%a)@]",ub="write_location",ab="mo_values/prim.ml",fb="get_heap_base",ib="text",cb="null",vb="msg_method_name_copy",ob="bigint function error",Ab="boxed_f64",sb="IDL error: coercion failure encountered",bb="M0041",Bb="memcmp",lb="<any>",jb=1023,kb="ENOTCONN",pb="return",_b="encodeUtf8",db=65536,mb="catch",hb="InComposite",xb="get_graph_destabilized_actor",yb="continue ",wb=8421504,gb="refs_size",Ib=328,qb='internal error: const "',Eb="infinity",Db="arg",$b="__stabilization_completed",Tb="clz16",Nb="object_size/Mut: Unexpected tag.",Pb="stable64_grow",Fb=161,Gb="candid:args",Kb=128,Ub=436,Ob="Sys_error",Rb="\nLast environment:\n",Mb="this function has the name of a system method, but is declared without system visibility and will not be called by the system",Lb=1073741823,Hb=4194304,Jb="compiler bug: expected a module or actor class but found a program, i.e. a sequence of declarations",Vb="Arr.ofBlob",Cb="mo_idl/idl_to_mo.ml",Sb="mo_interpreter/interpret.ml",zb="enhanced-orthogonal-persistence",Qb="regionLoadNat16",Zb="Vanilla",Xb="cycle_refunded",Wb="canister_self_size",Yb=32768,rB="StableMemory range overflow",nB="@{",tB="get_n_ptr",eB="unbound variable %s",uB="trap",aB="M0141",fB="$Self",iB="ESHUTDOWN",cB="float32",vB=" : file already exists",oB="EPROTOTYPE",AB="len2",sB="compile_eq",bB="tup",BB="Array.init",lB="ir_passes/eq.ml",jB="Local actors not supported by backend",kB="\n ",pB=1121,_B="@motoko_async_stabilization",dB="Array.idx_bigint",mB="__motoko_destabilize_after_upgrade",hB="field name %s does not exist in type\n %s",xB="*/",yB="true",wB="clzInt8",gB="IDL error: unexpected actor reference",IB="EADDRNOTAVAIL",qB="str",EB="misplaced ",DB="pattern failed",$B=334,TB=494,NB="fmin",PB="call_perform",FB="M0037",GB="__stablememory_store_word64",KB="bigint_to_word32_wrap",UB=1073741824,OB="nat_sub",RB="blob_vals_iter",MB="ctzInt32",LB="Nat->Nat64",HB="$Res",JB="IDL error: did not find field ",VB="Invalid stack rep join (",CB="__stablemem_grow",SB="buf",zB="IDL error: left-over bytes ",QB="fcos",ZB="throw",XB="stableMemoryLoadInt16",WB="actor class cannot take a context pattern",YB="last",rl=259,nl="compile_prim_invocation",tl=16776960,el="regionLoadNat64",ul="file ",al=1092,fl="stable64_read",il="this code is (or uses) the deprecated library `ExperimentalStableMemory`.\nPlease use the `Region` library instead: https://internetcomputer.org/docs/current/motoko/main/stable-memory/stable-regions/#the-region-library or compile with flag `--experimental-stable-memory 1` to suppress this message.",cl="y",vl=" and ",ol=121,Al="codegen/compile_classical.ml",sl="multi_val_%d",bl="Nat8Lit",Bl="__stablememory_load_blob",ll="No global named ",jl="bad import: expected a module or actor class but found an actor",kl="Invalid_argument",pl="Nat16",_l=" -> ",dl="as_async",ml="UnboxedTuple %d",hl=16777215,xl="future",yl="getCandidLimits",wl="StableMemory offset out of bounds",gl="Blob.idx",Il="shared function has unexpected type parameters",ql="duplicate binding for ",El='compile_const_exp/VarE: "%s" not found',Dl=512,$l="TagP",Tl="fmax",Nl="call_with_best_effort_response",Pl=1026,Fl="if (",Gl=157,Kl="tuple projection ",Ul="next",Ol="private",Rl="EPERM",Ml="cycle_add",Ll="rmdir",Hl="region_new",Jl="operator is not defined for operand type%a",Vl=198,Cl="mo_def/compUnit.ml",Sl=248,zl="array index out of bounds",Ql="M0031",Zl="break",Xl="print",Wl="BinOp",Yl="@@value_quota",rj="init",nj="implicit instantiation of type parameter ",tj=" does not exist in type\n ",ej=" in pattern",uj=16777153,aj="clz8",fj="data_certificate_copy",ij=108,cj="PrimT",vj="promising function cannot be local:\n %s",oj=".",Aj="ECHILD",sj="heartbeat_exp",bj="install_arg",Bj="popcnt32",lj="B_lsh",jj="clzInt64",kj="opt_scrut",pj="mo_types/productive.ml",_j="stream_write_byte",dj="compile_relop",mj=194,hj="fceil",xj=138,yj=",",wj="index out of bounds",gj="unbound variable %s%a%s",Ij="rts.wasm",qj=179,Ej=117,Dj=319,$j="request_size",Tj=353,Nj="loop",Pj="moc_stable_mem_set_version",Fj="misplaced return",Gj="set_upgrade_instructions",Kj="unreachable",Uj="async*",Oj=458,Rj="VarP",Mj="__stablemem_version",Lj=250,Hj="sub",Jj="text_uppercase",Vj="error_message",Cj="from_word128_ptr",Sj=274,zj="viper",Qj="lowmemory",Zj="running_gc",Xj="tag_scrut",Wj="InQuery",Yj="cannot perform %s when running locally",rk="fcopysign",nk="rotl",tk="int_of_string",ek="post_write_barrier",uk=255,ak="principal_of_blob",fk="<pat_bin>",ik="pipeline/pipeline.ml",ck="product",vk="bigint_sleb128_decode",ok="UnboxedTuple ",Ak=218,sk="msg_method_name_size",bk="allocation_barrier",Bk="ignore",lk="exists",jk="char_to_upper",kk="shared function has non-async result type%a",pk="win32",_k=963043957,dk=185,mk="regionLoadNat32",hk="Unix.Unix_error",xk="btstInt8",yk="Int16",wk="motoko:stable-types",gk="unop",Ik="EOVERFLOW",qk=205556449,Ek=", characters ",Dk="__stablememory_load_word32",$k="__motoko_async_helper",Tk="query",Nk="too few type arguments",Pk=452,Fk="pages_needed",Gk="zero flag expected",Kk="Nat8",Uk="%s",Ok=280,Rk=109,Mk="EMLINK",Lk=310,Hk="region_store_word64",Jk=265,Vk="@timeout",Ck="stableMemoryLoadNat16",Sk="popcnt8",zk="written_value",Qk="@",Zk="UnboxedWord64",Xk="idl_alloc_typtbl",Wk="@[<2>async@ %a@]",Yk="EDESTADDRREQ",rp="get_reclaimed",np="blob_compare",tp="ENOMEM",ep="skip_leb128",up="call_perform_message",ap="blob_of_ptr_size",fp="EBUSY",ip="inspect",cp="serializing value of type None",vp="Int32Lit",op="shared function cannot take a context pattern",Ap="skip_any",sp="alloc_size<",bp="<",Bp="<bl>",lp="start_graph_destabilization",jp="bigint_leb128_decode_word64",kp="of_string",pp="wpow_int",_p="Int16Lit",dp="btstInt16",mp="mo_frontend/parsing.ml",hp=182,xp=836501035,yp="moc_stable_mem_get_size",wp="CPSAsync unexpected typ",gp="VarD",Ip=231,qp=" : flags Open_rdonly and Open_wronly are not compatible",Ep="ENETUNREACH",Dp="incremental_gc",$p=32768,Tp="EINPROGRESS",Np="__stablememory_size",Pp="system_fatal",Fp="float_fmt",Gp="class",Kp="ic0_stable64_grow",Up='": captures "',Op="@;",Rp="regionSize",Mp="boundary",Lp="__motoko_runtime_information",Hp="unbound variable ",Jp="actor class has non-async return type",Vp=239,Cp="cannot get certificate when running locally",Sp="motoko",zp=1350,Qp="M0086",Zp="EXDEV",Xp="_",Wp="checking",Yp=491,r_="ETOOMANYREFS",n_="<dec>",t_="bigint_rem",e_="@[<1>?%a@]",u_="migration",a_="\\\\",f_="accept_message",i_="@@global_typtbl_size",c_="variant",v_="/static/",o_="msg_deadline",A_="multi_val_",s_="<id>",b_="as_obj",B_=137,l_="__motoko_stabilize_before_upgrade",j_=" does not match pattern",k_="deadline",p_="expression of type",__="continue",d_="bigint_to_word64_wrap",m_="garbageCollector",h_=8043,x_=1057,y_=" missing",w_=122,g_="regionStoreNat16",I_="EPIPE",q_="bigint_to_word32_trap_with",E_="in",D_="Function import not declared: ",$_="B+div",T_="cannot set certified data when running locally",N_="pages",P_=7949,F_="idltyp2",G_="text_of_ptr_size",K_=1174,U_="regionStoreNat8",O_=16777212,R_="TODO: compile_unop",M_="stableMemoryStoreInt16",L_="canister_init",H_="fabs",J_="actor",V_="popcnt16",C_="malformed operator",S_="%s\n",z_="wasm_features",Q_="OptT",Z_=166,X_=" (in TAG 0x",W_="debug",Y_="callbackTableSize",rd="=",nd="<typ_dec>",td="free_stable_actor",ed=1022,ud="M0096",ad=323,fd="shared function has non-shared parameter type",id=1021133848,cd="@add_cycles",vd="old_pages",od="max_res_bytes",Ad="region_load_word32",sd="rts_start",bd="\nand",Bd=372,ld="ENOTEMPTY",jd="compilerVersion",kd=1255,pd="compile_const_exp/DotE: not a static object",_d="alloc_array",dd="@deserialize<",md="case",hd="data buffer not filled",xd=-840203068,yd="call_as_prim was true?",wd=": calling convention ",gd=7947,Id="suspend",qd="print_text",Ed="unrecognised attribute ",Dd="hash",$d="ENOTSOCK",Td="clz32",Nd="func",Pd="regionId",Fd="first_word",Gd="custom section size mismatch",Kd=57344,Ud="region_store_blob",Od="bigint_leb128_size",Rd=455,Md=16777152,Ld="msg_caller_size",Hd="type parameter %s has cyclic bounds %s",Jd=193,Vd="ECONNREFUSED",Cd="arg_count",Sd="get_heap_size",zd="meth_pair1",Qd=178,Zd="mo_frontend/parser.ml",Xd="TypD",Wd="msg_reply",Yd="internal error: left-over ThrowPrim",rm=149,nm="mo_types/type.ml",tm="word16",em="Int",um="IDL error: unexpected principal reference",am="Principal",fm="\nwhere",im="TextLit",cm="new_object",vm="@[<v 0>%a@]",om="actor reference must have an actor type",Am="B_pow",sm="rts_max_stack_size",bm="sleb128_encode",Bm="an actor or actor class must be the only non-imported declaration in a program",lm="@@ref_buf",jm="ir_def/check_ir.ml",km="IDL error: exceeded value limit",pm="__destabilized_actor",_m="compile_const_exp/ProjE: not a static tuple",dm="IntLit",mm="is_controller",hm=180,xm=" in ",ym="Var",wm="*",gm=169,Im="wrap_pow_Int64",qm="type parameter ",Em="EMSGSIZE",Dm="lang_utils/expGraph.ml",$m="bigint_of_int64",Tm="to_opt_%i_tuple",Nm=696517344,Pm="char_is_whitespace",Fm="int64",Gm="lower",Km="alt_scrut",Um="composite send capability required, but not available\n (cannot call a `composite query` function from a non-`composite query` function)",Om="region_grow",Rm="text_len",Mm="lexp with non-mutable type",Lm=440380662,Hm="EADDRINUSE",Jm="cannot decide type constructor equality",Vm="cannot get ",Cm="ENOTDIR",Sm="bigint_lt",zm="malformed UTF-8 encoding",Qm="from_candid requires but is missing a known type (from context)",Zm="\\u{%02x}",Xm="write",Wm="call_on_cleanup",Ym=395,rh="send capability required, but not available\n (cannot call a `shared` function from a `query` function)",nh="Pervasives.do_at_exit",th="blob index out of bounds",eh="Blob.compare",uh="expected mutable assignment target",ah="msg_reject_msg_size",fh="Array.idx",ih="lsh_Nat",ch="alloc_size<%d>_tag<%d>",vh=301,oh="TryE",Ah="cb_index",sh="regionStoreInt64",bh=154,Bh="package",lh="text_concat",jh="arrayMutToBlob",kh="msg_cycles_refunded128",ph="is_graph_stabilization_started",_h="Composite",dh="word32",mh=290,hh="M",xh="AsyncE",yh="misplaced parenthetical (this call does not send a message)",wh="memo",gh="compile",Ih="rts_total_allocation",qh="PreInit",Eh="N",Dh="setCandidLimits",$h="blob too long for actor principal",Th="\n",Nh="time",Ph="assert",Fh="ENOENT",Gh="compile_comparison",Kh="frame_ptr <> stack_ptr",Uh="Division_by_zero",Oh="principalOfBlob",Rh="EOPNOTSUPP",Mh="x",Lh=119,Hh=287,Jh="mo_frontend/typing.ml",Vh="costHttpRequest",Ch=101,Sh="%.*g",zh="rts_callback_table_size",Qh=255,Zh=848054398,Xh=100,Wh=1114111,Yh="Out of stable memory.",rx="stableMemoryLoadFloat",nx="canister_pre_upgrade",tx="actor classes with non non-async return types are deprecated; please declare the return type as 'async ...'",ex="<exp_field>",ux="__stablememory_store_blob",ax="deprecated syntax: an imported library should be a module or named actor class",fx="msg_reject_msg_copy",ix="obj_idx<",cx="unknown primitive type",vx="InUpdate",ox="pow",Ax="bigint_rsh",sx="@@typtbl_end",bx="rts_version",Bx="ctz32",lx="wasi_snapshot_preview1",jx="rts",kx="/// ",px="region_vec_pages",_x="@get_actor_to_persist",dx="mul",mx="linking/linkModule.ml",hx="unexpected call_conv ",xx="\\n",yx="system_transient",wx="B_mod",gx="mutbox_value",Ix="compute_crc32",qx=7982,Ex="skip_fields",Dx="Bool",$x=919,Tx="AltP",Nx="0x",Px="LoopE",Fx="bad annotation (object type expected)",Gx="System",Kx="as_mut",Ux="print_ptr",Ox="to_candid",Rx=": closedir failed",Mx="canister_query ",Lx=933,Hx="IDL error: too few arguments ",Jx=384,Vx=223,Cx="EHOSTUNREACH",Sx="regionLoadBlob",zx=" must not depend on itself",Qx="IDL error: did not find tuple field in record",Zx="__call_perform_status",Xx="get_typtbl_ptr",Wx="data_buffer",Yx="Array index out of bounds",ry="Expect one table in first module",ny="regionStoreBlob",ty="bigint_isneg",ey=388,uy=7951,ay=430,fy="rts_logical_stable_memory_size",iy="cannot get cycles available when running locally",cy="__stablememory_store_float64",vy="cannot have more than one mode",oy="EAGAIN",Ay="regionGrow",sy="word64",by=416,By="fmtFloat->Text",ly="viper/trans.ml",jy="var ",ky="operator is not defined for operand type",py=" ",_y="principalOfActor",dy="cos",my="tagidx",hy="file %s must not depend on itself",xy="cost_sign_with_ecdsa",yy=500,wy="set_static_variable",gy="bigint_to_float64",Iy="type_desc: unexpected type ",qy="EMFILE",Ey=7976,Dy="bigint_to_word32_trap",$y="old_pos",Ty="call ",Ny=8041,Py="bigint_sub",Fy="` is provided but not expected in object of type",Gy="idlHash",Ky=7945,Uy="canister_self_copy",Oy="<exp_nonvar(ob)>",Ry="region_store_word16",My="compile_lit_pat",Ly=363,Hy="@@value_bias",Jy="<nat>",Vy="int_from_i64",Cy="type field",Sy=433,zy="IDL error: circular record read",Qy="shared function has non-shared return type%a",Zy="mo_types/typ_hash.ml",Xy="costCall",Wy="actor classes are not supported",Yy="Blob.compare_eq",rw="EHOSTDOWN",nw="ir_passes/erase_typ_field.ml",tw="ActorU",ew="composite",uw="Float->Text",aw=483,fw="set_val: ",iw="M0131",cw="canister_pre_upgrade attempted with outstanding message callbacks (try stopping the canister before upgrade)",vw="get_typtbl_size_ptr",ow="a shared function cannot be private",Aw=-16777216,sw="ctzInt64",bw="Blob.compare_ge",Bw="post_exp",lw="binop",jw="stableVarQuery",kw="EROFS",pw="Blob.compare_neq",_w="Region",dw="values",mw="..",hw="GOT.func",xw="Const",yw="cycle_balance",ww="rts_callback_table_count",gw="bigint_sleb128_encode",Iw=" mentioned in error at ",qw=8046,Ew="set_val: %s is const",Dw="regionStoreInt8",$w="cannot get %s when running locally",Tw=" or\n ",Nw="serialize_go",Pw="NatLit",Fw="leb128_decode",Gw="crc32Hash",Kw="f",Uw="get_upgrade_instructions",Ow="unbox64",Rw="%s@[(%a)@]",Mw="Nat16Lit",Lw="Float",Hw=195,Jw="buffer.ml",Vw="FuncE",Cw="to_candid argument must have shared type, but instead has non-shared type%a",Sw="idllib/arrange_idl.ml",zw="msg_caller_copy",Qw="root_key_copy",Zw="stableMemoryStoreInt8",Xw="stableMemoryLoadNat32",Ww=408,Yw="maxLiveSize",rg="deserialize_go (Region): unexpected idl_typ",ng='compile_const_exp/ObjE: "',tg="async",eg="B_eq",ug="bigint_abs",ag=240,fg="msg_reject_code",ig="stack_overflow",cg="stableMemoryLoadInt32",vg="regionStoreNat64",og=";",Ag=8044,sg="region_id",bg="record",Bg="CPSAwait answer type error",lg=" :",jg="with",kg='compile_const_exp/ObjE: "%s" not found',pg="regionLoadInt16",_g="B_neg",dg=375,mg="persistent",hg="Nat64",xg=7981,yg="__typtbl_end",wg="Blob.idx_bigint",gg=132,Ig="expected object type, but expression produces type\n ",qg="B_add",Eg="costSignWithEcdsa",Dg="finally",$g="decodeUtf8",Tg="maxStackSize",Ng="moc_stable_mem_get_version",Pg="B_div",Fg="__stablememory_load_word8",Gg="as_variant",Kg=-32,Ug="inner actor classes are not supported yet; any actor class must come last in your program",Og="canister_version",Rg="timer",Mg="exp",Lg="temp",Hg="recall_continuation",Jg="__stablememory_store_word32",Vg="%lx",Cg=": ",Sg="B_gt",zg="sanityChecks",Qg=371,Zg="stableMemoryGrow",Xg="regionStoreFloat",Wg="obj_scrut",Yg="rsh_Nat",rI=" in block",nI="start_gc_after_destabilization",tI="bigint_mul",eI="<:",uI="rotr",aI='internal error: const "%s": captures "%s", not found in static environment\n',fI="B_mul",iI=66447547,cI="AllocHow.join: cannot join StoreStatic and StoreHeap",vI="Odd: Type hash scratch space not empty",oI="actor_public_field",AI="Null",sI=-1073741824,bI=63,BI="<typ_bind>",lI=114,jI="nativeint_of_big_int",kI="regionStoreInt16",pI="@[<1>(%a%s)@]",_I="@[<hv 2>{@;<0 0>%a@;<0 -2>}@]",dI="[var ",mI="non-",hI="float64",xI="variable",yI=327,wI="Module",gI=111,II="Invalid UTF-8",qI="cannot infer type of forward field reference %s",EI=")",DI="int32",$I="?",TI="buffer_size: unexpected variant",NI="graph_destabilization_increment",PI=135,FI="public actor field needs to be a manifest function",GI="msg",KI="EALREADY",UI="region",OI=499,RI="ENOSPC",MI=495,LI="msg_reject",HI="bool",JI="class cannot be a query",VI="explode_Int64",CI="data_segment_blob",SI="val",zI="heartbeat",QI="unexpected `system` capability (try deleting it)",ZI=127,XI=190,WI="leb128_encode",YI="version",rq="expected array type, but expression produces type\n ",nq="<typ>",tq="ENETRESET",eq="try",uq="_bigarr02",aq="preupgrade",fq="bigint_count_bits",iq="data_certificate_present",cq="key_name",vq="BoolLit",oq="to_candid argument must have shared type, but instead has non-shared type",Aq="assertion failed at ",sq="newPages",bq="WildP",Bq="@[",lq="initialize_incremental_gc",jq="stable",kq="btstInt64",pq="call_new",_q="clzInt16",dq="idlHash only implemented in interpreter",mq="B_sub",hq="cannot accept cycles when running locally",xq="IDL error: left-over references ",yq="M0168",wq="Nat32->Char",gq="uncovered relop",Iq="menhir-recovery-lib/menhirRecoveryLib.ml",qq=253,Eq="ctz16",Dq="neg_trap",$q="cannot read balance when running locally",Tq="@@value_denominator",Nq="promising function cannot be local:\n ",Pq=" is const",Fq="ENOTTY",Gq="blob_iter_done",Kq="src",Uq="refs_start",Oq="nat8",Rq="InPreUpgrade",Mq=391,Lq=124,Hq="DIDL\0\0",Jq="uncaught throw",Vq="compile_binop",Cq="file$",Sq="Set.bal",zq="stream_write_text",Qq=1031864215,Zq=1024,Xq=246,Wq="canister_inspect_message",Yq=429,rE="BlockE",nE="alloc_stream",tE="@anon-",eE="Int8",uE="Blob size out of bounds",aE="idltyp1",fE="misplaced system visibility, did you mean private?",iE="migration expression consumes field `",cE="buffer_in_32_bit_range",vE="stream",oE="costSignWithSchnorr",AE="memorySize",sE=" <: ",bE="ctzInt16",BE="M0033",lE="expected object type, but expression produces type",jE="ir_passes/show.ml",kE="stream_shutdown",pE=781116926,_E="LitP",dE="\ncannot produce expected type",mE="this looks like an unintended function call, perhaps a missing ';'?",hE="#",xE="cost_sign_with_schnorr",yE="blobToArrayMut",wE="public ",gE=-822677911,IE=" of type",qE="table",EE="a",DE="blobToArray",$E=7979,TE="@[<2>field %s:@ %a@]",NE="regionLoadNat8",PE="IDL error: principal too long",FE="peek_future_continuation",GE="stableMemoryLoadInt8",KE="Nat->",UE=-10,OE="FloatLit",RE="Text",ME=776,LE="len_self",HE="IDL error: byte tag not 0 or 1",JE="__",VE=", expected one of token or <phrase> sequence:\n ",CE="type ",SE="IDL error: unexpected IDL type when parsing ",zE="res64",QE="B_ge",ZE="cannot reply when running locally",XE="operator may trap for inferred type%a",WE="M0064",YE="\0\0\0\0\0\0\0\0\0\0\0\0\0\0€\0\0ÿ\0\0\0\0\0\0\0\0\0\0\0\0",rD="Fatal error: exception %s\n",nD="cannot get actor-subnet-reference when running locally",tD=" := ",eD="compacting",uD="cannot compile library",aD="jsError",fD="rts_upgrade_instructions",iD="region_size",cD="IDL error: did not find field %s in record",vD="ENODEV",oD=" does not exist in ",AD=143,sD="can_recover",bD="to_var_type: UnboxedTuple",BD="pointer",lD="shared function with () result type has unexpected body:\n the body must either be of sugared form '{ ... }' \n or explicit form '= ignore ((async ...) : async ())'",jD="unvisited mutable data in serialize_go (MutBox)",kD="0",pD="moc_stable_memory_access_limit",_D="from_",dD="cannot infer type of forward field reference ",mD="field",hD="stable variable ",xD="set_local %i",yD=146,wD="cannot compute union of types containing recursive or forward references to other type definitions",gD=423,ID="@callback",qD="syntax",ED="Export ",DD="expected object type, but expression produces type\n %s",$D="system function timer is present but -no-timer flag is specified",TD="Text.compare_ge",ND="region0_get",PD="Idle",FD="field %s does not exist in %a%s",GD="cannot get root-key when running locally",KD="M0032",UD="cannot get deadline when running locally",OD="Query",RD="cannot get caller when running locally",MD="@cleanup_callback",LD="idx",HD="Memory",JD="@[<2>async%s@ %a@]",VD="region_page_count",CD="Public",SD="canister_error",zD="msg_cycles_accept128",QD="Passive data segments are not yet supported in the RTS module",ZD="clzInt32",XD="NewObjE",WD="M0039",YD="__stablemem_ensure",r$="$Ret",n$="<exp(ob)>",t$="viper/pretty.ml",e$="await*",u$="Any",a$="__collector_instructions",f$="null rel_buf",i$=",@ ",c$="nat32",v$="@buffer_size<",o$="<1>",A$="IDL error: incompatible function type",s$=428,b$="bigint_of_int32",B$="illegal control character in text literal",l$="fatan",j$="reclaimed",k$="explode_Int32",p$="<v 2>",_$="to_var_type: Const",d$="h_ptr",m$="__stack_pointer",h$=315,x$="higher stable memory version (expected 1..%s)",y$="ENOSYS",w$="chars",g$=" of previous type",I$="fsin",q$=1165,E$="actor classes with type parameters are not supported yet",D$=196,$$="TagE",T$=929,N$="alloc_words",P$=281,F$="IDL error: unexpecting primitive alias type",G$="as_array",K$="continuation_table_size",U$="word8",O$="utf8_valid",R$='/*\nThe primitive definitions.\n\nThis module should contain everything that cannot be implemented in plain\nMotoko. It is available via `import Prim "mo:⛔"`. Normal user code would\nusually not import that module directly, but through `base`, which takes\ncare of providing a proper module structure, e.g. exposing `Array_tabulate`\nthrough `Array.tabulate`.\n\nTherefore, the prim module does not need to provide a stable interface, as its\nonly supported consumer is the `base` library, and that is bundled with the\ncompiler.\n\nNevertheless, it shoud be _safe_ to import prim, i.e. the definitions here\nshould not break type safety or other guarantees of the language.\n*/\n\nmodule Types = {\n public type Any = prim "Any";\n public type None = prim "None";\n public type Null = prim "Null";\n public type Bool = prim "Bool";\n public type Nat = prim "Nat";\n public type Nat8 = prim "Nat8";\n public type Nat16 = prim "Nat16";\n public type Nat32 = prim "Nat32";\n public type Nat64 = prim "Nat64";\n public type Int = prim "Int";\n public type Int8 = prim "Int8";\n public type Int16 = prim "Int16";\n public type Int32 = prim "Int32";\n public type Int64 = prim "Int64";\n public type Float = prim "Float";\n public type Char = prim "Char";\n public type Text = prim "Text";\n public type Blob = prim "Blob";\n public type Error = prim "Error";\n public type Principal = prim "Principal";\n public type Region = prim "Region";\n};\n\nfunc abs(x : Int) : Nat { (prim "abs" : Int -> Nat) x };\nfunc shiftLeft(x : Nat, shift : Nat32) : Nat {\n (prim "lsh_Nat" : (Nat, Nat32) -> Nat)(x, shift);\n};\nfunc shiftRight(x : Nat, shift : Nat32) : Nat {\n (prim "rsh_Nat" : (Nat, Nat32) -> Nat)(x, shift);\n};\n\n// for testing\nfunc idlHash(x : Text) : Nat32 { (prim "idlHash" : Text -> Nat32) x };\n\n// Printing\n\nfunc debugPrint(x : Text) { (prim "print" : Text -> ()) x };\nfunc debugPrintNat(x : Nat) { debugPrint(@text_of_Nat x) };\nfunc debugPrintInt(x : Int) { debugPrint(@text_of_Int x) };\nfunc debugPrintChar(x : Char) { debugPrint(charToText x) };\n\n// Trapping\n\nfunc trap(x : Text) : None { (prim "trap" : Text -> None) x };\n\n// RTS stats\n\nfunc rts_version() : Text { (prim "rts_version" : () -> Text)() };\nfunc rts_memory_size() : Nat { (prim "rts_memory_size" : () -> Nat)() };\nfunc rts_heap_size() : Nat { (prim "rts_heap_size" : () -> Nat)() };\nfunc rts_total_allocation() : Nat {\n (prim "rts_total_allocation" : () -> Nat)();\n};\nfunc rts_reclaimed() : Nat { (prim "rts_reclaimed" : () -> Nat)() };\nfunc rts_max_live_size() : Nat { (prim "rts_max_live_size" : () -> Nat)() };\nfunc rts_max_stack_size() : Nat { (prim "rts_max_stack_size" : () -> Nat)() };\nfunc rts_callback_table_count() : Nat {\n (prim "rts_callback_table_count" : () -> Nat)();\n};\nfunc rts_callback_table_size() : Nat {\n (prim "rts_callback_table_size" : () -> Nat)();\n};\nfunc rts_mutator_instructions() : Nat {\n (prim "rts_mutator_instructions" : () -> Nat)();\n};\nfunc rts_collector_instructions() : Nat {\n (prim "rts_collector_instructions" : () -> Nat)();\n};\nfunc rts_upgrade_instructions() : Nat {\n (prim "rts_upgrade_instructions" : () -> Nat)();\n};\n\nfunc rts_stable_memory_size() : Nat {\n (prim "rts_stable_memory_size" : () -> Nat) ()\n};\n\nfunc rts_logical_stable_memory_size() : Nat {\n (prim "rts_logical_stable_memory_size" : () -> Nat) ()\n};\n\n// Total conversions (fixed to big)\n\nlet int64ToInt = @int64ToInt;\nlet int32ToInt = @int32ToInt;\nlet int16ToInt = @int16ToInt;\nlet int8ToInt = @int8ToInt;\nlet nat64ToNat = @nat64ToNat;\nlet nat32ToNat = @nat32ToNat;\nlet nat16ToNat = @nat16ToNat;\nlet nat8ToNat = @nat8ToNat;\n\n// Trapping conversions (big to fixed)\n\nfunc intToInt64(n : Int) : Int64 = (prim "num_conv_Int_Int64" : Int -> Int64) n;\nfunc intToInt32(n : Int) : Int32 = (prim "num_conv_Int_Int32" : Int -> Int32) n;\nfunc intToInt16(n : Int) : Int16 = (prim "num_conv_Int_Int16" : Int -> Int16) n;\nfunc intToInt8(n : Int) : Int8 = (prim "num_conv_Int_Int8" : Int -> Int8) n;\n\nfunc natToNat64(n : Nat) : Nat64 = (prim "num_conv_Nat_Nat64" : Nat -> Nat64) n;\nfunc natToNat32(n : Nat) : Nat32 = (prim "num_conv_Nat_Nat32" : Nat -> Nat32) n;\nfunc natToNat16(n : Nat) : Nat16 = (prim "num_conv_Nat_Nat16" : Nat -> Nat16) n;\nfunc natToNat8(n : Nat) : Nat8 = (prim "num_conv_Nat_Nat8" : Nat -> Nat8) n;\n\n// Wrapping conversions (big to fixed, and within fixed)\n\nfunc intToInt64Wrap(n : Int) : Int64 = (prim "num_wrap_Int_Int64" : Int -> Int64) n;\nfunc intToInt32Wrap(n : Int) : Int32 = (prim "num_wrap_Int_Int32" : Int -> Int32) n;\nfunc intToInt16Wrap(n : Int) : Int16 = (prim "num_wrap_Int_Int16" : Int -> Int16) n;\nfunc intToInt8Wrap(n : Int) : Int8 = (prim "num_wrap_Int_Int8" : Int -> Int8) n;\n\nfunc intToNat64Wrap(n : Int) : Nat64 = (prim "num_wrap_Int_Nat64" : Int -> Nat64) n;\nfunc intToNat32Wrap(n : Int) : Nat32 = (prim "num_wrap_Int_Nat32" : Int -> Nat32) n;\nfunc intToNat16Wrap(n : Int) : Nat16 = (prim "num_wrap_Int_Nat16" : Int -> Nat16) n;\nfunc intToNat8Wrap(n : Int) : Nat8 = (prim "num_wrap_Int_Nat8" : Int -> Nat8) n;\n\n// Across same width\nfunc int64ToNat64(n : Int64) : Nat64 = (prim "num_wrap_Int64_Nat64" : Int64 -> Nat64) n;\nfunc nat64ToInt64(n : Nat64) : Int64 = (prim "num_wrap_Nat64_Int64" : Nat64 -> Int64) n;\nfunc int32ToNat32(n : Int32) : Nat32 = (prim "num_wrap_Int32_Nat32" : Int32 -> Nat32) n;\nfunc nat32ToInt32(n : Nat32) : Int32 = (prim "num_wrap_Nat32_Int32" : Nat32 -> Int32) n;\nfunc int16ToNat16(n : Int16) : Nat16 = (prim "num_wrap_Int16_Nat16" : Int16 -> Nat16) n;\nfunc nat16ToInt16(n : Nat16) : Int16 = (prim "num_wrap_Nat16_Int16" : Nat16 -> Int16) n;\nfunc int8ToNat8(n : Int8) : Nat8 = (prim "num_wrap_Int8_Nat8" : Int8 -> Nat8) n;\nfunc nat8ToInt8(n : Nat8) : Int8 = (prim "num_wrap_Nat8_Int8" : Nat8 -> Int8) n;\n\n// Between adjacent widths\nfunc nat8ToNat16(n : Nat8) : Nat16 = (prim "num_conv_Nat8_Nat16" : Nat8 -> Nat16) n;\nfunc nat16ToNat32(n : Nat16) : Nat32 = (prim "num_conv_Nat16_Nat32" : Nat16 -> Nat32) n;\nfunc nat32ToNat64(n : Nat32) : Nat64 = (prim "num_conv_Nat32_Nat64" : Nat32 -> Nat64) n;\n\nfunc nat64ToNat32(n : Nat64) : Nat32 = (prim "num_conv_Nat64_Nat32" : Nat64 -> Nat32) n;\nfunc nat32ToNat16(n : Nat32) : Nat16 = (prim "num_conv_Nat32_Nat16" : Nat32 -> Nat16) n;\nfunc nat16ToNat8(n : Nat16) : Nat8 = (prim "num_conv_Nat16_Nat8" : Nat16 -> Nat8) n;\n\nfunc int8ToInt16(n : Int8) : Int16 = (prim "num_conv_Int8_Int16" : Int8 -> Int16) n;\nfunc int16ToInt32(n : Int16) : Int32 = (prim "num_conv_Int16_Int32" : Int16 -> Int32) n;\nfunc int32ToInt64(n : Int32) : Int64 = (prim "num_conv_Int32_Int64" : Int32 -> Int64) n;\n\nfunc int64ToInt32(n : Int64) : Int32 = (prim "num_conv_Int64_Int32" : Int64 -> Int32) n;\nfunc int32ToInt16(n : Int32) : Int16 = (prim "num_conv_Int32_Int16" : Int32 -> Int16) n;\nfunc int16ToInt8(n : Int16) : Int8 = (prim "num_conv_Int16_Int8" : Int16 -> Int8) n;\n\n\n// Exploding to bytes\nfunc explodeNat16(n : Nat16) : (msb : Nat8, lsb : Nat8) = (prim "explode_Nat16" : Nat16 -> (Nat8, Nat8)) n;\nfunc explodeInt16(n : Int16) : (msb : Nat8, lsb : Nat8) = (prim "explode_Int16" : Int16 -> (Nat8, Nat8)) n;\nfunc explodeNat32(n : Nat32) : (msb : Nat8, Nat8, Nat8, lsb : Nat8) = (prim "explode_Nat32" : Nat32 -> (Nat8, Nat8, Nat8, Nat8)) n;\nfunc explodeInt32(n : Int32) : (msb : Nat8, Nat8, Nat8, lsb : Nat8) = (prim "explode_Int32" : Int32 -> (Nat8, Nat8, Nat8, Nat8)) n;\nfunc explodeNat64(n : Nat64) : (msb : Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, lsb : Nat8) = (prim "explode_Nat64" : Nat64 -> (Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8)) n;\nfunc explodeInt64(n : Int64) : (msb : Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, lsb : Nat8) = (prim "explode_Int64" : Int64 -> (Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8, Nat8)) n;\n\n\n// Char conversion and properties\n\nfunc charToNat32(c : Char) : Nat32 = (prim "num_wrap_Char_Nat32" : Char -> Nat32) c;\nfunc nat32ToChar(w : Nat32) : Char = (prim "num_conv_Nat32_Char" : Nat32 -> Char) w;\n\nfunc charToText(c : Char) : Text = (prim "conv_Char_Text" : Char -> Text) c;\n\nfunc charToUpper(c : Char) : Char = (prim "char_to_upper" : Char -> Char) c;\nfunc charToLower(c : Char) : Char = (prim "char_to_lower" : Char -> Char) c;\nfunc charIsWhitespace(c : Char) : Bool = (prim "char_is_whitespace" : Char -> Bool) c;\nfunc charIsLowercase(c : Char) : Bool = (prim "char_is_lowercase" : Char -> Bool) c;\nfunc charIsUppercase(c : Char) : Bool = (prim "char_is_uppercase" : Char -> Bool) c;\nfunc charIsAlphabetic(c : Char) : Bool = (prim "char_is_alphabetic" : Char -> Bool) c;\n\n// Blob functions\n\nfunc blobCompare(b1 : Blob, b2 : Blob) : Int8 = (prim "blob_compare" : (Blob, Blob) -> Int8)(b1, b2);\nfunc hashBlob(b : Blob) : Nat32 { (prim "crc32Hash" : Blob -> Nat32) b };\n\n// Text conversion\nfunc decodeUtf8(b : Blob) : ?Text = (prim "decodeUtf8" : Blob -> ?Text) b;\nfunc encodeUtf8(t : Text) : Blob = (prim "encodeUtf8" : Text -> Blob) t;\n\n// Text comparison\nfunc textCompare(t1 : Text, t2 : Text) : Int8 = (prim "text_compare" : (Text, Text) -> Int8)(t1, t2);\n\n// Text lowercase\nfunc textLowercase(t : Text) : Text = (prim "text_lowercase" : (Text) -> Text) (t);\n// Text uppercase\nfunc textUppercase(t : Text) : Text = (prim "text_uppercase" : (Text) -> Text) (t);\n\n// Exotic bitwise operations\nfunc popcntNat8(w : Nat8) : Nat8 = (prim "popcnt8" : Nat8 -> Nat8) w;\nfunc clzNat8(w : Nat8) : Nat8 = (prim "clz8" : Nat8 -> Nat8) w;\nfunc ctzNat8(w : Nat8) : Nat8 = (prim "ctz8" : Nat8 -> Nat8) w;\nfunc btstNat8(w : Nat8, amount : Nat8) : Bool = (prim "btst8" : (Nat8, Nat8) -> Nat8)(w, amount) != (0 : Nat8);\n\nfunc popcntNat16(w : Nat16) : Nat16 = (prim "popcnt16" : Nat16 -> Nat16) w;\nfunc clzNat16(w : Nat16) : Nat16 = (prim "clz16" : Nat16 -> Nat16) w;\nfunc ctzNat16(w : Nat16) : Nat16 = (prim "ctz16" : Nat16 -> Nat16) w;\nfunc btstNat16(w : Nat16, amount : Nat16) : Bool = (prim "btst16" : (Nat16, Nat16) -> Nat16)(w, amount) != (0 : Nat16);\n\nfunc popcntNat32(w : Nat32) : Nat32 = (prim "popcnt32" : Nat32 -> Nat32) w;\nfunc clzNat32(w : Nat32) : Nat32 = (prim "clz32" : Nat32 -> Nat32) w;\nfunc ctzNat32(w : Nat32) : Nat32 = (prim "ctz32" : Nat32 -> Nat32) w;\nfunc btstNat32(w : Nat32, amount : Nat32) : Bool = (prim "btst32" : (Nat32, Nat32) -> Nat32)(w, amount) != (0 : Nat32);\n\nfunc popcntNat64(w : Nat64) : Nat64 = (prim "popcnt64" : Nat64 -> Nat64) w;\nfunc clzNat64(w : Nat64) : Nat64 = (prim "clz64" : Nat64 -> Nat64) w;\nfunc ctzNat64(w : Nat64) : Nat64 = (prim "ctz64" : Nat64 -> Nat64) w;\nfunc btstNat64(w : Nat64, amount : Nat64) : Bool = (prim "btst64" : (Nat64, Nat64) -> Nat64)(w, amount) != (0 : Nat64);\n\nfunc popcntInt8(w : Int8) : Int8 = (prim "popcntInt8" : Int8 -> Int8) w;\nfunc clzInt8(w : Int8) : Int8 = (prim "clzInt8" : Int8 -> Int8) w;\nfunc ctzInt8(w : Int8) : Int8 = (prim "ctzInt8" : Int8 -> Int8) w;\nfunc btstInt8(w : Int8, amount : Int8) : Bool = (prim "btstInt8" : (Int8, Int8) -> Int8) (w, amount) != (0 : Int8);\n\nfunc popcntInt16(w : Int16) : Int16 = (prim "popcntInt16" : Int16 -> Int16) w;\nfunc clzInt16(w : Int16) : Int16 = (prim "clzInt16" : Int16 -> Int16) w;\nfunc ctzInt16(w : Int16) : Int16 = (prim "ctzInt16" : Int16 -> Int16) w;\nfunc btstInt16(w : Int16, amount : Int16) : Bool = (prim "btstInt16" : (Int16, Int16) -> Int16) (w, amount) != (0 : Int16);\n\nfunc popcntInt32(w : Int32) : Int32 = (prim "popcntInt32" : Int32 -> Int32) w;\nfunc clzInt32(w : Int32) : Int32 = (prim "clzInt32" : Int32 -> Int32) w;\nfunc ctzInt32(w : Int32) : Int32 = (prim "ctzInt32" : Int32 -> Int32) w;\nfunc btstInt32(w : Int32, amount : Int32) : Bool = (prim "btstInt32" : (Int32, Int32) -> Int32)(w, amount) != (0 : Int32);\n\nfunc popcntInt64(w : Int64) : Int64 = (prim "popcntInt64" : Int64 -> Int64) w;\nfunc clzInt64(w : Int64) : Int64 = (prim "clzInt64" : Int64 -> Int64) w;\nfunc ctzInt64(w : Int64) : Int64 = (prim "ctzInt64" : Int64 -> Int64) w;\nfunc btstInt64(w : Int64, amount : Int64) : Bool = (prim "btstInt64" : (Int64, Int64) -> Int64)(w, amount) != (0 : Int64);\n\n// Float operations\n\nfunc floatAbs(f : Float) : Float = (prim "fabs" : Float -> Float) f;\nfunc floatSqrt(f : Float) : Float = (prim "fsqrt" : Float -> Float) f;\nfunc floatCeil(f : Float) : Float = (prim "fceil" : Float -> Float) f;\nfunc floatFloor(f : Float) : Float = (prim "ffloor" : Float -> Float) f;\nfunc floatTrunc(f : Float) : Float = (prim "ftrunc" : Float -> Float) f;\nfunc floatNearest(f : Float) : Float = (prim "fnearest" : Float -> Float) f;\nfunc floatMin(f : Float, g : Float) : Float = (prim "fmin" : (Float, Float) -> Float)(f, g);\nfunc floatMax(f : Float, g : Float) : Float = (prim "fmax" : (Float, Float) -> Float)(f, g);\nfunc floatCopySign(f : Float, g : Float) : Float = (prim "fcopysign" : (Float, Float) -> Float)(f, g);\nfunc floatToInt(f : Float) : Int = (prim "num_conv_Float_Int" : Float -> Int)(f);\nfunc intToFloat(n : Int) : Float = (prim "num_conv_Int_Float" : Int -> Float)(n);\nfunc floatToInt64(f : Float) : Int64 = (prim "num_conv_Float_Int64" : Float -> Int64)(f);\nfunc int64ToFloat(n : Int64) : Float = (prim "num_conv_Int64_Float" : Int64 -> Float)(n);\n\nlet floatToText = @text_of_Float;\n\n// Configurable Float formatter\n// mode:\n// 0) fixed format "%.*f"\n// 1) exponent format "%.*e"\n// 2) generic format "%.*g"\n// 3) hexadecimal format "%.*h"\n// _) invalid (traps)\nfunc floatToFormattedText(f : Float, prec : Nat8, mode : Nat8) : Text = (prim "fmtFloat->Text" : (Float, Nat8, Nat8) -> Text)(f, prec, mode);\n\n// Trigonometric and transcendental functions\n\nfunc sin(f : Float) : Float = (prim "fsin" : Float -> Float) f;\nfunc cos(f : Float) : Float = (prim "fcos" : Float -> Float) f;\nfunc tan(f : Float) : Float = (prim "ftan" : Float -> Float) f;\nfunc arcsin(f : Float) : Float = (prim "fasin" : Float -> Float) f;\nfunc arccos(f : Float) : Float = (prim "facos" : Float -> Float) f;\nfunc arctan(f : Float) : Float = (prim "fatan" : Float -> Float) f;\nfunc arctan2(y : Float, x