{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Util.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Types.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Numeric.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/lib/big.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Decimal.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Int32.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/lib/long.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Long.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Reflection.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/AsyncBuilder.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Option.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Choice.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Async.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Date.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/RegExp.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/String.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Global.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Array.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/FSharp.Collections.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/System.Text.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/FSharp.Core.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Seq.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/List.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/MapUtil.js","webpack:///./src/fable/fable_modules/Fable.Promise.3.1.3/Promise.fs.js","webpack:///./src/fable/fable_modules/Fable.Fetch.2.4.0/Fetch.fs.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Map.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/BigInt/n.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/BigInt/z.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/BigInt.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/TimeSpan.js","webpack:///./src/fable/fable_modules/Thoth.Json.4.1.0/Types.fs.js","webpack:///./src/fable/fable_modules/Thoth.Json.4.1.0/Encode.fs.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Guid.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/DateOffset.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Set.js","webpack:///./src/fable/fable_modules/Thoth.Json.4.1.0/Decode.fs.js","webpack:///./src/fable/fable_modules/Thoth.Fetch.2.0.0/Fetch.fs.js","webpack:///./src/fable/fable_modules/Dnn.Fable.Fetch.2.0.0/fetch.fs.js","webpack:///./src/fable/fable_modules/Fable.Elmish.3.1.0/prelude.fs.js","webpack:///./src/fable/fable_modules/Fable.Elmish.3.1.0/cmd.fs.js","webpack:///./src/fable/fable_modules/Feliz.1.57.0/Interop.fs.js","webpack:///./src/fable/fable_modules/Feliz.1.57.0/React.fs.js","webpack:///./src/fable/fable_modules/Feliz.1.57.0/ReactInterop.js","webpack:///./src/fable/Elements.fs.js","webpack:///./src/fable/fable_modules/fable-library.3.6.3/Range.js","webpack:///./src/fable/fable_modules/Fable.Elmish.3.1.0/ring.fs.js","webpack:///./src/fable/fable_modules/Fable.Elmish.3.1.0/program.fs.js","webpack:///./src/fable/fable_modules/Feliz.UseElmish.1.6.0/UseElmish.fs.js","webpack:///./src/fable/fable_modules/Feliz.UseDeferred.1.4.1/UseDeferred.fs.js","webpack:///./src/fable/Anbieterverzeichnis.fs.js","webpack:///./src/fable/Main.fs.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","isArrayLike","x","Array","isArray","ArrayBuffer","isView","isHashable","GetHashCode","isDisposable","Dispose","sameConstructor","y","getPrototypeOf","constructor","Enumerator","iter","this","current","cur","next","done","Error","getEnumerator","GetEnumerator","iterator","toIterator","en","hasNext","undefined","Lazy","factory","isValueCreated","createdValue","padWithZeros","str","toString","padLeftAndRightWithZeros","lengthLeft","lengthRight","dateOffset","date","date1","offset","kind","getTimezoneOffset","int32ToString","radix","ObjectRef","idMap","has","set","count","stringHash","h","len","charCodeAt","numberHash","combineHashCodes","hashes","reduce","h1","h2","structuralHash","arrayHash","Date","getTime","dateHash","values","map","v","id","equalArraysWith","eq","equalArrays","equals","Equals","isEquatable","compareDates","xKeys","keys","yKeys","sort","equalObjects","xtime","ytime","comparePrimitives","compareArrays","comp","compareArraysWith","compare","CompareTo","isComparable","compareObjects","min","comparer","max","createObj","fields","obj","kv","WeakMap","CURRIED","uncurry","arity","f","uncurried","res","_curry","args","arg","concat","curry","partialApply","mapCurriedArgs","fn","mappings","mapArg","idx","mapping","expectedArity","actualArity","seqToString","self","callStack","cons","entries","join","String","Union","fieldStr","withParens","indexOf","unionToString","tag","other","cases","recordToJSON","recordToString","recordGetHashCode","recordEquals","thisNames","recordCompareTo","Record","FSharpRef","contentsOrGetter","setter","symbol","isNumeric","multiply","toFixed","dp","toPrecision","sd","toExponential","toHex","Number","P","_this","mul","e","cmp","NAME","INVALID","INVALID_DP","NUMERIC","parse","nl","test","charAt","replace","search","substring","round","Big","DP","RM","rm","more","xc","isZero","findIndex","xci","unshift","pop","stringify","doExponential","isNonzero","abs","isneg","yc","k","Math","div","a","b","bl","bt","ri","bz","ai","al","rl","q","qc","qi","gt","gte","lt","lte","minus","sub","xlty","plus","xe","ye","reverse","mod","ygtx","times","add","pow","one","prec","sqrt","half","toJSON","NE","PE","toNumber","strict","valueOf","_Big_","normalize","TypeError","Decimal","NumberStyles","getRange","unsigned","bitsize","isValid","style","exec","prefix","digits","getInvalidDigits","AllowHexSpecifier","getRadix","regexMatch","sign","validResponse","parseInt","isNaN","umin","umax","tryParse","defValue","contents","_a","op_UnaryNegation_Int32","wasm","WebAssembly","Instance","Module","Uint8Array","Long","low","high","isLong","substr","fromBytes","toBytes","__isLong__","INT_CACHE","UINT_CACHE","fromInt","cachedObj","cache","fromBits","fromNumber","UZERO","ZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","negate","TWO_PWR_32_DBL","lowBits","highBits","pow_dbl","fromString","RangeError","radixToPower","size","fromValue","val","TWO_PWR_16_DBL","TWO_PWR_24","ONE","UONE","NEG_ONE","toInt","$this","isNegative","radixLong","divide","rem1","subtract","rem","remDiv","isOdd","lessThan","greaterThan","greaterThanOrEqual","thisNeg","otherNeg","not","addend","a48","a32","a16","a00","b48","b32","b16","c48","c32","c16","c00","subtrahend","multiplier","get_high","b00","divisor","approx","div_u","div_s","toUnsigned","shiftRightUnsigned","shiftLeft","shiftRight","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","numBits","le","hi","lo","toBytesLE","toBytesBE","bytes","fromBytesLE","fromBytesBE","LongLib","op_Addition","op_Multiply","op_Division","op_Modulus","rem_u","rem_s","op_UnaryNegation","op_BitwiseAnd","fromInteger","xh","_bitsize","maxValue","getMaxValue","toUpperCase","padStart","TypeInfo","fullname","generics","construct","parent","enumCases","fullName","getHashCode","getGenerics","fullnameHash","genHashes","t1","t2","getRecordElements","k1","v1","k2","v2","record_type","option_type","generic","list_type","obj_type","string_type","info","elemType","getElementType","lastIndexOf","isGenericType","isEnum","getGenericTypeDefinition","getEnumUnderlyingType","getEnumValues","getEnumCase","parseEnum","getUnionCases","getTupleElements","isTuple","isUnion","isRecord","startsWith","getUnionCaseFields","uci","makeUnion","expectedLength","declaringType","CancellationToken","cancelled","_id","_cancelled","_listeners","Map","listener","state","$","addListener","removeListener","OperationCanceledError","setPrototypeOf","Trampoline","callCount","maxTrampolineCallCount","setTimeout","protectedCont","ctx","cancelToken","isCancelled","onCancel","trampoline","incrementAndCheck","hijack","err","onError","protectedBind","computation","binder","onSuccess","ex","protectedReturn","singleton","computation1","computation2","Bind","generator","sequence","body","While","Delay","compensation","catchHandler","ex2","resource","TryFinally","guard","Return","Some","some","defaultArg","opt","defaultValue","FSharpResult$2","Result_Map","emptyContinuation","_x","createCancellationToken","token","cancel","awaitPromise","conts","then","defaultCancellationToken","startImmediate","cancellationToken","startWithContinuations","start","continuation","exceptionContinuation","cancellationContinuation","dateOffsetToString","isMinus","minutes","dateToHalfUTCString","toISOString","dateToStringWithCustomFormat","format","utc","match","rep","NaN","getUTCFullYear","getFullYear","getUTCMonth","getMonth","getUTCDate","getDate","getUTCHours","getHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCMilliseconds","getMilliseconds","dateToStringWithOffset","_b","_c","dateWithOffset","dateToStringWithKind","toUTCString","toLocaleString","toLocaleDateString","toLocaleTimeString","printOffset","dateToISOString","_provider","DateTime","parseRaw","input","fail","trim","baseDate","timeInSeconds","timeParts","split","parseFloat","offsetInMinutes","detectUTC","_err","pattern","options","flags","RegExp","escape","matches","reg","startAt","lastIndex","global","fsFormatRegExp","formatRegExp","isLessThan","numericCompare","printf","cont","strParts","strIdx","matchIndex","index","createPrinter","_strParts","_matches","_result","padArg","_padLength","precision","padLength","formatReplacement","continuePrint","toText","toFail","toLowerCase","dateToString","zeroFlag","minusFlag","ch","padLeft","_","intPart","decimalPart","decimalPartLength","thousandGroups","thousands","intPartLength","delimiter","xs","from","isRight","splitters","removeEmpty","filter","splits","findSplits","candidate","SR_notEnoughElements","Helpers_allocateArrayFromCons","differentLengths","fill","target","targetIndex","source","initialize","initializer","fold","folder","array","delegateArg0","delegateArg1","foldBack","reduceRight","foldBack2","array1","array2","acc","foldBackIndexed2","_arg1","ComparisonIdentity_Structural","e1","e2","Compare","x_1","LanguagePrimitives_FastGenericComparer","Enumerator_notStarted","Enumerator_alreadyFinished","Enumerator_Seq","Enumerator_FromFunctions$1","dispose","Enumerator_noReset","Enumerator_FromFunctions$1_$ctor_58C54629","Enumerator_enumerateThenFinally","Enumerator_generateWhileSome","openf","compute","closef","started","curr","value_1","finish","matchValue_1","matchValue","checkNonNull","argName","Operators_NullArg","mkSeq","Enumerator_Seq_$ctor_673A07F2","ofSeq","delay","sources","outerOpt","innerOpt","finished","inner","outer","inner_1","outer_1","ie","Enumerator_concat","unfold","st_1","Enumerator_unfold","ar","singleton_1","generate","generateIndexed","append","ys","contains","found","chooser","e_1","choose","iterate","action","unitVar0","mapIndexed","skip","collect","FSharpList","head","tail","xs_1_mut","ys_1_mut","loop","xs_1","ys_1","xt","yt","i_mut","h_mut","_key","ListEnumerator$1","ListEnumerator$1_$ctor_3002E699","it","FSharpList_get_Empty","FSharpList_Cons_305B8EAC","FSharpList__get_IsEmpty","FSharpList__get_Length","FSharpList__get_Head","SR_inputWasEmpty","FSharpList__get_Tail","empty","isEmpty","toArray","ofArrayWithTail","tail_1","ofArray","root","node","t_2","tryFindIndex","sortWith","arr","count_mut","xs_mut","CaseRules","dashify","separator","changeCase","caseRule","keyValueList","definedCaseRule","kvPair","assign","tryGetValue","PromiseBuilder","PromiseBuilder__Delay_62FBFDE1","er","Promise","reject","resolve","er_1","catch","onError_1","er_2","a_1","er_3","PromiseBuilder__Run_212F1D4B","Types_HttpRequestHeaders","Types_RequestProperties","MapTreeLeaf$2","MapTreeLeaf$2_$ctor_5BDDA1","MapTreeLeaf$2__get_Key","MapTreeLeaf$2__get_Value","MapTreeNode$2","left","right","MapTreeNode$2_$ctor_499A11FD","MapTreeNode$2__get_Left","MapTreeNode$2__get_Right","MapTreeNode$2__get_Height","MapTreeModule_size","MapTreeModule_sizeAux","acc_mut","m_mut","m2","MapTreeModule_mk","hl","hr","m_2","MapTreeModule_rebalance","m2_2","m_3","m2_3","t1h","t2h","matchValue_2","matchValue_3","MapTreeModule_add","MapTreeModule_empty","MapTreeModule_tryFind","comparer_mut","k_mut","MapTreeModule_iter","MapTreeModule_iterOpt","f_mut","MapTreeModule_mapi","MapTreeModule_mapiOpt","l2","r2","MapTreeModule_copyToArray","MapTreeModule_ofArray","forLoopVar","MapTreeModule_ofSeq","fold_1","tupledArg","MapTreeModule_ofList","e_mut","patternInput","MapTreeModule_mkFromEnumerator","MapTreeModule_MapIterator$2","stack","MapTreeModule_collapseLHS","stack_mut","isEmpty_1","empty_1","rest","MapTreeModule_mkIterator","MapTreeModule_current","MapTreeModule_alreadyFinished","MapTreeModule_notStarted","MapTreeModule_mkIEnumerator","MapTreeModule_moveNext","MapTreeModule_toSeq","en_1","FSharpMap","tree","this$","combineHash","enumerator","activePatternResult5790","FSharpMap__ComputeHashCode","that","m1","e1c","e2c","map_1","b1","b2","compareWith","kvp1","kvp2","FSharpMap__ContainsKey","FSharpMap__get_Item","FSharpMap__get_Count","thisArg","iterate_1","FSharpMap_$ctor","FSharpMap_Create","MapTreeModule_find","MapTreeModule_mem","table","FSharpMap__Add","tryFind","FSharpMap__TryFind","elements","BigNat","bound","BigNatModule_FFT_pow32","x_mut","n_mut","BigNatModule_FFT_maxTwoPower","Int32Array","BigNatModule_bound","BigNatModule_coeff","BigNatModule_coeff64","BigNatModule_setCoeff","BigNatModule_pow64","BigNatModule_pow32","BigNatModule_baseNi64","BigNatModule_baseMaski64","BigNatModule_createN","BigNatModule_normN","na_mut","na","findLeastBound","BigNatModule_embed","r_1","BigNatModule_boundInt","BigNatModule_eval32","BigNatModule_one","BigNatModule_zero","BigNatModule_degree","BigNatModule_isZero","BigNatModule_equal","pa_mut","qa_mut","pa","qa","check","BigNatModule_compare","BigNatModule_lt","BigNatModule_mulSchoolBookCarry","r_mut","c_mut","rak","BigNatModule_mulSchoolBookOneSmall","bp","q_1","BigNatModule_mulSchoolBook","pSmall","qSmall","BigNatModule_mulSchoolBookBothSmall","ra","pai","qaj","BigNatModule_mulSchoolBookNeitherSmall","BigNatModule_encoding","bigL","twoToBigL","bigK","bigN","BigNatModule_mkEncoding","BigNatModule_table","BigNatModule_mul","BigNatModule_scaleSubInPlace","patternInput_1","ad","f_1","z","zLo","zHi","BigNatModule_scaleAddInPlace","BigNatModule_removeFactor","degx","dega","pn","qn","xa","aa","qai","BigNatModule_divmod","BigNatModule_copyN","BigNatModule_ofInt32","BigNatModule_ofInt64","BigNatModule_boundInt64","BigNatModule_embed64","BigNatModule_toString","degn","digits_4","isLeading_mut","digits_mut","n_1_mut","_arg1_mut","isLeading","n_1","n_2","prior_1","nL","nH","prior_mut","ten2k_mut","prior","ten2k","route","BigNatModule_isSmall","BigNatModule_getSmall","BigInteger","signInt","BigInteger__get_SignInt","BigInteger__get_V","BigInteger_op_Equality_56F059C0","BigNatModule_hash","nn","BigInteger_op_LessThan_56F059C0","BigInteger_$ctor_Z2BE94A1","BigInteger_nat_Z67CCE57D","smallLim","smallPosTab","BigInteger_$ctor_Z524259A4","BigInteger_get_One","BigInteger_get_Two","two","BigInteger_get_Zero","zero","signedRound","ms","arguments","fromTicks","ticks","Long_toNumber","Long_op_Division","days","ts","hours","seconds","milliseconds","firstDot","firstColon","ErrorReason","CaseStrategy","Util_Cache$1","Util_Cache$1_$ctor","Util_Cache$1__GetOrAdd_43981464","__","outArg","dict","addToDict","Util_CachedEncoders","Util_CachedDecoders","Util_Casing_lowerFirst","Util_Casing_convert","caseStrategy","fieldName","replacement","limit","replacer","withGroups","pLast","groups","tmp","_s","sub1","sub2","seq","timespan","toString_4","sbyte","byte","int16","uint16","unit","space","JSON","option","encoder","defThunk","autoEncodeRecordsAndUnions","extra","skipNullField","encoderRef","extra_1","setters","fi","targetKey","encode_1","autoEncoder","field","getRecordField","source_1","target_1","set$","message","arg10","case_","getUnionFields","fieldTypes","target_2","encode_2","map_2","enumType","value_2","value_3","value_4","value_5","value_7","clo2","arg20","encoders","value_9","fullname_1","encoder_2","value_10","Value","encoder_3","value_11","keyType","valueEncoder","value_12","activePatternResult11201","keyEncoder","clo4","arg40","value_13","_arg2","activePatternResult11205","value_14","value_16","value_18","value_19","value_20","value_21","value_22","value_24","value_26","value_28","value_30","toString_3","datetime","value_31","datetimeOffset","value_32","value_33","makeExtra","map_3","Coders","guidRegex","guidRegexNoHyphen","guidRegexHex","hyphenateGuid","wsTrimAndLowered","chars","DateTimeOffset","checkOffsetInRange","offsetMatch","SetTreeLeaf$1","SetTreeLeaf$1_$ctor_2B595","SetTreeLeaf$1__get_Key","SetTreeNode$1","SetTreeNode$1_$ctor_Z6E7BE5F7","SetTreeNode$1__get_Left","SetTreeNode$1__get_Right","SetTreeNode$1__get_Height","SetTreeModule_count","SetTreeModule_countAux","t_mut","SetTreeModule_mk","SetTreeModule_rebalance","t2_3","t_3","t2_4","SetTreeModule_add","c_1","SetTreeModule_empty","SetTreeModule_mem","SetTreeModule_iter","SetTreeModule_SetIterator$1","SetTreeModule_collapseLHS","x2","SetTreeModule_mkIterator","SetTreeModule_current","SetTreeModule_alreadyFinished","SetTreeModule_notStarted","SetTreeModule_mkIEnumerator","SetTreeModule_moveNext","SetTreeModule_compare","l1_mut","l2_mut","SetTreeModule_compareStacks","l1","x1_3","x2_3","pattern_matching_result","t1_6","x1_4","t2_6","x2_4","matchValue_4","pattern_matching_result_1","t1_7","x1_5","t2_7","x2_5","c_3","c_2","matchValue_5","pattern_matching_result_2","t1_8","x1_6","t2_8","x2_6","pattern_matching_result_3","t1_2","x1","t2_2","x2_1","pattern_matching_result_4","t1_4","x1_2","x2_2","SetTreeModule_copyToArray","SetTreeModule_ofArray","SetTreeModule_ofSeq","fold_2","SetTreeModule_ofList","SetTreeModule_mkFromEnumerator","FSharpSet","FSharpSet__ComputeHashCode","FSharpSet__get_Comparer","FSharpSet__get_Tree","FSharpSet__get_Count","FSharpSet__Contains","FSharpSet_$ctor","genericMsg","msg","newLine","errorToString","path","error","reason_1","decoder","SyntaxError","path_1","isFinite","tryParse_3","name_1","int","uint32","tryParse_6","tryParse_7","requestedIndex","copyOfStruct","currentPath","vArray","list","list_1","tokens","acc_1","succeed","output","andThen","cb","ctor","d1","tuple2","decoder1","decoder2","decoder_3","path_3","decoder_2","decoder_1","path_2","arg10$0040","arg20$0040","toSet","mixedArray","decoders","arg30","predicate","name_3","find","uci_1","makeUnion_1","values_1","autoDecoder","autoDecodeRecordsAndUnions","isOptional","decoderRef","makeRecord","decoderInfos","autoObject","decoder_15","tryFind_1","enumValue","path_4","path_5","value_8","enumValue_1","y_1","path_6","t_4","path_7","enumValue_2","x_2","y_2","path_8","t_5","path_9","enumValue_3","x_3","y_3","path_10","t_6","path_11","value_17","enumValue_4","x_4","y_4","path_12","t_7","path_13","matchValue_6","enumValue_5","x_5","y_5","clo3","t_8","path_14","decoder_13","path_15","arg0","decoder_14","path_16","value_23","keyDecoder","valueDecoder","decoders_1","path_17","autoObject2","path_18","value_25","path_19","decoders_1_mut","errors_mut","errors","head_1","append_1","runner","oneOf","path_20","ofSeq_1","decoder_16","path_21","value_29","matchValue_7","path_22","path_23","path_24","path_25","value_34","path_26","value_35","path_27","value_36","path_28","value_37","path_29","value_38","tryParse_8","path_30","value_39","tryParse_2","guid","_arg1_6","FetchError","Helper_withContentTypeJson","headers","Helper_encode","dataResolver","resolver","ResolveType","caseStrategy_1","skipNullField_1","toString_5","Hash","Auto_generateEncoderCached_Z127D9D79","Helper_resolve","response","responseResolver","eitherUnitOr","value_40","toString_12","map_4","Auto_generateDecoderCached_7848D058","responseResolver_1","Helper_eitherUnit","promise","ok","text","Fetch_tryFetchAs_25B10BBE","url","httpMethod","properties","headers_2","properties_3","custom","list2","Helper_withProperties","data_1","Helper_withBody","init","fetch","Helper_fetch","exn","Fetch_fetchAs_25B10BBE","response_1","status","statusText","Helper_message","ServicesFramework_moduleHeaders","sf","getModuleId","getTabId","getAntiForgeryValue","ServicesFramework_setup$0027","isGet","moduleName","props","ServicesFramework","serviceroot","getServiceRoot","props_1","Url","Headers","Props","Fetch_get_511FB67E","Fetch_fetchAs_511FB67E","Log_onError","console","Cmd_exec","dispatch","cmd","Cmd_none","Cmd_batch","cmds","lists","forEach","xs_6","Interop_reactApi","react","ReactInterop_useEffectWithDeps","getDisposable","deps","useEffectReact","disposable","React_createDisposable_3A5B6456","useReact_useState_FCFD9EF","useState","useReact_useEffect_Z5234A374","effect","dependencies","useReact_useEffectOnce_Z5ECA432F","useReact_useEffect_Z101E1A95","_arg4","useReact_useRef_1505","initialValue","useRef","useFeliz_React__React_useState_Static_1505","initial","NumberOfCols","Icon_icon","classes","createElement","className","Icon_right","Icon_left","Icon_search","Icon_envelopeOpen","Icon_phone","Icon_stimmeAbgegeben$0027","children","Children","Icon_stimmeOhne$0027","Icon_spin","Button_bigLink","hint","handler","title","onClick","evn","preventDefault","BootstrapModule_col","BootstrapModule_Pager","setPage","page","pagesize","PageSize","pageCount","List","page_1","Header","RenderContainer","RenderElement","integralRangeStep","step","stop","stepFn","stepComparedWithZero","stepGreaterThanZero","comparedWithLast","makeRangeStepFunction","RingState$1","RingBuffer$1","RingBuffer$1__Push_2B595","item","wix_1","rix","items_1","wix$0027","ix","items","RingBuffer$1__doubleSize","wix","Program$4","update","subscribe","view","setState","syncDispatch","ProgramModule_mkProgram","model","ProgramModule_runWith","program","rb","reentered","nextMsg","msg_1","model$0027","ex_1","rix$0027","RingBuffer$1__Pop","ex_3","ex_2","ElmishObservable$2","hasDisposedOnce","dispatcher","ElmishObservable$2_$ctor","runProgram","obs","unitVar3","ProgramModule_withSetState","arg00","ElmishObservable$2__SetState","useFeliz_React__React_useElmish_Static_76E709","ElmishObservable$2__DisposeState","ElmishObservable$2__Dispatch_2B594","useFeliz_React__React_useElmish_Static_Z151674B","Deferred$1","Types_Eintrag","Firma","Stadt","Land","Adresse","Adresse2","PLZ","Homepage","Telefon","Email","T$00E4tigkeitsfelder","Leistungen","Types_Eintrag$reflection","Types_Filter","Suchbegriff","Types_Model","Eintr$00E4ge","Gefiltert","Filter","Types_Msg","State_apply","filter_1","begriffe","toLocaleUpperCase","s_1","Eintrag","eintragInputProps","children_4","eintrag","leistungen","toConsole","href","hp","l_1","filter_4","elm","tags","filter_5","kvp","ev","eintr$00E4geInputProps","projection","eintr$00E4ge_1","eintr$00E4ge","filter_2","filter_3","l$0027","e_2","State_update","_arg3","model_1","Verzeichnis","verzeichnisInputProps","operation","token_1","setDeferred","cts","executeOperation","TryWith","Zero","useFeliz_React__React_useDeferred_Static_2344FC52","moduleid","ReturnFrom","Deferred_render","container","document","getElementById","dataset","render"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,G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CAC9BU,SAAU7kD,KACVglD","file":"app.0.0.3.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"~/desktopModules/MVC/dgzfp.bc.anbieterverzeichnis\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([3,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","// tslint:disable:ban-types\nexport function isIterable(x) {\n return x != null && typeof x === \"object\" && Symbol.iterator in x;\n}\nexport function isArrayLike(x) {\n return Array.isArray(x) || ArrayBuffer.isView(x);\n}\nfunction isComparer(x) {\n return typeof x.Compare === \"function\";\n}\nfunction isComparable(x) {\n return typeof x.CompareTo === \"function\";\n}\nfunction isEquatable(x) {\n return typeof x.Equals === \"function\";\n}\nfunction isHashable(x) {\n return typeof x.GetHashCode === \"function\";\n}\nexport function isDisposable(x) {\n return x != null && typeof x.Dispose === \"function\";\n}\nexport function sameConstructor(x, y) {\n return Object.getPrototypeOf(x).constructor === Object.getPrototypeOf(y).constructor;\n}\nexport class Enumerator {\n constructor(iter) {\n this.iter = iter;\n }\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.MoveNext\"]() {\n const cur = this.iter.next();\n this.current = cur.value;\n return !cur.done;\n }\n [\"System.Collections.IEnumerator.Reset\"]() {\n throw new Error(\"JS iterators cannot be reset\");\n }\n Dispose() {\n return;\n }\n}\nexport function getEnumerator(o) {\n return typeof o.GetEnumerator === \"function\"\n ? o.GetEnumerator()\n : new Enumerator(o[Symbol.iterator]());\n}\nexport function toIterator(en) {\n return {\n [Symbol.iterator]() { return this; },\n next() {\n const hasNext = en[\"System.Collections.IEnumerator.MoveNext\"]();\n const current = hasNext ? en[\"System.Collections.IEnumerator.get_Current\"]() : undefined;\n return { done: !hasNext, value: current };\n },\n };\n}\nexport class Comparer {\n constructor(f) {\n this.Compare = f || compare;\n }\n}\nexport function comparerFromEqualityComparer(comparer) {\n // Sometimes IEqualityComparer also implements IComparer\n if (isComparer(comparer)) {\n return new Comparer(comparer.Compare);\n }\n else {\n return new Comparer((x, y) => {\n const xhash = comparer.GetHashCode(x);\n const yhash = comparer.GetHashCode(y);\n if (xhash === yhash) {\n return comparer.Equals(x, y) ? 0 : -1;\n }\n else {\n return xhash < yhash ? -1 : 1;\n }\n });\n }\n}\nexport function assertEqual(actual, expected, msg) {\n if (!equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport function assertNotEqual(actual, expected, msg) {\n if (equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport class Lazy {\n constructor(factory) {\n this.factory = factory;\n this.isValueCreated = false;\n }\n get Value() {\n if (!this.isValueCreated) {\n this.createdValue = this.factory();\n this.isValueCreated = true;\n }\n return this.createdValue;\n }\n get IsValueCreated() {\n return this.isValueCreated;\n }\n}\nexport function lazyFromValue(v) {\n return new Lazy(() => v);\n}\nexport function padWithZeros(i, length) {\n let str = i.toString(10);\n while (str.length < length) {\n str = \"0\" + str;\n }\n return str;\n}\nexport function padLeftAndRightWithZeros(i, lengthLeft, lengthRight) {\n let str = i.toString(10);\n while (str.length < lengthLeft) {\n str = \"0\" + str;\n }\n while (str.length < lengthRight) {\n str = str + \"0\";\n }\n return str;\n}\nexport function dateOffset(date) {\n const date1 = date;\n return typeof date1.offset === \"number\"\n ? date1.offset\n : (date.kind === 1 /* UTC */\n ? 0 : date.getTimezoneOffset() * -60000);\n}\nexport function int16ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport function int32ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFFFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport class ObjectRef {\n static id(o) {\n if (!ObjectRef.idMap.has(o)) {\n ObjectRef.idMap.set(o, ++ObjectRef.count);\n }\n return ObjectRef.idMap.get(o);\n }\n}\nObjectRef.idMap = new WeakMap();\nObjectRef.count = 0;\nexport function stringHash(s) {\n let i = 0;\n let h = 5381;\n const len = s.length;\n while (i < len) {\n h = (h * 33) ^ s.charCodeAt(i++);\n }\n return h;\n}\nexport function numberHash(x) {\n return x * 2654435761 | 0;\n}\n// From https://stackoverflow.com/a/37449594\nexport function combineHashCodes(hashes) {\n if (hashes.length === 0) {\n return 0;\n }\n return hashes.reduce((h1, h2) => {\n return ((h1 << 5) + h1) ^ h2;\n });\n}\nexport function physicalHash(x) {\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default:\n return numberHash(ObjectRef.id(x));\n }\n}\nexport function identityHash(x) {\n if (x == null) {\n return 0;\n }\n else if (isHashable(x)) {\n return x.GetHashCode();\n }\n else {\n return physicalHash(x);\n }\n}\nexport function dateHash(x) {\n return x.getTime();\n}\nexport function arrayHash(x) {\n const len = x.length;\n const hashes = new Array(len);\n for (let i = 0; i < len; i++) {\n hashes[i] = structuralHash(x[i]);\n }\n return combineHashCodes(hashes);\n}\nexport function structuralHash(x) {\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default: {\n if (isHashable(x)) {\n return x.GetHashCode();\n }\n else if (isArrayLike(x)) {\n return arrayHash(x);\n }\n else if (x instanceof Date) {\n return dateHash(x);\n }\n else if (Object.getPrototypeOf(x).constructor === Object) {\n // TODO: check call-stack to prevent cyclic objects?\n const hashes = Object.values(x).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n }\n else {\n // Classes don't implement GetHashCode by default, but must use identity hashing\n return numberHash(ObjectRef.id(x));\n // return stringHash(String(x));\n }\n }\n }\n}\n// Intended for custom numeric types, like long or decimal\nexport function fastStructuralHash(x) {\n return stringHash(String(x));\n}\n// Intended for declared types that may or may not implement GetHashCode\nexport function safeHash(x) {\n return x == null ? 0 : isHashable(x) ? x.GetHashCode() : numberHash(ObjectRef.id(x));\n}\nexport function equalArraysWith(x, y, eq) {\n if (x == null) {\n return y == null;\n }\n if (y == null) {\n return false;\n }\n if (x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; i++) {\n if (!eq(x[i], y[i])) {\n return false;\n }\n }\n return true;\n}\nexport function equalArrays(x, y) {\n return equalArraysWith(x, y, equals);\n}\nfunction equalObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return false;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0; i < xKeys.length; i++) {\n if (xKeys[i] !== yKeys[i] || !equals(x[xKeys[i]], y[yKeys[i]])) {\n return false;\n }\n }\n return true;\n}\nexport function equals(x, y) {\n if (x === y) {\n return true;\n }\n else if (x == null) {\n return y == null;\n }\n else if (y == null) {\n return false;\n }\n else if (typeof x !== \"object\") {\n return false;\n }\n else if (isEquatable(x)) {\n return x.Equals(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) && equalArrays(x, y);\n }\n else if (x instanceof Date) {\n return (y instanceof Date) && compareDates(x, y) === 0;\n }\n else {\n return Object.getPrototypeOf(x).constructor === Object && equalObjects(x, y);\n }\n}\nexport function compareDates(x, y) {\n let xtime;\n let ytime;\n // DateTimeOffset and DateTime deals with equality differently.\n if (\"offset\" in x && \"offset\" in y) {\n xtime = x.getTime();\n ytime = y.getTime();\n }\n else {\n xtime = x.getTime() + dateOffset(x);\n ytime = y.getTime() + dateOffset(y);\n }\n return xtime === ytime ? 0 : (xtime < ytime ? -1 : 1);\n}\nexport function comparePrimitives(x, y) {\n return x === y ? 0 : (x < y ? -1 : 1);\n}\nexport function compareArraysWith(x, y, comp) {\n if (x == null) {\n return y == null ? 0 : 1;\n }\n if (y == null) {\n return -1;\n }\n if (x.length !== y.length) {\n return x.length < y.length ? -1 : 1;\n }\n for (let i = 0, j = 0; i < x.length; i++) {\n j = comp(x[i], y[i]);\n if (j !== 0) {\n return j;\n }\n }\n return 0;\n}\nexport function compareArrays(x, y) {\n return compareArraysWith(x, y, compare);\n}\nfunction compareObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return xKeys.length < yKeys.length ? -1 : 1;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0, j = 0; i < xKeys.length; i++) {\n const key = xKeys[i];\n if (key !== yKeys[i]) {\n return key < yKeys[i] ? -1 : 1;\n }\n else {\n j = compare(x[key], y[key]);\n if (j !== 0) {\n return j;\n }\n }\n }\n return 0;\n}\nexport function compare(x, y) {\n if (x === y) {\n return 0;\n }\n else if (x == null) {\n return y == null ? 0 : -1;\n }\n else if (y == null) {\n return 1;\n }\n else if (typeof x !== \"object\") {\n return x < y ? -1 : 1;\n }\n else if (isComparable(x)) {\n return x.CompareTo(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) ? compareArrays(x, y) : -1;\n }\n else if (x instanceof Date) {\n return y instanceof Date ? compareDates(x, y) : -1;\n }\n else {\n return Object.getPrototypeOf(x).constructor === Object ? compareObjects(x, y) : -1;\n }\n}\nexport function min(comparer, x, y) {\n return comparer(x, y) < 0 ? x : y;\n}\nexport function max(comparer, x, y) {\n return comparer(x, y) > 0 ? x : y;\n}\nexport function clamp(comparer, value, min, max) {\n return (comparer(value, min) < 0) ? min : (comparer(value, max) > 0) ? max : value;\n}\nexport function createAtom(value) {\n let atom = value;\n return (value, isSetter) => {\n if (!isSetter) {\n return atom;\n }\n else {\n atom = value;\n return void 0;\n }\n };\n}\nexport function createObj(fields) {\n const obj = {};\n for (const kv of fields) {\n obj[kv[0]] = kv[1];\n }\n return obj;\n}\nexport function jsOptions(mutator) {\n const opts = {};\n mutator(opts);\n return opts;\n}\nexport function round(value, digits = 0) {\n const m = Math.pow(10, digits);\n const n = +(digits ? value * m : value).toFixed(8);\n const i = Math.floor(n);\n const f = n - i;\n const e = 1e-8;\n const r = (f > 0.5 - e && f < 0.5 + e) ? ((i % 2 === 0) ? i : i + 1) : Math.round(n);\n return digits ? r / m : r;\n}\nexport function sign(x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n}\nexport function randomNext(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}\nexport function randomBytes(buffer) {\n if (buffer == null) {\n throw new Error(\"Buffer cannot be null\");\n }\n for (let i = 0; i < buffer.length; i += 6) {\n // Pick random 48-bit number. Fill buffer in 2 24-bit chunks to avoid bitwise truncation.\n let r = Math.floor(Math.random() * 281474976710656); // Low 24 bits = chunk 1.\n const rhi = Math.floor(r / 16777216); // High 24 bits shifted via division = chunk 2.\n for (let j = 0; j < 6 && i + j < buffer.length; j++) {\n if (j === 3) {\n r = rhi;\n }\n buffer[i + j] = r & 255;\n r >>>= 8;\n }\n }\n}\nexport function unescapeDataString(s) {\n // https://stackoverflow.com/a/4458580/524236\n return decodeURIComponent((s).replace(/\\+/g, \"%20\"));\n}\nexport function escapeDataString(s) {\n return encodeURIComponent(s).replace(/!/g, \"%21\")\n .replace(/'/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\nexport function escapeUriString(s) {\n return encodeURI(s);\n}\n// ICollection.Clear and Count members can be called on Arrays\n// or Dictionaries so we need a runtime check (see #1120)\nexport function count(col) {\n if (isArrayLike(col)) {\n return col.length;\n }\n else {\n let count = 0;\n for (const _ of col) {\n count++;\n }\n return count;\n }\n}\nexport function clear(col) {\n if (isArrayLike(col)) {\n col.splice(0);\n }\n else {\n col.clear();\n }\n}\nconst CURRIED = Symbol(\"curried\");\nexport function uncurry(arity, f) {\n // f may be a function option with None value\n if (f == null || f.length > 1) {\n return f;\n }\n const uncurried = (...args) => {\n let res = f;\n for (let i = 0; i < arity; i++) {\n res = res(args[i]);\n }\n return res;\n };\n uncurried[CURRIED] = f;\n return uncurried;\n}\nfunction _curry(args, arity, f) {\n return (arg) => arity === 1\n ? f(...args.concat([arg]))\n // Note it's important to generate a new args array every time\n // because a partially applied function can be run multiple times\n : _curry(args.concat([arg]), arity - 1, f);\n}\nexport function curry(arity, f) {\n if (f == null || f.length === 1) {\n return f;\n }\n else if (CURRIED in f) {\n return f[CURRIED];\n }\n else {\n return _curry([], arity, f);\n }\n}\nexport function checkArity(arity, f) {\n return f.length > arity\n ? (...args1) => (...args2) => f.apply(undefined, args1.concat(args2))\n : f;\n}\nexport function partialApply(arity, f, args) {\n if (f == null) {\n return undefined;\n }\n else if (CURRIED in f) {\n f = f[CURRIED];\n for (let i = 0; i < args.length; i++) {\n f = f(args[i]);\n }\n return f;\n }\n else {\n return _curry(args, arity, f);\n }\n}\nexport function mapCurriedArgs(fn, mappings) {\n function mapArg(fn, arg, mappings, idx) {\n const mapping = mappings[idx];\n if (mapping !== 0) {\n const expectedArity = mapping[0];\n const actualArity = mapping[1];\n if (expectedArity > 1) {\n arg = curry(expectedArity, arg);\n }\n if (actualArity > 1) {\n arg = uncurry(actualArity, arg);\n }\n }\n const res = fn(arg);\n if (idx + 1 === mappings.length) {\n return res;\n }\n else {\n return (arg) => mapArg(res, arg, mappings, idx + 1);\n }\n }\n return (arg) => mapArg(fn, arg, mappings, 0);\n}\n","import { combineHashCodes, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from \"./Util.js\";\nexport function seqToString(self) {\n let count = 0;\n let str = \"[\";\n for (const x of self) {\n if (count === 0) {\n str += toString(x);\n }\n else if (count === 100) {\n str += \"; ...\";\n break;\n }\n else {\n str += \"; \" + toString(x);\n }\n count++;\n }\n return str + \"]\";\n}\nexport function toString(x, callStack = 0) {\n if (x != null && typeof x === \"object\") {\n if (typeof x.toString === \"function\") {\n return x.toString();\n }\n else if (Symbol.iterator in x) {\n return seqToString(x);\n }\n else { // TODO: Date?\n const cons = Object.getPrototypeOf(x).constructor;\n return cons === Object && callStack < 10\n // Same format as recordToString\n ? \"{ \" + Object.entries(x).map(([k, v]) => k + \" = \" + toString(v, callStack + 1)).join(\"\\n \") + \" }\"\n : cons.name;\n }\n }\n return String(x);\n}\nexport function unionToString(name, fields) {\n if (fields.length === 0) {\n return name;\n }\n else {\n let fieldStr = \"\";\n let withParens = true;\n if (fields.length === 1) {\n fieldStr = toString(fields[0]);\n withParens = fieldStr.indexOf(\" \") >= 0;\n }\n else {\n fieldStr = fields.map((x) => toString(x)).join(\", \");\n }\n return name + (withParens ? \" (\" : \" \") + fieldStr + (withParens ? \")\" : \"\");\n }\n}\nexport class Union {\n get name() {\n return this.cases()[this.tag];\n }\n toJSON() {\n return this.fields.length === 0 ? this.name : [this.name].concat(this.fields);\n }\n toString() {\n return unionToString(this.name, this.fields);\n }\n GetHashCode() {\n const hashes = this.fields.map((x) => structuralHash(x));\n hashes.splice(0, 0, numberHash(this.tag));\n return combineHashCodes(hashes);\n }\n Equals(other) {\n if (this === other) {\n return true;\n }\n else if (!sameConstructor(this, other)) {\n return false;\n }\n else if (this.tag === other.tag) {\n return equalArrays(this.fields, other.fields);\n }\n else {\n return false;\n }\n }\n CompareTo(other) {\n if (this === other) {\n return 0;\n }\n else if (!sameConstructor(this, other)) {\n return -1;\n }\n else if (this.tag === other.tag) {\n return compareArrays(this.fields, other.fields);\n }\n else {\n return this.tag < other.tag ? -1 : 1;\n }\n }\n}\nfunction recordToJSON(self) {\n const o = {};\n const keys = Object.keys(self);\n for (let i = 0; i < keys.length; i++) {\n o[keys[i]] = self[keys[i]];\n }\n return o;\n}\nfunction recordToString(self) {\n return \"{ \" + Object.entries(self).map(([k, v]) => k + \" = \" + toString(v)).join(\"\\n \") + \" }\";\n}\nfunction recordGetHashCode(self) {\n const hashes = Object.values(self).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n}\nfunction recordEquals(self, other) {\n if (self === other) {\n return true;\n }\n else if (!sameConstructor(self, other)) {\n return false;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n if (!equals(self[thisNames[i]], other[thisNames[i]])) {\n return false;\n }\n }\n return true;\n }\n}\nfunction recordCompareTo(self, other) {\n if (self === other) {\n return 0;\n }\n else if (!sameConstructor(self, other)) {\n return -1;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n const result = compare(self[thisNames[i]], other[thisNames[i]]);\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n }\n}\nexport class Record {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class FSharpRef {\n constructor(contentsOrGetter, setter) {\n if (typeof setter === \"function\") {\n this.getter = contentsOrGetter;\n this.setter = setter;\n }\n else {\n this.getter = () => contentsOrGetter;\n this.setter = (v) => { contentsOrGetter = v; };\n }\n }\n get contents() {\n return this.getter();\n }\n set contents(v) {\n this.setter(v);\n }\n}\n// EXCEPTIONS\n// Exception is intentionally not derived from Error, for performance reasons (see #2160)\nexport class Exception {\n constructor(message) {\n this.message = message;\n }\n}\nexport function isException(x) {\n return x instanceof Exception || x instanceof Error;\n}\nexport class FSharpException extends Exception {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class MatchFailureException extends FSharpException {\n constructor(arg1, arg2, arg3) {\n super();\n this.arg1 = arg1;\n this.arg2 = arg2 | 0;\n this.arg3 = arg3 | 0;\n this.message = \"The match cases were incomplete\";\n }\n}\nexport class Attribute {\n}\n","export const symbol = Symbol(\"numeric\");\nexport function isNumeric(x) {\n return typeof x === \"number\" || (x === null || x === void 0 ? void 0 : x[symbol]);\n}\nexport function compare(x, y) {\n if (typeof x === \"number\") {\n return x < y ? -1 : (x > y ? 1 : 0);\n }\n else {\n return x.CompareTo(y);\n }\n}\nexport function multiply(x, y) {\n if (typeof x === \"number\") {\n return x * y;\n }\n else {\n return x[symbol]().multiply(y);\n }\n}\nexport function toFixed(x, dp) {\n if (typeof x === \"number\") {\n return x.toFixed(dp);\n }\n else {\n return x[symbol]().toFixed(dp);\n }\n}\nexport function toPrecision(x, sd) {\n if (typeof x === \"number\") {\n return x.toPrecision(sd);\n }\n else {\n return x[symbol]().toPrecision(sd);\n }\n}\nexport function toExponential(x, dp) {\n if (typeof x === \"number\") {\n return x.toExponential(dp);\n }\n else {\n return x[symbol]().toExponential(dp);\n }\n}\nexport function toHex(x) {\n if (typeof x === \"number\") {\n return (Number(x) >>> 0).toString(16);\n }\n else {\n return x[symbol]().toHex();\n }\n}\n","// Adapted from https://github.com/MikeMcl/big.js/blob/0f94dc9110d55c4f324a47ba6a2e832ce23ac589/big.mjs\n/* tslint:disable */\nimport { combineHashCodes } from \"../Util.js\";\nimport { symbol } from \"../Numeric.js\";\n// The shared prototype object.\nvar P = {\n GetHashCode() { return combineHashCodes([this.s, this.e].concat(this.c)); },\n Equals(x) { return !this.cmp(x); },\n CompareTo(x) { return this.cmp(x); },\n [symbol]() {\n const _this = this;\n return {\n multiply: y => _this.mul(y),\n toPrecision: sd => _this.toPrecision(sd),\n toExponential: dp => _this.toExponential(dp),\n toFixed: dp => _this.toFixed(dp),\n toHex: () => (Number(_this) >>> 0).toString(16),\n };\n }\n};\n/*\n * big.js v6.0.3\n * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\n * Copyright (c) 2020 Michael Mclaughlin\n * https://github.com/MikeMcl/big.js/LICENCE.md\n */\n/************************************** EDITABLE DEFAULTS *****************************************/\n// The default values below must be integers within the stated ranges.\n/*\n * The maximum number of decimal places (DP) of the results of operations involving division:\n * div and sqrt, and pow with negative exponents.\n */\nvar DP = 28, // 0 to MAX_DP\n/*\n * The rounding mode (RM) used when rounding to the above decimal places.\n *\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\n * 3 Away from zero. (ROUND_UP)\n */\nRM = 1, // 0, 1, 2 or 3\n// The maximum value of DP and Big.DP.\nMAX_DP = 1E6, // 0 to 1000000\n// The maximum magnitude of the exponent argument to the pow method.\nMAX_POWER = 1E6, // 1 to 1000000\n/*\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\n * (JavaScript numbers: -7)\n * -1000000 is the minimum recommended exponent value of a Big.\n */\nNE = -29, // 0 to -1000000\n/*\n * The positive exponent (PE) at and above which toString returns exponential notation.\n * (JavaScript numbers: 21)\n * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\n */\nPE = 29, // 0 to 1000000\n/*\n * When true, an error will be thrown if a primitive number is passed to the Big constructor,\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\n * primitive number without a loss of precision.\n */\nSTRICT = false, // true or false\n/**************************************************************************************************/\n// Error messages.\nNAME = '[big.js] ', INVALID = NAME + 'Invalid ', INVALID_DP = INVALID + 'decimal places', INVALID_RM = INVALID + 'rounding mode', DIV_BY_ZERO = NAME + 'Division by zero', UNDEFINED = void 0, NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\n/*\n * Create and return a Big constructor.\n */\nfunction _Big_() {\n /*\n * The Big constructor and exported function.\n * Create and return a new instance of a Big number object.\n *\n * n {number|string|Big} A numeric value.\n */\n function Big(n) {\n var x = this;\n // Enable constructor usage without new.\n if (!(x instanceof Big))\n return n === UNDEFINED ? _Big_() : new Big(n);\n // Duplicate.\n if (n instanceof Big) {\n x.s = n.s;\n x.e = n.e;\n x.c = n.c.slice();\n normalize(x);\n }\n else {\n if (typeof n !== 'string') {\n if (Big.strict === true) {\n throw TypeError(INVALID + 'number');\n }\n // Minus zero?\n n = n === 0 && 1 / n < 0 ? '-0' : String(n);\n }\n parse(x, n);\n }\n // Retain a reference to this Big constructor.\n // Shadow Big.prototype.constructor which points to Object.\n x.constructor = Big;\n }\n Big.prototype = P;\n Big.DP = DP;\n Big.RM = RM;\n Big.NE = NE;\n Big.PE = PE;\n Big.strict = STRICT;\n return Big;\n}\nfunction normalize(x) {\n // x = round(x, DP, 0);\n if (x.c.length > 1 && !x.c[0]) {\n let i = x.c.findIndex(x => x);\n x.c = x.c.slice(i);\n x.e = x.e - i;\n }\n}\n/*\n * Parse the number or string value passed to a Big constructor.\n *\n * x {Big} A Big number instance.\n * n {number|string} A numeric value.\n */\nfunction parse(x, n) {\n var e, i, nl;\n if (!NUMERIC.test(n)) {\n throw Error(INVALID + 'number');\n }\n // Determine sign.\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\n // Decimal point?\n if ((e = n.indexOf('.')) > -1)\n n = n.replace('.', '');\n // Exponential form?\n if ((i = n.search(/e/i)) > 0) {\n // Determine exponent.\n if (e < 0)\n e = i;\n e += +n.slice(i + 1);\n n = n.substring(0, i);\n }\n else if (e < 0) {\n // Integer.\n e = n.length;\n }\n nl = n.length;\n // Determine leading zeros before decimal point.\n for (i = 0; i < e && i < nl && n.charAt(i) == '0';)\n ++i;\n // original version (ignores decimal point).\n // // Determine leading zeros.\n // for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\n if (i == nl) {\n // Zero.\n x.c = [x.e = 0];\n }\n else {\n x.e = e - i - 1;\n x.c = [];\n // Convert string to array of digits without leading zeros\n for (e = 0; i < nl;)\n x.c[e++] = +n.charAt(i++);\n // older version (doesn't keep trailing zeroes).\n // // Determine trailing zeros.\n // for (; nl > 0 && n.charAt(--nl) == '0';);\n // // Convert string to array of digits without leading/trailing zeros.\n // for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\n }\n x = round(x, Big.DP + 1, Big.RM);\n return x;\n}\n/*\n * Round Big x to a maximum of sd significant digits using rounding mode rm.\n *\n * x {Big} The Big to round.\n * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\n * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * [more] {boolean} Whether the result of division was truncated.\n */\nfunction round(x, sd, rm, more) {\n var xc = x.c;\n if (rm === UNDEFINED)\n rm = Big.RM;\n if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\n throw Error(INVALID_RM);\n }\n if (sd < 1) {\n more =\n rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 ||\n rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED)));\n xc.length = 1;\n if (more) {\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n x.e = x.e - sd + 1;\n xc[0] = 1;\n }\n else {\n // Zero.\n xc[0] = x.e = 0;\n }\n }\n else if (sd < xc.length) {\n // xc[sd] is the digit after the digit that may be rounded up.\n const isZero = xc.findIndex((xci, idx) => idx >= sd && xci > 0) < 0;\n more =\n rm === 1 && xc[sd] >= 5 ||\n rm === 2 && (xc[sd] > 5 || xc[sd] === 5 &&\n (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) ||\n rm === 3 && (more || !isZero);\n // Remove any digits after the required precision.\n xc.length = sd--;\n // Round up?\n if (more) {\n // Rounding up may mean the previous digit has to be rounded up.\n for (; ++xc[sd] > 9;) {\n xc[sd] = 0;\n if (!sd--) {\n ++x.e;\n xc.unshift(1);\n }\n }\n }\n // Remove trailing zeros.\n for (sd = xc.length; !xc[--sd];)\n xc.pop();\n }\n return x;\n}\n/*\n * Return a string representing the value of Big x in normal or exponential notation.\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\n */\nfunction stringify(x, doExponential, isNonzero) {\n var e = x.e, s = x.c.join(''), n = s.length;\n // Exponential notation?\n if (doExponential) {\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\n // Normal notation.\n }\n else if (e < 0) {\n for (; ++e;)\n s = '0' + s;\n s = '0.' + s;\n }\n else if (e > 0) {\n if (++e > n) {\n for (e -= n; e--;)\n s += '0';\n }\n else if (e < n) {\n s = s.slice(0, e) + '.' + s.slice(e);\n }\n }\n else if (n > 1) {\n s = s.charAt(0) + '.' + s.slice(1);\n }\n return x.s < 0 && isNonzero ? '-' + s : s;\n}\n// Prototype/instance methods\n/*\n * Return a new Big whose value is the absolute value of this Big.\n */\nP.abs = function () {\n var x = new this.constructor(this);\n x.s = 1;\n return x;\n};\n/*\n * Return 1 if the value of this Big is greater than the value of Big y,\n * -1 if the value of this Big is less than the value of Big y, or\n * 0 if they have the same value.\n */\nP.cmp = function (y) {\n var isneg, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;\n // Either zero?\n if (!xc[0] || !yc[0])\n return !xc[0] ? !yc[0] ? 0 : -j : i;\n // Signs differ?\n if (i != j)\n return i;\n isneg = i < 0;\n // Compare exponents.\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n // Compare digit by digit.\n j = Math.max(xc.length, yc.length);\n for (i = 0; i < j; i++) {\n k = i < xc.length ? xc[i] : 0;\n l = i < yc.length ? yc[i] : 0;\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n }\n return 0;\n // original version (doesn't compare well trailing zeroes, e.g. 1.0 with 1.00)\n // j = (k = xc.length) < (l = yc.length) ? k : l;\n // // Compare digit by digit.\n // for (i = -1; ++i < j;) {\n // if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\n // }\n // // Compare lengths.\n // return k == l ? 0 : k > l ^ isneg ? 1 : -1;\n};\n/*\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.div = function (y) {\n var Big = this.constructor, x = new Big(this), y = new Big(y), a = x.c, // dividend\n b = y.c, // divisor\n k = x.s == y.s ? 1 : -1, dp = Big.DP;\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n // Divisor is zero?\n if (!b[0]) {\n throw Error(DIV_BY_ZERO);\n }\n // Dividend is 0? Return +-0.\n if (!a[0]) {\n y.s = k;\n y.c = [y.e = 0];\n return y;\n }\n var bl, bt, n, cmp, ri, bz = b.slice(), ai = bl = b.length, al = a.length, r = a.slice(0, bl), // remainder\n rl = r.length, q = y, // quotient\n qc = q.c = [], qi = 0, p = dp + (q.e = x.e - y.e) + 1; // precision of the result\n q.s = k;\n k = p < 0 ? 0 : p;\n // Create version of divisor with leading zero.\n bz.unshift(0);\n // Add zeros to make remainder as long as divisor.\n for (; rl++ < bl;)\n r.push(0);\n do {\n // n is how many times the divisor goes into current remainder.\n for (n = 0; n < 10; n++) {\n // Compare divisor and remainder.\n if (bl != (rl = r.length)) {\n cmp = bl > rl ? 1 : -1;\n }\n else {\n for (ri = -1, cmp = 0; ++ri < bl;) {\n if (b[ri] != r[ri]) {\n cmp = b[ri] > r[ri] ? 1 : -1;\n break;\n }\n }\n }\n // If divisor < remainder, subtract divisor from remainder.\n if (cmp < 0) {\n // Remainder can't be more than 1 digit longer than divisor.\n // Equalise lengths using divisor with extra leading zero?\n for (bt = rl == bl ? b : bz; rl;) {\n if (r[--rl] < bt[rl]) {\n ri = rl;\n for (; ri && !r[--ri];)\n r[ri] = 9;\n --r[ri];\n r[rl] += 10;\n }\n r[rl] -= bt[rl];\n }\n for (; !r[0];)\n r.shift();\n }\n else {\n break;\n }\n }\n // Add the digit n to the result array.\n qc[qi++] = cmp ? n : ++n;\n // Update the remainder.\n if (r[0] && cmp)\n r[rl] = a[ai] || 0;\n else\n r = [a[ai]];\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\n // Leading zero? Do not remove if result is simply zero (qi == 1).\n if (!qc[0] && qi != 1) {\n // There can't be more than one zero.\n qc.shift();\n q.e--;\n p--;\n }\n // Round?\n if (qi > p)\n round(q, p, Big.RM, r[0] !== UNDEFINED);\n return q;\n};\n/*\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\n */\nP.eq = function (y) {\n return this.cmp(y) === 0;\n};\n/*\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\n * false.\n */\nP.gt = function (y) {\n return this.cmp(y) > 0;\n};\n/*\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\n * return false.\n */\nP.gte = function (y) {\n return this.cmp(y) > -1;\n};\n/*\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\n */\nP.lt = function (y) {\n return this.cmp(y) < 0;\n};\n/*\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\n * return false.\n */\nP.lte = function (y) {\n return this.cmp(y) < 1;\n};\n/*\n * Return a new Big whose value is the value of this Big minus the value of Big y.\n */\nP.minus = P.sub = function (y) {\n var i, j, t, xlty, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n // Signs differ?\n if (a != b) {\n y.s = -b;\n return x.plus(y);\n }\n var xc = x.c.slice(), xe = x.e, yc = y.c, ye = y.e;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (yc[0]) {\n y.s = -b;\n }\n else if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = 1;\n }\n return y;\n }\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\n if (a = xe - ye) {\n if (xlty = a < 0) {\n a = -a;\n t = xc;\n }\n else {\n ye = xe;\n t = yc;\n }\n t.reverse();\n for (b = a; b--;)\n t.push(0);\n t.reverse();\n }\n else {\n // Exponents equal. Check digit by digit.\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\n for (a = b = 0; b < j; b++) {\n if (xc[b] != yc[b]) {\n xlty = xc[b] < yc[b];\n break;\n }\n }\n }\n // x < y? Point xc to the array of the bigger number.\n if (xlty) {\n t = xc;\n xc = yc;\n yc = t;\n y.s = -y.s;\n }\n /*\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\n * needs to start at yc.length.\n */\n if ((b = (j = yc.length) - (i = xc.length)) > 0)\n for (; b--;)\n xc[i++] = 0;\n // Subtract yc from xc.\n for (b = i; j > a;) {\n if (xc[--j] < yc[j]) {\n for (i = j; i && !xc[--i];)\n xc[i] = 9;\n --xc[i];\n xc[j] += 10;\n }\n xc[j] -= yc[j];\n }\n // Remove trailing zeros.\n for (; xc[--b] === 0;)\n xc.pop();\n // Remove leading zeros and adjust exponent accordingly.\n for (; xc[0] === 0;) {\n xc.shift();\n --ye;\n }\n if (!xc[0]) {\n // n - n = +0\n y.s = 1;\n // Result must be zero.\n xc = [ye = 0];\n }\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\n */\nP.mod = function (y) {\n var ygtx, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n if (!y.c[0]) {\n throw Error(DIV_BY_ZERO);\n }\n x.s = y.s = 1;\n ygtx = y.cmp(x) == 1;\n x.s = a;\n y.s = b;\n if (ygtx)\n return new Big(x);\n a = Big.DP;\n b = Big.RM;\n Big.DP = Big.RM = 0;\n x = x.div(y);\n Big.DP = a;\n Big.RM = b;\n return this.minus(x.times(y));\n};\n/*\n * Return a new Big whose value is the value of this Big plus the value of Big y.\n */\nP.plus = P.add = function (y) {\n var e, k, t, Big = this.constructor, x = new Big(this), y = new Big(y);\n // Signs differ?\n if (x.s != y.s) {\n y.s = -y.s;\n return x.minus(y);\n }\n var xe = x.e, xc = x.c, ye = y.e, yc = y.c;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (!yc[0]) {\n if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = x.s;\n }\n }\n return y;\n }\n xc = xc.slice();\n // Prepend zeros to equalise exponents.\n // Note: reverse faster than unshifts.\n if (e = xe - ye) {\n if (e > 0) {\n ye = xe;\n t = yc;\n }\n else {\n e = -e;\n t = xc;\n }\n t.reverse();\n for (; e--;)\n t.push(0);\n t.reverse();\n }\n // Point xc to the longer array.\n if (xc.length - yc.length < 0) {\n t = yc;\n yc = xc;\n xc = t;\n }\n e = yc.length;\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\n for (k = 0; e; xc[e] %= 10)\n k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n if (k) {\n xc.unshift(k);\n ++ye;\n }\n // Remove trailing zeros.\n for (e = xc.length; xc[--e] === 0;)\n xc.pop();\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a Big whose value is the value of this Big raised to the power n.\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\n * mode Big.RM.\n *\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\n */\nP.pow = function (n) {\n var Big = this.constructor, x = new Big(this), y = new Big('1'), one = new Big('1'), isneg = n < 0;\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\n throw Error(INVALID + 'exponent');\n }\n if (isneg)\n n = -n;\n for (;;) {\n if (n & 1)\n y = y.times(x);\n n >>= 1;\n if (!n)\n break;\n x = x.times(x);\n }\n return isneg ? one.div(y) : y;\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.prec = function (sd, rm) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n return round(new this.constructor(this), sd, rm);\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\n * using rounding mode rm, or Big.RM if rm is not specified.\n * If dp is negative, round to an integer which is a multiple of 10**-dp.\n * If dp is not specified, round to 0 decimal places.\n *\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.round = function (dp, rm) {\n if (dp === UNDEFINED)\n dp = 0;\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n return round(new this.constructor(this), dp + this.e + 1, rm);\n};\n/*\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.sqrt = function () {\n var r, c, t, Big = this.constructor, x = new Big(this), s = x.s, e = x.e, half = new Big('0.5');\n // Zero?\n if (!x.c[0])\n return new Big(x);\n // Negative?\n if (s < 0) {\n throw Error(NAME + 'No square root');\n }\n // Estimate.\n s = Math.sqrt(x + '');\n // Math.sqrt underflow/overflow?\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\n if (s === 0 || s === 1 / 0) {\n c = x.c.join('');\n if (!(c.length + e & 1))\n c += '0';\n s = Math.sqrt(c);\n e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\n r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\n }\n else {\n r = new Big(s + '');\n }\n e = r.e + (Big.DP += 4);\n // Newton-Raphson iteration.\n do {\n t = r;\n r = half.times(t.plus(x.div(t)));\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\n return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\n};\n/*\n * Return a new Big whose value is the value of this Big times the value of Big y.\n */\nP.times = P.mul = function (y) {\n var c, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, a = xc.length, b = yc.length, i = x.e, j = y.e;\n // Determine sign of result.\n y.s = x.s == y.s ? 1 : -1;\n // Return signed 0 if either 0.\n if (!xc[0] || !yc[0]) {\n y.c = [y.e = 0];\n return y;\n }\n // Initialise exponent of result as x.e + y.e.\n y.e = i + j;\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\n if (a < b) {\n c = xc;\n xc = yc;\n yc = c;\n j = a;\n a = b;\n b = j;\n }\n // Initialise coefficient array of result with zeros.\n for (c = new Array(j = a + b); j--;)\n c[j] = 0;\n // Multiply.\n // i is initially xc.length.\n for (i = b; i--;) {\n b = 0;\n // a is yc.length.\n for (j = a + i; j > i;) {\n // Current sum of products at this digit position, plus carry.\n b = c[j] + yc[i] * xc[j - i - 1] + b;\n c[j--] = b % 10;\n // carry\n b = b / 10 | 0;\n }\n c[j] = b;\n }\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\n if (b)\n ++y.e;\n else\n c.shift();\n // Remove trailing zeros.\n for (i = c.length; !c[--i];)\n c.pop();\n y.c = c;\n return y;\n};\n/*\n * Return a string representing the value of this Big in exponential notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toExponential = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), ++dp, rm);\n for (; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, true, !!n);\n};\n/*\n * Return a string representing the value of this Big in normal notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n *\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\n */\nP.toFixed = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), dp + x.e + 1, rm);\n // x.e may have changed if the value is rounded up.\n for (dp = dp + x.e + 1; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, false, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Omit the sign for negative zero.\n */\nP.toJSON = P.toString = function () {\n var x = this, Big = x.constructor;\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\n};\n/*\n * Return the value of this Big as a primitve number.\n */\nP.toNumber = function () {\n var n = Number(stringify(this, true, true));\n if (this.constructor.strict === true && !this.eq(n.toString())) {\n throw Error(NAME + 'Imprecise conversion');\n }\n return n;\n};\n/*\n * Return a string representing the value of this Big rounded to sd significant digits using\n * rounding mode rm, or Big.RM if rm is not specified.\n * Use exponential notation if sd is less than the number of digits necessary to represent\n * the integer part of the value in normal notation.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toPrecision = function (sd, rm) {\n var x = this, Big = x.constructor, n = x.c[0];\n if (sd !== UNDEFINED) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n x = round(new Big(x), sd, rm);\n for (; x.c.length < sd;)\n x.c.push(0);\n }\n return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Include the sign for negative zero.\n */\nP.valueOf = function () {\n var x = this, Big = x.constructor;\n if (Big.strict === true) {\n throw Error(NAME + 'valueOf disallowed');\n }\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\n};\n// Export\nexport var Big = _Big_();\n/// \nexport default Big;\n","import Decimal from \"./lib/big.js\";\nimport { FSharpRef } from \"./Types.js\";\nexport default Decimal;\nexport const get_Zero = new Decimal(0);\nexport const get_One = new Decimal(1);\nexport const get_MinusOne = new Decimal(-1);\nexport const get_MaxValue = new Decimal(\"79228162514264337593543950335\");\nexport const get_MinValue = new Decimal(\"-79228162514264337593543950335\");\nexport function compare(x, y) {\n return x.cmp(y);\n}\nexport function equals(x, y) {\n return !x.cmp(y);\n}\nexport function abs(x) {\n return x.abs();\n}\nexport function round(x, digits = 0) {\n return x.round(digits, 2 /* ROUND_HALF_EVEN */);\n}\nexport function truncate(x) {\n return x.round(0, 0 /* ROUND_DOWN */);\n}\nexport function ceiling(x) {\n return x.round(0, x.cmp(0) >= 0 ? 3 /* ROUND_UP */ : 0 /* ROUND_DOWN */);\n}\nexport function floor(x) {\n return x.round(0, x.cmp(0) >= 0 ? 0 /* ROUND_DOWN */ : 3 /* ROUND_UP */);\n}\nexport function pow(x, n) {\n return x.pow(n);\n}\nexport function sqrt(x) {\n return x.sqrt();\n}\nexport function op_Addition(x, y) {\n return x.add(y);\n}\nexport function op_Subtraction(x, y) {\n return x.sub(y);\n}\nexport function op_Multiply(x, y) {\n return x.mul(y);\n}\nexport function op_Division(x, y) {\n return x.div(y);\n}\nexport function op_Modulus(x, y) {\n return x.mod(y);\n}\nexport function op_UnaryNegation(x) {\n const x2 = new Decimal(x);\n x2.s = -x2.s || 0;\n return x2;\n}\nexport const add = op_Addition;\nexport const subtract = op_Subtraction;\nexport const multiply = op_Multiply;\nexport const divide = op_Division;\nexport const remainder = op_Modulus;\nexport const negate = op_UnaryNegation;\nexport function toString(x) {\n return x.toString();\n}\nexport function tryParse(str, defValue) {\n try {\n defValue.contents = new Decimal(str.trim());\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function parse(str) {\n const defValue = new FSharpRef(get_Zero);\n if (tryParse(str, defValue)) {\n return defValue.contents;\n }\n else {\n throw new Error(\"Input string was not in a correct format.\");\n }\n}\nexport function toNumber(x) {\n return +x;\n}\nfunction decimalToHex(dec, bitSize) {\n const hex = new Uint8Array(bitSize / 4 | 0);\n let hexCount = 1;\n for (let d = 0; d < dec.length; d++) {\n let value = dec[d];\n for (let i = 0; i < hexCount; i++) {\n const digit = hex[i] * 10 + value | 0;\n hex[i] = digit & 0xF;\n value = digit >> 4;\n }\n if (value !== 0) {\n hex[hexCount++] = value;\n }\n }\n return hex.slice(0, hexCount); // digits in reverse order\n}\nfunction hexToDecimal(hex, bitSize) {\n const dec = new Uint8Array(bitSize * 301 / 1000 + 1 | 0);\n let decCount = 1;\n for (let d = hex.length - 1; d >= 0; d--) {\n let carry = hex[d];\n for (let i = 0; i < decCount; i++) {\n const val = dec[i] * 16 + carry | 0;\n dec[i] = (val % 10) | 0;\n carry = (val / 10) | 0;\n }\n while (carry > 0) {\n dec[decCount++] = (carry % 10) | 0;\n carry = (carry / 10) | 0;\n }\n }\n return dec.slice(0, decCount); // digits in reverse order\n}\nfunction setInt32Bits(hexDigits, bits, offset) {\n for (let i = 0; i < 8; i++) {\n hexDigits[offset + i] = (bits >> (i * 4)) & 0xF;\n }\n}\nfunction getInt32Bits(hexDigits, offset) {\n let bits = 0;\n for (let i = 0; i < 8; i++) {\n bits = bits | (hexDigits[offset + i] << (i * 4));\n }\n return bits;\n}\nexport function fromIntArray(bits) {\n return fromInts(bits[0], bits[1], bits[2], bits[3]);\n}\nexport function fromInts(low, mid, high, signExp) {\n const isNegative = signExp < 0;\n const scale = (signExp >> 16) & 0x7F;\n return fromParts(low, mid, high, isNegative, scale);\n}\nexport function fromParts(low, mid, high, isNegative, scale) {\n const bitSize = 96;\n const hexDigits = new Uint8Array(bitSize / 4);\n setInt32Bits(hexDigits, low, 0);\n setInt32Bits(hexDigits, mid, 8);\n setInt32Bits(hexDigits, high, 16);\n const decDigits = hexToDecimal(hexDigits, bitSize);\n scale = scale & 0x7F;\n const big = new Decimal(0);\n big.c = Array.from(decDigits.reverse());\n big.e = decDigits.length - scale - 1;\n big.s = isNegative ? -1 : 1;\n const d = new Decimal(big);\n return d;\n}\nexport function getBits(d) {\n const bitSize = 96;\n const decDigits = Uint8Array.from(d.c);\n const hexDigits = decimalToHex(decDigits, bitSize);\n const low = getInt32Bits(hexDigits, 0);\n const mid = getInt32Bits(hexDigits, 8);\n const high = getInt32Bits(hexDigits, 16);\n const decStr = d.toString();\n const dotPos = decStr.indexOf(\".\");\n const scale = dotPos < 0 ? 0 : decStr.length - dotPos - 1;\n const signExp = ((scale & 0x7F) << 16) | (d.s < 0 ? 0x80000000 : 0);\n return [low, mid, high, signExp];\n}\n// export function makeRangeStepFunction(step: Decimal, last: Decimal) {\n// const stepComparedWithZero = step.cmp(get_Zero);\n// if (stepComparedWithZero === 0) {\n// throw new Error(\"The step of a range cannot be zero\");\n// }\n// const stepGreaterThanZero = stepComparedWithZero > 0;\n// return (x: Decimal) => {\n// const comparedWithLast = x.cmp(last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\n","// export type decimal = Decimal;\nexport var NumberStyles;\n(function (NumberStyles) {\n // None = 0x00000000,\n // AllowLeadingWhite = 0x00000001,\n // AllowTrailingWhite = 0x00000002,\n // AllowLeadingSign = 0x00000004,\n // AllowTrailingSign = 0x00000008,\n // AllowParentheses = 0x00000010,\n // AllowDecimalPoint = 0x00000020,\n // AllowThousands = 0x00000040,\n // AllowExponent = 0x00000080,\n // AllowCurrencySymbol = 0x00000100,\n NumberStyles[NumberStyles[\"AllowHexSpecifier\"] = 512] = \"AllowHexSpecifier\";\n // Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign,\n // HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier,\n // Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowTrailingSign | AllowDecimalPoint | AllowThousands,\n // Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowDecimalPoint | AllowExponent,\n // Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol,\n // Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol | AllowExponent,\n})(NumberStyles || (NumberStyles = {}));\nfunction validResponse(regexMatch, radix) {\n const [/*all*/ , sign, prefix, digits] = regexMatch;\n return {\n sign: sign || \"\",\n prefix: prefix || \"\",\n digits,\n radix,\n };\n}\nfunction getRange(unsigned, bitsize) {\n switch (bitsize) {\n case 8: return unsigned ? [0, 255] : [-128, 127];\n case 16: return unsigned ? [0, 65535] : [-32768, 32767];\n case 32: return unsigned ? [0, 4294967295] : [-2147483648, 2147483647];\n default: throw new Error(\"Invalid bit size.\");\n }\n}\nfunction getInvalidDigits(radix) {\n switch (radix) {\n case 2: return /[^0-1]/;\n case 8: return /[^0-7]/;\n case 10: return /[^0-9]/;\n case 16: return /[^0-9a-fA-F]/;\n default:\n throw new Error(\"Invalid Base.\");\n }\n}\nfunction getRadix(prefix, style) {\n if (style & NumberStyles.AllowHexSpecifier) {\n return 16;\n }\n else {\n switch (prefix) {\n case \"0b\":\n case \"0B\": return 2;\n case \"0o\":\n case \"0O\": return 8;\n case \"0x\":\n case \"0X\": return 16;\n default: return 10;\n }\n }\n}\nexport function isValid(str, style, radix) {\n const integerRegex = /^\\s*([\\+\\-])?(0[xXoObB])?([0-9a-fA-F]+)\\s*$/;\n const res = integerRegex.exec(str.replace(/_/g, \"\"));\n if (res != null) {\n const [/*all*/ , /*sign*/ , prefix, digits] = res;\n radix = radix || getRadix(prefix, style);\n const invalidDigits = getInvalidDigits(radix);\n if (!invalidDigits.test(digits)) {\n return validResponse(res, radix);\n }\n }\n return null;\n}\nexport function parse(str, style, unsigned, bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n let v = Number.parseInt(res.sign + res.digits, res.radix);\n if (!Number.isNaN(v)) {\n const [umin, umax] = getRange(true, bitsize);\n if (!unsigned && res.radix !== 10 && v >= umin && v <= umax) {\n v = v << (32 - bitsize) >> (32 - bitsize);\n }\n const [min, max] = getRange(unsigned, bitsize);\n if (v >= min && v <= max) {\n return v;\n }\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function op_UnaryNegation_Int8(x) {\n return x === -128 ? x : -x;\n}\nexport function op_UnaryNegation_Int16(x) {\n return x === -32768 ? x : -x;\n}\nexport function op_UnaryNegation_Int32(x) {\n return x === -2147483648 ? x : -x;\n}\nexport function divRem(x, y, out) {\n const div = ~~(x / y);\n const rem = x % y;\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","// Adapted from: https://github.com/dcodeIO/long.js/blob/master/src/long.js\n// Apache License 2.0: https://github.com/dcodeIO/long.js/blob/master/LICENSE\n/* tslint:disable */\nimport { symbol } from \"../Numeric.js\";\n/**\n * wasm optimizations, to do native i64 multiplication and divide\n */\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n}\ncatch (e) {\n // no wasm support :(\n}\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nexport function Long(low, high, unsigned) {\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\nLong.prototype.GetHashCode = function () {\n let h1 = this.unsigned ? 1 : 0;\n h1 = ((h1 << 5) + h1) ^ this.high;\n h1 = ((h1 << 5) + h1) ^ this.low;\n return h1;\n};\nLong.prototype.Equals = function (x) { return equals(this, x); };\nLong.prototype.CompareTo = function (x) { return compare(this, x); };\nLong.prototype.toString = function (radix) { return toString(this, radix); };\nLong.prototype.toJSON = function () { return toString(this); };\nLong.prototype[symbol] = function () {\n const x = this;\n return {\n multiply: y => multiply(x, y),\n toPrecision: sd => String(x) + (0).toPrecision(sd).substr(1),\n toExponential: dp => String(x) + (0).toExponential(dp).substr(1),\n toFixed: dp => String(x) + (0).toFixed(dp).substr(1),\n toHex: () => toString(x.unsigned ? x : fromBytes(toBytes(x), true), 16),\n };\n};\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nexport function isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\n// Long.isLong = isLong;\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n }\n else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromInt = fromInt;\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n }\n else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return negate(fromNumber(-value, unsigned));\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromNumber = fromNumber;\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromBits = fromBits;\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nexport function fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned,\n unsigned = false;\n }\n else {\n unsigned = !!unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n var p = str.indexOf('-');\n if (p > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return negate(fromString(str.substring(1), unsigned, radix));\n }\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = add(multiply(result, power), fromNumber(value));\n }\n else {\n result = multiply(result, radixToPower);\n result = add(result, fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromString = fromString;\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\n// Long.fromValue = fromValue;\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n/**\n * @type {!Long}\n * @inner\n */\nexport var ZERO = fromInt(0);\n/**\n * Signed zero.\n * @type {!Long}\n */\n// Long.ZERO = ZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UZERO = fromInt(0, true);\n/**\n * Unsigned zero.\n * @type {!Long}\n */\n// Long.UZERO = UZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var ONE = fromInt(1);\n/**\n * Signed one.\n * @type {!Long}\n */\n// Long.ONE = ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UONE = fromInt(1, true);\n/**\n * Unsigned one.\n * @type {!Long}\n */\n// Long.UONE = UONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var NEG_ONE = fromInt(-1);\n/**\n * Signed negative one.\n * @type {!Long}\n */\n// Long.NEG_ONE = NEG_ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n/**\n * Maximum signed value.\n * @type {!Long}\n */\n// Long.MAX_VALUE = MAX_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\n// Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n/**\n * Minimum signed value.\n * @type {!Long}\n */\n// Long.MIN_VALUE = MIN_VALUE;\n/**\n * @alias Long.prototype\n * @inner\n */\n// var LongPrototype = Long.prototype;\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nexport function toInt($this) {\n return $this.unsigned ? $this.low >>> 0 : $this.low;\n}\n;\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nexport function toNumber($this) {\n if ($this.unsigned)\n return (($this.high >>> 0) * TWO_PWR_32_DBL) + ($this.low >>> 0);\n return $this.high * TWO_PWR_32_DBL + ($this.low >>> 0);\n}\n;\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nexport function toString($this, radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (isZero($this))\n return '0';\n if (isNegative($this)) { // Unsigned Longs are never negative\n if (equals($this, MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix), div = divide($this, radixLong), rem1 = subtract(multiply(div, radixLong), $this);\n return toString(div, radix) + toInt(rem1).toString(radix);\n }\n else\n return '-' + toString(negate($this), radix);\n }\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), $this.unsigned), rem = $this;\n var result = '';\n while (true) {\n var remDiv = divide(rem, radixToPower), intval = toInt(subtract(rem, multiply(remDiv, radixToPower))) >>> 0, digits = intval.toString(radix);\n rem = remDiv;\n if (isZero(rem))\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n}\n;\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nexport function getHighBits($this) {\n return $this.high;\n}\n;\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nexport function getHighBitsUnsigned($this) {\n return $this.high >>> 0;\n}\n;\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nexport function getLowBits($this) {\n return $this.low;\n}\n;\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nexport function getLowBitsUnsigned($this) {\n return $this.low >>> 0;\n}\n;\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nexport function getNumBitsAbs($this) {\n if (isNegative($this)) // Unsigned Longs are never negative\n return equals($this, MIN_VALUE) ? 64 : getNumBitsAbs(negate($this));\n var val = $this.high != 0 ? $this.high : $this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return $this.high != 0 ? bit + 33 : bit + 1;\n}\n;\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isZero($this) {\n return $this.high === 0 && $this.low === 0;\n}\n;\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\n// LongPrototype.eqz = LongPrototype.isZero;\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isNegative($this) {\n return !$this.unsigned && $this.high < 0;\n}\n;\n/**\n * Tests if this Long's value is positive.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isPositive($this) {\n return $this.unsigned || $this.high >= 0;\n}\n;\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isOdd($this) {\n return ($this.low & 1) === 1;\n}\n;\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isEven($this) {\n return ($this.low & 1) === 0;\n}\n;\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function equals($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if ($this.unsigned !== other.unsigned && ($this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return $this.high === other.high && $this.low === other.low;\n}\n;\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.eq = LongPrototype.equals;\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function notEquals($this, other) {\n return !equals($this, /* validates */ other);\n}\n;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.neq = LongPrototype.notEquals;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ne = LongPrototype.notEquals;\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThan($this, other) {\n return compare($this, /* validates */ other) < 0;\n}\n;\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lt = LongPrototype.lessThan;\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThanOrEqual($this, other) {\n return compare($this, /* validates */ other) <= 0;\n}\n;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lte = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.le = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThan($this, other) {\n return compare($this, /* validates */ other) > 0;\n}\n;\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gt = LongPrototype.greaterThan;\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThanOrEqual($this, other) {\n return compare($this, /* validates */ other) >= 0;\n}\n;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gte = LongPrototype.greaterThanOrEqual;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ge = LongPrototype.greaterThanOrEqual;\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nexport function compare($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if (equals($this, other))\n return 0;\n var thisNeg = isNegative($this), otherNeg = isNegative(other);\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!$this.unsigned)\n return isNegative(subtract($this, other)) ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > ($this.high >>> 0) || (other.high === $this.high && (other.low >>> 0) > ($this.low >>> 0)) ? -1 : 1;\n}\n;\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n// LongPrototype.comp = LongPrototype.compare;\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nexport function negate($this) {\n if (!$this.unsigned && equals($this, MIN_VALUE))\n return MIN_VALUE;\n return add(not($this), ONE);\n}\n;\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\n// LongPrototype.neg = LongPrototype.negate;\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nexport function add($this, addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nexport function subtract($this, subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return add($this, negate(subtrahend));\n}\n;\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n// LongPrototype.sub = LongPrototype.subtract;\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nexport function multiply($this, multiplier) {\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n // use wasm support if present\n if (wasm) {\n var low = wasm.mul($this.low, $this.high, multiplier.low, multiplier.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero(multiplier))\n return $this.unsigned ? UZERO : ZERO;\n if (equals($this, MIN_VALUE))\n return isOdd(multiplier) ? MIN_VALUE : ZERO;\n if (equals(multiplier, MIN_VALUE))\n return isOdd($this) ? MIN_VALUE : ZERO;\n if (isNegative($this)) {\n if (isNegative(multiplier))\n return multiply(negate($this), negate(multiplier));\n else\n return negate(multiply(negate($this), multiplier));\n }\n else if (isNegative(multiplier))\n return negate(multiply($this, negate(multiplier)));\n // If both longs are small, use float multiplication\n if (lessThan($this, TWO_PWR_24) && lessThan(multiplier, TWO_PWR_24))\n return fromNumber(toNumber($this) * toNumber(multiplier), $this.unsigned);\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n// LongPrototype.mul = LongPrototype.multiply;\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nexport function divide($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (isZero(divisor))\n throw Error('division by zero');\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!$this.unsigned &&\n $this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return $this;\n }\n var low = ($this.unsigned ? wasm.div_u : wasm.div_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!$this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (equals($this, MIN_VALUE)) {\n if (equals(divisor, ONE) || equals(divisor, NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (equals(divisor, MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = shiftRight($this, 1);\n approx = shiftLeft(divide(halfThis, divisor), 1);\n if (equals(approx, ZERO)) {\n return isNegative(divisor) ? ONE : NEG_ONE;\n }\n else {\n rem = subtract($this, multiply(divisor, approx));\n res = add(approx, divide(rem, divisor));\n return res;\n }\n }\n }\n else if (equals(divisor, MIN_VALUE))\n return $this.unsigned ? UZERO : ZERO;\n if (isNegative($this)) {\n if (isNegative(divisor))\n return divide(negate($this), negate(divisor));\n return negate(divide(negate($this), divisor));\n }\n else if (isNegative(divisor))\n return negate(divide($this, negate(divisor)));\n res = ZERO;\n }\n else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = toUnsigned(divisor);\n if (greaterThan(divisor, $this))\n return UZERO;\n if (greaterThan(divisor, shiftRightUnsigned($this, 1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = $this;\n while (greaterThanOrEqual(rem, divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(toNumber(rem) / toNumber(divisor)));\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), \n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx), approxRem = multiply(approxRes, divisor);\n while (isNegative(approxRem) || greaterThan(approxRem, rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, $this.unsigned);\n approxRem = multiply(approxRes, divisor);\n }\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (isZero(approxRes))\n approxRes = ONE;\n res = add(res, approxRes);\n rem = subtract(rem, approxRem);\n }\n return res;\n}\n;\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n// LongPrototype.div = LongPrototype.divide;\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nexport function modulo($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n // use wasm support if present\n if (wasm) {\n var low = ($this.unsigned ? wasm.rem_u : wasm.rem_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n return subtract($this, multiply(divide($this, divisor), divisor));\n}\n;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.mod = LongPrototype.modulo;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.rem = LongPrototype.modulo;\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nexport function not($this) {\n return fromBits(~$this.low, ~$this.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function and($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low & other.low, $this.high & other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function or($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low | other.low, $this.high | other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function xor($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low ^ other.low, $this.high ^ other.high, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftLeft($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits($this.low << numBits, ($this.high << numBits) | ($this.low >>> (32 - numBits)), $this.unsigned);\n else\n return fromBits(0, $this.low << (numBits - 32), $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shl = LongPrototype.shiftLeft;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRight($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits(($this.low >>> numBits) | ($this.high << (32 - numBits)), $this.high >> numBits, $this.unsigned);\n else\n return fromBits($this.high >> (numBits - 32), $this.high >= 0 ? 0 : -1, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr = LongPrototype.shiftRight;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRightUnsigned($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n numBits &= 63;\n if (numBits === 0)\n return $this;\n else {\n var high = $this.high;\n if (numBits < 32) {\n var low = $this.low;\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, $this.unsigned);\n }\n else if (numBits === 32)\n return fromBits(high, 0, $this.unsigned);\n else\n return fromBits(high >>> (numBits - 32), 0, $this.unsigned);\n }\n}\n;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shru = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotl = LongPrototype.rotateLeft;\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotr = LongPrototype.rotateRight;\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nexport function toSigned($this) {\n if (!$this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, false);\n}\n;\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nexport function toUnsigned($this) {\n if ($this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, true);\n}\n;\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nexport function toBytes($this, le) {\n return le ? toBytesLE($this) : toBytesBE($this);\n}\n;\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nexport function toBytesLE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n}\n;\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nexport function toBytesBE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n}\n;\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytes(bytes, unsigned, le) {\n return le ? fromBytesLE(bytes, unsigned) : fromBytesBE(bytes, unsigned);\n}\n;\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesLE(bytes, unsigned) {\n return new Long(bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24, bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24, unsigned);\n}\n;\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesBE(bytes, unsigned) {\n return new Long(bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7], bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3], unsigned);\n}\n;\n","import { isValid } from \"./Int32.js\";\nimport * as LongLib from \"./lib/long.js\";\nexport default LongLib.Long;\nexport const get_Zero = LongLib.ZERO;\nexport const get_One = LongLib.ONE;\nexport const op_Addition = LongLib.add;\nexport const op_Subtraction = LongLib.subtract;\nexport const op_Multiply = LongLib.multiply;\nexport const op_Division = LongLib.divide;\nexport const op_Modulus = LongLib.modulo;\nexport const op_UnaryNegation = LongLib.negate;\nexport const op_LeftShift = LongLib.shiftLeft;\nexport const op_RightShift = LongLib.shiftRight;\nexport const op_RightShiftUnsigned = LongLib.shiftRightUnsigned;\nexport const op_BitwiseAnd = LongLib.and;\nexport const op_BitwiseOr = LongLib.or;\nexport const op_ExclusiveOr = LongLib.xor;\nexport const op_LogicalNot = LongLib.not;\nexport const op_LessThan = LongLib.lessThan;\nexport const op_LessThanOrEqual = LongLib.lessThanOrEqual;\nexport const op_GreaterThan = LongLib.greaterThan;\nexport const op_GreaterThanOrEqual = LongLib.greaterThanOrEqual;\nexport const op_Equality = LongLib.equals;\nexport const op_Inequality = LongLib.notEquals;\nexport const equals = LongLib.equals;\nexport const compare = LongLib.compare;\nexport const fromInt = LongLib.fromInt;\nexport const fromBits = LongLib.fromBits;\nexport const fromBytes = LongLib.fromBytes;\nexport const fromNumber = LongLib.fromNumber;\nexport const fromString = LongLib.fromString;\nexport const fromValue = LongLib.fromValue;\nexport const toInt = LongLib.toInt;\nexport const toBytes = LongLib.toBytes;\nexport const toNumber = LongLib.toNumber;\nexport const toString = LongLib.toString;\nexport const getLowBits = LongLib.getLowBits;\nexport const getHighBits = LongLib.getHighBits;\nexport const getLowBitsUnsigned = LongLib.getLowBitsUnsigned;\nexport const getHighBitsUnsigned = LongLib.getHighBitsUnsigned;\nfunction getMaxValue(unsigned, radix, isNegative) {\n switch (radix) {\n case 2: return unsigned ?\n \"1111111111111111111111111111111111111111111111111111111111111111\" :\n (isNegative ? \"1000000000000000000000000000000000000000000000000000000000000000\"\n : \"111111111111111111111111111111111111111111111111111111111111111\");\n case 8: return unsigned ?\n \"1777777777777777777777\" :\n (isNegative ? \"1000000000000000000000\" : \"777777777777777777777\");\n case 10: return unsigned ?\n \"18446744073709551615\" :\n (isNegative ? \"9223372036854775808\" : \"9223372036854775807\");\n case 16: return unsigned ?\n \"FFFFFFFFFFFFFFFF\" :\n (isNegative ? \"8000000000000000\" : \"7FFFFFFFFFFFFFFF\");\n default: throw new Error(\"Invalid radix.\");\n }\n}\nexport function abs(x) {\n if (!x.unsigned && LongLib.isNegative(x)) {\n return op_UnaryNegation(x);\n }\n else {\n return x;\n }\n}\nexport function fromInteger(value, unsigned, kind) {\n let x = value;\n let xh = 0;\n switch (kind) {\n case 0:\n x = value << 24 >> 24;\n xh = x;\n break;\n case 4:\n x = value << 24 >>> 24;\n break;\n case 1:\n x = value << 16 >> 16;\n xh = x;\n break;\n case 5:\n x = value << 16 >>> 16;\n break;\n case 2:\n x = value >> 0;\n xh = x;\n break;\n case 6:\n x = value >>> 0;\n break;\n }\n return LongLib.fromBits(x, xh >> 31, unsigned);\n}\nexport function parse(str, style, unsigned, _bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n const lessOrEqual = (x, y) => {\n const len = Math.max(x.length, y.length);\n return x.padStart(len, \"0\") <= y.padStart(len, \"0\");\n };\n const isNegative = res.sign === \"-\";\n const maxValue = getMaxValue(unsigned || res.radix !== 10, res.radix, isNegative);\n if (lessOrEqual(res.digits.toUpperCase(), maxValue)) {\n str = isNegative ? res.sign + res.digits : res.digits;\n return LongLib.fromString(str, unsigned, res.radix);\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function unixEpochMillisecondsToTicks(ms, offset) {\n return op_Multiply(op_Addition(op_Addition(LongLib.fromNumber(ms), 62135596800000), offset), 10000);\n}\nexport function ticksToUnixEpochMilliseconds(ticks) {\n return LongLib.toNumber(op_Subtraction(op_Division(ticks, 10000), 62135596800000));\n}\n// export function makeRangeStepFunction(step: Long, last: Long, unsigned: boolean) {\n// const stepComparedWithZero = LongLib.compare(step, unsigned ? LongLib.UZERO : LongLib.ZERO);\n// if (stepComparedWithZero === 0) {\n// throw new Error(\"The step of a range cannot be zero\");\n// }\n// const stepGreaterThanZero = stepComparedWithZero > 0;\n// return (x: Long) => {\n// const comparedWithLast = LongLib.compare(x, last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\nexport function divRem(x, y, out) {\n const div = op_Division(x, y);\n const rem = op_Modulus(x, y);\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","import { Record, Union } from \"./Types.js\";\nimport { combineHashCodes, equalArraysWith, stringHash } from \"./Util.js\";\nimport Decimal from \"./Decimal.js\";\nimport { fromInt as int64FromInt } from \"./Long.js\";\nexport class CaseInfo {\n constructor(declaringType, tag, name, fields) {\n this.declaringType = declaringType;\n this.tag = tag;\n this.name = name;\n this.fields = fields;\n }\n}\nexport class MethodInfo {\n constructor(name, parameters, returnType) {\n this.name = name;\n this.parameters = parameters;\n this.returnType = returnType;\n }\n}\nexport class TypeInfo {\n constructor(fullname, generics, construct, parent, fields, cases, enumCases) {\n this.fullname = fullname;\n this.generics = generics;\n this.construct = construct;\n this.parent = parent;\n this.fields = fields;\n this.cases = cases;\n this.enumCases = enumCases;\n }\n toString() {\n return fullName(this);\n }\n GetHashCode() {\n return getHashCode(this);\n }\n Equals(other) {\n return equals(this, other);\n }\n}\nexport class GenericParameter extends TypeInfo {\n constructor(name) {\n super(name);\n }\n}\nexport function getGenerics(t) {\n return t.generics != null ? t.generics : [];\n}\nexport function getHashCode(t) {\n const fullnameHash = stringHash(t.fullname);\n const genHashes = getGenerics(t).map(getHashCode);\n return combineHashCodes([fullnameHash, ...genHashes]);\n}\nexport function equals(t1, t2) {\n if (t1.fullname === \"\") { // Anonymous records\n return t2.fullname === \"\"\n && equalArraysWith(getRecordElements(t1), getRecordElements(t2), ([k1, v1], [k2, v2]) => k1 === k2 && equals(v1, v2));\n }\n else {\n return t1.fullname === t2.fullname\n && equalArraysWith(getGenerics(t1), getGenerics(t2), equals);\n }\n}\nexport function class_type(fullname, generics, construct, parent) {\n return new TypeInfo(fullname, generics, construct, parent);\n}\nexport function record_type(fullname, generics, construct, fields) {\n return new TypeInfo(fullname, generics, construct, undefined, fields);\n}\nexport function anonRecord_type(...fields) {\n return new TypeInfo(\"\", undefined, undefined, undefined, () => fields);\n}\nexport function union_type(fullname, generics, construct, cases) {\n const t = new TypeInfo(fullname, generics, construct, undefined, undefined, () => {\n const caseNames = construct.prototype.cases();\n return cases().map((fields, i) => new CaseInfo(t, i, caseNames[i], fields));\n });\n return t;\n}\nexport function tuple_type(...generics) {\n return new TypeInfo(\"System.Tuple`\" + generics.length, generics);\n}\nexport function delegate_type(...generics) {\n return new TypeInfo(\"System.Func`\" + generics.length, generics);\n}\nexport function lambda_type(argType, returnType) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpFunc`2\", [argType, returnType]);\n}\nexport function option_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpOption`1\", [generic]);\n}\nexport function list_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Collections.FSharpList`1\", [generic]);\n}\nexport function array_type(generic) {\n return new TypeInfo(\"[]\", [generic]);\n}\nexport function enum_type(fullname, underlyingType, enumCases) {\n return new TypeInfo(fullname, [underlyingType], undefined, undefined, undefined, undefined, enumCases);\n}\nexport function measure_type(fullname) {\n return new TypeInfo(fullname);\n}\nexport function generic_type(name) {\n return new GenericParameter(name);\n}\nexport const obj_type = new TypeInfo(\"System.Object\");\nexport const unit_type = new TypeInfo(\"Microsoft.FSharp.Core.Unit\");\nexport const char_type = new TypeInfo(\"System.Char\");\nexport const string_type = new TypeInfo(\"System.String\");\nexport const bool_type = new TypeInfo(\"System.Boolean\");\nexport const int8_type = new TypeInfo(\"System.SByte\");\nexport const uint8_type = new TypeInfo(\"System.Byte\");\nexport const int16_type = new TypeInfo(\"System.Int16\");\nexport const uint16_type = new TypeInfo(\"System.UInt16\");\nexport const int32_type = new TypeInfo(\"System.Int32\");\nexport const uint32_type = new TypeInfo(\"System.UInt32\");\nexport const float32_type = new TypeInfo(\"System.Single\");\nexport const float64_type = new TypeInfo(\"System.Double\");\nexport const decimal_type = new TypeInfo(\"System.Decimal\");\nexport function name(info) {\n if (Array.isArray(info)) {\n return info[0];\n }\n else if (info instanceof TypeInfo) {\n const elemType = getElementType(info);\n if (elemType != null) {\n return name(elemType) + \"[]\";\n }\n else {\n const i = info.fullname.lastIndexOf(\".\");\n return i === -1 ? info.fullname : info.fullname.substr(i + 1);\n }\n }\n else {\n return info.name;\n }\n}\nexport function fullName(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return fullName(elemType) + \"[]\";\n }\n else if (t.generics == null || t.generics.length === 0) {\n return t.fullname;\n }\n else {\n return t.fullname + \"[\" + t.generics.map((x) => fullName(x)).join(\",\") + \"]\";\n }\n}\nexport function namespace(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return namespace(elemType);\n }\n else {\n const i = t.fullname.lastIndexOf(\".\");\n return i === -1 ? \"\" : t.fullname.substr(0, i);\n }\n}\nexport function isArray(t) {\n return getElementType(t) != null;\n}\nexport function getElementType(t) {\n var _a;\n return t.fullname === \"[]\" && ((_a = t.generics) === null || _a === void 0 ? void 0 : _a.length) === 1 ? t.generics[0] : undefined;\n}\nexport function isGenericType(t) {\n return t.generics != null && t.generics.length > 0;\n}\nexport function isGenericParameter(t) {\n return t instanceof GenericParameter;\n}\nexport function isEnum(t) {\n return t.enumCases != null && t.enumCases.length > 0;\n}\nexport function isSubclassOf(t1, t2) {\n return t1.parent != null && (t1.parent.Equals(t2) || isSubclassOf(t1.parent, t2));\n}\nfunction isErasedToNumber(t) {\n return isEnum(t) || [\n int8_type.fullname,\n uint8_type.fullname,\n int16_type.fullname,\n uint16_type.fullname,\n int32_type.fullname,\n uint32_type.fullname,\n float32_type.fullname,\n float64_type.fullname,\n ].includes(t.fullname);\n}\nexport function isInstanceOfType(t, o) {\n switch (typeof o) {\n case \"boolean\":\n return t.fullname === bool_type.fullname;\n case \"string\":\n return t.fullname === string_type.fullname;\n case \"function\":\n return isFunction(t);\n case \"number\":\n return isErasedToNumber(t);\n default:\n return t.construct != null && o instanceof t.construct;\n }\n}\n/**\n * This doesn't replace types for fields (records) or cases (unions)\n * but it should be enough for type comparison purposes\n */\nexport function getGenericTypeDefinition(t) {\n return t.generics == null ? t : new TypeInfo(t.fullname, t.generics.map(() => obj_type));\n}\nexport function getEnumUnderlyingType(t) {\n var _a;\n return (_a = t.generics) === null || _a === void 0 ? void 0 : _a[0];\n}\nexport function getEnumValues(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[1]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function getEnumNames(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[0]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nfunction getEnumCase(t, v) {\n if (t.enumCases != null) {\n if (typeof v === \"string\") {\n for (const kv of t.enumCases) {\n if (kv[0] === v) {\n return kv;\n }\n }\n throw new Error(`'${v}' was not found in ${t.fullname}`);\n }\n else {\n for (const kv of t.enumCases) {\n if (kv[1] === v) {\n return kv;\n }\n }\n // .NET returns the number even if it doesn't match any of the cases\n return [\"\", v];\n }\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function parseEnum(t, str) {\n // TODO: better int parsing here, parseInt ceils floats: \"4.8\" -> 4\n const value = parseInt(str, 10);\n return getEnumCase(t, isNaN(value) ? str : value)[1];\n}\nexport function tryParseEnum(t, str, defValue) {\n try {\n defValue.contents = parseEnum(t, str);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function getEnumName(t, v) {\n return getEnumCase(t, v)[0];\n}\nexport function isEnumDefined(t, v) {\n try {\n const kv = getEnumCase(t, v);\n return kv[0] != null && kv[0] !== \"\";\n }\n catch (_a) {\n // supress error\n }\n return false;\n}\n// FSharpType\nexport function getUnionCases(t) {\n if (t.cases != null) {\n return t.cases();\n }\n else {\n throw new Error(`${t.fullname} is not an F# union type`);\n }\n}\nexport function getRecordElements(t) {\n if (t.fields != null) {\n return t.fields();\n }\n else {\n throw new Error(`${t.fullname} is not an F# record type`);\n }\n}\nexport function getTupleElements(t) {\n if (isTuple(t) && t.generics != null) {\n return t.generics;\n }\n else {\n throw new Error(`${t.fullname} is not a tuple type`);\n }\n}\nexport function getFunctionElements(t) {\n if (isFunction(t) && t.generics != null) {\n const gen = t.generics;\n return [gen[0], gen[1]];\n }\n else {\n throw new Error(`${t.fullname} is not an F# function type`);\n }\n}\nexport function isUnion(t) {\n return t instanceof TypeInfo ? t.cases != null : t instanceof Union;\n}\nexport function isRecord(t) {\n return t instanceof TypeInfo ? t.fields != null : t instanceof Record;\n}\nexport function isTuple(t) {\n return t.fullname.startsWith(\"System.Tuple\");\n}\n// In .NET this is false for delegates\nexport function isFunction(t) {\n return t.fullname === \"Microsoft.FSharp.Core.FSharpFunc`2\";\n}\n// FSharpValue\nexport function getUnionFields(v, t) {\n const cases = getUnionCases(t);\n const case_ = cases[v.tag];\n if (case_ == null) {\n throw new Error(`Cannot find case ${v.name} in union type`);\n }\n return [case_, v.fields];\n}\nexport function getUnionCaseFields(uci) {\n return uci.fields == null ? [] : uci.fields;\n}\n// This is used as replacement of `FSharpValue.GetRecordFields`\n// For `FSharpTypes.GetRecordFields` see `getRecordElements`\n// Object.keys returns keys in the order they were added to the object\nexport function getRecordFields(v) {\n return Object.keys(v).map((k) => v[k]);\n}\nexport function getRecordField(v, field) {\n return v[field[0]];\n}\nexport function getTupleFields(v) {\n return v;\n}\nexport function getTupleField(v, i) {\n return v[i];\n}\nexport function makeUnion(uci, values) {\n const expectedLength = (uci.fields || []).length;\n if (values.length !== expectedLength) {\n throw new Error(`Expected an array of length ${expectedLength} but got ${values.length}`);\n }\n return uci.declaringType.construct != null\n ? new uci.declaringType.construct(uci.tag, ...values)\n : {};\n}\nexport function makeRecord(t, values) {\n const fields = getRecordElements(t);\n if (fields.length !== values.length) {\n throw new Error(`Expected an array of length ${fields.length} but got ${values.length}`);\n }\n return t.construct != null\n ? new t.construct(...values)\n : fields.reduce((obj, [key, _t], i) => {\n obj[key] = values[i];\n return obj;\n }, {});\n}\nexport function makeTuple(values, _t) {\n return values;\n}\nexport function makeGenericType(t, generics) {\n return new TypeInfo(t.fullname, generics, t.construct, t.parent, t.fields, t.cases);\n}\nexport function createInstance(t, consArgs) {\n // TODO: Check if consArgs length is same as t.construct?\n // (Arg types can still be different)\n if (typeof t.construct === \"function\") {\n return new t.construct(...(consArgs !== null && consArgs !== void 0 ? consArgs : []));\n }\n else if (isErasedToNumber(t)) {\n return 0;\n }\n else {\n switch (t.fullname) {\n case obj_type.fullname:\n return {};\n case bool_type.fullname:\n return false;\n case \"System.Int64\":\n case \"System.UInt64\":\n // typeof and typeof get transformed to class_type(\"System.Int64\")\n // and class_type(\"System.UInt64\") respectively. Test for the name of the primitive type.\n return int64FromInt(0);\n case decimal_type.fullname:\n return new Decimal(0);\n case char_type.fullname:\n // Even though char is a value type, it's erased to string, and Unchecked.defaultof is null\n return null;\n default:\n throw new Error(`Cannot access constructor of ${t.fullname}`);\n }\n }\n}\nexport function getValue(propertyInfo, v) {\n return v[propertyInfo[0]];\n}\n// Fable.Core.Reflection\nfunction assertUnion(x) {\n if (!(x instanceof Union)) {\n throw new Error(`Value is not an F# union type`);\n }\n}\nexport function getCaseTag(x) {\n assertUnion(x);\n return x.tag;\n}\nexport function getCaseName(x) {\n assertUnion(x);\n return x.cases()[x.tag];\n}\nexport function getCaseFields(x) {\n assertUnion(x);\n return x.fields;\n}\n","export class CancellationToken {\n constructor(cancelled = false) {\n this._id = 0;\n this._cancelled = cancelled;\n this._listeners = new Map();\n }\n get isCancelled() {\n return this._cancelled;\n }\n cancel() {\n if (!this._cancelled) {\n this._cancelled = true;\n for (const [, listener] of this._listeners) {\n listener();\n }\n }\n }\n addListener(f) {\n const id = this._id;\n this._listeners.set(this._id++, f);\n return id;\n }\n removeListener(id) {\n return this._listeners.delete(id);\n }\n register(f, state) {\n const $ = this;\n const id = this.addListener(state == null ? f : () => f(state));\n return { Dispose() { $.removeListener(id); } };\n }\n}\nexport class OperationCanceledError extends Error {\n constructor() {\n super(\"The operation was canceled\");\n Object.setPrototypeOf(this, OperationCanceledError.prototype);\n }\n}\nexport class Trampoline {\n constructor() {\n this.callCount = 0;\n }\n static get maxTrampolineCallCount() {\n return 2000;\n }\n incrementAndCheck() {\n return this.callCount++ > Trampoline.maxTrampolineCallCount;\n }\n hijack(f) {\n this.callCount = 0;\n setTimeout(f, 0);\n }\n}\nexport function protectedCont(f) {\n return (ctx) => {\n if (ctx.cancelToken.isCancelled) {\n ctx.onCancel(new OperationCanceledError());\n }\n else if (ctx.trampoline.incrementAndCheck()) {\n ctx.trampoline.hijack(() => {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(err);\n }\n });\n }\n else {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(err);\n }\n }\n };\n}\nexport function protectedBind(computation, binder) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n try {\n binder(x)(ctx);\n }\n catch (ex) {\n ctx.onError(ex);\n }\n },\n onError: ctx.onError,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function protectedReturn(value) {\n return protectedCont((ctx) => ctx.onSuccess(value));\n}\nexport class AsyncBuilder {\n Bind(computation, binder) {\n return protectedBind(computation, binder);\n }\n Combine(computation1, computation2) {\n return this.Bind(computation1, () => computation2);\n }\n Delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n }\n For(sequence, body) {\n const iter = sequence[Symbol.iterator]();\n let cur = iter.next();\n return this.While(() => !cur.done, this.Delay(() => {\n const res = body(cur.value);\n cur = iter.next();\n return res;\n }));\n }\n Return(value) {\n return protectedReturn(value);\n }\n ReturnFrom(computation) {\n return computation;\n }\n TryFinally(computation, compensation) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n compensation();\n ctx.onSuccess(x);\n },\n onError: (x) => {\n compensation();\n ctx.onError(x);\n },\n onCancel: (x) => {\n compensation();\n ctx.onCancel(x);\n },\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n }\n TryWith(computation, catchHandler) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: ctx.onSuccess,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n onError: (ex) => {\n try {\n catchHandler(ex)(ctx);\n }\n catch (ex2) {\n ctx.onError(ex2);\n }\n },\n });\n });\n }\n Using(resource, binder) {\n return this.TryFinally(binder(resource), () => resource.Dispose());\n }\n While(guard, computation) {\n if (guard()) {\n return this.Bind(computation, () => this.While(guard, computation));\n }\n else {\n return this.Return(void 0);\n }\n }\n Zero() {\n return protectedCont((ctx) => ctx.onSuccess(void 0));\n }\n}\nexport const singleton = new AsyncBuilder();\n","import { compare, equals, structuralHash } from \"./Util.js\";\n// Using a class here for better compatibility with TS files importing Some\nexport class Some {\n constructor(value) {\n this.value = value;\n }\n toJSON() {\n return this.value;\n }\n // Don't add \"Some\" for consistency with erased options\n toString() {\n return String(this.value);\n }\n GetHashCode() {\n return structuralHash(this.value);\n }\n Equals(other) {\n if (other == null) {\n return false;\n }\n else {\n return equals(this.value, other instanceof Some ? other.value : other);\n }\n }\n CompareTo(other) {\n if (other == null) {\n return 1;\n }\n else {\n return compare(this.value, other instanceof Some ? other.value : other);\n }\n }\n}\nexport function some(x) {\n return x == null || x instanceof Some ? new Some(x) : x;\n}\nexport function value(x) {\n if (x == null) {\n throw new Error(\"Option has no value\");\n }\n else {\n return x instanceof Some ? x.value : x;\n }\n}\nexport function ofNullable(x) {\n // This will fail with unit probably, an alternative would be:\n // return x === null ? undefined : (x === undefined ? new Some(x) : x);\n return x == null ? undefined : x;\n}\nexport function toNullable(x) {\n return x == null ? null : value(x);\n}\nexport function flatten(x) {\n return x == null ? undefined : value(x);\n}\nexport function toArray(opt) {\n return (opt == null) ? [] : [value(opt)];\n}\nexport function defaultArg(opt, defaultValue) {\n return (opt != null) ? value(opt) : defaultValue;\n}\nexport function defaultArgWith(opt, defThunk) {\n return (opt != null) ? value(opt) : defThunk();\n}\nexport function filter(predicate, opt) {\n return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt;\n}\nexport function map(mapping, opt) {\n return (opt != null) ? some(mapping(value(opt))) : undefined;\n}\nexport function map2(mapping, opt1, opt2) {\n return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined;\n}\nexport function map3(mapping, opt1, opt2, opt3) {\n return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined;\n}\nexport function bind(binder, opt) {\n return opt != null ? binder(value(opt)) : undefined;\n}\nexport function tryOp(op, arg) {\n try {\n return some(op(arg));\n }\n catch (_a) {\n return undefined;\n }\n}\n","import { Union } from \"./Types.js\";\r\nimport { union_type } from \"./Reflection.js\";\r\nimport { some } from \"./Option.js\";\r\n\r\nexport class FSharpResult$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Ok\", \"Error\"];\r\n }\r\n}\r\n\r\nexport function FSharpResult$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpResult`2\", [gen0, gen1], FSharpResult$2, () => [[[\"ResultValue\", gen0]], [[\"ErrorValue\", gen1]]]);\r\n}\r\n\r\nexport function Result_Map(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, mapping(result.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport function Result_MapError(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, mapping(result.fields[0]));\r\n }\r\n}\r\n\r\nexport function Result_Bind(binder, result) {\r\n if (result.tag === 0) {\r\n return binder(result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport class FSharpChoice$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of2\", \"Choice2Of2\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpChoice`2\", [gen0, gen1], FSharpChoice$2, () => [[[\"Item\", gen0]], [[\"Item\", gen1]]]);\r\n}\r\n\r\nexport class FSharpChoice$3 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of3\", \"Choice2Of3\", \"Choice3Of3\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$3$reflection(gen0, gen1, gen2) {\r\n return union_type(\"FSharp.Core.FSharpChoice`3\", [gen0, gen1, gen2], FSharpChoice$3, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]]]);\r\n}\r\n\r\nexport class FSharpChoice$4 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of4\", \"Choice2Of4\", \"Choice3Of4\", \"Choice4Of4\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$4$reflection(gen0, gen1, gen2, gen3) {\r\n return union_type(\"FSharp.Core.FSharpChoice`4\", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]]]);\r\n}\r\n\r\nexport class FSharpChoice$5 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of5\", \"Choice2Of5\", \"Choice3Of5\", \"Choice4Of5\", \"Choice5Of5\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$5$reflection(gen0, gen1, gen2, gen3, gen4) {\r\n return union_type(\"FSharp.Core.FSharpChoice`5\", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]]]);\r\n}\r\n\r\nexport class FSharpChoice$6 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of6\", \"Choice2Of6\", \"Choice3Of6\", \"Choice4Of6\", \"Choice5Of6\", \"Choice6Of6\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$6$reflection(gen0, gen1, gen2, gen3, gen4, gen5) {\r\n return union_type(\"FSharp.Core.FSharpChoice`6\", [gen0, gen1, gen2, gen3, gen4, gen5], FSharpChoice$6, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]]]);\r\n}\r\n\r\nexport class FSharpChoice$7 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of7\", \"Choice2Of7\", \"Choice3Of7\", \"Choice4Of7\", \"Choice5Of7\", \"Choice6Of7\", \"Choice7Of7\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$7$reflection(gen0, gen1, gen2, gen3, gen4, gen5, gen6) {\r\n return union_type(\"FSharp.Core.FSharpChoice`7\", [gen0, gen1, gen2, gen3, gen4, gen5, gen6], FSharpChoice$7, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]], [[\"Item\", gen6]]]);\r\n}\r\n\r\nexport function Choice_makeChoice1Of2(x) {\r\n return new FSharpChoice$2(0, x);\r\n}\r\n\r\nexport function Choice_makeChoice2Of2(x) {\r\n return new FSharpChoice$2(1, x);\r\n}\r\n\r\nexport function Choice_tryValueIfChoice1Of2(x) {\r\n if (x.tag === 0) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function Choice_tryValueIfChoice2Of2(x) {\r\n if (x.tag === 1) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\n","import { OperationCanceledError, Trampoline } from \"./AsyncBuilder.js\";\nimport { CancellationToken } from \"./AsyncBuilder.js\";\nimport { protectedCont } from \"./AsyncBuilder.js\";\nimport { protectedBind } from \"./AsyncBuilder.js\";\nimport { protectedReturn } from \"./AsyncBuilder.js\";\nimport { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from \"./Choice.js\";\nimport { TimeoutException } from \"./SystemException.js\";\n// Implemented just for type references\nexport class Async {\n}\nfunction emptyContinuation(_x) {\n // NOP\n}\n// see AsyncBuilder.Delay\nfunction delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n}\n// MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T>\nexport function makeAsync(body) {\n return body;\n}\n// Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn\nexport function invoke(computation, ctx) {\n return computation(ctx);\n}\n// CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function callThenInvoke(ctx, result1, part2) {\n return part2(result1)(ctx);\n}\n// Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function bind(ctx, part1, part2) {\n return protectedBind(part1, part2)(ctx);\n}\nexport function createCancellationToken(arg) {\n const token = new CancellationToken(typeof arg === \"boolean\" ? arg : false);\n if (typeof arg === \"number\") {\n setTimeout(() => { token.cancel(); }, arg);\n }\n return token;\n}\nexport function cancel(token) {\n token.cancel();\n}\nexport function cancelAfter(token, ms) {\n setTimeout(() => { token.cancel(); }, ms);\n}\nexport function isCancellationRequested(token) {\n return token != null && token.isCancelled;\n}\nexport function throwIfCancellationRequested(token) {\n if (token != null && token.isCancelled) {\n throw new Error(\"Operation is cancelled\");\n }\n}\nfunction throwAfter(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onError(new TimeoutException());\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function startChild(computation, ms) {\n if (ms) {\n const computationWithTimeout = protectedBind(parallel2(computation, throwAfter(ms)), xs => protectedReturn(xs[0]));\n return startChild(computationWithTimeout);\n }\n const promise = startAsPromise(computation);\n // JS Promises are hot, computation has already started\n // but we delay returning the result\n return protectedCont((ctx) => protectedReturn(awaitPromise(promise))(ctx));\n}\nexport function awaitPromise(p) {\n return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledError\n ? conts[2] : conts[1])(err)));\n}\nexport function cancellationToken() {\n return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken));\n}\nexport const defaultCancellationToken = new CancellationToken();\nexport function catchAsync(work) {\n return protectedCont((ctx) => {\n work({\n onSuccess: (x) => ctx.onSuccess(Choice_makeChoice1Of2(x)),\n onError: (ex) => ctx.onSuccess(Choice_makeChoice2Of2(ex)),\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function fromContinuations(f) {\n return protectedCont((ctx) => f([ctx.onSuccess, ctx.onError, ctx.onCancel]));\n}\nexport function ignore(computation) {\n return protectedBind(computation, (_x) => protectedReturn(void 0));\n}\nexport function parallel(computations) {\n return delay(() => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w)))));\n}\nfunction parallel2(a, b) {\n return delay(() => awaitPromise(Promise.all([startAsPromise(a), startAsPromise(b)])));\n}\nexport function sequential(computations) {\n function _sequential(computations) {\n let pr = Promise.resolve([]);\n for (const c of computations) {\n pr = pr.then(results => startAsPromise(c).then(r => results.concat([r])));\n }\n return pr;\n }\n return delay(() => awaitPromise(_sequential(computations)));\n}\nexport function sleep(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onSuccess(void 0);\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function runSynchronously() {\n throw new Error(\"Asynchronous code cannot be run synchronously in JS\");\n}\nexport function start(computation, cancellationToken) {\n return startWithContinuations(computation, cancellationToken);\n}\nexport function startImmediate(computation, cancellationToken) {\n return start(computation, cancellationToken);\n}\nexport function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {\n if (typeof continuation !== \"function\") {\n cancelToken = continuation;\n continuation = undefined;\n }\n const trampoline = new Trampoline();\n computation({\n onSuccess: continuation ? continuation : emptyContinuation,\n onError: exceptionContinuation ? exceptionContinuation : emptyContinuation,\n onCancel: cancellationContinuation ? cancellationContinuation : emptyContinuation,\n cancelToken: cancelToken ? cancelToken : defaultCancellationToken,\n trampoline,\n });\n}\nexport function startAsPromise(computation, cancellationToken) {\n return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken));\n}\nexport default Async;\n","/**\n * DateTimeOffset functions.\n *\n * Note: Date instances are always DateObjects in local\n * timezone (because JS dates are all kinds of messed up).\n * A local date returns UTC epoc when `.getTime()` is called.\n *\n * Basically; invariant: date.getTime() always return UTC time.\n */\nimport { fromValue, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from \"./Long.js\";\nimport { compareDates, dateOffset, padWithZeros } from \"./Util.js\";\nexport function dateOffsetToString(offset) {\n const isMinus = offset < 0;\n offset = Math.abs(offset);\n const hours = ~~(offset / 3600000);\n const minutes = (offset % 3600000) / 60000;\n return (isMinus ? \"-\" : \"+\") +\n padWithZeros(hours, 2) + \":\" +\n padWithZeros(minutes, 2);\n}\nexport function dateToHalfUTCString(date, half) {\n const str = date.toISOString();\n return half === \"first\"\n ? str.substring(0, str.indexOf(\"T\"))\n : str.substring(str.indexOf(\"T\") + 1, str.length - 1);\n}\nfunction dateToISOString(d, utc) {\n if (utc) {\n return d.toISOString();\n }\n else {\n // JS Date is always local\n const printOffset = d.kind == null ? true : d.kind === 2 /* Local */;\n return padWithZeros(d.getFullYear(), 4) + \"-\" +\n padWithZeros(d.getMonth() + 1, 2) + \"-\" +\n padWithZeros(d.getDate(), 2) + \"T\" +\n padWithZeros(d.getHours(), 2) + \":\" +\n padWithZeros(d.getMinutes(), 2) + \":\" +\n padWithZeros(d.getSeconds(), 2) + \".\" +\n padWithZeros(d.getMilliseconds(), 3) +\n (printOffset ? dateOffsetToString(d.getTimezoneOffset() * -60000) : \"\");\n }\n}\nfunction dateToISOStringWithOffset(dateWithOffset, offset) {\n const str = dateWithOffset.toISOString();\n return str.substring(0, str.length - 1) + dateOffsetToString(offset);\n}\nfunction dateToStringWithCustomFormat(date, format, utc) {\n return format.replace(/(\\w)\\1*/g, (match) => {\n let rep = Number.NaN;\n switch (match.substring(0, 1)) {\n case \"y\":\n const y = utc ? date.getUTCFullYear() : date.getFullYear();\n rep = match.length < 4 ? y % 100 : y;\n break;\n case \"M\":\n rep = (utc ? date.getUTCMonth() : date.getMonth()) + 1;\n break;\n case \"d\":\n rep = utc ? date.getUTCDate() : date.getDate();\n break;\n case \"H\":\n rep = utc ? date.getUTCHours() : date.getHours();\n break;\n case \"h\":\n const h = utc ? date.getUTCHours() : date.getHours();\n rep = h > 12 ? h % 12 : h;\n break;\n case \"m\":\n rep = utc ? date.getUTCMinutes() : date.getMinutes();\n break;\n case \"s\":\n rep = utc ? date.getUTCSeconds() : date.getSeconds();\n break;\n case \"f\":\n rep = utc ? date.getUTCMilliseconds() : date.getMilliseconds();\n break;\n }\n if (Number.isNaN(rep)) {\n return match;\n }\n else {\n return (rep < 10 && match.length > 1) ? \"0\" + rep : \"\" + rep;\n }\n });\n}\nfunction dateToStringWithOffset(date, format) {\n var _a, _b, _c;\n const d = new Date(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0));\n if (typeof format !== \"string\") {\n return d.toISOString().replace(/\\.\\d+/, \"\").replace(/[A-Z]|\\.\\d+/g, \" \") + dateOffsetToString(((_b = date.offset) !== null && _b !== void 0 ? _b : 0));\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\": return dateToHalfUTCString(d, \"first\");\n case \"T\":\n case \"t\": return dateToHalfUTCString(d, \"second\");\n case \"O\":\n case \"o\": return dateToISOStringWithOffset(d, ((_c = date.offset) !== null && _c !== void 0 ? _c : 0));\n default: throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(d, format, true);\n }\n}\nfunction dateToStringWithKind(date, format) {\n const utc = date.kind === 1 /* UTC */;\n if (typeof format !== \"string\") {\n return utc ? date.toUTCString() : date.toLocaleString();\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\":\n return utc ? dateToHalfUTCString(date, \"first\") : date.toLocaleDateString();\n case \"T\":\n case \"t\":\n return utc ? dateToHalfUTCString(date, \"second\") : date.toLocaleTimeString();\n case \"O\":\n case \"o\":\n return dateToISOString(date, utc);\n default:\n throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(date, format, utc);\n }\n}\nexport function toString(date, format, _provider) {\n return date.offset != null\n ? dateToStringWithOffset(date, format)\n : dateToStringWithKind(date, format);\n}\nexport function DateTime(value, kind) {\n const d = new Date(value);\n d.kind = (kind == null ? 0 /* Unspecified */ : kind) | 0;\n return d;\n}\nexport function fromTicks(ticks, kind) {\n ticks = fromValue(ticks);\n kind = kind != null ? kind : 2 /* Local */; // better default than Unspecified\n let date = DateTime(ticksToUnixEpochMilliseconds(ticks), kind);\n // Ticks are local to offset (in this case, either UTC or Local/Unknown).\n // If kind is anything but UTC, that means that the tick number was not\n // in utc, thus getTime() cannot return UTC, and needs to be shifted.\n if (kind !== 1 /* UTC */) {\n date = DateTime(date.getTime() - dateOffset(date), kind);\n }\n return date;\n}\nexport function fromDateTimeOffset(date, kind) {\n var _a;\n switch (kind) {\n case 1 /* UTC */: return DateTime(date.getTime(), 1 /* UTC */);\n case 2 /* Local */: return DateTime(date.getTime(), 2 /* Local */);\n default:\n const d = DateTime(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0), kind);\n return DateTime(d.getTime() - dateOffset(d), kind);\n }\n}\nexport function getTicks(date) {\n return unixEpochMillisecondsToTicks(date.getTime(), dateOffset(date));\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\", actual JS min value is -8640000000000000\n return DateTime(-62135596800000, 0 /* Unspecified */);\n}\nexport function maxValue() {\n // This is \"9999-12-31T23:59:59.999Z\", actual JS max value is 8640000000000000\n return DateTime(253402300799999, 0 /* Unspecified */);\n}\nexport function parseRaw(input) {\n function fail() {\n throw new Error(`The string is not a valid Date: ${input}`);\n }\n if (input === null || input.trim() === \"\") {\n fail();\n }\n // ISO dates without TZ are parsed as UTC. Adding time without TZ keeps them local.\n if (input.length === 10 && input[4] === \"-\" && input[7] === \"-\") {\n input += \"T00:00:00\";\n }\n let date = new Date(input);\n let offset = null;\n if (isNaN(date.getTime())) {\n // Try to check strings JS Date cannot parse (see #1045, #1422)\n // tslint:disable-next-line:max-line-length\n const m = /^\\s*(\\d+[^\\w\\s:]\\d+[^\\w\\s:]\\d+)?\\s*(\\d+:\\d+(?::\\d+(?:\\.\\d+)?)?)?\\s*([AaPp][Mm])?\\s*(Z|[+-]([01]?\\d):?([0-5]?\\d)?)?\\s*$/.exec(input);\n if (m != null) {\n let baseDate;\n let timeInSeconds = 0;\n if (m[2] != null) {\n const timeParts = m[2].split(\":\");\n timeInSeconds =\n parseInt(timeParts[0], 10) * 3600 +\n parseInt(timeParts[1] || \"0\", 10) * 60 +\n parseFloat(timeParts[2] || \"0\");\n if (m[3] != null && m[3].toUpperCase() === \"PM\") {\n timeInSeconds += 720;\n }\n }\n if (m[4] != null) { // There's an offset, parse as UTC\n if (m[1] != null) {\n baseDate = new Date(m[1] + \" UTC\");\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getUTCFullYear() + \"/\" + (d.getUTCMonth() + 1) + \"/\" + d.getUTCDate());\n }\n if (m[4] === \"Z\") {\n offset = \"Z\";\n }\n else {\n let offsetInMinutes = parseInt(m[5], 10) * 60 + parseInt(m[6] || \"0\", 10);\n if (m[4][0] === \"-\") {\n offsetInMinutes *= -1;\n }\n offset = offsetInMinutes;\n timeInSeconds -= offsetInMinutes * 60;\n }\n }\n else {\n if (m[1] != null) {\n baseDate = new Date(m[1]);\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getFullYear() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getDate());\n }\n }\n date = new Date(baseDate.getTime() + timeInSeconds * 1000);\n // correct for daylight savings time\n date = new Date(date.getTime() + (date.getTimezoneOffset() - baseDate.getTimezoneOffset()) * 60000);\n }\n else {\n fail();\n }\n // Check again the date is valid after transformations, see #2229\n if (isNaN(date.getTime())) {\n fail();\n }\n }\n return [date, offset];\n}\nexport function parse(str, detectUTC = false) {\n const [date, offset] = parseRaw(str);\n // .NET always parses DateTime as Local if there's offset info (even \"Z\")\n // Newtonsoft.Json uses UTC if the offset is \"Z\"\n const kind = offset != null\n ? (detectUTC && offset === \"Z\" ? 1 /* UTC */ : 2 /* Local */)\n : 0 /* Unspecified */;\n return DateTime(date.getTime(), kind);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_err) {\n return false;\n }\n}\nexport function create(year, month, day, h = 0, m = 0, s = 0, ms = 0, kind) {\n const dateValue = kind === 1 /* UTC */\n ? Date.UTC(year, month - 1, day, h, m, s, ms)\n : new Date(year, month - 1, day, h, m, s, ms).getTime();\n if (isNaN(dateValue)) {\n throw new Error(\"The parameters describe an unrepresentable Date.\");\n }\n const date = DateTime(dateValue, kind);\n if (year <= 99) {\n date.setFullYear(year, month - 1, day);\n }\n return date;\n}\nexport function now() {\n return DateTime(Date.now(), 2 /* Local */);\n}\nexport function utcNow() {\n return DateTime(Date.now(), 1 /* UTC */);\n}\nexport function today() {\n return date(now());\n}\nexport function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nexport function daysInMonth(year, month) {\n return month === 2\n ? (isLeapYear(year) ? 29 : 28)\n : (month >= 8 ? (month % 2 === 0 ? 31 : 30) : (month % 2 === 0 ? 30 : 31));\n}\nexport function toUniversalTime(date) {\n return date.kind === 1 /* UTC */ ? date : DateTime(date.getTime(), 1 /* UTC */);\n}\nexport function toLocalTime(date) {\n return date.kind === 2 /* Local */ ? date : DateTime(date.getTime(), 2 /* Local */);\n}\nexport function specifyKind(d, kind) {\n return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), kind);\n}\nexport function timeOfDay(d) {\n return hour(d) * 3600000\n + minute(d) * 60000\n + second(d) * 1000\n + millisecond(d);\n}\nexport function date(d) {\n return create(year(d), month(d), day(d), 0, 0, 0, 0, d.kind);\n}\nexport function day(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDate() : d.getDate();\n}\nexport function hour(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCHours() : d.getHours();\n}\nexport function millisecond(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMilliseconds() : d.getMilliseconds();\n}\nexport function minute(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMinutes() : d.getMinutes();\n}\nexport function month(d) {\n return (d.kind === 1 /* UTC */ ? d.getUTCMonth() : d.getMonth()) + 1;\n}\nexport function second(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCSeconds() : d.getSeconds();\n}\nexport function year(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCFullYear() : d.getFullYear();\n}\nexport function dayOfWeek(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDay() : d.getDay();\n}\nexport function dayOfYear(d) {\n const _year = year(d);\n const _month = month(d);\n let _day = day(d);\n for (let i = 1; i < _month; i++) {\n _day += daysInMonth(_year, i);\n }\n return _day;\n}\nexport function add(d, ts) {\n const newDate = DateTime(d.getTime() + ts, d.kind);\n if (d.kind === 2 /* Local */) {\n const oldTzOffset = d.getTimezoneOffset();\n const newTzOffset = newDate.getTimezoneOffset();\n return oldTzOffset !== newTzOffset\n ? DateTime(newDate.getTime() + (newTzOffset - oldTzOffset) * 60000, d.kind)\n : newDate;\n }\n else {\n return newDate;\n }\n}\nexport function addDays(d, v) {\n return add(d, v * 86400000);\n}\nexport function addHours(d, v) {\n return add(d, v * 3600000);\n}\nexport function addMinutes(d, v) {\n return add(d, v * 60000);\n}\nexport function addSeconds(d, v) {\n return add(d, v * 1000);\n}\nexport function addMilliseconds(d, v) {\n return add(d, v);\n}\nexport function addYears(d, v) {\n const newMonth = month(d);\n const newYear = year(d) + v;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function addMonths(d, v) {\n let newMonth = month(d) + v;\n let newMonth_ = 0;\n let yearOffset = 0;\n if (newMonth > 12) {\n newMonth_ = newMonth % 12;\n yearOffset = Math.floor(newMonth / 12);\n newMonth = newMonth_;\n }\n else if (newMonth < 1) {\n newMonth_ = 12 + newMonth % 12;\n yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);\n newMonth = newMonth_;\n }\n const newYear = year(d) + yearOffset;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function subtract(d, that) {\n return typeof that === \"number\"\n ? add(d, -that)\n : d.getTime() - that.getTime();\n}\nexport function toLongDateString(d) {\n return d.toDateString();\n}\nexport function toShortDateString(d) {\n return d.toLocaleDateString();\n}\nexport function toLongTimeString(d) {\n return d.toLocaleTimeString();\n}\nexport function toShortTimeString(d) {\n return d.toLocaleTimeString().replace(/:\\d\\d(?!:)/, \"\");\n}\nexport function equals(d1, d2) {\n return d1.getTime() === d2.getTime();\n}\nexport const compare = compareDates;\nexport const compareTo = compareDates;\nexport function op_Addition(x, y) {\n return add(x, y);\n}\nexport function op_Subtraction(x, y) {\n return subtract(x, y);\n}\nexport function isDaylightSavingTime(x) {\n const jan = new Date(x.getFullYear(), 0, 1);\n const jul = new Date(x.getFullYear(), 6, 1);\n return isDST(jan.getTimezoneOffset(), jul.getTimezoneOffset(), x.getTimezoneOffset());\n}\nfunction isDST(janOffset, julOffset, tOffset) {\n return Math.min(janOffset, julOffset) === tOffset;\n}\nexport default DateTime;\n","export function create(pattern, options = 0) {\n // Supported RegexOptions\n // * IgnoreCase: 0x0001\n // * Multiline: 0x0002\n // * Singleline: 0x0010\n // * ECMAScript: 0x0100 (ignored)\n if ((options & ~(1 ^ 2 ^ 16 ^ 256)) !== 0) {\n throw new Error(\"RegexOptions only supports: IgnoreCase, Multiline, Singleline and ECMAScript\");\n }\n let flags = \"g\";\n flags += options & 1 ? \"i\" : \"\"; // 0x0001 RegexOptions.IgnoreCase\n flags += options & 2 ? \"m\" : \"\";\n flags += options & 16 ? \"s\" : \"\";\n return new RegExp(pattern, flags);\n}\n// From http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\nexport function escape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n}\nexport function unescape(str) {\n return str.replace(/\\\\([\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|])/g, \"$1\");\n}\nexport function isMatch(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.test(input);\n}\nexport function match(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.exec(input);\n}\nexport function matches(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n if (!reg.global) {\n throw new Error(\"Non-global RegExp\"); // Prevent infinite loop\n }\n let m = reg.exec(input);\n const matches = [];\n while (m !== null) {\n matches.push(m);\n m = reg.exec(input);\n }\n return matches;\n}\nexport function options(reg) {\n let options = 256; // ECMAScript\n options |= reg.ignoreCase ? 1 : 0;\n options |= reg.multiline ? 2 : 0;\n return options;\n}\nexport function replace(reg, input, replacement, limit, offset = 0) {\n function replacer() {\n let res = arguments[0];\n if (limit) {\n limit--;\n const match = [];\n const len = arguments.length;\n // arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter\n // * match: matched substring\n // * p1, p2, ...: nth capture group string\n // * offset: offset of matched substring\n // * string: whole string examined\n // * groups: named capturing groups\n // ONLY if regex contains a named capture group AND browser supports named groups\n // -> last element can be groups OR input string\n // -> check if last element is string\n const withGroups = typeof arguments[len - 1] !== \"string\";\n let pLast = withGroups ? len - 3 : len - 2;\n for (let i = 0; i < pLast; i++) {\n match.push(arguments[i]);\n }\n match.index = arguments[pLast++];\n match.input = arguments[pLast++];\n if (withGroups) {\n match.groups = arguments[pLast];\n }\n res = replacement(match);\n }\n return res;\n }\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n if (typeof replacement === \"function\") {\n limit = limit == null ? -1 : limit;\n return input.substring(0, offset) + input.substring(offset).replace(reg, replacer);\n }\n else {\n replacement =\n replacement\n // $0 doesn't work with JS regex, see #1155\n .replace(/\\$0/g, (_s) => \"$&\")\n // named groups in replacement are `${name}` in .Net, but `$` in JS (in regex: groups are `(?...)` in both)\n .replace(/\\${([^}]+)}/g, \"\\$<$1>\");\n if (limit != null) {\n let m;\n const sub1 = input.substring(offset);\n const _matches = matches(reg, sub1);\n const sub2 = matches.length > limit ? (m = _matches[limit - 1], sub1.substring(0, m.index + m[0].length)) : sub1;\n return input.substring(0, offset) + sub2.replace(reg, replacement)\n + input.substring(offset + sub2.length);\n }\n else {\n return input.replace(reg, replacement);\n }\n }\n}\nexport function split(reg, input, limit, offset = 0) {\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n input = input.substring(offset);\n return input.split(reg, limit);\n}\n","import { toString as dateToString } from \"./Date.js\";\nimport { compare as numericCompare, isNumeric, multiply, toExponential, toFixed, toHex, toPrecision } from \"./Numeric.js\";\nimport { escape } from \"./RegExp.js\";\nimport { toString } from \"./Types.js\";\nconst fsFormatRegExp = /(^|[^%])%([0+\\- ]*)(\\*|\\d+)?(?:\\.(\\d+))?(\\w)/g;\nconst interpolateRegExp = /(?:(^|[^%])%([0+\\- ]*)(\\d+)?(?:\\.(\\d+))?(\\w))?%P\\(\\)/g;\nconst formatRegExp = /\\{(\\d+)(,-?\\d+)?(?:\\:([a-zA-Z])(\\d{0,2})|\\:(.+?))?\\}/g;\nfunction isLessThan(x, y) {\n return numericCompare(x, y) < 0;\n}\nfunction cmp(x, y, ic) {\n function isIgnoreCase(i) {\n return i === true ||\n i === 1 /* CurrentCultureIgnoreCase */ ||\n i === 3 /* InvariantCultureIgnoreCase */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n function isOrdinal(i) {\n return i === 4 /* Ordinal */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n if (x == null) {\n return y == null ? 0 : -1;\n }\n if (y == null) {\n return 1;\n } // everything is bigger than null\n if (isOrdinal(ic)) {\n if (isIgnoreCase(ic)) {\n x = x.toLowerCase();\n y = y.toLowerCase();\n }\n return (x === y) ? 0 : (x < y ? -1 : 1);\n }\n else {\n if (isIgnoreCase(ic)) {\n x = x.toLocaleLowerCase();\n y = y.toLocaleLowerCase();\n }\n return x.localeCompare(y);\n }\n}\nexport function compare(...args) {\n switch (args.length) {\n case 2: return cmp(args[0], args[1], false);\n case 3: return cmp(args[0], args[1], args[2]);\n case 4: return cmp(args[0], args[1], args[2] === true);\n case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false);\n case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]);\n case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true);\n default: throw new Error(\"String.compare: Unsupported number of parameters\");\n }\n}\nexport function compareOrdinal(x, y) {\n return cmp(x, y, 4 /* Ordinal */);\n}\nexport function compareTo(x, y) {\n return cmp(x, y, 0 /* CurrentCulture */);\n}\nexport function startsWith(str, pattern, ic) {\n if (str.length >= pattern.length) {\n return cmp(str.substr(0, pattern.length), pattern, ic) === 0;\n }\n return false;\n}\nexport function indexOfAny(str, anyOf, ...args) {\n if (str == null || str === \"\") {\n return -1;\n }\n const startIndex = (args.length > 0) ? args[0] : 0;\n if (startIndex < 0) {\n throw new Error(\"Start index cannot be negative\");\n }\n const length = (args.length > 1) ? args[1] : str.length - startIndex;\n if (length < 0) {\n throw new Error(\"Length cannot be negative\");\n }\n if (length > str.length - startIndex) {\n throw new Error(\"Invalid startIndex and length\");\n }\n str = str.substr(startIndex, length);\n for (const c of anyOf) {\n const index = str.indexOf(c);\n if (index > -1) {\n return index + startIndex;\n }\n }\n return -1;\n}\nexport function printf(input) {\n return {\n input,\n cont: fsFormat(input),\n };\n}\nexport function interpolate(str, values) {\n let valIdx = 0;\n let strIdx = 0;\n let result = \"\";\n interpolateRegExp.lastIndex = 0;\n let match = interpolateRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n result += str.substring(strIdx, matchIndex).replace(/%%/g, \"%\");\n const [, , flags, padLength, precision, format] = match;\n result += formatReplacement(values[valIdx++], flags, padLength, precision, format);\n strIdx = interpolateRegExp.lastIndex;\n // Likewise we need to move interpolateRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n interpolateRegExp.lastIndex -= 1;\n match = interpolateRegExp.exec(str);\n }\n result += str.substring(strIdx).replace(/%%/g, \"%\");\n return result;\n}\nfunction continuePrint(cont, arg) {\n return typeof arg === \"string\" ? cont(arg) : arg.cont(cont);\n}\nexport function toConsole(arg) {\n // Don't remove the lambda here, see #1357\n return continuePrint((x) => console.log(x), arg);\n}\nexport function toConsoleError(arg) {\n return continuePrint((x) => console.error(x), arg);\n}\nexport function toText(arg) {\n return continuePrint((x) => x, arg);\n}\nexport function toFail(arg) {\n return continuePrint((x) => {\n throw new Error(x);\n }, arg);\n}\nfunction formatReplacement(rep, flags, padLength, precision, format) {\n let sign = \"\";\n flags = flags || \"\";\n format = format || \"\";\n if (isNumeric(rep)) {\n if (format.toLowerCase() !== \"x\") {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n else {\n if (flags.indexOf(\" \") >= 0) {\n sign = \" \";\n }\n else if (flags.indexOf(\"+\") >= 0) {\n sign = \"+\";\n }\n }\n }\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 6;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"x\":\n rep = toHex(rep);\n break;\n case \"X\":\n rep = toHex(rep).toUpperCase();\n break;\n default: // AOid\n rep = String(rep);\n break;\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep);\n }\n else {\n rep = toString(rep);\n }\n padLength = typeof padLength === \"number\" ? padLength : parseInt(padLength, 10);\n if (!isNaN(padLength)) {\n const zeroFlag = flags.indexOf(\"0\") >= 0; // Use '0' for left padding\n const minusFlag = flags.indexOf(\"-\") >= 0; // Right padding\n const ch = minusFlag || !zeroFlag ? \" \" : \"0\";\n if (ch === \"0\") {\n rep = padLeft(rep, padLength - sign.length, ch, minusFlag);\n rep = sign + rep;\n }\n else {\n rep = padLeft(sign + rep, padLength, ch, minusFlag);\n }\n }\n else {\n rep = sign + rep;\n }\n return rep;\n}\nfunction createPrinter(cont, _strParts, _matches, _result = \"\", padArg = -1) {\n return (...args) => {\n // Make copies of the values passed by reference because the function can be used multiple times\n let result = _result;\n const strParts = _strParts.slice();\n const matches = _matches.slice();\n for (const arg of args) {\n const [, , flags, _padLength, precision, format] = matches[0];\n let padLength = _padLength;\n if (padArg >= 0) {\n padLength = padArg;\n padArg = -1;\n }\n else if (padLength === \"*\") {\n if (arg < 0) {\n throw new Error(\"Non-negative number required\");\n }\n padArg = arg;\n continue;\n }\n result += strParts[0];\n result += formatReplacement(arg, flags, padLength, precision, format);\n strParts.splice(0, 1);\n matches.splice(0, 1);\n }\n if (matches.length === 0) {\n result += strParts[0];\n return cont(result);\n }\n else {\n return createPrinter(cont, strParts, matches, result, padArg);\n }\n };\n}\nexport function fsFormat(str) {\n return (cont) => {\n fsFormatRegExp.lastIndex = 0;\n const strParts = [];\n const matches = [];\n let strIdx = 0;\n let match = fsFormatRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n strParts.push(str.substring(strIdx, matchIndex).replace(/%%/g, \"%\"));\n matches.push(match);\n strIdx = fsFormatRegExp.lastIndex;\n // Likewise we need to move fsFormatRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n fsFormatRegExp.lastIndex -= 1;\n match = fsFormatRegExp.exec(str);\n }\n if (strParts.length === 0) {\n return cont(str.replace(/%%/g, \"%\"));\n }\n else {\n strParts.push(str.substring(strIdx).replace(/%%/g, \"%\"));\n return createPrinter(cont, strParts, matches);\n }\n };\n}\nexport function format(str, ...args) {\n if (typeof str === \"object\" && args.length > 0) {\n // Called with culture info\n str = args[0];\n args.shift();\n }\n return str.replace(formatRegExp, (_, idx, padLength, format, precision, pattern) => {\n let rep = args[idx];\n if (isNumeric(rep)) {\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 2;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"p\":\n case \"P\":\n precision = precision != null ? precision : 2;\n rep = toFixed(multiply(rep, 100), precision) + \" %\";\n break;\n case \"d\":\n case \"D\":\n rep = precision != null ? padLeft(String(rep), precision, \"0\") : String(rep);\n break;\n case \"x\":\n case \"X\":\n rep = precision != null ? padLeft(toHex(rep), precision, \"0\") : toHex(rep);\n if (format === \"X\") {\n rep = rep.toUpperCase();\n }\n break;\n default:\n if (pattern) {\n let sign = \"\";\n rep = pattern.replace(/([0#,]+)(\\.[0#]+)?/, (_, intPart, decimalPart) => {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n const decimalPartLength = decimalPart != null ? decimalPart.length : 0;\n rep = toFixed(rep, Math.max(decimalPartLength - 1, 0));\n // Thousands separator\n if (intPart.indexOf(\",\") > 0) {\n const [intPart, decimalPart] = rep.split(\".\");\n const i = intPart.length % 3;\n const thousandGroups = Math.floor(intPart.length / 3);\n let thousands = i > 0 ? intPart.substr(0, i) + (thousandGroups > 0 ? \",\" : \"\") : \"\";\n for (let j = 0; j < thousandGroups; j++) {\n thousands += intPart.substr(i + j * 3, 3) + (j < thousandGroups - 1 ? \",\" : \"\");\n }\n rep = decimalPart ? thousands + \".\" + decimalPart : thousands;\n }\n // In .NET you can mix 0/# placeholders but for simplicity we only check the left most character\n intPart = intPart.replace(/,/g, \"\");\n const intPartLength = intPart.length > 0 && intPart[0] === \"0\" ? intPart.length : 0;\n return padLeft(rep, intPartLength - sign.length + decimalPartLength, \"0\");\n });\n rep = sign + rep;\n }\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep, pattern || format);\n }\n else {\n rep = toString(rep);\n }\n padLength = parseInt((padLength || \" \").substring(1), 10);\n if (!isNaN(padLength)) {\n rep = padLeft(String(rep), Math.abs(padLength), \" \", padLength < 0);\n }\n return rep;\n });\n}\nexport function endsWith(str, search) {\n const idx = str.lastIndexOf(search);\n return idx >= 0 && idx === str.length - search.length;\n}\nexport function initialize(n, f) {\n if (n < 0) {\n throw new Error(\"String length must be non-negative\");\n }\n const xs = new Array(n);\n for (let i = 0; i < n; i++) {\n xs[i] = f(i);\n }\n return xs.join(\"\");\n}\nexport function insert(str, startIndex, value) {\n if (startIndex < 0 || startIndex > str.length) {\n throw new Error(\"startIndex is negative or greater than the length of this instance.\");\n }\n return str.substring(0, startIndex) + value + str.substring(startIndex);\n}\nexport function isNullOrEmpty(str) {\n return typeof str !== \"string\" || str.length === 0;\n}\nexport function isNullOrWhiteSpace(str) {\n return typeof str !== \"string\" || /^\\s*$/.test(str);\n}\nexport function concat(...xs) {\n return xs.map((x) => String(x)).join(\"\");\n}\nexport function join(delimiter, xs) {\n if (Array.isArray(xs)) {\n return xs.join(delimiter);\n }\n else {\n return Array.from(xs).join(delimiter);\n }\n}\nexport function joinWithIndices(delimiter, xs, startIndex, count) {\n const endIndexPlusOne = startIndex + count;\n if (endIndexPlusOne > xs.length) {\n throw new Error(\"Index and count must refer to a location within the buffer.\");\n }\n return xs.slice(startIndex, endIndexPlusOne).join(delimiter);\n}\nfunction notSupported(name) {\n throw new Error(\"The environment doesn't support '\" + name + \"', please use a polyfill.\");\n}\nexport function toBase64String(inArray) {\n let str = \"\";\n for (let i = 0; i < inArray.length; i++) {\n str += String.fromCharCode(inArray[i]);\n }\n return typeof btoa === \"function\" ? btoa(str) : notSupported(\"btoa\");\n}\nexport function fromBase64String(b64Encoded) {\n const binary = typeof atob === \"function\" ? atob(b64Encoded) : notSupported(\"atob\");\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\nexport function padLeft(str, len, ch, isRight) {\n ch = ch || \" \";\n len = len - str.length;\n for (let i = 0; i < len; i++) {\n str = isRight ? str + ch : ch + str;\n }\n return str;\n}\nexport function padRight(str, len, ch) {\n return padLeft(str, len, ch, true);\n}\nexport function remove(str, startIndex, count) {\n if (startIndex >= str.length) {\n throw new Error(\"startIndex must be less than length of string\");\n }\n if (typeof count === \"number\" && (startIndex + count) > str.length) {\n throw new Error(\"Index and count must refer to a location within the string.\");\n }\n return str.slice(0, startIndex) + (typeof count === \"number\" ? str.substr(startIndex + count) : \"\");\n}\nexport function replace(str, search, replace) {\n return str.replace(new RegExp(escape(search), \"g\"), replace);\n}\nexport function replicate(n, x) {\n return initialize(n, () => x);\n}\nexport function getCharAtIndex(input, index) {\n if (index < 0 || index >= input.length) {\n throw new Error(\"Index was outside the bounds of the array.\");\n }\n return input[index];\n}\nexport function split(str, splitters, count, options) {\n count = typeof count === \"number\" ? count : undefined;\n options = typeof options === \"number\" ? options : 0;\n if (count && count < 0) {\n throw new Error(\"Count cannot be less than zero\");\n }\n if (count === 0) {\n return [];\n }\n const removeEmpty = (options & 1) === 1;\n const trim = (options & 2) === 2;\n splitters = splitters || [];\n splitters = splitters.filter(x => x).map(escape);\n splitters = splitters.length > 0 ? splitters : [\"\\\\s\"];\n const splits = [];\n const reg = new RegExp(splitters.join(\"|\"), \"g\");\n let findSplits = true;\n let i = 0;\n do {\n const match = reg.exec(str);\n if (match === null) {\n const candidate = trim ? str.substring(i).trim() : str.substring(i);\n if (!removeEmpty || candidate.length > 0) {\n splits.push(candidate);\n }\n findSplits = false;\n }\n else {\n const candidate = trim ? str.substring(i, match.index).trim() : str.substring(i, match.index);\n if (!removeEmpty || candidate.length > 0) {\n if (count != null && splits.length + 1 === count) {\n splits.push(trim ? str.substring(i).trim() : str.substring(i));\n findSplits = false;\n }\n else {\n splits.push(candidate);\n }\n }\n i = reg.lastIndex;\n }\n } while (findSplits);\n return splits;\n}\nexport function trim(str, ...chars) {\n if (chars.length === 0) {\n return str.trim();\n }\n const pattern = \"[\" + escape(chars.join(\"\")) + \"]+\";\n return str.replace(new RegExp(\"^\" + pattern), \"\").replace(new RegExp(pattern + \"$\"), \"\");\n}\nexport function trimStart(str, ...chars) {\n return chars.length === 0\n ? str.trimStart()\n : str.replace(new RegExp(\"^[\" + escape(chars.join(\"\")) + \"]+\"), \"\");\n}\nexport function trimEnd(str, ...chars) {\n return chars.length === 0\n ? str.trimEnd()\n : str.replace(new RegExp(\"[\" + escape(chars.join(\"\")) + \"]+$\"), \"\");\n}\nexport function filter(pred, x) {\n return x.split(\"\").filter((c) => pred(c)).join(\"\");\n}\nexport function substring(str, startIndex, length) {\n if ((startIndex + (length || 0) > str.length)) {\n throw new Error(\"Invalid startIndex and/or length\");\n }\n return length != null ? str.substr(startIndex, length) : str.substr(startIndex);\n}\nexport function fmt(strs, ...args) {\n return ({ strs, args });\n}\nexport function fmtWith(fmts) {\n return (strs, ...args) => ({ strs, args, fmts });\n}\nexport function getFormat(s) {\n return s.fmts\n ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart)\n : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart);\n}\n","\r\nexport const SR_indexOutOfBounds = \"The index was outside the range of elements in the collection.\";\r\n\r\nexport const SR_inputWasEmpty = \"Collection was empty.\";\r\n\r\nexport const SR_inputMustBeNonNegative = \"The input must be non-negative.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_differentLengths = \"The collections had different lengths.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\n","import { value as value_2, defaultArg, some } from \"./Option.js\";\r\nimport { min as min_1, getEnumerator, comparePrimitives, max as max_1 } from \"./Util.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport function Helpers_allocateArrayFromCons(cons, len) {\r\n if ((typeof cons) === \"function\") {\r\n return new cons(len);\r\n }\r\n else {\r\n return new Array(len);\r\n }\r\n}\r\n\r\nfunction indexNotFound() {\r\n throw (new Error(\"An index satisfying the predicate was not found in the collection.\"));\r\n}\r\n\r\nfunction differentLengths() {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n}\r\n\r\nexport function append(array1, array2, cons) {\r\n const len1 = array1.length | 0;\r\n const len2 = array2.length | 0;\r\n const newArray = Helpers_allocateArrayFromCons(cons, len1 + len2);\r\n for (let i = 0; i <= (len1 - 1); i++) {\r\n newArray[i] = array1[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n newArray[i_1 + len1] = array2[i_1];\r\n }\r\n return newArray;\r\n}\r\n\r\nexport function filter(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function fill(target, targetIndex, count, value) {\r\n const start = targetIndex | 0;\r\n return target.fill(value, start, (start + count));\r\n}\r\n\r\nexport function getSubArray(array, start, count) {\r\n const start_1 = start | 0;\r\n return array.slice(start_1, (start_1 + count));\r\n}\r\n\r\nexport function last(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n return array[array.length - 1];\r\n}\r\n\r\nexport function tryLast(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[array.length - 1]);\r\n }\r\n}\r\n\r\nexport function mapIndexed(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(i, source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function map(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function mapIndexed2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapIndexed3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapFold(mapping, state, array, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const patternInput = mapping(acc, array[i]);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function mapFoldBack(mapping, array, state, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n const patternInput = mapping(array[i], acc);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function indexed(source) {\r\n const len = source.length | 0;\r\n const target = new Array(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = [i, source[i]];\r\n }\r\n return target;\r\n}\r\n\r\nexport function truncate(count, array) {\r\n const count_1 = max_1((x, y) => comparePrimitives(x, y), 0, count) | 0;\r\n const start = 0;\r\n return array.slice(start, (start + count_1));\r\n}\r\n\r\nexport function concat(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const matchValue = arrays_1.length | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n case 1: {\r\n return arrays_1[0];\r\n }\r\n default: {\r\n let totalIdx = 0;\r\n let totalLength = 0;\r\n for (let idx = 0; idx <= (arrays_1.length - 1); idx++) {\r\n const arr_1 = arrays_1[idx];\r\n totalLength = ((totalLength + arr_1.length) | 0);\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, totalLength);\r\n for (let idx_1 = 0; idx_1 <= (arrays_1.length - 1); idx_1++) {\r\n const arr_2 = arrays_1[idx_1];\r\n for (let j = 0; j <= (arr_2.length - 1); j++) {\r\n result[totalIdx] = arr_2[j];\r\n totalIdx = ((totalIdx + 1) | 0);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function collect(mapping, array, cons) {\r\n return concat(map(mapping, array, null), cons);\r\n}\r\n\r\nexport function where(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function contains(value, array, eq) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return false;\r\n }\r\n else if (eq.Equals(value, array[i])) {\r\n return true;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function empty(cons) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n}\r\n\r\nexport function singleton(value, cons) {\r\n const ar = Helpers_allocateArrayFromCons(cons, 1);\r\n ar[0] = value;\r\n return ar;\r\n}\r\n\r\nexport function initialize(count, initializer, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = initializer(i);\r\n }\r\n return result;\r\n}\r\n\r\nexport function pairwise(array) {\r\n if (array.length < 2) {\r\n return [];\r\n }\r\n else {\r\n const count = (array.length - 1) | 0;\r\n const result = new Array(count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = [array[i], array[i + 1]];\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function replicate(count, initial, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (result.length - 1); i++) {\r\n result[i] = initial;\r\n }\r\n return result;\r\n}\r\n\r\nexport function copy(array) {\r\n return array.slice();\r\n}\r\n\r\nexport function reverse(array) {\r\n const array_2 = array.slice();\r\n return array_2.reverse();\r\n}\r\n\r\nexport function scan(folder, state, array, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[0] = state;\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n res[i + 1] = folder(res[i], array[i]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function scanBack(folder, array, state, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[array.length] = state;\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n res[i] = folder(array[i], res[i + 1]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function skip(count, array, cons) {\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = ((count < 0) ? 0 : count) | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = count | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function take(count, array, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n return array.slice(start, (start + count));\r\n }\r\n}\r\n\r\nexport function takeWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n const count_1 = count | 0;\r\n return array.slice(start, (start + count_1));\r\n }\r\n}\r\n\r\nexport function addInPlace(x, array) {\r\n array.push(x);\r\n}\r\n\r\nexport function addRangeInPlace(range, array) {\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n addInPlace(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), array);\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n}\r\n\r\nexport function insertRangeInPlace(index, range, array) {\r\n let index_1;\r\n let i = index;\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n (index_1 = (i | 0), array.splice(index_1, 0, x));\r\n i = ((i + 1) | 0);\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n}\r\n\r\nexport function removeInPlace(item_1, array) {\r\n const i = array.indexOf(item_1, 0);\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function removeAllInPlace(predicate, array) {\r\n const countRemoveAll = (count) => {\r\n const i = array.findIndex(predicate);\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return (countRemoveAll(count) + 1) | 0;\r\n }\r\n else {\r\n return count | 0;\r\n }\r\n };\r\n return countRemoveAll(0) | 0;\r\n}\r\n\r\nexport function copyTo(source, sourceIndex, target, targetIndex, count) {\r\n const diff = (targetIndex - sourceIndex) | 0;\r\n for (let i = sourceIndex; i <= ((sourceIndex + count) - 1); i++) {\r\n target[i + diff] = source[i];\r\n }\r\n}\r\n\r\nexport function copyToTypedArray(source, sourceIndex, target, targetIndex, count) {\r\n try {\r\n target.set(source.subarray(sourceIndex, sourceIndex + count), targetIndex);\r\n }\r\n catch (matchValue) {\r\n copyTo(source, sourceIndex, target, targetIndex, count);\r\n }\r\n}\r\n\r\nexport function indexOf(array, item_1, start, count) {\r\n const start_1 = defaultArg(start, 0) | 0;\r\n const i = array.indexOf(item_1, start_1);\r\n if ((count != null) && (i >= (start_1 + value_2(count)))) {\r\n return -1;\r\n }\r\n else {\r\n return i | 0;\r\n }\r\n}\r\n\r\nexport function partition(f, source, cons) {\r\n const len = source.length | 0;\r\n const res1 = Helpers_allocateArrayFromCons(cons, len);\r\n const res2 = Helpers_allocateArrayFromCons(cons, len);\r\n let iTrue = 0;\r\n let iFalse = 0;\r\n for (let i = 0; i <= (len - 1); i++) {\r\n if (f(source[i])) {\r\n res1[iTrue] = source[i];\r\n iTrue = ((iTrue + 1) | 0);\r\n }\r\n else {\r\n res2[iFalse] = source[i];\r\n iFalse = ((iFalse + 1) | 0);\r\n }\r\n }\r\n return [truncate(iTrue, res1), truncate(iFalse, res2)];\r\n}\r\n\r\nexport function find(predicate, array) {\r\n const matchValue = array.find(predicate);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_2(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, array) {\r\n return array.find(predicate);\r\n}\r\n\r\nexport function findIndex(predicate, array) {\r\n const matchValue = array.findIndex(predicate);\r\n if (matchValue > -1) {\r\n return matchValue | 0;\r\n }\r\n else {\r\n return indexNotFound() | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, array) {\r\n const matchValue = array.findIndex(predicate);\r\n if (matchValue > -1) {\r\n return matchValue;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function pick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return indexNotFound();\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n return value_2(matchValue);\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function tryPick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue == null) {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function findBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound();\r\n }\r\n else if (predicate(array[i])) {\r\n return array[i];\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function tryFindBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return some(array[i]);\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function findLastIndex(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return -1;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function findIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound() | 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function choose(chooser, array, cons) {\r\n const res = [];\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n const y = value_2(matchValue);\r\n res.push(y);\r\n }\r\n }\r\n if ((typeof cons) === \"function\") {\r\n return map((x) => x, res, cons);\r\n }\r\n else {\r\n return res;\r\n }\r\n}\r\n\r\nexport function foldIndexed(folder, state, array) {\r\n return array.reduce(((delegateArg0, delegateArg1, delegateArg2) => folder(delegateArg2, delegateArg0, delegateArg1)), state);\r\n}\r\n\r\nexport function fold(folder, state, array) {\r\n return array.reduce(((delegateArg0, delegateArg1) => folder(delegateArg0, delegateArg1)), state);\r\n}\r\n\r\nexport function iterate(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(array[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(i, array[i]);\r\n }\r\n}\r\n\r\nexport function iterate2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(i, array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function isEmpty(array) {\r\n return array.length === 0;\r\n}\r\n\r\nexport function forAll(predicate, array) {\r\n return array.every(predicate);\r\n}\r\n\r\nexport function permute(f, array) {\r\n const size = array.length | 0;\r\n const res = array.slice();\r\n const checkFlags = new Array(size);\r\n iterateIndexed((i, x) => {\r\n const j = f(i) | 0;\r\n if ((j < 0) ? true : (j >= size)) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n res[j] = x;\r\n checkFlags[j] = 1;\r\n }, array);\r\n if (!(checkFlags.every((y) => (1 === y)))) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n return res;\r\n}\r\n\r\nexport function setSlice(target, lower, upper, source) {\r\n const lower_1 = defaultArg(lower, 0) | 0;\r\n const upper_1 = defaultArg(upper, 0) | 0;\r\n const length = (((upper_1 > 0) ? upper_1 : (target.length - 1)) - lower_1) | 0;\r\n for (let i = 0; i <= length; i++) {\r\n target[i + lower_1] = source[i];\r\n }\r\n}\r\n\r\nexport function sortInPlaceBy(projection, xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(projection(x), projection(y)));\r\n}\r\n\r\nexport function sortInPlace(xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(x, y));\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => comparer.Compare(x, y));\r\n return xs_1;\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y)));\r\n return xs_1;\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => (comparer.Compare(x, y) * -1));\r\n return xs_1;\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1));\r\n return xs_1;\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const comparer_1 = comparer;\r\n const xs_1 = xs.slice();\r\n xs_1.sort(comparer_1);\r\n return xs_1;\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const len1 = xs.length | 0;\r\n const len2 = ys.length | 0;\r\n const res = new Array(len1 * len2);\r\n for (let i = 0; i <= (xs.length - 1); i++) {\r\n for (let j = 0; j <= (ys.length - 1); j++) {\r\n res[(i * len2) + j] = [xs[i], ys[j]];\r\n }\r\n }\r\n return res;\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n const res = [];\r\n const loop = (state_1_mut) => {\r\n loop:\r\n while (true) {\r\n const state_1 = state_1_mut;\r\n const matchValue = generator(state_1);\r\n if (matchValue != null) {\r\n const x = matchValue[0];\r\n const s = matchValue[1];\r\n res.push(x);\r\n state_1_mut = s;\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(state);\r\n return res;\r\n}\r\n\r\nexport function unzip(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n }, array);\r\n return [res1, res2];\r\n}\r\n\r\nexport function unzip3(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n const res3 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n res3[i] = tupledArg[2];\r\n }, array);\r\n return [res1, res2, res3];\r\n}\r\n\r\nexport function zip(array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function zip3(array1, array2, array3) {\r\n if ((array1.length !== array2.length) ? true : (array2.length !== array3.length)) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i], array3[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function chunkBySize(chunkSize, array) {\r\n if (chunkSize < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: size\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n for (let x = 0; x <= ((~(~Math.ceil(array.length / chunkSize))) - 1); x++) {\r\n let slice;\r\n const start_1 = (x * chunkSize) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function splitAt(index, array) {\r\n let start;\r\n if ((index < 0) ? true : (index > array.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [(start = 0, array.slice(start, (start + index))), array.slice(index)];\r\n}\r\n\r\nexport function compareWith(comparer, array1, array2) {\r\n if (array1 == null) {\r\n if (array2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (array2 == null) {\r\n return 1;\r\n }\r\n else {\r\n let i = 0;\r\n let result = 0;\r\n const length1 = array1.length | 0;\r\n const length2 = array2.length | 0;\r\n if (length1 > length2) {\r\n return 1;\r\n }\r\n else if (length1 < length2) {\r\n return -1;\r\n }\r\n else {\r\n while ((i < length1) && (result === 0)) {\r\n result = (comparer(array1[i], array2[i]) | 0);\r\n i = ((i + 1) | 0);\r\n }\r\n return result | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function equalsWith(equals, array1, array2) {\r\n if (array1 == null) {\r\n if (array2 == null) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (array2 == null) {\r\n return false;\r\n }\r\n else {\r\n let i = 0;\r\n let result = true;\r\n const length1 = array1.length | 0;\r\n const length2 = array2.length | 0;\r\n if (length1 > length2) {\r\n return false;\r\n }\r\n else if (length1 < length2) {\r\n return false;\r\n }\r\n else {\r\n while ((i < length1) && result) {\r\n result = equals(array1[i], array2[i]);\r\n i = ((i + 1) | 0);\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function exactlyOne(array) {\r\n if (array.length === 1) {\r\n return array[0];\r\n }\r\n else if (array.length === 0) {\r\n throw (new Error(\"The input sequence was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n throw (new Error(\"Input array too long\\\\nParameter name: array\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(array) {\r\n if (array.length === 1) {\r\n return some(array[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function head(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n return array[0];\r\n }\r\n}\r\n\r\nexport function tryHead(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[0]);\r\n }\r\n}\r\n\r\nexport function tail(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"Not enough elements\\\\nParameter name: array\"));\r\n }\r\n return array.slice(1);\r\n}\r\n\r\nexport function item(index, array) {\r\n return array[index];\r\n}\r\n\r\nexport function tryItem(index, array) {\r\n if ((index < 0) ? true : (index >= array.length)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[index]);\r\n }\r\n}\r\n\r\nexport function foldBackIndexed(folder, array, state) {\r\n return array.reduceRight(((delegateArg0, delegateArg1, delegateArg2) => folder(delegateArg2, delegateArg1, delegateArg0)), state);\r\n}\r\n\r\nexport function foldBack(folder, array, state) {\r\n return array.reduceRight(((delegateArg0, delegateArg1) => folder(delegateArg1, delegateArg0)), state);\r\n}\r\n\r\nexport function foldIndexed2(folder, state, array1, array2) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n throw (new Error(\"Arrays have different lengths\"));\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n acc = folder(i, acc, array1[i], array2[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function fold2(folder, state, array1, array2) {\r\n return foldIndexed2((_arg1, acc, x, y) => folder(acc, x, y), state, array1, array2);\r\n}\r\n\r\nexport function foldBackIndexed2(folder, array1, array2, state) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const size = array1.length | 0;\r\n for (let i = 1; i <= size; i++) {\r\n acc = folder(i - 1, array1[size - i], array2[size - i], acc);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(f, array1, array2, state) {\r\n return foldBackIndexed2((_arg1, x, y, acc) => f(x, y, acc), array1, array2, state);\r\n}\r\n\r\nexport function reduce(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduce(reduction_1);\r\n}\r\n\r\nexport function reduceBack(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduceRight(reduction_1);\r\n}\r\n\r\nexport function forAll2(predicate, array1, array2) {\r\n return fold2((acc, x, y) => (acc && predicate(x, y)), true, array1, array2);\r\n}\r\n\r\nexport function existsOffset(predicate_mut, array_mut, index_mut) {\r\n existsOffset:\r\n while (true) {\r\n const predicate = predicate_mut, array = array_mut, index = index_mut;\r\n if (index === array.length) {\r\n return false;\r\n }\r\n else if (predicate(array[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array_mut = array;\r\n index_mut = (index + 1);\r\n continue existsOffset;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists(predicate, array) {\r\n return existsOffset(predicate, array, 0);\r\n}\r\n\r\nexport function existsOffset2(predicate_mut, array1_mut, array2_mut, index_mut) {\r\n existsOffset2:\r\n while (true) {\r\n const predicate = predicate_mut, array1 = array1_mut, array2 = array2_mut, index = index_mut;\r\n if (index === array1.length) {\r\n return false;\r\n }\r\n else if (predicate(array1[index], array2[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array1_mut = array1;\r\n array2_mut = array2;\r\n index_mut = (index + 1);\r\n continue existsOffset2;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists2(predicate, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n return existsOffset2(predicate, array1, array2, 0);\r\n}\r\n\r\nexport function sum(array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, array[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function sumBy(projection, array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, projection(array[i]));\r\n }\r\n return acc;\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, array[i]);\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function averageBy(projection, array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, projection(array[i]));\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function windowed(windowSize, source) {\r\n if (windowSize <= 0) {\r\n throw (new Error(\"windowSize must be positive\"));\r\n }\r\n let res;\r\n const len = max_1((x, y) => comparePrimitives(x, y), 0, source.length - windowSize) | 0;\r\n res = (new Array(len));\r\n for (let i = windowSize; i <= source.length; i++) {\r\n res[i - windowSize] = source.slice(i - windowSize, (i - 1) + 1);\r\n }\r\n return res;\r\n}\r\n\r\nexport function splitInto(chunks, array) {\r\n if (chunks < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: chunks\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n const chunks_1 = min_1((x, y) => comparePrimitives(x, y), chunks, array.length) | 0;\r\n const minChunkSize = (~(~(array.length / chunks_1))) | 0;\r\n const chunksWithExtraItem = (array.length % chunks_1) | 0;\r\n for (let i = 0; i <= (chunks_1 - 1); i++) {\r\n const chunkSize = ((i < chunksWithExtraItem) ? (minChunkSize + 1) : minChunkSize) | 0;\r\n let slice;\r\n const start_1 = ((i * minChunkSize) + min_1((x_1, y_1) => comparePrimitives(x_1, y_1), chunksWithExtraItem, i)) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function transpose(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const len = arrays_1.length | 0;\r\n if (len === 0) {\r\n return new Array(0);\r\n }\r\n else {\r\n const lenInner = arrays_1[0].length | 0;\r\n if (!forAll((a) => (a.length === lenInner), arrays_1)) {\r\n differentLengths();\r\n }\r\n const result = new Array(lenInner);\r\n for (let i = 0; i <= (lenInner - 1); i++) {\r\n result[i] = Helpers_allocateArrayFromCons(cons, len);\r\n for (let j = 0; j <= (len - 1); j++) {\r\n result[i][j] = arrays_1[j][i];\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len + 1);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n target[index] = y;\r\n for (let i_1 = index; i_1 <= (len - 1); i_1++) {\r\n target[i_1 + 1] = xs[i_1];\r\n }\r\n return target;\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const ys_1 = Array.from(ys);\r\n const len2 = ys_1.length | 0;\r\n const target = new xs.constructor(len + len2);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n target[index + i_1] = ys_1[i_1];\r\n }\r\n for (let i_2 = index; i_2 <= (len - 1); i_2++) {\r\n target[i_2 + len2] = xs[i_2];\r\n }\r\n return target;\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n if ((index < 0) ? true : (index >= xs.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n let i = -1;\r\n return filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n return i !== index;\r\n }, xs);\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index >= len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = ((i === index) ? y : xs[i]);\r\n }\r\n return target;\r\n}\r\n\r\n","import { compare, physicalHash, equals, structuralHash } from \"./Util.js\";\r\n\r\nexport function HashIdentity_FromFunctions(hash, eq) {\r\n return {\r\n Equals(x, y) {\r\n return eq(x, y);\r\n },\r\n GetHashCode(x_1) {\r\n return hash(x_1);\r\n },\r\n };\r\n}\r\n\r\nexport function HashIdentity_Structural() {\r\n return HashIdentity_FromFunctions((obj) => structuralHash(obj), (e1, e2) => equals(e1, e2));\r\n}\r\n\r\nexport function HashIdentity_Reference() {\r\n return HashIdentity_FromFunctions((obj) => physicalHash(obj), (e1, e2) => (e1 === e2));\r\n}\r\n\r\nexport function ComparisonIdentity_FromFunction(comparer) {\r\n return {\r\n Compare(x, y) {\r\n return comparer(x, y);\r\n },\r\n };\r\n}\r\n\r\nexport function ComparisonIdentity_Structural() {\r\n return ComparisonIdentity_FromFunction((e1, e2) => compare(e1, e2));\r\n}\r\n\r\n","import { substring, format, isNullOrEmpty, join } from \"./String.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { clear, int32ToString } from \"./Util.js\";\r\nimport { toString } from \"./Types.js\";\r\n\r\nexport class StringBuilder {\r\n constructor(value, capacity) {\r\n this.buf = [];\r\n if (!isNullOrEmpty(value)) {\r\n void (this.buf.push(value));\r\n }\r\n }\r\n toString() {\r\n const __ = this;\r\n return join(\"\", __.buf);\r\n }\r\n}\r\n\r\nexport function StringBuilder$reflection() {\r\n return class_type(\"System.Text.StringBuilder\", void 0, StringBuilder);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z18115A39(value, capacity) {\r\n return new StringBuilder(value, capacity);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z524259A4(capacity) {\r\n return StringBuilder_$ctor_Z18115A39(\"\", capacity);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z721C83C5(value) {\r\n return StringBuilder_$ctor_Z18115A39(value, 16);\r\n}\r\n\r\nexport function StringBuilder_$ctor() {\r\n return StringBuilder_$ctor_Z18115A39(\"\", 16);\r\n}\r\n\r\nexport function StringBuilder__Append_Z721C83C5(x, s) {\r\n void (x.buf.push(s));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_244C7CD6(x, c) {\r\n void (x.buf.push(c));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_Z524259A4(x, o) {\r\n void (x.buf.push(int32ToString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_5E38073B(x, o) {\r\n void (x.buf.push(o.toString()));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_Z1FBCCD16(x, o) {\r\n void (x.buf.push(toString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_4E60E31B(x, o) {\r\n void (x.buf.push(toString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_695F1130(x, cs) {\r\n void (x.buf.push(cs.join('')));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_43A65C09(x, s) {\r\n void (x.buf.push(toString(s)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendFormat_433E080(x, fmt, o) {\r\n void (x.buf.push(format(fmt, o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendLine(x) {\r\n void (x.buf.push(\"\\n\"));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendLine_Z721C83C5(x, s) {\r\n void (x.buf.push(s));\r\n void (x.buf.push(\"\\n\"));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__get_Length(x) {\r\n let len = 0;\r\n for (let i = x.buf.length - 1; i >= 0; i--) {\r\n len = ((len + x.buf[i].length) | 0);\r\n }\r\n return len | 0;\r\n}\r\n\r\nexport function StringBuilder__ToString_Z37302880(x, firstIndex, length) {\r\n return substring(toString(x), firstIndex, length);\r\n}\r\n\r\nexport function StringBuilder__Clear(x) {\r\n clear(x.buf);\r\n return x;\r\n}\r\n\r\n","import { structuralHash, equals } from \"./Util.js\";\r\nimport { HashIdentity_Structural, ComparisonIdentity_Structural } from \"./FSharp.Collections.js\";\r\nimport { StringBuilder__Append_Z721C83C5 } from \"./System.Text.js\";\r\n\r\nexport const LanguagePrimitives_GenericEqualityComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport const LanguagePrimitives_GenericEqualityERComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport function LanguagePrimitives_FastGenericComparer() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericComparerFromTable() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparer() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparerFromTable() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function Operators_Failure(message) {\r\n return new Error(message);\r\n}\r\n\r\nexport function Operators_FailurePattern(exn) {\r\n return exn.message;\r\n}\r\n\r\nexport function Operators_NullArg(x) {\r\n throw (new Error(x));\r\n}\r\n\r\nexport function Operators_Using(resource, action) {\r\n try {\r\n return action(resource);\r\n }\r\n finally {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n resource.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport function Operators_Lock(_lockObj, action) {\r\n return action();\r\n}\r\n\r\nexport function ExtraTopLevelOperators_LazyPattern(input) {\r\n return input.Value;\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilderThen(continuation, builder, format) {\r\n return format.cont((s) => {\r\n StringBuilder__Append_Z721C83C5(builder, s);\r\n return continuation();\r\n });\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilder(builder, format) {\r\n return PrintfModule_PrintFormatToStringBuilderThen(() => {\r\n }, builder, format);\r\n}\r\n\r\n","import { clear, equals, isArrayLike, isDisposable, toIterator, getEnumerator } from \"./Util.js\";\r\nimport { toString } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { Operators_NullArg } from \"./FSharp.Core.js\";\r\nimport { chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, windowed as windowed_1, splitInto as splitInto_1, map as map_1, pairwise as pairwise_1, scanBack as scanBack_1, reverse as reverse_1, mapFoldBack as mapFoldBack_1, mapFold as mapFold_1, tryItem as tryItem_1, tryHead as tryHead_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from \"./Array.js\";\r\nimport { length as length_1, tryItem as tryItem_2, isEmpty as isEmpty_1, tryHead as tryHead_2, ofSeq as ofSeq_1, ofArray as ofArray_1, toArray as toArray_1, FSharpList } from \"./List.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport const SR_enumerationAlreadyFinished = \"Enumeration already finished.\";\r\n\r\nexport const SR_enumerationNotStarted = \"Enumeration has not started. Call MoveNext.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\nexport const SR_resetNotSupported = \"Reset is not supported on this enumerator.\";\r\n\r\nexport function Enumerator_noReset() {\r\n throw (new Error(SR_resetNotSupported));\r\n}\r\n\r\nexport function Enumerator_notStarted() {\r\n throw (new Error(SR_enumerationNotStarted));\r\n}\r\n\r\nexport function Enumerator_alreadyFinished() {\r\n throw (new Error(SR_enumerationAlreadyFinished));\r\n}\r\n\r\nexport class Enumerator_Seq {\r\n constructor(f) {\r\n this.f = f;\r\n }\r\n toString() {\r\n const xs = this;\r\n const maxCount = 4;\r\n let i = 0;\r\n let str = \"seq [\";\r\n const e = getEnumerator(xs);\r\n try {\r\n while ((i < maxCount) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (i > 0) {\r\n str = (str + \"; \");\r\n }\r\n str = (str + toString(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n i = ((i + 1) | 0);\r\n }\r\n if (i === maxCount) {\r\n str = (str + \"; ...\");\r\n }\r\n return str + \"]\";\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n }\r\n GetEnumerator() {\r\n const x = this;\r\n return x.f();\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const x = this;\r\n return x.f();\r\n }\r\n}\r\n\r\nexport function Enumerator_Seq$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.Seq\", [gen0], Enumerator_Seq);\r\n}\r\n\r\nexport function Enumerator_Seq_$ctor_673A07F2(f) {\r\n return new Enumerator_Seq(f);\r\n}\r\n\r\nexport class Enumerator_FromFunctions$1 {\r\n constructor(current, next, dispose) {\r\n this.current = current;\r\n this.next = next;\r\n this.dispose = dispose;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n return __.next();\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n Enumerator_noReset();\r\n }\r\n Dispose() {\r\n const __ = this;\r\n __.dispose();\r\n }\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.FromFunctions`1\", [gen0], Enumerator_FromFunctions$1);\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1_$ctor_58C54629(current, next, dispose) {\r\n return new Enumerator_FromFunctions$1(current, next, dispose);\r\n}\r\n\r\nexport function Enumerator_cast(e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.IEnumerator.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n if (isDisposable(e)) {\r\n e.Dispose();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_concat(sources) {\r\n let outerOpt = void 0;\r\n let innerOpt = void 0;\r\n let started = false;\r\n let finished = false;\r\n let curr = void 0;\r\n const finish = () => {\r\n finished = true;\r\n if (innerOpt != null) {\r\n const inner = innerOpt;\r\n try {\r\n inner.Dispose();\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n if (outerOpt != null) {\r\n const outer = outerOpt;\r\n try {\r\n outer.Dispose();\r\n }\r\n finally {\r\n outerOpt = (void 0);\r\n }\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n else if (finished) {\r\n Enumerator_alreadyFinished();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n let copyOfStruct;\r\n if (!started) {\r\n started = true;\r\n }\r\n if (finished) {\r\n return false;\r\n }\r\n else {\r\n let res = void 0;\r\n while (res == null) {\r\n const matchValue = [outerOpt, innerOpt];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const inner_1 = matchValue[1];\r\n if (inner_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = some(inner_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n res = true;\r\n }\r\n else {\r\n try {\r\n inner_1.Dispose();\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n }\r\n else {\r\n const outer_1 = matchValue[0];\r\n if (outer_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const ie = outer_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n innerOpt = ((copyOfStruct = ie, getEnumerator(copyOfStruct)));\r\n }\r\n else {\r\n finish();\r\n res = false;\r\n }\r\n }\r\n }\r\n else {\r\n outerOpt = getEnumerator(sources);\r\n }\r\n }\r\n return value_1(res);\r\n }\r\n }, () => {\r\n if (!finished) {\r\n finish();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_enumerateThenFinally(f, e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n try {\r\n e.Dispose();\r\n }\r\n finally {\r\n f();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_generateWhileSome(openf, compute, closef) {\r\n let started = false;\r\n let curr = void 0;\r\n let state = some(openf());\r\n const dispose = () => {\r\n if (state != null) {\r\n const x_1 = value_1(state);\r\n try {\r\n closef(x_1);\r\n }\r\n finally {\r\n state = (void 0);\r\n }\r\n }\r\n };\r\n const finish = () => {\r\n try {\r\n dispose();\r\n }\r\n finally {\r\n curr = (void 0);\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n if (!started) {\r\n started = true;\r\n }\r\n if (state != null) {\r\n const s = value_1(state);\r\n let matchValue_1;\r\n try {\r\n matchValue_1 = compute(s);\r\n }\r\n catch (matchValue) {\r\n finish();\r\n throw matchValue;\r\n }\r\n if (matchValue_1 != null) {\r\n curr = matchValue_1;\r\n return true;\r\n }\r\n else {\r\n finish();\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }, dispose);\r\n}\r\n\r\nexport function Enumerator_unfold(f, state) {\r\n let curr = void 0;\r\n let acc = state;\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (curr != null) {\r\n const x = curr[0];\r\n const st = curr[1];\r\n return x;\r\n }\r\n else {\r\n return Enumerator_notStarted();\r\n }\r\n }, () => {\r\n curr = f(acc);\r\n if (curr != null) {\r\n const x_1 = curr[0];\r\n const st_1 = curr[1];\r\n acc = st_1;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }, () => {\r\n });\r\n}\r\n\r\nexport function indexNotFound() {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n}\r\n\r\nexport function checkNonNull(argName, arg) {\r\n if (arg == null) {\r\n Operators_NullArg(argName);\r\n }\r\n}\r\n\r\nexport function mkSeq(f) {\r\n return Enumerator_Seq_$ctor_673A07F2(f);\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n checkNonNull(\"source\", xs);\r\n return getEnumerator(xs);\r\n}\r\n\r\nexport function delay(generator) {\r\n return mkSeq(() => getEnumerator(generator()));\r\n}\r\n\r\nexport function concat(sources) {\r\n return mkSeq(() => Enumerator_concat(sources));\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n return mkSeq(() => Enumerator_unfold(generator, state));\r\n}\r\n\r\nexport function empty() {\r\n return delay(() => (new Array(0)));\r\n}\r\n\r\nexport function singleton(x) {\r\n return delay(() => singleton_1(x));\r\n}\r\n\r\nexport function ofArray(arr) {\r\n return arr;\r\n}\r\n\r\nexport function toArray(xs) {\r\n if (xs instanceof FSharpList) {\r\n return toArray_1(xs);\r\n }\r\n else {\r\n return Array.from(xs);\r\n }\r\n}\r\n\r\nexport function ofList(xs) {\r\n return xs;\r\n}\r\n\r\nexport function toList(xs) {\r\n if (isArrayLike(xs)) {\r\n return ofArray_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n return ofSeq_1(xs);\r\n }\r\n}\r\n\r\nexport function generate(create, compute, dispose) {\r\n return mkSeq(() => Enumerator_generateWhileSome(create, compute, dispose));\r\n}\r\n\r\nexport function generateIndexed(create, compute, dispose) {\r\n return mkSeq(() => {\r\n let i = -1;\r\n return Enumerator_generateWhileSome(create, (x) => {\r\n i = ((i + 1) | 0);\r\n return compute(i, x);\r\n }, dispose);\r\n });\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return concat([xs, ys]);\r\n}\r\n\r\nexport function cast(xs) {\r\n return mkSeq(() => {\r\n checkNonNull(\"source\", xs);\r\n return Enumerator_cast(getEnumerator(xs));\r\n });\r\n}\r\n\r\nexport function choose(chooser, xs) {\r\n return generate(() => ofSeq(xs), (e) => {\r\n let curr = void 0;\r\n while ((curr == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return curr;\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let c = 0;\r\n let b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n let b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n while (((c === 0) && b1) && b2) {\r\n c = (comparer(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) | 0);\r\n if (c === 0) {\r\n b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n }\r\n return ((c !== 0) ? c : (b1 ? 1 : (b2 ? -1 : 0))) | 0;\r\n }\r\n finally {\r\n e2.Dispose();\r\n }\r\n }\r\n finally {\r\n e1.Dispose();\r\n }\r\n}\r\n\r\nexport function contains(value, xs, comparer) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = comparer.Equals(value, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function enumerateFromFunctions(create, moveNext, current) {\r\n return generate(create, (x) => (moveNext(x) ? some(current(x)) : (void 0)), (x_1) => {\r\n const matchValue = x_1;\r\n if (isDisposable(matchValue)) {\r\n matchValue.Dispose();\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateThenFinally(source, compensation) {\r\n const compensation_1 = compensation;\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation_1, ofSeq(source));\r\n }\r\n catch (matchValue) {\r\n compensation_1();\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateUsing(resource, source) {\r\n const compensation = () => {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n let copyOfStruct = resource;\r\n copyOfStruct.Dispose();\r\n }\r\n };\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation, ofSeq(source(resource)));\r\n }\r\n catch (matchValue_1) {\r\n compensation();\r\n throw matchValue_1;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateWhile(guard, xs) {\r\n return concat(unfold((i) => (guard() ? [xs, i + 1] : (void 0)), 0));\r\n}\r\n\r\nexport function filter(f, xs) {\r\n return choose((x) => {\r\n if (f(x)) {\r\n return some(x);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, xs);\r\n}\r\n\r\nexport function exists(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function exists2(predicate, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let found = false;\r\n while (((!found) && e1[\"System.Collections.IEnumerator.MoveNext\"]()) && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n e2.Dispose();\r\n }\r\n }\r\n finally {\r\n e1.Dispose();\r\n }\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return v;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? (void 0) : some(v);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const c = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (predicate(c)) {\r\n res = some(c);\r\n }\r\n }\r\n return res;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function find(predicate, xs) {\r\n const matchValue = tryFind(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(predicate, xs) {\r\n return tryFindBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findBack(predicate, xs) {\r\n const matchValue = tryFindBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function findIndex(predicate, xs) {\r\n const matchValue = tryFindIndex(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, xs) {\r\n return tryFindIndexBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(predicate, xs) {\r\n const matchValue = tryFindIndexBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let acc = state;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let acc = state;\r\n while (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n e2.Dispose();\r\n }\r\n }\r\n finally {\r\n e1.Dispose();\r\n }\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function forAll(predicate, xs) {\r\n return !exists((x) => (!predicate(x)), xs);\r\n}\r\n\r\nexport function forAll2(predicate, xs, ys) {\r\n return !exists2((x, y) => (!predicate(x, y)), xs, ys);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (isArrayLike(xs)) {\r\n return tryHead_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryHead_2(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport function head(xs) {\r\n const matchValue = tryHead(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function initialize(count, f) {\r\n return unfold((i) => ((i < count) ? [f(i), i + 1] : (void 0)), 0);\r\n}\r\n\r\nexport function initializeInfinite(f) {\r\n return initialize(2147483647, f);\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length === 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return isEmpty_1(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return !e[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport function tryItem(index, xs) {\r\n if (isArrayLike(xs)) {\r\n return tryItem_1(index, xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryItem_2(index, xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (index_1_mut) => {\r\n loop:\r\n while (true) {\r\n const index_1 = index_1_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return void 0;\r\n }\r\n else if (index_1 === 0) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n index_1_mut = (index_1 - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(index);\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport function item(index, xs) {\r\n const matchValue = tryItem(index, xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar0, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar0, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function tryLast(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function length(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length | 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return length_1(xs) | 0;\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n let count = 0;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n count = ((count + 1) | 0);\r\n }\r\n return count | 0;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n return generate(() => ofSeq(xs), (e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(i, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n tupledArg_1[0].Dispose();\r\n }\r\n finally {\r\n tupledArg_1[1].Dispose();\r\n }\r\n });\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(i, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n tupledArg_1[0].Dispose();\r\n }\r\n finally {\r\n tupledArg_1[1].Dispose();\r\n }\r\n });\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys), ofSeq(zs)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n const e3 = tupledArg[2];\r\n return ((e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) && e3[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e3[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n tupledArg_1[0].Dispose();\r\n }\r\n finally {\r\n try {\r\n tupledArg_1[1].Dispose();\r\n }\r\n finally {\r\n tupledArg_1[2].Dispose();\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function readOnly(xs) {\r\n checkNonNull(\"source\", xs);\r\n return map((x) => x, xs);\r\n}\r\n\r\nexport class CachedSeq$1 {\r\n constructor(cleanup, res) {\r\n this.cleanup = cleanup;\r\n this.res = res;\r\n }\r\n Dispose() {\r\n const _ = this;\r\n _.cleanup();\r\n }\r\n GetEnumerator() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n}\r\n\r\nexport function CachedSeq$1$reflection(gen0) {\r\n return class_type(\"SeqModule.CachedSeq`1\", [gen0], CachedSeq$1);\r\n}\r\n\r\nexport function CachedSeq$1_$ctor_Z7A8347D4(cleanup, res) {\r\n return new CachedSeq$1(cleanup, res);\r\n}\r\n\r\nexport function CachedSeq$1__Clear(_) {\r\n _.cleanup();\r\n}\r\n\r\nexport function cache(source) {\r\n checkNonNull(\"source\", source);\r\n const prefix = [];\r\n let enumeratorR = void 0;\r\n return CachedSeq$1_$ctor_Z7A8347D4(() => {\r\n clear(prefix);\r\n let pattern_matching_result, e;\r\n if (enumeratorR != null) {\r\n if (value_1(enumeratorR) != null) {\r\n pattern_matching_result = 0;\r\n e = value_1(enumeratorR);\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n e.Dispose();\r\n break;\r\n }\r\n }\r\n enumeratorR = (void 0);\r\n }, unfold((i_1) => {\r\n if (i_1 < prefix.length) {\r\n return [prefix[i_1], i_1 + 1];\r\n }\r\n else {\r\n if (i_1 >= prefix.length) {\r\n let optEnumerator_2;\r\n if (enumeratorR != null) {\r\n optEnumerator_2 = value_1(enumeratorR);\r\n }\r\n else {\r\n const optEnumerator = getEnumerator(source);\r\n enumeratorR = some(optEnumerator);\r\n optEnumerator_2 = optEnumerator;\r\n }\r\n if (optEnumerator_2 == null) {\r\n }\r\n else {\r\n const enumerator = optEnumerator_2;\r\n if (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n void (prefix.push(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n }\r\n else {\r\n enumerator.Dispose();\r\n enumeratorR = some(void 0);\r\n }\r\n }\r\n }\r\n return (i_1 < prefix.length) ? [prefix[i_1], i_1 + 1] : (void 0);\r\n }\r\n }, 0));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const ysCache = cache(ys);\r\n return delay(() => concat(map((x) => map((y) => [x, y], ysCache), xs)));\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const patternInput = mapFold_1(mapping, state, toArray(xs));\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n const patternInput = mapFoldBack_1(mapping, toArray(xs), state);\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function tryPick(chooser, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n res = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return res;\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function pick(chooser, xs) {\r\n const matchValue = tryPick(chooser, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function reduce(folder, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc_mut = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n continue loop;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n }\r\n finally {\r\n e.Dispose();\r\n }\r\n}\r\n\r\nexport function reduceBack(folder, xs) {\r\n const arr = toArray(xs);\r\n if (arr.length > 0) {\r\n return arr.reduceRight(folder);\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg1) => x);\r\n}\r\n\r\nexport function reverse(xs) {\r\n return delay(() => ofArray(reverse_1(toArray(xs))));\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n return delay(() => {\r\n let acc = state;\r\n return concat([singleton(state), map((x) => {\r\n acc = folder(acc, x);\r\n return acc;\r\n }, xs)]);\r\n });\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return delay(() => ofArray(scanBack_1(folder, toArray(xs), state)));\r\n}\r\n\r\nexport function skip(count, source) {\r\n return mkSeq(() => {\r\n const e = ofSeq(source);\r\n try {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n return Enumerator_enumerateThenFinally(() => {\r\n }, e);\r\n }\r\n catch (matchValue) {\r\n e.Dispose();\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function skipWhile(predicate, xs) {\r\n return delay(() => {\r\n let skipped = true;\r\n return filter((x) => {\r\n if (skipped) {\r\n skipped = predicate(x);\r\n }\r\n return !skipped;\r\n }, xs);\r\n });\r\n}\r\n\r\nexport function tail(xs) {\r\n return skip(1, xs);\r\n}\r\n\r\nexport function take(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < count) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n return generate(() => ofSeq(xs), (e) => ((e[\"System.Collections.IEnumerator.MoveNext\"]() && predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (((i < count) && e[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n return delay(() => concat(map(mapping, xs)));\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return delay(() => ofArray(pairwise_1(toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return delay(() => ofArray(map_1((arr) => ofArray(arr), splitInto_1(chunks, toArray(xs)))));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return delay(() => ofArray(map_1((arr) => ofArray(arr), windowed_1(windowSize, toArray(xs)))));\r\n}\r\n\r\nexport function transpose(xss) {\r\n return delay(() => ofArray(map_1((arr) => ofArray(arr), transpose_1(map_1((xs_1) => toArray(xs_1), toArray(xss))))));\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n return delay(() => {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n });\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return delay(() => ofArray(permute_1(f, toArray(xs))));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return delay(() => ofArray(map_1((arr) => ofArray(arr), chunkBySize_1(chunkSize, toArray(xs)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if (i === index) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let status = -1;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n if (i === index) {\r\n status = 0;\r\n }\r\n let inserted;\r\n if (status === 0) {\r\n if (e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n inserted = some(e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n status = 1;\r\n inserted = (void 0);\r\n }\r\n }\r\n else {\r\n inserted = (void 0);\r\n }\r\n if (inserted == null) {\r\n if (e1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n if (status < 1) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return some(value_1(inserted));\r\n }\r\n }, (tupledArg_1) => {\r\n tupledArg_1[0].Dispose();\r\n tupledArg_1[1].Dispose();\r\n });\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < index) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n }\r\n else {\r\n if (i === index) {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n }\r\n }\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n e_1.Dispose();\r\n });\r\n}\r\n\r\n","import { join } from \"./String.js\";\r\nimport { uncurry, isArrayLike, getEnumerator, toIterator, compare, structuralHash, equals } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { class_type, record_type, option_type } from \"./Reflection.js\";\r\nimport { SR_inputSequenceTooLong, SR_inputSequenceEmpty, SR_inputMustBeNonNegative, SR_notEnoughElements, SR_differentLengths, SR_keyNotFoundAlt, SR_indexOutOfBounds, SR_inputWasEmpty } from \"./Global.js\";\r\nimport { defaultArg, value as value_1, some } from \"./Option.js\";\r\nimport { transpose as transpose_1, splitInto as splitInto_1, windowed as windowed_1, pairwise as pairwise_1, chunkBySize as chunkBySize_1, map as map_1, permute as permute_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, scanBack as scanBack_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, fill } from \"./Array.js\";\r\nimport { foldBack as foldBack_2 } from \"./Seq.js\";\r\n\r\nexport class FSharpList extends Record {\r\n constructor(head, tail) {\r\n super();\r\n this.head = head;\r\n this.tail = tail;\r\n }\r\n toString() {\r\n const xs = this;\r\n return (\"[\" + join(\"; \", xs)) + \"]\";\r\n }\r\n Equals(other) {\r\n const xs = this;\r\n if (xs === other) {\r\n return true;\r\n }\r\n else {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n if (equals(xs_1.head, ys_1.head)) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other);\r\n }\r\n }\r\n GetHashCode() {\r\n const xs = this;\r\n const loop = (i_mut, h_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, h = h_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n if (i > 18) {\r\n return h | 0;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n h_mut = (((h << 1) + structuralHash(xs_1.head)) + (631 * i));\r\n xs_1_mut = t;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return h | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, 0, xs) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n CompareTo(other) {\r\n const xs = this;\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n const c = compare(xs_1.head, ys_1.head) | 0;\r\n if (c === 0) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other) | 0;\r\n }\r\n GetEnumerator() {\r\n const xs = this;\r\n return ListEnumerator$1_$ctor_3002E699(xs);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const xs = this;\r\n return getEnumerator(xs);\r\n }\r\n}\r\n\r\nexport function FSharpList$reflection(gen0) {\r\n return record_type(\"ListModule.FSharpList\", [gen0], FSharpList, () => [[\"head\", gen0], [\"tail\", option_type(FSharpList$reflection(gen0))]]);\r\n}\r\n\r\nexport class ListEnumerator$1 {\r\n constructor(xs) {\r\n this.xs = xs;\r\n this.it = this.xs;\r\n this.current = null;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n const matchValue = __.it.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n __.current = __.it.head;\r\n __.it = t;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n const __ = this;\r\n __.it = __.xs;\r\n __.current = null;\r\n }\r\n Dispose() {\r\n }\r\n}\r\n\r\nexport function ListEnumerator$1$reflection(gen0) {\r\n return class_type(\"ListModule.ListEnumerator`1\", [gen0], ListEnumerator$1);\r\n}\r\n\r\nexport function ListEnumerator$1_$ctor_3002E699(xs) {\r\n return new ListEnumerator$1(xs);\r\n}\r\n\r\nexport function FSharpList_get_Empty() {\r\n return new FSharpList(null, void 0);\r\n}\r\n\r\nexport function FSharpList_Cons_305B8EAC(x, xs) {\r\n return new FSharpList(x, xs);\r\n}\r\n\r\nexport function FSharpList__get_IsEmpty(xs) {\r\n return xs.tail == null;\r\n}\r\n\r\nexport function FSharpList__get_Length(xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n else {\r\n return i | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs) | 0;\r\n}\r\n\r\nexport function FSharpList__get_Head(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return xs.head;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Tail(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return matchValue;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Item_Z524259A4(xs, index) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n if (i === index) {\r\n return xs_1.head;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpList_get_Empty();\r\n}\r\n\r\nexport function cons(x, xs) {\r\n return FSharpList_Cons_305B8EAC(x, xs);\r\n}\r\n\r\nexport function singleton(x) {\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_get_Empty());\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n return FSharpList__get_IsEmpty(xs);\r\n}\r\n\r\nexport function length(xs) {\r\n return FSharpList__get_Length(xs);\r\n}\r\n\r\nexport function head(xs) {\r\n return FSharpList__get_Head(xs);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n}\r\n\r\nexport function tail(xs) {\r\n return FSharpList__get_Tail(xs);\r\n}\r\n\r\nexport function tryLast(xs_mut) {\r\n tryLast:\r\n while (true) {\r\n const xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n const t = FSharpList__get_Tail(xs);\r\n if (FSharpList__get_IsEmpty(t)) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n xs_mut = t;\r\n continue tryLast;\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs_1), FSharpList__get_IsEmpty(ys_1)];\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n return 1;\r\n }\r\n else {\r\n const c = comparer(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)) | 0;\r\n if (c === 0) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, ys) | 0;\r\n}\r\n\r\nexport function toArray(xs) {\r\n const len = FSharpList__get_Length(xs) | 0;\r\n const res = fill(new Array(len), 0, len, null);\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (!FSharpList__get_IsEmpty(xs_1)) {\r\n res[i] = FSharpList__get_Head(xs_1);\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(0, xs);\r\n return res;\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_1)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function reverse(xs) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), FSharpList_get_Empty(), xs);\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function foldIndexed(folder, state, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = folder(i, acc, FSharpList__get_Head(xs_1));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, state, xs);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n let ys_1 = ys;\r\n while ((!FSharpList__get_IsEmpty(xs_1)) && (!FSharpList__get_IsEmpty(ys_1))) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n ys_1 = FSharpList__get_Tail(ys_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function unfold(gen, state) {\r\n const loop = (acc_mut, node_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, node = node_mut;\r\n const matchValue = gen(acc);\r\n if (matchValue != null) {\r\n acc_mut = matchValue[1];\r\n node_mut = ((t = (new FSharpList(matchValue[0], void 0)), (node.tail = t, t)));\r\n continue loop;\r\n }\r\n else {\r\n return node;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(state, root);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar0, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar0, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function toSeq(xs) {\r\n return xs;\r\n}\r\n\r\nexport function ofArrayWithTail(xs, tail_1) {\r\n let res = tail_1;\r\n for (let i = xs.length - 1; i >= 0; i--) {\r\n res = FSharpList_Cons_305B8EAC(xs[i], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function ofArray(xs) {\r\n return ofArrayWithTail(xs, FSharpList_get_Empty());\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n let xs_3, t;\r\n if (isArrayLike(xs)) {\r\n return ofArray(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const enumerator = getEnumerator(xs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n node = ((xs_3 = node, (t = (new FSharpList(x, void 0)), (xs_3.tail = t, t))));\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n const xs_5 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_5.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n }\r\n}\r\n\r\nexport function concat(lists) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const action = (xs) => {\r\n node = fold((acc, x) => {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }, node, xs);\r\n };\r\n if (isArrayLike(lists)) {\r\n lists.forEach(action);\r\n }\r\n else if (lists instanceof FSharpList) {\r\n iterate(action, lists);\r\n }\r\n else {\r\n const enumerator = getEnumerator(lists);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n action(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n }\r\n const xs_6 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_6.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n let xs_4, t_2;\r\n const root = FSharpList_get_Empty();\r\n let node;\r\n const t = new FSharpList(state, void 0);\r\n root.tail = t;\r\n node = t;\r\n let acc = state;\r\n let xs_3 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_3)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_3));\r\n node = ((xs_4 = node, (t_2 = (new FSharpList(acc, void 0)), (xs_4.tail = t_2, t_2))));\r\n xs_3 = FSharpList__get_Tail(xs_3);\r\n }\r\n const xs_6 = node;\r\n const t_4 = FSharpList_get_Empty();\r\n xs_6.tail = t_4;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return ofArray(scanBack_1(folder, toArray(xs), state));\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), ys, reverse(xs));\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n let xs_1, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n let ys = xs;\r\n while (!FSharpList__get_IsEmpty(ys)) {\r\n let zs = mapping(FSharpList__get_Head(ys));\r\n while (!FSharpList__get_IsEmpty(zs)) {\r\n node = ((xs_1 = node, (t = (new FSharpList(FSharpList__get_Head(zs), void 0)), (xs_1.tail = t, t))));\r\n zs = FSharpList__get_Tail(zs);\r\n }\r\n ys = FSharpList__get_Tail(ys);\r\n }\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = foldIndexed((i, acc, x) => {\r\n const t = new FSharpList(mapping(i, x), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n const t = new FSharpList(mapping(x), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold2((acc, x, y) => {\r\n const t = new FSharpList(mapping(x, y), void 0);\r\n acc.tail = t;\r\n return t;\r\n }, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n const loop = (i_mut, acc_mut, xs_1_mut, ys_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = ((t = (new FSharpList(mapping(i, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(0, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n const loop = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut, zs_1 = zs_1_mut;\r\n if ((FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) ? true : FSharpList__get_IsEmpty(zs_1)) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(mapping(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1), FSharpList__get_Head(zs_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n zs_1_mut = FSharpList__get_Tail(zs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(root, xs, ys, zs);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const root = FSharpList_get_Empty();\r\n const patternInput_1 = fold((tupledArg, x) => {\r\n let t;\r\n const patternInput = mapping(tupledArg[1], x);\r\n return [(t = (new FSharpList(patternInput[0], void 0)), (tupledArg[0].tail = t, t)), patternInput[1]];\r\n }, [root, state], xs);\r\n const t_2 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_2;\r\n return [FSharpList__get_Tail(root), patternInput_1[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n return mapFold((acc, x) => mapping(x, acc), state, reverse(xs));\r\n}\r\n\r\nexport function tryPick(f, xs) {\r\n const loop = (xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = f(FSharpList__get_Head(xs_1));\r\n if (matchValue == null) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs);\r\n}\r\n\r\nexport function pick(f, xs) {\r\n const matchValue = tryPick(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(f, xs) {\r\n return tryPick((x) => (f(x) ? some(x) : (void 0)), xs);\r\n}\r\n\r\nexport function find(f, xs) {\r\n const matchValue = tryFind(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(f, xs) {\r\n return tryFindBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findBack(f, xs) {\r\n const matchValue = tryFindBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(f, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (f(FSharpList__get_Head(xs_1))) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function findIndex(f, xs) {\r\n const matchValue = tryFindIndex(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(f, xs) {\r\n return tryFindIndexBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(f, xs) {\r\n const matchValue = tryFindIndexBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryItem(n, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (i === n) {\r\n return some(FSharpList__get_Head(xs_1));\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function item(n, xs) {\r\n return FSharpList__get_Item_Z524259A4(xs, n);\r\n}\r\n\r\nexport function filter(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n if (f(x)) {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function partition(f, xs) {\r\n const patternInput = [FSharpList_get_Empty(), FSharpList_get_Empty()];\r\n const root2 = patternInput[1];\r\n const root1 = patternInput[0];\r\n const patternInput_1 = fold(uncurry(2, (tupledArg) => {\r\n const lacc = tupledArg[0];\r\n const racc = tupledArg[1];\r\n return (x) => {\r\n let t, t_2;\r\n return f(x) ? [(t = (new FSharpList(x, void 0)), (lacc.tail = t, t)), racc] : [lacc, (t_2 = (new FSharpList(x, void 0)), (racc.tail = t_2, t_2))];\r\n };\r\n }), [root1, root2], xs);\r\n const t_4 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_4;\r\n const t_5 = FSharpList_get_Empty();\r\n patternInput_1[1].tail = t_5;\r\n return [FSharpList__get_Tail(root1), FSharpList__get_Tail(root2)];\r\n}\r\n\r\nexport function choose(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n const matchValue = f(x);\r\n if (matchValue == null) {\r\n return acc;\r\n }\r\n else {\r\n const t = new FSharpList(value_1(matchValue), void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function contains(value, xs, eq) {\r\n return tryFindIndex((v) => eq.Equals(value, v), xs) != null;\r\n}\r\n\r\nexport function initialize(n, f) {\r\n let xs, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n for (let i = 0; i <= (n - 1); i++) {\r\n node = ((xs = node, (t = (new FSharpList(f(i), void 0)), (xs.tail = t, t))));\r\n }\r\n const xs_2 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_2.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg1) => x);\r\n}\r\n\r\nexport function reduce(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return fold(f, head(xs), tail(xs));\r\n }\r\n}\r\n\r\nexport function reduceBack(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return foldBack(f, tail(xs), head(xs));\r\n }\r\n}\r\n\r\nexport function forAll(f, xs) {\r\n return fold((acc, x) => (acc && f(x)), true, xs);\r\n}\r\n\r\nexport function forAll2(f, xs, ys) {\r\n return fold2((acc, x, y) => (acc && f(x, y)), true, xs, ys);\r\n}\r\n\r\nexport function exists(f, xs) {\r\n return tryFindIndex(f, xs) != null;\r\n}\r\n\r\nexport function exists2(f_mut, xs_mut, ys_mut) {\r\n exists2:\r\n while (true) {\r\n const f = f_mut, xs = xs_mut, ys = ys_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs), FSharpList__get_IsEmpty(ys)];\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n pattern_matching_result = 2;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return false;\r\n }\r\n case 1: {\r\n if (f(FSharpList__get_Head(xs), FSharpList__get_Head(ys))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n ys_mut = FSharpList__get_Tail(ys);\r\n continue exists2;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error((SR_differentLengths + \"\\\\nParameter name: \") + \"list2\"));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function unzip(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function unzip3(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1]), FSharpList_Cons_305B8EAC(tupledArg[2], tupledArg_1[2])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n return averager.DivideByInt(fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs), count);\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n return averager.DivideByInt(fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs), count);\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return ofArray(permute_1(f, toArray(xs)));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return ofArray(map_1((xs_1) => ofArray(xs_1), chunkBySize_1(chunkSize, toArray(xs))));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n iterate((x) => {\r\n iterate((y) => {\r\n let xs_1, t;\r\n node = ((xs_1 = node, (t = (new FSharpList([x, y], void 0)), (xs_1.tail = t, t))));\r\n }, ys);\r\n }, xs);\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function skip(count_mut, xs_mut) {\r\n skip:\r\n while (true) {\r\n const count = count_mut, xs = xs_mut;\r\n if (count <= 0) {\r\n return xs;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n count_mut = (count - 1);\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skip;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate_mut, xs_mut) {\r\n skipWhile:\r\n while (true) {\r\n const predicate = predicate_mut, xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return xs;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs))) {\r\n return xs;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skipWhile;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function take(count, xs) {\r\n if (count < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n const loop = (acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs_1))) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function getSlice(startIndex, endIndex, xs) {\r\n const len = length(xs) | 0;\r\n const startIndex_1 = defaultArg(startIndex, 0) | 0;\r\n const endIndex_1 = defaultArg(endIndex, len - 1) | 0;\r\n if (startIndex_1 < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"startIndex\"));\r\n }\r\n else if (endIndex_1 >= len) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"endIndex\"));\r\n }\r\n else if (endIndex_1 < startIndex_1) {\r\n return FSharpList_get_Empty();\r\n }\r\n else {\r\n return take((endIndex_1 - startIndex_1) + 1, skip(startIndex_1, xs));\r\n }\r\n}\r\n\r\nexport function splitAt(index, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n if (index > FSharpList__get_Length(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [take(index, xs), skip(index, xs)];\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else if (FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return FSharpList__get_Head(xs);\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n if ((!FSharpList__get_IsEmpty(xs)) && FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return ofArray(pairwise_1(toArray(xs)));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return ofArray(map_1((xs_1) => ofArray(xs_1), windowed_1(windowSize, toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return ofArray(map_1((xs_1) => ofArray(xs_1), splitInto_1(chunks, toArray(xs))));\r\n}\r\n\r\nexport function transpose(lists) {\r\n return ofArray(map_1((xs_1) => ofArray(xs_1), transpose_1(map_1((xs) => toArray(xs), Array.from(lists)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const result = fold((acc, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_Cons_305B8EAC(y, acc));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? FSharpList_Cons_305B8EAC(y, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys_1 = foldBack_2((y, acc) => FSharpList_Cons_305B8EAC(y, acc), ys, FSharpList_get_Empty());\r\n const result = fold((acc_1, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, append(ys_1, acc_1));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc_1);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? append(ys_1, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n const ys = mapIndexed((i, x) => {\r\n if (i === index) {\r\n isDone = true;\r\n return y;\r\n }\r\n else {\r\n return x;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\n","import { equals } from \"./Util.js\";\nimport { Union } from \"./Types.js\";\nconst CaseRules = {\n None: 0,\n LowerFirst: 1,\n SnakeCase: 2,\n SnakeCaseAllCaps: 3,\n KebabCase: 4,\n};\nfunction dashify(str, separator) {\n return str.replace(/[a-z]?[A-Z]/g, (m) => m.length === 1\n ? m.toLowerCase()\n : m.charAt(0) + separator + m.charAt(1).toLowerCase());\n}\nfunction changeCase(str, caseRule) {\n switch (caseRule) {\n case CaseRules.LowerFirst:\n return str.charAt(0).toLowerCase() + str.slice(1);\n case CaseRules.SnakeCase:\n return dashify(str, \"_\");\n case CaseRules.SnakeCaseAllCaps:\n return dashify(str, \"_\").toUpperCase();\n case CaseRules.KebabCase:\n return dashify(str, \"-\");\n case CaseRules.None:\n default:\n return str;\n }\n}\nexport function keyValueList(fields, caseRule = CaseRules.None) {\n const obj = {};\n const definedCaseRule = caseRule;\n function fail(kvPair) {\n throw new Error(\"Cannot infer key and value of \" + String(kvPair));\n }\n function assign(key, caseRule, value) {\n key = changeCase(key, caseRule);\n obj[key] = value;\n }\n for (let kvPair of fields) {\n let caseRule = CaseRules.None;\n if (kvPair == null) {\n fail(kvPair);\n }\n // Deflate unions and use the defined case rule\n if (kvPair instanceof Union) {\n const name = kvPair.cases()[kvPair.tag];\n kvPair = kvPair.fields.length === 0 ? name : [name].concat(kvPair.fields);\n caseRule = definedCaseRule;\n }\n if (Array.isArray(kvPair)) {\n switch (kvPair.length) {\n case 0:\n fail(kvPair);\n break;\n case 1:\n assign(kvPair[0], caseRule, true);\n break;\n case 2:\n const value = kvPair[1];\n assign(kvPair[0], caseRule, value);\n break;\n default:\n assign(kvPair[0], caseRule, kvPair.slice(1));\n }\n }\n else if (typeof kvPair === \"string\") {\n assign(kvPair, caseRule, true);\n }\n else {\n fail(kvPair);\n }\n }\n return obj;\n}\n// TODO: Move these methods to Map and Set modules\nexport function containsValue(v, map) {\n for (const kv of map) {\n if (equals(v, kv[1])) {\n return true;\n }\n }\n return false;\n}\nexport function tryGetValue(map, key, defaultValue) {\n if (map.has(key)) {\n defaultValue.contents = map.get(key);\n return true;\n }\n return false;\n}\nexport function addToSet(v, set) {\n if (set.has(v)) {\n return false;\n }\n set.add(v);\n return true;\n}\nexport function addToDict(dict, k, v) {\n if (dict.has(k)) {\n throw new Error(\"An item with the same key has already been added. Key: \" + k);\n }\n dict.set(k, v);\n}\nexport function getItemFromDict(map, key) {\n if (map.has(key)) {\n return map.get(key);\n }\n else {\n throw new Error(`The given key '${key}' was not present in the dictionary.`);\n }\n}\n","import { Result_MapError, Result_Map, FSharpResult$2 } from \"../fable-library.3.6.3/Choice.js\";\r\nimport { class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { getEnumerator } from \"../fable-library.3.6.3/Util.js\";\r\n\r\nexport function tap(fn, a) {\r\n return a.then((x) => {\r\n fn(x);\r\n return x;\r\n });\r\n}\r\n\r\nexport function result(a) {\r\n return a.then((arg0) => (new FSharpResult$2(0, arg0))).catch((arg0_1) => (new FSharpResult$2(1, arg0_1)));\r\n}\r\n\r\nexport function mapResult(fn, a) {\r\n return a.then((result_1) => Result_Map(fn, result_1));\r\n}\r\n\r\nexport function bindResult(fn, a) {\r\n return a.then((a_1) => {\r\n if (a_1.tag === 1) {\r\n return Promise.resolve(new FSharpResult$2(1, a_1.fields[0]));\r\n }\r\n else {\r\n const pr = fn(a_1.fields[0]);\r\n return pr.then((arg0) => (new FSharpResult$2(0, arg0)));\r\n }\r\n });\r\n}\r\n\r\nexport function mapResultError(fn, a) {\r\n return a.then((result_1) => Result_MapError(fn, result_1));\r\n}\r\n\r\nexport class PromiseBuilder {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function PromiseBuilder$reflection() {\r\n return class_type(\"Promise.PromiseBuilder\", void 0, PromiseBuilder);\r\n}\r\n\r\nexport function PromiseBuilder_$ctor() {\r\n return new PromiseBuilder();\r\n}\r\n\r\nexport function PromiseBuilder__For_1565554B(_, seq, body) {\r\n let pr;\r\n let p = Promise.resolve(undefined);\r\n const enumerator = getEnumerator(seq);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const a = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n p = ((pr = p, pr.then(() => body(a))));\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n return p;\r\n}\r\n\r\nexport function PromiseBuilder__While_2044D34(this$, guard, p) {\r\n if (guard()) {\r\n return p.then(() => PromiseBuilder__While_2044D34(this$, guard, p));\r\n }\r\n else {\r\n return Promise.resolve(undefined);\r\n }\r\n}\r\n\r\nexport function PromiseBuilder__TryFinally_7D49A2FD(_, p, compensation) {\r\n return p.then((x) => {\r\n compensation();\r\n return x;\r\n }).catch((er) => {\r\n compensation();\r\n throw er;\r\n });\r\n}\r\n\r\nexport function PromiseBuilder__Delay_62FBFDE1(_, generator) {\r\n return {\r\n then: (onSuccess, onError) => {\r\n try {\r\n return generator().then(onSuccess, onError);\r\n }\r\n catch (er) {\r\n if (onError == null) {\r\n return Promise.reject(er);\r\n }\r\n else {\r\n try {\r\n const a = onError(er);\r\n return Promise.resolve(a);\r\n }\r\n catch (er_1) {\r\n return Promise.reject(er_1);\r\n }\r\n }\r\n }\r\n },\r\n catch: (onError_1) => {\r\n try {\r\n return generator().catch(onError_1);\r\n }\r\n catch (er_2) {\r\n try {\r\n const a_1 = onError_1(er_2);\r\n return Promise.resolve(a_1);\r\n }\r\n catch (er_3) {\r\n return Promise.reject(er_3);\r\n }\r\n }\r\n },\r\n };\r\n}\r\n\r\nexport function PromiseBuilder__Run_212F1D4B(_, p) {\r\n return p.then((x) => x);\r\n}\r\n\r\nexport function PromiseBuilder__Using_74F7E79D(this$, resource, binder) {\r\n return PromiseBuilder__TryFinally_7D49A2FD(this$, binder(resource), () => {\r\n let copyOfStruct = resource;\r\n copyOfStruct.Dispose();\r\n });\r\n}\r\n\r\n","import { Union } from \"../fable-library.3.6.3/Types.js\";\r\nimport { bool_type, class_type, union_type, obj_type, int32_type, string_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { int32ToString } from \"../fable-library.3.6.3/Util.js\";\r\nimport { keyValueList } from \"../fable-library.3.6.3/MapUtil.js\";\r\nimport { result } from \"../Fable.Promise.3.1.3/Promise.fs.js\";\r\nimport { singleton } from \"../fable-library.3.6.3/List.js\";\r\n\r\nexport class Types_HttpRequestHeaders extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Accept\", \"Accept-Charset\", \"Accept-Encoding\", \"Accept-Language\", \"Accept-Datetime\", \"Authorization\", \"Cache-Control\", \"Connection\", \"Cookie\", \"Content-Length\", \"Content-MD5\", \"Content-Type\", \"Date\", \"Expect\", \"Forwarded\", \"From\", \"Host\", \"If-Match\", \"If-Modified-Since\", \"If-None-Match\", \"If-Range\", \"If-Unmodified-Since\", \"Max-Forwards\", \"Origin\", \"Pragma\", \"Proxy-Authorization\", \"Range\", \"Referer\", \"SOAPAction\", \"TE\", \"User-Agent\", \"Upgrade\", \"Via\", \"Warning\", \"X-Requested-With\", \"DNT\", \"X-Forwarded-For\", \"X-Forwarded-Host\", \"X-Forwarded-Proto\", \"Front-End-Https\", \"X-Http-Method-Override\", \"X-ATT-DeviceId\", \"X-Wap-Profile\", \"Proxy-Connection\", \"X-UIDH\", \"X-Csrf-Token\", \"Custom\"];\r\n }\r\n}\r\n\r\nexport function Types_HttpRequestHeaders$reflection() {\r\n return union_type(\"Fetch.Types.HttpRequestHeaders\", [], Types_HttpRequestHeaders, () => [[[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", int32_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"key\", string_type], [\"value\", obj_type]]]);\r\n}\r\n\r\nexport class Types_RequestProperties extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Method\", \"Headers\", \"Body\", \"Mode\", \"Credentials\", \"Cache\", \"Redirect\", \"Referrer\", \"ReferrerPolicy\", \"Integrity\", \"KeepAlive\", \"Signal\"];\r\n }\r\n}\r\n\r\nexport function Types_RequestProperties$reflection() {\r\n return union_type(\"Fetch.Types.RequestProperties\", [], Types_RequestProperties, () => [[[\"Item\", string_type]], [[\"Item\", class_type(\"Fetch.Types.IHttpRequestHeaders\")]], [[\"Item\", obj_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", bool_type]], [[\"Item\", class_type(\"Fetch.Types.AbortSignal\")]]]);\r\n}\r\n\r\nfunction errorString(response) {\r\n return (((int32ToString(response.status) + \" \") + (response.statusText)) + \" for URL \") + (response.url);\r\n}\r\n\r\nexport function fetch$(url, init) {\r\n const pr = fetch(url, keyValueList(init, 1));\r\n return pr.then((response) => {\r\n if (response.ok) {\r\n return response;\r\n }\r\n else {\r\n const message = errorString(response);\r\n throw (new Error(message));\r\n }\r\n });\r\n}\r\n\r\nexport function fetchUnsafe(url, init) {\r\n return fetch(url, keyValueList(init, 1));\r\n}\r\n\r\nexport function tryFetch(url, init) {\r\n return result(fetch$(url, init));\r\n}\r\n\r\nexport function tryOptionsRequest(url) {\r\n return result(fetch$(url, singleton(new Types_RequestProperties(0, \"OPTIONS\"))));\r\n}\r\n\r\n","import { record_type, bool_type, list_type, option_type, class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { singleton, ofArrayWithTail, head, tail, isEmpty as isEmpty_1, FSharpList, fold as fold_1, empty as empty_1, cons } from \"./List.js\";\r\nimport { fill } from \"./Array.js\";\r\nimport { structuralHash, compare, toIterator, equals, getEnumerator, isArrayLike } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { tryPick as tryPick_1, pick as pick_1, iterate as iterate_1, compareWith, map as map_1, unfold } from \"./Seq.js\";\r\nimport { format, join } from \"./String.js\";\r\nimport { LanguagePrimitives_FastGenericComparer } from \"./FSharp.Core.js\";\r\n\r\nexport class MapTreeLeaf$2 {\r\n constructor(k, v) {\r\n this.k = k;\r\n this.v = v;\r\n }\r\n}\r\n\r\nexport function MapTreeLeaf$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeLeaf`2\", [gen0, gen1], MapTreeLeaf$2);\r\n}\r\n\r\nexport function MapTreeLeaf$2_$ctor_5BDDA1(k, v) {\r\n return new MapTreeLeaf$2(k, v);\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Key(_) {\r\n return _.k;\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Value(_) {\r\n return _.v;\r\n}\r\n\r\nexport class MapTreeNode$2 extends MapTreeLeaf$2 {\r\n constructor(k, v, left, right, h) {\r\n super(k, v);\r\n this.left = left;\r\n this.right = right;\r\n this.h = (h | 0);\r\n }\r\n}\r\n\r\nexport function MapTreeNode$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeNode`2\", [gen0, gen1], MapTreeNode$2, MapTreeLeaf$2$reflection(gen0, gen1));\r\n}\r\n\r\nexport function MapTreeNode$2_$ctor_499A11FD(k, v, left, right, h) {\r\n return new MapTreeNode$2(k, v, left, right, h);\r\n}\r\n\r\nexport function MapTreeNode$2__get_Left(_) {\r\n return _.left;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Right(_) {\r\n return _.right;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Height(_) {\r\n return _.h;\r\n}\r\n\r\nexport function MapTreeModule_empty() {\r\n return void 0;\r\n}\r\n\r\nexport function MapTreeModule_sizeAux(acc_mut, m_mut) {\r\n MapTreeModule_sizeAux:\r\n while (true) {\r\n const acc = acc_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n acc_mut = MapTreeModule_sizeAux(acc + 1, MapTreeNode$2__get_Left(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_sizeAux;\r\n }\r\n else {\r\n return (acc + 1) | 0;\r\n }\r\n }\r\n else {\r\n return acc | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_size(x) {\r\n return MapTreeModule_sizeAux(0, x);\r\n}\r\n\r\nexport function MapTreeModule_mk(l, k, v, r) {\r\n let hl;\r\n const m = l;\r\n if (m != null) {\r\n const m2 = m;\r\n hl = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n hl = 0;\r\n }\r\n let hr;\r\n const m_1 = r;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n hr = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n hr = 0;\r\n }\r\n const m_2 = ((hl < hr) ? hr : hl) | 0;\r\n if (m_2 === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, l, r, m_2 + 1);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_rebalance(t1, k, v, t2) {\r\n let m_2, m2_2, m_3, m2_3;\r\n let t1h;\r\n const m = t1;\r\n if (m != null) {\r\n const m2 = m;\r\n t1h = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n t1h = 0;\r\n }\r\n let t2h;\r\n const m_1 = t2;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n t2h = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n t2h = 0;\r\n }\r\n if (t2h > (t1h + 2)) {\r\n const matchValue = value_1(t2);\r\n if (matchValue instanceof MapTreeNode$2) {\r\n if (((m_2 = MapTreeNode$2__get_Left(matchValue), (m_2 != null) ? ((m2_2 = m_2, (m2_2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_2) : 1)) : 0)) > (t1h + 1)) {\r\n const matchValue_1 = value_1(MapTreeNode$2__get_Left(matchValue));\r\n if (matchValue_1 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue_1)), MapTreeLeaf$2__get_Key(matchValue_1), MapTreeLeaf$2__get_Value(matchValue_1), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_1), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue)));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue)), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else if (t1h > (t2h + 2)) {\r\n const matchValue_2 = value_1(t1);\r\n if (matchValue_2 instanceof MapTreeNode$2) {\r\n if (((m_3 = MapTreeNode$2__get_Right(matchValue_2), (m_3 != null) ? ((m2_3 = m_3, (m2_3 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_3) : 1)) : 0)) > (t2h + 1)) {\r\n const matchValue_3 = value_1(MapTreeNode$2__get_Right(matchValue_2));\r\n if (matchValue_3 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeNode$2__get_Left(matchValue_3)), MapTreeLeaf$2__get_Key(matchValue_3), MapTreeLeaf$2__get_Value(matchValue_3), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_3), k, v, t2));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_2), k, v, t2));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(t1, k, v, t2);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_add(comparer, k, v, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c < 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeModule_empty(), m, 2);\r\n }\r\n else if (c === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, m, MapTreeModule_empty(), 2);\r\n }\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryFind(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_tryFind:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c === 0) {\r\n return some(MapTreeLeaf$2__get_Value(m2));\r\n }\r\n else if (m2 instanceof MapTreeNode$2) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = ((c < 0) ? MapTreeNode$2__get_Left(m2) : MapTreeNode$2__get_Right(m2));\r\n continue MapTreeModule_tryFind;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_find(comparer, k, m) {\r\n const matchValue = MapTreeModule_tryFind(comparer, k, m);\r\n if (matchValue == null) {\r\n throw (new Error());\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition1(comparer, f, k, v, acc1, acc2) {\r\n if (f(k, v)) {\r\n return [MapTreeModule_add(comparer, k, v, acc1), acc2];\r\n }\r\n else {\r\n return [acc1, MapTreeModule_add(comparer, k, v, acc2)];\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partitionAux(comparer_mut, f_mut, m_mut, acc_0_mut, acc_1_mut) {\r\n MapTreeModule_partitionAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc_0 = acc_0_mut, acc_1 = acc_1_mut;\r\n const acc = [acc_0, acc_1];\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_2 = MapTreeModule_partitionAux(comparer, f, MapTreeNode$2__get_Right(m2), acc[0], acc[1]);\r\n const acc_3 = MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_2[0], acc_2[1]);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n acc_0_mut = acc_3[0];\r\n acc_1_mut = acc_3[1];\r\n continue MapTreeModule_partitionAux;\r\n }\r\n else {\r\n return MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc[0], acc[1]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition(comparer, f, m) {\r\n return MapTreeModule_partitionAux(comparer, f, m, MapTreeModule_empty(), MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_filter1(comparer, f, k, v, acc) {\r\n if (f(k, v)) {\r\n return MapTreeModule_add(comparer, k, v, acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filterAux(comparer_mut, f_mut, m_mut, acc_mut) {\r\n MapTreeModule_filterAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc = acc_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_1 = MapTreeModule_filterAux(comparer, f, MapTreeNode$2__get_Left(m2), acc);\r\n const acc_2 = MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_1);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n acc_mut = acc_2;\r\n continue MapTreeModule_filterAux;\r\n }\r\n else {\r\n return MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filter(comparer, f, m) {\r\n return MapTreeModule_filterAux(comparer, f, m, MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_spliceOutSuccessor(m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2)];\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Left(m2));\r\n return [patternInput[0], patternInput[1], MapTreeModule_mk(patternInput[2], MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2))];\r\n }\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_empty()];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.spliceOutSuccessor\"));\r\n }\r\n}\r\n\r\nexport function MapTreeModule_remove(comparer, k, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c === 0) {\r\n return MapTreeModule_empty();\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_change(comparer, k, u, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n const matchValue_1 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_1 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_1), MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c_1 < 0) {\r\n const matchValue_2 = u(void 0);\r\n if (matchValue_2 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_2), MapTreeModule_empty(), m, 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else if (c_1 === 0) {\r\n const matchValue_3 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_3 != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue_3));\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n }\r\n else {\r\n const matchValue_4 = u(void 0);\r\n if (matchValue_4 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_4), m, MapTreeModule_empty(), 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const matchValue = u(void 0);\r\n if (matchValue != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue));\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mem(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_mem:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n else if (c === 0) {\r\n return true;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n }\r\n else {\r\n return c === 0;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iterOpt(f_mut, m_mut) {\r\n MapTreeModule_iterOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n MapTreeModule_iterOpt(f, MapTreeNode$2__get_Left(m2));\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_iterOpt;\r\n }\r\n else {\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iter(f, m) {\r\n MapTreeModule_iterOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_tryPickOpt(f_mut, m_mut) {\r\n MapTreeModule_tryPickOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const matchValue = MapTreeModule_tryPickOpt(f, MapTreeNode$2__get_Left(m2));\r\n if (matchValue == null) {\r\n const matchValue_1 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n if (matchValue_1 == null) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_tryPickOpt;\r\n }\r\n else {\r\n return matchValue_1;\r\n }\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryPick(f, m) {\r\n return MapTreeModule_tryPickOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_existsOpt(f_mut, m_mut) {\r\n MapTreeModule_existsOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_existsOpt(f, MapTreeNode$2__get_Left(m2)) ? true : f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_existsOpt;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_exists(f, m) {\r\n return MapTreeModule_existsOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_forallOpt(f_mut, m_mut) {\r\n MapTreeModule_forallOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_forallOpt(f, MapTreeNode$2__get_Left(m2)) && f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_forallOpt;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_forall(f, m) {\r\n return MapTreeModule_forallOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_map(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_map(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_map(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapiOpt(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapi(f, m) {\r\n return MapTreeModule_mapiOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_foldBackOpt(f_mut, m_mut, x_mut) {\r\n MapTreeModule_foldBackOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut, x = x_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const x_1 = MapTreeModule_foldBackOpt(f, MapTreeNode$2__get_Right(m2), x);\r\n const x_2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n x_mut = x_2;\r\n continue MapTreeModule_foldBackOpt;\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x);\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldBack(f, m, x) {\r\n return MapTreeModule_foldBackOpt(f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_foldOpt(f_mut, x_mut, m_mut) {\r\n MapTreeModule_foldOpt:\r\n while (true) {\r\n const f = f_mut, x = x_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n f_mut = f;\r\n x_mut = f(MapTreeModule_foldOpt(f, x, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_foldOpt;\r\n }\r\n else {\r\n return f(x, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_fold(f, x, m) {\r\n return MapTreeModule_foldOpt(f, x, m);\r\n}\r\n\r\nexport function MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x) {\r\n const foldFromTo = (f_1_mut, m_1_mut, x_1_mut) => {\r\n foldFromTo:\r\n while (true) {\r\n const f_1 = f_1_mut, m_1 = m_1_mut, x_1 = x_1_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const cLoKey = comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n const cKeyHi = comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) | 0;\r\n const x_2 = (cLoKey < 0) ? foldFromTo(f_1, MapTreeNode$2__get_Left(m2), x_1) : x_1;\r\n const x_3 = ((cLoKey <= 0) && (cKeyHi <= 0)) ? f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_2) : x_2;\r\n if (cKeyHi < 0) {\r\n f_1_mut = f_1;\r\n m_1_mut = MapTreeNode$2__get_Right(m2);\r\n x_1_mut = x_3;\r\n continue foldFromTo;\r\n }\r\n else {\r\n return x_3;\r\n }\r\n }\r\n else if ((comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) <= 0) && (comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) <= 0)) {\r\n return f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n }\r\n else {\r\n return x_1;\r\n }\r\n }\r\n else {\r\n return x_1;\r\n }\r\n break;\r\n }\r\n };\r\n if (comparer.Compare(lo, hi) === 1) {\r\n return x;\r\n }\r\n else {\r\n return foldFromTo(f, m, x);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldSection(comparer, lo, hi, f, m, x) {\r\n return MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_toList(m) {\r\n const loop = (m_1_mut, acc_mut) => {\r\n loop:\r\n while (true) {\r\n const m_1 = m_1_mut, acc = acc_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n m_1_mut = MapTreeNode$2__get_Left(m2);\r\n acc_mut = cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], loop(MapTreeNode$2__get_Right(m2), acc));\r\n continue loop;\r\n }\r\n else {\r\n return cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(m, empty_1());\r\n}\r\n\r\nexport function MapTreeModule_copyToArray(m, arr, i) {\r\n let j = i;\r\n MapTreeModule_iter((x, y) => {\r\n arr[j] = [x, y];\r\n j = ((j + 1) | 0);\r\n }, m);\r\n}\r\n\r\nexport function MapTreeModule_toArray(m) {\r\n const n = MapTreeModule_size(m) | 0;\r\n const res = fill(new Array(n), 0, n, [null, null]);\r\n MapTreeModule_copyToArray(m, res, 0);\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofList(comparer, l) {\r\n return fold_1((acc, tupledArg) => MapTreeModule_add(comparer, tupledArg[0], tupledArg[1], acc), MapTreeModule_empty(), l);\r\n}\r\n\r\nexport function MapTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) {\r\n MapTreeModule_mkFromEnumerator:\r\n while (true) {\r\n const comparer = comparer_mut, acc = acc_mut, e = e_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const patternInput = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n comparer_mut = comparer;\r\n acc_mut = MapTreeModule_add(comparer, patternInput[0], patternInput[1], acc);\r\n e_mut = e;\r\n continue MapTreeModule_mkFromEnumerator;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_ofArray(comparer, arr) {\r\n let res = MapTreeModule_empty();\r\n for (let idx = 0; idx <= (arr.length - 1); idx++) {\r\n const forLoopVar = arr[idx];\r\n res = MapTreeModule_add(comparer, forLoopVar[0], forLoopVar[1], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofSeq(comparer, c) {\r\n if (isArrayLike(c)) {\r\n return MapTreeModule_ofArray(comparer, c);\r\n }\r\n else if (c instanceof FSharpList) {\r\n return MapTreeModule_ofList(comparer, c);\r\n }\r\n else {\r\n const ie = getEnumerator(c);\r\n try {\r\n return MapTreeModule_mkFromEnumerator(comparer, MapTreeModule_empty(), ie);\r\n }\r\n finally {\r\n ie.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport class MapTreeModule_MapIterator$2 extends Record {\r\n constructor(stack, started) {\r\n super();\r\n this.stack = stack;\r\n this.started = started;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_MapIterator$2$reflection(gen0, gen1) {\r\n return record_type(\"Map.MapTreeModule.MapIterator`2\", [gen0, gen1], MapTreeModule_MapIterator$2, () => [[\"stack\", list_type(option_type(MapTreeLeaf$2$reflection(gen0, gen1)))], [\"started\", bool_type]]);\r\n}\r\n\r\nexport function MapTreeModule_collapseLHS(stack_mut) {\r\n MapTreeModule_collapseLHS:\r\n while (true) {\r\n const stack = stack_mut;\r\n if (!isEmpty_1(stack)) {\r\n const rest = tail(stack);\r\n const m = head(stack);\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n stack_mut = ofArrayWithTail([MapTreeNode$2__get_Left(m2), MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)), MapTreeNode$2__get_Right(m2)], rest);\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n else {\r\n return stack;\r\n }\r\n }\r\n else {\r\n stack_mut = rest;\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIterator(m) {\r\n return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton(m)), false);\r\n}\r\n\r\nexport function MapTreeModule_notStarted() {\r\n throw (new Error(\"enumeration not started\"));\r\n}\r\n\r\nexport function MapTreeModule_alreadyFinished() {\r\n throw (new Error(\"enumeration already finished\"));\r\n}\r\n\r\nexport function MapTreeModule_current(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m), MapTreeLeaf$2__get_Value(m)];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_alreadyFinished();\r\n }\r\n }\r\n else {\r\n return MapTreeModule_notStarted();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_moveNext(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n else {\r\n i.stack = MapTreeModule_collapseLHS(tail(matchValue));\r\n return !isEmpty_1(i.stack);\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n i.started = true;\r\n return !isEmpty_1(i.stack);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIEnumerator(m) {\r\n let i = MapTreeModule_mkIterator(m);\r\n return {\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n return MapTreeModule_moveNext(i);\r\n },\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n i = MapTreeModule_mkIterator(m);\r\n },\r\n Dispose() {\r\n },\r\n };\r\n}\r\n\r\nexport function MapTreeModule_toSeq(s) {\r\n return unfold((en_1) => {\r\n if (en_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return [en_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), en_1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, MapTreeModule_mkIEnumerator(s));\r\n}\r\n\r\nexport class FSharpMap {\r\n constructor(comparer, tree) {\r\n this.comparer = comparer;\r\n this.tree = tree;\r\n }\r\n GetHashCode() {\r\n const this$ = this;\r\n return FSharpMap__ComputeHashCode(this$) | 0;\r\n }\r\n Equals(that) {\r\n const this$ = this;\r\n if (that instanceof FSharpMap) {\r\n const e1 = getEnumerator(this$);\r\n try {\r\n const e2 = getEnumerator(that);\r\n try {\r\n const loop = () => {\r\n const m1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n if (m1 === e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (!m1) {\r\n return true;\r\n }\r\n else {\r\n const e1c = e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n const e2c = e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (equals(e1c[0], e2c[0]) && equals(e1c[1], e2c[1])) {\r\n return loop();\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return loop();\r\n }\r\n finally {\r\n e2.Dispose();\r\n }\r\n }\r\n finally {\r\n e1.Dispose();\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n toString() {\r\n const this$ = this;\r\n return (\"map [\" + join(\"; \", map_1((kv) => format(\"({0}, {1})\", kv[0], kv[1]), this$))) + \"]\";\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"FSharpMap\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n GetEnumerator() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n CompareTo(obj) {\r\n const m = this;\r\n if (obj instanceof FSharpMap) {\r\n return compareWith((kvp1, kvp2) => {\r\n const c = m.comparer.Compare(kvp1[0], kvp2[0]) | 0;\r\n return ((c !== 0) ? c : compare(kvp1[1], kvp2[1])) | 0;\r\n }, m, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](x) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, x[0]) && equals(FSharpMap__get_Item(m, x[0]), x[1]);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](arr, i) {\r\n const m = this;\r\n MapTreeModule_copyToArray(m.tree, arr, i);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return true;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n [\"System.Collections.Generic.IReadOnlyCollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n get size() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n clear() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n delete(_arg1) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return false;\r\n }\r\n entries() {\r\n const m = this;\r\n return map_1((p) => [p[0], p[1]], m);\r\n }\r\n get(k) {\r\n const m = this;\r\n return FSharpMap__get_Item(m, k);\r\n }\r\n has(k) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, k);\r\n }\r\n keys() {\r\n const m = this;\r\n return map_1((p) => p[0], m);\r\n }\r\n set(k, v) {\r\n const m = this;\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return m;\r\n }\r\n values() {\r\n const m = this;\r\n return map_1((p) => p[1], m);\r\n }\r\n forEach(f, thisArg) {\r\n const m = this;\r\n iterate_1((p) => {\r\n f(p[1], p[0], m);\r\n }, m);\r\n }\r\n}\r\n\r\nexport function FSharpMap$reflection(gen0, gen1) {\r\n return class_type(\"Map.FSharpMap\", [gen0, gen1], FSharpMap);\r\n}\r\n\r\nexport function FSharpMap_$ctor(comparer, tree) {\r\n return new FSharpMap(comparer, tree);\r\n}\r\n\r\n(() => {\r\n FSharpMap.empty = FSharpMap_$ctor(LanguagePrimitives_FastGenericComparer(), MapTreeModule_empty());\r\n})();\r\n\r\nexport function FSharpMap_get_Empty() {\r\n return FSharpMap.empty;\r\n}\r\n\r\nexport function FSharpMap_Create(ie) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, ie));\r\n}\r\n\r\nexport function FSharpMap__get_Comparer(m) {\r\n return m.comparer;\r\n}\r\n\r\nexport function FSharpMap__get_Tree(m) {\r\n return m.tree;\r\n}\r\n\r\nexport function FSharpMap__Add(m, key, value) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_add(m.comparer, key, value, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Change(m, key, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_change(m.comparer, key, f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__get_IsEmpty(m) {\r\n return m.tree == null;\r\n}\r\n\r\nexport function FSharpMap__get_Item(m, key) {\r\n return MapTreeModule_find(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__TryPick(m, f) {\r\n return MapTreeModule_tryPick(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Exists(m, predicate) {\r\n return MapTreeModule_exists(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Filter(m, predicate) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_filter(m.comparer, predicate, m.tree));\r\n}\r\n\r\nexport function FSharpMap__ForAll(m, predicate) {\r\n return MapTreeModule_forall(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Fold(m, f, acc) {\r\n return MapTreeModule_foldBack(f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__FoldSection(m, lo, hi, f, acc) {\r\n return MapTreeModule_foldSection(m.comparer, lo, hi, f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__Iterate(m, f) {\r\n MapTreeModule_iter(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__MapRange(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_map(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Map(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_mapi(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Partition(m, predicate) {\r\n const patternInput = MapTreeModule_partition(m.comparer, predicate, m.tree);\r\n return [FSharpMap_$ctor(m.comparer, patternInput[0]), FSharpMap_$ctor(m.comparer, patternInput[1])];\r\n}\r\n\r\nexport function FSharpMap__get_Count(m) {\r\n return MapTreeModule_size(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ContainsKey(m, key) {\r\n return MapTreeModule_mem(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Remove(m, key) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_remove(m.comparer, key, m.tree));\r\n}\r\n\r\nexport function FSharpMap__TryGetValue(__, key, value) {\r\n const matchValue = MapTreeModule_tryFind(__.comparer, key, __.tree);\r\n if (matchValue == null) {\r\n return false;\r\n }\r\n else {\r\n const v = value_1(matchValue);\r\n value.contents = v;\r\n return true;\r\n }\r\n}\r\n\r\nexport function FSharpMap__get_Keys(__) {\r\n return Array.from(map_1((kvp) => kvp[0], MapTreeModule_toSeq(__.tree)));\r\n}\r\n\r\nexport function FSharpMap__get_Values(__) {\r\n return Array.from(map_1((kvp) => kvp[1], MapTreeModule_toSeq(__.tree)));\r\n}\r\n\r\nexport function FSharpMap__TryFind(m, key) {\r\n return MapTreeModule_tryFind(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToList(m) {\r\n return MapTreeModule_toList(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToArray(m) {\r\n return MapTreeModule_toArray(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ComputeHashCode(this$) {\r\n const combineHash = (x, y) => (((x << 1) + y) + 631);\r\n let res = 0;\r\n const enumerator = getEnumerator(this$);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const activePatternResult5790 = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n res = (combineHash(res, structuralHash(activePatternResult5790[0])) | 0);\r\n res = (combineHash(res, structuralHash(activePatternResult5790[1])) | 0);\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function isEmpty(table) {\r\n return FSharpMap__get_IsEmpty(table);\r\n}\r\n\r\nexport function add(key, value, table) {\r\n return FSharpMap__Add(table, key, value);\r\n}\r\n\r\nexport function change(key, f, table) {\r\n return FSharpMap__Change(table, key, f);\r\n}\r\n\r\nexport function find(key, table) {\r\n return FSharpMap__get_Item(table, key);\r\n}\r\n\r\nexport function tryFind(key, table) {\r\n return FSharpMap__TryFind(table, key);\r\n}\r\n\r\nexport function remove(key, table) {\r\n return FSharpMap__Remove(table, key);\r\n}\r\n\r\nexport function containsKey(key, table) {\r\n return FSharpMap__ContainsKey(table, key);\r\n}\r\n\r\nexport function iterate(action, table) {\r\n FSharpMap__Iterate(table, action);\r\n}\r\n\r\nexport function tryPick(chooser, table) {\r\n return FSharpMap__TryPick(table, chooser);\r\n}\r\n\r\nexport function pick(chooser, table) {\r\n const matchValue = tryPick(chooser, table);\r\n if (matchValue != null) {\r\n return value_1(matchValue);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n}\r\n\r\nexport function exists(predicate, table) {\r\n return FSharpMap__Exists(table, predicate);\r\n}\r\n\r\nexport function filter(predicate, table) {\r\n return FSharpMap__Filter(table, predicate);\r\n}\r\n\r\nexport function partition(predicate, table) {\r\n return FSharpMap__Partition(table, predicate);\r\n}\r\n\r\nexport function forAll(predicate, table) {\r\n return FSharpMap__ForAll(table, predicate);\r\n}\r\n\r\nexport function map(mapping, table) {\r\n return FSharpMap__Map(table, mapping);\r\n}\r\n\r\nexport function fold(folder, state, table) {\r\n return MapTreeModule_fold(folder, state, FSharpMap__get_Tree(table));\r\n}\r\n\r\nexport function foldBack(folder, table, state) {\r\n return MapTreeModule_foldBack(folder, FSharpMap__get_Tree(table), state);\r\n}\r\n\r\nexport function toSeq(table) {\r\n return map_1((kvp) => [kvp[0], kvp[1]], table);\r\n}\r\n\r\nexport function findKey(predicate, table) {\r\n return pick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function tryFindKey(predicate, table) {\r\n return tryPick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function ofList(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofSeq(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofArray(elements) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofArray(comparer, elements));\r\n}\r\n\r\nexport function toList(table) {\r\n return FSharpMap__ToList(table);\r\n}\r\n\r\nexport function toArray(table) {\r\n return FSharpMap__ToArray(table);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpMap_get_Empty();\r\n}\r\n\r\nexport function count(table) {\r\n return FSharpMap__get_Count(table);\r\n}\r\n\r\n","import { Record } from \"../Types.js\";\r\nimport { record_type, array_type, int32_type } from \"../Reflection.js\";\r\nimport { op_LeftShift, op_BitwiseAnd, op_Addition, compare, op_Subtraction, op_Division, equals, fromInteger, op_Multiply, op_Modulus, toInt, fromBits } from \"../Long.js\";\r\nimport { copy, initialize, map, fill } from \"../Array.js\";\r\nimport { toArray, empty, head, tail, isEmpty, cons } from \"../List.js\";\r\nimport { int32ToString } from \"../Util.js\";\r\nimport { isNullOrEmpty, join } from \"../String.js\";\r\n\r\nexport class BigNat extends Record {\r\n constructor(bound, digits) {\r\n super();\r\n this.bound = (bound | 0);\r\n this.digits = digits;\r\n }\r\n}\r\n\r\nexport function BigNat$reflection() {\r\n return record_type(\"BigInt.BigNat\", [], BigNat, () => [[\"bound\", int32_type], [\"digits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_FFT_pow32(x_mut, n_mut) {\r\n BigNatModule_FFT_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_FFT_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_leastBounding2Power(b) {\r\n const findBounding2Power = (b_1_mut, tp_mut, i_mut) => {\r\n findBounding2Power:\r\n while (true) {\r\n const b_1 = b_1_mut, tp = tp_mut, i = i_mut;\r\n if (b_1 <= tp) {\r\n return [tp, i];\r\n }\r\n else {\r\n b_1_mut = b_1;\r\n tp_mut = (tp * 2);\r\n i_mut = (i + 1);\r\n continue findBounding2Power;\r\n }\r\n break;\r\n }\r\n };\r\n return findBounding2Power(b, 1, 0);\r\n}\r\n\r\nexport const BigNatModule_FFT_p = fromBits(2013265921, 0, false);\r\n\r\nconst BigNatModule_FFT_patternInput$004075 = [27, 15, 31, 440564289];\r\n\r\nexport const BigNatModule_FFT_w = BigNatModule_FFT_patternInput$004075[3];\r\n\r\nexport const BigNatModule_FFT_m = BigNatModule_FFT_patternInput$004075[1];\r\n\r\nexport const BigNatModule_FFT_k = BigNatModule_FFT_patternInput$004075[0];\r\n\r\nexport const BigNatModule_FFT_g = BigNatModule_FFT_patternInput$004075[2];\r\n\r\nexport const BigNatModule_FFT_primeP = BigNatModule_FFT_p;\r\n\r\nexport const BigNatModule_FFT_maxBitsInsideFp = 30;\r\n\r\nexport const BigNatModule_FFT_Fp_p = 2013265921;\r\n\r\nexport const BigNatModule_FFT_Fp_p64 = fromBits(2013265921, 0, true);\r\n\r\nexport function BigNatModule_FFT_Fp_toInt(x) {\r\n return ~(~x);\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_ofInt32(x) {\r\n return x >>> 0;\r\n}\r\n\r\nexport const BigNatModule_FFT_Fp_mzero = 0;\r\n\r\nexport const BigNatModule_FFT_Fp_mone = 1;\r\n\r\nexport const BigNatModule_FFT_Fp_mtwo = 2;\r\n\r\nexport function BigNatModule_FFT_Fp_mpow(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpow:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_Fp_mpow;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpow(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, ~(~(n / 2)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_mpowL(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpowL:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (equals(n, fromBits(0, 0, false))) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if (equals(op_Modulus(n, fromBits(2, 0, false)), fromBits(0, 0, false))) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = op_Division(n, fromBits(2, 0, false));\r\n continue BigNatModule_FFT_Fp_mpowL;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpowL(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, op_Division(n, fromBits(2, 0, false)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_m2PowNthRoot(n) {\r\n return BigNatModule_FFT_Fp_mpow(BigNatModule_FFT_w >>> 0, BigNatModule_FFT_pow32(2, BigNatModule_FFT_k - n));\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_minv(x) {\r\n return BigNatModule_FFT_Fp_mpowL(x, op_Subtraction(BigNatModule_FFT_primeP, fromBits(2, 0, false)));\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFFT(lambda, mu, n, w, u, res, offset) {\r\n let x_1, x_3, y_5;\r\n if (n === 1) {\r\n res[offset] = u[mu];\r\n }\r\n else {\r\n const halfN = (~(~(n / 2))) | 0;\r\n const ww = toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(w, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n const offsetHalfN = (offset + halfN) | 0;\r\n BigNatModule_FFT_computeFFT(lambda * 2, mu, halfN, ww, u, res, offset);\r\n BigNatModule_FFT_computeFFT(lambda * 2, lambda + mu, halfN, ww, u, res, offsetHalfN);\r\n let wj = BigNatModule_FFT_Fp_mone;\r\n for (let j = 0; j <= (halfN - 1); j++) {\r\n const even = res[offset + j];\r\n const odd = res[offsetHalfN + j];\r\n res[offset + j] = ((even + ((x_1 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_1, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n res[offsetHalfN + j] = (((even + BigNatModule_FFT_Fp_p) - ((x_3 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_3, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n wj = ((y_5 = wj, toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(y_5, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0));\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_computFftInPlace(n, w, u) {\r\n const res = fill(new Uint32Array(n), 0, n, BigNatModule_FFT_Fp_mzero);\r\n BigNatModule_FFT_computeFFT(1, 0, n, w, u, res, 0);\r\n return res;\r\n}\r\n\r\nexport function BigNatModule_FFT_computeInverseFftInPlace(n, w, uT) {\r\n const bigKInv = BigNatModule_FFT_Fp_minv(n >>> 0);\r\n return map((y) => (toInt(op_Modulus(op_Multiply(fromInteger(bigKInv, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0), BigNatModule_FFT_computFftInPlace(n, BigNatModule_FFT_Fp_minv(w), uT), Uint32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_maxTwoPower = 29;\r\n\r\nexport const BigNatModule_FFT_twoPowerTable = initialize(BigNatModule_FFT_maxTwoPower - 1, (i) => BigNatModule_FFT_pow32(2, i), Int32Array);\r\n\r\nexport function BigNatModule_FFT_computeFftPaddedPolynomialProduct(bigK, k, u, v) {\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(k);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v);\r\n return BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array));\r\n}\r\n\r\nexport function BigNatModule_FFT_padTo(n, u) {\r\n const uBound = u.length | 0;\r\n return initialize(n, (i) => ((i < uBound) ? BigNatModule_FFT_Fp_ofInt32(u[i]) : BigNatModule_FFT_Fp_mzero), Uint32Array);\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFftPolynomialProduct(degu, u, degv, v) {\r\n const patternInput = BigNatModule_FFT_leastBounding2Power((degu + degv) + 1);\r\n const bigK = patternInput[0] | 0;\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(patternInput[1]);\r\n const u_1 = BigNatModule_FFT_padTo(bigK, u);\r\n const v_1 = BigNatModule_FFT_padTo(bigK, v);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u_1);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v_1);\r\n return map((x_1) => BigNatModule_FFT_Fp_toInt(x_1), BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array)), Int32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_mzero = BigNatModule_FFT_Fp_mzero;\r\n\r\nexport const BigNatModule_FFT_mone = BigNatModule_FFT_Fp_mone;\r\n\r\nexport const BigNatModule_FFT_maxFp = ((BigNatModule_FFT_Fp_p + BigNatModule_FFT_Fp_p) - BigNatModule_FFT_mone) % BigNatModule_FFT_Fp_p;\r\n\r\nexport function BigNatModule_bound(n) {\r\n return n.bound;\r\n}\r\n\r\nexport function BigNatModule_setBound(n, v) {\r\n n.bound = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_coeff(n, i) {\r\n return n.digits[i];\r\n}\r\n\r\nexport function BigNatModule_coeff64(n, i) {\r\n return fromInteger(BigNatModule_coeff(n, i), false, 2);\r\n}\r\n\r\nexport function BigNatModule_setCoeff(n, i, v) {\r\n n.digits[i] = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_pow64(x_mut, n_mut) {\r\n BigNatModule_pow64:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return fromBits(1, 0, false);\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = op_Multiply(x, x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow64;\r\n }\r\n else {\r\n return op_Multiply(x, BigNatModule_pow64(op_Multiply(x, x), ~(~(n / 2))));\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_pow32(x_mut, n_mut) {\r\n BigNatModule_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_hash(n) {\r\n let res = 0;\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n res = ((n.digits[i] + (res << 3)) | 0);\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function BigNatModule_maxInt(a, b) {\r\n if (a < b) {\r\n return b | 0;\r\n }\r\n else {\r\n return a | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_minInt(a, b) {\r\n if (a < b) {\r\n return a | 0;\r\n }\r\n else {\r\n return b | 0;\r\n }\r\n}\r\n\r\nexport const BigNatModule_baseBits = 24;\r\n\r\nexport const BigNatModule_baseN = 16777216;\r\n\r\nexport const BigNatModule_baseMask = 16777215;\r\n\r\nexport const BigNatModule_baseNi64 = fromBits(16777216, 0, false);\r\n\r\nexport const BigNatModule_baseMaski64 = fromBits(16777215, 0, false);\r\n\r\nexport const BigNatModule_baseMaskU = fromBits(16777215, 0, true);\r\n\r\nexport const BigNatModule_baseMask32A = 16777215;\r\n\r\nexport const BigNatModule_baseMask32B = 255;\r\n\r\nexport const BigNatModule_baseShift32B = 24;\r\n\r\nexport const BigNatModule_baseMask64A = 16777215;\r\n\r\nexport const BigNatModule_baseMask64B = 16777215;\r\n\r\nexport const BigNatModule_baseMask64C = 65535;\r\n\r\nexport const BigNatModule_baseShift64B = 24;\r\n\r\nexport const BigNatModule_baseShift64C = 48;\r\n\r\nexport function BigNatModule_divbase(x) {\r\n return ~(~((x >>> 0) >>> BigNatModule_baseBits));\r\n}\r\n\r\nexport function BigNatModule_modbase(x) {\r\n return x & BigNatModule_baseMask;\r\n}\r\n\r\nexport function BigNatModule_createN(b) {\r\n return new BigNat(b, new Int32Array(b));\r\n}\r\n\r\nexport function BigNatModule_copyN(x) {\r\n return new BigNat(x.bound, copy(x.digits));\r\n}\r\n\r\nexport function BigNatModule_normN(n) {\r\n const findLeastBound = (na_mut, i_mut) => {\r\n findLeastBound:\r\n while (true) {\r\n const na = na_mut, i = i_mut;\r\n if ((i === -1) ? true : (na[i] !== 0)) {\r\n return (i + 1) | 0;\r\n }\r\n else {\r\n na_mut = na;\r\n i_mut = (i - 1);\r\n continue findLeastBound;\r\n }\r\n break;\r\n }\r\n };\r\n const bound = findLeastBound(n.digits, n.bound - 1) | 0;\r\n n.bound = (bound | 0);\r\n return n;\r\n}\r\n\r\nexport const BigNatModule_boundInt = 2;\r\n\r\nexport const BigNatModule_boundInt64 = 3;\r\n\r\nexport const BigNatModule_boundBase = 1;\r\n\r\nexport function BigNatModule_embed(x) {\r\n const x_1 = ((x < 0) ? 0 : x) | 0;\r\n if (x_1 < BigNatModule_baseN) {\r\n const r = BigNatModule_createN(1);\r\n r.digits[0] = (x_1 | 0);\r\n return BigNatModule_normN(r);\r\n }\r\n else {\r\n const r_1 = BigNatModule_createN(BigNatModule_boundInt);\r\n for (let i = 0; i <= (BigNatModule_boundInt - 1); i++) {\r\n r_1.digits[i] = (((~(~(x_1 / BigNatModule_pow32(BigNatModule_baseN, i)))) % BigNatModule_baseN) | 0);\r\n }\r\n return BigNatModule_normN(r_1);\r\n }\r\n}\r\n\r\nexport function BigNatModule_embed64(x) {\r\n const x_1 = (compare(x, fromBits(0, 0, false)) < 0) ? fromBits(0, 0, false) : x;\r\n const r = BigNatModule_createN(BigNatModule_boundInt64);\r\n for (let i = 0; i <= (BigNatModule_boundInt64 - 1); i++) {\r\n r.digits[i] = ((~(~toInt(op_Modulus(op_Division(x_1, BigNatModule_pow64(BigNatModule_baseNi64, i)), BigNatModule_baseNi64)))) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_eval32(n) {\r\n if (n.bound === 1) {\r\n return n.digits[0] | 0;\r\n }\r\n else {\r\n let acc = 0;\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = ((n.digits[i] + (BigNatModule_baseN * acc)) | 0);\r\n }\r\n return acc | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_eval64(n) {\r\n if (n.bound === 1) {\r\n return fromInteger(n.digits[0], false, 2);\r\n }\r\n else {\r\n let acc = fromBits(0, 0, false);\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = op_Addition(fromInteger(n.digits[i], false, 2), op_Multiply(BigNatModule_baseNi64, acc));\r\n }\r\n return acc;\r\n }\r\n}\r\n\r\nexport const BigNatModule_one = BigNatModule_embed(1);\r\n\r\nexport const BigNatModule_zero = BigNatModule_embed(0);\r\n\r\nexport function BigNatModule_restrictTo(d, n) {\r\n return new BigNat(BigNatModule_minInt(d, n.bound), n.digits);\r\n}\r\n\r\nexport function BigNatModule_shiftUp(d, n) {\r\n const m = BigNatModule_createN(n.bound + d);\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n m.digits[i + d] = (n.digits[i] | 0);\r\n }\r\n return m;\r\n}\r\n\r\nexport function BigNatModule_shiftDown(d, n) {\r\n if ((n.bound - d) <= 0) {\r\n return BigNatModule_zero;\r\n }\r\n else {\r\n const m = BigNatModule_createN(n.bound - d);\r\n for (let i = 0; i <= (m.bound - 1); i++) {\r\n m.digits[i] = (n.digits[i + d] | 0);\r\n }\r\n return m;\r\n }\r\n}\r\n\r\nexport function BigNatModule_degree(n) {\r\n return n.bound - 1;\r\n}\r\n\r\nexport function BigNatModule_addP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_addP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) + ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_addP;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_add(p, q) {\r\n const rbound = (1 + BigNatModule_maxInt(p.bound, q.bound)) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n BigNatModule_addP(0, rbound, 0, p, q, r);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_subP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_subP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) - ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n if (x > 0) {\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n else {\r\n const x_1 = (x + BigNatModule_baseN) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x_1) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = (BigNatModule_divbase(x_1) - 1);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n }\r\n else {\r\n return c !== 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_sub(p, q) {\r\n const rbound = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n if (BigNatModule_subP(0, rbound, 0, p, q, r)) {\r\n return BigNatModule_embed(0);\r\n }\r\n else {\r\n return BigNatModule_normN(r);\r\n }\r\n}\r\n\r\nexport function BigNatModule_isZero(p) {\r\n return p.bound === 0;\r\n}\r\n\r\nexport function BigNatModule_IsZero(p) {\r\n return BigNatModule_isZero(p);\r\n}\r\n\r\nexport function BigNatModule_isOne(p) {\r\n if (p.bound === 1) {\r\n return p.digits[0] === 1;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_equal(p, q) {\r\n if (p.bound === q.bound) {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return true;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_shiftCompare(p, pn, q, qn) {\r\n if ((p.bound + pn) < (q.bound + qn)) {\r\n return -1;\r\n }\r\n else if ((p.bound + pn) > (q.bound + pn)) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else {\r\n const pai = ((i < pn) ? 0 : pa[i - pn]) | 0;\r\n const qai = ((i < qn) ? 0 : qa[i - qn]) | 0;\r\n if (pai === qai) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pai < qai) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, (p.bound + pn) - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_compare(p, q) {\r\n if (p.bound < q.bound) {\r\n return -1;\r\n }\r\n else if (p.bound > q.bound) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pa[i] < qa[i]) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_lt(p, q) {\r\n return BigNatModule_compare(p, q) === -1;\r\n}\r\n\r\nexport function BigNatModule_gt(p, q) {\r\n return BigNatModule_compare(p, q) === 1;\r\n}\r\n\r\nexport function BigNatModule_lte(p, q) {\r\n return BigNatModule_compare(p, q) !== 1;\r\n}\r\n\r\nexport function BigNatModule_gte(p, q) {\r\n return BigNatModule_compare(p, q) !== -1;\r\n}\r\n\r\nexport function BigNatModule_min(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return a;\r\n }\r\n else {\r\n return b;\r\n }\r\n}\r\n\r\nexport function BigNatModule_max(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return b;\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n\r\nexport function BigNatModule_contributeArr(a_mut, i_mut, c_mut) {\r\n BigNatModule_contributeArr:\r\n while (true) {\r\n const a = a_mut, i = i_mut, c = c_mut;\r\n const x = op_Addition(fromInteger(a[i], false, 2), c);\r\n const c_1 = op_Division(x, BigNatModule_baseNi64);\r\n const x_3 = (~(~toInt(op_BitwiseAnd(x, BigNatModule_baseMaski64)))) | 0;\r\n a[i] = (x_3 | 0);\r\n if (compare(c_1, fromBits(0, 0, false)) > 0) {\r\n a_mut = a;\r\n i_mut = (i + 1);\r\n c_mut = c_1;\r\n continue BigNatModule_contributeArr;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_scale(k, p) {\r\n const r = BigNatModule_createN(p.bound + BigNatModule_boundInt);\r\n const k_1 = fromInteger(k, false, 2);\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n BigNatModule_contributeArr(r.digits, i, op_Multiply(k_1, fromInteger(p.digits[i], false, 2)));\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookBothSmall(p, q) {\r\n const r = BigNatModule_createN(2);\r\n const rak = op_Multiply(fromInteger(p, false, 2), fromInteger(q, false, 2));\r\n BigNatModule_setCoeff(r, 0, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n BigNatModule_setCoeff(r, 1, ~(~toInt(op_Division(rak, BigNatModule_baseNi64))));\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookCarry(r_mut, c_mut, k_mut) {\r\n BigNatModule_mulSchoolBookCarry:\r\n while (true) {\r\n const r = r_mut, c = c_mut, k = k_mut;\r\n if (compare(c, fromBits(0, 0, false)) > 0) {\r\n const rak = op_Addition(BigNatModule_coeff64(r, k), c);\r\n BigNatModule_setCoeff(r, k, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n r_mut = r;\r\n c_mut = op_Division(rak, BigNatModule_baseNi64);\r\n k_mut = (k + 1);\r\n continue BigNatModule_mulSchoolBookCarry;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookOneSmall(p, q) {\r\n const bp = BigNatModule_bound(p) | 0;\r\n const r = BigNatModule_createN(bp + 1);\r\n const q_1 = fromInteger(q, false, 2);\r\n let c = fromBits(0, 0, false);\r\n for (let i = 0; i <= (bp - 1); i++) {\r\n const rak = op_Addition(op_Addition(c, BigNatModule_coeff64(r, i)), op_Multiply(BigNatModule_coeff64(p, i), q_1));\r\n BigNatModule_setCoeff(r, i, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, bp);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookNeitherSmall(p, q) {\r\n const r = BigNatModule_createN(p.bound + q.bound);\r\n const ra = r.digits;\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n const pai = fromInteger(p.digits[i], false, 2);\r\n let c = fromBits(0, 0, false);\r\n let k = i;\r\n for (let j = 0; j <= (q.bound - 1); j++) {\r\n const qaj = fromInteger(q.digits[j], false, 2);\r\n const rak = op_Addition(op_Addition(fromInteger(ra[k], false, 2), c), op_Multiply(pai, qaj));\r\n ra[k] = ((~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64)))) | 0);\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n k = ((k + 1) | 0);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, k);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBook(p, q) {\r\n const pSmall = BigNatModule_bound(p) === 1;\r\n const qSmall = BigNatModule_bound(q) === 1;\r\n if (pSmall && qSmall) {\r\n return BigNatModule_mulSchoolBookBothSmall(BigNatModule_coeff(p, 0), BigNatModule_coeff(q, 0));\r\n }\r\n else if (pSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(q, BigNatModule_coeff(p, 0));\r\n }\r\n else if (qSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(p, BigNatModule_coeff(q, 0));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBookNeitherSmall(p, q);\r\n }\r\n}\r\n\r\nexport class BigNatModule_encoding extends Record {\r\n constructor(bigL, twoToBigL, k, bigK, bigN, split, splits) {\r\n super();\r\n this.bigL = (bigL | 0);\r\n this.twoToBigL = (twoToBigL | 0);\r\n this.k = (k | 0);\r\n this.bigK = (bigK | 0);\r\n this.bigN = (bigN | 0);\r\n this.split = (split | 0);\r\n this.splits = splits;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encoding$reflection() {\r\n return record_type(\"BigInt.BigNatModule.encoding\", [], BigNatModule_encoding, () => [[\"bigL\", int32_type], [\"twoToBigL\", int32_type], [\"k\", int32_type], [\"bigK\", int32_type], [\"bigN\", int32_type], [\"split\", int32_type], [\"splits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_mkEncoding(bigL, k, bigK, bigN) {\r\n return new BigNatModule_encoding(bigL, BigNatModule_pow32(2, bigL), k, bigK, bigN, ~(~(BigNatModule_baseBits / bigL)), initialize(~(~(BigNatModule_baseBits / bigL)), (i) => BigNatModule_pow32(2, bigL * i), Int32Array));\r\n}\r\n\r\nexport const BigNatModule_table = [BigNatModule_mkEncoding(1, 28, 268435456, 268435456), BigNatModule_mkEncoding(2, 26, 67108864, 134217728), BigNatModule_mkEncoding(3, 24, 16777216, 50331648), BigNatModule_mkEncoding(4, 22, 4194304, 16777216), BigNatModule_mkEncoding(5, 20, 1048576, 5242880), BigNatModule_mkEncoding(6, 18, 262144, 1572864), BigNatModule_mkEncoding(7, 16, 65536, 458752), BigNatModule_mkEncoding(8, 14, 16384, 131072), BigNatModule_mkEncoding(9, 12, 4096, 36864), BigNatModule_mkEncoding(10, 10, 1024, 10240), BigNatModule_mkEncoding(11, 8, 256, 2816), BigNatModule_mkEncoding(12, 6, 64, 768), BigNatModule_mkEncoding(13, 4, 16, 208)];\r\n\r\nexport function BigNatModule_calculateTableTow(bigL) {\r\n const k = (BigNatModule_FFT_maxBitsInsideFp - (2 * bigL)) | 0;\r\n const bigK = BigNatModule_pow64(fromBits(2, 0, false), k);\r\n return [bigL, k, bigK, op_Multiply(bigK, fromInteger(bigL, false, 2))];\r\n}\r\n\r\nexport function BigNatModule_encodingGivenResultBits(bitsRes) {\r\n const selectFrom = (i_mut) => {\r\n selectFrom:\r\n while (true) {\r\n const i = i_mut;\r\n if (((i + 1) < BigNatModule_table.length) && (bitsRes < BigNatModule_table[i + 1].bigN)) {\r\n i_mut = (i + 1);\r\n continue selectFrom;\r\n }\r\n else {\r\n return BigNatModule_table[i];\r\n }\r\n break;\r\n }\r\n };\r\n if (bitsRes >= BigNatModule_table[0].bigN) {\r\n throw (new Error(\"Product is huge, around 268435456 bits, beyond quickmul\"));\r\n }\r\n else {\r\n return selectFrom(0);\r\n }\r\n}\r\n\r\nexport const BigNatModule_bitmask = initialize(BigNatModule_baseBits, (i) => (BigNatModule_pow32(2, i) - 1), Int32Array);\r\n\r\nexport const BigNatModule_twopowers = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow32(2, i), Int32Array);\r\n\r\nexport const BigNatModule_twopowersI64 = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow64(fromBits(2, 0, false), i));\r\n\r\nexport function BigNatModule_wordBits(word) {\r\n const hi = (k_mut) => {\r\n hi:\r\n while (true) {\r\n const k = k_mut;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n else if ((word & BigNatModule_twopowers[k - 1]) !== 0) {\r\n return k | 0;\r\n }\r\n else {\r\n k_mut = (k - 1);\r\n continue hi;\r\n }\r\n break;\r\n }\r\n };\r\n return hi(BigNatModule_baseBits) | 0;\r\n}\r\n\r\nexport function BigNatModule_bits(u) {\r\n if (u.bound === 0) {\r\n return 0;\r\n }\r\n else {\r\n return ((BigNatModule_degree(u) * BigNatModule_baseBits) + BigNatModule_wordBits(u.digits[BigNatModule_degree(u)])) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_extractBits(n, enc, bi) {\r\n let z, i, z_1, i_1, z_2, i_2;\r\n const biw = (~(~(bi / BigNatModule_baseBits))) | 0;\r\n const bjw = (~(~(((bi + enc.bigL) - 1) / BigNatModule_baseBits))) | 0;\r\n if (biw !== bjw) {\r\n const xbit = (bi % BigNatModule_baseBits) | 0;\r\n return (((((z = n, (i = (biw | 0), (i < z.bound) ? z.digits[i] : 0))) >> xbit) | (((z_1 = n, (i_1 = (bjw | 0), (i_1 < z_1.bound) ? z_1.digits[i_1] : 0))) << (BigNatModule_baseBits - xbit))) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n else {\r\n return ((((z_2 = n, (i_2 = (biw | 0), (i_2 < z_2.bound) ? z_2.digits[i_2] : 0))) >> (bi % BigNatModule_baseBits)) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encodePoly(enc, n) {\r\n const poly = fill(new Uint32Array(enc.bigK), 0, enc.bigK, BigNatModule_FFT_Fp_ofInt32(0));\r\n const biMax = (n.bound * BigNatModule_baseBits) | 0;\r\n const encoder = (i_mut, bi_mut) => {\r\n encoder:\r\n while (true) {\r\n const i = i_mut, bi = bi_mut;\r\n if ((i === enc.bigK) ? true : (bi > biMax)) {\r\n }\r\n else {\r\n const pi = BigNatModule_extractBits(n, enc, bi) | 0;\r\n poly[i] = BigNatModule_FFT_Fp_ofInt32(pi);\r\n i_mut = (i + 1);\r\n bi_mut = (bi + enc.bigL);\r\n continue encoder;\r\n }\r\n break;\r\n }\r\n };\r\n encoder(0, 0);\r\n return poly;\r\n}\r\n\r\nexport function BigNatModule_decodeResultBits(enc, poly) {\r\n let n = 0;\r\n for (let i = 0; i <= (poly.length - 1); i++) {\r\n if (poly[i] !== BigNatModule_FFT_mzero) {\r\n n = (i | 0);\r\n }\r\n }\r\n return (((BigNatModule_FFT_maxBitsInsideFp + (enc.bigL * n)) + 1) + 1) | 0;\r\n}\r\n\r\nexport function BigNatModule_decodePoly(enc, poly) {\r\n const rbound = ((~(~(BigNatModule_decodeResultBits(enc, poly) / BigNatModule_baseBits))) + 1) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n const evaluate = (i_mut, j_mut, d_mut) => {\r\n evaluate:\r\n while (true) {\r\n const i = i_mut, j = j_mut, d = d_mut;\r\n if (i === enc.bigK) {\r\n }\r\n else {\r\n if (j >= rbound) {\r\n }\r\n else {\r\n BigNatModule_contributeArr(r.digits, j, op_Multiply(fromInteger(BigNatModule_FFT_Fp_toInt(poly[i]), false, 2), BigNatModule_twopowersI64[d]));\r\n }\r\n const d_1 = (d + enc.bigL) | 0;\r\n const patternInput = (d_1 >= BigNatModule_baseBits) ? [j + 1, d_1 - BigNatModule_baseBits] : [j, d_1];\r\n i_mut = (i + 1);\r\n j_mut = patternInput[0];\r\n d_mut = patternInput[1];\r\n continue evaluate;\r\n }\r\n break;\r\n }\r\n };\r\n evaluate(0, 0, 0);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_quickMulUsingFft(u, v) {\r\n const enc = BigNatModule_encodingGivenResultBits(BigNatModule_bits(u) + BigNatModule_bits(v));\r\n return BigNatModule_normN(BigNatModule_decodePoly(enc, BigNatModule_FFT_computeFftPaddedPolynomialProduct(enc.bigK, enc.k, BigNatModule_encodePoly(enc, u), BigNatModule_encodePoly(enc, v))));\r\n}\r\n\r\nexport const BigNatModule_minDigitsKaratsuba = 16;\r\n\r\nexport function BigNatModule_recMulKaratsuba(mul, p, q) {\r\n const bmax = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n if (bmax > BigNatModule_minDigitsKaratsuba) {\r\n const k = (~(~(bmax / 2))) | 0;\r\n const a0 = BigNatModule_restrictTo(k, p);\r\n const a1 = BigNatModule_shiftDown(k, p);\r\n const b0 = BigNatModule_restrictTo(k, q);\r\n const b1 = BigNatModule_shiftDown(k, q);\r\n const q0 = mul(a0, b0);\r\n const q1 = mul(BigNatModule_add(a0, a1), BigNatModule_add(b0, b1));\r\n const q2 = mul(a1, b1);\r\n return BigNatModule_add(q0, BigNatModule_shiftUp(k, BigNatModule_add(BigNatModule_sub(q1, BigNatModule_add(q0, q2)), BigNatModule_shiftUp(k, q2))));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulKaratsuba(x, y) {\r\n return BigNatModule_recMulKaratsuba((x_1, y_1) => BigNatModule_mulKaratsuba(x_1, y_1), x, y);\r\n}\r\n\r\nexport const BigNatModule_productDigitsUpperSchoolBook = ~(~(64000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_singleDigitForceSchoolBook = ~(~(32000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_productDigitsUpperFft = ~(~(BigNatModule_table[0].bigN / BigNatModule_baseBits));\r\n\r\nexport function BigNatModule_mul(p, q) {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n}\r\n\r\nexport function BigNatModule_scaleSubInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo <= x_1[j + n]) {\r\n x_1[j + n] = ((x_1[j + n] - zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((x_1[j + n] + (BigNatModule_baseN - zLo)) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleSub(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleSubInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_scaleAddInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo < (BigNatModule_baseN - x_1[j + n])) {\r\n x_1[j + n] = ((x_1[j + n] + zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((zLo - (BigNatModule_baseN - x_1[j + n])) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleAdd(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleAddInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_removeFactor(x, a, n) {\r\n const patternInput = [BigNatModule_degree(a), BigNatModule_degree(x)];\r\n const degx = patternInput[1] | 0;\r\n const dega = patternInput[0] | 0;\r\n if (degx < (dega + n)) {\r\n return 0;\r\n }\r\n else {\r\n const patternInput_1 = [a.digits, x.digits];\r\n const xa = patternInput_1[1];\r\n const aa = patternInput_1[0];\r\n const f = ((dega === 0) ? ((degx === n) ? (~(~(xa[n] / aa[0]))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), fromInteger(aa[0], false, 2)))))) : ((degx === (dega + n)) ? (~(~(xa[degx] / (aa[dega] + 1)))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), op_Addition(fromInteger(aa[dega], false, 2), fromBits(1, 0, false)))))))) | 0;\r\n if (f === 0) {\r\n if (BigNatModule_shiftCompare(a, n, x, 0) !== 1) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return f | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_divmod(b, a) {\r\n if (BigNatModule_isZero(a)) {\r\n throw (new Error());\r\n }\r\n else if (BigNatModule_degree(b) < BigNatModule_degree(a)) {\r\n return [BigNatModule_zero, b];\r\n }\r\n else {\r\n const x = BigNatModule_copyN(b);\r\n const d = BigNatModule_createN(((BigNatModule_degree(b) - BigNatModule_degree(a)) + 1) + 1);\r\n let p = BigNatModule_degree(b);\r\n const m = BigNatModule_degree(a) | 0;\r\n let n = p - m;\r\n const Invariant = (tupledArg) => {\r\n };\r\n let finished = false;\r\n while (!finished) {\r\n Invariant([d, x, n, p]);\r\n const f = BigNatModule_removeFactor(x, a, n) | 0;\r\n if (f > 0) {\r\n BigNatModule_scaleSubInPlace(x, f, a, n);\r\n BigNatModule_scaleAddInPlace(d, f, BigNatModule_one, n);\r\n Invariant([d, x, n, p]);\r\n }\r\n else {\r\n finished = ((f === 0) && (n === 0));\r\n if (!finished) {\r\n if (p === (m + n)) {\r\n Invariant([d, x, n - 1, p]);\r\n n = ((n - 1) | 0);\r\n }\r\n else {\r\n Invariant([d, x, n - 1, p - 1]);\r\n n = ((n - 1) | 0);\r\n p = ((p - 1) | 0);\r\n }\r\n }\r\n }\r\n }\r\n return [BigNatModule_normN(d), BigNatModule_normN(x)];\r\n }\r\n}\r\n\r\nexport function BigNatModule_div(b, a) {\r\n return BigNatModule_divmod(b, a)[0];\r\n}\r\n\r\nexport function BigNatModule_rem(b, a) {\r\n return BigNatModule_divmod(b, a)[1];\r\n}\r\n\r\nexport function BigNatModule_bitAnd(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_minInt(a.bound, b.bound));\r\n for (let i = 0; i <= (r.bound - 1); i++) {\r\n r.digits[i] = ((a.digits[i] & b.digits[i]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitOr(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] | a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] | b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitXor(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] ^ a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] ^ b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_hcf(a, b) {\r\n const hcfloop = (a_1_mut, b_1_mut) => {\r\n hcfloop:\r\n while (true) {\r\n const a_1 = a_1_mut, b_1 = b_1_mut;\r\n if (BigNatModule_equal(BigNatModule_zero, a_1)) {\r\n return b_1;\r\n }\r\n else {\r\n a_1_mut = BigNatModule_divmod(b_1, a_1)[1];\r\n b_1_mut = a_1;\r\n continue hcfloop;\r\n }\r\n break;\r\n }\r\n };\r\n if (BigNatModule_lt(a, b)) {\r\n return hcfloop(a, b);\r\n }\r\n else {\r\n return hcfloop(b, a);\r\n }\r\n}\r\n\r\nexport const BigNatModule_two = BigNatModule_embed(2);\r\n\r\nexport function BigNatModule_powi(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (n_1 === 0) {\r\n return acc;\r\n }\r\n else if ((n_1 % 2) === 0) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_pow(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (BigNatModule_isZero(n_1)) {\r\n return acc;\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(n_1, BigNatModule_two);\r\n const ndiv2 = patternInput[0];\r\n if (BigNatModule_isZero(patternInput[1])) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_toFloat(n) {\r\n const evalFloat = (acc_mut, k_mut, i_mut) => {\r\n evalFloat:\r\n while (true) {\r\n const acc = acc_mut, k = k_mut, i = i_mut;\r\n if (i === n.bound) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = (acc + (k * n.digits[i]));\r\n k_mut = (k * BigNatModule_baseN);\r\n i_mut = (i + 1);\r\n continue evalFloat;\r\n }\r\n break;\r\n }\r\n };\r\n return evalFloat(0, 1, 0);\r\n}\r\n\r\nexport function BigNatModule_ofInt32(n) {\r\n return BigNatModule_embed(n);\r\n}\r\n\r\nexport function BigNatModule_ofInt64(n) {\r\n return BigNatModule_embed64(n);\r\n}\r\n\r\nexport function BigNatModule_toUInt32(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n const value = n.digits[0] | 0;\r\n return value >>> 0;\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n const xB = patternInput[1] | 0;\r\n if (xB > BigNatModule_baseMask32B) {\r\n throw (new Error());\r\n }\r\n return ((patternInput[0] & BigNatModule_baseMask32A) >>> 0) + ((((xB & BigNatModule_baseMask32B) >>> 0) << BigNatModule_baseShift32B) >>> 0);\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toUInt64(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return fromBits(0, 0, true);\r\n }\r\n case 1: {\r\n return fromInteger(n.digits[0], true, 2);\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n return op_Addition(fromInteger(patternInput[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B));\r\n }\r\n case 3: {\r\n const patternInput_1 = [n.digits[0], n.digits[1], n.digits[2]];\r\n const xC = patternInput_1[2] | 0;\r\n if (xC > BigNatModule_baseMask64C) {\r\n throw (new Error());\r\n }\r\n return op_Addition(op_Addition(fromInteger(patternInput_1[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput_1[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B)), op_LeftShift(fromInteger(xC & BigNatModule_baseMask64C, true, 2), BigNatModule_baseShift64C));\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toString(n) {\r\n const degn = BigNatModule_degree(n) | 0;\r\n const route = (prior_mut, k_mut, ten2k_mut) => {\r\n route:\r\n while (true) {\r\n const prior = prior_mut, k = k_mut, ten2k = ten2k_mut;\r\n if (BigNatModule_degree(ten2k) > degn) {\r\n return cons([k, ten2k], prior);\r\n }\r\n else {\r\n prior_mut = cons([k, ten2k], prior);\r\n k_mut = (k + 1);\r\n ten2k_mut = BigNatModule_mul(ten2k, ten2k);\r\n continue route;\r\n }\r\n break;\r\n }\r\n };\r\n const collect = (isLeading_mut, digits_mut, n_1_mut, _arg1_mut) => {\r\n collect:\r\n while (true) {\r\n const isLeading = isLeading_mut, digits = digits_mut, n_1 = n_1_mut, _arg1 = _arg1_mut;\r\n if (!isEmpty(_arg1)) {\r\n const prior_1 = tail(_arg1);\r\n const patternInput = BigNatModule_divmod(n_1, head(_arg1)[1]);\r\n const nL = patternInput[1];\r\n const nH = patternInput[0];\r\n if (isLeading && BigNatModule_isZero(nH)) {\r\n isLeading_mut = isLeading;\r\n digits_mut = digits;\r\n n_1_mut = nL;\r\n _arg1_mut = prior_1;\r\n continue collect;\r\n }\r\n else {\r\n isLeading_mut = isLeading;\r\n digits_mut = collect(false, digits, nL, prior_1);\r\n n_1_mut = nH;\r\n _arg1_mut = prior_1;\r\n continue collect;\r\n }\r\n }\r\n else {\r\n const n_2 = BigNatModule_eval32(n_1) | 0;\r\n if (isLeading && (n_2 === 0)) {\r\n return digits;\r\n }\r\n else {\r\n return cons(int32ToString(n_2), digits);\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n const digits_4 = collect(true, empty(), n, route(empty(), 0, BigNatModule_embed(10)));\r\n if (isEmpty(digits_4)) {\r\n return \"0\";\r\n }\r\n else {\r\n return join(\"\", toArray(digits_4));\r\n }\r\n}\r\n\r\nexport function BigNatModule_ofString(str) {\r\n const len = str.length | 0;\r\n if (isNullOrEmpty(str)) {\r\n throw (new Error(\"empty string\\\\nParameter name: str\"));\r\n }\r\n const ten = BigNatModule_embed(10);\r\n const build = (acc_mut, i_mut) => {\r\n build:\r\n while (true) {\r\n const acc = acc_mut, i = i_mut;\r\n if (i === len) {\r\n return acc;\r\n }\r\n else {\r\n const d = (str[i].charCodeAt(0) - 48) | 0;\r\n if ((0 <= d) && (d <= 9)) {\r\n acc_mut = BigNatModule_add(BigNatModule_mul(ten, acc), BigNatModule_embed(d));\r\n i_mut = (i + 1);\r\n continue build;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return build(BigNatModule_embed(0), 0);\r\n}\r\n\r\nexport function BigNatModule_isSmall(n) {\r\n return n.bound <= 1;\r\n}\r\n\r\nexport function BigNatModule_getSmall(n) {\r\n const z = n;\r\n const i = 0;\r\n if (i < z.bound) {\r\n return z.digits[i] | 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_factorial(n) {\r\n const productR = (a, b) => {\r\n if (BigNatModule_equal(a, b)) {\r\n return a;\r\n }\r\n else {\r\n const m = BigNatModule_div(BigNatModule_add(a, b), BigNatModule_ofInt32(2));\r\n return BigNatModule_mul(productR(a, m), productR(BigNatModule_add(m, BigNatModule_one), b));\r\n }\r\n };\r\n return productR(BigNatModule_one, n);\r\n}\r\n\r\n","import { BigNatModule_factorial, BigNatModule_ofString, BigNatModule_toFloat, BigNatModule_toUInt64, BigNatModule_toUInt32, BigNatModule_pow, BigNatModule_two, BigNatModule_rem, BigNatModule_lte, BigNatModule_hcf, BigNatModule_bitXor, BigNatModule_bitOr, BigNatModule_bitAnd, BigNatModule_divmod, BigNatModule_mul, BigNatModule_isOne, BigNatModule_sub, BigNatModule_gte, BigNatModule_scale, BigNatModule_one, BigNatModule_add, BigNatModule_ofInt64, BigNatModule_hash, BigNatModule_gt, BigNatModule_lt, BigNatModule_equal, BigNatModule_getSmall, BigNatModule_isSmall, BigNatModule_ofInt32, BigNatModule_toString, BigNatModule_isZero } from \"./n.js\";\r\nimport { Record, toString } from \"../Types.js\";\r\nimport { class_type } from \"../Reflection.js\";\r\nimport { initialize } from \"../Array.js\";\r\nimport { op_Addition, op_Multiply, fromValue, equals, fromBits, compare, fromInteger, op_UnaryNegation } from \"../Long.js\";\r\nimport { op_UnaryNegation_Int32 } from \"../Int32.js\";\r\nimport Decimal from \"../Decimal.js\";\r\n\r\nexport class BigInteger extends Record {\r\n constructor(signInt, v) {\r\n super();\r\n this.signInt = (signInt | 0);\r\n this.v = v;\r\n }\r\n toString() {\r\n const x = this;\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return BigNatModule_isZero(BigInteger__get_V(x)) ? \"0\" : (\"-\" + BigNatModule_toString(BigInteger__get_V(x)));\r\n }\r\n case 0: {\r\n return \"0\";\r\n }\r\n case 1: {\r\n return BigNatModule_toString(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\"));\r\n }\r\n }\r\n }\r\n Equals(obj) {\r\n const this$ = this;\r\n return (obj instanceof BigInteger) && BigInteger_op_Equality_56F059C0(this$, obj);\r\n }\r\n GetHashCode() {\r\n const x = this;\r\n return BigInteger_hash_Z665282C2(x) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return toString(this$);\r\n }\r\n CompareTo(obj) {\r\n const this$ = this;\r\n if (obj instanceof BigInteger) {\r\n return BigInteger_compare_56F059C0(this$, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"the objects are not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger$reflection() {\r\n return class_type(\"BigInt.BigInteger\", void 0, BigInteger, class_type(\"System.ValueType\"));\r\n}\r\n\r\nexport function BigInteger_$ctor_Z2BE94A1(signInt, v) {\r\n return new BigInteger(signInt, v);\r\n}\r\n\r\n(() => {\r\n BigInteger.smallLim = 4096;\r\n BigInteger.smallPosTab = initialize(BigInteger.smallLim, (n) => BigNatModule_ofInt32(n));\r\n BigInteger.one = BigInteger_$ctor_Z524259A4(1);\r\n BigInteger.two = BigInteger_$ctor_Z524259A4(2);\r\n BigInteger.zero = BigInteger_$ctor_Z524259A4(0);\r\n})();\r\n\r\nexport function BigInteger_nat_Z67CCE57D(n) {\r\n if (BigNatModule_isSmall(n) && (BigNatModule_getSmall(n) < BigInteger.smallLim)) {\r\n return BigInteger.smallPosTab[BigNatModule_getSmall(n)];\r\n }\r\n else {\r\n return n;\r\n }\r\n}\r\n\r\nexport function BigInteger_create_Z2BE94A1(s, n) {\r\n return BigInteger_$ctor_Z2BE94A1(s, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_posn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_negn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger__get_Sign(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return x.signInt | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_SignInt(x) {\r\n return x.signInt;\r\n}\r\n\r\nexport function BigInteger__get_V(x) {\r\n return x.v;\r\n}\r\n\r\nexport function BigInteger_op_Equality_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Inequality_56F059C0(x, y) {\r\n return !BigInteger_op_Equality_56F059C0(x, y);\r\n}\r\n\r\nexport function BigInteger_op_LessThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return false;\r\n }\r\n case 3: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return false;\r\n }\r\n case 7: {\r\n return false;\r\n }\r\n case 8: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 3: {\r\n return false;\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return false;\r\n }\r\n case 6: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return false;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_compare_56F059C0(n, nn) {\r\n if (BigInteger_op_LessThan_56F059C0(n, nn)) {\r\n return -1;\r\n }\r\n else if (BigInteger_op_Equality_56F059C0(n, nn)) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n\r\nexport function BigInteger_hash_Z665282C2(z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return 1;\r\n }\r\n else {\r\n return (BigInteger__get_SignInt(z) + BigNatModule_hash(BigInteger__get_V(z))) | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_StructuredDisplayString(x) {\r\n return toString(x);\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259A4(n) {\r\n if (n >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(n)));\r\n }\r\n else if (n === -2147483648) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(fromInteger(n, false, 2)))));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(op_UnaryNegation_Int32(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259C1(n) {\r\n if (compare(n, fromBits(0, 0, false)) >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(n)));\r\n }\r\n else if (equals(n, fromBits(0, 2147483648, false))) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_add(BigNatModule_ofInt64(fromBits(4294967295, 2147483647, false)), BigNatModule_one)));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_get_One() {\r\n return BigInteger.one;\r\n}\r\n\r\nexport function BigInteger_get_Two() {\r\n return BigInteger.two;\r\n}\r\n\r\nexport function BigInteger_get_Zero() {\r\n return BigInteger.zero;\r\n}\r\n\r\nexport function BigInteger_op_UnaryNegation_Z665282C2(z) {\r\n const matchValue = BigInteger__get_SignInt(z) | 0;\r\n if (matchValue === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(matchValue), BigInteger__get_V(z));\r\n }\r\n}\r\n\r\nexport function BigInteger_Scale_Z320F31E(k, z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else if (k < 0) {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(BigInteger__get_SignInt(z)), BigNatModule_scale(op_UnaryNegation_Int32(k), BigInteger__get_V(z)));\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(z), BigNatModule_scale(k, BigInteger__get_V(z)));\r\n }\r\n}\r\n\r\nexport function BigInteger_subnn_6A57060(nx, ny) {\r\n if (BigNatModule_gte(nx, ny)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_sub(nx, ny));\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_sub(ny, nx));\r\n }\r\n}\r\n\r\nexport function BigInteger_addnn_6A57060(nx, ny) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_add(nx, ny));\r\n}\r\n\r\nexport function BigInteger__get_IsZero(x) {\r\n if (BigInteger__get_SignInt(x) === 0) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsOne(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return BigNatModule_isOne(BigInteger__get_V(x));\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Addition_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return y;\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 2: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Subtraction_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(y);\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Multiply_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(y)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(x)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(y)) {\r\n return x;\r\n }\r\n else {\r\n const m = BigNatModule_mul(BigInteger__get_V(x), BigInteger__get_V(y));\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(x) * BigInteger__get_SignInt(y), m);\r\n }\r\n}\r\n\r\nexport function BigInteger_DivRem_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n throw (new Error());\r\n }\r\n if (BigInteger__get_IsZero(x)) {\r\n return [BigInteger_get_Zero(), BigInteger_get_Zero()];\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(BigInteger__get_V(x), BigInteger__get_V(y));\r\n const r = patternInput[1];\r\n const d = patternInput[0];\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 1: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 2: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 3: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Division_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[0];\r\n}\r\n\r\nexport function BigInteger_op_Modulus_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[1];\r\n}\r\n\r\nexport function BigInteger_op_RightShift_62E082A2(x, y) {\r\n return BigInteger_op_Division_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_LeftShift_62E082A2(x, y) {\r\n return BigInteger_op_Multiply_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseAnd_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitAnd(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitOr(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_ExclusiveOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitXor(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_GreatestCommonDivisor_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n if (matchValue[0] === 0) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(y));\r\n }\r\n }\r\n else if (matchValue[1] === 0) {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(x));\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_hcf(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsNegative(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsPositive(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_Abs_Z665282C2(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(x);\r\n }\r\n else {\r\n return x;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_LessThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n return true;\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 6: {\r\n return true;\r\n }\r\n case 7: {\r\n return true;\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return true;\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return true;\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 8: {\r\n return true;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_Pow_62E082A2(x, y) {\r\n if (y < 0) {\r\n throw (new Error(\"y\"));\r\n }\r\n const matchValue = [BigInteger__get_IsZero(x), y];\r\n if (matchValue[0]) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_One();\r\n }\r\n else {\r\n return BigInteger_get_Zero();\r\n }\r\n }\r\n else {\r\n const yval = BigInteger_$ctor_Z524259A4(y);\r\n return BigInteger_create_Z2BE94A1(BigNatModule_isZero(BigNatModule_rem(BigInteger__get_V(yval), BigNatModule_two)) ? 1 : BigInteger__get_SignInt(x), BigNatModule_pow(BigInteger__get_V(x), BigInteger__get_V(yval)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n const u = BigNatModule_toUInt32(BigInteger__get_V(x));\r\n if (u <= (2147483647 >>> 0)) {\r\n return (BigInteger__get_SignInt(x) * (~(~u))) | 0;\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && (u === ((2147483647 + 1) >>> 0))) {\r\n return -2147483648;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return BigNatModule_toUInt32(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, false);\r\n }\r\n else {\r\n const u = BigNatModule_toUInt64(BigInteger__get_V(x));\r\n if (compare(u, fromValue(fromBits(4294967295, 2147483647, false), true)) <= 0) {\r\n return op_Multiply(fromInteger(BigInteger__get_SignInt(x), false, 2), fromValue(u, false));\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && equals(u, fromValue(op_Addition(fromBits(4294967295, 2147483647, false), fromBits(1, 0, false)), true))) {\r\n return fromBits(0, 2147483648, false);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, true);\r\n }\r\n else {\r\n return BigNatModule_toUInt64(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToDouble(x) {\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return -BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n return BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToSByte(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x80 & 0xFF) - 0x80;\r\n}\r\n\r\nexport function BigInteger__get_ToByte(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFF;\r\n}\r\n\r\nexport function BigInteger__get_ToInt16(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x8000 & 0xFFFF) - 0x8000;\r\n}\r\n\r\nexport function BigInteger__get_ToUInt16(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFFFF;\r\n}\r\n\r\nexport function BigInteger__get_ToSingle(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function BigInteger__get_ToDecimal(x) {\r\n return new Decimal(BigInteger__get_ToDouble(x));\r\n}\r\n\r\nexport function BigInteger_Parse_Z721C83C5(text) {\r\n if (text == null) {\r\n throw (new Error(\"text\"));\r\n }\r\n const text_1 = text.trim();\r\n const len = text_1.length | 0;\r\n if (len === 0) {\r\n throw (new Error());\r\n }\r\n const matchValue = [text_1[0], len];\r\n if (matchValue[0] === \"+\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else if (matchValue[0] === \"-\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsSmall(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isSmall(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger_Factorial_Z665282C2(x) {\r\n if (BigInteger__get_IsNegative(x)) {\r\n throw (new Error(\"mustBeNonNegative\\\\nParameter name: x\"));\r\n }\r\n if (BigInteger__get_IsPositive(x)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_factorial(BigInteger__get_V(x)));\r\n }\r\n else {\r\n return BigInteger_get_One();\r\n }\r\n}\r\n\r\nexport function BigInteger_op_UnaryPlus_Z665282C2(n1) {\r\n return n1;\r\n}\r\n\r\nexport function BigInteger_FromInt64_Z524259C1(x) {\r\n return BigInteger_$ctor_Z524259C1(x);\r\n}\r\n\r\nexport function BigInteger_FromInt32_Z524259A4(x) {\r\n return BigInteger_$ctor_Z524259A4(x);\r\n}\r\n\r\n","import { BigInteger_op_Inequality_56F059C0, BigInteger_op_Equality_56F059C0, BigInteger_op_GreaterThanOrEqual_56F059C0, BigInteger_op_GreaterThan_56F059C0, BigInteger_op_LessThanOrEqual_56F059C0, BigInteger_op_LessThan_56F059C0, BigInteger_op_ExclusiveOr_56F059C0, BigInteger_op_BitwiseOr_56F059C0, BigInteger_op_BitwiseAnd_56F059C0, BigInteger_op_LeftShift_62E082A2, BigInteger_op_RightShift_62E082A2, BigInteger_op_UnaryPlus_Z665282C2, BigInteger_op_UnaryNegation_Z665282C2, BigInteger_op_Modulus_56F059C0, BigInteger_op_Division_56F059C0, BigInteger_op_Multiply_56F059C0, BigInteger_op_Subtraction_56F059C0, BigInteger_op_Addition_56F059C0, BigInteger__get_IsOne, BigInteger__get_IsZero, BigInteger__get_Sign, BigInteger__get_ToDecimal, BigInteger__get_ToDouble, BigInteger__get_ToSingle, BigInteger__get_ToUInt64, BigInteger__get_ToInt64, BigInteger__get_ToUInt32, BigInteger__get_ToInt32, BigInteger__get_ToUInt16, BigInteger__get_ToInt16, BigInteger__get_ToByte, BigInteger__get_ToSByte, BigInteger_$ctor_Z524259A4, BigInteger_$ctor_Z524259C1, BigInteger_get_Two, BigInteger_get_One, BigInteger_get_Zero, BigInteger_Abs_Z665282C2, BigInteger_Pow_62E082A2, BigInteger_GreatestCommonDivisor_56F059C0, BigInteger_DivRem_56F059C0, BigInteger_Parse_Z721C83C5, BigInteger } from \"./BigInt/z.js\";\r\nimport { fromInteger } from \"./Long.js\";\r\nimport { comparePrimitives, min, compare as compare_1, equals as equals_1, safeHash } from \"./Util.js\";\r\nimport { toString as toString_1 } from \"./Types.js\";\r\nimport { fold, empty, ofArrayWithTail, cons, toArray, head, skipWhile } from \"./List.js\";\r\nimport { fill, reverse } from \"./Array.js\";\r\n\r\nexport function isBigInt(x) {\r\n return x instanceof BigInteger;\r\n}\r\n\r\nexport function tryParse(str, res) {\r\n try {\r\n res.contents = BigInteger_Parse_Z721C83C5(str);\r\n return true;\r\n }\r\n catch (matchValue) {\r\n return false;\r\n }\r\n}\r\n\r\nexport function divRem(x, y, remainder) {\r\n const patternInput = BigInteger_DivRem_56F059C0(x, y);\r\n remainder.contents = patternInput[1];\r\n return patternInput[0];\r\n}\r\n\r\nexport function parse(arg00) {\r\n return BigInteger_Parse_Z721C83C5(arg00);\r\n}\r\n\r\nexport function greatestCommonDivisor(arg00, arg01) {\r\n return BigInteger_GreatestCommonDivisor_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function pow(arg00, arg01) {\r\n return BigInteger_Pow_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function abs(arg00) {\r\n return BigInteger_Abs_Z665282C2(arg00);\r\n}\r\n\r\nexport const zero = BigInteger_get_Zero();\r\n\r\nexport const one = BigInteger_get_One();\r\n\r\nexport const two = BigInteger_get_Two();\r\n\r\nexport function fromString(s) {\r\n return BigInteger_Parse_Z721C83C5(s);\r\n}\r\n\r\nexport function fromZero() {\r\n return BigInteger_get_Zero();\r\n}\r\n\r\nexport function fromOne() {\r\n return BigInteger_get_One();\r\n}\r\n\r\nexport function fromInt64(i) {\r\n return BigInteger_$ctor_Z524259C1(i);\r\n}\r\n\r\nexport function fromInt32(i) {\r\n if (i > 2147483647) {\r\n return BigInteger_$ctor_Z524259C1(fromInteger(i, false, 6));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z524259A4(i);\r\n }\r\n}\r\n\r\nexport function toSByte(x) {\r\n return BigInteger__get_ToSByte(x);\r\n}\r\n\r\nexport function toByte(x) {\r\n return BigInteger__get_ToByte(x);\r\n}\r\n\r\nexport function toInt16(x) {\r\n return BigInteger__get_ToInt16(x);\r\n}\r\n\r\nexport function toUInt16(x) {\r\n return BigInteger__get_ToUInt16(x);\r\n}\r\n\r\nexport function toInt32(x) {\r\n return BigInteger__get_ToInt32(x);\r\n}\r\n\r\nexport function toUInt32(x) {\r\n return BigInteger__get_ToUInt32(x);\r\n}\r\n\r\nexport function toInt64(x) {\r\n return BigInteger__get_ToInt64(x);\r\n}\r\n\r\nexport function toUInt64(x) {\r\n return BigInteger__get_ToUInt64(x);\r\n}\r\n\r\nexport function toSingle(x) {\r\n return BigInteger__get_ToSingle(x);\r\n}\r\n\r\nexport function toDouble(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function toDecimal(x) {\r\n return BigInteger__get_ToDecimal(x);\r\n}\r\n\r\nexport function sign(x) {\r\n return BigInteger__get_Sign(x);\r\n}\r\n\r\nexport function isZero(x) {\r\n return BigInteger__get_IsZero(x);\r\n}\r\n\r\nexport function isOne(x) {\r\n return BigInteger__get_IsOne(x);\r\n}\r\n\r\nexport function hash(x) {\r\n return safeHash(x);\r\n}\r\n\r\nexport function compare(x, y) {\r\n return x.CompareTo(y);\r\n}\r\n\r\nexport function equals(x, y) {\r\n return equals_1(x, y);\r\n}\r\n\r\nexport function toString(x) {\r\n return toString_1(x);\r\n}\r\n\r\nexport const get_Zero = BigInteger_get_Zero();\r\n\r\nexport const get_One = BigInteger_get_One();\r\n\r\nexport function op_Addition(arg00, arg01) {\r\n return BigInteger_op_Addition_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Subtraction(arg00, arg01) {\r\n return BigInteger_op_Subtraction_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Multiply(arg00, arg01) {\r\n return BigInteger_op_Multiply_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Division(arg00, arg01) {\r\n return BigInteger_op_Division_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Modulus(arg00, arg01) {\r\n return BigInteger_op_Modulus_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_UnaryNegation(arg00) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(arg00);\r\n}\r\n\r\nexport function op_UnaryPlus(arg00) {\r\n return BigInteger_op_UnaryPlus_Z665282C2(arg00);\r\n}\r\n\r\nexport function op_RightShift(arg00, arg01) {\r\n return BigInteger_op_RightShift_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function op_LeftShift(arg00, arg01) {\r\n return BigInteger_op_LeftShift_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function op_BitwiseAnd(arg00, arg01) {\r\n return BigInteger_op_BitwiseAnd_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_BitwiseOr(arg00, arg01) {\r\n return BigInteger_op_BitwiseOr_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_ExclusiveOr(arg00, arg01) {\r\n return BigInteger_op_ExclusiveOr_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_LessThan(arg00, arg01) {\r\n return BigInteger_op_LessThan_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_LessThanOrEqual(arg00, arg01) {\r\n return BigInteger_op_LessThanOrEqual_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_GreaterThan(arg00, arg01) {\r\n return BigInteger_op_GreaterThan_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_GreaterThanOrEqual(arg00, arg01) {\r\n return BigInteger_op_GreaterThanOrEqual_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Equality(arg00, arg01) {\r\n return BigInteger_op_Equality_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Inequality(arg00, arg01) {\r\n return BigInteger_op_Inequality_56F059C0(arg00, arg01);\r\n}\r\n\r\nfunction flipTwosComplement(currByte, lowBitFound) {\r\n const matchValue = [currByte, lowBitFound];\r\n if (matchValue[1]) {\r\n return [(currByte ^ 255) & 255, true];\r\n }\r\n else if (matchValue[0] === 0) {\r\n return [0, false];\r\n }\r\n else {\r\n return [(currByte ^ (254 << (new Int32Array([0, 1, 2, 3, 4, 5, 6, 7])).find((i) => ((currByte & (1 << i)) > 0)))) & 255, true];\r\n }\r\n}\r\n\r\nexport function toByteArray(value) {\r\n if (equals_1(value, zero)) {\r\n return new Uint8Array([0]);\r\n }\r\n else {\r\n const isPositive = compare_1(value, zero) > 0;\r\n const value_1 = isPositive ? value : BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value);\r\n const mask32 = fromInt64(fromInteger(4294967295, false, 6));\r\n const loop = (accumBytes_mut, consumeValue_mut, lowBitFound_mut) => {\r\n let value_6, value_8, value_9, value_10;\r\n loop:\r\n while (true) {\r\n const accumBytes = accumBytes_mut, consumeValue = consumeValue_mut, lowBitFound = lowBitFound_mut;\r\n if (compare_1(consumeValue, zero) <= 0) {\r\n const accumBytes_1 = isPositive ? skipWhile((b) => (b === 0), accumBytes) : skipWhile((b_1) => (b_1 === 255), accumBytes);\r\n const isHighBitOne = (head(accumBytes_1) & 128) !== 0;\r\n return reverse(toArray((isPositive && isHighBitOne) ? cons(0, accumBytes_1) : (((!isPositive) && (!isHighBitOne)) ? cons(255, accumBytes_1) : accumBytes_1)));\r\n }\r\n else {\r\n const currValue = toUInt32(BigInteger_op_BitwiseAnd_56F059C0(consumeValue, mask32));\r\n if (isPositive) {\r\n const b0 = currValue & 0xFF;\r\n let b1;\r\n const value_4 = currValue >>> 8;\r\n b1 = (value_4 & 0xFF);\r\n let b2;\r\n const value_5 = currValue >>> 16;\r\n b2 = (value_5 & 0xFF);\r\n accumBytes_mut = ofArrayWithTail([(value_6 = (currValue >>> 24), value_6 & 0xFF), b2, b1, b0], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n const patternInput = flipTwosComplement(currValue & 0xFF, lowBitFound);\r\n const patternInput_1 = flipTwosComplement((value_8 = (currValue >>> 8), value_8 & 0xFF), patternInput[1]);\r\n const patternInput_2 = flipTwosComplement((value_9 = (currValue >>> 16), value_9 & 0xFF), patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement((value_10 = (currValue >>> 24), value_10 & 0xFF), patternInput_2[1]);\r\n accumBytes_mut = ofArrayWithTail([patternInput_3[0], patternInput_2[0], patternInput_1[0], patternInput[0]], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), value_1, false);\r\n }\r\n}\r\n\r\nexport function fromByteArray(bytes) {\r\n if (bytes == null) {\r\n throw (new Error(\"bytes\"));\r\n }\r\n if (bytes.length === 0) {\r\n return zero;\r\n }\r\n else {\r\n const isPositive = (bytes[bytes.length - 1] & 128) === 0;\r\n const buffer = fill(new Uint8Array(4), 0, 4, 0);\r\n const loop = (accumUInt32_mut, currIndex_mut, bytesRemaining_mut, lowBitFound_mut) => {\r\n loop:\r\n while (true) {\r\n const accumUInt32 = accumUInt32_mut, currIndex = currIndex_mut, bytesRemaining = bytesRemaining_mut, lowBitFound = lowBitFound_mut;\r\n if (bytesRemaining === 0) {\r\n const value_2 = fold((acc, value) => BigInteger_op_Addition_56F059C0(BigInteger_op_LeftShift_62E082A2(acc, 32), fromInt64(fromInteger(value, false, 6))), zero, accumUInt32);\r\n if (isPositive) {\r\n return value_2;\r\n }\r\n else {\r\n return BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value_2);\r\n }\r\n }\r\n else {\r\n const bytesToProcess = min((x, y) => comparePrimitives(x, y), bytesRemaining, 4) | 0;\r\n for (let i_1 = 0; i_1 <= (bytesToProcess - 1); i_1++) {\r\n buffer[i_1] = bytes[currIndex + i_1];\r\n }\r\n if (isPositive) {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 0);\r\n accumUInt32_mut = cons((((((buffer[0] | ((buffer[1] << 8) >>> 0)) >>> 0) | ((buffer[2] << 16) >>> 0)) >>> 0) | ((buffer[3] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 255);\r\n const patternInput = flipTwosComplement(buffer[0], lowBitFound);\r\n const patternInput_1 = flipTwosComplement(buffer[1], patternInput[1]);\r\n const patternInput_2 = flipTwosComplement(buffer[2], patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement(buffer[3], patternInput_2[1]);\r\n accumUInt32_mut = cons((((((patternInput[0] | ((patternInput_1[0] << 8) >>> 0)) >>> 0) | ((patternInput_2[0] << 16) >>> 0)) >>> 0) | ((patternInput_3[0] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), 0, bytes.length, false);\r\n }\r\n}\r\n\r\n","// tslint:disable:max-line-length\nimport { fromNumber as Long_fromNumber, op_Division as Long_op_Division, op_Multiply as Long_op_Multiply, toNumber as Long_toNumber } from \"./Long.js\";\nimport { comparePrimitives, padLeftAndRightWithZeros, padWithZeros } from \"./Util.js\";\n// TimeSpan in runtime just becomes a number representing milliseconds\n/**\n * Calls:\n * - `Math.ceil` if the `value` is **negative**\n * - `Math.floor` if the `value` is **positive**\n * @param value Value to round\n */\nfunction signedRound(value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n}\nexport function create(d = 0, h = 0, m = 0, s = 0, ms = 0) {\n switch (arguments.length) {\n case 1:\n // ticks\n return fromTicks(arguments[0]);\n case 3:\n // h,m,s\n d = 0, h = arguments[0], m = arguments[1], s = arguments[2], ms = 0;\n break;\n default:\n // d,h,m,s,ms\n break;\n }\n return d * 86400000 + h * 3600000 + m * 60000 + s * 1000 + ms;\n}\nexport function fromTicks(ticks) {\n return Long_toNumber(Long_op_Division(ticks, 10000));\n}\nexport function fromDays(d) {\n return create(d, 0, 0, 0);\n}\nexport function fromHours(h) {\n return create(h, 0, 0);\n}\nexport function fromMinutes(m) {\n return create(0, m, 0);\n}\nexport function fromSeconds(s) {\n return create(0, 0, s);\n}\nexport function days(ts) {\n return signedRound(ts / 86400000);\n}\nexport function hours(ts) {\n return signedRound(ts % 86400000 / 3600000);\n}\nexport function minutes(ts) {\n return signedRound(ts % 3600000 / 60000);\n}\nexport function seconds(ts) {\n return signedRound(ts % 60000 / 1000);\n}\nexport function milliseconds(ts) {\n return signedRound(ts % 1000);\n}\nexport function ticks(ts) {\n return Long_op_Multiply(Long_fromNumber(ts), 10000);\n}\nexport function totalDays(ts) {\n return ts / 86400000;\n}\nexport function totalHours(ts) {\n return ts / 3600000;\n}\nexport function totalMinutes(ts) {\n return ts / 60000;\n}\nexport function totalSeconds(ts) {\n return ts / 1000;\n}\nexport function negate(ts) {\n return ts * -1;\n}\nexport function add(ts1, ts2) {\n return ts1 + ts2;\n}\nexport function subtract(ts1, ts2) {\n return ts1 - ts2;\n}\nexport function multiply(ts, factor) {\n return ts * factor;\n}\nexport function divide(ts, b) {\n return ts / b;\n}\nexport const op_Addition = add;\nexport const op_Subtraction = subtract;\nexport const op_Multiply = multiply;\nexport const op_Division = divide;\nexport const compare = comparePrimitives;\nexport const compareTo = comparePrimitives;\nexport function duration(x) {\n return Math.abs(x);\n}\nexport function toString(ts, format = \"c\", _provider) {\n if ([\"c\", \"g\", \"G\"].indexOf(format) === -1) {\n throw new Error(\"Custom formats are not supported\");\n }\n const d = Math.abs(days(ts));\n const h = Math.abs(hours(ts));\n const m = Math.abs(minutes(ts));\n const s = Math.abs(seconds(ts));\n const ms = Math.abs(milliseconds(ts));\n const sign = ts < 0 ? \"-\" : \"\";\n return `${sign}${d === 0 && (format === \"c\" || format === \"g\") ? \"\" : format === \"c\" ? d + \".\" : d + \":\"}${format === \"g\" ? h : padWithZeros(h, 2)}:${padWithZeros(m, 2)}:${padWithZeros(s, 2)}${ms === 0 && (format === \"c\" || format === \"g\") ? \"\" : format === \"g\" ? \".\" + padWithZeros(ms, 3) : \".\" + padLeftAndRightWithZeros(ms, 3, 7)}`;\n}\nexport function parse(str) {\n const firstDot = str.search(\"\\\\.\");\n const firstColon = str.search(\"\\\\:\");\n if (firstDot === -1 && firstColon === -1) { // There is only a day ex: 4\n const d = parseInt(str, 0);\n if (isNaN(d)) {\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n }\n else {\n return create(d, 0, 0, 0, 0);\n }\n }\n if (firstColon > 0) { // process time part\n // WIP: (-?)(((\\d+)\\.)?([0-9]|0[0-9]|1[0-9]|2[0-3]):(\\d+)(:\\d+(\\.\\d{1,7})?)?|\\d+(?:(?!\\.)))\n const r = /^(-?)((\\d+)\\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\\.?(\\d+)?$/.exec(str);\n if (r != null && r[4] != null && r[5] != null) {\n let d = 0;\n let ms = 0;\n let s = 0;\n const sign = r[1] != null && r[1] === \"-\" ? -1 : 1;\n const h = +r[4];\n const m = +r[5];\n if (r[3] != null) {\n d = +r[3];\n }\n if (r[7] != null) {\n s = +r[7];\n }\n if (r[8] != null) {\n // Depending on the number of decimals passed, we need to adapt the numbers\n switch (r[8].length) {\n case 1:\n ms = +r[8] * 100;\n break;\n case 2:\n ms = +r[8] * 10;\n break;\n case 3:\n ms = +r[8];\n break;\n case 4:\n ms = +r[8] / 10;\n break;\n case 5:\n ms = +r[8] / 100;\n break;\n case 6:\n ms = +r[8] / 1000;\n break;\n case 7:\n ms = +r[8] / 10000;\n break;\n default:\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n }\n }\n return sign * create(d, h, m, s, ms);\n }\n }\n throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n","import { FSharpRef, Record, Union } from \"../fable-library.3.6.3/Types.js\";\r\nimport { record_type, class_type, tuple_type, lambda_type, union_type, list_type, obj_type, string_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { FSharpResult$2 } from \"../fable-library.3.6.3/Choice.js\";\r\nimport { addToDict, tryGetValue } from \"../fable-library.3.6.3/MapUtil.js\";\r\nimport { replace } from \"../fable-library.3.6.3/RegExp.js\";\r\n\r\nexport class ErrorReason extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"BadPrimitive\", \"BadPrimitiveExtra\", \"BadType\", \"BadField\", \"BadPath\", \"TooSmallArray\", \"FailMessage\", \"BadOneOf\"];\r\n }\r\n}\r\n\r\nexport function ErrorReason$reflection() {\r\n return union_type(\"Thoth.Json.ErrorReason\", [], ErrorReason, () => [[[\"Item1\", string_type], [\"Item2\", obj_type]], [[\"Item1\", string_type], [\"Item2\", obj_type], [\"Item3\", string_type]], [[\"Item1\", string_type], [\"Item2\", obj_type]], [[\"Item1\", string_type], [\"Item2\", obj_type]], [[\"Item1\", string_type], [\"Item2\", obj_type], [\"Item3\", string_type]], [[\"Item1\", string_type], [\"Item2\", obj_type]], [[\"Item\", string_type]], [[\"Item\", list_type(string_type)]]]);\r\n}\r\n\r\nexport class CaseStrategy extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"PascalCase\", \"CamelCase\", \"SnakeCase\"];\r\n }\r\n}\r\n\r\nexport function CaseStrategy$reflection() {\r\n return union_type(\"Thoth.Json.CaseStrategy\", [], CaseStrategy, () => [[], [], []]);\r\n}\r\n\r\nexport class ExtraCoders extends Record {\r\n constructor(Hash, Coders) {\r\n super();\r\n this.Hash = Hash;\r\n this.Coders = Coders;\r\n }\r\n}\r\n\r\nexport function ExtraCoders$reflection() {\r\n return record_type(\"Thoth.Json.ExtraCoders\", [], ExtraCoders, () => [[\"Hash\", string_type], [\"Coders\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [string_type, tuple_type(lambda_type(obj_type, obj_type), lambda_type(string_type, lambda_type(obj_type, union_type(\"Microsoft.FSharp.Core.FSharpResult`2\", [obj_type, tuple_type(string_type, ErrorReason$reflection())], FSharpResult$2, () => [[[\"ResultValue\", obj_type]], [[\"ErrorValue\", tuple_type(string_type, ErrorReason$reflection())]]]))))])]]);\r\n}\r\n\r\nexport class Util_Cache$1 {\r\n constructor() {\r\n this.cache = (new Map([]));\r\n }\r\n}\r\n\r\nexport function Util_Cache$1$reflection(gen0) {\r\n return class_type(\"Thoth.Json.Util.Cache`1\", [gen0], Util_Cache$1);\r\n}\r\n\r\nexport function Util_Cache$1_$ctor() {\r\n return new Util_Cache$1();\r\n}\r\n\r\nexport function Util_Cache$1__GetOrAdd_43981464(__, key, factory) {\r\n let matchValue;\r\n let outArg = null;\r\n matchValue = [tryGetValue(__.cache, key, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return matchValue[1];\r\n }\r\n else {\r\n const x_1 = factory();\r\n addToDict(__.cache, key, x_1);\r\n return x_1;\r\n }\r\n}\r\n\r\nexport const Util_CachedEncoders = Util_Cache$1_$ctor();\r\n\r\nexport const Util_CachedDecoders = Util_Cache$1_$ctor();\r\n\r\nexport function Util_Casing_lowerFirst(str) {\r\n return str.slice(void 0, 0 + 1).toLowerCase() + str.slice(1, str.length);\r\n}\r\n\r\nexport function Util_Casing_convert(caseStrategy, fieldName) {\r\n switch (caseStrategy.tag) {\r\n case 2: {\r\n return replace(Util_Casing_lowerFirst(fieldName), \"[A-Z]\", \"_$0\").toLowerCase();\r\n }\r\n case 0: {\r\n return fieldName;\r\n }\r\n default: {\r\n return Util_Casing_lowerFirst(fieldName);\r\n }\r\n }\r\n}\r\n\r\n","import { toString as toString_1 } from \"../fable-library.3.6.3/Decimal.js\";\r\nimport { Lazy, mapCurriedArgs, uncurry, getEnumerator } from \"../fable-library.3.6.3/Util.js\";\r\nimport { empty, map as map_3, tryFind, add, toList } from \"../fable-library.3.6.3/Map.js\";\r\nimport { toString as toString_2 } from \"../fable-library.3.6.3/BigInt.js\";\r\nimport { toString as toString_3 } from \"../fable-library.3.6.3/Date.js\";\r\nimport { toString as toString_4 } from \"../fable-library.3.6.3/TimeSpan.js\";\r\nimport { defaultArg, value as value_34, map, defaultArgWith, some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { toString as toString_5, FSharpRef } from \"../fable-library.3.6.3/Types.js\";\r\nimport { class_type, getGenerics, getGenericTypeDefinition, getTupleFields, getTupleElements, isTuple, isGenericType, getEnumUnderlyingType, isEnum, getElementType, isArray, getUnionCaseFields, getUnionFields, isUnion, getRecordElements, getRecordField, name, isRecord, fullName } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { fill, map as map_1 } from \"../fable-library.3.6.3/Array.js\";\r\nimport { Util_CachedEncoders, Util_Cache$1__GetOrAdd_43981464, CaseStrategy, Util_Casing_convert } from \"./Types.fs.js\";\r\nimport { mapIndexed, map as map_2, fold } from \"../fable-library.3.6.3/Seq.js\";\r\nimport { toFail, printf, toText } from \"../fable-library.3.6.3/String.js\";\r\n\r\nexport function guid(value) {\r\n return value;\r\n}\r\n\r\nexport function decimal(value) {\r\n return toString_1(value);\r\n}\r\n\r\nexport const nil = null;\r\n\r\nexport function object(values) {\r\n const o = {};\r\n const enumerator = getEnumerator(values);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const forLoopVar = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n o[forLoopVar[0]] = forLoopVar[1];\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n return o;\r\n}\r\n\r\nexport function list(values) {\r\n return Array.from(values);\r\n}\r\n\r\nexport function seq(values) {\r\n return Array.from(values);\r\n}\r\n\r\nexport function dict(values) {\r\n return object(toList(values));\r\n}\r\n\r\nexport function bigint(value) {\r\n return toString_2(value);\r\n}\r\n\r\nexport function datetimeOffset(value) {\r\n return toString_3(value, \"O\", {});\r\n}\r\n\r\nexport function timespan(value) {\r\n return toString_4(value);\r\n}\r\n\r\nexport function sbyte(value) {\r\n return String(value);\r\n}\r\n\r\nexport function byte(value) {\r\n return String(value);\r\n}\r\n\r\nexport function int16(value) {\r\n return String(value);\r\n}\r\n\r\nexport function uint16(value) {\r\n return String(value);\r\n}\r\n\r\nexport function int64(value) {\r\n return String(value);\r\n}\r\n\r\nexport function uint64(value) {\r\n return String(value);\r\n}\r\n\r\nexport function unit() {\r\n return null;\r\n}\r\n\r\nexport function tuple2(enc1, enc2, v1, v2) {\r\n return [enc1(v1), enc2(v2)];\r\n}\r\n\r\nexport function tuple3(enc1, enc2, enc3, v1, v2, v3) {\r\n return [enc1(v1), enc2(v2), enc3(v3)];\r\n}\r\n\r\nexport function tuple4(enc1, enc2, enc3, enc4, v1, v2, v3, v4) {\r\n return [enc1(v1), enc2(v2), enc3(v3), enc4(v4)];\r\n}\r\n\r\nexport function tuple5(enc1, enc2, enc3, enc4, enc5, v1, v2, v3, v4, v5) {\r\n return [enc1(v1), enc2(v2), enc3(v3), enc4(v4), enc5(v5)];\r\n}\r\n\r\nexport function tuple6(enc1, enc2, enc3, enc4, enc5, enc6, v1, v2, v3, v4, v5, v6) {\r\n return [enc1(v1), enc2(v2), enc3(v3), enc4(v4), enc5(v5), enc6(v6)];\r\n}\r\n\r\nexport function tuple7(enc1, enc2, enc3, enc4, enc5, enc6, enc7, v1, v2, v3, v4, v5, v6, v7) {\r\n return [enc1(v1), enc2(v2), enc3(v3), enc4(v4), enc5(v5), enc6(v6), enc7(v7)];\r\n}\r\n\r\nexport function tuple8(enc1, enc2, enc3, enc4, enc5, enc6, enc7, enc8, v1, v2, v3, v4, v5, v6, v7, v8) {\r\n return [enc1(v1), enc2(v2), enc3(v3), enc4(v4), enc5(v5), enc6(v6), enc7(v7), enc8(v8)];\r\n}\r\n\r\nexport function Enum_byte(value) {\r\n return byte(value);\r\n}\r\n\r\nexport function Enum_sbyte(value) {\r\n return sbyte(value);\r\n}\r\n\r\nexport function Enum_int16(value) {\r\n return int16(value);\r\n}\r\n\r\nexport function Enum_uint16(value) {\r\n return uint16(value);\r\n}\r\n\r\nexport function Enum_int(value) {\r\n return value;\r\n}\r\n\r\nexport function Enum_uint32(value) {\r\n return value;\r\n}\r\n\r\nexport function datetime(value) {\r\n return toString_3(value, \"O\", {});\r\n}\r\n\r\nexport function toString(space, value) {\r\n return JSON.stringify(value, uncurry(2, null), some(space));\r\n}\r\n\r\nexport function option(encoder) {\r\n return (arg) => defaultArgWith(map(encoder, arg), () => nil);\r\n}\r\n\r\nfunction autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t) {\r\n const encoderRef = new FSharpRef(null);\r\n const extra_1 = add(fullName(t), encoderRef, extra);\r\n let encoder;\r\n if (isRecord(t, true)) {\r\n const setters = map_1((fi) => {\r\n const targetKey = Util_Casing_convert(caseStrategy, name(fi));\r\n const encode_1 = autoEncoder(extra_1, caseStrategy, skipNullField, fi[1]);\r\n return (source) => ((target) => {\r\n const value = getRecordField(source, fi);\r\n if ((!skipNullField) ? true : (skipNullField && (!(value == null)))) {\r\n target[targetKey]=encode_1(value);\r\n }\r\n return target;\r\n });\r\n }, getRecordElements(t, true));\r\n encoder = ((source_1) => fold(uncurry(2, mapCurriedArgs((target_1) => ((set$) => set$(source_1, target_1)), [0, [0, 2]])), {}, setters));\r\n }\r\n else if (isUnion(t, true)) {\r\n encoder = ((value_1) => {\r\n const patternInput = getUnionFields(value_1, t, true);\r\n const info = patternInput[0];\r\n const fields = patternInput[1];\r\n const matchValue = fields.length | 0;\r\n if (matchValue === 0) {\r\n return name(info);\r\n }\r\n else {\r\n const len = matchValue | 0;\r\n const fieldTypes = getUnionCaseFields(info);\r\n const target_2 = fill(new Array(len + 1), 0, len + 1, null);\r\n target_2[0] = name(info);\r\n for (let i = 1; i <= len; i++) {\r\n const encode_2 = autoEncoder(extra_1, caseStrategy, skipNullField, fieldTypes[i - 1][1]);\r\n target_2[i] = encode_2(fields[i - 1]);\r\n }\r\n return target_2;\r\n }\r\n });\r\n }\r\n else {\r\n let message;\r\n const arg10 = fullName(t);\r\n message = toText(printf(\"Cannot generate auto encoder for %s. Please pass an extra encoder.\"))(arg10);\r\n throw (new Error(message));\r\n }\r\n encoderRef.contents = encoder;\r\n return encoder;\r\n}\r\n\r\nfunction autoEncoder(extra, caseStrategy, skipNullField, t) {\r\n const fullname = fullName(t);\r\n const matchValue = tryFind(fullname, extra);\r\n if (matchValue == null) {\r\n if (isArray(t)) {\r\n const encoder = autoEncoder(extra, caseStrategy, skipNullField, getElementType(t));\r\n return (value) => seq(map_2(encoder, value));\r\n }\r\n else if (isEnum(t)) {\r\n const enumType = fullName(getEnumUnderlyingType(t));\r\n if (enumType === \"System.SByte\") {\r\n return (value_1) => sbyte(value_1);\r\n }\r\n else if (enumType === \"System.Byte\") {\r\n return (value_2) => byte(value_2);\r\n }\r\n else if (enumType === \"System.Int16\") {\r\n return (value_3) => int16(value_3);\r\n }\r\n else if (enumType === \"System.UInt16\") {\r\n return (value_4) => uint16(value_4);\r\n }\r\n else if (enumType === \"System.Int32\") {\r\n return (value_5) => value_5;\r\n }\r\n else if (enumType === \"System.UInt32\") {\r\n return (value_7) => value_7;\r\n }\r\n else {\r\n const arg10 = fullName(t);\r\n const clo2 = toFail(printf(\"Cannot generate auto encoder for %s.\\nThoth.Json.Net only support the folluwing enum types:\\n- sbyte\\n- byte\\n- int16\\n- uint16\\n- int\\n- uint32\\nIf you can\\u0027t use one of these types, please pass an extra encoder.\\n \"))(arg10);\r\n return (arg20) => clo2(arg20);\r\n }\r\n }\r\n else if (isGenericType(t)) {\r\n if (isTuple(t)) {\r\n const encoders = map_1((t_2) => autoEncoder(extra, caseStrategy, skipNullField, t_2), getTupleElements(t));\r\n return (value_9) => seq(mapIndexed((i, x) => encoders[i](x), getTupleFields(value_9)));\r\n }\r\n else {\r\n const fullname_1 = fullName(getGenericTypeDefinition(t));\r\n if (fullname_1 === \"Microsoft.FSharp.Core.FSharpOption`1[System.Object]\") {\r\n const encoder_2 = new Lazy(() => option(autoEncoder(extra, caseStrategy, skipNullField, getGenerics(t)[0])));\r\n return (value_10) => {\r\n if (value_10 == null) {\r\n return nil;\r\n }\r\n else {\r\n return encoder_2.Value(value_10);\r\n }\r\n };\r\n }\r\n else if ((fullname_1 === \"Microsoft.FSharp.Collections.FSharpList`1[System.Object]\") ? true : (fullname_1 === \"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]\")) {\r\n const encoder_3 = autoEncoder(extra, caseStrategy, skipNullField, getGenerics(t)[0]);\r\n return (value_11) => seq(map_2(encoder_3, value_11));\r\n }\r\n else if (fullname_1 === \"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]\") {\r\n const keyType = getGenerics(t)[0];\r\n const valueEncoder = autoEncoder(extra, caseStrategy, skipNullField, getGenerics(t)[1]);\r\n if ((fullName(keyType) === \"System.String\") ? true : (fullName(keyType) === \"System.Guid\")) {\r\n return (value_12) => fold((target, _arg1) => {\r\n const activePatternResult11201 = _arg1;\r\n target[activePatternResult11201[0]]=valueEncoder(activePatternResult11201[1]);\r\n return target;\r\n }, {}, value_12);\r\n }\r\n else {\r\n let keyEncoder;\r\n const clo4 = autoEncoder(extra, caseStrategy, skipNullField, keyType);\r\n keyEncoder = ((arg40) => clo4(arg40));\r\n return (value_13) => seq(map_2((_arg2) => {\r\n const activePatternResult11205 = _arg2;\r\n return [keyEncoder(activePatternResult11205[0]), valueEncoder(activePatternResult11205[1])];\r\n }, value_13));\r\n }\r\n }\r\n else {\r\n return autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t);\r\n }\r\n }\r\n }\r\n else if (fullname === \"System.Boolean\") {\r\n return (value_14) => value_14;\r\n }\r\n else if (fullname === \"Microsoft.FSharp.Core.Unit\") {\r\n return unit;\r\n }\r\n else if (fullname === \"System.String\") {\r\n return (value_16) => value_16;\r\n }\r\n else if (fullname === \"System.SByte\") {\r\n return (value_18) => sbyte(value_18);\r\n }\r\n else if (fullname === \"System.Byte\") {\r\n return (value_19) => byte(value_19);\r\n }\r\n else if (fullname === \"System.Int16\") {\r\n return (value_20) => int16(value_20);\r\n }\r\n else if (fullname === \"System.UInt16\") {\r\n return (value_21) => uint16(value_21);\r\n }\r\n else if (fullname === \"System.Int32\") {\r\n return (value_22) => value_22;\r\n }\r\n else if (fullname === \"System.UInt32\") {\r\n return (value_24) => value_24;\r\n }\r\n else if (fullname === \"System.Double\") {\r\n return (value_26) => value_26;\r\n }\r\n else if (fullname === \"System.Single\") {\r\n return (value_28) => value_28;\r\n }\r\n else if (fullname === \"System.DateTime\") {\r\n return (value_30) => datetime(value_30);\r\n }\r\n else if (fullname === \"System.DateTimeOffset\") {\r\n return (value_31) => datetimeOffset(value_31);\r\n }\r\n else if (fullname === \"System.TimeSpan\") {\r\n return (value_32) => timespan(value_32);\r\n }\r\n else if (fullname === \"System.Guid\") {\r\n return (value_33) => guid(value_33);\r\n }\r\n else if (fullname === \"System.Object\") {\r\n return (x_1) => x_1;\r\n }\r\n else {\r\n return autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t);\r\n }\r\n }\r\n else {\r\n const encoderRef = matchValue;\r\n return (v) => encoderRef.contents(v);\r\n }\r\n}\r\n\r\nfunction makeExtra(extra) {\r\n if (extra != null) {\r\n return map_3((_arg2, tupledArg) => (new FSharpRef(tupledArg[0])), extra.Coders);\r\n }\r\n else {\r\n return empty();\r\n }\r\n}\r\n\r\nexport class Auto {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function Auto$reflection() {\r\n return class_type(\"Thoth.Json.Encode.Auto\", void 0, Auto);\r\n}\r\n\r\nexport function Auto_generateEncoderCached_Z127D9D79(caseStrategy, extra, skipNullField, resolver) {\r\n let y_1, y;\r\n const t = value_34(resolver).ResolveType();\r\n const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0));\r\n const skipNullField_1 = defaultArg(skipNullField, true);\r\n return Util_Cache$1__GetOrAdd_43981464(Util_CachedEncoders, (y_1 = ((y = fullName(t), toString_5(caseStrategy_1) + y)), defaultArg(map((e) => e.Hash, extra), \"\") + y_1), () => autoEncoder(makeExtra(extra), caseStrategy_1, skipNullField_1, t));\r\n}\r\n\r\nexport function Auto_generateEncoder_Z127D9D79(caseStrategy, extra, skipNullField, resolver) {\r\n const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0));\r\n const skipNullField_1 = defaultArg(skipNullField, true);\r\n const t = value_34(resolver).ResolveType();\r\n return autoEncoder(makeExtra(extra), caseStrategy_1, skipNullField_1, t);\r\n}\r\n\r\nexport function Auto_toString_5A41365E(space, value, caseStrategy, extra, skipNullField, resolver) {\r\n return toString(space, Auto_generateEncoder_Z127D9D79(caseStrategy, extra, skipNullField, resolver)(value));\r\n}\r\n\r\nexport function encode(space, value) {\r\n return toString(space, value);\r\n}\r\n\r\n","import { trim } from \"./String.js\";\n// RFC 4122 compliant. From https://stackoverflow.com/a/13653180/3922220\n// const guidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;\n// Relax GUID parsing, see #1637\nconst guidRegex = /^[\\(\\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\\)\\}]{0,2}$/;\nconst guidRegexNoHyphen = /^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/;\nconst guidRegexHex = /^\\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\\}\\}$/;\nconst guidHexCaptures = /^([0-9a-f]{8})-(([0-9a-f]{4})-)(([0-9a-f]{4})-)([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/;\nexport function toString(str, format, _provider) {\n if (format && (format === null || format === void 0 ? void 0 : format.length) > 0) {\n switch (format) {\n case \"N\":\n return str.replace(/-/g, '');\n case \"D\":\n return str;\n case \"B\":\n return \"{\" + str + \"}\";\n case \"P\":\n return \"(\" + str + \")\";\n case \"X\":\n return str.replace(guidHexCaptures, \"{0x$1,0x$3,0x$5,{0x$6,0x$7,0x$8,0x$9,0x$10,0x$11,0x$12,0x$13}}\");\n default:\n throw new Error(\"Unrecognized Guid print format\");\n }\n }\n else {\n return str;\n }\n}\n/** Validates UUID as specified in RFC4122 (versions 1-5). */\nexport function parse(str) {\n function hyphenateGuid(str) {\n return str.replace(guidRegexNoHyphen, \"$1-$2-$3-$4-$5\");\n }\n const wsTrimAndLowered = str.trim().toLowerCase();\n if (guidRegex.test(wsTrimAndLowered)) {\n return trim(wsTrimAndLowered, \"{\", \"}\", \"(\", \")\");\n }\n else if (guidRegexNoHyphen.test(wsTrimAndLowered)) {\n return hyphenateGuid(wsTrimAndLowered);\n }\n else if (guidRegexHex.test(wsTrimAndLowered)) {\n return hyphenateGuid(wsTrimAndLowered.replace(/[\\{\\},]|0x/g, ''));\n }\n else {\n throw new Error(\"Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\");\n }\n}\nexport function tryParse(str, defValue) {\n try {\n defValue.contents = parse(str);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n// From https://gist.github.com/LeverOne/1308368\nexport function newGuid() {\n let b = \"\";\n for (let a = 0; a++ < 36;) {\n b += a * 51 & 52\n ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16)\n : \"-\";\n }\n return b;\n}\n// Maps for number <-> hex string conversion\nlet _convertMapsInitialized = false;\nlet _byteToHex;\nlet _hexToByte;\nfunction initConvertMaps() {\n _byteToHex = new Array(256);\n _hexToByte = {};\n for (let i = 0; i < 256; i++) {\n _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n _hexToByte[_byteToHex[i]] = i;\n }\n _convertMapsInitialized = true;\n}\n/** Parse a UUID into it's component bytes */\n// Adapted from https://github.com/zefferus/uuid-parse\nexport function guidToArray(s) {\n if (!_convertMapsInitialized) {\n initConvertMaps();\n }\n let i = 0;\n const buf = new Uint8Array(16);\n s.toLowerCase().replace(/[0-9a-f]{2}/g, ((oct) => {\n switch (i) {\n // .NET saves first three byte groups with different endianness\n // See https://stackoverflow.com/a/16722909/3922220\n case 0:\n case 1:\n case 2:\n case 3:\n buf[3 - i++] = _hexToByte[oct];\n break;\n case 4:\n case 5:\n buf[9 - i++] = _hexToByte[oct];\n break;\n case 6:\n case 7:\n buf[13 - i++] = _hexToByte[oct];\n break;\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n buf[i++] = _hexToByte[oct];\n break;\n }\n }));\n // Zero out remaining bytes if string was short\n while (i < 16) {\n buf[i++] = 0;\n }\n return buf;\n}\n/** Convert UUID byte array into a string */\nexport function arrayToGuid(buf) {\n if (buf.length !== 16) {\n throw new Error(\"Byte array for GUID must be exactly 16 bytes long\");\n }\n if (!_convertMapsInitialized) {\n initConvertMaps();\n }\n const guid = _byteToHex[buf[3]] + _byteToHex[buf[2]] +\n _byteToHex[buf[1]] + _byteToHex[buf[0]] + \"-\" +\n _byteToHex[buf[5]] + _byteToHex[buf[4]] + \"-\" +\n _byteToHex[buf[7]] + _byteToHex[buf[6]] + \"-\" +\n _byteToHex[buf[8]] + _byteToHex[buf[9]] + \"-\" +\n _byteToHex[buf[10]] + _byteToHex[buf[11]] +\n _byteToHex[buf[12]] + _byteToHex[buf[13]] +\n _byteToHex[buf[14]] + _byteToHex[buf[15]];\n return guid;\n}\n","/**\n * DateTimeOffset functions.\n *\n * Note: DateOffset instances are always DateObjects in local\n * timezone (because JS dates are all kinds of messed up).\n * A local date returns UTC epoc when `.getTime()` is called.\n *\n * However, this means that in order to construct an UTC date\n * from a DateOffset with offset of +5 hours, you first need\n * to subtract those 5 hours, than add the \"local\" offset.\n * As said, all kinds of messed up.\n *\n * Basically; invariant: date.getTime() always return UTC time.\n */\nimport { create as createDate, dateOffsetToString, daysInMonth, parseRaw } from \"./Date.js\";\nimport { fromValue, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from \"./Long.js\";\nimport { compareDates, padWithZeros } from \"./Util.js\";\nexport default function DateTimeOffset(value, offset) {\n checkOffsetInRange(offset);\n const d = new Date(value);\n d.offset = offset != null ? offset : new Date().getTimezoneOffset() * -60000;\n return d;\n}\nfunction checkOffsetInRange(offset) {\n if (offset != null && offset !== 0) {\n if (offset % 60000 !== 0) {\n throw new Error(\"Offset must be specified in whole minutes.\");\n }\n if (Math.abs(offset / 3600000) > 14) {\n throw new Error(\"Offset must be within plus or minus 14 hours.\");\n }\n }\n}\nexport function fromDate(date, offset) {\n let offset2 = 0;\n switch (date.kind) {\n case 1 /* UTC */:\n if (offset != null && offset !== 0) {\n throw new Error(\"The UTC Offset for Utc DateTime instances must be 0.\");\n }\n offset2 = 0;\n break;\n case 2 /* Local */:\n offset2 = date.getTimezoneOffset() * -60000;\n if (offset != null && offset !== offset2) {\n throw new Error(\"The UTC Offset of the local dateTime parameter does not match the offset argument.\");\n }\n break;\n case 0 /* Unspecified */:\n default:\n if (offset == null) {\n offset2 = date.getTimezoneOffset() * -60000;\n }\n else {\n offset2 = offset;\n }\n break;\n }\n return DateTimeOffset(date.getTime(), offset2);\n}\nexport function fromTicks(ticks, offset) {\n ticks = fromValue(ticks);\n const epoc = ticksToUnixEpochMilliseconds(ticks) - offset;\n return DateTimeOffset(epoc, offset);\n}\nexport function getUtcTicks(date) {\n return unixEpochMillisecondsToTicks(date.getTime(), 0);\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\", actual JS min value is -8640000000000000\n return DateTimeOffset(-62135596800000, 0);\n}\nexport function maxValue() {\n // This is \"9999-12-31T23:59:59.999Z\", actual JS max value is 8640000000000000\n return DateTimeOffset(253402300799999, 0);\n}\nexport function parse(str) {\n const [date, offsetMatch] = parseRaw(str);\n const offset = offsetMatch == null\n ? date.getTimezoneOffset() * -60000\n : (offsetMatch === \"Z\" ? 0 : offsetMatch * 60000);\n return DateTimeOffset(date.getTime(), offset);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_err) {\n return false;\n }\n}\nexport function create(year, month, day, h, m, s, ms, offset) {\n if (offset == null) {\n offset = ms;\n ms = 0;\n }\n checkOffsetInRange(offset);\n let date;\n if (offset === 0) {\n date = new Date(Date.UTC(year, month - 1, day, h, m, s, ms));\n if (year <= 99) {\n date.setFullYear(year, month - 1, day);\n }\n }\n else {\n const str = padWithZeros(year, 4) + \"-\" +\n padWithZeros(month, 2) + \"-\" +\n padWithZeros(day, 2) + \"T\" +\n padWithZeros(h, 2) + \":\" +\n padWithZeros(m, 2) + \":\" +\n padWithZeros(s, 2) + \".\" +\n padWithZeros(ms, 3) +\n dateOffsetToString(offset);\n date = new Date(str);\n }\n const dateValue = date.getTime();\n if (isNaN(dateValue)) {\n throw new Error(\"The parameters describe an unrepresentable Date\");\n }\n return DateTimeOffset(dateValue, offset);\n}\nexport function now() {\n const date = new Date();\n const offset = date.getTimezoneOffset() * -60000;\n return DateTimeOffset(date.getTime(), offset);\n}\nexport function utcNow() {\n const date = now();\n return DateTimeOffset(date.getTime(), 0);\n}\nexport function toUniversalTime(date) {\n return DateTimeOffset(date.getTime(), 0);\n}\nexport function toLocalTime(date) {\n return DateTimeOffset(date.getTime(), date.getTimezoneOffset() * -60000);\n}\nexport function timeOfDay(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n return d2.getUTCHours() * 3600000\n + d2.getUTCMinutes() * 60000\n + d2.getUTCSeconds() * 1000\n + d2.getUTCMilliseconds();\n}\nexport function date(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n return createDate(d2.getUTCFullYear(), d2.getUTCMonth() + 1, d2.getUTCDate(), 0, 0, 0, 0);\n}\nexport function day(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCDate();\n}\nexport function hour(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCHours();\n}\nexport function millisecond(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMilliseconds();\n}\nexport function minute(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMinutes();\n}\nexport function month(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCMonth() + 1;\n}\nexport function second(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCSeconds();\n}\nexport function year(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCFullYear();\n}\nexport function dayOfWeek(d) {\n var _a;\n return new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0)).getUTCDay();\n}\nexport function dayOfYear(d) {\n var _a;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n const _year = d2.getUTCFullYear();\n const _month = d2.getUTCMonth() + 1;\n let _day = d2.getUTCDate();\n for (let i = 1; i < _month; i++) {\n _day += daysInMonth(_year, i);\n }\n return _day;\n}\nexport function add(d, ts) {\n var _a;\n return DateTimeOffset(d.getTime() + ts, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addDays(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 86400000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addHours(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 3600000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMinutes(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 60000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addSeconds(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v * 1000, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMilliseconds(d, v) {\n var _a;\n return DateTimeOffset(d.getTime() + v, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addYears(d, v) {\n var _a;\n const newMonth = d.getUTCMonth() + 1;\n const newYear = d.getUTCFullYear() + v;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, d.getUTCDate());\n return create(newYear, newMonth, newDay, d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds(), ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n}\nexport function addMonths(d, v) {\n var _a, _b;\n const d2 = new Date(d.getTime() + ((_a = d.offset) !== null && _a !== void 0 ? _a : 0));\n let newMonth = d2.getUTCMonth() + 1 + v;\n let newMonth_ = 0;\n let yearOffset = 0;\n if (newMonth > 12) {\n newMonth_ = newMonth % 12;\n yearOffset = Math.floor(newMonth / 12);\n newMonth = newMonth_;\n }\n else if (newMonth < 1) {\n newMonth_ = 12 + newMonth % 12;\n yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);\n newMonth = newMonth_;\n }\n const newYear = d2.getUTCFullYear() + yearOffset;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, d2.getUTCDate());\n return create(newYear, newMonth, newDay, d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds(), ((_b = d.offset) !== null && _b !== void 0 ? _b : 0));\n}\nexport function subtract(d, that) {\n var _a;\n return typeof that === \"number\"\n ? DateTimeOffset(d.getTime() - that, ((_a = d.offset) !== null && _a !== void 0 ? _a : 0))\n : d.getTime() - that.getTime();\n}\nexport function equals(d1, d2) {\n return d1.getTime() === d2.getTime();\n}\nexport function equalsExact(d1, d2) {\n return d1.getTime() === d2.getTime() && d1.offset === d2.offset;\n}\nexport function compare(d1, d2) {\n return compareDates(d1, d2);\n}\nexport const compareTo = compare;\nexport function op_Addition(x, y) {\n return add(x, y);\n}\nexport function op_Subtraction(x, y) {\n return subtract(x, y);\n}\nexport function toOffset(d, offset) {\n return DateTimeOffset(d.getTime(), offset);\n}\n","import { record_type, bool_type, list_type, option_type, class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { toString, Record } from \"./Types.js\";\r\nimport { FSharpList, fold as fold_2, cons, singleton as singleton_1, empty as empty_1, ofArrayWithTail, tail, head, isEmpty as isEmpty_1 } from \"./List.js\";\r\nimport { fold as fold_1, fill } from \"./Array.js\";\r\nimport { structuralHash, toIterator, getEnumerator, isArrayLike } from \"./Util.js\";\r\nimport { join } from \"./String.js\";\r\nimport { exists as exists_1, cache, forAll as forAll_1, fold as fold_3, reduce, iterate as iterate_1, map as map_1 } from \"./Seq.js\";\r\nimport { HashSet__get_Comparer, HashSet_$ctor_Z6150332D, HashSet } from \"./MutableSet.js\";\r\n\r\nexport class SetTreeLeaf$1 {\r\n constructor(k) {\r\n this.k = k;\r\n }\r\n}\r\n\r\nexport function SetTreeLeaf$1$reflection(gen0) {\r\n return class_type(\"Set.SetTreeLeaf`1\", [gen0], SetTreeLeaf$1);\r\n}\r\n\r\nexport function SetTreeLeaf$1_$ctor_2B595(k) {\r\n return new SetTreeLeaf$1(k);\r\n}\r\n\r\nexport function SetTreeLeaf$1__get_Key(_) {\r\n return _.k;\r\n}\r\n\r\nexport class SetTreeNode$1 extends SetTreeLeaf$1 {\r\n constructor(v, left, right, h) {\r\n super(v);\r\n this.left = left;\r\n this.right = right;\r\n this.h = (h | 0);\r\n }\r\n}\r\n\r\nexport function SetTreeNode$1$reflection(gen0) {\r\n return class_type(\"Set.SetTreeNode`1\", [gen0], SetTreeNode$1, SetTreeLeaf$1$reflection(gen0));\r\n}\r\n\r\nexport function SetTreeNode$1_$ctor_Z6E7BE5F7(v, left, right, h) {\r\n return new SetTreeNode$1(v, left, right, h);\r\n}\r\n\r\nexport function SetTreeNode$1__get_Left(_) {\r\n return _.left;\r\n}\r\n\r\nexport function SetTreeNode$1__get_Right(_) {\r\n return _.right;\r\n}\r\n\r\nexport function SetTreeNode$1__get_Height(_) {\r\n return _.h;\r\n}\r\n\r\nexport function SetTreeModule_empty() {\r\n return void 0;\r\n}\r\n\r\nexport function SetTreeModule_countAux(t_mut, acc_mut) {\r\n SetTreeModule_countAux:\r\n while (true) {\r\n const t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_countAux(SetTreeNode$1__get_Right(t2), acc + 1);\r\n continue SetTreeModule_countAux;\r\n }\r\n else {\r\n return (acc + 1) | 0;\r\n }\r\n }\r\n else {\r\n return acc | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_count(s) {\r\n return SetTreeModule_countAux(s, 0);\r\n}\r\n\r\nexport function SetTreeModule_mk(l, k, r) {\r\n let hl;\r\n const t = l;\r\n if (t != null) {\r\n const t2 = t;\r\n hl = ((t2 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2) : 1);\r\n }\r\n else {\r\n hl = 0;\r\n }\r\n let hr;\r\n const t_1 = r;\r\n if (t_1 != null) {\r\n const t2_1 = t_1;\r\n hr = ((t2_1 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_1) : 1);\r\n }\r\n else {\r\n hr = 0;\r\n }\r\n const m = ((hl < hr) ? hr : hl) | 0;\r\n if (m === 0) {\r\n return SetTreeLeaf$1_$ctor_2B595(k);\r\n }\r\n else {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, l, r, m + 1);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_rebalance(t1, v, t2) {\r\n let t_2, t2_3, t_3, t2_4;\r\n let t1h;\r\n const t = t1;\r\n if (t != null) {\r\n const t2_1 = t;\r\n t1h = ((t2_1 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_1) : 1);\r\n }\r\n else {\r\n t1h = 0;\r\n }\r\n let t2h;\r\n const t_1 = t2;\r\n if (t_1 != null) {\r\n const t2_2 = t_1;\r\n t2h = ((t2_2 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_2) : 1);\r\n }\r\n else {\r\n t2h = 0;\r\n }\r\n if (t2h > (t1h + 2)) {\r\n const matchValue = value_1(t2);\r\n if (matchValue instanceof SetTreeNode$1) {\r\n if (((t_2 = SetTreeNode$1__get_Left(matchValue), (t_2 != null) ? ((t2_3 = t_2, (t2_3 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_3) : 1)) : 0)) > (t1h + 1)) {\r\n const matchValue_1 = value_1(SetTreeNode$1__get_Left(matchValue));\r\n if (matchValue_1 instanceof SetTreeNode$1) {\r\n return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(matchValue_1)), SetTreeLeaf$1__get_Key(matchValue_1), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_1), SetTreeLeaf$1__get_Key(matchValue), SetTreeNode$1__get_Right(matchValue)));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(matchValue)), SetTreeLeaf$1__get_Key(matchValue), SetTreeNode$1__get_Right(matchValue));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else if (t1h > (t2h + 2)) {\r\n const matchValue_2 = value_1(t1);\r\n if (matchValue_2 instanceof SetTreeNode$1) {\r\n if (((t_3 = SetTreeNode$1__get_Right(matchValue_2), (t_3 != null) ? ((t2_4 = t_3, (t2_4 instanceof SetTreeNode$1) ? SetTreeNode$1__get_Height(t2_4) : 1)) : 0)) > (t2h + 1)) {\r\n const matchValue_3 = value_1(SetTreeNode$1__get_Right(matchValue_2));\r\n if (matchValue_3 instanceof SetTreeNode$1) {\r\n return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(matchValue_2), SetTreeLeaf$1__get_Key(matchValue_2), SetTreeNode$1__get_Left(matchValue_3)), SetTreeLeaf$1__get_Key(matchValue_3), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_3), v, t2));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(SetTreeNode$1__get_Left(matchValue_2), SetTreeLeaf$1__get_Key(matchValue_2), SetTreeModule_mk(SetTreeNode$1__get_Right(matchValue_2), v, t2));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.rebalance\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_mk(t1, v, t2);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_add(comparer, k, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n return SetTreeModule_rebalance(SetTreeModule_add(comparer, k, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2));\r\n }\r\n else if (c === 0) {\r\n return t;\r\n }\r\n else {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), SetTreeModule_add(comparer, k, SetTreeNode$1__get_Right(t2)));\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (c_1 < 0) {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, SetTreeModule_empty(), t, 2);\r\n }\r\n else if (c_1 === 0) {\r\n return t;\r\n }\r\n else {\r\n return SetTreeNode$1_$ctor_Z6E7BE5F7(k, t, SetTreeModule_empty(), 2);\r\n }\r\n }\r\n }\r\n else {\r\n return SetTreeLeaf$1_$ctor_2B595(k);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_balance(comparer, t1, k, t2) {\r\n if (t1 != null) {\r\n const t1$0027 = t1;\r\n if (t2 != null) {\r\n const t2$0027 = t2;\r\n if (t1$0027 instanceof SetTreeNode$1) {\r\n if (t2$0027 instanceof SetTreeNode$1) {\r\n if ((SetTreeNode$1__get_Height(t1$0027) + 2) < SetTreeNode$1__get_Height(t2$0027)) {\r\n return SetTreeModule_rebalance(SetTreeModule_balance(comparer, t1, k, SetTreeNode$1__get_Left(t2$0027)), SetTreeLeaf$1__get_Key(t2$0027), SetTreeNode$1__get_Right(t2$0027));\r\n }\r\n else if ((SetTreeNode$1__get_Height(t2$0027) + 2) < SetTreeNode$1__get_Height(t1$0027)) {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t1$0027), SetTreeLeaf$1__get_Key(t1$0027), SetTreeModule_balance(comparer, SetTreeNode$1__get_Right(t1$0027), k, t2));\r\n }\r\n else {\r\n return SetTreeModule_mk(t1, k, t2);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, t1);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, k, t2);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_split(comparer, pivot, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const c = comparer.Compare(pivot, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (c < 0) {\r\n const patternInput = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Left(t2));\r\n return [patternInput[0], patternInput[1], SetTreeModule_balance(comparer, patternInput[2], SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2))];\r\n }\r\n else if (c === 0) {\r\n return [SetTreeNode$1__get_Left(t2), true, SetTreeNode$1__get_Right(t2)];\r\n }\r\n else {\r\n const patternInput_1 = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Right(t2));\r\n return [SetTreeModule_balance(comparer, SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), patternInput_1[0]), patternInput_1[1], patternInput_1[2]];\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(t2), pivot) | 0;\r\n if (c_1 < 0) {\r\n return [t, false, SetTreeModule_empty()];\r\n }\r\n else if (c_1 === 0) {\r\n return [SetTreeModule_empty(), true, SetTreeModule_empty()];\r\n }\r\n else {\r\n return [SetTreeModule_empty(), false, t];\r\n }\r\n }\r\n }\r\n else {\r\n return [SetTreeModule_empty(), false, SetTreeModule_empty()];\r\n }\r\n}\r\n\r\nexport function SetTreeModule_spliceOutSuccessor(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(t2) == null) {\r\n return [SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2)];\r\n }\r\n else {\r\n const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Left(t2));\r\n return [patternInput[0], SetTreeModule_mk(patternInput[1], SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2))];\r\n }\r\n }\r\n else {\r\n return [SetTreeLeaf$1__get_Key(t2), SetTreeModule_empty()];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Set.spliceOutSuccessor\"));\r\n }\r\n}\r\n\r\nexport function SetTreeModule_remove(comparer, k, t) {\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n return SetTreeModule_rebalance(SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2), SetTreeNode$1__get_Right(t2));\r\n }\r\n else if (c === 0) {\r\n if (SetTreeNode$1__get_Left(t2) == null) {\r\n return SetTreeNode$1__get_Right(t2);\r\n }\r\n else if (SetTreeNode$1__get_Right(t2) == null) {\r\n return SetTreeNode$1__get_Left(t2);\r\n }\r\n else {\r\n const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Right(t2));\r\n return SetTreeModule_mk(SetTreeNode$1__get_Left(t2), patternInput[0], patternInput[1]);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2), SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Right(t2)));\r\n }\r\n }\r\n else if (c === 0) {\r\n return SetTreeModule_empty();\r\n }\r\n else {\r\n return t;\r\n }\r\n }\r\n else {\r\n return t;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mem(comparer_mut, k_mut, t_mut) {\r\n SetTreeModule_mem:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (c < 0) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n continue SetTreeModule_mem;\r\n }\r\n else if (c === 0) {\r\n return true;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_mem;\r\n }\r\n }\r\n else {\r\n return c === 0;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_iter(f_mut, t_mut) {\r\n SetTreeModule_iter:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n SetTreeModule_iter(f, SetTreeNode$1__get_Left(t2));\r\n f(SetTreeLeaf$1__get_Key(t2));\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_iter;\r\n }\r\n else {\r\n f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_foldBackOpt(f_mut, t_mut, x_mut) {\r\n SetTreeModule_foldBackOpt:\r\n while (true) {\r\n const f = f_mut, t = t_mut, x = x_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n x_mut = f(SetTreeLeaf$1__get_Key(t2), SetTreeModule_foldBackOpt(f, SetTreeNode$1__get_Right(t2), x));\r\n continue SetTreeModule_foldBackOpt;\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2), x);\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_foldBack(f, m, x) {\r\n return SetTreeModule_foldBackOpt(f, m, x);\r\n}\r\n\r\nexport function SetTreeModule_foldOpt(f_mut, x_mut, t_mut) {\r\n SetTreeModule_foldOpt:\r\n while (true) {\r\n const f = f_mut, x = x_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n f_mut = f;\r\n x_mut = f(SetTreeModule_foldOpt(f, x, SetTreeNode$1__get_Left(t2)), SetTreeLeaf$1__get_Key(t2));\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_foldOpt;\r\n }\r\n else {\r\n return f(x, SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_fold(f, x, m) {\r\n return SetTreeModule_foldOpt(f, x, m);\r\n}\r\n\r\nexport function SetTreeModule_forall(f_mut, t_mut) {\r\n SetTreeModule_forall:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (f(SetTreeLeaf$1__get_Key(t2)) && SetTreeModule_forall(f, SetTreeNode$1__get_Left(t2))) {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_forall;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_exists(f_mut, t_mut) {\r\n SetTreeModule_exists:\r\n while (true) {\r\n const f = f_mut, t = t_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n if (f(SetTreeLeaf$1__get_Key(t2)) ? true : SetTreeModule_exists(f, SetTreeNode$1__get_Left(t2))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n continue SetTreeModule_exists;\r\n }\r\n }\r\n else {\r\n return f(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_subset(comparer, a, b) {\r\n return SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a);\r\n}\r\n\r\nexport function SetTreeModule_properSubset(comparer, a, b) {\r\n if (SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a)) {\r\n return SetTreeModule_exists((x_1) => (!SetTreeModule_mem(comparer, x_1, a)), b);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_filterAux(comparer_mut, f_mut, t_mut, acc_mut) {\r\n SetTreeModule_filterAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_1 = f(SetTreeLeaf$1__get_Key(t2)) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc) : acc;\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_filterAux(comparer, f, SetTreeNode$1__get_Right(t2), acc_1);\r\n continue SetTreeModule_filterAux;\r\n }\r\n else if (f(SetTreeLeaf$1__get_Key(t2))) {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_filter(comparer, f, s) {\r\n return SetTreeModule_filterAux(comparer, f, s, SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_diffAux(comparer_mut, t_mut, acc_mut) {\r\n SetTreeModule_diffAux:\r\n while (true) {\r\n const comparer = comparer_mut, t = t_mut, acc = acc_mut;\r\n if (acc == null) {\r\n return acc;\r\n }\r\n else if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = SetTreeModule_diffAux(comparer, SetTreeNode$1__get_Right(t2), SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(t2), acc));\r\n continue SetTreeModule_diffAux;\r\n }\r\n else {\r\n return SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_diff(comparer, a, b) {\r\n return SetTreeModule_diffAux(comparer, b, a);\r\n}\r\n\r\nexport function SetTreeModule_union(comparer, t1, t2) {\r\n if (t1 != null) {\r\n const t1$0027 = t1;\r\n if (t2 != null) {\r\n const t2$0027 = t2;\r\n if (t1$0027 instanceof SetTreeNode$1) {\r\n if (t2$0027 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Height(t1$0027) > SetTreeNode$1__get_Height(t2$0027)) {\r\n const patternInput = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2);\r\n return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t1$0027), patternInput[0]), SetTreeLeaf$1__get_Key(t1$0027), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t1$0027), patternInput[2]));\r\n }\r\n else {\r\n const patternInput_1 = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1);\r\n return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t2$0027), patternInput_1[0]), SetTreeLeaf$1__get_Key(t2$0027), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t2$0027), patternInput_1[2]));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1);\r\n }\r\n }\r\n else {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2);\r\n }\r\n }\r\n else {\r\n return t1;\r\n }\r\n }\r\n else {\r\n return t2;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_intersectionAux(comparer_mut, b_mut, t_mut, acc_mut) {\r\n SetTreeModule_intersectionAux:\r\n while (true) {\r\n const comparer = comparer_mut, b = b_mut, t = t_mut, acc = acc_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_1 = SetTreeModule_intersectionAux(comparer, b, SetTreeNode$1__get_Right(t2), acc);\r\n const acc_2 = SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(t2), b) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc_1) : acc_1;\r\n comparer_mut = comparer;\r\n b_mut = b;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = acc_2;\r\n continue SetTreeModule_intersectionAux;\r\n }\r\n else if (SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(t2), b)) {\r\n return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_intersection(comparer, a, b) {\r\n return SetTreeModule_intersectionAux(comparer, b, a, SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_partition1(comparer, f, k, acc1, acc2) {\r\n if (f(k)) {\r\n return [SetTreeModule_add(comparer, k, acc1), acc2];\r\n }\r\n else {\r\n return [acc1, SetTreeModule_add(comparer, k, acc2)];\r\n }\r\n}\r\n\r\nexport function SetTreeModule_partitionAux(comparer_mut, f_mut, t_mut, acc_0_mut, acc_1_mut) {\r\n SetTreeModule_partitionAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, t = t_mut, acc_0 = acc_0_mut, acc_1 = acc_1_mut;\r\n const acc = [acc_0, acc_1];\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n const acc_2 = SetTreeModule_partitionAux(comparer, f, SetTreeNode$1__get_Right(t2), acc[0], acc[1]);\r\n const acc_3 = SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(t2), acc_2[0], acc_2[1]);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n acc_0_mut = acc_3[0];\r\n acc_1_mut = acc_3[1];\r\n continue SetTreeModule_partitionAux;\r\n }\r\n else {\r\n return SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(t2), acc[0], acc[1]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_partition(comparer, f, s) {\r\n return SetTreeModule_partitionAux(comparer, f, s, SetTreeModule_empty(), SetTreeModule_empty());\r\n}\r\n\r\nexport function SetTreeModule_minimumElementAux(t_mut, n_mut) {\r\n SetTreeModule_minimumElementAux:\r\n while (true) {\r\n const t = t_mut, n = n_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Left(t2);\r\n n_mut = SetTreeLeaf$1__get_Key(t2);\r\n continue SetTreeModule_minimumElementAux;\r\n }\r\n else {\r\n return SetTreeLeaf$1__get_Key(t2);\r\n }\r\n }\r\n else {\r\n return n;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_minimumElementOpt(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n return some(SetTreeModule_minimumElementAux(SetTreeNode$1__get_Left(t2), SetTreeLeaf$1__get_Key(t2)));\r\n }\r\n else {\r\n return some(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElementAux(t_mut, n_mut) {\r\n SetTreeModule_maximumElementAux:\r\n while (true) {\r\n const t = t_mut, n = n_mut;\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t_mut = SetTreeNode$1__get_Right(t2);\r\n n_mut = SetTreeLeaf$1__get_Key(t2);\r\n continue SetTreeModule_maximumElementAux;\r\n }\r\n else {\r\n return SetTreeLeaf$1__get_Key(t2);\r\n }\r\n }\r\n else {\r\n return n;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElementOpt(t) {\r\n if (t != null) {\r\n const t2 = t;\r\n if (t2 instanceof SetTreeNode$1) {\r\n return some(SetTreeModule_maximumElementAux(SetTreeNode$1__get_Right(t2), SetTreeLeaf$1__get_Key(t2)));\r\n }\r\n else {\r\n return some(SetTreeLeaf$1__get_Key(t2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_minimumElement(s) {\r\n const matchValue = SetTreeModule_minimumElementOpt(s);\r\n if (matchValue == null) {\r\n throw (new Error(\"Set contains no elements\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_maximumElement(s) {\r\n const matchValue = SetTreeModule_maximumElementOpt(s);\r\n if (matchValue == null) {\r\n throw (new Error(\"Set contains no elements\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport class SetTreeModule_SetIterator$1 extends Record {\r\n constructor(stack, started) {\r\n super();\r\n this.stack = stack;\r\n this.started = started;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_SetIterator$1$reflection(gen0) {\r\n return record_type(\"Set.SetTreeModule.SetIterator`1\", [gen0], SetTreeModule_SetIterator$1, () => [[\"stack\", list_type(option_type(SetTreeLeaf$1$reflection(gen0)))], [\"started\", bool_type]]);\r\n}\r\n\r\nexport function SetTreeModule_collapseLHS(stack_mut) {\r\n SetTreeModule_collapseLHS:\r\n while (true) {\r\n const stack = stack_mut;\r\n if (!isEmpty_1(stack)) {\r\n const x = head(stack);\r\n const rest = tail(stack);\r\n if (x != null) {\r\n const x2 = x;\r\n if (x2 instanceof SetTreeNode$1) {\r\n stack_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2)), SetTreeNode$1__get_Right(x2)], rest);\r\n continue SetTreeModule_collapseLHS;\r\n }\r\n else {\r\n return stack;\r\n }\r\n }\r\n else {\r\n stack_mut = rest;\r\n continue SetTreeModule_collapseLHS;\r\n }\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mkIterator(s) {\r\n return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton_1(s)), false);\r\n}\r\n\r\nexport function SetTreeModule_notStarted() {\r\n throw (new Error(\"Enumeration not started\"));\r\n}\r\n\r\nexport function SetTreeModule_alreadyFinished() {\r\n throw (new Error(\"Enumeration already started\"));\r\n}\r\n\r\nexport function SetTreeModule_current(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (isEmpty_1(matchValue)) {\r\n return SetTreeModule_alreadyFinished();\r\n }\r\n else if (head(matchValue) != null) {\r\n const t = head(matchValue);\r\n return SetTreeLeaf$1__get_Key(t);\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for current\"));\r\n }\r\n }\r\n else {\r\n return SetTreeModule_notStarted();\r\n }\r\n}\r\n\r\nexport function SetTreeModule_moveNext(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const t = head(matchValue);\r\n if (t instanceof SetTreeNode$1) {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for moveNext\"));\r\n }\r\n else {\r\n i.stack = SetTreeModule_collapseLHS(tail(matchValue));\r\n return !isEmpty_1(i.stack);\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Set iterator, unexpected stack for moveNext\"));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n i.started = true;\r\n return !isEmpty_1(i.stack);\r\n }\r\n}\r\n\r\nexport function SetTreeModule_mkIEnumerator(s) {\r\n let i = SetTreeModule_mkIterator(s);\r\n return {\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n return SetTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n return SetTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n return SetTreeModule_moveNext(i);\r\n },\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n i = SetTreeModule_mkIterator(s);\r\n },\r\n Dispose() {\r\n },\r\n };\r\n}\r\n\r\nexport function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {\r\n SetTreeModule_compareStacks:\r\n while (true) {\r\n const comparer = comparer_mut, l1 = l1_mut, l2 = l2_mut;\r\n const matchValue = [l1, l2];\r\n if (!isEmpty_1(matchValue[0])) {\r\n if (!isEmpty_1(matchValue[1])) {\r\n if (head(matchValue[1]) != null) {\r\n if (head(matchValue[0]) != null) {\r\n const x1_3 = head(matchValue[0]);\r\n const x2_3 = head(matchValue[1]);\r\n if (x1_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x1_3) == null) {\r\n if (x2_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x2_3) == null) {\r\n const c = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c !== 0) {\r\n return c | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeNode$1__get_Right(x1_3), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeNode$1__get_Right(x2_3), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n const matchValue_3 = [l1, l2];\r\n let pattern_matching_result, t1_6, x1_4, t2_6, x2_4;\r\n if (!isEmpty_1(matchValue_3[0])) {\r\n if (head(matchValue_3[0]) != null) {\r\n pattern_matching_result = 0;\r\n t1_6 = tail(matchValue_3[0]);\r\n x1_4 = head(matchValue_3[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_3[1])) {\r\n if (head(matchValue_3[1]) != null) {\r\n pattern_matching_result = 1;\r\n t2_6 = tail(matchValue_3[1]);\r\n x2_4 = head(matchValue_3[1]);\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_3[1])) {\r\n if (head(matchValue_3[1]) != null) {\r\n pattern_matching_result = 1;\r\n t2_6 = tail(matchValue_3[1]);\r\n x2_4 = head(matchValue_3[1]);\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n if (x1_4 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_4), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_4), 0)], t1_6);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_4))], t1_6);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_4 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_4), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_4), 0)], t2_6);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_4))], t2_6);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_1 !== 0) {\r\n return c_1 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeNode$1__get_Right(x1_3), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeModule_empty(), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n }\r\n else {\r\n const matchValue_4 = [l1, l2];\r\n let pattern_matching_result_1, t1_7, x1_5, t2_7, x2_5;\r\n if (!isEmpty_1(matchValue_4[0])) {\r\n if (head(matchValue_4[0]) != null) {\r\n pattern_matching_result_1 = 0;\r\n t1_7 = tail(matchValue_4[0]);\r\n x1_5 = head(matchValue_4[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_4[1])) {\r\n if (head(matchValue_4[1]) != null) {\r\n pattern_matching_result_1 = 1;\r\n t2_7 = tail(matchValue_4[1]);\r\n x2_5 = head(matchValue_4[1]);\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_4[1])) {\r\n if (head(matchValue_4[1]) != null) {\r\n pattern_matching_result_1 = 1;\r\n t2_7 = tail(matchValue_4[1]);\r\n x2_5 = head(matchValue_4[1]);\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 2;\r\n }\r\n switch (pattern_matching_result_1) {\r\n case 0: {\r\n if (x1_5 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_5), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_5), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_5), 0)], t1_7);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_5))], t1_7);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_5 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_5), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_5), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_5), 0)], t2_7);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_5))], t2_7);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else if (x2_3 instanceof SetTreeNode$1) {\r\n if (SetTreeNode$1__get_Left(x2_3) == null) {\r\n const c_2 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_2 !== 0) {\r\n return c_2 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = cons(SetTreeModule_empty(), tail(matchValue[0]));\r\n l2_mut = cons(SetTreeNode$1__get_Right(x2_3), tail(matchValue[1]));\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n const matchValue_5 = [l1, l2];\r\n let pattern_matching_result_2, t1_8, x1_6, t2_8, x2_6;\r\n if (!isEmpty_1(matchValue_5[0])) {\r\n if (head(matchValue_5[0]) != null) {\r\n pattern_matching_result_2 = 0;\r\n t1_8 = tail(matchValue_5[0]);\r\n x1_6 = head(matchValue_5[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_5[1])) {\r\n if (head(matchValue_5[1]) != null) {\r\n pattern_matching_result_2 = 1;\r\n t2_8 = tail(matchValue_5[1]);\r\n x2_6 = head(matchValue_5[1]);\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_5[1])) {\r\n if (head(matchValue_5[1]) != null) {\r\n pattern_matching_result_2 = 1;\r\n t2_8 = tail(matchValue_5[1]);\r\n x2_6 = head(matchValue_5[1]);\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 2;\r\n }\r\n switch (pattern_matching_result_2) {\r\n case 0: {\r\n if (x1_6 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_6), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_6), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_6), 0)], t1_8);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_6))], t1_8);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_6 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_6), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_6), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_6), 0)], t2_8);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_6))], t2_8);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const c_3 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0;\r\n if (c_3 !== 0) {\r\n return c_3 | 0;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = tail(matchValue[0]);\r\n l2_mut = tail(matchValue[1]);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n }\r\n else {\r\n const x2 = head(matchValue[1]);\r\n const matchValue_1 = [l1, l2];\r\n let pattern_matching_result_3, t1_2, x1, t2_2, x2_1;\r\n if (!isEmpty_1(matchValue_1[0])) {\r\n if (head(matchValue_1[0]) != null) {\r\n pattern_matching_result_3 = 0;\r\n t1_2 = tail(matchValue_1[0]);\r\n x1 = head(matchValue_1[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_1[1])) {\r\n if (head(matchValue_1[1]) != null) {\r\n pattern_matching_result_3 = 1;\r\n t2_2 = tail(matchValue_1[1]);\r\n x2_1 = head(matchValue_1[1]);\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_1[1])) {\r\n if (head(matchValue_1[1]) != null) {\r\n pattern_matching_result_3 = 1;\r\n t2_2 = tail(matchValue_1[1]);\r\n x2_1 = head(matchValue_1[1]);\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_3 = 2;\r\n }\r\n switch (pattern_matching_result_3) {\r\n case 0: {\r\n if (x1 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1), 0)], t1_2);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1))], t1_2);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_1 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_1), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_1), 0)], t2_2);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_1))], t2_2);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n }\r\n else if (head(matchValue[0]) != null) {\r\n const x1_1 = head(matchValue[0]);\r\n const matchValue_2 = [l1, l2];\r\n let pattern_matching_result_4, t1_4, x1_2, t2_4, x2_2;\r\n if (!isEmpty_1(matchValue_2[0])) {\r\n if (head(matchValue_2[0]) != null) {\r\n pattern_matching_result_4 = 0;\r\n t1_4 = tail(matchValue_2[0]);\r\n x1_2 = head(matchValue_2[0]);\r\n }\r\n else if (!isEmpty_1(matchValue_2[1])) {\r\n if (head(matchValue_2[1]) != null) {\r\n pattern_matching_result_4 = 1;\r\n t2_4 = tail(matchValue_2[1]);\r\n x2_2 = head(matchValue_2[1]);\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else if (!isEmpty_1(matchValue_2[1])) {\r\n if (head(matchValue_2[1]) != null) {\r\n pattern_matching_result_4 = 1;\r\n t2_4 = tail(matchValue_2[1]);\r\n x2_2 = head(matchValue_2[1]);\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 2;\r\n }\r\n switch (pattern_matching_result_4) {\r\n case 0: {\r\n if (x1_2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1_2), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x1_2), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1_2), 0)], t1_4);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_2))], t1_4);\r\n l2_mut = l2;\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 1: {\r\n if (x2_2 instanceof SetTreeNode$1) {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2_2), SetTreeNode$1_$ctor_Z6E7BE5F7(SetTreeLeaf$1__get_Key(x2_2), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2_2), 0)], t2_4);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = l1;\r\n l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_2))], t2_4);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error(\"unexpected state in SetTree.compareStacks\"));\r\n }\r\n }\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n l1_mut = tail(matchValue[0]);\r\n l2_mut = tail(matchValue[1]);\r\n continue SetTreeModule_compareStacks;\r\n }\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n else if (isEmpty_1(matchValue[1])) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_compare(comparer, t1, t2) {\r\n if (t1 == null) {\r\n if (t2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (t2 == null) {\r\n return 1;\r\n }\r\n else {\r\n return SetTreeModule_compareStacks(comparer, singleton_1(t1), singleton_1(t2)) | 0;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_choose(s) {\r\n return SetTreeModule_minimumElement(s);\r\n}\r\n\r\nexport function SetTreeModule_toList(t) {\r\n const loop = (t$0027_mut, acc_mut) => {\r\n loop:\r\n while (true) {\r\n const t$0027 = t$0027_mut, acc = acc_mut;\r\n if (t$0027 != null) {\r\n const t2 = t$0027;\r\n if (t2 instanceof SetTreeNode$1) {\r\n t$0027_mut = SetTreeNode$1__get_Left(t2);\r\n acc_mut = cons(SetTreeLeaf$1__get_Key(t2), loop(SetTreeNode$1__get_Right(t2), acc));\r\n continue loop;\r\n }\r\n else {\r\n return cons(SetTreeLeaf$1__get_Key(t2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(t, empty_1());\r\n}\r\n\r\nexport function SetTreeModule_copyToArray(s, arr, i) {\r\n let j = i;\r\n SetTreeModule_iter((x) => {\r\n arr[j] = x;\r\n j = ((j + 1) | 0);\r\n }, s);\r\n}\r\n\r\nexport function SetTreeModule_toArray(s) {\r\n const n = SetTreeModule_count(s) | 0;\r\n const res = fill(new Array(n), 0, n, null);\r\n SetTreeModule_copyToArray(s, res, 0);\r\n return res;\r\n}\r\n\r\nexport function SetTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) {\r\n SetTreeModule_mkFromEnumerator:\r\n while (true) {\r\n const comparer = comparer_mut, acc = acc_mut, e = e_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n comparer_mut = comparer;\r\n acc_mut = SetTreeModule_add(comparer, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), acc);\r\n e_mut = e;\r\n continue SetTreeModule_mkFromEnumerator;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function SetTreeModule_ofArray(comparer, l) {\r\n return fold_1((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l);\r\n}\r\n\r\nexport function SetTreeModule_ofList(comparer, l) {\r\n return fold_2((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l);\r\n}\r\n\r\nexport function SetTreeModule_ofSeq(comparer, c) {\r\n if (isArrayLike(c)) {\r\n return SetTreeModule_ofArray(comparer, c);\r\n }\r\n else if (c instanceof FSharpList) {\r\n return SetTreeModule_ofList(comparer, c);\r\n }\r\n else {\r\n const ie = getEnumerator(c);\r\n try {\r\n return SetTreeModule_mkFromEnumerator(comparer, SetTreeModule_empty(), ie);\r\n }\r\n finally {\r\n ie.Dispose();\r\n }\r\n }\r\n}\r\n\r\nexport class FSharpSet {\r\n constructor(comparer, tree) {\r\n this.comparer = comparer;\r\n this.tree = tree;\r\n }\r\n GetHashCode() {\r\n const this$ = this;\r\n return FSharpSet__ComputeHashCode(this$) | 0;\r\n }\r\n Equals(that) {\r\n const this$ = this;\r\n return (that instanceof FSharpSet) && (SetTreeModule_compare(FSharpSet__get_Comparer(this$), FSharpSet__get_Tree(this$), FSharpSet__get_Tree(that)) === 0);\r\n }\r\n toString() {\r\n const this$ = this;\r\n return (\"set [\" + join(\"; \", map_1((x) => {\r\n let copyOfStruct = x;\r\n return toString(copyOfStruct);\r\n }, this$))) + \"]\";\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"FSharpSet\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n CompareTo(that) {\r\n const s = this;\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(s), FSharpSet__get_Tree(s), FSharpSet__get_Tree(that)) | 0;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](x) {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](x) {\r\n throw (new Error(\"ReadOnlyCollection\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](x) {\r\n const s = this;\r\n return SetTreeModule_mem(FSharpSet__get_Comparer(s), x, FSharpSet__get_Tree(s));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](arr, i) {\r\n const s = this;\r\n SetTreeModule_copyToArray(FSharpSet__get_Tree(s), arr, i);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return true;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n [\"System.Collections.Generic.IReadOnlyCollection`1.get_Count\"]() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n GetEnumerator() {\r\n const s = this;\r\n return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s));\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const s = this;\r\n return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s));\r\n }\r\n get size() {\r\n const s = this;\r\n return FSharpSet__get_Count(s) | 0;\r\n }\r\n add(k) {\r\n const s = this;\r\n throw (new Error(\"Set cannot be mutated\"));\r\n return s;\r\n }\r\n clear() {\r\n throw (new Error(\"Set cannot be mutated\"));\r\n }\r\n delete(k) {\r\n throw (new Error(\"Set cannot be mutated\"));\r\n return false;\r\n }\r\n has(k) {\r\n const s = this;\r\n return FSharpSet__Contains(s, k);\r\n }\r\n keys() {\r\n const s = this;\r\n return map_1((x) => x, s);\r\n }\r\n values() {\r\n const s = this;\r\n return map_1((x) => x, s);\r\n }\r\n entries() {\r\n const s = this;\r\n return map_1((v) => [v, v], s);\r\n }\r\n forEach(f, thisArg) {\r\n const s = this;\r\n iterate_1((x) => {\r\n f(x, x, s);\r\n }, s);\r\n }\r\n}\r\n\r\nexport function FSharpSet$reflection(gen0) {\r\n return class_type(\"Set.FSharpSet\", [gen0], FSharpSet);\r\n}\r\n\r\nexport function FSharpSet_$ctor(comparer, tree) {\r\n return new FSharpSet(comparer, tree);\r\n}\r\n\r\nexport function FSharpSet__get_Comparer(set$) {\r\n return set$.comparer;\r\n}\r\n\r\nexport function FSharpSet__get_Tree(set$) {\r\n return set$.tree;\r\n}\r\n\r\nexport function FSharpSet_Empty(comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_empty());\r\n}\r\n\r\nexport function FSharpSet__Add(s, value) {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_add(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__Remove(s, value) {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_remove(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__get_Count(s) {\r\n return SetTreeModule_count(FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Contains(s, value) {\r\n return SetTreeModule_mem(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Iterate(s, x) {\r\n SetTreeModule_iter(x, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__Fold(s, f, z) {\r\n const f_1 = f;\r\n return SetTreeModule_fold((x, z_1) => f_1(z_1, x), z, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__get_IsEmpty(s) {\r\n return FSharpSet__get_Tree(s) == null;\r\n}\r\n\r\nexport function FSharpSet__Partition(s, f) {\r\n if (FSharpSet__get_Tree(s) == null) {\r\n return [s, s];\r\n }\r\n else {\r\n const patternInput = SetTreeModule_partition(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s));\r\n return [FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[0]), FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[1])];\r\n }\r\n}\r\n\r\nexport function FSharpSet__Filter(s, f) {\r\n if (FSharpSet__get_Tree(s) == null) {\r\n return s;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_filter(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s)));\r\n }\r\n}\r\n\r\nexport function FSharpSet__Map(s, f, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_fold((acc, k) => SetTreeModule_add(comparer, f(k), acc), SetTreeModule_empty(), FSharpSet__get_Tree(s)));\r\n}\r\n\r\nexport function FSharpSet__Exists(s, f) {\r\n return SetTreeModule_exists(f, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet__ForAll(s, f) {\r\n return SetTreeModule_forall(f, FSharpSet__get_Tree(s));\r\n}\r\n\r\nexport function FSharpSet_op_Subtraction(set1, set2) {\r\n if (FSharpSet__get_Tree(set1) == null) {\r\n return set1;\r\n }\r\n else if (FSharpSet__get_Tree(set2) == null) {\r\n return set1;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_diff(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_op_Addition(set1, set2) {\r\n if (FSharpSet__get_Tree(set2) == null) {\r\n return set1;\r\n }\r\n else if (FSharpSet__get_Tree(set1) == null) {\r\n return set2;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_union(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_Intersection(a, b) {\r\n if (FSharpSet__get_Tree(b) == null) {\r\n return b;\r\n }\r\n else if (FSharpSet__get_Tree(a) == null) {\r\n return a;\r\n }\r\n else {\r\n return FSharpSet_$ctor(FSharpSet__get_Comparer(a), SetTreeModule_intersection(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)));\r\n }\r\n}\r\n\r\nexport function FSharpSet_IntersectionMany(sets) {\r\n return reduce((s1, s2) => FSharpSet_Intersection(s1, s2), sets);\r\n}\r\n\r\nexport function FSharpSet_Equality(a, b) {\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)) === 0;\r\n}\r\n\r\nexport function FSharpSet_Compare(a, b) {\r\n return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b));\r\n}\r\n\r\nexport function FSharpSet__get_Choose(x) {\r\n return SetTreeModule_choose(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__get_MinimumElement(x) {\r\n return SetTreeModule_minimumElement(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__get_MaximumElement(x) {\r\n return SetTreeModule_maximumElement(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__IsSubsetOf(x, otherSet) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet));\r\n}\r\n\r\nexport function FSharpSet__IsSupersetOf(x, otherSet) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__IsProperSubsetOf(x, otherSet) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet));\r\n}\r\n\r\nexport function FSharpSet__IsProperSupersetOf(x, otherSet) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ToList(x) {\r\n return SetTreeModule_toList(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ToArray(x) {\r\n return SetTreeModule_toArray(FSharpSet__get_Tree(x));\r\n}\r\n\r\nexport function FSharpSet__ComputeHashCode(this$) {\r\n let y;\r\n let res = 0;\r\n const enumerator = getEnumerator(this$);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x_1 = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n res = (((y = (structuralHash(x_1) | 0), ((res << 1) + y) + 631)) | 0);\r\n }\r\n }\r\n finally {\r\n enumerator.Dispose();\r\n }\r\n return Math.abs(res) | 0;\r\n}\r\n\r\nexport function isEmpty(set$) {\r\n return FSharpSet__get_IsEmpty(set$);\r\n}\r\n\r\nexport function contains(element, set$) {\r\n return FSharpSet__Contains(set$, element);\r\n}\r\n\r\nexport function add(value, set$) {\r\n return FSharpSet__Add(set$, value);\r\n}\r\n\r\nexport function singleton(value, comparer) {\r\n return FSharpSet__Add(FSharpSet_Empty(comparer), value);\r\n}\r\n\r\nexport function remove(value, set$) {\r\n return FSharpSet__Remove(set$, value);\r\n}\r\n\r\nexport function union(set1, set2) {\r\n return FSharpSet_op_Addition(set1, set2);\r\n}\r\n\r\nexport function unionMany(sets, comparer) {\r\n return fold_3((s1, s2) => FSharpSet_op_Addition(s1, s2), FSharpSet_Empty(comparer), sets);\r\n}\r\n\r\nexport function intersect(set1, set2) {\r\n return FSharpSet_Intersection(set1, set2);\r\n}\r\n\r\nexport function intersectMany(sets) {\r\n return FSharpSet_IntersectionMany(sets);\r\n}\r\n\r\nexport function iterate(action, set$) {\r\n FSharpSet__Iterate(set$, action);\r\n}\r\n\r\nexport function empty(comparer) {\r\n return FSharpSet_Empty(comparer);\r\n}\r\n\r\nexport function forAll(predicate, set$) {\r\n return FSharpSet__ForAll(set$, predicate);\r\n}\r\n\r\nexport function exists(predicate, set$) {\r\n return FSharpSet__Exists(set$, predicate);\r\n}\r\n\r\nexport function filter(predicate, set$) {\r\n return FSharpSet__Filter(set$, predicate);\r\n}\r\n\r\nexport function partition(predicate, set$) {\r\n return FSharpSet__Partition(set$, predicate);\r\n}\r\n\r\nexport function fold(folder, state, set$) {\r\n return SetTreeModule_fold(folder, state, FSharpSet__get_Tree(set$));\r\n}\r\n\r\nexport function foldBack(folder, set$, state) {\r\n return SetTreeModule_foldBack(folder, FSharpSet__get_Tree(set$), state);\r\n}\r\n\r\nexport function map(mapping, set$, comparer) {\r\n return FSharpSet__Map(set$, mapping, comparer);\r\n}\r\n\r\nexport function count(set$) {\r\n return FSharpSet__get_Count(set$);\r\n}\r\n\r\nexport function ofList(elements, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements));\r\n}\r\n\r\nexport function ofArray(array, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofArray(comparer, array));\r\n}\r\n\r\nexport function toList(set$) {\r\n return FSharpSet__ToList(set$);\r\n}\r\n\r\nexport function toArray(set$) {\r\n return FSharpSet__ToArray(set$);\r\n}\r\n\r\nexport function toSeq(set$) {\r\n return map_1((x) => x, set$);\r\n}\r\n\r\nexport function ofSeq(elements, comparer) {\r\n return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements));\r\n}\r\n\r\nexport function difference(set1, set2) {\r\n return FSharpSet_op_Subtraction(set1, set2);\r\n}\r\n\r\nexport function isSubset(set1, set2) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2));\r\n}\r\n\r\nexport function isSuperset(set1, set2) {\r\n return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1));\r\n}\r\n\r\nexport function isProperSubset(set1, set2) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2));\r\n}\r\n\r\nexport function isProperSuperset(set1, set2) {\r\n return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1));\r\n}\r\n\r\nexport function minElement(set$) {\r\n return FSharpSet__get_MinimumElement(set$);\r\n}\r\n\r\nexport function maxElement(set$) {\r\n return FSharpSet__get_MaximumElement(set$);\r\n}\r\n\r\nexport function unionWith(s1, s2) {\r\n return fold_3((acc, x) => acc.add(x), s1, s2);\r\n}\r\n\r\nexport function newMutableSetWith(s1, s2) {\r\n if (s1 instanceof HashSet) {\r\n return HashSet_$ctor_Z6150332D(s2, HashSet__get_Comparer(s1));\r\n }\r\n else {\r\n return new Set(s2);\r\n }\r\n}\r\n\r\nexport function intersectWith(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n iterate_1((x) => {\r\n if (!s2_1.has(x)) {\r\n s1.delete(x);\r\n }\r\n }, s1.values());\r\n}\r\n\r\nexport function exceptWith(s1, s2) {\r\n iterate_1((x) => {\r\n s1.delete(x);\r\n }, s2);\r\n}\r\n\r\nexport function isSubsetOf(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n return forAll_1((arg00) => s2_1.has(arg00), s1.values());\r\n}\r\n\r\nexport function isSupersetOf(s1, s2) {\r\n return forAll_1((arg00) => s1.has(arg00), s2);\r\n}\r\n\r\nexport function isProperSubsetOf(s1, s2) {\r\n const s2_1 = newMutableSetWith(s1, s2);\r\n if (s2_1.size > s1.size) {\r\n return forAll_1((arg00) => s2_1.has(arg00), s1.values());\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function isProperSupersetOf(s1, s2) {\r\n const s2_1 = cache(s2);\r\n if (exists_1((arg) => (!s1.has(arg)), s2_1)) {\r\n return forAll_1((arg00_1) => s1.has(arg00_1), s2_1);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\n","import { toFail, printf, toText, join } from \"../fable-library.3.6.3/String.js\";\r\nimport { Result_Map, FSharpResult$2 } from \"../fable-library.3.6.3/Choice.js\";\r\nimport { Util_CachedDecoders, Util_Cache$1__GetOrAdd_43981464, CaseStrategy, Util_Casing_convert, ErrorReason } from \"./Types.fs.js\";\r\nimport { tryParse as tryParse_2 } from \"../fable-library.3.6.3/Guid.js\";\r\nimport { toString as toString_12, FSharpRef } from \"../fable-library.3.6.3/Types.js\";\r\nimport { tryParse as tryParse_3 } from \"../fable-library.3.6.3/Int32.js\";\r\nimport { tryParse as tryParse_4, fromInt, fromNumber, toNumber, fromBits } from \"../fable-library.3.6.3/Long.js\";\r\nimport { parse, fromInt32 } from \"../fable-library.3.6.3/BigInt.js\";\r\nimport { tryParse as tryParse_5 } from \"../fable-library.3.6.3/Decimal.js\";\r\nimport Decimal from \"../fable-library.3.6.3/Decimal.js\";\r\nimport { toUniversalTime, tryParse as tryParse_6, minValue } from \"../fable-library.3.6.3/Date.js\";\r\nimport { tryParse as tryParse_7, minValue as minValue_1 } from \"../fable-library.3.6.3/DateOffset.js\";\r\nimport { tryParse as tryParse_8 } from \"../fable-library.3.6.3/TimeSpan.js\";\r\nimport { map as map_4, value as value_40, defaultArg, some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { ofArray, toArray, map as map_1, length, singleton, append as append_1, tail as tail_1, head as head_1, isEmpty, ofSeq, empty, reverse, fold, tryLast, cons } from \"../fable-library.3.6.3/List.js\";\r\nimport { int16ToString, numberHash, mapCurriedArgs, compare, int32ToString, uncurry } from \"../fable-library.3.6.3/Util.js\";\r\nimport { map as map_2, tryFind, foldBack2, foldBack, fill, fold as fold_1 } from \"../fable-library.3.6.3/Array.js\";\r\nimport { contains, fold as fold_2, toList, append, reverse as reverse_1 } from \"../fable-library.3.6.3/Seq.js\";\r\nimport { empty as empty_1, map as map_3, tryFind as tryFind_1, add, ofSeq as ofSeq_1, ofList } from \"../fable-library.3.6.3/Map.js\";\r\nimport { getGenerics, getGenericTypeDefinition, makeTuple, getTupleElements, isTuple, isGenericType, parseEnum, getEnumValues, getEnumUnderlyingType, isEnum, getElementType, isArray, isUnion, makeRecord, getRecordElements, isRecord, fullName, getUnionCaseFields, makeUnion as makeUnion_1, getUnionCases, name as name_3, class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { ofSeq as ofSeq_2 } from \"../fable-library.3.6.3/Set.js\";\r\n\r\nexport function Helpers_isUndefined(o) {\r\n return (typeof o) === \"undefined\";\r\n}\r\n\r\nfunction genericMsg(msg, value_1, newLine) {\r\n try {\r\n return (((\"Expecting \" + msg) + \" but instead got:\") + (newLine ? \"\\n\" : \" \")) + (JSON.stringify(value_1, null, 4) + '');\r\n }\r\n catch (matchValue) {\r\n return ((\"Expecting \" + msg) + \" but decoder failed. Couldn\\u0027t report given value due to circular structure.\") + (newLine ? \"\\n\" : \" \");\r\n }\r\n}\r\n\r\nfunction errorToString(path, error) {\r\n const reason_1 = (error.tag === 2) ? genericMsg(error.fields[0], error.fields[1], true) : ((error.tag === 1) ? ((genericMsg(error.fields[0], error.fields[1], false) + \"\\nReason: \") + error.fields[2]) : ((error.tag === 3) ? genericMsg(error.fields[0], error.fields[1], true) : ((error.tag === 4) ? (genericMsg(error.fields[0], error.fields[1], true) + ((\"\\nNode `\" + error.fields[2]) + \"` is unkown.\")) : ((error.tag === 5) ? (((\"Expecting \" + error.fields[0]) + \".\\n\") + (JSON.stringify(error.fields[1], null, 4) + '')) : ((error.tag === 7) ? (\"The following errors were found:\\n\\n\" + join(\"\\n\\n\", error.fields[0])) : ((error.tag === 6) ? (\"The following `failure` occurred with the decoder: \" + error.fields[0]) : genericMsg(error.fields[0], error.fields[1], false)))))));\r\n if (error.tag === 7) {\r\n return reason_1;\r\n }\r\n else {\r\n return ((\"Error at: `\" + path) + \"`\\n\") + reason_1;\r\n }\r\n}\r\n\r\nexport function fromValue(path, decoder, value_1) {\r\n const matchValue = decoder(path, value_1);\r\n if (matchValue.tag === 1) {\r\n const error = matchValue.fields[0];\r\n return new FSharpResult$2(1, errorToString(error[0], error[1]));\r\n }\r\n else {\r\n return new FSharpResult$2(0, matchValue.fields[0]);\r\n }\r\n}\r\n\r\nexport function fromString(decoder, value_1) {\r\n try {\r\n return fromValue(\"$\", decoder, JSON.parse(value_1));\r\n }\r\n catch (matchValue) {\r\n if (matchValue instanceof SyntaxError) {\r\n return new FSharpResult$2(1, \"Given an invalid JSON: \" + matchValue.message);\r\n }\r\n else {\r\n throw matchValue;\r\n }\r\n }\r\n}\r\n\r\nexport function unsafeFromString(decoder, value_1) {\r\n const matchValue = fromString(decoder, value_1);\r\n if (matchValue.tag === 1) {\r\n throw (new Error(matchValue.fields[0]));\r\n }\r\n else {\r\n return matchValue.fields[0];\r\n }\r\n}\r\n\r\nexport function decodeValue(path, decoder) {\r\n const decoder_1 = decoder;\r\n return (value_1) => fromValue(path, decoder_1, value_1);\r\n}\r\n\r\nexport function decodeString(decoder) {\r\n const decoder_1 = decoder;\r\n return (value_1) => fromString(decoder_1, value_1);\r\n}\r\n\r\nexport function string(path, value_1) {\r\n if ((typeof value_1) === \"string\") {\r\n return new FSharpResult$2(0, value_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a string\", value_1)]);\r\n }\r\n}\r\n\r\nexport function guid(path, value_1) {\r\n if ((typeof value_1) === \"string\") {\r\n let matchValue;\r\n let outArg = \"00000000-0000-0000-0000-000000000000\";\r\n matchValue = [tryParse_2(value_1, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return new FSharpResult$2(0, matchValue[1]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a guid\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a guid\", value_1)]);\r\n }\r\n}\r\n\r\nexport function unit(path, value_1) {\r\n if (value_1 == null) {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"null\", value_1)]);\r\n }\r\n}\r\n\r\nexport const sbyte = (path) => ((value_2) => {\r\n const name_1 = \"a sbyte\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((-128 <= value_4) && (value_4 <= 127)) ? (new FSharpResult$2(0, (value_4 + 0x80 & 0xFF) - 0x80)) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, false, 8, new FSharpRef(() => outArg, (v) => {\r\n outArg = (v | 0);\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const byte = (path) => ((value_2) => {\r\n const name_1 = \"a byte\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((0 <= value_4) && (value_4 <= 255)) ? (new FSharpResult$2(0, value_4 & 0xFF)) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, true, 8, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const int16 = (path) => ((value_2) => {\r\n const name_1 = \"an int16\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((-32768 <= value_4) && (value_4 <= 32767)) ? (new FSharpResult$2(0, (value_4 + 0x8000 & 0xFFFF) - 0x8000)) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, false, 16, new FSharpRef(() => outArg, (v) => {\r\n outArg = (v | 0);\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const uint16 = (path) => ((value_2) => {\r\n const name_1 = \"an uint16\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((0 <= value_4) && (value_4 <= 65535)) ? (new FSharpResult$2(0, value_4 & 0xFFFF)) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, true, 16, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const int = (path) => ((value_2) => {\r\n const name_1 = \"an int\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((-2147483648 <= value_4) && (value_4 <= 2147483647)) ? (new FSharpResult$2(0, ~(~value_4))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, false, 32, new FSharpRef(() => outArg, (v) => {\r\n outArg = (v | 0);\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const uint32 = (path) => ((value_2) => {\r\n const name_1 = \"an uint32\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((0 <= value_4) && (value_4 <= 4294967295)) ? (new FSharpResult$2(0, value_4 >>> 0)) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_3(value_3, 511, true, 32, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n});\r\n\r\nexport const int64 = (() => {\r\n const min = fromBits(0, 2147483648, false);\r\n const max = fromBits(4294967295, 2147483647, false);\r\n return (path) => ((value_2) => {\r\n const name_1 = \"an int64\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((toNumber(min) <= value_4) && (value_4 <= toNumber(max))) ? (new FSharpResult$2(0, fromNumber(value_4, false))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = fromInt(0);\r\n matchValue = [tryParse_4(value_3, 511, false, 64, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n });\r\n})();\r\n\r\nexport const uint64 = (() => {\r\n const min = fromBits(0, 0, true);\r\n const max = fromBits(4294967295, 4294967295, true);\r\n return (path) => ((value_2) => {\r\n const name_1 = \"an uint64\";\r\n const path_1 = path;\r\n const value_3 = value_2;\r\n if ((typeof value_3) === \"number\") {\r\n const value_4 = value_3;\r\n return (isFinite(value_4) && Math.floor(value_4) === value_4) ? (((toNumber(min) <= value_4) && (value_4 <= toNumber(max))) ? (new FSharpResult$2(0, fromNumber(value_4, true))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value was either too large or too small for \" + name_1)]))) : (new FSharpResult$2(1, [path_1, new ErrorReason(1, name_1, value_4, \"Value is not an integral value\")]));\r\n }\r\n else if ((typeof value_3) === \"string\") {\r\n let matchValue;\r\n let outArg = fromInt(0);\r\n matchValue = [tryParse_4(value_3, 511, true, 64, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n return matchValue[0] ? (new FSharpResult$2(0, matchValue[1])) : (new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, name_1, value_3)]);\r\n }\r\n });\r\n})();\r\n\r\nexport function bigint(path, value_1) {\r\n if ((typeof value_1) === \"number\") {\r\n return new FSharpResult$2(0, fromInt32(value_1));\r\n }\r\n else if ((typeof value_1) === \"string\") {\r\n try {\r\n return new FSharpResult$2(0, parse(value_1));\r\n }\r\n catch (matchValue) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a bigint\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a bigint\", value_1)]);\r\n }\r\n}\r\n\r\nexport function bool(path, value_1) {\r\n if ((typeof value_1) === \"boolean\") {\r\n return new FSharpResult$2(0, value_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a boolean\", value_1)]);\r\n }\r\n}\r\n\r\nexport function float(path, value_1) {\r\n if ((typeof value_1) === \"number\") {\r\n return new FSharpResult$2(0, value_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a float\", value_1)]);\r\n }\r\n}\r\n\r\nexport function float32(path, value_1) {\r\n if ((typeof value_1) === \"number\") {\r\n return new FSharpResult$2(0, value_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a float32\", value_1)]);\r\n }\r\n}\r\n\r\nexport function decimal(path, value_1) {\r\n if ((typeof value_1) === \"number\") {\r\n return new FSharpResult$2(0, new Decimal(value_1));\r\n }\r\n else if ((typeof value_1) === \"string\") {\r\n let matchValue;\r\n let outArg = new Decimal(0);\r\n matchValue = [tryParse_5(value_1, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return new FSharpResult$2(0, matchValue[1]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a decimal\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a decimal\", value_1)]);\r\n }\r\n}\r\n\r\nexport function datetime(path, value_1) {\r\n if ((typeof value_1) === \"string\") {\r\n let matchValue;\r\n let outArg = minValue();\r\n matchValue = [tryParse_6(value_1, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return new FSharpResult$2(0, toUniversalTime(matchValue[1]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a datetime\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a datetime\", value_1)]);\r\n }\r\n}\r\n\r\nexport function datetimeOffset(path, value_1) {\r\n if ((typeof value_1) === \"string\") {\r\n let matchValue;\r\n let outArg = minValue_1();\r\n matchValue = [tryParse_7(value_1, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return new FSharpResult$2(0, matchValue[1]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a datetimeoffset\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a datetime\", value_1)]);\r\n }\r\n}\r\n\r\nexport function timespan(path, value_1) {\r\n if ((typeof value_1) === \"string\") {\r\n let matchValue;\r\n let outArg = 0;\r\n matchValue = [tryParse_8(value_1, new FSharpRef(() => outArg, (v) => {\r\n outArg = v;\r\n })), outArg];\r\n if (matchValue[0]) {\r\n return new FSharpResult$2(0, matchValue[1]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a timespan\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a timespan\", value_1)]);\r\n }\r\n}\r\n\r\nfunction decodeMaybeNull(path, decoder, value_1) {\r\n const matchValue = decoder(path, value_1);\r\n if (matchValue.tag === 1) {\r\n if (value_1 == null) {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else if (matchValue.tag === 1) {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n else {\r\n throw (new Error(\"Match failure\"));\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(0, some(matchValue.fields[0]));\r\n }\r\n}\r\n\r\nexport function optional(fieldName, decoder, path, value_1) {\r\n if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {\r\n const fieldValue = value_1[fieldName];\r\n if (Helpers_isUndefined(fieldValue)) {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else {\r\n return decodeMaybeNull((path + \".\") + fieldName, decoder, fieldValue);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(2, \"an object\", value_1)]);\r\n }\r\n}\r\n\r\nfunction badPathError(fieldNames, currentPath, value_1) {\r\n return new FSharpResult$2(1, [defaultArg(currentPath, join(\".\", cons(\"$\", fieldNames))), new ErrorReason(4, (\"an object with path `\" + join(\".\", fieldNames)) + \"`\", value_1, defaultArg(tryLast(fieldNames), \"\"))]);\r\n}\r\n\r\nexport function optionalAt(fieldNames, decoder, firstPath, firstValue) {\r\n const _arg1 = fold(uncurry(2, (tupledArg) => {\r\n const curPath = tupledArg[0];\r\n const curValue = tupledArg[1];\r\n const res = tupledArg[2];\r\n return (field_1) => ((res == null) ? ((curValue == null) ? [curPath, curValue, badPathError(fieldNames, curPath, firstValue)] : ((curValue === null ? false : (Object.getPrototypeOf(curValue || false) === Object.prototype)) ? [(curPath + \".\") + field_1, curValue[field_1], void 0] : [curPath, curValue, new FSharpResult$2(1, [curPath, new ErrorReason(2, \"an object\", curValue)])])) : [curPath, curValue, res]);\r\n }), [firstPath, firstValue, void 0], fieldNames);\r\n if (_arg1[2] == null) {\r\n const lastValue = _arg1[1];\r\n if (Helpers_isUndefined(lastValue)) {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else {\r\n return decodeMaybeNull(_arg1[0], decoder, lastValue);\r\n }\r\n }\r\n else {\r\n return _arg1[2];\r\n }\r\n}\r\n\r\nexport function field(fieldName, decoder, path, value_1) {\r\n if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {\r\n const fieldValue = value_1[fieldName];\r\n if (Helpers_isUndefined(fieldValue)) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(3, (\"an object with a field named `\" + fieldName) + \"`\", value_1)]);\r\n }\r\n else {\r\n return decoder((path + \".\") + fieldName, fieldValue);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(2, \"an object\", value_1)]);\r\n }\r\n}\r\n\r\nexport function at(fieldNames, decoder, firstPath, firstValue) {\r\n const _arg1 = fold(uncurry(2, (tupledArg) => {\r\n const curPath = tupledArg[0];\r\n const curValue = tupledArg[1];\r\n const res = tupledArg[2];\r\n return (field_1) => {\r\n if (res == null) {\r\n if (curValue == null) {\r\n return [curPath, curValue, badPathError(fieldNames, curPath, firstValue)];\r\n }\r\n else if (curValue === null ? false : (Object.getPrototypeOf(curValue || false) === Object.prototype)) {\r\n const curValue_1 = curValue[field_1];\r\n return Helpers_isUndefined(curValue_1) ? [curPath, curValue_1, badPathError(fieldNames, void 0, firstValue)] : [(curPath + \".\") + field_1, curValue_1, void 0];\r\n }\r\n else {\r\n return [curPath, curValue, new FSharpResult$2(1, [curPath, new ErrorReason(2, \"an object\", curValue)])];\r\n }\r\n }\r\n else {\r\n return [curPath, curValue, res];\r\n }\r\n };\r\n }), [firstPath, firstValue, void 0], fieldNames);\r\n if (_arg1[2] == null) {\r\n return decoder(_arg1[0], _arg1[1]);\r\n }\r\n else {\r\n return _arg1[2];\r\n }\r\n}\r\n\r\nexport function index(requestedIndex, decoder, path, value_1) {\r\n let copyOfStruct;\r\n const currentPath = ((path + \".[\") + int32ToString(requestedIndex)) + \"]\";\r\n if (Array.isArray(value_1)) {\r\n const vArray = value_1;\r\n if (requestedIndex < vArray.length) {\r\n return decoder(currentPath, vArray[requestedIndex]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [currentPath, new ErrorReason(5, (((\"a longer array. Need index `\" + int32ToString(requestedIndex)) + \"` but there are only `\") + ((copyOfStruct = vArray.length, int32ToString(copyOfStruct)))) + \"` entries\", value_1)]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [currentPath, new ErrorReason(0, \"an array\", value_1)]);\r\n }\r\n}\r\n\r\nexport function option(decoder, path, value_1) {\r\n if (value_1 == null) {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else {\r\n return Result_Map((arg0) => some(arg0), decoder(path, value_1));\r\n }\r\n}\r\n\r\nexport function list(decoder, path, value_1) {\r\n if (Array.isArray(value_1)) {\r\n let i = -1;\r\n return Result_Map((list_1) => reverse(list_1), fold_1((acc, value_2) => {\r\n i = ((i + 1) | 0);\r\n if (acc.tag === 0) {\r\n const matchValue = decoder(((path + \".[\") + int32ToString(i)) + \"]\", value_2);\r\n if (matchValue.tag === 0) {\r\n return new FSharpResult$2(0, cons(matchValue.fields[0], acc.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, new FSharpResult$2(0, empty()), value_1));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a list\", value_1)]);\r\n }\r\n}\r\n\r\nexport function seq(decoder, path, value_1) {\r\n if (Array.isArray(value_1)) {\r\n let i = -1;\r\n return Result_Map((source) => reverse_1(source), fold_1((acc, value_2) => {\r\n i = ((i + 1) | 0);\r\n if (acc.tag === 0) {\r\n const matchValue = decoder(((path + \".[\") + int32ToString(i)) + \"]\", value_2);\r\n if (matchValue.tag === 0) {\r\n return new FSharpResult$2(0, append([matchValue.fields[0]], acc.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, new FSharpResult$2(0, []), value_1));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"a seq\", value_1)]);\r\n }\r\n}\r\n\r\nexport function array(decoder, path, value_1) {\r\n if (Array.isArray(value_1)) {\r\n let i = -1;\r\n const tokens = value_1;\r\n return fold_1((acc, value_2) => {\r\n i = ((i + 1) | 0);\r\n if (acc.tag === 0) {\r\n const acc_1 = acc.fields[0];\r\n const matchValue = decoder(((path + \".[\") + int32ToString(i)) + \"]\", value_2);\r\n if (matchValue.tag === 0) {\r\n acc_1[i] = matchValue.fields[0];\r\n return new FSharpResult$2(0, acc_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, new FSharpResult$2(0, fill(new Array(tokens.length), 0, tokens.length, null)), tokens);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"an array\", value_1)]);\r\n }\r\n}\r\n\r\nexport function keys(path, value_1) {\r\n if (value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype)) {\r\n return new FSharpResult$2(0, ofSeq(Object.keys(value_1)));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"an object\", value_1)]);\r\n }\r\n}\r\n\r\nexport function keyValuePairs(decoder, path, value_1) {\r\n const matchValue = keys(path, value_1);\r\n if (matchValue.tag === 1) {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n else {\r\n return Result_Map((list_2) => reverse(list_2), fold((acc, prop) => {\r\n if (acc.tag === 0) {\r\n const matchValue_1 = decoder(path, value_1[prop]);\r\n if (matchValue_1.tag === 0) {\r\n return new FSharpResult$2(0, cons([prop, matchValue_1.fields[0]], acc.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue_1.fields[0]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, new FSharpResult$2(0, empty()), matchValue.fields[0]));\r\n }\r\n}\r\n\r\nexport function oneOf(decoders, path, value_1) {\r\n const runner = (decoders_1_mut, errors_mut) => {\r\n runner:\r\n while (true) {\r\n const decoders_1 = decoders_1_mut, errors = errors_mut;\r\n if (isEmpty(decoders_1)) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(7, errors)]);\r\n }\r\n else {\r\n const matchValue = fromValue(path, uncurry(2, head_1(decoders_1)), value_1);\r\n if (matchValue.tag === 1) {\r\n decoders_1_mut = tail_1(decoders_1);\r\n errors_mut = append_1(errors, singleton(matchValue.fields[0]));\r\n continue runner;\r\n }\r\n else {\r\n return new FSharpResult$2(0, matchValue.fields[0]);\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return runner(decoders, empty());\r\n}\r\n\r\nexport function nil(output, path, value_1) {\r\n if (value_1 == null) {\r\n return new FSharpResult$2(0, output);\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"null\", value_1)]);\r\n }\r\n}\r\n\r\nexport function value(_arg1, v) {\r\n return new FSharpResult$2(0, v);\r\n}\r\n\r\nexport function succeed(output, _arg2, _arg1) {\r\n return new FSharpResult$2(0, output);\r\n}\r\n\r\nexport function fail(msg, path, _arg1) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(6, msg)]);\r\n}\r\n\r\nexport function andThen(cb, decoder, path, value_1) {\r\n const matchValue = decoder(path, value_1);\r\n if (matchValue.tag === 0) {\r\n return cb(matchValue.fields[0], path, value_1);\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n}\r\n\r\nexport function all(decoders, path, value_1) {\r\n const runner = (decoders_1_mut, values_mut) => {\r\n runner:\r\n while (true) {\r\n const decoders_1 = decoders_1_mut, values = values_mut;\r\n if (isEmpty(decoders_1)) {\r\n return new FSharpResult$2(0, values);\r\n }\r\n else {\r\n const matchValue = head_1(decoders_1)(path)(value_1);\r\n if (matchValue.tag === 1) {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n else {\r\n decoders_1_mut = tail_1(decoders_1);\r\n values_mut = append_1(values, singleton(matchValue.fields[0]));\r\n continue runner;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return runner(decoders, empty());\r\n}\r\n\r\nexport function map(ctor, d1, path, value_1) {\r\n const matchValue = d1(path, value_1);\r\n if (matchValue.tag === 1) {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(matchValue.fields[0]));\r\n }\r\n}\r\n\r\nexport function map2(ctor, d1, d2, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0]));\r\n }\r\n }\r\n}\r\n\r\nexport function map3(ctor, d1, d2, d3, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0]));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function map4(ctor, d1, d2, d3, d4, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1), d4(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_3 = matchValue[3];\r\n if (copyOfStruct_3.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_3.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0]));\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function map5(ctor, d1, d2, d3, d4, d5, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1), d4(path, value_1), d5(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_3 = matchValue[3];\r\n if (copyOfStruct_3.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_3.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_4 = matchValue[4];\r\n if (copyOfStruct_4.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_4.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0]));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function map6(ctor, d1, d2, d3, d4, d5, d6, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1), d4(path, value_1), d5(path, value_1), d6(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_3 = matchValue[3];\r\n if (copyOfStruct_3.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_3.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_4 = matchValue[4];\r\n if (copyOfStruct_4.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_4.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_5 = matchValue[5];\r\n if (copyOfStruct_5.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_5.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0]));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function map7(ctor, d1, d2, d3, d4, d5, d6, d7, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1), d4(path, value_1), d5(path, value_1), d6(path, value_1), d7(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_3 = matchValue[3];\r\n if (copyOfStruct_3.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_3.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_4 = matchValue[4];\r\n if (copyOfStruct_4.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_4.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_5 = matchValue[5];\r\n if (copyOfStruct_5.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_5.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_6 = matchValue[6];\r\n if (copyOfStruct_6.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_6.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0], copyOfStruct_6.fields[0]));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function map8(ctor, d1, d2, d3, d4, d5, d6, d7, d8, path, value_1) {\r\n const matchValue = [d1(path, value_1), d2(path, value_1), d3(path, value_1), d4(path, value_1), d5(path, value_1), d6(path, value_1), d7(path, value_1), d8(path, value_1)];\r\n const copyOfStruct = matchValue[0];\r\n if (copyOfStruct.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_1 = matchValue[1];\r\n if (copyOfStruct_1.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_1.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_2 = matchValue[2];\r\n if (copyOfStruct_2.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_2.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_3 = matchValue[3];\r\n if (copyOfStruct_3.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_3.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_4 = matchValue[4];\r\n if (copyOfStruct_4.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_4.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_5 = matchValue[5];\r\n if (copyOfStruct_5.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_5.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_6 = matchValue[6];\r\n if (copyOfStruct_6.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_6.fields[0]);\r\n }\r\n else {\r\n const copyOfStruct_7 = matchValue[7];\r\n if (copyOfStruct_7.tag === 1) {\r\n return new FSharpResult$2(1, copyOfStruct_7.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(0, ctor(copyOfStruct.fields[0], copyOfStruct_1.fields[0], copyOfStruct_2.fields[0], copyOfStruct_3.fields[0], copyOfStruct_4.fields[0], copyOfStruct_5.fields[0], copyOfStruct_6.fields[0], copyOfStruct_7.fields[0]));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function dict(decoder) {\r\n let d1;\r\n const decoder_1 = decoder;\r\n d1 = ((path) => ((value_1) => keyValuePairs(decoder_1, path, value_1)));\r\n return (path_1) => ((value_2) => map((elements) => ofList(elements), uncurry(2, d1), path_1, value_2));\r\n}\r\n\r\nfunction unwrapWith(errors, path, decoder, value_1) {\r\n const matchValue = decoder(path, value_1);\r\n if (matchValue.tag === 1) {\r\n void (errors.push(matchValue.fields[0]));\r\n return null;\r\n }\r\n else {\r\n return matchValue.fields[0];\r\n }\r\n}\r\n\r\nexport class Getters$1 {\r\n constructor(path, v) {\r\n let _this, _this_1;\r\n this.errors = [];\r\n this.required = ((_this = this, {\r\n Field(fieldName, decoder) {\r\n return unwrapWith(_this.errors, path, (path_1, value_1) => field(fieldName, decoder, path_1, value_1), v);\r\n },\r\n At(fieldNames, decoder_2) {\r\n return unwrapWith(_this.errors, path, (firstPath, firstValue) => at(fieldNames, decoder_2, firstPath, firstValue), v);\r\n },\r\n Raw(decoder_4) {\r\n return unwrapWith(_this.errors, path, decoder_4, v);\r\n },\r\n }));\r\n this.optional = ((_this_1 = this, {\r\n Field(fieldName_1, decoder_5) {\r\n return unwrapWith(_this_1.errors, path, (path_2, value_2) => optional(fieldName_1, decoder_5, path_2, value_2), v);\r\n },\r\n At(fieldNames_1, decoder_7) {\r\n return unwrapWith(_this_1.errors, path, (firstPath_1, firstValue_1) => optionalAt(fieldNames_1, decoder_7, firstPath_1, firstValue_1), v);\r\n },\r\n Raw(decoder_9) {\r\n const matchValue = decoder_9(path, v);\r\n if (matchValue.tag === 1) {\r\n const reason = matchValue.fields[0][1];\r\n const error = matchValue.fields[0];\r\n let pattern_matching_result, v_2;\r\n switch (reason.tag) {\r\n case 1: {\r\n pattern_matching_result = 0;\r\n v_2 = reason.fields[1];\r\n break;\r\n }\r\n case 2: {\r\n pattern_matching_result = 0;\r\n v_2 = reason.fields[1];\r\n break;\r\n }\r\n case 3:\r\n case 4: {\r\n pattern_matching_result = 1;\r\n break;\r\n }\r\n case 5:\r\n case 6:\r\n case 7: {\r\n pattern_matching_result = 2;\r\n break;\r\n }\r\n default: {\r\n pattern_matching_result = 0;\r\n v_2 = reason.fields[1];\r\n }\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n if (v_2 == null) {\r\n return void 0;\r\n }\r\n else {\r\n void (_this_1.errors.push(error));\r\n return null;\r\n }\r\n }\r\n case 1: {\r\n return void 0;\r\n }\r\n case 2: {\r\n void (_this_1.errors.push(error));\r\n return null;\r\n }\r\n }\r\n }\r\n else {\r\n return some(matchValue.fields[0]);\r\n }\r\n },\r\n }));\r\n }\r\n get Required() {\r\n const __ = this;\r\n return __.required;\r\n }\r\n get Optional() {\r\n const __ = this;\r\n return __.optional;\r\n }\r\n}\r\n\r\nexport function Getters$1$reflection(gen0) {\r\n return class_type(\"Thoth.Json.Decode.Getters`1\", [gen0], Getters$1);\r\n}\r\n\r\nexport function Getters$1_$ctor_4A51B60E(path, v) {\r\n return new Getters$1(path, v);\r\n}\r\n\r\nexport function Getters$1__get_Errors(__) {\r\n return toList(__.errors);\r\n}\r\n\r\nexport function object(builder, path, v) {\r\n const getters = Getters$1_$ctor_4A51B60E(path, v);\r\n const result = builder(getters);\r\n const matchValue = Getters$1__get_Errors(getters);\r\n if (!isEmpty(matchValue)) {\r\n const errors = matchValue;\r\n if (length(errors) > 1) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(7, map_1((tupledArg) => errorToString(tupledArg[0], tupledArg[1]), errors))]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, head_1(matchValue));\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(0, result);\r\n }\r\n}\r\n\r\nexport function tuple2(decoder1, decoder2) {\r\n let decoder_3;\r\n const decoder = decoder1;\r\n decoder_3 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_3) => ((value_4) => andThen(uncurry(3, (v1) => {\r\n let decoder_2;\r\n const decoder_1 = decoder2;\r\n decoder_2 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_2) => ((value_3) => andThen((v2, arg10$0040, arg20$0040) => succeed([v1, v2], arg10$0040, arg20$0040), uncurry(2, decoder_2), path_2, value_3));\r\n }), uncurry(2, decoder_3), path_3, value_4));\r\n}\r\n\r\nexport function tuple3(decoder1, decoder2, decoder3) {\r\n let decoder_5;\r\n const decoder = decoder1;\r\n decoder_5 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_5) => ((value_6) => andThen(uncurry(3, (v1) => {\r\n let decoder_4;\r\n const decoder_1 = decoder2;\r\n decoder_4 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_4) => ((value_5) => andThen(uncurry(3, (v2) => {\r\n let decoder_3;\r\n const decoder_2 = decoder3;\r\n decoder_3 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_3) => ((value_4) => andThen((v3, arg10$0040, arg20$0040) => succeed([v1, v2, v3], arg10$0040, arg20$0040), uncurry(2, decoder_3), path_3, value_4));\r\n }), uncurry(2, decoder_4), path_4, value_5));\r\n }), uncurry(2, decoder_5), path_5, value_6));\r\n}\r\n\r\nexport function tuple4(decoder1, decoder2, decoder3, decoder4) {\r\n let decoder_7;\r\n const decoder = decoder1;\r\n decoder_7 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_7) => ((value_8) => andThen(uncurry(3, (v1) => {\r\n let decoder_6;\r\n const decoder_1 = decoder2;\r\n decoder_6 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_6) => ((value_7) => andThen(uncurry(3, (v2) => {\r\n let decoder_5;\r\n const decoder_2 = decoder3;\r\n decoder_5 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_5) => ((value_6) => andThen(uncurry(3, (v3) => {\r\n let decoder_4;\r\n const decoder_3 = decoder4;\r\n decoder_4 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));\r\n return (path_4) => ((value_5) => andThen((v4, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4], arg10$0040, arg20$0040), uncurry(2, decoder_4), path_4, value_5));\r\n }), uncurry(2, decoder_5), path_5, value_6));\r\n }), uncurry(2, decoder_6), path_6, value_7));\r\n }), uncurry(2, decoder_7), path_7, value_8));\r\n}\r\n\r\nexport function tuple5(decoder1, decoder2, decoder3, decoder4, decoder5) {\r\n let decoder_9;\r\n const decoder = decoder1;\r\n decoder_9 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_9) => ((value_10) => andThen(uncurry(3, (v1) => {\r\n let decoder_8;\r\n const decoder_1 = decoder2;\r\n decoder_8 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_8) => ((value_9) => andThen(uncurry(3, (v2) => {\r\n let decoder_7;\r\n const decoder_2 = decoder3;\r\n decoder_7 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_7) => ((value_8) => andThen(uncurry(3, (v3) => {\r\n let decoder_6;\r\n const decoder_3 = decoder4;\r\n decoder_6 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));\r\n return (path_6) => ((value_7) => andThen(uncurry(3, (v4) => {\r\n let decoder_5;\r\n const decoder_4 = decoder5;\r\n decoder_5 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));\r\n return (path_5) => ((value_6) => andThen((v5, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5], arg10$0040, arg20$0040), uncurry(2, decoder_5), path_5, value_6));\r\n }), uncurry(2, decoder_6), path_6, value_7));\r\n }), uncurry(2, decoder_7), path_7, value_8));\r\n }), uncurry(2, decoder_8), path_8, value_9));\r\n }), uncurry(2, decoder_9), path_9, value_10));\r\n}\r\n\r\nexport function tuple6(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6) {\r\n let decoder_11;\r\n const decoder = decoder1;\r\n decoder_11 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_11) => ((value_12) => andThen(uncurry(3, (v1) => {\r\n let decoder_10;\r\n const decoder_1 = decoder2;\r\n decoder_10 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_10) => ((value_11) => andThen(uncurry(3, (v2) => {\r\n let decoder_9;\r\n const decoder_2 = decoder3;\r\n decoder_9 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_9) => ((value_10) => andThen(uncurry(3, (v3) => {\r\n let decoder_8;\r\n const decoder_3 = decoder4;\r\n decoder_8 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));\r\n return (path_8) => ((value_9) => andThen(uncurry(3, (v4) => {\r\n let decoder_7;\r\n const decoder_4 = decoder5;\r\n decoder_7 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));\r\n return (path_7) => ((value_8) => andThen(uncurry(3, (v5) => {\r\n let decoder_6;\r\n const decoder_5 = decoder6;\r\n decoder_6 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));\r\n return (path_6) => ((value_7) => andThen((v6, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6], arg10$0040, arg20$0040), uncurry(2, decoder_6), path_6, value_7));\r\n }), uncurry(2, decoder_7), path_7, value_8));\r\n }), uncurry(2, decoder_8), path_8, value_9));\r\n }), uncurry(2, decoder_9), path_9, value_10));\r\n }), uncurry(2, decoder_10), path_10, value_11));\r\n }), uncurry(2, decoder_11), path_11, value_12));\r\n}\r\n\r\nexport function tuple7(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6, decoder7) {\r\n let decoder_13;\r\n const decoder = decoder1;\r\n decoder_13 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_13) => ((value_14) => andThen(uncurry(3, (v1) => {\r\n let decoder_12;\r\n const decoder_1 = decoder2;\r\n decoder_12 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_12) => ((value_13) => andThen(uncurry(3, (v2) => {\r\n let decoder_11;\r\n const decoder_2 = decoder3;\r\n decoder_11 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_11) => ((value_12) => andThen(uncurry(3, (v3) => {\r\n let decoder_10;\r\n const decoder_3 = decoder4;\r\n decoder_10 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));\r\n return (path_10) => ((value_11) => andThen(uncurry(3, (v4) => {\r\n let decoder_9;\r\n const decoder_4 = decoder5;\r\n decoder_9 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));\r\n return (path_9) => ((value_10) => andThen(uncurry(3, (v5) => {\r\n let decoder_8;\r\n const decoder_5 = decoder6;\r\n decoder_8 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));\r\n return (path_8) => ((value_9) => andThen(uncurry(3, (v6) => {\r\n let decoder_7;\r\n const decoder_6 = decoder7;\r\n decoder_7 = ((path_6) => ((value_7) => index(6, decoder_6, path_6, value_7)));\r\n return (path_7) => ((value_8) => andThen((v7, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6, v7], arg10$0040, arg20$0040), uncurry(2, decoder_7), path_7, value_8));\r\n }), uncurry(2, decoder_8), path_8, value_9));\r\n }), uncurry(2, decoder_9), path_9, value_10));\r\n }), uncurry(2, decoder_10), path_10, value_11));\r\n }), uncurry(2, decoder_11), path_11, value_12));\r\n }), uncurry(2, decoder_12), path_12, value_13));\r\n }), uncurry(2, decoder_13), path_13, value_14));\r\n}\r\n\r\nexport function tuple8(decoder1, decoder2, decoder3, decoder4, decoder5, decoder6, decoder7, decoder8) {\r\n let decoder_15;\r\n const decoder = decoder1;\r\n decoder_15 = ((path) => ((value_1) => index(0, decoder, path, value_1)));\r\n return (path_15) => ((value_16) => andThen(uncurry(3, (v1) => {\r\n let decoder_14;\r\n const decoder_1 = decoder2;\r\n decoder_14 = ((path_1) => ((value_2) => index(1, decoder_1, path_1, value_2)));\r\n return (path_14) => ((value_15) => andThen(uncurry(3, (v2) => {\r\n let decoder_13;\r\n const decoder_2 = decoder3;\r\n decoder_13 = ((path_2) => ((value_3) => index(2, decoder_2, path_2, value_3)));\r\n return (path_13) => ((value_14) => andThen(uncurry(3, (v3) => {\r\n let decoder_12;\r\n const decoder_3 = decoder4;\r\n decoder_12 = ((path_3) => ((value_4) => index(3, decoder_3, path_3, value_4)));\r\n return (path_12) => ((value_13) => andThen(uncurry(3, (v4) => {\r\n let decoder_11;\r\n const decoder_4 = decoder5;\r\n decoder_11 = ((path_4) => ((value_5) => index(4, decoder_4, path_4, value_5)));\r\n return (path_11) => ((value_12) => andThen(uncurry(3, (v5) => {\r\n let decoder_10;\r\n const decoder_5 = decoder6;\r\n decoder_10 = ((path_5) => ((value_6) => index(5, decoder_5, path_5, value_6)));\r\n return (path_10) => ((value_11) => andThen(uncurry(3, (v6) => {\r\n let decoder_9;\r\n const decoder_6 = decoder7;\r\n decoder_9 = ((path_6) => ((value_7) => index(6, decoder_6, path_6, value_7)));\r\n return (path_9) => ((value_10) => andThen(uncurry(3, (v7) => {\r\n let decoder_8;\r\n const decoder_7 = decoder8;\r\n decoder_8 = ((path_7) => ((value_8) => index(7, decoder_7, path_7, value_8)));\r\n return (path_8) => ((value_9) => andThen((v8, arg10$0040, arg20$0040) => succeed([v1, v2, v3, v4, v5, v6, v7, v8], arg10$0040, arg20$0040), uncurry(2, decoder_8), path_8, value_9));\r\n }), uncurry(2, decoder_9), path_9, value_10));\r\n }), uncurry(2, decoder_10), path_10, value_11));\r\n }), uncurry(2, decoder_11), path_11, value_12));\r\n }), uncurry(2, decoder_12), path_12, value_13));\r\n }), uncurry(2, decoder_13), path_13, value_14));\r\n }), uncurry(2, decoder_14), path_14, value_15));\r\n }), uncurry(2, decoder_15), path_15, value_16));\r\n}\r\n\r\nfunction toMap(xs) {\r\n return ofSeq_1(xs);\r\n}\r\n\r\nfunction toSet(xs) {\r\n return ofSeq_2(xs, {\r\n Compare: (x, y) => compare(x, y),\r\n });\r\n}\r\n\r\nfunction autoObject(decoderInfos, path, value_1) {\r\n if (!(value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype))) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"an object\", value_1)]);\r\n }\r\n else {\r\n return foldBack(uncurry(2, (tupledArg) => {\r\n const name = tupledArg[0];\r\n return (acc) => ((acc.tag === 0) ? Result_Map((v) => cons(v, acc.fields[0]), tupledArg[1]((path + \".\") + name)(value_1[name])) : acc);\r\n }), decoderInfos, new FSharpResult$2(0, empty()));\r\n }\r\n}\r\n\r\nfunction autoObject2(keyDecoder, valueDecoder, path, value_1) {\r\n if (!(value_1 === null ? false : (Object.getPrototypeOf(value_1 || false) === Object.prototype))) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(0, \"an object\", value_1)]);\r\n }\r\n else {\r\n return fold_2((acc, name) => {\r\n if (acc.tag === 0) {\r\n const matchValue = keyDecoder(path, name);\r\n if (matchValue.tag === 0) {\r\n const _arg1 = valueDecoder((path + \".\") + name, value_1[name]);\r\n if (_arg1.tag === 0) {\r\n return new FSharpResult$2(0, cons([matchValue.fields[0], _arg1.fields[0]], acc.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, _arg1.fields[0]);\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, matchValue.fields[0]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, new FSharpResult$2(0, empty()), Object.keys(value_1));\r\n }\r\n}\r\n\r\nfunction mixedArray(msg, decoders, path, values) {\r\n let arg30, arg10;\r\n if (decoders.length !== values.length) {\r\n return new FSharpResult$2(1, [path, new ErrorReason(6, (arg30 = (values.length | 0), (arg10 = (decoders.length | 0), toText(printf(\"Expected %i %s but got %i\"))(arg10)(msg)(arg30))))]);\r\n }\r\n else {\r\n return foldBack2(uncurry(3, mapCurriedArgs((value_1) => ((decoder) => ((acc) => ((acc.tag === 0) ? Result_Map((v) => cons(v, acc.fields[0]), decoder(path, value_1)) : acc))), [0, [0, 2], 0])), values, decoders, new FSharpResult$2(0, empty()));\r\n }\r\n}\r\n\r\nfunction makeUnion(extra, caseStrategy, t, name, path, values) {\r\n const uci = tryFind((x) => (name_3(x) === name), getUnionCases(t, true));\r\n if (uci != null) {\r\n const uci_1 = uci;\r\n if (values.length === 0) {\r\n return new FSharpResult$2(0, makeUnion_1(uci_1, [], true));\r\n }\r\n else {\r\n return Result_Map((values_1) => makeUnion_1(uci_1, toArray(values_1), true), mixedArray(\"union fields\", map_2((fi) => autoDecoder(extra, caseStrategy, false, fi[1]), getUnionCaseFields(uci_1)), path, values));\r\n }\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path, new ErrorReason(6, ((\"Cannot find case \" + name) + \" in \") + fullName(t))]);\r\n }\r\n}\r\n\r\nfunction autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t) {\r\n const decoderRef = new FSharpRef(null);\r\n const extra_1 = add(fullName(t), decoderRef, extra);\r\n let decoder;\r\n if (isRecord(t, true)) {\r\n const decoders = map_2((fi) => [Util_Casing_convert(caseStrategy, name_3(fi)), autoDecoder(extra_1, caseStrategy, false, fi[1])], getRecordElements(t, true));\r\n decoder = ((path) => ((value_1) => Result_Map((xs) => makeRecord(t, toArray(xs), true), autoObject(decoders, path, value_1))));\r\n }\r\n else if (isUnion(t, true)) {\r\n decoder = ((path_1) => ((value_2) => {\r\n if ((typeof value_2) === \"string\") {\r\n return makeUnion(extra_1, caseStrategy, t, value_2, path_1, []);\r\n }\r\n else if (Array.isArray(value_2)) {\r\n const values = value_2;\r\n return makeUnion(extra_1, caseStrategy, t, values[0], path_1, values.slice(1, values.length));\r\n }\r\n else {\r\n return new FSharpResult$2(1, [path_1, new ErrorReason(0, \"a string or array\", value_2)]);\r\n }\r\n }));\r\n }\r\n else if (isOptional) {\r\n decoder = ((path_2) => ((value_3) => (new FSharpResult$2(1, [path_2, new ErrorReason(2, \"an extra coder for \" + fullName(t), value_3)]))));\r\n }\r\n else {\r\n let message;\r\n const arg10 = fullName(t);\r\n message = toText(printf(\"Cannot generate auto decoder for %s. Please pass an extra decoder.\"))(arg10);\r\n throw (new Error(message));\r\n }\r\n decoderRef.contents = decoder;\r\n return decoder;\r\n}\r\n\r\nfunction autoDecoder(extra, caseStrategy, isOptional, t) {\r\n let decoder_15;\r\n const fullname = fullName(t);\r\n const matchValue = tryFind_1(fullname, extra);\r\n if (matchValue == null) {\r\n if (isArray(t)) {\r\n const decoder = autoDecoder(extra, caseStrategy, false, getElementType(t));\r\n return (path_1) => ((value_2) => array(uncurry(2, decoder), path_1, value_2));\r\n }\r\n else if (isEnum(t)) {\r\n const enumType = fullName(getEnumUnderlyingType(t));\r\n if (enumType === \"System.SByte\") {\r\n return (path_2) => ((value_4) => {\r\n const t_2 = t;\r\n const path_3 = path_2;\r\n const value_5 = value_4;\r\n const matchValue_1 = sbyte(path_3)(value_5);\r\n if (matchValue_1.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_1.fields[0]);\r\n }\r\n else {\r\n const enumValue = matchValue_1.fields[0];\r\n return contains(enumValue, getEnumValues(t_2), {\r\n Equals: (x, y) => (x === y),\r\n GetHashCode: (x) => numberHash(x),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_2, enumValue.toString()))) : (new FSharpResult$2(1, [path_3, new ErrorReason(1, fullName(t_2), value_5, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else if (enumType === \"System.Byte\") {\r\n return (path_4) => ((value_7) => {\r\n const t_3 = t;\r\n const path_5 = path_4;\r\n const value_8 = value_7;\r\n const matchValue_2 = byte(path_5)(value_8);\r\n if (matchValue_2.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_2.fields[0]);\r\n }\r\n else {\r\n const enumValue_1 = matchValue_2.fields[0];\r\n return contains(enumValue_1, getEnumValues(t_3), {\r\n Equals: (x_1, y_1) => (x_1 === y_1),\r\n GetHashCode: (x_1) => numberHash(x_1),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_3, enumValue_1.toString()))) : (new FSharpResult$2(1, [path_5, new ErrorReason(1, fullName(t_3), value_8, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else if (enumType === \"System.Int16\") {\r\n return (path_6) => ((value_10) => {\r\n const t_4 = t;\r\n const path_7 = path_6;\r\n const value_11 = value_10;\r\n const matchValue_3 = int16(path_7)(value_11);\r\n if (matchValue_3.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_3.fields[0]);\r\n }\r\n else {\r\n const enumValue_2 = matchValue_3.fields[0];\r\n return contains(enumValue_2, getEnumValues(t_4), {\r\n Equals: (x_2, y_2) => (x_2 === y_2),\r\n GetHashCode: (x_2) => numberHash(x_2),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_4, int16ToString(enumValue_2)))) : (new FSharpResult$2(1, [path_7, new ErrorReason(1, fullName(t_4), value_11, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else if (enumType === \"System.UInt16\") {\r\n return (path_8) => ((value_13) => {\r\n const t_5 = t;\r\n const path_9 = path_8;\r\n const value_14 = value_13;\r\n const matchValue_4 = uint16(path_9)(value_14);\r\n if (matchValue_4.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_4.fields[0]);\r\n }\r\n else {\r\n const enumValue_3 = matchValue_4.fields[0];\r\n return contains(enumValue_3, getEnumValues(t_5), {\r\n Equals: (x_3, y_3) => (x_3 === y_3),\r\n GetHashCode: (x_3) => numberHash(x_3),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_5, enumValue_3.toString()))) : (new FSharpResult$2(1, [path_9, new ErrorReason(1, fullName(t_5), value_14, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else if (enumType === \"System.Int32\") {\r\n return (path_10) => ((value_16) => {\r\n const t_6 = t;\r\n const path_11 = path_10;\r\n const value_17 = value_16;\r\n const matchValue_5 = int(path_11)(value_17);\r\n if (matchValue_5.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_5.fields[0]);\r\n }\r\n else {\r\n const enumValue_4 = matchValue_5.fields[0];\r\n return contains(enumValue_4, getEnumValues(t_6), {\r\n Equals: (x_4, y_4) => (x_4 === y_4),\r\n GetHashCode: (x_4) => numberHash(x_4),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_6, int32ToString(enumValue_4)))) : (new FSharpResult$2(1, [path_11, new ErrorReason(1, fullName(t_6), value_17, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else if (enumType === \"System.UInt32\") {\r\n return (path_12) => ((value_19) => {\r\n const t_7 = t;\r\n const path_13 = path_12;\r\n const value_20 = value_19;\r\n const matchValue_6 = uint32(path_13)(value_20);\r\n if (matchValue_6.tag === 1) {\r\n return new FSharpResult$2(1, matchValue_6.fields[0]);\r\n }\r\n else {\r\n const enumValue_5 = matchValue_6.fields[0];\r\n return contains(enumValue_5, getEnumValues(t_7), {\r\n Equals: (x_5, y_5) => (x_5 === y_5),\r\n GetHashCode: (x_5) => numberHash(x_5),\r\n }) ? (new FSharpResult$2(0, parseEnum(t_7, enumValue_5.toString()))) : (new FSharpResult$2(1, [path_13, new ErrorReason(1, fullName(t_7), value_20, \"Unkown value provided for the enum\")]));\r\n }\r\n });\r\n }\r\n else {\r\n const arg10 = fullName(t);\r\n const clo2 = toFail(printf(\"Cannot generate auto decoder for %s.\\nThoth.Json.Net only support the folluwing enum types:\\n- sbyte\\n- byte\\n- int16\\n- uint16\\n- int\\n- uint32\\nIf you can\\u0027t use one of these types, please pass an extra decoder.\\n \"))(arg10);\r\n return (arg20) => {\r\n const clo3 = clo2(arg20);\r\n return (arg30) => clo3(arg30);\r\n };\r\n }\r\n }\r\n else if (isGenericType(t)) {\r\n if (isTuple(t)) {\r\n const decoders = map_2((t_8) => autoDecoder(extra, caseStrategy, false, t_8), getTupleElements(t));\r\n return (path_14) => ((value_21) => (Array.isArray(value_21) ? Result_Map((xs) => makeTuple(toArray(xs), t), mixedArray(\"tuple elements\", decoders, path_14, value_21)) : (new FSharpResult$2(1, [path_14, new ErrorReason(0, \"an array\", value_21)]))));\r\n }\r\n else {\r\n const fullname_1 = fullName(getGenericTypeDefinition(t));\r\n if (fullname_1 === \"Microsoft.FSharp.Core.FSharpOption`1[System.Object]\") {\r\n const decoder_13 = autoDecoder(extra, caseStrategy, true, getGenerics(t)[0]);\r\n return (path_15) => ((value_22) => option(uncurry(2, decoder_13), path_15, value_22));\r\n }\r\n else if (fullname_1 === \"Microsoft.FSharp.Collections.FSharpList`1[System.Object]\") {\r\n const decoder_14 = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]);\r\n return (path_16) => ((value_23) => list(uncurry(2, decoder_14), path_16, value_23));\r\n }\r\n else if (fullname_1 === \"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]\") {\r\n const keyDecoder = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]);\r\n const valueDecoder = autoDecoder(extra, caseStrategy, false, getGenerics(t)[1]);\r\n let d1;\r\n const decoders_1 = ofArray([(path_17) => ((value_24) => autoObject2(uncurry(2, keyDecoder), uncurry(2, valueDecoder), path_17, value_24)), (decoder_15 = tuple2(uncurry(2, keyDecoder), uncurry(2, valueDecoder)), (path_18) => ((value_25) => list(uncurry(2, decoder_15), path_18, value_25)))]);\r\n d1 = ((path_19) => ((value_26) => oneOf(decoders_1, path_19, value_26)));\r\n return (path_20) => ((value_28) => map((ar) => toMap(ar), uncurry(2, d1), path_20, value_28));\r\n }\r\n else if (fullname_1 === \"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]\") {\r\n const decoder_16 = autoDecoder(extra, caseStrategy, false, getGenerics(t)[0]);\r\n return (path_21) => ((value_29) => {\r\n const matchValue_7 = array(uncurry(2, decoder_16), path_21, value_29);\r\n return (matchValue_7.tag === 0) ? (new FSharpResult$2(0, toSet(matchValue_7.fields[0]))) : (new FSharpResult$2(1, matchValue_7.fields[0]));\r\n });\r\n }\r\n else {\r\n return autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t);\r\n }\r\n }\r\n }\r\n else if (fullname === \"System.Boolean\") {\r\n return (path_22) => ((value_31) => bool(path_22, value_31));\r\n }\r\n else if (fullname === \"Microsoft.FSharp.Core.Unit\") {\r\n return (path_23) => ((value_32) => unit(path_23, value_32));\r\n }\r\n else if (fullname === \"System.String\") {\r\n return (path_24) => ((value_33) => string(path_24, value_33));\r\n }\r\n else if (fullname === \"System.SByte\") {\r\n return sbyte;\r\n }\r\n else if (fullname === \"System.Byte\") {\r\n return byte;\r\n }\r\n else if (fullname === \"System.Int16\") {\r\n return int16;\r\n }\r\n else if (fullname === \"System.UInt16\") {\r\n return uint16;\r\n }\r\n else if (fullname === \"System.Int32\") {\r\n return int;\r\n }\r\n else if (fullname === \"System.UInt32\") {\r\n return uint32;\r\n }\r\n else if (fullname === \"System.Double\") {\r\n return (path_25) => ((value_34) => float(path_25, value_34));\r\n }\r\n else if (fullname === \"System.Single\") {\r\n return (path_26) => ((value_35) => float32(path_26, value_35));\r\n }\r\n else if (fullname === \"System.DateTime\") {\r\n return (path_27) => ((value_36) => datetime(path_27, value_36));\r\n }\r\n else if (fullname === \"System.DateTimeOffset\") {\r\n return (path_28) => ((value_37) => datetimeOffset(path_28, value_37));\r\n }\r\n else if (fullname === \"System.TimeSpan\") {\r\n return (path_29) => ((value_38) => timespan(path_29, value_38));\r\n }\r\n else if (fullname === \"System.Guid\") {\r\n return (path_30) => ((value_39) => guid(path_30, value_39));\r\n }\r\n else if (fullname === \"System.Object\") {\r\n return (_arg1_6) => ((v) => (new FSharpResult$2(0, v)));\r\n }\r\n else {\r\n return autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t);\r\n }\r\n }\r\n else {\r\n const decoderRef = matchValue;\r\n return (path) => ((value_1) => decoderRef.contents(path)(value_1));\r\n }\r\n}\r\n\r\nfunction makeExtra(extra) {\r\n if (extra != null) {\r\n return map_3((_arg2, tupledArg) => (new FSharpRef(tupledArg[1])), extra.Coders);\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n}\r\n\r\nexport class Auto {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function Auto$reflection() {\r\n return class_type(\"Thoth.Json.Decode.Auto\", void 0, Auto);\r\n}\r\n\r\nexport function Auto_generateDecoderCached_7848D058(caseStrategy, extra, resolver) {\r\n let y_1, y;\r\n const t = value_40(resolver).ResolveType();\r\n const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0));\r\n return Util_Cache$1__GetOrAdd_43981464(Util_CachedDecoders, (y_1 = ((y = fullName(t), toString_12(caseStrategy_1) + y)), defaultArg(map_4((e) => e.Hash, extra), \"\") + y_1), () => autoDecoder(makeExtra(extra), caseStrategy_1, false, t));\r\n}\r\n\r\nexport function Auto_generateDecoder_7848D058(caseStrategy, extra, resolver) {\r\n const caseStrategy_1 = defaultArg(caseStrategy, new CaseStrategy(0));\r\n const t = value_40(resolver).ResolveType();\r\n return autoDecoder(makeExtra(extra), caseStrategy_1, false, t);\r\n}\r\n\r\nexport function Auto_fromString_Z5CB6BD(json, caseStrategy, extra, resolver) {\r\n return fromString(uncurry(2, Auto_generateDecoder_7848D058(caseStrategy, extra, resolver)), json);\r\n}\r\n\r\nexport function Auto_unsafeFromString_Z5CB6BD(json, caseStrategy, extra, resolver) {\r\n const matchValue = fromString(uncurry(2, Auto_generateDecoder_7848D058(caseStrategy, extra, resolver)), json);\r\n if (matchValue.tag === 1) {\r\n throw (new Error(matchValue.fields[0]));\r\n }\r\n else {\r\n return matchValue.fields[0];\r\n }\r\n}\r\n\r\n","import { Union } from \"../fable-library.3.6.3/Types.js\";\r\nimport { fullName, union_type, string_type, class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { keyValueList } from \"../fable-library.3.6.3/MapUtil.js\";\r\nimport { Types_RequestProperties, Types_HttpRequestHeaders } from \"../Fable.Fetch.2.4.0/Fetch.fs.js\";\r\nimport { ofArray, empty, append, cons } from \"../fable-library.3.6.3/List.js\";\r\nimport { Auto_generateEncoderCached_Z127D9D79, toString } from \"../Thoth.Json.4.1.0/Encode.fs.js\";\r\nimport { value as value_2, map, defaultArg } from \"../fable-library.3.6.3/Option.js\";\r\nimport { FSharpResult$2 } from \"../fable-library.3.6.3/Choice.js\";\r\nimport { int32ToString, uncurry, curry } from \"../fable-library.3.6.3/Util.js\";\r\nimport { fromString, Auto_generateDecoderCached_7848D058 } from \"../Thoth.Json.4.1.0/Decode.fs.js\";\r\nimport { PromiseBuilder__Delay_62FBFDE1, PromiseBuilder__Run_212F1D4B } from \"../Fable.Promise.3.1.3/Promise.fs.js\";\r\nimport { promise } from \"../Fable.Promise.3.1.3/PromiseImpl.fs.js\";\r\n\r\nexport class FetchError extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"PreparingRequestFailed\", \"DecodingFailed\", \"FetchFailed\", \"NetworkError\"];\r\n }\r\n}\r\n\r\nexport function FetchError$reflection() {\r\n return union_type(\"Thoth.Fetch.FetchError\", [], FetchError, () => [[[\"Item\", class_type(\"System.Exception\")]], [[\"Item\", string_type]], [[\"Item\", class_type(\"Fetch.Types.Response\")]], [[\"Item\", class_type(\"System.Exception\")]]]);\r\n}\r\n\r\nexport function Helper_fetch(url, init) {\r\n return fetch(url, keyValueList(init, 1));\r\n}\r\n\r\nexport function Helper_withContentTypeJson(data, headers) {\r\n if (data != null) {\r\n return cons(new Types_HttpRequestHeaders(11, \"application/json\"), headers);\r\n }\r\n else {\r\n return headers;\r\n }\r\n}\r\n\r\nexport function Helper_encode(data, caseStrategy, extra, dataResolver) {\r\n return toString(0, Auto_generateEncoderCached_Z127D9D79(caseStrategy, extra, void 0, dataResolver)(data));\r\n}\r\n\r\nexport function Helper_withBody(data, caseStrategy, extra, dataResolver, properties) {\r\n return defaultArg(map((data_1) => cons(new Types_RequestProperties(2, Helper_encode(data_1, caseStrategy, extra, dataResolver)), properties), data), properties);\r\n}\r\n\r\nexport function Helper_withProperties(custom, properties) {\r\n return defaultArg(map((list2) => append(properties, list2), custom), properties);\r\n}\r\n\r\nexport function Helper_eitherUnit(responseResolver, cont) {\r\n if (fullName(responseResolver.ResolveType()) === \"Microsoft.FSharp.Core.Unit\") {\r\n return new FSharpResult$2(0, void 0);\r\n }\r\n else {\r\n return cont();\r\n }\r\n}\r\n\r\nexport function Helper_resolve(response, caseStrategy, extra, decoder, responseResolver) {\r\n const decoder_1 = defaultArg(curry(2, decoder), Auto_generateDecoderCached_7848D058(caseStrategy, extra, responseResolver));\r\n let eitherUnitOr;\r\n const responseResolver_1 = value_2(responseResolver);\r\n eitherUnitOr = ((cont) => Helper_eitherUnit(responseResolver_1, cont));\r\n return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (((response.ok) ? PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (response.text().then((_arg1) => (Promise.resolve(eitherUnitOr(() => {\r\n const matchValue = fromString(uncurry(2, decoder_1), _arg1);\r\n return (matchValue.tag === 1) ? (new FSharpResult$2(1, new FetchError(1, matchValue.fields[0]))) : (new FSharpResult$2(0, matchValue.fields[0]));\r\n }))))))) : (Promise.resolve(new FSharpResult$2(1, new FetchError(2, response))))).then((_arg2) => (Promise.resolve(_arg2))))));\r\n}\r\n\r\nexport function Helper_message(error) {\r\n switch (error.tag) {\r\n case 1: {\r\n return \"[Thoth.Fetch] Error while decoding the response:\\n\\n\" + error.fields[0];\r\n }\r\n case 2: {\r\n const response = error.fields[0];\r\n return ((((\"[Thoth.Fetch] Request failed:\\n\\n\" + int32ToString(response.status)) + \" \") + (response.statusText)) + \" for URL \") + (response.url);\r\n }\r\n case 3: {\r\n return \"[Thoth.Fetch] A network error occured:\\n\\n\" + error.fields[0].message;\r\n }\r\n default: {\r\n return \"[Thoth.Fetch] Request preparation failed:\\n\\n\" + error.fields[0].message;\r\n }\r\n }\r\n}\r\n\r\nexport class Fetch {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function Fetch$reflection() {\r\n return class_type(\"Thoth.Fetch.Fetch\", void 0, Fetch);\r\n}\r\n\r\nexport function Fetch_tryFetchAs_25B10BBE(url, decoder, data, httpMethod, properties, headers, caseStrategy, extra, responseResolver, dataResolver) {\r\n let headers_2;\r\n try {\r\n const properties_3 = Helper_withProperties(properties, Helper_withBody(data, caseStrategy, extra, dataResolver, ofArray([new Types_RequestProperties(0, defaultArg(httpMethod, \"GET\")), (headers_2 = Helper_withContentTypeJson(data, defaultArg(headers, empty())), new Types_RequestProperties(1, keyValueList(headers_2, 0)))])));\r\n const pr = PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (Helper_fetch(url, properties_3).then((_arg1) => (Helper_resolve(_arg1, caseStrategy, extra, decoder, responseResolver))))));\r\n return pr.catch((arg) => (new FSharpResult$2(1, new FetchError(3, arg))));\r\n }\r\n catch (exn) {\r\n return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (Promise.resolve(new FSharpResult$2(1, new FetchError(0, exn))))));\r\n }\r\n}\r\n\r\nexport function Fetch_fetchAs_25B10BBE(url, decoder, data, httpMethod, properties, headers, caseStrategy, extra, responseResolver, dataResolver) {\r\n return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => (Fetch_tryFetchAs_25B10BBE(url, decoder, data, httpMethod, properties, headers, caseStrategy, extra, responseResolver, dataResolver).then((_arg2) => {\r\n const result = _arg2;\r\n let response_1;\r\n if (result.tag === 1) {\r\n throw (new Error(Helper_message(result.fields[0])));\r\n }\r\n else {\r\n response_1 = result.fields[0];\r\n }\r\n return Promise.resolve(response_1);\r\n }))));\r\n}\r\n\r\nexport function Fetch_get_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_fetchAs_25B10BBE(url, decoder, data, void 0, properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryGet_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_tryFetchAs_25B10BBE(url, decoder, data, void 0, properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_post_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_fetchAs_25B10BBE(url, decoder, data, \"POST\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPost_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_tryFetchAs_25B10BBE(url, decoder, data, \"POST\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_put_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_fetchAs_25B10BBE(url, decoder, data, \"PUT\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPut_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_tryFetchAs_25B10BBE(url, decoder, data, \"PUT\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_patch_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_fetchAs_25B10BBE(url, decoder, data, \"PATCH\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPatch_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_tryFetchAs_25B10BBE(url, decoder, data, \"PATCH\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_delete_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_fetchAs_25B10BBE(url, decoder, data, \"DELETE\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryDelete_5760677E(url, data, properties, headers, caseStrategy, extra, decoder, responseResolver, dataResolver) {\r\n return Fetch_tryFetchAs_25B10BBE(url, decoder, data, \"DELETE\", properties, headers, caseStrategy, extra, responseResolver, dataResolver);\r\n}\r\n\r\n","import { empty, singleton, append, ofArray } from \"../fable-library.3.6.3/List.js\";\r\nimport { Types_RequestProperties } from \"../Fable.Fetch.2.4.0/Fetch.fs.js\";\r\nimport { some, defaultArg } from \"../fable-library.3.6.3/Option.js\";\r\nimport { obj_type, class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { Fetch_tryDelete_5760677E, Fetch_delete_5760677E, Fetch_tryPatch_5760677E, Fetch_patch_5760677E, Fetch_tryPut_5760677E, Fetch_put_5760677E, Fetch_tryPost_5760677E, Fetch_post_5760677E, Fetch_tryFetchAs_25B10BBE, Fetch_fetchAs_25B10BBE } from \"../Thoth.Fetch.2.0.0/Fetch.fs.js\";\r\nimport { uncurry } from \"../fable-library.3.6.3/Util.js\";\r\n\r\nexport function ServicesFramework_moduleHeaders(sf) {\r\n return ofArray([[\"ModuleId\", sf.getModuleId()], [\"TabId\", sf.getTabId()], [\"RequestVerificationToken\", sf.getAntiForgeryValue()]]);\r\n}\r\n\r\nexport function ServicesFramework_setup$0027(isGet, moduleId, moduleName, url, props) {\r\n const sf = window['$'].ServicesFramework(moduleId);\r\n const serviceroot = sf.getServiceRoot(moduleName);\r\n const props_1 = append(singleton(new Types_RequestProperties(4, \"same-origin\")), defaultArg(props, empty()));\r\n const Url = serviceroot + url;\r\n return {\r\n Headers: ServicesFramework_moduleHeaders(sf),\r\n Props: props_1,\r\n Url: Url,\r\n };\r\n}\r\n\r\nexport const ServicesFramework_setup = (moduleId) => ((moduleName) => ((url) => ((props) => ServicesFramework_setup$0027(false, moduleId, moduleName, url, props))));\r\n\r\nexport class Fetch {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function Fetch$reflection() {\r\n return class_type(\"Dnn.Fable.Fetch\", void 0, Fetch);\r\n}\r\n\r\nexport function Fetch_fetchAs_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver) {\r\n const sf = ServicesFramework_setup$0027(true, moduleId, moduleName, url, properties);\r\n return Fetch_fetchAs_25B10BBE(sf.Url, uncurry(2, void 0), void 0, void 0, sf.Props, sf.Headers, caseStrategy, extra, responseResolver, {\r\n ResolveType: () => obj_type,\r\n });\r\n}\r\n\r\nexport function Fetch_tryFetchAs_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver) {\r\n const sf = ServicesFramework_setup$0027(true, moduleId, moduleName, url, properties);\r\n return Fetch_tryFetchAs_25B10BBE(sf.Url, uncurry(2, void 0), void 0, void 0, sf.Props, sf.Headers, caseStrategy, extra, responseResolver, {\r\n ResolveType: () => obj_type,\r\n });\r\n}\r\n\r\nexport function Fetch_get_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver) {\r\n return Fetch_fetchAs_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver);\r\n}\r\n\r\nexport function Fetch_tryGet_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver) {\r\n return Fetch_tryFetchAs_511FB67E(moduleId, moduleName, url, properties, caseStrategy, extra, responseResolver);\r\n}\r\n\r\nexport function Fetch_post_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_post_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPost_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_tryPost_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_put_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_put_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPut_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_tryPut_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_patch_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_patch_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryPatch_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_tryPatch_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_delete_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_delete_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\nexport function Fetch_tryDelete_3817AB3A(moduleId, moduleName, url, data, properties, caseStrategy, extra, responseResolver, dataResolver) {\r\n const sf = ServicesFramework_setup(moduleId)(moduleName)(url)(properties);\r\n return Fetch_tryDelete_5760677E(sf.Url, some(data), sf.Props, sf.Headers, caseStrategy, extra, uncurry(2, void 0), responseResolver, dataResolver);\r\n}\r\n\r\n","import Timer from \"../fable-library.3.6.3/Timer.js\";\r\nimport { add } from \"../fable-library.3.6.3/Observable.js\";\r\n\r\nexport function Log_onError(text, ex) {\r\n console.error(text, ex);\r\n}\r\n\r\nexport function Log_toConsole(text, o) {\r\n console.log(text, o);\r\n}\r\n\r\nexport function Timer_delay(interval, callback) {\r\n let t;\r\n let returnVal = new Timer(interval);\r\n returnVal.AutoReset = false;\r\n t = returnVal;\r\n add(callback, t.Elapsed());\r\n t.Enabled = true;\r\n t.Start();\r\n}\r\n\r\n","import { singleton, concat, map, empty, iterate } from \"../fable-library.3.6.3/List.js\";\r\nimport { singleton as singleton_1 } from \"../fable-library.3.6.3/AsyncBuilder.js\";\r\nimport { startImmediate, catchAsync } from \"../fable-library.3.6.3/Async.js\";\r\nimport { Timer_delay } from \"./prelude.fs.js\";\r\n\r\nexport function Cmd_exec(onError, dispatch, cmd) {\r\n iterate((call) => {\r\n try {\r\n call(dispatch);\r\n }\r\n catch (ex) {\r\n onError(ex);\r\n }\r\n }, cmd);\r\n}\r\n\r\nexport function Cmd_none() {\r\n return empty();\r\n}\r\n\r\nexport function Cmd_map(f, cmd) {\r\n return map((g) => ((arg_1) => {\r\n g((arg) => {\r\n arg_1(f(arg));\r\n });\r\n }), cmd);\r\n}\r\n\r\nexport function Cmd_batch(cmds) {\r\n return concat(cmds);\r\n}\r\n\r\nexport function Cmd_ofSub(sub) {\r\n return singleton(sub);\r\n}\r\n\r\nexport function Cmd_OfFunc_either(task, arg, ofSuccess, ofError) {\r\n return singleton((dispatch) => {\r\n try {\r\n return dispatch(ofSuccess(task(arg)));\r\n }\r\n catch (x) {\r\n return dispatch(ofError(x));\r\n }\r\n });\r\n}\r\n\r\nexport function Cmd_OfFunc_perform(task, arg, ofSuccess) {\r\n return singleton((dispatch) => {\r\n try {\r\n dispatch(ofSuccess(task(arg)));\r\n }\r\n catch (x) {\r\n }\r\n });\r\n}\r\n\r\nexport function Cmd_OfFunc_attempt(task, arg, ofError) {\r\n return singleton((dispatch) => {\r\n try {\r\n task(arg);\r\n }\r\n catch (x) {\r\n dispatch(ofError(x));\r\n }\r\n });\r\n}\r\n\r\nexport function Cmd_OfFunc_result(msg) {\r\n return singleton((dispatch) => {\r\n dispatch(msg);\r\n });\r\n}\r\n\r\nexport function Cmd_OfAsyncWith_either(start, task, arg, ofSuccess, ofError) {\r\n return singleton((arg_1) => {\r\n start(singleton_1.Delay(() => singleton_1.Bind(catchAsync(task(arg)), (_arg1) => {\r\n const r = _arg1;\r\n arg_1((r.tag === 1) ? ofError(r.fields[0]) : ofSuccess(r.fields[0]));\r\n return singleton_1.Zero();\r\n })));\r\n });\r\n}\r\n\r\nexport function Cmd_OfAsyncWith_perform(start, task, arg, ofSuccess) {\r\n return singleton((arg_1) => {\r\n start(singleton_1.Delay(() => singleton_1.Bind(catchAsync(task(arg)), (_arg1) => {\r\n const r = _arg1;\r\n if (r.tag === 0) {\r\n arg_1(ofSuccess(r.fields[0]));\r\n return singleton_1.Zero();\r\n }\r\n else {\r\n return singleton_1.Zero();\r\n }\r\n })));\r\n });\r\n}\r\n\r\nexport function Cmd_OfAsyncWith_attempt(start, task, arg, ofError) {\r\n return singleton((arg_1) => {\r\n start(singleton_1.Delay(() => singleton_1.Bind(catchAsync(task(arg)), (_arg1) => {\r\n const r = _arg1;\r\n if (r.tag === 1) {\r\n arg_1(ofError(r.fields[0]));\r\n return singleton_1.Zero();\r\n }\r\n else {\r\n return singleton_1.Zero();\r\n }\r\n })));\r\n });\r\n}\r\n\r\nexport function Cmd_OfAsyncWith_result(start, task) {\r\n return singleton((arg) => {\r\n start(singleton_1.Delay(() => singleton_1.Bind(task, (_arg1) => {\r\n arg(_arg1);\r\n return singleton_1.Zero();\r\n })));\r\n });\r\n}\r\n\r\nexport function Cmd_OfAsync_start(x) {\r\n Timer_delay(0, (_arg1) => {\r\n startImmediate(x);\r\n });\r\n}\r\n\r\nexport function Cmd_OfPromise_either(task, arg, ofSuccess, ofError) {\r\n return singleton((dispatch) => {\r\n task(arg).then((arg_1) => dispatch(ofSuccess(arg_1))).catch((arg_3) => dispatch(ofError(arg_3)));\r\n });\r\n}\r\n\r\nexport function Cmd_OfPromise_perform(task, arg, ofSuccess) {\r\n return singleton((dispatch) => {\r\n task(arg).then((arg_1) => dispatch(ofSuccess(arg_1)));\r\n });\r\n}\r\n\r\nexport function Cmd_OfPromise_attempt(task, arg, ofError) {\r\n return singleton((dispatch) => {\r\n task(arg).catch((arg_2) => {\r\n dispatch(ofError(arg_2));\r\n });\r\n });\r\n}\r\n\r\nexport function Cmd_OfPromise_result(task) {\r\n return singleton((dispatch) => {\r\n task.then(dispatch);\r\n });\r\n}\r\n\r\nexport function Cmd_attemptFunc(task, arg, ofError) {\r\n return Cmd_OfFunc_attempt(task, arg, ofError);\r\n}\r\n\r\n","import { some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { create, isLeapYear } from \"../fable-library.3.6.3/Date.js\";\r\nimport { parse } from \"../fable-library.3.6.3/Int32.js\";\r\nimport { split, isNullOrWhiteSpace } from \"../fable-library.3.6.3/String.js\";\r\nimport { equalsWith } from \"../fable-library.3.6.3/Array.js\";\r\nimport react from \"react\";\r\n\r\nexport function DateParsing_$007CBetween$007C_$007C(x, y, input) {\r\n if ((input >= x) && (input <= y)) {\r\n return some(void 0);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function DateParsing_isLeapYear(year) {\r\n return isLeapYear(year);\r\n}\r\n\r\nexport function DateParsing_$007CInt$007C_$007C(input) {\r\n try {\r\n return parse(input, 511, false, 32);\r\n }\r\n catch (matchValue) {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function DateParsing_parse(input) {\r\n try {\r\n if (isNullOrWhiteSpace(input)) {\r\n return void 0;\r\n }\r\n else {\r\n const parts = split(input, [\"-\"], null, 0);\r\n let patternInput;\r\n let pattern_matching_result, month, year;\r\n if ((!equalsWith((x, y) => (x === y), parts, null)) && (parts.length === 2)) {\r\n const activePatternResult2160 = DateParsing_$007CInt$007C_$007C(parts[0]);\r\n if (activePatternResult2160 != null) {\r\n const activePatternResult2161 = DateParsing_$007CInt$007C_$007C(parts[1]);\r\n if (activePatternResult2161 != null) {\r\n pattern_matching_result = 0;\r\n month = activePatternResult2161;\r\n year = activePatternResult2160;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n patternInput = [year, month, 1, 0, 0];\r\n break;\r\n }\r\n case 1: {\r\n let pattern_matching_result_1, day, month_1, year_1;\r\n if ((!equalsWith((x_1, y_1) => (x_1 === y_1), parts, null)) && (parts.length === 3)) {\r\n const activePatternResult2157 = DateParsing_$007CInt$007C_$007C(parts[0]);\r\n if (activePatternResult2157 != null) {\r\n const activePatternResult2158 = DateParsing_$007CInt$007C_$007C(parts[1]);\r\n if (activePatternResult2158 != null) {\r\n const activePatternResult2159 = DateParsing_$007CInt$007C_$007C(parts[2]);\r\n if (activePatternResult2159 != null) {\r\n pattern_matching_result_1 = 0;\r\n day = activePatternResult2159;\r\n month_1 = activePatternResult2158;\r\n year_1 = activePatternResult2157;\r\n }\r\n else {\r\n pattern_matching_result_1 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_1 = 1;\r\n }\r\n switch (pattern_matching_result_1) {\r\n case 0: {\r\n patternInput = [year_1, month_1, day, 0, 0];\r\n break;\r\n }\r\n case 1: {\r\n let pattern_matching_result_2, day_1, month_2, year_2;\r\n if ((!equalsWith((x_2, y_2) => (x_2 === y_2), parts, null)) && (parts.length === 3)) {\r\n const activePatternResult2155 = DateParsing_$007CInt$007C_$007C(parts[0]);\r\n if (activePatternResult2155 != null) {\r\n const activePatternResult2156 = DateParsing_$007CInt$007C_$007C(parts[1]);\r\n if (activePatternResult2156 != null) {\r\n pattern_matching_result_2 = 0;\r\n day_1 = parts[2];\r\n month_2 = activePatternResult2156;\r\n year_2 = activePatternResult2155;\r\n }\r\n else {\r\n pattern_matching_result_2 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_2 = 1;\r\n }\r\n switch (pattern_matching_result_2) {\r\n case 0: {\r\n if (day_1.indexOf(\"T\") >= 0) {\r\n const matchValue = split(day_1, [\"T\"], null, 0);\r\n let pattern_matching_result_3, parsedDay, time;\r\n if ((!equalsWith((x_3, y_3) => (x_3 === y_3), matchValue, null)) && (matchValue.length === 2)) {\r\n const activePatternResult2154 = DateParsing_$007CInt$007C_$007C(matchValue[0]);\r\n if (activePatternResult2154 != null) {\r\n pattern_matching_result_3 = 0;\r\n parsedDay = activePatternResult2154;\r\n time = matchValue[1];\r\n }\r\n else {\r\n pattern_matching_result_3 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_3 = 1;\r\n }\r\n switch (pattern_matching_result_3) {\r\n case 0: {\r\n const matchValue_1 = split(time, [\":\"], null, 0);\r\n let pattern_matching_result_4, hour, minute;\r\n if ((!equalsWith((x_4, y_4) => (x_4 === y_4), matchValue_1, null)) && (matchValue_1.length === 2)) {\r\n const activePatternResult2152 = DateParsing_$007CInt$007C_$007C(matchValue_1[0]);\r\n if (activePatternResult2152 != null) {\r\n const activePatternResult2153 = DateParsing_$007CInt$007C_$007C(matchValue_1[1]);\r\n if (activePatternResult2153 != null) {\r\n pattern_matching_result_4 = 0;\r\n hour = activePatternResult2152;\r\n minute = activePatternResult2153;\r\n }\r\n else {\r\n pattern_matching_result_4 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_4 = 1;\r\n }\r\n switch (pattern_matching_result_4) {\r\n case 0: {\r\n const matchValue_2 = [hour, minute];\r\n let pattern_matching_result_5;\r\n if (DateParsing_$007CBetween$007C_$007C(0, 59, matchValue_2[0]) != null) {\r\n if (DateParsing_$007CBetween$007C_$007C(0, 59, matchValue_2[1]) != null) {\r\n pattern_matching_result_5 = 0;\r\n }\r\n else {\r\n pattern_matching_result_5 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_5 = 1;\r\n }\r\n switch (pattern_matching_result_5) {\r\n case 0: {\r\n patternInput = [year_2, month_2, parsedDay, hour, minute];\r\n break;\r\n }\r\n case 1: {\r\n patternInput = [-1, 1, 1, 0, 0];\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 1: {\r\n patternInput = [-1, 1, 1, 0, 0];\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 1: {\r\n patternInput = [-1, 1, 1, 0, 0];\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n patternInput = [-1, 1, 1, 0, 0];\r\n }\r\n break;\r\n }\r\n case 1: {\r\n patternInput = [-1, 1, 1, 0, 0];\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n const year_3 = patternInput[0] | 0;\r\n const month_3 = patternInput[1] | 0;\r\n const minute_1 = patternInput[4] | 0;\r\n const hour_1 = patternInput[3] | 0;\r\n const day_2 = patternInput[2] | 0;\r\n if (year_3 <= 0) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue_3 = [month_3, day_2];\r\n let pattern_matching_result_6;\r\n if (matchValue_3[0] === 2) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 29, matchValue_3[1]) != null) {\r\n if (DateParsing_isLeapYear(year_3)) {\r\n pattern_matching_result_6 = 0;\r\n }\r\n else {\r\n pattern_matching_result_6 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_6 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_6 = 1;\r\n }\r\n switch (pattern_matching_result_6) {\r\n case 0: {\r\n return create(year_3, month_3, day_2, hour_1, minute_1, 0);\r\n }\r\n case 1: {\r\n let pattern_matching_result_7;\r\n if (matchValue_3[0] === 2) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 28, matchValue_3[1]) != null) {\r\n if (!DateParsing_isLeapYear(year_3)) {\r\n pattern_matching_result_7 = 0;\r\n }\r\n else {\r\n pattern_matching_result_7 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_7 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_7 = 1;\r\n }\r\n switch (pattern_matching_result_7) {\r\n case 0: {\r\n return create(year_3, month_3, day_2, hour_1, minute_1, 0);\r\n }\r\n case 1: {\r\n let pattern_matching_result_8;\r\n if (matchValue_3[0] === 1) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 3) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 5) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 7) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 8) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 10) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 12) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 31, matchValue_3[1]) != null) {\r\n pattern_matching_result_8 = 0;\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_8 = 1;\r\n }\r\n switch (pattern_matching_result_8) {\r\n case 0: {\r\n return create(year_3, month_3, day_2, hour_1, minute_1, 0);\r\n }\r\n case 1: {\r\n let pattern_matching_result_9;\r\n if (matchValue_3[0] === 4) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 30, matchValue_3[1]) != null) {\r\n pattern_matching_result_9 = 0;\r\n }\r\n else {\r\n pattern_matching_result_9 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 6) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 30, matchValue_3[1]) != null) {\r\n pattern_matching_result_9 = 0;\r\n }\r\n else {\r\n pattern_matching_result_9 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 9) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 30, matchValue_3[1]) != null) {\r\n pattern_matching_result_9 = 0;\r\n }\r\n else {\r\n pattern_matching_result_9 = 1;\r\n }\r\n }\r\n else if (matchValue_3[0] === 11) {\r\n if (DateParsing_$007CBetween$007C_$007C(1, 30, matchValue_3[1]) != null) {\r\n pattern_matching_result_9 = 0;\r\n }\r\n else {\r\n pattern_matching_result_9 = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result_9 = 1;\r\n }\r\n switch (pattern_matching_result_9) {\r\n case 0: {\r\n return create(year_3, month_3, day_2, hour_1, minute_1, 0);\r\n }\r\n case 1: {\r\n return void 0;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n catch (matchValue_4) {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport const Interop_reactApi = react;\r\n\r\n","import { useLayoutEffectWithDeps, useLayoutEffect, useEffectWithDeps, useEffect, useDebugValue } from \"./ReactInterop.js\";\r\nimport { class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { iterate } from \"../fable-library.3.6.3/Seq.js\";\r\nimport { defaultArg, toArray } from \"../fable-library.3.6.3/Option.js\";\r\nimport { Interop_reactApi } from \"./Interop.fs.js\";\r\nimport { curry, uncurry } from \"../fable-library.3.6.3/Util.js\";\r\nimport { useState } from \"react\";\r\nimport * as react from \"react\";\r\n\r\nexport const ReactInterop_useDebugValueWithFormatter = useDebugValue;\r\n\r\nexport const ReactInterop_useEffect = useEffect;\r\n\r\nexport const ReactInterop_useEffectWithDeps = useEffectWithDeps;\r\n\r\nexport const ReactInterop_useLayoutEffect = useLayoutEffect;\r\n\r\nexport const ReactInterop_useLayoutEffectWithDeps = useLayoutEffectWithDeps;\r\n\r\nexport class Internal {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function Internal$reflection() {\r\n return class_type(\"Feliz.Internal\", void 0, Internal);\r\n}\r\n\r\nexport function Internal_$ctor() {\r\n return new Internal();\r\n}\r\n\r\n\r\nexport function Internal_functionComponent_Z1B155329(renderElement, name, withKey) {\r\n iterate((name_1) => {\r\n renderElement.displayName = name_1;\r\n }, toArray(name));\r\n console.warn(\"Feliz: using React.functionComponent in Fable 3 is obsolete, please consider using the [\\u003cReactComponent\\u003e] attribute instead which makes Feliz output better Javascript code that is compatible with react-refresh\");\r\n return (props) => Interop_reactApi.createElement(renderElement, Internal_propsWithKey(withKey, props));\r\n}\r\n\r\nexport function Internal_memo_Z603636D8(renderElement, name, areEqual, withKey) {\r\n const memoElementType = Interop_reactApi.memo(renderElement, uncurry(2, defaultArg(curry(2, areEqual), null)));\r\n iterate((name_1) => {\r\n renderElement.displayName = name_1;\r\n }, toArray(name));\r\n return (props) => Interop_reactApi.createElement(memoElementType, Internal_propsWithKey(withKey, props));\r\n}\r\n\r\nfunction Internal_propsWithKey(withKey, props) {\r\n if (withKey == null) {\r\n return props;\r\n }\r\n else {\r\n const f = withKey;\r\n props.key = f(props);\r\n return props;\r\n }\r\n}\r\n\r\nexport class React {\r\n constructor() {\r\n }\r\n}\r\n\r\nexport function React$reflection() {\r\n return class_type(\"Feliz.React\", void 0, React);\r\n}\r\n\r\nexport function React_createDisposable_3A5B6456(dispose) {\r\n return {\r\n Dispose() {\r\n dispose();\r\n },\r\n };\r\n}\r\n\r\nexport function useReact_useState_FCFD9EF(initializer) {\r\n return Interop_reactApi.useState(initializer);\r\n}\r\n\r\nexport function useReact_useReducer_2B9E6EA0(update, initialState) {\r\n return Interop_reactApi.useReducer(update, initialState);\r\n}\r\n\r\nexport function useReact_useEffect_Z5ECA432F(effect) {\r\n ReactInterop_useEffect(effect);\r\n}\r\n\r\nexport function useReact_useEffect_Z5234A374(effect, dependencies) {\r\n ReactInterop_useEffectWithDeps(effect, dependencies);\r\n}\r\n\r\nexport function useReact_useLayoutEffect_Z5ECA432F(effect) {\r\n ReactInterop_useLayoutEffect(effect);\r\n}\r\n\r\nexport function useReact_useLayoutEffect_Z5234A374(effect, dependencies) {\r\n ReactInterop_useLayoutEffectWithDeps(effect, dependencies);\r\n}\r\n\r\nexport function useReact_useLayoutEffect_3A5B6456(effect) {\r\n ReactInterop_useLayoutEffect((_arg1) => {\r\n effect();\r\n return React_createDisposable_3A5B6456(() => {\r\n });\r\n });\r\n}\r\n\r\nexport function useReact_useLayoutEffect_Z101E1A95(effect, dependencies) {\r\n ReactInterop_useLayoutEffectWithDeps((_arg2) => {\r\n effect();\r\n return React_createDisposable_3A5B6456(() => {\r\n });\r\n }, dependencies);\r\n}\r\n\r\nexport function useReact_useEffectOnce_3A5B6456(effect) {\r\n useReact_useEffect_Z101E1A95(effect, []);\r\n}\r\n\r\nexport function useReact_useEffectOnce_Z5ECA432F(effect) {\r\n useReact_useEffect_Z5234A374(effect, []);\r\n}\r\n\r\nexport function useReact_useEffectOnce_6E825304(effect) {\r\n useReact_useEffect_Z5234A374(() => {\r\n const disposeOption = effect();\r\n return {\r\n Dispose() {\r\n iterate((d) => {\r\n let copyOfStruct = d;\r\n copyOfStruct.Dispose();\r\n }, toArray(disposeOption));\r\n },\r\n };\r\n }, []);\r\n}\r\n\r\nexport function useReact_useEffect_3A5B6456(effect) {\r\n ReactInterop_useEffect((_arg3) => {\r\n effect();\r\n return React_createDisposable_3A5B6456(() => {\r\n });\r\n });\r\n}\r\n\r\nexport function useReact_useEffect_Z101E1A95(effect, dependencies) {\r\n ReactInterop_useEffectWithDeps((_arg4) => {\r\n effect();\r\n return React_createDisposable_3A5B6456(() => {\r\n });\r\n }, dependencies);\r\n}\r\n\r\nexport function useReact_useDebugValue_Z721C83C5(value) {\r\n ReactInterop_useDebugValueWithFormatter(value, (x) => x);\r\n}\r\n\r\nexport function useReact_useDebugValue_77A55D6D(value, formatter) {\r\n ReactInterop_useDebugValueWithFormatter(value, formatter);\r\n}\r\n\r\nexport function useReact_useCallback_93353E(callbackFunction, dependencies) {\r\n return Interop_reactApi.useCallback(callbackFunction, defaultArg(dependencies, []));\r\n}\r\n\r\nexport function useReact_useRef_1505(initialValue) {\r\n return Interop_reactApi.useRef(initialValue);\r\n}\r\n\r\nexport function useReact_useInputRef() {\r\n return useReact_useRef_1505(void 0);\r\n}\r\n\r\nexport function useReact_useButtonRef() {\r\n return useReact_useRef_1505(void 0);\r\n}\r\n\r\nexport function useReact_useElementRef() {\r\n return useReact_useRef_1505(void 0);\r\n}\r\n\r\nexport function useReact_useMemo_CF4EA67(createFunction, dependencies) {\r\n return Interop_reactApi.useMemo(createFunction, defaultArg(dependencies, []));\r\n}\r\n\r\nexport function React_functionComponent_2F9D7239(render, withKey) {\r\n return Internal_functionComponent_Z1B155329(render, void 0, withKey);\r\n}\r\n\r\nexport function React_functionComponent_Z4C5FE1BE(name, render, withKey) {\r\n return Internal_functionComponent_Z1B155329(render, name, withKey);\r\n}\r\n\r\nexport function React_functionComponent_19A12FB2(render, withKey) {\r\n return Internal_functionComponent_Z1B155329((arg) => react.createElement(react.Fragment, {}, ...render(arg)), void 0, withKey);\r\n}\r\n\r\nexport function React_functionComponent_2E1DD889(name, render, withKey) {\r\n return Internal_functionComponent_Z1B155329((arg) => react.createElement(react.Fragment, {}, ...render(arg)), name, withKey);\r\n}\r\n\r\nexport function React_memo_62A0F746(render, withKey, areEqual) {\r\n return Internal_memo_Z603636D8(render, void 0, areEqual, withKey);\r\n}\r\n\r\nexport function React_memo_6648A89D(name, render, withKey, areEqual) {\r\n return Internal_memo_Z603636D8(render, name, areEqual, withKey);\r\n}\r\n\r\nexport function React_memo_C2C6BED(render, withKey, areEqual) {\r\n return Internal_memo_Z603636D8((arg) => react.createElement(react.Fragment, {}, ...render(arg)), void 0, areEqual, withKey);\r\n}\r\n\r\nexport function React_memo_Z4FCC584A(name, render, withKey, areEqual) {\r\n return Internal_memo_Z603636D8((arg) => react.createElement(react.Fragment, {}, ...render(arg)), name, areEqual, withKey);\r\n}\r\n\r\nexport function React_createContext_1AE444D8(name, defaultValue) {\r\n const contextObject = Interop_reactApi.createContext(defaultArg(defaultValue, void 0));\r\n iterate((name_1) => {\r\n contextObject.displayName = name_1;\r\n }, toArray(name));\r\n return contextObject;\r\n}\r\n\r\nexport function React_contextProvider_34D9BBBD(contextObject, contextValue, child) {\r\n return Interop_reactApi.createElement(contextObject.Provider, {\r\n value: contextValue,\r\n }, child);\r\n}\r\n\r\nexport function React_contextProvider_138D2F56(contextObject, contextValue, children) {\r\n return Interop_reactApi.createElement(contextObject.Provider, {\r\n value: contextValue,\r\n }, ...children);\r\n}\r\n\r\nexport function React_contextConsumer_Z68910595(contextObject, render) {\r\n return Interop_reactApi.createElement(contextObject.Consumer, null, render);\r\n}\r\n\r\nexport function React_contextConsumer_56D53A40(contextObject, render) {\r\n return Interop_reactApi.createElement(contextObject.Consumer, null, (arg) => react.createElement(react.Fragment, {}, ...render(arg)));\r\n}\r\n\r\nexport function useReact_useContext_37FA55CF(contextObject) {\r\n return Interop_reactApi.useContext(contextObject);\r\n}\r\n\r\nexport function useReact_useCallbackRef_7C4B0DD6(callback) {\r\n const lastRenderCallbackRef = useReact_useRef_1505(callback);\r\n const callbackRef = useReact_useCallback_93353E((arg) => lastRenderCallbackRef.current(arg), []);\r\n useReact_useLayoutEffect_3A5B6456(() => {\r\n lastRenderCallbackRef.current = callback;\r\n });\r\n return callbackRef;\r\n}\r\n\r\nexport const React_useStateWithUpdater_1505 = useState;\r\n\r\nexport function React_forwardRef_3790D881(render) {\r\n const forwardRefType = Interop_reactApi.forwardRef((props, ref) => render([props, ref]));\r\n return (tupledArg) => {\r\n const propsObj = Object.assign({}, tupledArg[0]);\r\n propsObj.ref = tupledArg[1];\r\n return Interop_reactApi.createElement(forwardRefType, propsObj);\r\n };\r\n}\r\n\r\nexport function React_forwardRef_7DC3DB1A(name, render) {\r\n const forwardRefType = Interop_reactApi.forwardRef((props, ref) => render([props, ref]));\r\n render.displayName = name;\r\n return (tupledArg) => {\r\n const propsObj = Object.assign({}, tupledArg[0]);\r\n propsObj.ref = tupledArg[1];\r\n return Interop_reactApi.createElement(forwardRefType, propsObj);\r\n };\r\n}\r\n\r\nexport function React_strictMode_6E3A73D(children) {\r\n return Interop_reactApi.createElement(Interop_reactApi.StrictMode, void 0, ...children);\r\n}\r\n\r\nexport function React_lazy$0027_4712D3AE(dynamicImport, props) {\r\n return Interop_reactApi.createElement(Interop_reactApi.lazy(() => dynamicImport), props);\r\n}\r\n\r\nexport function React_lazy$0027_Z3D8450FC(dynamicImport, props) {\r\n return Interop_reactApi.createElement(Interop_reactApi.lazy(dynamicImport), props);\r\n}\r\n\r\nexport function React_suspense_6E3A73D(children) {\r\n let o;\r\n return Interop_reactApi.createElement(Interop_reactApi.Suspense, (o = {\r\n fallback: null,\r\n }, Object.assign({}, o)), ...children);\r\n}\r\n\r\nexport function React_suspense_Z3796A576(children, fallback) {\r\n let o;\r\n return Interop_reactApi.createElement(Interop_reactApi.Suspense, (o = {\r\n fallback: fallback,\r\n }, Object.assign({}, o)), ...children);\r\n}\r\n\r\nexport function useReact_useImperativeHandle_596DDC25(ref, createHandle) {\r\n Interop_reactApi.useImperativeHandle(ref, createHandle);\r\n}\r\n\r\nexport function useReact_useImperativeHandle_Z12F09548(ref, createHandle, dependencies) {\r\n Interop_reactApi.useImperativeHandle(ref, createHandle, dependencies);\r\n}\r\n\r\nexport function useFeliz_React__React_useState_Static_1505(initial) {\r\n return Interop_reactApi.useState(initial);\r\n}\r\n\r\nexport const Feliz_React__React_useStateWithUpdater_Static_FCFD9EF = useState;\r\n\r\n","import {\r\n useEffect as useEffectReact,\r\n useLayoutEffect as useLayoutEffectReact,\r\n useDebugValue as useDebugValueReact } from 'react'\r\n\r\nexport const useEffect = getDisposable => {\r\n useEffectReact(() => {\r\n const disposable = getDisposable()\r\n return () => {\r\n disposable.Dispose();\r\n }\r\n })\r\n}\r\n\r\nexport const useEffectWithDeps = (getDisposable, deps) => {\r\n useEffectReact(() => {\r\n const disposable = getDisposable()\r\n return () => {\r\n disposable.Dispose();\r\n }\r\n }, deps)\r\n}\r\n\r\nexport const useLayoutEffect = getDisposable => {\r\n useLayoutEffectReact(() => {\r\n const disposable = getDisposable()\r\n return () => {\r\n disposable.Dispose();\r\n }\r\n })\r\n}\r\n\r\nexport const useLayoutEffectWithDeps = (getDisposable, deps) => {\r\n useLayoutEffectReact(() => {\r\n const disposable = getDisposable()\r\n return () => {\r\n disposable.Dispose();\r\n }\r\n }, deps)\r\n}\r\n\r\nexport const useDebugValue = (value, formatter) => useDebugValueReact(value, formatter)","import { Union } from \"./fable_modules/fable-library.3.6.3/Types.js\";\r\nimport { union_type, int32_type } from \"./fable_modules/fable-library.3.6.3/Reflection.js\";\r\nimport { createElement } from \"react\";\r\nimport * as react from \"react\";\r\nimport { printf, toText, join } from \"./fable_modules/fable-library.3.6.3/String.js\";\r\nimport { min, comparePrimitives, max, createObj } from \"./fable_modules/fable-library.3.6.3/Util.js\";\r\nimport { Interop_reactApi } from \"./fable_modules/Feliz.1.57.0/Interop.fs.js\";\r\nimport { ofArray, skip, truncate, map, length, singleton, empty } from \"./fable_modules/fable-library.3.6.3/List.js\";\r\nimport { useFeliz_React__React_useState_Static_1505 } from \"./fable_modules/Feliz.1.57.0/React.fs.js\";\r\n\r\nexport class NumberOfCols extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Cols\"];\r\n }\r\n}\r\n\r\nexport function NumberOfCols$reflection() {\r\n return union_type(\"Elements.NumberOfCols\", [], NumberOfCols, () => [[[\"Item\", int32_type]]]);\r\n}\r\n\r\nexport function Icon_icon(classes) {\r\n return createElement(\"span\", {\r\n className: join(\" \", classes),\r\n });\r\n}\r\n\r\nexport const Icon_right = Icon_icon([\"fa\", \"fa-chevron-right\"]);\r\n\r\nexport const Icon_left = Icon_icon([\"fa\", \"fa-chevron-left\"]);\r\n\r\nexport const Icon_filter = Icon_icon([\"fa\", \"fa-filter\"]);\r\n\r\nexport const Icon_search = Icon_icon([\"fa\", \"fa-search\"]);\r\n\r\nexport const Icon_unkown = Icon_icon([\"fa\", \"fa-question\"]);\r\n\r\nexport const Icon_ok = Icon_icon([\"fa\", \"fa-check\", \"text-blau\"]);\r\n\r\nexport const Icon_ban = Icon_icon([\"fa\", \"fa-ban\"]);\r\n\r\nexport const Icon_envelopeOpen = Icon_icon([\"fa\", \"fa-envelope-open-o\"]);\r\n\r\nexport const Icon_envelope = Icon_icon([\"fa\", \"fa-envelope\"]);\r\n\r\nexport const Icon_phone = Icon_icon([\"fa\", \"fa-phone\"]);\r\n\r\nfunction Icon_stimmeAbgegeben$0027(style) {\r\n return createElement(\"span\", {\r\n style: createObj(style),\r\n className: join(\" \", [\"fa-stack\", \"fa-lg\"]),\r\n children: Interop_reactApi.Children.toArray([Icon_icon([\"fa\", \"fa-times\", \"fa-stack-1x\", \"text-primary\"]), Icon_icon([\"fa\", \"fa-circle-thin\", \"fa-stack-2x\", \"text-secondary\"])]),\r\n });\r\n}\r\n\r\nexport const Icon_stimmeAbgegeben = Icon_stimmeAbgegeben$0027(empty());\r\n\r\nexport const Icon_stimmeAbgegebenKlein = Icon_stimmeAbgegeben$0027(singleton([\"fontSize\", 0.7 + \"em\"]));\r\n\r\nfunction Icon_stimmeOhne$0027(style) {\r\n return createElement(\"span\", {\r\n style: createObj(style),\r\n className: join(\" \", [\"fa-stack\", \"fa-lg\"]),\r\n children: Interop_reactApi.Children.toArray([Icon_icon([\"fa\", \"fa-circle-thin\", \"fa-stack-2x\", \"text-secondary\"])]),\r\n });\r\n}\r\n\r\nexport const Icon_stimmeOhne = Icon_stimmeOhne$0027(empty());\r\n\r\nexport const Icon_stimmeOhneKlein = Icon_stimmeOhne$0027(singleton([\"fontSize\", 0.7 + \"em\"]));\r\n\r\nexport const Icon_spin = react.createElement(react.Fragment, {}, Icon_icon([\"fa\", \"fa-circle-o-notch\", \"fa-spin\", \"fa-2x\", \"btn-link\"]), createElement(\"span\", {\r\n className: \"sr-only\",\r\n children: \"Loading..\",\r\n}));\r\n\r\nexport const Icon_check = Icon_icon([\"fa\", \"fa-check\", \"text-success\"]);\r\n\r\nexport const Icon_userPlus = Icon_icon([\"fa\", \"fa-user-plus\"]);\r\n\r\nexport function Button_bigLink(children, hint, handler) {\r\n return createElement(\"button\", {\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n className: join(\" \", [\"btn\", \"btn-lg\", \"btn-link\"]),\r\n title: hint,\r\n onClick: (evn) => {\r\n handler();\r\n evn.preventDefault();\r\n },\r\n });\r\n}\r\n\r\nexport function Deferred_render(f, a) {\r\n switch (a.tag) {\r\n case 1: {\r\n return Icon_spin;\r\n }\r\n case 3: {\r\n return createElement(\"div\", {\r\n className: join(\" \", [\"alert\", \"alert-danger\"]),\r\n children: a.fields[0].message,\r\n });\r\n }\r\n case 2: {\r\n return f(a.fields[0]);\r\n }\r\n default: {\r\n return null;\r\n }\r\n }\r\n}\r\n\r\nexport function BootstrapModule_container(children) {\r\n return createElement(\"div\", {\r\n className: \"container\",\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_row(children) {\r\n return createElement(\"div\", {\r\n className: join(\" \", [\"row\", \"align-items-center\"]),\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_col(_arg1, children) {\r\n return createElement(\"div\", {\r\n className: join(\" \", [toText(printf(\"col-sm-%i\"))(_arg1.fields[0]), \"align-middle\"]),\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_prependAndGrouped(elm, input) {\r\n return createElement(\"div\", {\r\n className: join(\" \", [\"input-group\", \"mb-2\"]),\r\n children: Interop_reactApi.Children.toArray([createElement(\"div\", {\r\n className: \"input-group-prepend\",\r\n children: Interop_reactApi.Children.toArray([createElement(\"div\", {\r\n className: \"input-group-text\",\r\n children: Interop_reactApi.Children.toArray([elm]),\r\n })]),\r\n }), input]),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_alert(alert, children) {\r\n return createElement(\"div\", {\r\n className: join(\" \", [\"alert\", alert]),\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_alertDanger(children) {\r\n return BootstrapModule_alert(\"alert-danger\", children);\r\n}\r\n\r\nexport function BootstrapModule_alertInfo(children) {\r\n return BootstrapModule_alert(\"alert-info\", children);\r\n}\r\n\r\nexport function BootstrapModule_alertPrimary(children) {\r\n return BootstrapModule_alert(\"alert-green\", children);\r\n}\r\n\r\nexport function BootstrapModule_dialog(v) {\r\n return createElement(\"div\", {\r\n className: \"modal\",\r\n tabIndex: -1,\r\n role: join(\" \", [\"dialog\"]),\r\n style: {\r\n display: \"block\",\r\n },\r\n children: Interop_reactApi.Children.toArray([createElement(\"div\", {\r\n className: join(\" \", [\"modal-dialog\", \"modal-dialog-centered\"]),\r\n role: join(\" \", [\"document\"]),\r\n children: Interop_reactApi.Children.toArray([createElement(\"div\", {\r\n className: \"modal-content\",\r\n style: {\r\n backgroundColor: \"#f8f9fa\",\r\n },\r\n children: Interop_reactApi.Children.toArray([createElement(\"div\", {\r\n className: join(\" \", [\"modal-header\", \"alert-green\"]),\r\n children: Interop_reactApi.Children.toArray(Array.from(v.Header)),\r\n }), createElement(\"div\", {\r\n className: \"modal-body\",\r\n children: Interop_reactApi.Children.toArray(Array.from(v.Body)),\r\n }), createElement(\"div\", {\r\n className: \"modal-footer\",\r\n children: Interop_reactApi.Children.toArray(Array.from(v.Footer)),\r\n })]),\r\n })]),\r\n })]),\r\n });\r\n}\r\n\r\nexport function BootstrapModule_Pager(v) {\r\n let arg20, arg10;\r\n const patternInput = useFeliz_React__React_useState_Static_1505(0);\r\n const setPage = patternInput[1];\r\n const page = patternInput[0] | 0;\r\n const pagesize = v.PageSize | 0;\r\n const pageCount = (~(~(length(v.List) / pagesize))) | 0;\r\n const page_1 = ((page > pageCount) ? pageCount : page) | 0;\r\n const children = ofArray([v.Header, v.RenderContainer(map(v.RenderElement, truncate(pagesize, skip(page_1 * pagesize, v.List)))), Button_bigLink([Icon_left, Icon_left], \"Zum Anfang\", () => {\r\n setPage(0);\r\n }), Button_bigLink([Icon_left], \"Zurück\", () => {\r\n setPage(max((x, y) => comparePrimitives(x, y), 0, page_1 - 1));\r\n }), (arg20 = ((pageCount + 1) | 0), (arg10 = ((page_1 + 1) | 0), toText(printf(\" %i von %i \"))(arg10)(arg20))), Button_bigLink([Icon_right], \"Vor\", () => {\r\n setPage(min((x_1, y_1) => comparePrimitives(x_1, y_1), pageCount, page_1 + 1));\r\n }), Button_bigLink([Icon_right, Icon_right], \"Ans Ende\", () => {\r\n setPage(pageCount);\r\n })]);\r\n return createElement(\"div\", {\r\n children: Interop_reactApi.Children.toArray(Array.from(children)),\r\n });\r\n}\r\n\r\n","import { compare } from \"./Util.js\";\r\nimport { unfold, delay } from \"./Seq.js\";\r\nimport { op_Addition, fromZero } from \"./BigInt.js\";\r\nimport { op_Addition as op_Addition_1, fromParts } from \"./Decimal.js\";\r\nimport { op_Addition as op_Addition_2, fromBits } from \"./Long.js\";\r\n\r\nexport function makeRangeStepFunction(step, stop, zero, add) {\r\n const stepComparedWithZero = compare(step, zero) | 0;\r\n if (stepComparedWithZero === 0) {\r\n throw (new Error(\"The step of a range cannot be zero\"));\r\n }\r\n const stepGreaterThanZero = stepComparedWithZero > 0;\r\n return (x) => {\r\n const comparedWithLast = compare(x, stop) | 0;\r\n return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : ((!stepGreaterThanZero) && (comparedWithLast >= 0))) ? [x, add(x, step)] : (void 0);\r\n };\r\n}\r\n\r\nexport function integralRangeStep(start, step, stop, zero, add) {\r\n const stepFn = makeRangeStepFunction(step, stop, zero, add);\r\n return delay(() => unfold(stepFn, start));\r\n}\r\n\r\nexport function rangeBigInt(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromZero(), (x, y) => op_Addition(x, y));\r\n}\r\n\r\nexport function rangeDecimal(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), (x, y) => op_Addition_1(x, y));\r\n}\r\n\r\nexport function rangeDouble(start, step, stop) {\r\n return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));\r\n}\r\n\r\nexport function rangeInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, false), (x, y) => op_Addition_2(x, y));\r\n}\r\n\r\nexport function rangeUInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, true), (x, y) => op_Addition_2(x, y));\r\n}\r\n\r\nexport function rangeChar(start, stop) {\r\n const intStop = stop.charCodeAt(0) | 0;\r\n return delay(() => unfold((c) => {\r\n if (c <= intStop) {\r\n return [String.fromCharCode(c), c + 1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, start.charCodeAt(0)));\r\n}\r\n\r\n","import { Union } from \"../fable-library.3.6.3/Types.js\";\r\nimport { class_type, union_type, int32_type, array_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { fill } from \"../fable-library.3.6.3/Array.js\";\r\nimport { comparePrimitives, max } from \"../fable-library.3.6.3/Util.js\";\r\nimport { some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { singleton, collect, take, skip, append, delay } from \"../fable-library.3.6.3/Seq.js\";\r\nimport { rangeDouble } from \"../fable-library.3.6.3/Range.js\";\r\n\r\nexport class RingState$1 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Writable\", \"ReadWritable\"];\r\n }\r\n}\r\n\r\nexport function RingState$1$reflection(gen0) {\r\n return union_type(\"Elmish.RingState`1\", [gen0], RingState$1, () => [[[\"wx\", array_type(gen0)], [\"ix\", int32_type]], [[\"rw\", array_type(gen0)], [\"wix\", int32_type], [\"rix\", int32_type]]]);\r\n}\r\n\r\nexport class RingBuffer$1 {\r\n constructor(size) {\r\n this.state = (new RingState$1(0, fill(new Array(max((x, y) => comparePrimitives(x, y), size, 10)), 0, max((x, y) => comparePrimitives(x, y), size, 10), null), 0));\r\n }\r\n}\r\n\r\nexport function RingBuffer$1$reflection(gen0) {\r\n return class_type(\"Elmish.RingBuffer`1\", [gen0], RingBuffer$1);\r\n}\r\n\r\nexport function RingBuffer$1_$ctor_Z524259A4(size) {\r\n return new RingBuffer$1(size);\r\n}\r\n\r\nexport function RingBuffer$1__Pop(__) {\r\n const matchValue = __.state;\r\n if (matchValue.tag === 1) {\r\n const wix = matchValue.fields[1] | 0;\r\n const rix = matchValue.fields[2] | 0;\r\n const items = matchValue.fields[0];\r\n const rix$0027 = ((rix + 1) % items.length) | 0;\r\n if (rix$0027 === wix) {\r\n __.state = (new RingState$1(0, items, wix));\r\n }\r\n else {\r\n __.state = (new RingState$1(1, items, wix, rix$0027));\r\n }\r\n return some(items[rix]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function RingBuffer$1__Push_2B595(__, item) {\r\n const matchValue = __.state;\r\n if (matchValue.tag === 1) {\r\n const wix_1 = matchValue.fields[1] | 0;\r\n const rix = matchValue.fields[2] | 0;\r\n const items_1 = matchValue.fields[0];\r\n items_1[wix_1] = item;\r\n const wix$0027 = ((wix_1 + 1) % items_1.length) | 0;\r\n if (wix$0027 === rix) {\r\n __.state = (new RingState$1(1, RingBuffer$1__doubleSize(__, rix, items_1), items_1.length, 0));\r\n }\r\n else {\r\n __.state = (new RingState$1(1, items_1, wix$0027, rix));\r\n }\r\n }\r\n else {\r\n const ix = matchValue.fields[1] | 0;\r\n const items = matchValue.fields[0];\r\n items[ix] = item;\r\n const wix = ((ix + 1) % items.length) | 0;\r\n __.state = (new RingState$1(1, items, wix, ix));\r\n }\r\n}\r\n\r\nfunction RingBuffer$1__doubleSize(this$, ix, items) {\r\n return Array.from(delay(() => append(skip(ix, items), delay(() => append(take(ix, items), delay(() => collect((matchValue) => singleton(null), rangeDouble(0, 1, items.length))))))));\r\n}\r\n\r\n","import { Record } from \"../fable-library.3.6.3/Types.js\";\r\nimport { record_type, class_type, string_type, tuple_type, list_type, lambda_type, unit_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { Cmd_exec, Cmd_batch, Cmd_none } from \"./cmd.fs.js\";\r\nimport { Log_toConsole, Log_onError } from \"./prelude.fs.js\";\r\nimport { curry, partialApply, uncurry } from \"../fable-library.3.6.3/Util.js\";\r\nimport { ofArray } from \"../fable-library.3.6.3/List.js\";\r\nimport { RingBuffer$1__Pop, RingBuffer$1__Push_2B595, RingBuffer$1_$ctor_Z524259A4 } from \"./ring.fs.js\";\r\nimport { value as value_1, some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { printf, toText } from \"../fable-library.3.6.3/String.js\";\r\n\r\nexport class Program$4 extends Record {\r\n constructor(init, update, subscribe, view, setState, onError, syncDispatch) {\r\n super();\r\n this.init = init;\r\n this.update = update;\r\n this.subscribe = subscribe;\r\n this.view = view;\r\n this.setState = setState;\r\n this.onError = onError;\r\n this.syncDispatch = syncDispatch;\r\n }\r\n}\r\n\r\nexport function Program$4$reflection(gen0, gen1, gen2, gen3) {\r\n return record_type(\"Elmish.Program`4\", [gen0, gen1, gen2, gen3], Program$4, () => [[\"init\", lambda_type(gen0, tuple_type(gen1, list_type(lambda_type(lambda_type(gen2, unit_type), unit_type))))], [\"update\", lambda_type(gen2, lambda_type(gen1, tuple_type(gen1, list_type(lambda_type(lambda_type(gen2, unit_type), unit_type)))))], [\"subscribe\", lambda_type(gen1, list_type(lambda_type(lambda_type(gen2, unit_type), unit_type)))], [\"view\", lambda_type(gen1, lambda_type(lambda_type(gen2, unit_type), gen3))], [\"setState\", lambda_type(gen1, lambda_type(lambda_type(gen2, unit_type), unit_type))], [\"onError\", lambda_type(tuple_type(string_type, class_type(\"System.Exception\")), unit_type)], [\"syncDispatch\", lambda_type(lambda_type(gen2, unit_type), lambda_type(gen2, unit_type))]]);\r\n}\r\n\r\nexport function ProgramModule_mkProgram(init, update, view) {\r\n return new Program$4(init, update, (_arg1) => Cmd_none(), view, (model, arg) => {\r\n view(model, arg);\r\n }, (tupledArg) => {\r\n Log_onError(tupledArg[0], tupledArg[1]);\r\n }, uncurry(2, (x) => x));\r\n}\r\n\r\nexport function ProgramModule_mkSimple(init, update, view) {\r\n return new Program$4((arg) => [init(arg), Cmd_none()], (msg, arg_1) => [update(msg, arg_1), Cmd_none()], (_arg1) => Cmd_none(), view, (model, arg_2) => {\r\n view(model, arg_2);\r\n }, (tupledArg) => {\r\n Log_onError(tupledArg[0], tupledArg[1]);\r\n }, uncurry(2, (x) => x));\r\n}\r\n\r\nexport function ProgramModule_withSubscription(subscribe, program) {\r\n return new Program$4(program.init, program.update, (model) => Cmd_batch(ofArray([program.subscribe(model), subscribe(model)])), program.view, program.setState, program.onError, program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_withConsoleTrace(program) {\r\n return new Program$4((arg) => {\r\n const patternInput = program.init(arg);\r\n const initModel = patternInput[0];\r\n Log_toConsole(\"Initial state:\", initModel);\r\n return [initModel, patternInput[1]];\r\n }, (msg, model) => {\r\n Log_toConsole(\"New message:\", msg);\r\n const patternInput_1 = program.update(msg, model);\r\n const newModel = patternInput_1[0];\r\n Log_toConsole(\"Updated state:\", newModel);\r\n return [newModel, patternInput_1[1]];\r\n }, program.subscribe, program.view, program.setState, program.onError, program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_withTrace(trace, program) {\r\n return new Program$4(program.init, (msg, model) => {\r\n const patternInput = program.update(msg, model);\r\n const state = patternInput[0];\r\n trace(msg, state);\r\n return [state, patternInput[1]];\r\n }, program.subscribe, program.view, program.setState, program.onError, program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_withErrorHandler(onError, program) {\r\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, onError, program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_mapErrorHandler(map, program) {\r\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, partialApply(1, map, [program.onError]), program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_onError(program) {\r\n return program.onError;\r\n}\r\n\r\nexport function ProgramModule_withSetState(setState, program) {\r\n return new Program$4(program.init, program.update, program.subscribe, program.view, setState, program.onError, program.syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_setState(program) {\r\n return curry(2, program.setState);\r\n}\r\n\r\nexport function ProgramModule_view(program) {\r\n return curry(2, program.view);\r\n}\r\n\r\nexport function ProgramModule_withSyncDispatch(syncDispatch, program) {\r\n return new Program$4(program.init, program.update, program.subscribe, program.view, program.setState, program.onError, syncDispatch);\r\n}\r\n\r\nexport function ProgramModule_map(mapInit, mapUpdate, mapView, mapSetState, mapSubscribe, program) {\r\n const init = partialApply(1, mapInit, [program.init]);\r\n const update = partialApply(2, mapUpdate, [program.update]);\r\n const view = partialApply(2, mapView, [program.view]);\r\n const setState = partialApply(2, mapSetState, [program.setState]);\r\n return new Program$4(init, uncurry(2, update), partialApply(1, mapSubscribe, [program.subscribe]), uncurry(2, view), uncurry(2, setState), program.onError, uncurry(2, (x) => x));\r\n}\r\n\r\nexport function ProgramModule_runWith(arg, program) {\r\n const patternInput = program.init(arg);\r\n const model = patternInput[0];\r\n const rb = RingBuffer$1_$ctor_Z524259A4(10);\r\n let reentered = false;\r\n let state = model;\r\n const dispatch = (msg) => {\r\n if (reentered) {\r\n RingBuffer$1__Push_2B595(rb, msg);\r\n }\r\n else {\r\n reentered = true;\r\n let nextMsg = some(msg);\r\n while (nextMsg != null) {\r\n const msg_1 = value_1(nextMsg);\r\n try {\r\n const patternInput_1 = program.update(msg_1, state);\r\n const model$0027 = patternInput_1[0];\r\n program.setState(model$0027, syncDispatch);\r\n Cmd_exec((ex) => {\r\n program.onError([toText(printf(\"Error in command while handling: %A\"))(msg_1), ex]);\r\n }, syncDispatch, patternInput_1[1]);\r\n state = model$0027;\r\n }\r\n catch (ex_1) {\r\n program.onError([toText(printf(\"Unable to process the message: %A\"))(msg_1), ex_1]);\r\n }\r\n nextMsg = RingBuffer$1__Pop(rb);\r\n }\r\n reentered = false;\r\n }\r\n };\r\n const syncDispatch = partialApply(1, program.syncDispatch, [dispatch]);\r\n program.setState(model, syncDispatch);\r\n Cmd_exec((ex_3) => {\r\n program.onError([\"Error intitializing:\", ex_3]);\r\n }, syncDispatch, Cmd_batch(ofArray([(() => {\r\n try {\r\n return program.subscribe(model);\r\n }\r\n catch (ex_2) {\r\n program.onError([\"Unable to subscribe:\", ex_2]);\r\n return Cmd_none();\r\n }\r\n })(), patternInput[1]])));\r\n}\r\n\r\nexport function ProgramModule_run(program) {\r\n ProgramModule_runWith(void 0, program);\r\n}\r\n\r\n","import { class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { defaultArg, value, some } from \"../fable-library.3.6.3/Option.js\";\r\nimport { isDisposable } from \"../fable-library.3.6.3/Util.js\";\r\nimport { ProgramModule_mkProgram, ProgramModule_withSetState, ProgramModule_runWith } from \"../Fable.Elmish.3.1.0/program.fs.js\";\r\nimport { React_createDisposable_3A5B6456, useReact_useEffect_Z5234A374, useReact_useState_FCFD9EF } from \"../Feliz.1.57.0/React.fs.js\";\r\n\r\nclass ElmishObservable$2 {\r\n constructor() {\r\n this.hasDisposedOnce = false;\r\n this.state = (void 0);\r\n this.listener = (void 0);\r\n this.dispatcher = (void 0);\r\n }\r\n}\r\n\r\nfunction ElmishObservable$2$reflection(gen0, gen1) {\r\n return class_type(\"Feliz.UseElmish.UseElmishExtensions.ElmishObservable`2\", [gen0, gen1], ElmishObservable$2);\r\n}\r\n\r\nfunction ElmishObservable$2_$ctor() {\r\n return new ElmishObservable$2();\r\n}\r\n\r\nfunction ElmishObservable$2__get_Value(_) {\r\n return _.state;\r\n}\r\n\r\nfunction ElmishObservable$2__get_HasDisposedOnce(_) {\r\n return _.hasDisposedOnce;\r\n}\r\n\r\nfunction ElmishObservable$2__SetState(_, model, dispatch) {\r\n _.state = some(model);\r\n _.dispatcher = dispatch;\r\n const matchValue = _.listener;\r\n if (matchValue != null) {\r\n matchValue(model);\r\n }\r\n}\r\n\r\nfunction ElmishObservable$2__Dispatch_2B594(_, msg) {\r\n const matchValue = _.dispatcher;\r\n if (matchValue != null) {\r\n matchValue(msg);\r\n }\r\n}\r\n\r\nfunction ElmishObservable$2__Subscribe_5028453F(_, f) {\r\n const matchValue = _.listener;\r\n if (matchValue == null) {\r\n _.listener = f;\r\n }\r\n}\r\n\r\nfunction ElmishObservable$2__DisposeState(_) {\r\n const matchValue = _.state;\r\n if (matchValue != null) {\r\n const matchValue_1 = value(matchValue);\r\n if (isDisposable(matchValue_1)) {\r\n matchValue_1.Dispose();\r\n }\r\n }\r\n _.dispatcher = (void 0);\r\n _.state = (void 0);\r\n _.hasDisposedOnce = true;\r\n}\r\n\r\nfunction runProgram(program, arg, obs, unitVar3) {\r\n ProgramModule_runWith(arg, ProgramModule_withSetState((arg00, arg10) => {\r\n ElmishObservable$2__SetState(obs, arg00, arg10);\r\n }, program()));\r\n const matchValue = ElmishObservable$2__get_Value(obs);\r\n if (matchValue != null) {\r\n return value(matchValue);\r\n }\r\n else {\r\n throw (new Error(\"Elmish program has not initialized\"));\r\n }\r\n}\r\n\r\nexport function disposeState(state) {\r\n const matchValue = state;\r\n if (isDisposable(matchValue)) {\r\n matchValue.Dispose();\r\n }\r\n}\r\n\r\nexport function useFeliz_React__React_useElmish_Static_76E709(program, arg, dependencies) {\r\n const obs = useReact_useState_FCFD9EF(ElmishObservable$2_$ctor)[0];\r\n const patternInput_1 = useReact_useState_FCFD9EF(() => runProgram(program, arg, obs, void 0));\r\n const setState = patternInput_1[1];\r\n useReact_useEffect_Z5234A374(() => {\r\n if (ElmishObservable$2__get_HasDisposedOnce(obs)) {\r\n setState(runProgram(program, arg, obs, void 0));\r\n }\r\n return React_createDisposable_3A5B6456(() => {\r\n ElmishObservable$2__DisposeState(obs);\r\n });\r\n }, defaultArg(dependencies, []));\r\n ElmishObservable$2__Subscribe_5028453F(obs, setState);\r\n return [patternInput_1[0], (arg00) => {\r\n ElmishObservable$2__Dispatch_2B594(obs, arg00);\r\n }];\r\n}\r\n\r\nexport function useFeliz_React__React_useElmish_Static_Z151674B(program, dependencies) {\r\n return useFeliz_React__React_useElmish_Static_76E709(program, void 0, dependencies);\r\n}\r\n\r\nexport function useFeliz_React__React_useElmish_Static_Z4D826B22(init, update, arg, dependencies) {\r\n return useFeliz_React__React_useElmish_Static_76E709(() => ProgramModule_mkProgram(init, update, (_arg2, _arg1) => {\r\n }), arg, dependencies);\r\n}\r\n\r\nexport function useFeliz_React__React_useElmish_Static_B42E862(init, update, dependencies) {\r\n return useFeliz_React__React_useElmish_Static_Z151674B(() => ProgramModule_mkProgram(init, update, (_arg4, _arg3) => {\r\n }), dependencies);\r\n}\r\n\r\nexport function useFeliz_React__React_useElmish_Static_78C5B8C8(init, update, dependencies) {\r\n return useFeliz_React__React_useElmish_Static_Z151674B(() => ProgramModule_mkProgram(() => init, update, (_arg6, _arg5) => {\r\n }), dependencies);\r\n}\r\n\r\n","import { Union } from \"../fable-library.3.6.3/Types.js\";\r\nimport { union_type, class_type } from \"../fable-library.3.6.3/Reflection.js\";\r\nimport { useReact_useCallback_93353E, React_useStateWithUpdater_1505, useReact_useCallbackRef_7C4B0DD6, useReact_useEffect_Z101E1A95, React_createDisposable_3A5B6456, useReact_useEffectOnce_Z5ECA432F, useReact_useRef_1505, useFeliz_React__React_useState_Static_1505 } from \"../Feliz.1.57.0/React.fs.js\";\r\nimport { parallel, ignore, isCancellationRequested, startImmediate, cancel, createCancellationToken } from \"../fable-library.3.6.3/Async.js\";\r\nimport { singleton } from \"../fable-library.3.6.3/AsyncBuilder.js\";\r\nimport { toList as toList_1, add, empty } from \"../fable-library.3.6.3/Map.js\";\r\nimport { singleton as singleton_1, collect, delay, toList } from \"../fable-library.3.6.3/Seq.js\";\r\n\r\nexport class Deferred$1 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"HasNotStartedYet\", \"InProgress\", \"Resolved\", \"Failed\"];\r\n }\r\n}\r\n\r\nexport function Deferred$1$reflection(gen0) {\r\n return union_type(\"Feliz.UseDeferred.Deferred`1\", [gen0], Deferred$1, () => [[], [], [[\"Item\", gen0]], [[\"Item\", class_type(\"System.Exception\")]]]);\r\n}\r\n\r\nexport function Deferred_hasNotStartedYet(_arg1) {\r\n if (_arg1.tag === 0) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function Deferred_resolved(_arg1) {\r\n if (_arg1.tag === 2) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function Deferred_inProgress(_arg1) {\r\n if (_arg1.tag === 1) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function Deferred_map(transform, deferred) {\r\n switch (deferred.tag) {\r\n case 1: {\r\n return new Deferred$1(1);\r\n }\r\n case 3: {\r\n return new Deferred$1(3, deferred.fields[0]);\r\n }\r\n case 2: {\r\n try {\r\n return new Deferred$1(2, transform(deferred.fields[0]));\r\n }\r\n catch (error_1) {\r\n return new Deferred$1(3, error_1);\r\n }\r\n }\r\n default: {\r\n return new Deferred$1(0);\r\n }\r\n }\r\n}\r\n\r\nexport function Deferred_iter(perform, deferred) {\r\n if (deferred.tag === 2) {\r\n perform(deferred.fields[0]);\r\n }\r\n}\r\n\r\nexport function Deferred_exists(predicate, _arg1) {\r\n if (_arg1.tag === 2) {\r\n return predicate(_arg1.fields[0]);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function Deferred_bind(transform, deferred) {\r\n switch (deferred.tag) {\r\n case 1: {\r\n return new Deferred$1(1);\r\n }\r\n case 3: {\r\n return new Deferred$1(3, deferred.fields[0]);\r\n }\r\n case 2: {\r\n try {\r\n return transform(deferred.fields[0]);\r\n }\r\n catch (error_1) {\r\n return new Deferred$1(3, error_1);\r\n }\r\n }\r\n default: {\r\n return new Deferred$1(0);\r\n }\r\n }\r\n}\r\n\r\nexport function useFeliz_React__React_useDeferred_Static_2344FC52(operation, dependencies) {\r\n const patternInput = useFeliz_React__React_useState_Static_1505(new Deferred$1(0));\r\n const setDeferred = patternInput[1];\r\n let token_1;\r\n const cts = useReact_useRef_1505(createCancellationToken());\r\n const token = useReact_useRef_1505(cts.current);\r\n useReact_useEffectOnce_Z5ECA432F(() => React_createDisposable_3A5B6456(() => {\r\n cancel(cts.current);\r\n }));\r\n token_1 = token;\r\n const executeOperation = singleton.Delay(() => singleton.TryWith(singleton.Delay(() => {\r\n setDeferred(new Deferred$1(1));\r\n return singleton.Bind(operation, (_arg1) => {\r\n setDeferred(new Deferred$1(2, _arg1));\r\n return singleton.Zero();\r\n });\r\n }), (_arg2) => {\r\n setDeferred(new Deferred$1(3, _arg2));\r\n return singleton.Zero();\r\n }));\r\n useReact_useEffect_Z101E1A95(() => {\r\n startImmediate(executeOperation, token_1.current);\r\n }, dependencies);\r\n return patternInput[0];\r\n}\r\n\r\nexport function useFeliz_React__React_useDeferredCallback_Static_7088D81D(operation, setDeferred) {\r\n const cancellationToken = useReact_useRef_1505(createCancellationToken());\r\n useReact_useEffectOnce_Z5ECA432F(() => React_createDisposable_3A5B6456(() => {\r\n cancel(cancellationToken.current);\r\n }));\r\n return useReact_useCallbackRef_7C4B0DD6((arg_1) => {\r\n if (!isCancellationRequested(cancellationToken.current)) {\r\n startImmediate(singleton.Delay(() => singleton.TryWith(singleton.Delay(() => {\r\n setDeferred(new Deferred$1(1));\r\n return singleton.Bind(operation(arg_1), (_arg3) => {\r\n setDeferred(new Deferred$1(2, _arg3));\r\n return singleton.Zero();\r\n });\r\n }), (_arg4) => {\r\n setDeferred(new Deferred$1(3, _arg4));\r\n return singleton.Zero();\r\n })), cancellationToken.current);\r\n }\r\n });\r\n}\r\n\r\nexport function useFeliz_React__React_useDeferredParallel_Static_Z7E3F34D2(deferred, map) {\r\n const patternInput = React_useStateWithUpdater_1505(empty());\r\n const addData = useReact_useCallbackRef_7C4B0DD6((tupledArg) => {\r\n patternInput[1]((prev) => add(tupledArg[0], tupledArg[1], prev));\r\n });\r\n let token_1;\r\n const cts = useReact_useRef_1505(createCancellationToken());\r\n const token = useReact_useRef_1505(cts.current);\r\n useReact_useEffectOnce_Z5ECA432F(() => React_createDisposable_3A5B6456(() => {\r\n cancel(cts.current);\r\n }));\r\n token_1 = token;\r\n const start = useReact_useCallback_93353E((operations_1) => {\r\n setTimeout(() => {\r\n startImmediate(ignore(parallel(toList(delay(() => collect((matchValue) => {\r\n const key_1 = matchValue[0];\r\n return singleton_1(singleton.Delay(() => singleton.TryWith(singleton.Delay(() => {\r\n addData([key_1, new Deferred$1(1)]);\r\n return singleton.Bind(matchValue[1], (_arg5) => {\r\n addData([key_1, new Deferred$1(2, _arg5)]);\r\n return singleton.Zero();\r\n });\r\n }), (_arg6) => {\r\n addData([key_1, new Deferred$1(3, _arg6)]);\r\n return singleton.Zero();\r\n })));\r\n }, operations_1))))), token_1.current);\r\n }, 0);\r\n });\r\n useReact_useEffect_Z101E1A95(() => {\r\n Deferred_iter((data_1) => {\r\n start(map(data_1));\r\n }, deferred);\r\n }, [deferred]);\r\n return toList_1(patternInput[0]);\r\n}\r\n\r\n","import { Union, Record } from \"./fable_modules/fable-library.3.6.3/Types.js\";\r\nimport { union_type, class_type, record_type, list_type, option_type, string_type } from \"./fable_modules/fable-library.3.6.3/Reflection.js\";\r\nimport { singleton } from \"./fable_modules/fable-library.3.6.3/AsyncBuilder.js\";\r\nimport { awaitPromise } from \"./fable_modules/fable-library.3.6.3/Async.js\";\r\nimport { Fetch_get_511FB67E } from \"./fable_modules/Dnn.Fable.Fetch.2.0.0/fetch.fs.js\";\r\nimport { FSharpMap__get_Keys, FSharpMap__get_Item, ofSeq } from \"./fable_modules/fable-library.3.6.3/Map.js\";\r\nimport { equals, createObj, stringHash, comparePrimitives } from \"./fable_modules/fable-library.3.6.3/Util.js\";\r\nimport { sortBy, ofArray, map as map_2, filter as filter_4, cons, contains, forAll, isEmpty, empty } from \"./fable_modules/fable-library.3.6.3/List.js\";\r\nimport { Cmd_none } from \"./fable_modules/Fable.Elmish.3.1.0/cmd.fs.js\";\r\nimport { map } from \"./fable_modules/fable-library.3.6.3/Array.js\";\r\nimport { printf, toConsole, split } from \"./fable_modules/fable-library.3.6.3/String.js\";\r\nimport { map as map_1, defaultArg } from \"./fable_modules/fable-library.3.6.3/Option.js\";\r\nimport { Deferred_render, BootstrapModule_Pager, Icon_search, BootstrapModule_prependAndGrouped, Icon_envelopeOpen, Icon_phone, NumberOfCols, BootstrapModule_col, BootstrapModule_row } from \"./Elements.fs.js\";\r\nimport { createElement } from \"react\";\r\nimport * as react from \"react\";\r\nimport { Interop_reactApi } from \"./fable_modules/Feliz.1.57.0/Interop.fs.js\";\r\nimport { filter as filter_5, map as map_3 } from \"./fable_modules/fable-library.3.6.3/Seq.js\";\r\nimport { useFeliz_React__React_useElmish_Static_B42E862 } from \"./fable_modules/Feliz.UseElmish.1.6.0/UseElmish.fs.js\";\r\nimport { useFeliz_React__React_useDeferred_Static_2344FC52 } from \"./fable_modules/Feliz.UseDeferred.1.4.1/UseDeferred.fs.js\";\r\n\r\nexport class Types_Eintrag extends Record {\r\n constructor(Firma, Stadt, Land, Adresse, Adresse2, PLZ, Homepage, Telefon, Email, T$00E4tigkeitsfelder, Leistungen) {\r\n super();\r\n this.Firma = Firma;\r\n this.Stadt = Stadt;\r\n this.Land = Land;\r\n this.Adresse = Adresse;\r\n this.Adresse2 = Adresse2;\r\n this.PLZ = PLZ;\r\n this.Homepage = Homepage;\r\n this.Telefon = Telefon;\r\n this.Email = Email;\r\n this[\"Tätigkeitsfelder\"] = T$00E4tigkeitsfelder;\r\n this.Leistungen = Leistungen;\r\n }\r\n}\r\n\r\nexport function Types_Eintrag$reflection() {\r\n return record_type(\"Anbieterverzeichnis.Types.Eintrag\", [], Types_Eintrag, () => [[\"Firma\", string_type], [\"Stadt\", string_type], [\"Land\", string_type], [\"Adresse\", option_type(string_type)], [\"Adresse2\", option_type(string_type)], [\"PLZ\", option_type(string_type)], [\"Homepage\", option_type(string_type)], [\"Telefon\", option_type(string_type)], [\"Email\", option_type(string_type)], [\"Tätigkeitsfelder\", option_type(string_type)], [\"Leistungen\", list_type(string_type)]]);\r\n}\r\n\r\nexport class Types_Filter extends Record {\r\n constructor(Leistungen, Suchbegriff) {\r\n super();\r\n this.Leistungen = Leistungen;\r\n this.Suchbegriff = Suchbegriff;\r\n }\r\n}\r\n\r\nexport function Types_Filter$reflection() {\r\n return record_type(\"Anbieterverzeichnis.Types.Filter\", [], Types_Filter, () => [[\"Leistungen\", list_type(string_type)], [\"Suchbegriff\", string_type]]);\r\n}\r\n\r\nexport class Types_Model extends Record {\r\n constructor(Eintr$00E4ge, Gefiltert, Filter, Leistungen) {\r\n super();\r\n this[\"Einträge\"] = Eintr$00E4ge;\r\n this.Gefiltert = Gefiltert;\r\n this.Filter = Filter;\r\n this.Leistungen = Leistungen;\r\n }\r\n}\r\n\r\nexport function Types_Model$reflection() {\r\n return record_type(\"Anbieterverzeichnis.Types.Model\", [], Types_Model, () => [[\"Einträge\", list_type(Types_Eintrag$reflection())], [\"Gefiltert\", list_type(Types_Eintrag$reflection())], [\"Filter\", Types_Filter$reflection()], [\"Leistungen\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [string_type, string_type])]]);\r\n}\r\n\r\nexport class Types_Msg extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"SuchbegriffGeändert\", \"LeistungFilterHinzufügen\", \"LeistungFilterEntfernen\"];\r\n }\r\n}\r\n\r\nexport function Types_Msg$reflection() {\r\n return union_type(\"Anbieterverzeichnis.Types.Msg\", [], Types_Msg, () => [[[\"Item\", string_type]], [[\"Item\", string_type]], [[\"Item\", string_type]]]);\r\n}\r\n\r\nexport const API_moduleName = \"dgzfp.bc.anbieterverzeichnis\";\r\n\r\nexport function API_load(moduleId) {\r\n return singleton.Delay(() => singleton.ReturnFrom(awaitPromise(Fetch_get_511FB67E(moduleId, API_moduleName, \"Anbieterverzeichnis/Get\", void 0, void 0, void 0, {\r\n ResolveType: () => list_type(Types_Eintrag$reflection()),\r\n }))));\r\n}\r\n\r\nexport function State_leistungen() {\r\n return ofSeq([[\"-\", \"ohne\"], [\"AR\", \"Akustische Resonanzanalyse\"], [\"AT\", \"Schallemmission\"], [\"CT\", \"Computertomografie\"], [\"ET\", \"Wirbelstrom\"], [\"LT\", \"Lecksuche/Dichtheitsprüfung\"], [\"MT\", \"Magnetpulververfahren\"], [\"OM\", \"Optische Messtechnik\"], [\"PT\", \"Eindringverfahren\"], [\"RT\", \"Durchstrahlungsprüfung\"], [\"TT\", \"Thermografie\"], [\"UT\", \"Ultraschall\"], [\"VT\", \"Sichtprüfung\"], [\"S\", \"ZfP Service\"]], {\r\n Compare: (x, y) => comparePrimitives(x, y),\r\n });\r\n}\r\n\r\nexport function State_init(eintr$00E4ge) {\r\n return [new Types_Model(eintr$00E4ge, eintr$00E4ge, new Types_Filter(empty(), \"\"), State_leistungen()), Cmd_none()];\r\n}\r\n\r\nexport function State_apply(filter_1, e) {\r\n const begriffe = map((s) => s.toLocaleUpperCase().trim(), split(filter_1.Suchbegriff.trim(), [\" \"], null, 0));\r\n if (isEmpty(filter_1.Leistungen) ? true : forAll((l) => contains(l, e.Leistungen, {\r\n Equals: (x, y) => (x === y),\r\n GetHashCode: (x) => stringHash(x),\r\n }), filter_1.Leistungen)) {\r\n if (begriffe.length === 0) {\r\n return true;\r\n }\r\n else {\r\n return begriffe.some((b) => {\r\n if (((((e.Firma.toLocaleUpperCase().indexOf(b) >= 0) ? true : (e.Stadt.toLocaleUpperCase().indexOf(b) >= 0)) ? true : (e.Land.toLocaleUpperCase().indexOf(b) >= 0)) ? true : (defaultArg(e.PLZ, \"\").toLocaleUpperCase().indexOf(b) >= 0)) ? true : (defaultArg(e[\"Tätigkeitsfelder\"], \"\").toLocaleUpperCase().indexOf(b) >= 0)) {\r\n return true;\r\n }\r\n else {\r\n return defaultArg(map_1((s_1) => (s_1.toLocaleUpperCase().indexOf(b) >= 0), e[\"Tätigkeitsfelder\"]), false);\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function State_update(msg, model) {\r\n switch (msg.tag) {\r\n case 1: {\r\n const filter_2 = new Types_Filter(cons(msg.fields[0], model.Filter.Leistungen), model.Filter.Suchbegriff);\r\n return [new Types_Model(model[\"Einträge\"], filter_4((e_1) => State_apply(filter_2, e_1), model[\"Einträge\"]), filter_2, model.Leistungen), Cmd_none()];\r\n }\r\n case 2: {\r\n const filter_3 = new Types_Filter(filter_4((l$0027) => (l$0027 !== msg.fields[0]), model.Filter.Leistungen), model.Filter.Suchbegriff);\r\n return [new Types_Model(model[\"Einträge\"], filter_4((e_2) => State_apply(filter_3, e_2), model[\"Einträge\"]), filter_3, model.Leistungen), Cmd_none()];\r\n }\r\n default: {\r\n const filter_1 = new Types_Filter(model.Filter.Leistungen, msg.fields[0]);\r\n return [new Types_Model(model[\"Einträge\"], filter_4((e) => State_apply(filter_1, e), model[\"Einträge\"]), filter_1, model.Leistungen), Cmd_none()];\r\n }\r\n }\r\n}\r\n\r\nexport function Eintrag(eintragInputProps) {\r\n let children_4;\r\n const eintrag = eintragInputProps.eintrag;\r\n const leistungen = eintragInputProps.leistungen;\r\n const filter_1 = eintragInputProps.filter;\r\n toConsole(printf(\"%s\"))(eintrag.Firma);\r\n return BootstrapModule_row([BootstrapModule_col(new NumberOfCols(0, 5), [createElement(\"h4\", {\r\n children: eintrag.Firma,\r\n className: \"mb-1\",\r\n }), createElement(\"p\", {\r\n children: Interop_reactApi.Children.toArray([defaultArg(map_1((a) => react.createElement(react.Fragment, {}, a, createElement(\"br\", {})), eintrag.Adresse), null), defaultArg(map_1((a_1) => react.createElement(react.Fragment, {}, a_1, createElement(\"br\", {})), eintrag.Adresse2), null), `${eintrag.PLZ} ${eintrag.Stadt}`, createElement(\"br\", {}), eintrag.Land]),\r\n }), createElement(\"p\", {\r\n children: Interop_reactApi.Children.toArray([Icon_phone, ` ${eintrag.Telefon}`, defaultArg(map_1((e) => react.createElement(react.Fragment, {}, createElement(\"br\", {}), Icon_envelopeOpen, \" \", createElement(\"a\", {\r\n href: `mailto:${e}`,\r\n children: e,\r\n })), eintrag.Email), null), defaultArg(map_1((hp) => react.createElement(react.Fragment, {}, createElement(\"br\", {}), createElement(\"a\", {\r\n href: hp,\r\n children: hp,\r\n })), eintrag.Homepage), null)]),\r\n })]), BootstrapModule_col(new NumberOfCols(0, 7), [(children_4 = map_2((l_1) => createElement(\"span\", {\r\n className: \"badge badge-secondary mr-1 p-1 \",\r\n children: `${l_1} - ${FSharpMap__get_Item(leistungen, l_1)}`,\r\n }), filter_4((l) => (l !== \"-\"), eintrag.Leistungen)), createElement(\"div\", {\r\n children: Interop_reactApi.Children.toArray(Array.from(children_4)),\r\n })), defaultArg(map_1((t) => createElement(\"div\", {\r\n className: \"mt-2\",\r\n children: Interop_reactApi.Children.toArray([createElement(\"i\", {\r\n children: [t],\r\n })]),\r\n }), eintrag[\"Tätigkeitsfelder\"]), null)])]);\r\n}\r\n\r\nexport function filter(filter_1, leistungen, dispatch) {\r\n let value_14;\r\n const tags = map_3((l_1) => {\r\n if (contains(l_1, filter_1.Leistungen, {\r\n Equals: (x, y) => (x === y),\r\n GetHashCode: (x) => stringHash(x),\r\n })) {\r\n return createElement(\"span\", {\r\n children: `${l_1} - ${FSharpMap__get_Item(leistungen, l_1)}`,\r\n className: \"badge badge-warning mr-1 \",\r\n onClick: (_arg1) => {\r\n dispatch(new Types_Msg(2, l_1));\r\n },\r\n });\r\n }\r\n else {\r\n return createElement(\"span\", {\r\n children: `${l_1} - ${FSharpMap__get_Item(leistungen, l_1)}`,\r\n className: \"badge badge-light mr-1 \",\r\n onClick: (_arg2) => {\r\n dispatch(new Types_Msg(1, l_1));\r\n },\r\n });\r\n }\r\n }, filter_5((l) => (l !== \"-\"), FSharpMap__get_Keys(leistungen)));\r\n return react.createElement(react.Fragment, {}, BootstrapModule_prependAndGrouped(Icon_search, createElement(\"input\", createObj(ofArray([[\"className\", \"form-control\"], [\"placeholder\", \"Suchbegriff eingeben\"], (value_14 = filter_1.Suchbegriff, [\"ref\", (e) => {\r\n if ((!(e == null)) && (!equals(e.value, value_14))) {\r\n e.value = value_14;\r\n }\r\n }]), [\"onChange\", (ev) => {\r\n dispatch(new Types_Msg(0, ev.target.value));\r\n }]])))), createElement(\"div\", {\r\n children: Interop_reactApi.Children.toArray(Array.from(tags)),\r\n }));\r\n}\r\n\r\nexport function Eintr$00E4ge(eintr$00E4geInputProps) {\r\n const eintr$00E4ge_1 = sortBy((e) => e.Firma.toUpperCase(), eintr$00E4geInputProps[\"einträge\"], {\r\n Compare: (x, y) => comparePrimitives(x, y),\r\n });\r\n const patternInput = useFeliz_React__React_useElmish_Static_B42E862(() => State_init(eintr$00E4ge_1), (msg, model) => State_update(msg, model), []);\r\n const model_1 = patternInput[0];\r\n return createElement(BootstrapModule_Pager, {\r\n Header: filter(model_1.Filter, model_1.Leistungen, patternInput[1]),\r\n List: model_1.Gefiltert,\r\n PageSize: 10,\r\n RenderContainer: (arg00) => createElement(\"div\", {\r\n children: Interop_reactApi.Children.toArray(Array.from(arg00)),\r\n }),\r\n RenderElement: (eintrag) => createElement(Eintrag, {\r\n filter: model_1.Filter,\r\n leistungen: model_1.Leistungen,\r\n eintrag: eintrag,\r\n }),\r\n });\r\n}\r\n\r\nexport function Verzeichnis(verzeichnisInputProps) {\r\n const eintr$00E4ge = useFeliz_React__React_useDeferred_Static_2344FC52(API_load(verzeichnisInputProps.moduleid), []);\r\n return react.createElement(react.Fragment, {}, createElement(\"h2\", {\r\n children: [\"Anbieterverzeichnis\"],\r\n }), Deferred_render((eintr$00E4ge_1) => createElement(Eintr$00E4ge, {\r\n [\"einträge\"]: eintr$00E4ge_1,\r\n }), eintr$00E4ge));\r\n}\r\n\r\n","import * as global$ from \"./styles/global.scss\";\r\nimport { render } from \"react-dom\";\r\nimport { createElement } from \"react\";\r\nimport { Verzeichnis } from \"./Anbieterverzeichnis.fs.js\";\r\n\r\n\r\nexport const container = document.getElementById(\"feliz\");\r\n\r\nexport const moduleId = container.dataset[\"moduleid\"];\r\n\r\nrender(createElement(Verzeichnis, {\r\n moduleid: moduleId,\r\n}), container);\r\n\r\n"],"sourceRoot":""}