diff --git a/Content/minimal/.gitignore b/Content/minimal/.gitignore index bcc62c93..7902b816 100644 --- a/Content/minimal/.gitignore +++ b/Content/minimal/.gitignore @@ -1,4 +1,5 @@ .fable/ +fable_modules/ .fake/ .farmer/ .idea/ diff --git a/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fable.Fetch.fableproj b/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fable.Fetch.fableproj deleted file mode 100644 index 10adcccf..00000000 --- a/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fable.Fetch.fableproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 2.4.0 - 2.4.0 - netstandard2.0 - - - - - - - - - - - - - - diff --git a/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fetch.fs b/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fetch.fs deleted file mode 100644 index 59709ec2..00000000 --- a/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fetch.fs +++ /dev/null @@ -1,390 +0,0 @@ -/// The Fetch API provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. -/// It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. -module Fetch - -#nowarn "1182" // Unused values - -open System -open Fable.Core -open Fable.Core.JsInterop -open Browser.Types - -[] -module Types = - - type Body = - abstract bodyUsed: bool with get, set - abstract arrayBuffer: unit -> JS.Promise - abstract blob: unit -> JS.Promise - abstract formData: unit -> JS.Promise - abstract json : unit -> JS.Promise - abstract json<'T> : unit -> JS.Promise<'T> - abstract text : unit -> JS.Promise - - and Request = //(input: U2, ?init: RequestInit) = - inherit Body - abstract ``method`` : string with get - abstract url: string with get - abstract headers: Headers with get - abstract referrer: string with get - abstract mode: U2 with get - abstract credentials: U2 with get - abstract cache: U2 with get - abstract clone: unit -> unit - - and RequestInit = - abstract ``method``: string option with get, set - abstract headers: HeaderInit option with get, set - abstract body: BodyInit option with get, set - abstract mode: RequestMode option with get, set - abstract credentials: RequestCredentials option with get, set - abstract cache: RequestCache option with get, set - - and [] RequestContext = - | Audio | Beacon | Cspreport | Download | Embed | Eventsource | Favicon | Fetch | Font - | Form | Frame | Hyperlink | Iframe | Image | Imageset | Import | Internal | Location - | Manifest | Object | Ping | Plugin | Prefetch | Script | Serviceworker | Sharedworker - | Subresource | Style | Track | Video | Worker | Xmlhttprequest | Xslt - - and [] RequestMode = - | []Sameorigin | []Nocors | Cors - - and [] RequestCredentials = - Omit | []Sameorigin | Include - - and [] RequestCache = - | Default - | []Nostore - | Reload - | []Nocache - | []Forcecache - | []Onlyifcached - - and [] RedirectMode = - | Follow | Error | Manual - - and [] ReferrerPolicy = - | []NoReferrer - | []NoReferrerWhenDowngrade - | Origin - | []OriginWhenCrossOrigin - | []UnsafeUrl - - and Headers = - abstract append : string * string -> unit - abstract delete : string -> unit - abstract get : string -> string - abstract getAll : string -> string[] - abstract has : string -> bool - abstract set : string * string -> unit - - /// Specifying which web sites can participate in cross-origin resource sharing - [] abstract AccessControlAllowOrigin: string option - - /// Specifies which patch document formats this server supports - [] abstract AcceptPatch: string option - - /// What partial content range types this server supports via byte serving - [] abstract AcceptRanges: string option - - /// The age the object has been in a proxy cache in seconds - [] abstract Age: string option - - /// Valid actions for a specified resource. To be used for a 405 Method not allowed - [] abstract Allow: string option - - /// A server uses "Alt-Svc" header (meaning Alternative Services) to indicate that its resources can also be accessed at a different network location (host or port) or using a different protocol - [] abstract AltSvc: string option - - /// Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds - [] abstract CacheControl: string option - - /// Control options for the current connection and list of hop-by-hop response fields - [] abstract Connection: string option - - /// An opportunity to raise a "File Download" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters. - [] abstract ContentDisposition: string option - - /// The type of encoding used on the data - [] abstract ContentEncoding: string option - - /// The natural language or languages of the intended audience for the enclosed content - [] abstract ContentLanguage: string option - - /// The length of the response body in octets (8-bit bytes) - [] abstract ContentLength: string option - - /// An alternate location for the returned data - [] abstract ContentLocation: string option - - /// A Base64-encoded binary MD5 sum of the content of the response - [] abstract ContentMD5: string option - - /// Where in a full body message this partial message belongs - [] abstract ContentRange: string option - - /// The MIME type of this content - [] abstract ContentType: string option - - /// The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231) - [] abstract Date: string option - - /// An identifier for a specific version of a resource, often a message digest - [] abstract ETag: string option - - /// Gives the date/time after which the response is considered stale (in "HTTP-date" format as defined by RFC 7231) - [] abstract Expires: string option - - /// The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231) - [] abstract LastModified: string option - - /// Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988 - [] abstract Link: string option - - /// Used in redirection, or when a new resource has been created. - [] abstract Location: string option - - /// This field is supposed to set P3P policy, in the form of P3P:CP="your_compact_policy". - [] abstract P3P: string option - - /// Implementation-specific fields that may have various effects anywhere along the request-response chain. - [] abstract Pragma: string option - - /// Request authentication to access the proxy. - [] abstract ProxyAuthenticate: string option - - /// HTTP Public Key Pinning, announces hash of website's authentic TLS certificate - [] abstract PublicKeyPins: string option - - /// Used in redirection, or when a new resource has been created. This refresh redirects after 5 seconds. - [] abstract Refresh: string option - - /// If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date. - [] abstract RetryAfter: string option - - /// A name for the server - [] abstract Server: string option - - /// An HTTP cookie - [] abstract SetCookie: string option - - /// CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate "Status-Line" instead, defined by RFC 7230 - [] abstract Status: string option - - /// A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains. - [] abstract StrictTransportSecurity: string option - - /// The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding. - [] abstract Trailer: string option - - /// The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity. - [] abstract TransferEncoding: string option - - /// Tracking Status Value, value suggested to be sent in response to a DNT(do-not-track) - [] abstract TSV: string option - - /// Ask the client to upgrade to another protocol. - [] abstract Upgrade: string option - - /// Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server. - [] abstract Vary: string option - - /// Informs the client of proxies through which the response was sent. - [] abstract Via: string option - - /// A general warning about possible problems with the entity body. - [] abstract Warning: string option - - /// Indicates the authentication scheme that should be used to access the requested entity. - [] abstract WWWAuthenticate: string option - - /// Clickjacking protection: deny - no rendering within a frame, sameorigin - no rendering if origin mismatch, allow-from - allow from specified location, allowall - non-standard, allow from any location - [] abstract XFrameOptions: string option - - /// Cross-site scripting (XSS) filter - [] abstract XXSSProtection: string option - - /// Content Security Policy definition. - [] abstract ContentSecurityPolicy: string option - - /// The only defined value, "nosniff", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions - [] abstract XContentTypeOptions: string option - - /// Specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version) - [] abstract XPoweredBy: string option - - /// Recommends the preferred rendering engine (often a backward-compatibility mode) to use to display the content. Also used to activate Chrome Frame in Internet Explorer. - [] abstract XUACompatible: string option - - /// Provide the duration of the audio or video in seconds; only supported by Gecko browsers - [] abstract XContentDuration: string option - - /// Tells a server which (presumably in the middle of a HTTP -> HTTPS migration) hosts mixed content that the client would prefer redirection to HTTPS and can handle Content-Security-Policy: upgrade-insecure-requests - [] abstract UpgradeInsecureRequests: string option - - /// Correlates HTTP requests between a client and server. - [] abstract XRequestID: string option - - /// Correlates HTTP requests between a client and server. - [] abstract XCorrelationID: string option - - - and Response = //(?body: BodyInit, ?init: ResponseInit) = - inherit Body - - /// Verifies that the fetch was successful - [] abstract Ok: bool - - /// Returns the HTTP status code - [] abstract Status: int - - /// Returns the HTTP status message - [] abstract StatusText: string - - /// Returns the response URL - [] abstract Url: string - - /// Returns the headers objct - [] abstract Headers : Headers - - and [] ResponseType = - | Basic | Cors | Default | Error | Opaque - - and ResponseInit = - abstract status: float with get, set - abstract statusText: string option with get, set - abstract headers: HeaderInit option with get, set - - and HeaderInit = - U2 - - and BodyInit = - U3 - - [] - type RequestInfo = - /// Uses a simple Url as string to create the request info - | Url of string - /// Uses a Request object as request info - | Req of Request - - type [] GlobalFetch = - []static member fetch (req: RequestInfo, ?init: RequestInit) = jsNative :JS.Promise - - [] - type HttpMethod = - | [] CONNECT - | [] DELETE - | [] GET - | [] HEAD - | [] OPTIONS - | [] PATCH - | [] POST - | [] PUT - | [] TRACE - - type IHttpRequestHeaders = - interface end - - type HttpRequestHeaders = - | Accept of string - | [] AcceptCharset of string - | [] AcceptEncoding of string - | [] AcceptLanguage of string - | [] AcceptDatetime of string - | Authorization of string - | [] CacheControl of string - | Connection of string - | Cookie of string - | [] ContentLength of string - | [] ContentMD5 of string - | [] ContentType of string - | Date of string - | Expect of string - | Forwarded of string - | From of string - | Host of string - | [] IfMatch of string - | [] IfModifiedSince of string - | [] IfNoneMatch of string - | [] IfRange of string - | [] IfUnmodifiedSince of string - | [] MaxForwards of int - | Origin of string - | Pragma of string - | [] ProxyAuthorization of string - | Range of string - | Referer of string - | [] SOAPAction of string - | [] TE of string - | [] UserAgent of string - | Upgrade of string - | Via of string - | Warning of string - | [] XRequestedWith of string - | [] DNT of string - | [] XForwardedFor of string - | [] XForwardedHost of string - | [] XForwardedProto of string - | [] FrontEndHttps of string - | [] XHttpMethodOverride of string - | [] XATTDeviceId of string - | [] XWapProfile of string - | [] ProxyConnection of string - | [] XUIDH of string - | [] XCsrfToken of string - | [] Custom of key:string * value:obj - - type AbortSignal = - abstract aborted : bool with get - abstract onabort : (unit -> unit) with get, set - - type AbortController = - abstract signal : AbortSignal with get - abstract abort : (unit -> unit) with get - - [] - type RequestProperties = - | Method of HttpMethod - | Headers of IHttpRequestHeaders - | Body of BodyInit - | Mode of RequestMode - | Credentials of RequestCredentials - | Cache of RequestCache - | Redirect of RedirectMode - | Referrer of string - | ReferrerPolicy of ReferrerPolicy - | Integrity of string - | KeepAlive of bool - | Signal of AbortSignal - -[] -let newAbortController () : AbortController = jsNative - -let inline requestHeaders (headers: HttpRequestHeaders list) = - RequestProperties.Headers(keyValueList CaseRules.None headers :?> IHttpRequestHeaders) - -let inline requestProps (props: RequestProperties list) = - keyValueList CaseRules.LowerFirst props :?> RequestInit - -let private errorString (response: Response) = - string response.Status + " " + response.StatusText + " for URL " + response.Url - -/// Retrieves data from the specified resource. Fails if `response.Ok` evals to false. -let fetch (url: string) (init: RequestProperties list) : JS.Promise = - GlobalFetch.fetch(RequestInfo.Url url, requestProps init) - |> Promise.map (fun response -> - if response.Ok - then response - else errorString response |> failwith) - -/// Retrieves data from the specified resource without check for 2xx status. -let fetchUnsafe (url: string) (init: RequestProperties list) : JS.Promise = - GlobalFetch.fetch(RequestInfo.Url url, requestProps init) - -let tryFetch (url: string) (init: RequestProperties list) : JS.Promise> = - fetch url init |> Promise.result - -/// Sends a HTTP OPTIONS request. -let tryOptionsRequest (url:string) : JS.Promise> = - fetch url [RequestProperties.Method HttpMethod.OPTIONS] |> Promise.result diff --git a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Fable.Promise.fableproj b/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Fable.Promise.fableproj deleted file mode 100644 index 5e117374..00000000 --- a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Fable.Promise.fableproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 2.2.2 - 2.2.2 - netstandard2.0 - - - - - - - - - - - - - diff --git a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Promise.fs b/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Promise.fs deleted file mode 100644 index c20f7680..00000000 --- a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Promise.fs +++ /dev/null @@ -1,176 +0,0 @@ - -[] -module Promise - -#nowarn "1182" // Unused values - -open System -open Fable.Core -open Fable.Core.JsInterop - -let inline private (!!) (x:obj): 'T = unbox x - -[] -/// The promise function receives two other function parameters: success and fail -let create (f: ('T->unit)->(Exception->unit)->unit): JS.Promise<'T> = jsNative - -[ setTimeout(resolve, $0))")>] -let sleep (ms: int): JS.Promise = jsNative - -[] -let lift<'T> (a: 'T): JS.Promise<'T> = jsNative - -/// Creates promise (in rejected state) with supplied reason. -let reject<'T> reason : JS.Promise<'T> = JS.Constructors.Promise.reject<'T> reason - -[] -let bind (a: 'T->JS.Promise<'R>) (pr: JS.Promise<'T>): JS.Promise<'R> = jsNative - -[] -let map (a: 'T->'R) (pr: JS.Promise<'T>): JS.Promise<'R> = jsNative - -[] -let iter (a: 'T->unit) (pr: JS.Promise<'T>): unit = jsNative - -[] -/// This version of `catch` fakes a function returning just 'T, as opposed to `Promise<'T>`. If you need to return `Promise<'T>`, use `catchBind`. -let catch (fail: Exception->'T) (pr: JS.Promise<'T>): JS.Promise<'T> = jsNative - -[] -/// This is a version of `catch` that fakes a function returning Promise<'T> as opposed to just 'T. If you need to return just 'T, use `catch`. -let catchBind (fail: Exception->JS.Promise<'T>) (pr: JS.Promise<'T>): JS.Promise<'T> = jsNative - -[] -/// Used to catch errors at the end of a promise chain. -let catchEnd (fail: Exception->unit) (pr: JS.Promise<'T>): unit = jsNative - -[] -/// A combination of `map/bind` and `catch/catchBind`, this function applies the `success` continuation when the input promise resolves successfully, or `fail` continuation when the input promise fails. Both continuations may return either naked value `'R` or another promise `Promise<'R>`. Use the erased-cast operator `!^` to cast values when returning, for example: -/// ``` -/// somePromise |> Promise.either (fun x -> !^(string x)) (fun err -> ^!(Promise.lift err.Message)) -/// ``` -let either (success: 'T->U2<'R, JS.Promise<'R>>) (fail: 'E->U2<'R, JS.Promise<'R>>) (pr: JS.Promise<'T>): JS.Promise<'R> = jsNative - -[] -let eitherEnd (success: 'T->unit) (fail: 'E->unit) (pr: JS.Promise<'T>): unit = jsNative - -[] -let start (pr: JS.Promise<'T>): unit = jsNative - -[] -let tryStart (fail: Exception->unit) (pr: JS.Promise<'T>): unit = jsNative - -[] -let Parallel (pr: seq>): JS.Promise<'T[]> = jsNative - -[] -let all (pr: seq>): JS.Promise<'T[]> = jsNative - -let result (a: JS.Promise<'A>): JS.Promise> = - either (U2.Case1 << Ok) (U2.Case1 << Error) a - -let mapResult (fn: 'A -> 'B) (a: JS.Promise>): JS.Promise> = - a |> map (Result.map fn) - -let bindResult (fn: 'A -> JS.Promise<'B>) (a: JS.Promise>): JS.Promise> = - a |> bind (fun a -> - match a with - | Ok a -> - result (fn a) - | Error e -> - lift (Error e)) - -let mapResultError (fn: 'B -> 'C) (a: JS.Promise>): JS.Promise> = - a |> map (Result.mapError fn) - -let tap (fn: 'A -> unit) (a: JS.Promise<'A>): JS.Promise<'A> = - a |> map (fun x -> fn x; x) - -type PromiseBuilder() = - [] - member x.Bind(p: JS.Promise<'T>, f: 'T->JS.Promise<'R>): JS.Promise<'R> = jsNative - - [ $2)")>] - member x.Combine(p1: JS.Promise, p2: JS.Promise<'T>): JS.Promise<'T> = jsNative - - member x.For(seq: seq<'T>, body: 'T->JS.Promise): JS.Promise = - // (lift (), seq) - // ||> Seq.fold (fun p a -> - // bind (fun () -> body a) p) - let mutable p = lift () - for a in seq do - p <- !!p?``then``(fun () -> body a) - p - - [] - member x.For(p: JS.Promise<'T>, f: 'T->JS.Promise<'R>): JS.Promise<'R> = jsNative - - member x.While(guard, p): JS.Promise = - if guard() - then bind (fun () -> x.While(guard, p)) p - else lift() - - [] - member x.Return(a: 'T): JS.Promise<'T> = jsNative - - [] - member x.ReturnFrom(p: JS.Promise<'T>): JS.Promise<'T> = jsNative - - [] - member x.Zero(): JS.Promise = jsNative - - member x.TryFinally(p: JS.Promise<'T>, compensation: unit->unit): JS.Promise<'T> = - either (fun (x: 'T) -> compensation(); U2.Case1 x) (fun er -> compensation(); raise !!er) p - - [] - member x.TryWith(p: JS.Promise<'T>, catchHandler: Exception->JS.Promise<'T>): JS.Promise<'T> = jsNative - - member x.Delay(generator: unit->JS.Promise<'T>): JS.Promise<'T> = - !!createObj[ - "then" ==> fun f1 f2 -> - try generator()?``then``(f1,f2) - with er -> - if box f2 = null - then !!JS.Constructors.Promise.reject(er) - else - try !!JS.Constructors.Promise.resolve(f2(er)) - with er -> !!JS.Constructors.Promise.reject(er) - "catch" ==> fun f -> - try generator()?catch(f) - with er -> - try !!JS.Constructors.Promise.resolve(f(er)) - with er -> !!JS.Constructors.Promise.reject(er) - ] - - member x.Run(p:JS.Promise<'T>): JS.Promise<'T> = - create (fun success fail -> - try - let p : JS.Promise<'T> = !!JS.Constructors.Promise.resolve(p) - p?``then``(success, fail) - with - er -> fail(er) - ) - - member x.Using<'T, 'R when 'T :> IDisposable>(resource: 'T, binder: 'T->JS.Promise<'R>): JS.Promise<'R> = - x.TryFinally(binder(resource), fun () -> resource.Dispose()) - - [] - member x.MergeSources(a: JS.Promise<'T1>, b: JS.Promise<'T2>): JS.Promise<'T1 * 'T2>= jsNative - - [] - member x.MergeSources3(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>): JS.Promise<'T1 * 'T2 * 'T3>= jsNative - - [] - member x.MergeSources4(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4>= jsNative - - [] - member x.MergeSources5(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>, e: JS.Promise<'T5>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4 * 'T5>= jsNative - - [] - member x.MergeSources6(a: JS.Promise<'T1>, b: JS.Promise<'T2>, c: JS.Promise<'T3>, d: JS.Promise<'T4>, e: JS.Promise<'T5>, f: JS.Promise<'T6>): JS.Promise<'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6>= jsNative - -// member x.BindReturn(y: JS.Promise<'T1>, f) = map f y - - [ $3(a,b))")>] - [] - member x.Merge(a: JS.Promise<'T1>, b: JS.Promise<'T2>, [] resultSelector : 'T1 -> 'T2 -> 'R): JS.Promise<'R> = jsNative diff --git a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/PromiseImpl.fs b/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/PromiseImpl.fs deleted file mode 100644 index 1844aa70..00000000 --- a/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/PromiseImpl.fs +++ /dev/null @@ -1,4 +0,0 @@ -[] -module PromiseImpl - -let promise = Promise.PromiseBuilder() \ No newline at end of file diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.d.ts deleted file mode 100644 index 91eeb24b..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { int32 } from "./Int32.js"; -import { Option } from "./Option.js"; -import { IComparer, IEqualityComparer } from "./Util.js"; -export declare function append(array1: T[], array2: T[], cons?: any): T[]; -export declare function filter(predicate: ((arg0: T) => boolean), array: T[]): T[]; -export declare function fill(target: T[], targetIndex: int32, count: int32, value: T): T[]; -export declare function getSubArray(array: T[], start: int32, count: int32): T[]; -export declare function last(array: T[]): T; -export declare function tryLast(array: T[]): Option; -export declare function mapIndexed(f: ((arg0: int32, arg1: T) => U), source: T[], cons?: any): U[]; -export declare function map(f: ((arg0: T) => U), source: T[], cons?: any): U[]; -export declare function mapIndexed2(f: ((arg0: int32, arg1: T1, arg2: T2) => U), source1: T1[], source2: T2[], cons?: any): U[]; -export declare function map2(f: ((arg0: T1, arg1: T2) => U), source1: T1[], source2: T2[], cons?: any): U[]; -export declare function mapIndexed3(f: ((arg0: int32, arg1: T1, arg2: T2, arg3: T3) => U), source1: T1[], source2: T2[], source3: T3[], cons?: any): U[]; -export declare function map3(f: ((arg0: T1, arg1: T2, arg2: T3) => U), source1: T1[], source2: T2[], source3: T3[], cons?: any): U[]; -export declare function mapFold(mapping: ((arg0: State, arg1: T) => [Result, State]), state: State, array: T[], cons?: any): [Result[], State]; -export declare function mapFoldBack(mapping: ((arg0: T, arg1: State) => [Result, State]), array: T[], state: State, cons?: any): [Result[], State]; -export declare function indexed(source: T[]): [int32, T][]; -export declare function truncate(count: int32, array: T[]): T[]; -export declare function concat(arrays: Iterable, cons?: any): T[]; -export declare function collect(mapping: ((arg0: T) => U[]), array: T[], cons?: any): U[]; -export declare function where<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): $a[]; -export declare function indexOf(array: T[], item_1: T, start: Option, count: Option, eq: IEqualityComparer): int32; -export declare function contains(value: T, array: T[], eq: IEqualityComparer): boolean; -export declare function empty<$a>(cons: any): $a[]; -export declare function singleton(value: T, cons?: any): T[]; -export declare function initialize(count: int32, initializer: ((arg0: int32) => T), cons?: any): T[]; -export declare function pairwise(array: T[]): [T, T][]; -export declare function replicate(count: int32, initial: T, cons?: any): T[]; -export declare function copy(array: T[]): T[]; -export declare function copyTo(source: T[], sourceIndex: int32, target: T[], targetIndex: int32, count: int32): void; -export declare function reverse(array: T[]): T[]; -export declare function scan(folder: ((arg0: State, arg1: T) => State), state: State, array: T[], cons?: any): State[]; -export declare function scanBack(folder: ((arg0: T, arg1: State) => State), array: T[], state: State, cons?: any): State[]; -export declare function skip(count: int32, array: T[], cons?: any): T[]; -export declare function skipWhile(predicate: ((arg0: T) => boolean), array: T[], cons?: any): T[]; -export declare function take(count: int32, array: T[], cons?: any): T[]; -export declare function takeWhile(predicate: ((arg0: T) => boolean), array: T[], cons?: any): T[]; -export declare function addInPlace(x: T, array: T[]): void; -export declare function addRangeInPlace(range: Iterable, array: T[]): void; -export declare function insertRangeInPlace(index: int32, range: Iterable, array: T[]): void; -export declare function removeInPlace(item_1: T, array: T[], eq: IEqualityComparer): boolean; -export declare function removeAllInPlace(predicate: ((arg0: T) => boolean), array: T[]): int32; -export declare function partition(f: ((arg0: T) => boolean), source: T[], cons?: any): [T[], T[]]; -export declare function find(predicate: ((arg0: T) => boolean), array: T[]): T; -export declare function tryFind(predicate: ((arg0: T) => boolean), array: T[]): Option; -export declare function findIndex(predicate: ((arg0: T) => boolean), array: T[]): int32; -export declare function tryFindIndex(predicate: ((arg0: T) => boolean), array: T[]): Option; -export declare function pick<$a, $b>(chooser: ((arg0: $a) => Option<$b>), array: $a[]): $b; -export declare function tryPick<$a, $b>(chooser: ((arg0: $a) => Option<$b>), array: $a[]): Option<$b>; -export declare function findBack<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): $a; -export declare function tryFindBack<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): Option<$a>; -export declare function findLastIndex<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): int32; -export declare function findIndexBack<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): int32; -export declare function tryFindIndexBack<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): Option; -export declare function choose(chooser: ((arg0: T) => Option), array: T[], cons?: any): U[]; -export declare function foldIndexed(folder: ((arg0: int32, arg1: State, arg2: T) => State), state: State, array: T[]): State; -export declare function fold(folder: ((arg0: State, arg1: T) => State), state: State, array: T[]): State; -export declare function iterate(action: ((arg0: T) => void), array: T[]): void; -export declare function iterateIndexed(action: ((arg0: int32, arg1: T) => void), array: T[]): void; -export declare function iterate2(action: ((arg0: T1, arg1: T2) => void), array1: T1[], array2: T2[]): void; -export declare function iterateIndexed2(action: ((arg0: int32, arg1: T1, arg2: T2) => void), array1: T1[], array2: T2[]): void; -export declare function isEmpty(array: T[]): boolean; -export declare function forAll(predicate: ((arg0: T) => boolean), array: T[]): boolean; -export declare function permute(f: ((arg0: int32) => int32), array: T[]): T[]; -export declare function setSlice(target: T[], lower: Option, upper: Option, source: T[]): void; -export declare function sortInPlaceBy(projection: ((arg0: a) => b), xs: a[], comparer: IComparer): void; -export declare function sortInPlace(xs: T[], comparer: IComparer): void; -export declare function sort(xs: T[], comparer: IComparer): T[]; -export declare function sortBy(projection: ((arg0: a) => b), xs: a[], comparer: IComparer): a[]; -export declare function sortDescending(xs: T[], comparer: IComparer): T[]; -export declare function sortByDescending(projection: ((arg0: a) => b), xs: a[], comparer: IComparer): a[]; -export declare function sortWith(comparer: ((arg0: T, arg1: T) => int32), xs: T[]): T[]; -export declare function allPairs(xs: T1[], ys: T2[]): [T1, T2][]; -export declare function unfold(generator: ((arg0: State) => Option<[T, State]>), state: State): T[]; -export declare function unzip<$a, $b>(array: [$a, $b][]): [$a[], $b[]]; -export declare function unzip3<$a, $b, $c>(array: [$a, $b, $c][]): [$a[], $b[], $c[]]; -export declare function zip(array1: T[], array2: U[]): [T, U][]; -export declare function zip3(array1: T[], array2: U[], array3: V[]): [T, U, V][]; -export declare function chunkBySize(chunkSize: int32, array: T[]): T[][]; -export declare function splitAt(index: int32, array: T[]): [T[], T[]]; -export declare function compareWith(comparer: ((arg0: T, arg1: T) => int32), source1: T[], source2: T[]): int32; -export declare function compareTo(comparer: ((arg0: T, arg1: T) => int32), source1: T[], source2: T[]): int32; -export declare function equalsWith(equals: ((arg0: T, arg1: T) => boolean), array1: T[], array2: T[]): boolean; -export declare function exactlyOne(array: T[]): T; -export declare function tryExactlyOne(array: T[]): Option; -export declare function head(array: T[]): T; -export declare function tryHead(array: T[]): Option; -export declare function tail(array: T[]): T[]; -export declare function item<$a>(index: int32, array: $a[]): $a; -export declare function tryItem(index: int32, array: T[]): Option; -export declare function foldBackIndexed(folder: ((arg0: int32, arg1: T, arg2: State) => State), array: T[], state: State): State; -export declare function foldBack(folder: ((arg0: T, arg1: State) => State), array: T[], state: State): State; -export declare function foldIndexed2<$a, $b, $c>(folder: ((arg0: int32, arg1: $a, arg2: $b, arg3: $c) => $a), state: $a, array1: $b[], array2: $c[]): $a; -export declare function fold2(folder: ((arg0: State, arg1: T1, arg2: T2) => State), state: State, array1: T1[], array2: T2[]): State; -export declare function foldBackIndexed2(folder: ((arg0: int32, arg1: T1, arg2: T2, arg3: State) => State), array1: T1[], array2: T2[], state: State): State; -export declare function foldBack2(f: ((arg0: T1, arg1: T2, arg2: State) => State), array1: T1[], array2: T2[], state: State): State; -export declare function reduce(reduction: ((arg0: T, arg1: T) => T), array: T[]): T; -export declare function reduceBack(reduction: ((arg0: T, arg1: T) => T), array: T[]): T; -export declare function forAll2<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), array1: $a[], array2: $b[]): boolean; -export declare function existsOffset(predicate_mut: ((arg0: T) => boolean), array_mut: T[], index_mut: int32): boolean; -export declare function exists<$a>(predicate: ((arg0: $a) => boolean), array: $a[]): boolean; -export declare function existsOffset2<$a, $b>(predicate_mut: ((arg0: $a, arg1: $b) => boolean), array1_mut: $a[], array2_mut: $b[], index_mut: int32): boolean; -export declare function exists2<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), array1: $a[], array2: $b[]): boolean; -export declare function sum(array: T[], adder: any): T; -export declare function sumBy(projection: ((arg0: T) => T2), array: T[], adder: any): T2; -export declare function maxBy(projection: ((arg0: a) => b), xs: a[], comparer: IComparer): a; -export declare function max(xs: a[], comparer: IComparer): a; -export declare function minBy(projection: ((arg0: a) => b), xs: a[], comparer: IComparer): a; -export declare function min(xs: a[], comparer: IComparer): a; -export declare function average(array: T[], averager: any): T; -export declare function averageBy(projection: ((arg0: T) => T2), array: T[], averager: any): T2; -export declare function windowed(windowSize: int32, source: T[]): T[][]; -export declare function splitInto(chunks: int32, array: T[]): T[][]; -export declare function transpose(arrays: Iterable, cons?: any): T[][]; -export declare function insertAt(index: int32, y: T, xs: T[], cons?: any): T[]; -export declare function insertManyAt(index: int32, ys: Iterable, xs: T[], cons?: any): T[]; -export declare function removeAt(index: int32, xs: T[]): T[]; -export declare function removeManyAt(index: int32, count: int32, xs: T[]): T[]; -export declare function updateAt(index: int32, y: T, xs: T[], cons?: any): T[]; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.js deleted file mode 100644 index d169215e..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Array.js +++ /dev/null @@ -1,1205 +0,0 @@ -import { Helpers_allocateArrayFromCons } from "./Native.js"; -import { value as value_2, map as map_1, defaultArg, some } from "./Option.js"; -import { min as min_1, max as max_1 } from "./Double.js"; -import { equals as equals_1, disposeSafe, getEnumerator, copyToArray, defaultOf } from "./Util.js"; -import { SR_indexOutOfBounds } from "./Global.js"; -function indexNotFound() { - throw new Error("An index satisfying the predicate was not found in the collection."); -} -function differentLengths() { - throw new Error("Arrays had different lengths"); -} -export function append(array1, array2, cons) { - const len1 = array1.length | 0; - const len2 = array2.length | 0; - const newArray = Helpers_allocateArrayFromCons(cons, len1 + len2); - for (let i = 0; i <= (len1 - 1); i++) { - newArray[i] = array1[i]; - } - for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) { - newArray[i_1 + len1] = array2[i_1]; - } - return newArray; -} -export function filter(predicate, array) { - return array.filter(predicate); -} -export function fill(target, targetIndex, count, value) { - const start = targetIndex | 0; - return target.fill(value, start, (start + count)); -} -export function getSubArray(array, start, count) { - const start_1 = start | 0; - return array.slice(start_1, (start_1 + count)); -} -export function last(array) { - if (array.length === 0) { - throw new Error("The input array was empty\\nParameter name: array"); - } - return array[array.length - 1]; -} -export function tryLast(array) { - if (array.length === 0) { - return void 0; - } - else { - return some(array[array.length - 1]); - } -} -export function mapIndexed(f, source, cons) { - const len = source.length | 0; - const target = Helpers_allocateArrayFromCons(cons, len); - for (let i = 0; i <= (len - 1); i++) { - target[i] = f(i, source[i]); - } - return target; -} -export function map(f, source, cons) { - const len = source.length | 0; - const target = Helpers_allocateArrayFromCons(cons, len); - for (let i = 0; i <= (len - 1); i++) { - target[i] = f(source[i]); - } - return target; -} -export function mapIndexed2(f, source1, source2, cons) { - if (source1.length !== source2.length) { - throw new Error("Arrays had different lengths"); - } - const result = Helpers_allocateArrayFromCons(cons, source1.length); - for (let i = 0; i <= (source1.length - 1); i++) { - result[i] = f(i, source1[i], source2[i]); - } - return result; -} -export function map2(f, source1, source2, cons) { - if (source1.length !== source2.length) { - throw new Error("Arrays had different lengths"); - } - const result = Helpers_allocateArrayFromCons(cons, source1.length); - for (let i = 0; i <= (source1.length - 1); i++) { - result[i] = f(source1[i], source2[i]); - } - return result; -} -export function mapIndexed3(f, source1, source2, source3, cons) { - if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) { - throw new Error("Arrays had different lengths"); - } - const result = Helpers_allocateArrayFromCons(cons, source1.length); - for (let i = 0; i <= (source1.length - 1); i++) { - result[i] = f(i, source1[i], source2[i], source3[i]); - } - return result; -} -export function map3(f, source1, source2, source3, cons) { - if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) { - throw new Error("Arrays had different lengths"); - } - const result = Helpers_allocateArrayFromCons(cons, source1.length); - for (let i = 0; i <= (source1.length - 1); i++) { - result[i] = f(source1[i], source2[i], source3[i]); - } - return result; -} -export function mapFold(mapping, state, array, cons) { - const matchValue = array.length | 0; - if (matchValue === 0) { - return [[], state]; - } - else { - let acc = state; - const res = Helpers_allocateArrayFromCons(cons, matchValue); - for (let i = 0; i <= (array.length - 1); i++) { - const patternInput = mapping(acc, array[i]); - res[i] = patternInput[0]; - acc = patternInput[1]; - } - return [res, acc]; - } -} -export function mapFoldBack(mapping, array, state, cons) { - const matchValue = array.length | 0; - if (matchValue === 0) { - return [[], state]; - } - else { - let acc = state; - const res = Helpers_allocateArrayFromCons(cons, matchValue); - for (let i = array.length - 1; i >= 0; i--) { - const patternInput = mapping(array[i], acc); - res[i] = patternInput[0]; - acc = patternInput[1]; - } - return [res, acc]; - } -} -export function indexed(source) { - const len = source.length | 0; - const target = new Array(len); - for (let i = 0; i <= (len - 1); i++) { - target[i] = [i, source[i]]; - } - return target; -} -export function truncate(count, array) { - const count_1 = max_1(0, count) | 0; - return array.slice(0, (0 + count_1)); -} -export function concat(arrays, cons) { - const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays)); - const matchValue = arrays_1.length | 0; - switch (matchValue) { - case 0: - return Helpers_allocateArrayFromCons(cons, 0); - case 1: - return arrays_1[0]; - default: { - let totalIdx = 0; - let totalLength = 0; - for (let idx = 0; idx <= (arrays_1.length - 1); idx++) { - const arr_1 = arrays_1[idx]; - totalLength = ((totalLength + arr_1.length) | 0); - } - const result = Helpers_allocateArrayFromCons(cons, totalLength); - for (let idx_1 = 0; idx_1 <= (arrays_1.length - 1); idx_1++) { - const arr_2 = arrays_1[idx_1]; - for (let j = 0; j <= (arr_2.length - 1); j++) { - result[totalIdx] = arr_2[j]; - totalIdx = ((totalIdx + 1) | 0); - } - } - return result; - } - } -} -export function collect(mapping, array, cons) { - return concat(map(mapping, array, defaultOf()), cons); -} -export function where(predicate, array) { - return array.filter(predicate); -} -export function indexOf(array, item_1, start, count, eq) { - const start_1 = defaultArg(start, 0) | 0; - const end$0027 = defaultArg(map_1((c) => (start_1 + c), count), array.length) | 0; - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i >= end$0027) { - return -1; - } - else if (eq.Equals(item_1, array[i])) { - return i | 0; - } - else { - i_mut = (i + 1); - continue loop; - } - break; - } - }; - return loop(start_1) | 0; -} -export function contains(value, array, eq) { - return indexOf(array, value, void 0, void 0, eq) >= 0; -} -export function empty(cons) { - return Helpers_allocateArrayFromCons(cons, 0); -} -export function singleton(value, cons) { - const ar = Helpers_allocateArrayFromCons(cons, 1); - ar[0] = value; - return ar; -} -export function initialize(count, initializer, cons) { - if (count < 0) { - throw new Error("The input must be non-negative\\nParameter name: count"); - } - const result = Helpers_allocateArrayFromCons(cons, count); - for (let i = 0; i <= (count - 1); i++) { - result[i] = initializer(i); - } - return result; -} -export function pairwise(array) { - if (array.length < 2) { - return []; - } - else { - const count = (array.length - 1) | 0; - const result = new Array(count); - for (let i = 0; i <= (count - 1); i++) { - result[i] = [array[i], array[i + 1]]; - } - return result; - } -} -export function replicate(count, initial, cons) { - if (count < 0) { - throw new Error("The input must be non-negative\\nParameter name: count"); - } - const result = Helpers_allocateArrayFromCons(cons, count); - for (let i = 0; i <= (result.length - 1); i++) { - result[i] = initial; - } - return result; -} -export function copy(array) { - return array.slice(); -} -export function copyTo(source, sourceIndex, target, targetIndex, count) { - copyToArray(source, sourceIndex, target, targetIndex, count); -} -export function reverse(array) { - const array_2 = array.slice(); - return array_2.reverse(); -} -export function scan(folder, state, array, cons) { - const res = Helpers_allocateArrayFromCons(cons, array.length + 1); - res[0] = state; - for (let i = 0; i <= (array.length - 1); i++) { - res[i + 1] = folder(res[i], array[i]); - } - return res; -} -export function scanBack(folder, array, state, cons) { - const res = Helpers_allocateArrayFromCons(cons, array.length + 1); - res[array.length] = state; - for (let i = array.length - 1; i >= 0; i--) { - res[i] = folder(array[i], res[i + 1]); - } - return res; -} -export function skip(count, array, cons) { - if (count > array.length) { - throw new Error("count is greater than array length\\nParameter name: count"); - } - if (count === array.length) { - return Helpers_allocateArrayFromCons(cons, 0); - } - else { - const count_1 = ((count < 0) ? 0 : count) | 0; - return array.slice(count_1); - } -} -export function skipWhile(predicate, array, cons) { - let count = 0; - while ((count < array.length) && predicate(array[count])) { - count = ((count + 1) | 0); - } - if (count === array.length) { - return Helpers_allocateArrayFromCons(cons, 0); - } - else { - const count_1 = count | 0; - return array.slice(count_1); - } -} -export function take(count, array, cons) { - if (count < 0) { - throw new Error("The input must be non-negative\\nParameter name: count"); - } - if (count > array.length) { - throw new Error("count is greater than array length\\nParameter name: count"); - } - if (count === 0) { - return Helpers_allocateArrayFromCons(cons, 0); - } - else { - return array.slice(0, (0 + count)); - } -} -export function takeWhile(predicate, array, cons) { - let count = 0; - while ((count < array.length) && predicate(array[count])) { - count = ((count + 1) | 0); - } - if (count === 0) { - return Helpers_allocateArrayFromCons(cons, 0); - } - else { - const count_1 = count | 0; - return array.slice(0, (0 + count_1)); - } -} -export function addInPlace(x, array) { - array.push(x); -} -export function addRangeInPlace(range, array) { - const enumerator = getEnumerator(range); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - addInPlace(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](), array); - } - } - finally { - disposeSafe(enumerator); - } -} -export function insertRangeInPlace(index, range, array) { - let index_1; - let i = index; - const enumerator = getEnumerator(range); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const x = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - (index_1 = (i | 0), array.splice(index_1, 0, x)); - i = ((i + 1) | 0); - } - } - finally { - disposeSafe(enumerator); - } -} -export function removeInPlace(item_1, array, eq) { - const i = indexOf(array, item_1, void 0, void 0, eq) | 0; - if (i > -1) { - array.splice(i, 1); - return true; - } - else { - return false; - } -} -export function removeAllInPlace(predicate, array) { - const countRemoveAll = (count) => { - const i = (array.findIndex(predicate)) | 0; - if (i > -1) { - array.splice(i, 1); - return (countRemoveAll(count) + 1) | 0; - } - else { - return count | 0; - } - }; - return countRemoveAll(0) | 0; -} -export function partition(f, source, cons) { - const len = source.length | 0; - const res1 = Helpers_allocateArrayFromCons(cons, len); - const res2 = Helpers_allocateArrayFromCons(cons, len); - let iTrue = 0; - let iFalse = 0; - for (let i = 0; i <= (len - 1); i++) { - if (f(source[i])) { - res1[iTrue] = source[i]; - iTrue = ((iTrue + 1) | 0); - } - else { - res2[iFalse] = source[i]; - iFalse = ((iFalse + 1) | 0); - } - } - return [truncate(iTrue, res1), truncate(iFalse, res2)]; -} -export function find(predicate, array) { - const matchValue = array.find(predicate); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_2(matchValue); - } -} -export function tryFind(predicate, array) { - return array.find(predicate); -} -export function findIndex(predicate, array) { - const matchValue = (array.findIndex(predicate)) | 0; - if (matchValue > -1) { - return matchValue | 0; - } - else { - indexNotFound(); - return -1; - } -} -export function tryFindIndex(predicate, array) { - const matchValue = (array.findIndex(predicate)) | 0; - if (matchValue > -1) { - return matchValue; - } - else { - return void 0; - } -} -export function pick(chooser, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i >= array.length) { - return indexNotFound(); - } - else { - const matchValue = chooser(array[i]); - if (matchValue != null) { - return value_2(matchValue); - } - else { - i_mut = (i + 1); - continue loop; - } - } - break; - } - }; - return loop(0); -} -export function tryPick(chooser, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i >= array.length) { - return void 0; - } - else { - const matchValue = chooser(array[i]); - if (matchValue == null) { - i_mut = (i + 1); - continue loop; - } - else { - return matchValue; - } - } - break; - } - }; - return loop(0); -} -export function findBack(predicate, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i < 0) { - return indexNotFound(); - } - else if (predicate(array[i])) { - return array[i]; - } - else { - i_mut = (i - 1); - continue loop; - } - break; - } - }; - return loop(array.length - 1); -} -export function tryFindBack(predicate, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i < 0) { - return void 0; - } - else if (predicate(array[i])) { - return some(array[i]); - } - else { - i_mut = (i - 1); - continue loop; - } - break; - } - }; - return loop(array.length - 1); -} -export function findLastIndex(predicate, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i < 0) { - return -1; - } - else if (predicate(array[i])) { - return i | 0; - } - else { - i_mut = (i - 1); - continue loop; - } - break; - } - }; - return loop(array.length - 1) | 0; -} -export function findIndexBack(predicate, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i < 0) { - indexNotFound(); - return -1; - } - else if (predicate(array[i])) { - return i | 0; - } - else { - i_mut = (i - 1); - continue loop; - } - break; - } - }; - return loop(array.length - 1) | 0; -} -export function tryFindIndexBack(predicate, array) { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (i < 0) { - return void 0; - } - else if (predicate(array[i])) { - return i; - } - else { - i_mut = (i - 1); - continue loop; - } - break; - } - }; - return loop(array.length - 1); -} -export function choose(chooser, array, cons) { - const res = []; - for (let i = 0; i <= (array.length - 1); i++) { - const matchValue = chooser(array[i]); - if (matchValue != null) { - const y = value_2(matchValue); - res.push(y); - } - } - if (equals_1(cons, defaultOf())) { - return res; - } - else { - return map((x) => x, res, cons); - } -} -export function foldIndexed(folder, state, array) { - return array.reduce(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg, delegateArg_1)), state); -} -export function fold(folder, state, array) { - const folder_1 = folder; - return array.reduce((folder_1), state); -} -export function iterate(action, array) { - for (let i = 0; i <= (array.length - 1); i++) { - action(array[i]); - } -} -export function iterateIndexed(action, array) { - for (let i = 0; i <= (array.length - 1); i++) { - action(i, array[i]); - } -} -export function iterate2(action, array1, array2) { - if (array1.length !== array2.length) { - differentLengths(); - } - for (let i = 0; i <= (array1.length - 1); i++) { - action(array1[i], array2[i]); - } -} -export function iterateIndexed2(action, array1, array2) { - if (array1.length !== array2.length) { - differentLengths(); - } - for (let i = 0; i <= (array1.length - 1); i++) { - action(i, array1[i], array2[i]); - } -} -export function isEmpty(array) { - return array.length === 0; -} -export function forAll(predicate, array) { - return array.every(predicate); -} -export function permute(f, array) { - const size = array.length | 0; - const res = array.slice(); - const checkFlags = new Array(size); - iterateIndexed((i, x) => { - const j = f(i) | 0; - if ((j < 0) ? true : (j >= size)) { - throw new Error("Not a valid permutation"); - } - res[j] = x; - checkFlags[j] = 1; - }, array); - if (!(checkFlags.every((y) => (1 === y)))) { - throw new Error("Not a valid permutation"); - } - return res; -} -export function setSlice(target, lower, upper, source) { - const lower_1 = defaultArg(lower, 0) | 0; - const upper_1 = defaultArg(upper, -1) | 0; - const length = (((upper_1 >= 0) ? upper_1 : (target.length - 1)) - lower_1) | 0; - for (let i = 0; i <= length; i++) { - target[i + lower_1] = source[i]; - } -} -export function sortInPlaceBy(projection, xs, comparer) { - xs.sort((x, y) => comparer.Compare(projection(x), projection(y))); -} -export function sortInPlace(xs, comparer) { - xs.sort((x, y) => comparer.Compare(x, y)); -} -export function sort(xs, comparer) { - const xs_1 = xs.slice(); - xs_1.sort((x, y) => comparer.Compare(x, y)); - return xs_1; -} -export function sortBy(projection, xs, comparer) { - const xs_1 = xs.slice(); - xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y))); - return xs_1; -} -export function sortDescending(xs, comparer) { - const xs_1 = xs.slice(); - xs_1.sort((x, y) => (comparer.Compare(x, y) * -1)); - return xs_1; -} -export function sortByDescending(projection, xs, comparer) { - const xs_1 = xs.slice(); - xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1)); - return xs_1; -} -export function sortWith(comparer, xs) { - const comparer_1 = comparer; - const xs_1 = xs.slice(); - xs_1.sort(comparer_1); - return xs_1; -} -export function allPairs(xs, ys) { - const len1 = xs.length | 0; - const len2 = ys.length | 0; - const res = new Array(len1 * len2); - for (let i = 0; i <= (xs.length - 1); i++) { - for (let j = 0; j <= (ys.length - 1); j++) { - res[(i * len2) + j] = [xs[i], ys[j]]; - } - } - return res; -} -export function unfold(generator, state) { - const res = []; - const loop = (state_1_mut) => { - loop: while (true) { - const state_1 = state_1_mut; - const matchValue = generator(state_1); - if (matchValue != null) { - const x = value_2(matchValue)[0]; - const s = value_2(matchValue)[1]; - res.push(x); - state_1_mut = s; - continue loop; - } - break; - } - }; - loop(state); - return res; -} -export function unzip(array) { - const len = array.length | 0; - const res1 = new Array(len); - const res2 = new Array(len); - iterateIndexed((i, tupledArg) => { - res1[i] = tupledArg[0]; - res2[i] = tupledArg[1]; - }, array); - return [res1, res2]; -} -export function unzip3(array) { - const len = array.length | 0; - const res1 = new Array(len); - const res2 = new Array(len); - const res3 = new Array(len); - iterateIndexed((i, tupledArg) => { - res1[i] = tupledArg[0]; - res2[i] = tupledArg[1]; - res3[i] = tupledArg[2]; - }, array); - return [res1, res2, res3]; -} -export function zip(array1, array2) { - if (array1.length !== array2.length) { - differentLengths(); - } - const result = new Array(array1.length); - for (let i = 0; i <= (array1.length - 1); i++) { - result[i] = [array1[i], array2[i]]; - } - return result; -} -export function zip3(array1, array2, array3) { - if ((array1.length !== array2.length) ? true : (array2.length !== array3.length)) { - differentLengths(); - } - const result = new Array(array1.length); - for (let i = 0; i <= (array1.length - 1); i++) { - result[i] = [array1[i], array2[i], array3[i]]; - } - return result; -} -export function chunkBySize(chunkSize, array) { - if (chunkSize < 1) { - throw new Error("The input must be positive.\\nParameter name: size"); - } - if (array.length === 0) { - return [[]]; - } - else { - const result = []; - for (let x = 0; x <= (~~Math.ceil(array.length / chunkSize) - 1); x++) { - let slice; - const start_1 = (x * chunkSize) | 0; - slice = (array.slice(start_1, (start_1 + chunkSize))); - result.push(slice); - } - return result; - } -} -export function splitAt(index, array) { - if ((index < 0) ? true : (index > array.length)) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return [array.slice(0, (0 + index)), array.slice(index)]; -} -export function compareWith(comparer, source1, source2) { - if (source1 == null) { - if (source2 == null) { - return 0; - } - else { - return -1; - } - } - else if (source2 == null) { - return 1; - } - else { - const len1 = source1.length | 0; - const len2 = source2.length | 0; - const len = ((len1 < len2) ? len1 : len2) | 0; - let i = 0; - let res = 0; - while ((res === 0) && (i < len)) { - res = (comparer(source1[i], source2[i]) | 0); - i = ((i + 1) | 0); - } - if (res !== 0) { - return res | 0; - } - else if (len1 > len2) { - return 1; - } - else if (len1 < len2) { - return -1; - } - else { - return 0; - } - } -} -export function compareTo(comparer, source1, source2) { - if (source1 == null) { - if (source2 == null) { - return 0; - } - else { - return -1; - } - } - else if (source2 == null) { - return 1; - } - else { - const len1 = source1.length | 0; - const len2 = source2.length | 0; - if (len1 > len2) { - return 1; - } - else if (len1 < len2) { - return -1; - } - else { - let i = 0; - let res = 0; - while ((res === 0) && (i < len1)) { - res = (comparer(source1[i], source2[i]) | 0); - i = ((i + 1) | 0); - } - return res | 0; - } - } -} -export function equalsWith(equals, array1, array2) { - if (array1 == null) { - if (array2 == null) { - return true; - } - else { - return false; - } - } - else if (array2 == null) { - return false; - } - else { - let i = 0; - let result = true; - const length1 = array1.length | 0; - const length2 = array2.length | 0; - if (length1 > length2) { - return false; - } - else if (length1 < length2) { - return false; - } - else { - while ((i < length1) && result) { - result = equals(array1[i], array2[i]); - i = ((i + 1) | 0); - } - return result; - } - } -} -export function exactlyOne(array) { - switch (array.length) { - case 1: - return array[0]; - case 0: - throw new Error("The input sequence was empty\\nParameter name: array"); - default: - throw new Error("Input array too long\\nParameter name: array"); - } -} -export function tryExactlyOne(array) { - if (array.length === 1) { - return some(array[0]); - } - else { - return void 0; - } -} -export function head(array) { - if (array.length === 0) { - throw new Error("The input array was empty\\nParameter name: array"); - } - else { - return array[0]; - } -} -export function tryHead(array) { - if (array.length === 0) { - return void 0; - } - else { - return some(array[0]); - } -} -export function tail(array) { - if (array.length === 0) { - throw new Error("Not enough elements\\nParameter name: array"); - } - return array.slice(1); -} -export function item(index, array) { - return array[index]; -} -export function tryItem(index, array) { - if ((index < 0) ? true : (index >= array.length)) { - return void 0; - } - else { - return some(array[index]); - } -} -export function foldBackIndexed(folder, array, state) { - return array.reduceRight(((delegateArg, delegateArg_1, delegateArg_2) => folder(delegateArg_2, delegateArg_1, delegateArg)), state); -} -export function foldBack(folder, array, state) { - return array.reduceRight(((delegateArg, delegateArg_1) => folder(delegateArg_1, delegateArg)), state); -} -export function foldIndexed2(folder, state, array1, array2) { - let acc = state; - if (array1.length !== array2.length) { - throw new Error("Arrays have different lengths"); - } - for (let i = 0; i <= (array1.length - 1); i++) { - acc = folder(i, acc, array1[i], array2[i]); - } - return acc; -} -export function fold2(folder, state, array1, array2) { - return foldIndexed2((_arg, acc, x, y) => folder(acc, x, y), state, array1, array2); -} -export function foldBackIndexed2(folder, array1, array2, state) { - let acc = state; - if (array1.length !== array2.length) { - differentLengths(); - } - const size = array1.length | 0; - for (let i = 1; i <= size; i++) { - acc = folder(i - 1, array1[size - i], array2[size - i], acc); - } - return acc; -} -export function foldBack2(f, array1, array2, state) { - return foldBackIndexed2((_arg, x, y, acc) => f(x, y, acc), array1, array2, state); -} -export function reduce(reduction, array) { - if (array.length === 0) { - throw new Error("The input array was empty"); - } - const reduction_1 = reduction; - return array.reduce(reduction_1); -} -export function reduceBack(reduction, array) { - if (array.length === 0) { - throw new Error("The input array was empty"); - } - const reduction_1 = reduction; - return array.reduceRight(reduction_1); -} -export function forAll2(predicate, array1, array2) { - return fold2((acc, x, y) => (acc && predicate(x, y)), true, array1, array2); -} -export function existsOffset(predicate_mut, array_mut, index_mut) { - existsOffset: while (true) { - const predicate = predicate_mut, array = array_mut, index = index_mut; - if (index === array.length) { - return false; - } - else if (predicate(array[index])) { - return true; - } - else { - predicate_mut = predicate; - array_mut = array; - index_mut = (index + 1); - continue existsOffset; - } - break; - } -} -export function exists(predicate, array) { - return existsOffset(predicate, array, 0); -} -export function existsOffset2(predicate_mut, array1_mut, array2_mut, index_mut) { - existsOffset2: while (true) { - const predicate = predicate_mut, array1 = array1_mut, array2 = array2_mut, index = index_mut; - if (index === array1.length) { - return false; - } - else if (predicate(array1[index], array2[index])) { - return true; - } - else { - predicate_mut = predicate; - array1_mut = array1; - array2_mut = array2; - index_mut = (index + 1); - continue existsOffset2; - } - break; - } -} -export function exists2(predicate, array1, array2) { - if (array1.length !== array2.length) { - differentLengths(); - } - return existsOffset2(predicate, array1, array2, 0); -} -export function sum(array, adder) { - let acc = adder.GetZero(); - for (let i = 0; i <= (array.length - 1); i++) { - acc = adder.Add(acc, array[i]); - } - return acc; -} -export function sumBy(projection, array, adder) { - let acc = adder.GetZero(); - for (let i = 0; i <= (array.length - 1); i++) { - acc = adder.Add(acc, projection(array[i])); - } - return acc; -} -export function maxBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs); -} -export function max(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs); -} -export function minBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs); -} -export function min(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs); -} -export function average(array, averager) { - if (array.length === 0) { - throw new Error("The input array was empty\\nParameter name: array"); - } - let total = averager.GetZero(); - for (let i = 0; i <= (array.length - 1); i++) { - total = averager.Add(total, array[i]); - } - return averager.DivideByInt(total, array.length); -} -export function averageBy(projection, array, averager) { - if (array.length === 0) { - throw new Error("The input array was empty\\nParameter name: array"); - } - let total = averager.GetZero(); - for (let i = 0; i <= (array.length - 1); i++) { - total = averager.Add(total, projection(array[i])); - } - return averager.DivideByInt(total, array.length); -} -export function windowed(windowSize, source) { - if (windowSize <= 0) { - throw new Error("windowSize must be positive"); - } - let res; - const len = max_1(0, (source.length - windowSize) + 1) | 0; - res = (new Array(len)); - for (let i = windowSize; i <= source.length; i++) { - res[i - windowSize] = source.slice(i - windowSize, (i - 1) + 1); - } - return res; -} -export function splitInto(chunks, array) { - if (chunks < 1) { - throw new Error("The input must be positive.\\nParameter name: chunks"); - } - if (array.length === 0) { - return [[]]; - } - else { - const result = []; - const chunks_1 = min_1(chunks, array.length) | 0; - const minChunkSize = ~~(array.length / chunks_1) | 0; - const chunksWithExtraItem = (array.length % chunks_1) | 0; - for (let i = 0; i <= (chunks_1 - 1); i++) { - const chunkSize = ((i < chunksWithExtraItem) ? (minChunkSize + 1) : minChunkSize) | 0; - let slice; - const start_1 = ((i * minChunkSize) + min_1(chunksWithExtraItem, i)) | 0; - slice = (array.slice(start_1, (start_1 + chunkSize))); - result.push(slice); - } - return result; - } -} -export function transpose(arrays, cons) { - const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays)); - const len = arrays_1.length | 0; - if (len === 0) { - return new Array(0); - } - else { - const firstArray = arrays_1[0]; - const lenInner = firstArray.length | 0; - if (!forAll((a) => (a.length === lenInner), arrays_1)) { - differentLengths(); - } - const result = new Array(lenInner); - for (let i = 0; i <= (lenInner - 1); i++) { - result[i] = Helpers_allocateArrayFromCons(cons, len); - for (let j = 0; j <= (len - 1); j++) { - result[i][j] = arrays_1[j][i]; - } - } - return result; - } -} -export function insertAt(index, y, xs, cons) { - const len = xs.length | 0; - if ((index < 0) ? true : (index > len)) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - const target = Helpers_allocateArrayFromCons(cons, len + 1); - for (let i = 0; i <= (index - 1); i++) { - target[i] = xs[i]; - } - target[index] = y; - for (let i_1 = index; i_1 <= (len - 1); i_1++) { - target[i_1 + 1] = xs[i_1]; - } - return target; -} -export function insertManyAt(index, ys, xs, cons) { - const len = xs.length | 0; - if ((index < 0) ? true : (index > len)) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - const ys_1 = Array.from(ys); - const len2 = ys_1.length | 0; - const target = Helpers_allocateArrayFromCons(cons, len + len2); - for (let i = 0; i <= (index - 1); i++) { - target[i] = xs[i]; - } - for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) { - target[index + i_1] = ys_1[i_1]; - } - for (let i_2 = index; i_2 <= (len - 1); i_2++) { - target[i_2 + len2] = xs[i_2]; - } - return target; -} -export function removeAt(index, xs) { - if ((index < 0) ? true : (index >= xs.length)) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - let i = -1; - return filter((_arg) => { - i = ((i + 1) | 0); - return i !== index; - }, xs); -} -export function removeManyAt(index, count, xs) { - let i = -1; - let status = -1; - const ys = filter((_arg) => { - i = ((i + 1) | 0); - if (i === index) { - status = 0; - return false; - } - else if (i > index) { - if (i < (index + count)) { - return false; - } - else { - status = 1; - return true; - } - } - else { - return true; - } - }, xs); - const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0; - if (status_1 < 1) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + ((status_1 < 0) ? "index" : "count")); - } - return ys; -} -export function updateAt(index, y, xs, cons) { - const len = xs.length | 0; - if ((index < 0) ? true : (index >= len)) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - const target = Helpers_allocateArrayFromCons(cons, len); - for (let i = 0; i <= (len - 1); i++) { - target[i] = ((i === index) ? y : xs[i]); - } - return target; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.d.ts deleted file mode 100644 index e6009c44..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Continuation, Continuations } from "./AsyncBuilder.js"; -import { CancellationToken } from "./AsyncBuilder.js"; -import { IAsync } from "./AsyncBuilder.js"; -import { IAsyncContext } from "./AsyncBuilder.js"; -import { FSharpChoice$2_$union } from "./Choice.js"; -export declare class Async<_T> { -} -export declare function makeAsync(body: IAsync): IAsync; -export declare function invoke(computation: IAsync, ctx: IAsyncContext): void; -export declare function callThenInvoke(ctx: IAsyncContext, result1: U, part2: (x: U) => IAsync): void; -export declare function bind(ctx: IAsyncContext, part1: IAsync, part2: (x: U) => IAsync): void; -export declare function createCancellationToken(arg?: boolean | number): CancellationToken; -export declare function cancel(token: CancellationToken): void; -export declare function cancelAfter(token: CancellationToken, ms: number): void; -export declare function isCancellationRequested(token: CancellationToken): boolean; -export declare function throwIfCancellationRequested(token: CancellationToken): void; -export declare function startChild(computation: IAsync, ms?: number): IAsync>; -export declare function awaitPromise(p: Promise): (ctx: IAsyncContext) => void; -export declare function cancellationToken(): (ctx: IAsyncContext) => void; -export declare const defaultCancellationToken: CancellationToken; -export declare function catchAsync(work: IAsync): (ctx: IAsyncContext>) => void; -export declare function fromContinuations(f: (conts: Continuations) => void): (ctx: IAsyncContext) => void; -export declare function ignore(computation: IAsync): (ctx: IAsyncContext) => void; -export declare function parallel(computations: Iterable>): (ctx: IAsyncContext[]>) => void; -export declare function sequential(computations: Iterable>): (ctx: IAsyncContext) => void; -export declare function sleep(millisecondsDueTime: number): (ctx: IAsyncContext) => void; -export declare function runSynchronously(): never; -export declare function start(computation: IAsync, cancellationToken?: CancellationToken): void; -export declare function startImmediate(computation: IAsync, cancellationToken?: CancellationToken): void; -export declare function startWithContinuations(computation: IAsync, continuation?: Continuation | CancellationToken, exceptionContinuation?: Continuation, cancellationContinuation?: Continuation, cancelToken?: CancellationToken): void; -export declare function startAsPromise(computation: IAsync, cancellationToken?: CancellationToken): Promise; -export default Async; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.js deleted file mode 100644 index 10fe9e0c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Async.js +++ /dev/null @@ -1,158 +0,0 @@ -import { OperationCanceledError, Trampoline } from "./AsyncBuilder.js"; -import { CancellationToken } from "./AsyncBuilder.js"; -import { protectedCont } from "./AsyncBuilder.js"; -import { protectedBind } from "./AsyncBuilder.js"; -import { protectedReturn } from "./AsyncBuilder.js"; -import { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from "./Choice.js"; -import { TimeoutException } from "./SystemException.js"; -// Implemented just for type references -export class Async { -} -function emptyContinuation(_x) { - // NOP -} -// see AsyncBuilder.Delay -function delay(generator) { - return protectedCont((ctx) => generator()(ctx)); -} -// MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T> -export function makeAsync(body) { - return body; -} -// Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn -export function invoke(computation, ctx) { - return computation(ctx); -} -// CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn -export function callThenInvoke(ctx, result1, part2) { - return part2(result1)(ctx); -} -// Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn -export function bind(ctx, part1, part2) { - return protectedBind(part1, part2)(ctx); -} -export function createCancellationToken(arg) { - const token = new CancellationToken(typeof arg === "boolean" ? arg : false); - if (typeof arg === "number") { - setTimeout(() => { token.cancel(); }, arg); - } - return token; -} -export function cancel(token) { - token.cancel(); -} -export function cancelAfter(token, ms) { - setTimeout(() => { token.cancel(); }, ms); -} -export function isCancellationRequested(token) { - return token != null && token.isCancelled; -} -export function throwIfCancellationRequested(token) { - if (token != null && token.isCancelled) { - throw new Error("Operation is cancelled"); - } -} -function throwAfter(millisecondsDueTime) { - return protectedCont((ctx) => { - let tokenId; - const timeoutId = setTimeout(() => { - ctx.cancelToken.removeListener(tokenId); - ctx.onError(new TimeoutException()); - }, millisecondsDueTime); - tokenId = ctx.cancelToken.addListener(() => { - clearTimeout(timeoutId); - ctx.onCancel(new OperationCanceledError()); - }); - }); -} -export function startChild(computation, ms) { - if (ms) { - const computationWithTimeout = protectedBind(parallel2(computation, throwAfter(ms)), xs => protectedReturn(xs[0])); - return startChild(computationWithTimeout); - } - const promise = startAsPromise(computation); - // JS Promises are hot, computation has already started - // but we delay returning the result - return protectedCont((ctx) => protectedReturn(awaitPromise(promise))(ctx)); -} -export function awaitPromise(p) { - return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledError - ? conts[2] : conts[1])(err))); -} -export function cancellationToken() { - return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken)); -} -export const defaultCancellationToken = new CancellationToken(); -export function catchAsync(work) { - return protectedCont((ctx) => { - work({ - onSuccess: (x) => ctx.onSuccess(Choice_makeChoice1Of2(x)), - onError: (ex) => ctx.onSuccess(Choice_makeChoice2Of2(ex)), - onCancel: ctx.onCancel, - cancelToken: ctx.cancelToken, - trampoline: ctx.trampoline, - }); - }); -} -export function fromContinuations(f) { - return protectedCont((ctx) => f([ctx.onSuccess, ctx.onError, ctx.onCancel])); -} -export function ignore(computation) { - return protectedBind(computation, (_x) => protectedReturn(void 0)); -} -export function parallel(computations) { - return delay(() => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w))))); -} -function parallel2(a, b) { - return delay(() => awaitPromise(Promise.all([startAsPromise(a), startAsPromise(b)]))); -} -export function sequential(computations) { - function _sequential(computations) { - let pr = Promise.resolve([]); - for (const c of computations) { - pr = pr.then(results => startAsPromise(c).then(r => results.concat([r]))); - } - return pr; - } - return delay(() => awaitPromise(_sequential(computations))); -} -export function sleep(millisecondsDueTime) { - return protectedCont((ctx) => { - let tokenId; - const timeoutId = setTimeout(() => { - ctx.cancelToken.removeListener(tokenId); - ctx.onSuccess(void 0); - }, millisecondsDueTime); - tokenId = ctx.cancelToken.addListener(() => { - clearTimeout(timeoutId); - ctx.onCancel(new OperationCanceledError()); - }); - }); -} -export function runSynchronously() { - throw new Error("Asynchronous code cannot be run synchronously in JS"); -} -export function start(computation, cancellationToken) { - return startWithContinuations(computation, cancellationToken); -} -export function startImmediate(computation, cancellationToken) { - return start(computation, cancellationToken); -} -export function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) { - if (typeof continuation !== "function") { - cancelToken = continuation; - continuation = undefined; - } - const trampoline = new Trampoline(); - computation({ - onSuccess: continuation ? continuation : emptyContinuation, - onError: exceptionContinuation ? exceptionContinuation : emptyContinuation, - onCancel: cancellationContinuation ? cancellationContinuation : emptyContinuation, - cancelToken: cancelToken ? cancelToken : defaultCancellationToken, - trampoline, - }); -} -export function startAsPromise(computation, cancellationToken) { - return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken)); -} -export default Async; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.d.ts deleted file mode 100644 index bc2c4d71..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { IDisposable } from "./Util.js"; -export interface AsyncReplyChannel { - reply(value: Reply): void; -} -export type Continuation = (x: T) => void; -export type Continuations = [ - Continuation, - Continuation, - Continuation -]; -export declare class CancellationToken implements IDisposable { - private _id; - private _cancelled; - private _listeners; - constructor(cancelled?: boolean); - get isCancelled(): boolean; - cancel(): void; - addListener(f: () => void): number; - removeListener(id: number): boolean; - register(f: (state?: any) => void, state?: any): { - Dispose(): void; - }; - Dispose(): void; -} -export declare class OperationCanceledError extends Error { - constructor(); -} -export declare class Trampoline { - static get maxTrampolineCallCount(): number; - private callCount; - constructor(); - incrementAndCheck(): boolean; - hijack(f: () => void): void; -} -export interface IAsyncContext { - onSuccess: Continuation; - onError: Continuation; - onCancel: Continuation; - cancelToken: CancellationToken; - trampoline: Trampoline; -} -export type IAsync = (x: IAsyncContext) => void; -export declare function protectedCont(f: IAsync): (ctx: IAsyncContext) => void; -export declare function protectedBind(computation: IAsync, binder: (x: T) => IAsync): (ctx: IAsyncContext) => void; -export declare function protectedReturn(value: T): (ctx: IAsyncContext) => void; -export declare class AsyncBuilder { - Bind(computation: IAsync, binder: (x: T) => IAsync): (ctx: IAsyncContext) => void; - Combine(computation1: IAsync, computation2: IAsync): (ctx: IAsyncContext) => void; - Delay(generator: () => IAsync): (ctx: IAsyncContext) => void; - For(sequence: Iterable, body: (x: T) => IAsync): IAsync; - Return(value?: T): (ctx: IAsyncContext) => void; - ReturnFrom(computation: IAsync): IAsync; - TryFinally(computation: IAsync, compensation: () => void): (ctx: IAsyncContext) => void; - TryWith(computation: IAsync, catchHandler: (e: any) => IAsync): (ctx: IAsyncContext) => void; - Using(resource: T, binder: (x: T) => IAsync): (ctx: IAsyncContext) => void; - While(guard: () => boolean, computation: IAsync): IAsync; - Zero(): (ctx: IAsyncContext) => void; -} -export declare const singleton: AsyncBuilder; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.js deleted file mode 100644 index 51a94539..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/AsyncBuilder.js +++ /dev/null @@ -1,183 +0,0 @@ -import { ensureErrorOrException } from './Types.js'; -export class CancellationToken { - constructor(cancelled = false) { - this._id = 0; - this._cancelled = cancelled; - this._listeners = new Map(); - } - get isCancelled() { - return this._cancelled; - } - cancel() { - if (!this._cancelled) { - this._cancelled = true; - for (const [, listener] of this._listeners) { - listener(); - } - } - } - addListener(f) { - const id = this._id; - this._listeners.set(this._id++, f); - return id; - } - removeListener(id) { - return this._listeners.delete(id); - } - register(f, state) { - const $ = this; - const id = this.addListener(state == null ? f : () => f(state)); - return { Dispose() { $.removeListener(id); } }; - } - Dispose() { - // Implement IDisposable for compatibility but do nothing - // According to docs, calling Dispose does not trigger cancellation - // https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtokensource.dispose?view=net-6.0 - } -} -export class OperationCanceledError extends Error { - constructor() { - super("The operation was canceled"); - Object.setPrototypeOf(this, OperationCanceledError.prototype); - } -} -export class Trampoline { - static get maxTrampolineCallCount() { - return 2000; - } - constructor() { - this.callCount = 0; - } - incrementAndCheck() { - return this.callCount++ > Trampoline.maxTrampolineCallCount; - } - hijack(f) { - this.callCount = 0; - setTimeout(f, 0); - } -} -export function protectedCont(f) { - return (ctx) => { - if (ctx.cancelToken.isCancelled) { - ctx.onCancel(new OperationCanceledError()); - } - else if (ctx.trampoline.incrementAndCheck()) { - ctx.trampoline.hijack(() => { - try { - f(ctx); - } - catch (err) { - ctx.onError(ensureErrorOrException(err)); - } - }); - } - else { - try { - f(ctx); - } - catch (err) { - ctx.onError(ensureErrorOrException(err)); - } - } - }; -} -export function protectedBind(computation, binder) { - return protectedCont((ctx) => { - computation({ - onSuccess: (x) => { - try { - binder(x)(ctx); - } - catch (err) { - ctx.onError(ensureErrorOrException(err)); - } - }, - onError: ctx.onError, - onCancel: ctx.onCancel, - cancelToken: ctx.cancelToken, - trampoline: ctx.trampoline, - }); - }); -} -export function protectedReturn(value) { - return protectedCont((ctx) => ctx.onSuccess(value)); -} -export class AsyncBuilder { - Bind(computation, binder) { - return protectedBind(computation, binder); - } - Combine(computation1, computation2) { - return this.Bind(computation1, () => computation2); - } - Delay(generator) { - return protectedCont((ctx) => generator()(ctx)); - } - For(sequence, body) { - const iter = sequence[Symbol.iterator](); - let cur = iter.next(); - return this.While(() => !cur.done, this.Delay(() => { - const res = body(cur.value); - cur = iter.next(); - return res; - })); - } - Return(value) { - return protectedReturn(value); - } - ReturnFrom(computation) { - return computation; - } - TryFinally(computation, compensation) { - return protectedCont((ctx) => { - computation({ - onSuccess: (x) => { - compensation(); - ctx.onSuccess(x); - }, - onError: (x) => { - compensation(); - ctx.onError(x); - }, - onCancel: (x) => { - compensation(); - ctx.onCancel(x); - }, - cancelToken: ctx.cancelToken, - trampoline: ctx.trampoline, - }); - }); - } - TryWith(computation, catchHandler) { - return protectedCont((ctx) => { - computation({ - onSuccess: ctx.onSuccess, - onCancel: ctx.onCancel, - cancelToken: ctx.cancelToken, - trampoline: ctx.trampoline, - onError: (ex) => { - try { - catchHandler(ex)(ctx); - } - catch (err) { - ctx.onError(ensureErrorOrException(err)); - } - }, - }); - }); - } - Using(resource, binder) { - return this.TryFinally(binder(resource), () => resource.Dispose()); - } - While(guard, computation) { - if (guard()) { - return this.Bind(computation, () => this.While(guard, computation)); - } - else { - return this.Return(void 0); - } - } - Zero() { - return protectedCont((ctx) => ctx.onSuccess(void 0)); - } -} -export const singleton = new AsyncBuilder(); diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.d.ts deleted file mode 100644 index baad1be5..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { FSharpRef } from "./Types.js"; -import { int8, uint8, int16, uint16, int32, uint32, float16, float32, float64 } from "./Int32.js"; -import { decimal } from "./Decimal.js"; -export type int64 = bigint; -export type uint64 = bigint; -export type int128 = bigint; -export type uint128 = bigint; -export type nativeint = bigint; -export type unativeint = bigint; -export declare function isBigInt(x: any): boolean; -export declare function hash(x: bigint): int32; -export declare function equals(x: bigint, y: bigint): boolean; -export declare function compare(x: bigint, y: bigint): int32; -export declare function abs(x: bigint): bigint; -export declare function sign(x: bigint): int32; -export declare function max(x: bigint, y: bigint): bigint; -export declare function min(x: bigint, y: bigint): bigint; -export declare function maxMagnitude(x: bigint, y: bigint): bigint; -export declare function minMagnitude(x: bigint, y: bigint): bigint; -export declare function clamp(x: bigint, min: bigint, max: bigint): bigint; -export declare function add(x: bigint, y: bigint): bigint; -export declare function subtract(x: bigint, y: bigint): bigint; -export declare function multiply(x: bigint, y: bigint): bigint; -export declare function divide(x: bigint, y: bigint): bigint; -export declare function remainder(x: bigint, y: bigint): bigint; -export declare function negate(x: bigint): bigint; -export declare function op_UnaryNegation(x: bigint): bigint; -export declare function op_LogicalNot(x: bigint): bigint; -export declare function op_UnaryPlus(x: bigint): bigint; -export declare function op_Addition(x: bigint, y: bigint): bigint; -export declare function op_Subtraction(x: bigint, y: bigint): bigint; -export declare function op_Multiply(x: bigint, y: bigint): bigint; -export declare function op_Division(x: bigint, y: bigint): bigint; -export declare function op_Modulus(x: bigint, y: bigint): bigint; -export declare function op_RightShift(x: bigint, n: int32): bigint; -export declare function op_LeftShift(x: bigint, n: int32): bigint; -export declare function op_BitwiseAnd(x: bigint, y: bigint): bigint; -export declare function op_BitwiseOr(x: bigint, y: bigint): bigint; -export declare function op_ExclusiveOr(x: bigint, y: bigint): bigint; -export declare function op_LessThan(x: bigint, y: bigint): boolean; -export declare function op_LessThanOrEqual(x: bigint, y: bigint): boolean; -export declare function op_GreaterThan(x: bigint, y: bigint): boolean; -export declare function op_GreaterThanOrEqual(x: bigint, y: bigint): boolean; -export declare function op_Equality(x: bigint, y: bigint): boolean; -export declare function op_Inequality(x: bigint, y: bigint): boolean; -export declare function get_Zero(): bigint; -export declare function get_One(): bigint; -export declare function get_MinusOne(): bigint; -export declare function get_IsZero(x: bigint): boolean; -export declare function get_IsOne(x: bigint): boolean; -export declare function get_IsEven(x: bigint): boolean; -export declare function get_IsPowerOfTwo(x: bigint): boolean; -export declare function get_Sign(x: bigint): int32; -export declare function isNegative(x: bigint): boolean; -export declare function isPositive(x: bigint): boolean; -export declare function isEvenInteger(x: bigint): boolean; -export declare function isOddInteger(x: bigint): boolean; -export declare function isPow2(x: bigint): boolean; -export declare function fromZero(): bigint; -export declare function fromOne(): bigint; -export declare function fromInt8(n: int8): bigint; -export declare function fromUInt8(n: uint8): bigint; -export declare function fromInt16(n: int16): bigint; -export declare function fromUInt16(n: uint16): bigint; -export declare function fromInt32(n: int32): bigint; -export declare function fromUInt32(n: uint32): bigint; -export declare function fromInt64(n: int64): bigint; -export declare function fromUInt64(n: uint64): bigint; -export declare function fromInt128(n: int128): bigint; -export declare function fromUInt128(n: uint128): bigint; -export declare function fromNativeInt(n: nativeint): bigint; -export declare function fromUNativeInt(n: unativeint): bigint; -export declare function fromFloat16(n: float16): bigint; -export declare function fromFloat32(n: float32): bigint; -export declare function fromFloat64(n: float64): bigint; -export declare function fromDecimal(d: decimal): bigint; -export declare function fromBigInt(x: bigint): bigint; -export declare function fromBoolean(b: boolean): bigint; -export declare function fromChar(c: string): bigint; -export declare function fromString(s: string): bigint; -export declare function fromByteArray(bytes: ArrayLike): bigint; -export declare function toByteArray(value: bigint): number[]; -export declare function toInt8(x: bigint): int8; -export declare function toUInt8(x: bigint): uint8; -export declare function toInt16(x: bigint): int16; -export declare function toUInt16(x: bigint): uint16; -export declare function toInt32(x: bigint): int32; -export declare function toUInt32(x: bigint): uint32; -export declare function toInt64(x: bigint): int64; -export declare function toUInt64(x: bigint): uint64; -export declare function toInt128(x: bigint): int128; -export declare function toUInt128(x: bigint): uint128; -export declare function toNativeInt(x: bigint): nativeint; -export declare function toUNativeInt(x: bigint): unativeint; -export declare function toFloat16(x: bigint): float32; -export declare function toFloat32(x: bigint): float32; -export declare function toFloat64(x: bigint): float64; -export declare function toDecimal(x: bigint): decimal; -export declare function toBigInt(x: bigint): bigint; -export declare function toBoolean(x: bigint): boolean; -export declare function toChar(x: bigint): string; -export declare function toString(x: bigint): string; -export declare function tryParse(s: string, res: FSharpRef): boolean; -export declare function parse(s: string): bigint; -export declare function pow(x: bigint, n: int32): bigint; -export declare function modPow(x: bigint, e: bigint, m: bigint): bigint; -export declare function divRem(x: bigint, y: bigint): [bigint, bigint]; -export declare function divRem(x: bigint, y: bigint, out: FSharpRef): bigint; -export declare function greatestCommonDivisor(x: bigint, y: bigint): bigint; -export declare function getBitLength(x: bigint): int64; -export declare function log2(x: bigint): float64; -export declare function log10(x: bigint): float64; -export declare function ln(x: bigint): float64; -export declare function log(x: bigint, base: float64): float64; -export declare function ilog2(x: bigint): bigint; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.js deleted file mode 100644 index 6808e2fb..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BigInt.js +++ /dev/null @@ -1,282 +0,0 @@ -import { fromParts, truncate } from "./Decimal.js"; -import { bigintHash } from "./Util.js"; -const isBigEndian = false; -BigInt.prototype.toJSON = function () { - return `${this.toString()}`; -}; -const zero = 0n; -const one = 1n; -const two = 2n; -const minusOne = -1n; -export function isBigInt(x) { - return typeof x === "bigint"; -} -export function hash(x) { - return bigintHash(x); -} -export function equals(x, y) { - return x === y; -} -export function compare(x, y) { - return x < y ? -1 : x > y ? 1 : 0; -} -export function abs(x) { return x < zero ? -x : x; } -export function sign(x) { return x < zero ? -1 : x > zero ? 1 : 0; } -export function max(x, y) { return x > y ? x : y; } -export function min(x, y) { return x < y ? x : y; } -export function maxMagnitude(x, y) { return abs(x) > abs(y) ? x : y; } -export function minMagnitude(x, y) { return abs(x) < abs(y) ? x : y; } -export function clamp(x, min, max) { - return x < min ? min : x > max ? max : x; -} -export function add(x, y) { return x + y; } -export function subtract(x, y) { return x - y; } -export function multiply(x, y) { return x * y; } -export function divide(x, y) { return x / y; } -export function remainder(x, y) { return x % y; } -export function negate(x) { return -x; } -export function op_UnaryNegation(x) { return -x; } -export function op_LogicalNot(x) { return ~x; } -export function op_UnaryPlus(x) { return x; } -export function op_Addition(x, y) { return x + y; } -export function op_Subtraction(x, y) { return x - y; } -export function op_Multiply(x, y) { return x * y; } -export function op_Division(x, y) { return x / y; } -export function op_Modulus(x, y) { return x % y; } -export function op_RightShift(x, n) { return x >> BigInt(n); } -export function op_LeftShift(x, n) { return x << BigInt(n); } -export function op_BitwiseAnd(x, y) { return x & y; } -export function op_BitwiseOr(x, y) { return x | y; } -export function op_ExclusiveOr(x, y) { return x ^ y; } -export function op_LessThan(x, y) { return x < y; } -export function op_LessThanOrEqual(x, y) { return x <= y; } -export function op_GreaterThan(x, y) { return x > y; } -export function op_GreaterThanOrEqual(x, y) { return x >= y; } -export function op_Equality(x, y) { return x === y; } -export function op_Inequality(x, y) { return x !== y; } -export function get_Zero() { return zero; } -export function get_One() { return one; } -export function get_MinusOne() { return minusOne; } -export function get_IsZero(x) { return x === zero; } -export function get_IsOne(x) { return x === one; } -export function get_IsEven(x) { return isEvenInteger(x); } -export function get_IsPowerOfTwo(x) { return isPow2(x); } -export function get_Sign(x) { return sign(x); } -export function isNegative(x) { return x < zero; } -export function isPositive(x) { return x > zero; } -export function isEvenInteger(x) { return (x % two) === zero; } -export function isOddInteger(x) { return (x % two) !== zero; } -export function isPow2(x) { return (x & (x - one)) === zero; } -export function fromZero() { return zero; } -export function fromOne() { return one; } -export function fromInt8(n) { return BigInt(n); } -export function fromUInt8(n) { return BigInt(n); } -export function fromInt16(n) { return BigInt(n); } -export function fromUInt16(n) { return BigInt(n); } -export function fromInt32(n) { return BigInt(n); } -export function fromUInt32(n) { return BigInt(n); } -export function fromInt64(n) { return n; } -export function fromUInt64(n) { return n; } -export function fromInt128(n) { return n; } -export function fromUInt128(n) { return n; } -export function fromNativeInt(n) { return n; } -export function fromUNativeInt(n) { return n; } -export function fromFloat16(n) { return BigInt(Math.trunc(n)); } -export function fromFloat32(n) { return BigInt(Math.trunc(n)); } -export function fromFloat64(n) { return BigInt(Math.trunc(n)); } -export function fromDecimal(d) { return BigInt(truncate(d).toString()); } -export function fromBigInt(x) { return x; } -export function fromBoolean(b) { return BigInt(b); } -export function fromChar(c) { return BigInt(c.charCodeAt(0)); } -export function fromString(s) { return BigInt(s); } -export function fromByteArray(bytes) { - return fromSignedBytes(bytes, isBigEndian); -} -export function toByteArray(value) { - return toSignedBytes(value, isBigEndian); -} -export function toInt8(x) { return Number(BigInt.asIntN(8, x)); } -export function toUInt8(x) { return Number(BigInt.asUintN(8, x)); } -export function toInt16(x) { return Number(BigInt.asIntN(16, x)); } -export function toUInt16(x) { return Number(BigInt.asUintN(16, x)); } -export function toInt32(x) { return Number(BigInt.asIntN(32, x)); } -export function toUInt32(x) { return Number(BigInt.asUintN(32, x)); } -export function toInt64(x) { return BigInt.asIntN(64, x); } -export function toUInt64(x) { return BigInt.asUintN(64, x); } -export function toInt128(x) { return BigInt.asIntN(128, x); } -export function toUInt128(x) { return BigInt.asUintN(128, x); } -export function toNativeInt(x) { return BigInt.asIntN(64, x); } -export function toUNativeInt(x) { return BigInt.asUintN(64, x); } -export function toFloat16(x) { return Number(x); } -export function toFloat32(x) { return Number(x); } -export function toFloat64(x) { return Number(x); } -export function toDecimal(x) { - const low = Number(BigInt.asUintN(32, x)); - const mid = Number(BigInt.asUintN(32, x >> 32n)); - const high = Number(BigInt.asUintN(32, x >> 64n)); - const isNegative = x < zero; - const scale = 0; - return fromParts(low, mid, high, isNegative, scale); -} -export function toBigInt(x) { return x; } -export function toBoolean(x) { return x !== zero; } -export function toChar(x) { - return String.fromCharCode(toUInt16(x)); -} -export function toString(x) { return x.toString(); } -export function tryParse(s, res) { - try { - res.contents = BigInt(s); - return true; - } - catch (err) { - return false; - } -} -export function parse(s) { - return BigInt(s); -} -export function pow(x, n) { - return x ** BigInt(n); -} -export function modPow(x, e, m) { - return (x ** e) % m; -} -export function divRem(x, y, out) { - const div = x / y; - const rem = x % y; - if (out === void 0) { - return [div, rem]; - } - else { - out.contents = rem; - return div; - } -} -export function greatestCommonDivisor(x, y) { - while (y > zero) { - const q = x / y; - const r = x - q * y; - x = y; - y = r; - } - return x; -} -export function getBitLength(x) { - return fromFloat64(x === zero ? 1 : log2(abs(x)) + 1); -} -export function log2(x) { - const n = Number(x); - if (Number.isFinite(n)) - return Math.log2(n); // fast path - if (x < zero) - return Number.NaN; - let shift = one; - while (x >= (one << shift)) { - shift = shift << one; - } - let log = zero; - while (shift > one) { - shift = shift >> one; - if (x >= (one << shift)) { - log = log + shift; - x = x >> shift; - } - } - return Number(log); -} -export function log10(x) { - return log2(x) * Math.log10(2); -} -export function ln(x) { - return log2(x) * Math.log(2); -} -export function log(x, base) { - return log2(x) / Math.log2(base); -} -export function ilog2(x) { - return BigInt(log2(x)); -} -// export function copySign -// export function createChecked -// export function createSaturating -// export function createTruncating -// export function getByteCount -// export function leadingZeroCount -// export function popCount -// export function rotateLeft -// export function rotateRight -// export function trailingZeroCount -// export function tryFormat -// export function tryWriteBytes -// ------------------------------------------------- -// Binary serialization -// ------------------------------------------------- -const hexCodes = new Uint8Array([48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102]); -function fromHexCode(code) { - if (48 <= code && code <= 57) - return code - 48; - if (97 <= code && code <= 102) - return code - 97 + 10; - if (65 <= code && code <= 70) - return code - 65 + 10; - throw Error(`Invalid hex code: ${code}`); -} -function toSignedBytes(x, isBigEndian) { - const isNeg = x < 0n; - if (isNeg) { - const len = log2(-x); - const bits = len + (8 - len % 8); - const pow2 = (1n << BigInt(bits)); - x = x + pow2; // two's complement - } - const hex = x.toString(16); - const len = hex.length; - const odd = len % 2; - const first = hex.charCodeAt(0); - const isLow = 48 <= first && first <= 55; // 0..7 - const start = (isNeg && isLow) || (!isNeg && !isLow) ? 1 : 0; - const bytes = new Uint8Array(start + (len + odd) / 2); - const inc = isBigEndian ? 1 : -1; - let pos = isBigEndian ? 0 : bytes.length - 1; - if (start > 0) { - bytes[pos] = isNeg ? 255 : 0; - pos += inc; - } - if (odd > 0) { - bytes[pos] = fromHexCode(first); - pos += inc; - } - for (let i = odd; i < len; i += 2, pos += inc) { - const a = fromHexCode(hex.charCodeAt(i)); - const b = fromHexCode(hex.charCodeAt(i + 1)); - bytes[pos] = (a << 4) | b; - } - return bytes; -} -function fromSignedBytes(bytes, isBigEndian) { - if (bytes == null) { - throw new Error("bytes is null"); - } - const len = bytes.length; - const first = isBigEndian ? 0 : len - 1; - const isNeg = bytes[first] > 127; - const codes = new Uint16Array(len * 2 + 2); - codes[0] = 48; // 0 - codes[1] = 120; // x - const inc = isBigEndian ? 1 : -1; - let pos = isBigEndian ? 0 : len - 1; - for (let i = 0; i < bytes.length; i++, pos += inc) { - const byte = bytes[pos]; - codes[2 * i + 2] = hexCodes[byte >> 4]; - codes[2 * i + 3] = hexCodes[byte & 15]; - } - const str = String.fromCharCode.apply(null, codes); - let x = BigInt(str); - if (isNeg) { - const bits = len * 8; - const pow2 = (1n << BigInt(bits)); - x = x - pow2; // two's complement - } - return x; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.d.ts deleted file mode 100644 index 8fe524c3..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { uint8, int16, uint16, int32, uint32, float32, float64 } from "./Int32.js"; -import { int64, uint64 } from "./BigInt.js"; -import { char } from "./Char.js"; -export declare function isLittleEndian(): boolean; -export declare function getBytesBoolean(value: boolean): Uint8Array; -export declare function getBytesChar(value: char): Uint8Array; -export declare function getBytesInt16(value: int16): Uint8Array; -export declare function getBytesInt32(value: int32): Uint8Array; -export declare function getBytesInt64(value: int64): Uint8Array; -export declare function getBytesUInt16(value: uint16): Uint8Array; -export declare function getBytesUInt32(value: uint32): Uint8Array; -export declare function getBytesUInt64(value: uint64): Uint8Array; -export declare function getBytesSingle(value: float32): Uint8Array; -export declare function getBytesDouble(value: float64): Uint8Array; -export declare function int64BitsToDouble(value: int64): float64; -export declare function doubleToInt64Bits(value: float64): int64; -export declare function toBoolean(bytes: ArrayLike, offset: int32): boolean; -export declare function toChar(bytes: ArrayLike, offset: int32): char; -export declare function toInt16(bytes: ArrayLike, offset: int32): int16; -export declare function toInt32(bytes: ArrayLike, offset: int32): int32; -export declare function toInt64(bytes: ArrayLike, offset: int32): int64; -export declare function toUInt16(bytes: ArrayLike, offset: int32): uint16; -export declare function toUInt32(bytes: ArrayLike, offset: int32): uint32; -export declare function toUInt64(bytes: ArrayLike, offset: int32): uint64; -export declare function toSingle(bytes: ArrayLike, offset: int32): float32; -export declare function toDouble(bytes: ArrayLike, offset: int32): float64; -export declare function toString(bytes: ArrayLike, offset?: int32, count?: int32): string; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.js deleted file mode 100644 index d65a3438..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/BitConverter.js +++ /dev/null @@ -1,138 +0,0 @@ -const littleEndian = true; -export function isLittleEndian() { - return littleEndian; -} -export function getBytesBoolean(value) { - const bytes = new Uint8Array(1); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setUint8(0, value ? 1 : 0); - return bytes; -} -export function getBytesChar(value) { - const bytes = new Uint8Array(2); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setUint16(0, value.charCodeAt(0), littleEndian); - return bytes; -} -export function getBytesInt16(value) { - const bytes = new Uint8Array(2); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setInt16(0, value, littleEndian); - return bytes; -} -export function getBytesInt32(value) { - const bytes = new Uint8Array(4); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setInt32(0, value, littleEndian); - return bytes; -} -export function getBytesInt64(value) { - const bytes = new Uint8Array(8); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setBigInt64(0, value, littleEndian); - return bytes; -} -export function getBytesUInt16(value) { - const bytes = new Uint8Array(2); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setUint16(0, value, littleEndian); - return bytes; -} -export function getBytesUInt32(value) { - const bytes = new Uint8Array(4); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setUint32(0, value, littleEndian); - return bytes; -} -export function getBytesUInt64(value) { - const bytes = new Uint8Array(8); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setBigUint64(0, value, littleEndian); - return bytes; -} -export function getBytesSingle(value) { - const bytes = new Uint8Array(4); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setFloat32(0, value, littleEndian); - return bytes; -} -export function getBytesDouble(value) { - const bytes = new Uint8Array(8); - const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); - view.setFloat64(0, value, littleEndian); - return bytes; -} -export function int64BitsToDouble(value) { - const buffer = new ArrayBuffer(8); - const view = new DataView(buffer); - view.setBigInt64(0, value, littleEndian); - return view.getFloat64(0, littleEndian); -} -export function doubleToInt64Bits(value) { - const buffer = new ArrayBuffer(8); - const view = new DataView(buffer); - view.setFloat64(0, value, littleEndian); - return view.getBigInt64(0, littleEndian); -} -export function toBoolean(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getUint8(offset) === 1 ? true : false; -} -export function toChar(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - const code = view.getUint16(offset, littleEndian); - return String.fromCharCode(code); -} -export function toInt16(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getInt16(offset, littleEndian); -} -export function toInt32(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getInt32(offset, littleEndian); -} -export function toInt64(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getBigInt64(offset, littleEndian); -} -export function toUInt16(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getUint16(offset, littleEndian); -} -export function toUInt32(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getUint32(offset, littleEndian); -} -export function toUInt64(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getBigUint64(offset, littleEndian); -} -export function toSingle(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getFloat32(offset, littleEndian); -} -export function toDouble(bytes, offset) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - return view.getFloat64(offset, littleEndian); -} -export function toString(bytes, offset, count) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); - if (offset != null && count != null) { - buffer = buffer.subarray(offset, offset + count); - } - else if (offset != null) { - buffer = buffer.subarray(offset); - } - return Array.from(buffer).map((b) => ("0" + b.toString(16)).slice(-2)).join("-"); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.d.ts deleted file mode 100644 index c8106ff2..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export declare function tryParse(str: string, defValue: FSharpRef): boolean; -export declare function parse(str: string): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.js deleted file mode 100644 index c95a2ed4..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Boolean.js +++ /dev/null @@ -1,21 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export function tryParse(str, defValue) { - if (str.match(/^\s*true\s*$/i)) { - defValue.contents = true; - return true; - } - else if (str.match(/^\s*false\s*$/i)) { - defValue.contents = false; - return true; - } - return false; -} -export function parse(str) { - const defValue = new FSharpRef(false); - if (tryParse(str, defValue)) { - return defValue.contents; - } - else { - throw new Error(`String '${str}' was not recognized as a valid Boolean.`); - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/CHANGELOG.md b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/CHANGELOG.md deleted file mode 100644 index 838a8c1c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## Unreleased - -## 1.1.1 - 2023-05-16 - -* Initialising the changelog diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.d.ts deleted file mode 100644 index 81245657..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export type char = string; -export declare const enum UnicodeCategory { - UppercaseLetter = 0, - LowercaseLetter = 1, - TitlecaseLetter = 2, - ModifierLetter = 3, - OtherLetter = 4, - NonSpacingMark = 5, - SpacingCombiningMark = 6, - EnclosingMark = 7, - DecimalDigitNumber = 8, - LetterNumber = 9, - OtherNumber = 10, - SpaceSeparator = 11, - LineSeparator = 12, - ParagraphSeparator = 13, - Control = 14, - Format = 15, - Surrogate = 16, - PrivateUse = 17, - ConnectorPunctuation = 18, - DashPunctuation = 19, - OpenPunctuation = 20, - ClosePunctuation = 21, - InitialQuotePunctuation = 22, - FinalQuotePunctuation = 23, - OtherPunctuation = 24, - MathSymbol = 25, - CurrencySymbol = 26, - ModifierSymbol = 27, - OtherSymbol = 28, - OtherNotAssigned = 29 -} -export declare const getUnicodeCategory: (s: string) => number; -export declare const isControl: (s: string) => boolean; -export declare const isDigit: (s: string) => boolean; -export declare const isLetter: (s: string) => boolean; -export declare const isLetterOrDigit: (s: string) => boolean; -export declare const isUpper: (s: string) => boolean; -export declare const isLower: (s: string) => boolean; -export declare const isNumber: (s: string) => boolean; -export declare const isPunctuation: (s: string) => boolean; -export declare const isSeparator: (s: string) => boolean; -export declare const isSymbol: (s: string) => boolean; -export declare const isWhiteSpace: (s: string) => boolean; -export declare const isHighSurrogate: (s: string) => boolean; -export declare const isLowSurrogate: (s: string) => boolean; -export declare const isSurrogate: (s: string) => boolean; -export declare function getUnicodeCategory2(s: string, index: number): number; -export declare function isControl2(s: string, index: number): boolean; -export declare function isDigit2(s: string, index: number): boolean; -export declare function isLetter2(s: string, index: number): boolean; -export declare function isLetterOrDigit2(s: string, index: number): boolean; -export declare function isUpper2(s: string, index: number): boolean; -export declare function isLower2(s: string, index: number): boolean; -export declare function isNumber2(s: string, index: number): boolean; -export declare function isPunctuation2(s: string, index: number): boolean; -export declare function isSeparator2(s: string, index: number): boolean; -export declare function isSymbol2(s: string, index: number): boolean; -export declare function isWhiteSpace2(s: string, index: number): boolean; -export declare function isHighSurrogate2(s: string, index: number): boolean; -export declare function isLowSurrogate2(s: string, index: number): boolean; -export declare function isSurrogate2(s: string, index: number): boolean; -export declare function isSurrogatePair(s: string, index: string | number): boolean; -export declare function parse(input: string): string; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.js deleted file mode 100644 index 96ab2b16..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Char.js +++ /dev/null @@ -1,169 +0,0 @@ -import * as Unicode from "./Unicode.13.0.0.js"; -function getCategoryFunc() { - // unpack Unicode codepoint ranges (delta encoded) and general categories - const offset = 35; // offsets unprintable characters - const a1 = [...Unicode.rangeDeltas].map((ch) => (ch.codePointAt(0) ?? 0) - offset); - const a2 = [...Unicode.categories].map((ch) => (ch.codePointAt(0) ?? 0) - offset); - const codepoints = new Uint32Array(a1); - const categories = new Uint8Array(a2); - for (let i = 1; i < codepoints.length; ++i) { - codepoints[i] += codepoints[i - 1]; - } - // binary search in unicode ranges - return (cp) => { - let hi = codepoints.length; - let lo = 0; - while (hi - lo > 1) { - const mid = Math.floor((hi + lo) / 2); - const test = codepoints[mid]; - if (cp < test) { - hi = mid; - } - else if (cp === test) { - hi = lo = mid; - break; - } - else if (test < cp) { - lo = mid; - } - } - return categories[lo]; - }; -} -const isControlMask = 1 << 14 /* UnicodeCategory.Control */; -const isDigitMask = 1 << 8 /* UnicodeCategory.DecimalDigitNumber */; -const isLetterMask = 0 - | 1 << 0 /* UnicodeCategory.UppercaseLetter */ - | 1 << 1 /* UnicodeCategory.LowercaseLetter */ - | 1 << 2 /* UnicodeCategory.TitlecaseLetter */ - | 1 << 3 /* UnicodeCategory.ModifierLetter */ - | 1 << 4 /* UnicodeCategory.OtherLetter */; -const isLetterOrDigitMask = isLetterMask | isDigitMask; -const isUpperMask = 1 << 0 /* UnicodeCategory.UppercaseLetter */; -const isLowerMask = 1 << 1 /* UnicodeCategory.LowercaseLetter */; -const isNumberMask = 0 - | 1 << 8 /* UnicodeCategory.DecimalDigitNumber */ - | 1 << 9 /* UnicodeCategory.LetterNumber */ - | 1 << 10 /* UnicodeCategory.OtherNumber */; -const isPunctuationMask = 0 - | 1 << 18 /* UnicodeCategory.ConnectorPunctuation */ - | 1 << 19 /* UnicodeCategory.DashPunctuation */ - | 1 << 20 /* UnicodeCategory.OpenPunctuation */ - | 1 << 21 /* UnicodeCategory.ClosePunctuation */ - | 1 << 22 /* UnicodeCategory.InitialQuotePunctuation */ - | 1 << 23 /* UnicodeCategory.FinalQuotePunctuation */ - | 1 << 24 /* UnicodeCategory.OtherPunctuation */; -const isSeparatorMask = 0 - | 1 << 11 /* UnicodeCategory.SpaceSeparator */ - | 1 << 12 /* UnicodeCategory.LineSeparator */ - | 1 << 13 /* UnicodeCategory.ParagraphSeparator */; -const isSymbolMask = 0 - | 1 << 25 /* UnicodeCategory.MathSymbol */ - | 1 << 26 /* UnicodeCategory.CurrencySymbol */ - | 1 << 27 /* UnicodeCategory.ModifierSymbol */ - | 1 << 28 /* UnicodeCategory.OtherSymbol */; -const isWhiteSpaceMask = 0 - | 1 << 11 /* UnicodeCategory.SpaceSeparator */ - | 1 << 12 /* UnicodeCategory.LineSeparator */ - | 1 << 13 /* UnicodeCategory.ParagraphSeparator */; -const unicodeCategoryFunc = getCategoryFunc(); -function charCodeAt(s, index) { - if (index >= 0 && index < s.length) { - return s.charCodeAt(index); - } - else { - throw new Error("Index out of range."); - } -} -export const getUnicodeCategory = (s) => getUnicodeCategory2(s, 0); -export const isControl = (s) => isControl2(s, 0); -export const isDigit = (s) => isDigit2(s, 0); -export const isLetter = (s) => isLetter2(s, 0); -export const isLetterOrDigit = (s) => isLetterOrDigit2(s, 0); -export const isUpper = (s) => isUpper2(s, 0); -export const isLower = (s) => isLower2(s, 0); -export const isNumber = (s) => isNumber2(s, 0); -export const isPunctuation = (s) => isPunctuation2(s, 0); -export const isSeparator = (s) => isSeparator2(s, 0); -export const isSymbol = (s) => isSymbol2(s, 0); -export const isWhiteSpace = (s) => isWhiteSpace2(s, 0); -export const isHighSurrogate = (s) => isHighSurrogate2(s, 0); -export const isLowSurrogate = (s) => isLowSurrogate2(s, 0); -export const isSurrogate = (s) => isSurrogate2(s, 0); -export function getUnicodeCategory2(s, index) { - const cp = charCodeAt(s, index); - return unicodeCategoryFunc(cp); -} -export function isControl2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isControlMask) !== 0; -} -export function isDigit2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isDigitMask) !== 0; -} -export function isLetter2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isLetterMask) !== 0; -} -export function isLetterOrDigit2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isLetterOrDigitMask) !== 0; -} -export function isUpper2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isUpperMask) !== 0; -} -export function isLower2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isLowerMask) !== 0; -} -export function isNumber2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isNumberMask) !== 0; -} -export function isPunctuation2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isPunctuationMask) !== 0; -} -export function isSeparator2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isSeparatorMask) !== 0; -} -export function isSymbol2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - return (test & isSymbolMask) !== 0; -} -export function isWhiteSpace2(s, index) { - const test = 1 << getUnicodeCategory2(s, index); - if ((test & isWhiteSpaceMask) !== 0) { - return true; - } - const cp = charCodeAt(s, index); - return (0x09 <= cp && cp <= 0x0D) || cp === 0x85 || cp === 0xA0; -} -export function isHighSurrogate2(s, index) { - const cp = charCodeAt(s, index); - return (0xD800 <= cp && cp <= 0xDBFF); -} -export function isLowSurrogate2(s, index) { - const cp = charCodeAt(s, index); - return (0xDC00 <= cp && cp <= 0xDFFF); -} -export function isSurrogate2(s, index) { - const cp = charCodeAt(s, index); - return (0xD800 <= cp && cp <= 0xDFFF); -} -export function isSurrogatePair(s, index) { - return typeof index === "number" - ? isHighSurrogate2(s, index) && isLowSurrogate2(s, index + 1) - : isHighSurrogate(s) && isLowSurrogate(index); -} -export function parse(input) { - if (input.length === 1) { - return input[0]; - } - else { - throw new Error("String must be exactly one character long."); - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.d.ts deleted file mode 100644 index de56b9a8..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Union } from "./Types.js"; -import { TypeInfo } from "./Reflection.js"; -import { Option } from "./Option.js"; -export type FSharpResult$2_$union = FSharpResult$2 | FSharpResult$2; -export type FSharpResult$2_$cases = { - 0: ["Ok", [T]]; - 1: ["Error", [TError]]; -}; -export declare function FSharpResult$2_Ok(ResultValue: T): FSharpResult$2; -export declare function FSharpResult$2_Error(ErrorValue: TError): FSharpResult$2; -export declare class FSharpResult$2> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpResult$2_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpResult$2_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpResult$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function Result_Map(mapping: ((arg0: a) => b), result: FSharpResult$2_$union): FSharpResult$2_$union; -export declare function Result_MapError(mapping: ((arg0: a) => b), result: FSharpResult$2_$union): FSharpResult$2_$union; -export declare function Result_Bind(binder: ((arg0: a) => FSharpResult$2_$union), result: FSharpResult$2_$union): FSharpResult$2_$union; -export type FSharpChoice$2_$union = FSharpChoice$2 | FSharpChoice$2; -export type FSharpChoice$2_$cases = { - 0: ["Choice1Of2", [T1]]; - 1: ["Choice2Of2", [T2]]; -}; -export declare function FSharpChoice$2_Choice1Of2(Item: T1): FSharpChoice$2; -export declare function FSharpChoice$2_Choice2Of2(Item: T2): FSharpChoice$2; -export declare class FSharpChoice$2> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$2_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$2_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export type FSharpChoice$3_$union = FSharpChoice$3 | FSharpChoice$3 | FSharpChoice$3; -export type FSharpChoice$3_$cases = { - 0: ["Choice1Of3", [T1]]; - 1: ["Choice2Of3", [T2]]; - 2: ["Choice3Of3", [T3]]; -}; -export declare function FSharpChoice$3_Choice1Of3(Item: T1): FSharpChoice$3; -export declare function FSharpChoice$3_Choice2Of3(Item: T2): FSharpChoice$3; -export declare function FSharpChoice$3_Choice3Of3(Item: T3): FSharpChoice$3; -export declare class FSharpChoice$3> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$3_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$3_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$3_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo): TypeInfo; -export type FSharpChoice$4_$union = FSharpChoice$4 | FSharpChoice$4 | FSharpChoice$4 | FSharpChoice$4; -export type FSharpChoice$4_$cases = { - 0: ["Choice1Of4", [T1]]; - 1: ["Choice2Of4", [T2]]; - 2: ["Choice3Of4", [T3]]; - 3: ["Choice4Of4", [T4]]; -}; -export declare function FSharpChoice$4_Choice1Of4(Item: T1): FSharpChoice$4; -export declare function FSharpChoice$4_Choice2Of4(Item: T2): FSharpChoice$4; -export declare function FSharpChoice$4_Choice3Of4(Item: T3): FSharpChoice$4; -export declare function FSharpChoice$4_Choice4Of4(Item: T4): FSharpChoice$4; -export declare class FSharpChoice$4> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$4_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$4_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$4_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo): TypeInfo; -export type FSharpChoice$5_$union = FSharpChoice$5 | FSharpChoice$5 | FSharpChoice$5 | FSharpChoice$5 | FSharpChoice$5; -export type FSharpChoice$5_$cases = { - 0: ["Choice1Of5", [T1]]; - 1: ["Choice2Of5", [T2]]; - 2: ["Choice3Of5", [T3]]; - 3: ["Choice4Of5", [T4]]; - 4: ["Choice5Of5", [T5]]; -}; -export declare function FSharpChoice$5_Choice1Of5(Item: T1): FSharpChoice$5; -export declare function FSharpChoice$5_Choice2Of5(Item: T2): FSharpChoice$5; -export declare function FSharpChoice$5_Choice3Of5(Item: T3): FSharpChoice$5; -export declare function FSharpChoice$5_Choice4Of5(Item: T4): FSharpChoice$5; -export declare function FSharpChoice$5_Choice5Of5(Item: T5): FSharpChoice$5; -export declare class FSharpChoice$5> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$5_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$5_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$5_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo): TypeInfo; -export type FSharpChoice$6_$union = FSharpChoice$6 | FSharpChoice$6 | FSharpChoice$6 | FSharpChoice$6 | FSharpChoice$6 | FSharpChoice$6; -export type FSharpChoice$6_$cases = { - 0: ["Choice1Of6", [T1]]; - 1: ["Choice2Of6", [T2]]; - 2: ["Choice3Of6", [T3]]; - 3: ["Choice4Of6", [T4]]; - 4: ["Choice5Of6", [T5]]; - 5: ["Choice6Of6", [T6]]; -}; -export declare function FSharpChoice$6_Choice1Of6(Item: T1): FSharpChoice$6; -export declare function FSharpChoice$6_Choice2Of6(Item: T2): FSharpChoice$6; -export declare function FSharpChoice$6_Choice3Of6(Item: T3): FSharpChoice$6; -export declare function FSharpChoice$6_Choice4Of6(Item: T4): FSharpChoice$6; -export declare function FSharpChoice$6_Choice5Of6(Item: T5): FSharpChoice$6; -export declare function FSharpChoice$6_Choice6Of6(Item: T6): FSharpChoice$6; -export declare class FSharpChoice$6> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$6_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$6_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$6_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo, gen5: TypeInfo): TypeInfo; -export type FSharpChoice$7_$union = FSharpChoice$7 | FSharpChoice$7 | FSharpChoice$7 | FSharpChoice$7 | FSharpChoice$7 | FSharpChoice$7 | FSharpChoice$7; -export type FSharpChoice$7_$cases = { - 0: ["Choice1Of7", [T1]]; - 1: ["Choice2Of7", [T2]]; - 2: ["Choice3Of7", [T3]]; - 3: ["Choice4Of7", [T4]]; - 4: ["Choice5Of7", [T5]]; - 5: ["Choice6Of7", [T6]]; - 6: ["Choice7Of7", [T7]]; -}; -export declare function FSharpChoice$7_Choice1Of7(Item: T1): FSharpChoice$7; -export declare function FSharpChoice$7_Choice2Of7(Item: T2): FSharpChoice$7; -export declare function FSharpChoice$7_Choice3Of7(Item: T3): FSharpChoice$7; -export declare function FSharpChoice$7_Choice4Of7(Item: T4): FSharpChoice$7; -export declare function FSharpChoice$7_Choice5Of7(Item: T5): FSharpChoice$7; -export declare function FSharpChoice$7_Choice6Of7(Item: T6): FSharpChoice$7; -export declare function FSharpChoice$7_Choice7Of7(Item: T7): FSharpChoice$7; -export declare class FSharpChoice$7> extends Union[Tag][0]> { - readonly tag: Tag; - readonly fields: FSharpChoice$7_$cases[Tag][1]; - constructor(tag: Tag, fields: FSharpChoice$7_$cases[Tag][1]); - cases(): string[]; -} -export declare function FSharpChoice$7_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo, gen5: TypeInfo, gen6: TypeInfo): TypeInfo; -export declare function Choice_makeChoice1Of2(x: T1): FSharpChoice$2_$union; -export declare function Choice_makeChoice2Of2(x: T2): FSharpChoice$2_$union; -export declare function Choice_tryValueIfChoice1Of2(x: FSharpChoice$2_$union): Option; -export declare function Choice_tryValueIfChoice2Of2(x: FSharpChoice$2_$union): Option; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.js deleted file mode 100644 index c374e283..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Choice.js +++ /dev/null @@ -1,227 +0,0 @@ -import { Union } from "./Types.js"; -import { union_type } from "./Reflection.js"; -import { some } from "./Option.js"; -export function FSharpResult$2_Ok(ResultValue) { - return new FSharpResult$2(0, [ResultValue]); -} -export function FSharpResult$2_Error(ErrorValue) { - return new FSharpResult$2(1, [ErrorValue]); -} -export class FSharpResult$2 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Ok", "Error"]; - } -} -export function FSharpResult$2_$reflection(gen0, gen1) { - return union_type("FSharp.Core.FSharpResult`2", [gen0, gen1], FSharpResult$2, () => [[["ResultValue", gen0]], [["ErrorValue", gen1]]]); -} -export function Result_Map(mapping, result) { - if (result.tag === /* Ok */ 0) { - return FSharpResult$2_Ok(mapping(result.fields[0])); - } - else { - return FSharpResult$2_Error(result.fields[0]); - } -} -export function Result_MapError(mapping, result) { - if (result.tag === /* Ok */ 0) { - return FSharpResult$2_Ok(result.fields[0]); - } - else { - return FSharpResult$2_Error(mapping(result.fields[0])); - } -} -export function Result_Bind(binder, result) { - if (result.tag === /* Ok */ 0) { - return binder(result.fields[0]); - } - else { - return FSharpResult$2_Error(result.fields[0]); - } -} -export function FSharpChoice$2_Choice1Of2(Item) { - return new FSharpChoice$2(0, [Item]); -} -export function FSharpChoice$2_Choice2Of2(Item) { - return new FSharpChoice$2(1, [Item]); -} -export class FSharpChoice$2 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of2", "Choice2Of2"]; - } -} -export function FSharpChoice$2_$reflection(gen0, gen1) { - return union_type("FSharp.Core.FSharpChoice`2", [gen0, gen1], FSharpChoice$2, () => [[["Item", gen0]], [["Item", gen1]]]); -} -export function FSharpChoice$3_Choice1Of3(Item) { - return new FSharpChoice$3(0, [Item]); -} -export function FSharpChoice$3_Choice2Of3(Item) { - return new FSharpChoice$3(1, [Item]); -} -export function FSharpChoice$3_Choice3Of3(Item) { - return new FSharpChoice$3(2, [Item]); -} -export class FSharpChoice$3 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of3", "Choice2Of3", "Choice3Of3"]; - } -} -export function FSharpChoice$3_$reflection(gen0, gen1, gen2) { - return union_type("FSharp.Core.FSharpChoice`3", [gen0, gen1, gen2], FSharpChoice$3, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]]]); -} -export function FSharpChoice$4_Choice1Of4(Item) { - return new FSharpChoice$4(0, [Item]); -} -export function FSharpChoice$4_Choice2Of4(Item) { - return new FSharpChoice$4(1, [Item]); -} -export function FSharpChoice$4_Choice3Of4(Item) { - return new FSharpChoice$4(2, [Item]); -} -export function FSharpChoice$4_Choice4Of4(Item) { - return new FSharpChoice$4(3, [Item]); -} -export class FSharpChoice$4 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of4", "Choice2Of4", "Choice3Of4", "Choice4Of4"]; - } -} -export function FSharpChoice$4_$reflection(gen0, gen1, gen2, gen3) { - return union_type("FSharp.Core.FSharpChoice`4", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]]]); -} -export function FSharpChoice$5_Choice1Of5(Item) { - return new FSharpChoice$5(0, [Item]); -} -export function FSharpChoice$5_Choice2Of5(Item) { - return new FSharpChoice$5(1, [Item]); -} -export function FSharpChoice$5_Choice3Of5(Item) { - return new FSharpChoice$5(2, [Item]); -} -export function FSharpChoice$5_Choice4Of5(Item) { - return new FSharpChoice$5(3, [Item]); -} -export function FSharpChoice$5_Choice5Of5(Item) { - return new FSharpChoice$5(4, [Item]); -} -export class FSharpChoice$5 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of5", "Choice2Of5", "Choice3Of5", "Choice4Of5", "Choice5Of5"]; - } -} -export function FSharpChoice$5_$reflection(gen0, gen1, gen2, gen3, gen4) { - return union_type("FSharp.Core.FSharpChoice`5", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]]]); -} -export function FSharpChoice$6_Choice1Of6(Item) { - return new FSharpChoice$6(0, [Item]); -} -export function FSharpChoice$6_Choice2Of6(Item) { - return new FSharpChoice$6(1, [Item]); -} -export function FSharpChoice$6_Choice3Of6(Item) { - return new FSharpChoice$6(2, [Item]); -} -export function FSharpChoice$6_Choice4Of6(Item) { - return new FSharpChoice$6(3, [Item]); -} -export function FSharpChoice$6_Choice5Of6(Item) { - return new FSharpChoice$6(4, [Item]); -} -export function FSharpChoice$6_Choice6Of6(Item) { - return new FSharpChoice$6(5, [Item]); -} -export class FSharpChoice$6 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of6", "Choice2Of6", "Choice3Of6", "Choice4Of6", "Choice5Of6", "Choice6Of6"]; - } -} -export function FSharpChoice$6_$reflection(gen0, gen1, gen2, gen3, gen4, gen5) { - 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]]]); -} -export function FSharpChoice$7_Choice1Of7(Item) { - return new FSharpChoice$7(0, [Item]); -} -export function FSharpChoice$7_Choice2Of7(Item) { - return new FSharpChoice$7(1, [Item]); -} -export function FSharpChoice$7_Choice3Of7(Item) { - return new FSharpChoice$7(2, [Item]); -} -export function FSharpChoice$7_Choice4Of7(Item) { - return new FSharpChoice$7(3, [Item]); -} -export function FSharpChoice$7_Choice5Of7(Item) { - return new FSharpChoice$7(4, [Item]); -} -export function FSharpChoice$7_Choice6Of7(Item) { - return new FSharpChoice$7(5, [Item]); -} -export function FSharpChoice$7_Choice7Of7(Item) { - return new FSharpChoice$7(6, [Item]); -} -export class FSharpChoice$7 extends Union { - constructor(tag, fields) { - super(); - this.tag = tag; - this.fields = fields; - } - cases() { - return ["Choice1Of7", "Choice2Of7", "Choice3Of7", "Choice4Of7", "Choice5Of7", "Choice6Of7", "Choice7Of7"]; - } -} -export function FSharpChoice$7_$reflection(gen0, gen1, gen2, gen3, gen4, gen5, gen6) { - 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]]]); -} -export function Choice_makeChoice1Of2(x) { - return FSharpChoice$2_Choice1Of2(x); -} -export function Choice_makeChoice2Of2(x) { - return FSharpChoice$2_Choice2Of2(x); -} -export function Choice_tryValueIfChoice1Of2(x) { - if (x.tag === /* Choice1Of2 */ 0) { - return some(x.fields[0]); - } - else { - return void 0; - } -} -export function Choice_tryValueIfChoice2Of2(x) { - if (x.tag === /* Choice2Of2 */ 1) { - return some(x.fields[0]); - } - else { - return void 0; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.d.ts deleted file mode 100644 index ec96a872..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * DateTimeOffset functions. - * - * Note: Date instances are always DateObjects in local - * timezone (because JS dates are all kinds of messed up). - * A local date returns UTC epoch when `.getTime()` is called. - * - * Basically; invariant: date.getTime() always return UTC time. - */ -import { int64 } from "./BigInt.js"; -import { FSharpRef } from "./Types.js"; -import { compareDates, DateKind, IDateTime, IDateTimeOffset } from "./Util.js"; -export type OffsetInMinutes = number; -export type Offset = "Z" | OffsetInMinutes | null; -export declare function kind(value: IDateTime): number; -export declare function unixEpochMillisecondsToTicks(ms: number, offset: number): int64; -export declare function ticksToUnixEpochMilliseconds(ticks: number | bigint): number; -export declare function dateOffsetToString(offset: number): string; -export declare function dateToHalfUTCString(date: IDateTime, half: "first" | "second"): string; -export declare function toString(date: IDateTime | IDateTimeOffset, format?: string, _provider?: any): string; -export declare function DateTime(value: number, kind?: DateKind): IDateTime; -export declare function fromTicks(ticks: number | bigint, kind?: DateKind): IDateTime; -export declare function fromDateTimeOffset(date: IDateTimeOffset, kind: DateKind): IDateTime; -export declare function getTicks(date: IDateTime | IDateTimeOffset): bigint; -export declare function minValue(): IDateTime; -export declare function maxValue(): IDateTime; -export declare function parseRaw(input: string): [Date, Offset]; -export declare function parse(str: string, detectUTC?: boolean): IDateTime; -export declare function tryParse(v: string, defValue: FSharpRef): boolean; -export declare function create(year: number, month: number, day: number, h?: number, m?: number, s?: number, ms?: number, kind?: DateKind): IDateTime; -export declare function now(): IDateTime; -export declare function utcNow(): IDateTime; -export declare function today(): IDateTime; -export declare function isLeapYear(year: number): boolean; -export declare function daysInMonth(year: number, month: number): 29 | 28 | 31 | 30; -export declare function toUniversalTime(date: IDateTime): IDateTime; -export declare function toLocalTime(date: IDateTime): IDateTime; -export declare function specifyKind(d: IDateTime, kind: DateKind): IDateTime; -export declare function timeOfDay(d: IDateTime): number; -export declare function date(d: IDateTime): IDateTime; -export declare function day(d: IDateTime): number; -export declare function hour(d: IDateTime): number; -export declare function millisecond(d: IDateTime): number; -export declare function minute(d: IDateTime): number; -export declare function month(d: IDateTime): number; -export declare function second(d: IDateTime): number; -export declare function year(d: IDateTime): number; -export declare function dayOfWeek(d: IDateTime): number; -export declare function dayOfYear(d: IDateTime): number; -export declare function add(d: IDateTime, ts: number): IDateTime; -export declare function addDays(d: IDateTime, v: number): IDateTime; -export declare function addHours(d: IDateTime, v: number): IDateTime; -export declare function addMinutes(d: IDateTime, v: number): IDateTime; -export declare function addSeconds(d: IDateTime, v: number): IDateTime; -export declare function addMilliseconds(d: IDateTime, v: number): IDateTime; -export declare function addTicks(d: IDateTime, v: int64): IDateTime; -export declare function addYears(d: IDateTime, v: number): IDateTime; -export declare function addMonths(d: IDateTime, v: number): IDateTime; -export declare function subtract(d: IDateTime, that: Input): Output; -export declare function toLongDateString(d: IDateTime): string; -export declare function toShortDateString(d: IDateTime): string; -export declare function toLongTimeString(d: IDateTime): string; -export declare function toShortTimeString(d: IDateTime): string; -export declare function equals(d1: IDateTime, d2: IDateTime): boolean; -export declare const compare: typeof compareDates; -export declare const compareTo: typeof compareDates; -export declare function op_Addition(x: IDateTime, y: number): IDateTime; -export declare function op_Subtraction(x: IDateTime, y: Input): Output; -export declare function isDaylightSavingTime(x: IDateTime): boolean; -export default DateTime; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.js deleted file mode 100644 index 3477f292..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Date.js +++ /dev/null @@ -1,451 +0,0 @@ -/** - * DateTimeOffset functions. - * - * Note: Date instances are always DateObjects in local - * timezone (because JS dates are all kinds of messed up). - * A local date returns UTC epoch when `.getTime()` is called. - * - * Basically; invariant: date.getTime() always return UTC time. - */ -import { toInt64, toFloat64 } from "./BigInt.js"; -import { compareDates, dateOffset, padWithZeros } from "./Util.js"; -export function kind(value) { - return value.kind || 0; -} -export function unixEpochMillisecondsToTicks(ms, offset) { - return toInt64(((BigInt(ms) + 62135596800000n) + BigInt(offset)) * 10000n); -} -export function ticksToUnixEpochMilliseconds(ticks) { - return Number(((BigInt(ticks) / 10000n) - 62135596800000n)); -} -export function dateOffsetToString(offset) { - const isMinus = offset < 0; - offset = Math.abs(offset); - const hours = ~~(offset / 3600000); - const minutes = (offset % 3600000) / 60000; - return (isMinus ? "-" : "+") + - padWithZeros(hours, 2) + ":" + - padWithZeros(minutes, 2); -} -export function dateToHalfUTCString(date, half) { - const str = date.toISOString(); - return half === "first" - ? str.substring(0, str.indexOf("T")) - : str.substring(str.indexOf("T") + 1, str.length - 1); -} -function dateToISOString(d, utc) { - if (utc) { - return d.toISOString(); - } - else { - // JS Date is always local - const printOffset = d.kind == null ? true : d.kind === 2 /* DateKind.Local */; - return padWithZeros(d.getFullYear(), 4) + "-" + - padWithZeros(d.getMonth() + 1, 2) + "-" + - padWithZeros(d.getDate(), 2) + "T" + - padWithZeros(d.getHours(), 2) + ":" + - padWithZeros(d.getMinutes(), 2) + ":" + - padWithZeros(d.getSeconds(), 2) + "." + - padWithZeros(d.getMilliseconds(), 3) + - (printOffset ? dateOffsetToString(d.getTimezoneOffset() * -60000) : ""); - } -} -function dateToISOStringWithOffset(dateWithOffset, offset) { - const str = dateWithOffset.toISOString(); - return str.substring(0, str.length - 1) + dateOffsetToString(offset); -} -function dateToStringWithCustomFormat(date, format, utc) { - return format.replace(/(\w)\1*/g, (match) => { - let rep = Number.NaN; - switch (match.substring(0, 1)) { - case "y": - const y = utc ? date.getUTCFullYear() : date.getFullYear(); - rep = match.length < 4 ? y % 100 : y; - break; - case "M": - rep = (utc ? date.getUTCMonth() : date.getMonth()) + 1; - break; - case "d": - rep = utc ? date.getUTCDate() : date.getDate(); - break; - case "H": - rep = utc ? date.getUTCHours() : date.getHours(); - break; - case "h": - const h = utc ? date.getUTCHours() : date.getHours(); - rep = h > 12 ? h % 12 : h; - break; - case "m": - rep = utc ? date.getUTCMinutes() : date.getMinutes(); - break; - case "s": - rep = utc ? date.getUTCSeconds() : date.getSeconds(); - break; - case "f": - rep = utc ? date.getUTCMilliseconds() : date.getMilliseconds(); - break; - } - if (Number.isNaN(rep)) { - return match; - } - else { - return padWithZeros(rep, match.length); - } - }); -} -function dateToStringWithOffset(date, format) { - const d = new Date(date.getTime() + (date.offset ?? 0)); - if (typeof format !== "string") { - return d.toISOString().replace(/\.\d+/, "").replace(/[A-Z]|\.\d+/g, " ") + dateOffsetToString((date.offset ?? 0)); - } - else if (format.length === 1) { - switch (format) { - case "D": - case "d": return dateToHalfUTCString(d, "first"); - case "T": - case "t": return dateToHalfUTCString(d, "second"); - case "O": - case "o": return dateToISOStringWithOffset(d, (date.offset ?? 0)); - default: throw new Error("Unrecognized Date print format"); - } - } - else { - return dateToStringWithCustomFormat(d, format, true); - } -} -function dateToStringWithKind(date, format) { - const utc = date.kind === 1 /* DateKind.UTC */; - if (typeof format !== "string") { - return utc ? date.toUTCString() : date.toLocaleString(); - } - else if (format.length === 1) { - switch (format) { - case "D": - case "d": - return utc ? dateToHalfUTCString(date, "first") : date.toLocaleDateString(); - case "T": - case "t": - return utc ? dateToHalfUTCString(date, "second") : date.toLocaleTimeString(); - case "O": - case "o": - return dateToISOString(date, utc); - default: - throw new Error("Unrecognized Date print format"); - } - } - else { - return dateToStringWithCustomFormat(date, format, utc); - } -} -export function toString(date, format, _provider) { - return date.offset != null - ? dateToStringWithOffset(date, format) - : dateToStringWithKind(date, format); -} -export function DateTime(value, kind) { - const d = new Date(value); - d.kind = (kind == null ? 0 /* DateKind.Unspecified */ : kind) | 0; - return d; -} -export function fromTicks(ticks, kind) { - kind = kind != null ? kind : 2 /* DateKind.Local */; // better default than Unspecified - let date = DateTime(ticksToUnixEpochMilliseconds(ticks), kind); - // Ticks are local to offset (in this case, either UTC or Local/Unknown). - // If kind is anything but UTC, that means that the tick number was not - // in utc, thus getTime() cannot return UTC, and needs to be shifted. - if (kind !== 1 /* DateKind.UTC */) { - date = DateTime(date.getTime() - dateOffset(date), kind); - } - return date; -} -export function fromDateTimeOffset(date, kind) { - switch (kind) { - case 1 /* DateKind.UTC */: return DateTime(date.getTime(), 1 /* DateKind.UTC */); - case 2 /* DateKind.Local */: return DateTime(date.getTime(), 2 /* DateKind.Local */); - default: - const d = DateTime(date.getTime() + (date.offset ?? 0), kind); - return DateTime(d.getTime() - dateOffset(d), kind); - } -} -export function getTicks(date) { - return unixEpochMillisecondsToTicks(date.getTime(), dateOffset(date)); -} -export function minValue() { - // This is "0001-01-01T00:00:00.000Z", actual JS min value is -8640000000000000 - return DateTime(-62135596800000, 0 /* DateKind.Unspecified */); -} -export function maxValue() { - // This is "9999-12-31T23:59:59.999Z", actual JS max value is 8640000000000000 - return DateTime(253402300799999, 0 /* DateKind.Unspecified */); -} -export function parseRaw(input) { - function fail() { - throw new Error(`The string is not a valid Date: ${input}`); - } - if (input == null || input.trim() === "") { - fail(); - } - // ISO dates without TZ are parsed as UTC. Adding time without TZ keeps them local. - if (input.length === 10 && input[4] === "-" && input[7] === "-") { - input += "T00:00:00"; - } - let date = new Date(input); - let offset = null; - if (isNaN(date.getTime())) { - // Try to check strings JS Date cannot parse (see #1045, #1422) - // tslint:disable-next-line:max-line-length - 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); - if (m != null) { - let baseDate; - let timeInSeconds = 0; - if (m[2] != null) { - const timeParts = m[2].split(":"); - timeInSeconds = - parseInt(timeParts[0], 10) * 3600 + - parseInt(timeParts[1] || "0", 10) * 60 + - parseFloat(timeParts[2] || "0"); - if (m[3] != null && m[3].toUpperCase() === "PM") { - timeInSeconds += 720; - } - } - if (m[4] != null) { // There's an offset, parse as UTC - if (m[1] != null) { - baseDate = new Date(m[1] + " UTC"); - } - else { - const d = new Date(); - baseDate = new Date(d.getUTCFullYear() + "/" + (d.getUTCMonth() + 1) + "/" + d.getUTCDate()); - } - if (m[4] === "Z") { - offset = "Z"; - } - else { - let offsetInMinutes = parseInt(m[5], 10) * 60 + parseInt(m[6] || "0", 10); - if (m[4][0] === "-") { - offsetInMinutes *= -1; - } - offset = offsetInMinutes; - timeInSeconds -= offsetInMinutes * 60; - } - } - else { - if (m[1] != null) { - baseDate = new Date(m[1]); - } - else { - const d = new Date(); - baseDate = new Date(d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate()); - } - } - date = new Date(baseDate.getTime() + timeInSeconds * 1000); - // correct for daylight savings time - date = new Date(date.getTime() + (date.getTimezoneOffset() - baseDate.getTimezoneOffset()) * 60000); - } - else { - fail(); - } - // Check again the date is valid after transformations, see #2229 - if (isNaN(date.getTime())) { - fail(); - } - } - return [date, offset]; -} -export function parse(str, detectUTC = false) { - const [date, offset] = parseRaw(str); - // .NET always parses DateTime as Local if there's offset info (even "Z") - // Newtonsoft.Json uses UTC if the offset is "Z" - const kind = offset != null - ? (detectUTC && offset === "Z" ? 1 /* DateKind.UTC */ : 2 /* DateKind.Local */) - : 0 /* DateKind.Unspecified */; - return DateTime(date.getTime(), kind); -} -export function tryParse(v, defValue) { - try { - defValue.contents = parse(v); - return true; - } - catch (_err) { - return false; - } -} -export function create(year, month, day, h = 0, m = 0, s = 0, ms = 0, kind) { - const date = kind === 1 /* DateKind.UTC */ - ? new Date(Date.UTC(year, month - 1, day, h, m, s, ms)) - : new Date(year, month - 1, day, h, m, s, ms); - if (year <= 99) { - if (kind === 1 /* DateKind.UTC */) { - date.setUTCFullYear(year, month - 1, day); - } - else { - date.setFullYear(year, month - 1, day); - } - } - const dateValue = date.getTime(); - if (isNaN(dateValue)) { - throw new Error("The parameters describe an unrepresentable Date."); - } - return DateTime(dateValue, kind); -} -export function now() { - return DateTime(Date.now(), 2 /* DateKind.Local */); -} -export function utcNow() { - return DateTime(Date.now(), 1 /* DateKind.UTC */); -} -export function today() { - return date(now()); -} -export function isLeapYear(year) { - return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; -} -export function daysInMonth(year, month) { - return month === 2 - ? (isLeapYear(year) ? 29 : 28) - : (month >= 8 ? (month % 2 === 0 ? 31 : 30) : (month % 2 === 0 ? 30 : 31)); -} -export function toUniversalTime(date) { - return date.kind === 1 /* DateKind.UTC */ ? date : DateTime(date.getTime(), 1 /* DateKind.UTC */); -} -export function toLocalTime(date) { - return date.kind === 2 /* DateKind.Local */ ? date : DateTime(date.getTime(), 2 /* DateKind.Local */); -} -export function specifyKind(d, kind) { - return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), kind); -} -export function timeOfDay(d) { - return hour(d) * 3600000 - + minute(d) * 60000 - + second(d) * 1000 - + millisecond(d); -} -export function date(d) { - return create(year(d), month(d), day(d), 0, 0, 0, 0, d.kind); -} -export function day(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCDate() : d.getDate(); -} -export function hour(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCHours() : d.getHours(); -} -export function millisecond(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCMilliseconds() : d.getMilliseconds(); -} -export function minute(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCMinutes() : d.getMinutes(); -} -export function month(d) { - return (d.kind === 1 /* DateKind.UTC */ ? d.getUTCMonth() : d.getMonth()) + 1; -} -export function second(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCSeconds() : d.getSeconds(); -} -export function year(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCFullYear() : d.getFullYear(); -} -export function dayOfWeek(d) { - return d.kind === 1 /* DateKind.UTC */ ? d.getUTCDay() : d.getDay(); -} -export function dayOfYear(d) { - const _year = year(d); - const _month = month(d); - let _day = day(d); - for (let i = 1; i < _month; i++) { - _day += daysInMonth(_year, i); - } - return _day; -} -export function add(d, ts) { - const newDate = DateTime(d.getTime() + ts, d.kind); - if (d.kind === 2 /* DateKind.Local */) { - const oldTzOffset = d.getTimezoneOffset(); - const newTzOffset = newDate.getTimezoneOffset(); - return oldTzOffset !== newTzOffset - ? DateTime(newDate.getTime() + (newTzOffset - oldTzOffset) * 60000, d.kind) - : newDate; - } - else { - return newDate; - } -} -export function addDays(d, v) { - return add(d, v * 86400000); -} -export function addHours(d, v) { - return add(d, v * 3600000); -} -export function addMinutes(d, v) { - return add(d, v * 60000); -} -export function addSeconds(d, v) { - return add(d, v * 1000); -} -export function addMilliseconds(d, v) { - return add(d, v); -} -export function addTicks(d, v) { - return add(d, toFloat64(v / 10000n)); -} -export function addYears(d, v) { - const newMonth = month(d); - const newYear = year(d) + v; - const _daysInMonth = daysInMonth(newYear, newMonth); - const newDay = Math.min(_daysInMonth, day(d)); - return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind); -} -export function addMonths(d, v) { - let newMonth = month(d) + v; - let newMonth_ = 0; - let yearOffset = 0; - if (newMonth > 12) { - newMonth_ = newMonth % 12; - yearOffset = Math.floor(newMonth / 12); - newMonth = newMonth_; - } - else if (newMonth < 1) { - newMonth_ = 12 + newMonth % 12; - yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0); - newMonth = newMonth_; - } - const newYear = year(d) + yearOffset; - const _daysInMonth = daysInMonth(newYear, newMonth); - const newDay = Math.min(_daysInMonth, day(d)); - return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind); -} -export function subtract(d, that) { - return typeof that === "number" - ? add(d, -that) - : d.getTime() - that.getTime(); -} -export function toLongDateString(d) { - return d.toDateString(); -} -export function toShortDateString(d) { - return d.toLocaleDateString(); -} -export function toLongTimeString(d) { - return d.toLocaleTimeString(); -} -export function toShortTimeString(d) { - return d.toLocaleTimeString().replace(/:\d\d(?!:)/, ""); -} -export function equals(d1, d2) { - return d1.getTime() === d2.getTime(); -} -export const compare = compareDates; -export const compareTo = compareDates; -export function op_Addition(x, y) { - return add(x, y); -} -export function op_Subtraction(x, y) { - return subtract(x, y); -} -export function isDaylightSavingTime(x) { - const jan = new Date(x.getFullYear(), 0, 1); - const jul = new Date(x.getFullYear(), 6, 1); - return isDST(jan.getTimezoneOffset(), jul.getTimezoneOffset(), x.getTimezoneOffset()); -} -function isDST(janOffset, julOffset, tOffset) { - return Math.min(janOffset, julOffset) === tOffset; -} -export default DateTime; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.d.ts deleted file mode 100644 index 4b41d6be..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * DateTimeOffset functions. - * - * Note: DateOffset instances are always DateObjects in local - * timezone (because JS dates are all kinds of messed up). - * A local date returns UTC epoch when `.getTime()` is called. - * - * However, this means that in order to construct an UTC date - * from a DateOffset with offset of +5 hours, you first need - * to subtract those 5 hours, than add the "local" offset. - * As said, all kinds of messed up. - * - * Basically; invariant: date.getTime() always return UTC time. - */ -import { int64 } from "./BigInt.js"; -import { FSharpRef } from "./Types.js"; -import { IDateTime, IDateTimeOffset } from "./Util.js"; -export default function DateTimeOffset(value: number, offset?: number): IDateTimeOffset; -export declare function offset(value: IDateTimeOffset): number; -export declare function fromDate(date: IDateTime, offset?: number): IDateTimeOffset; -export declare function fromTicks(ticks: int64, offset: number): IDateTimeOffset; -export declare function fromUnixTimeMilliseconds(ms: int64): IDateTimeOffset; -export declare function fromUnixTimeSeconds(seconds: int64): IDateTimeOffset; -export declare function getUtcTicks(date: IDateTimeOffset): bigint; -export declare function minValue(): IDateTimeOffset; -export declare function maxValue(): IDateTimeOffset; -export declare function parse(str: string): IDateTimeOffset; -export declare function tryParse(v: string, defValue: FSharpRef): boolean; -export declare function create(year: number, month: number, day: number, h: number, m: number, s: number, ms: number, offset?: number): IDateTimeOffset; -export declare function now(): IDateTimeOffset; -export declare function utcNow(): IDateTimeOffset; -export declare function toUniversalTime(date: IDateTimeOffset): Date; -export declare function toLocalTime(date: IDateTimeOffset): Date; -export declare function timeOfDay(d: IDateTimeOffset): number; -export declare function date(d: IDateTimeOffset): IDateTime; -export declare function day(d: IDateTimeOffset): number; -export declare function hour(d: IDateTimeOffset): number; -export declare function millisecond(d: IDateTimeOffset): number; -export declare function minute(d: IDateTimeOffset): number; -export declare function month(d: IDateTimeOffset): number; -export declare function second(d: IDateTimeOffset): number; -export declare function year(d: IDateTimeOffset): number; -export declare function dayOfWeek(d: IDateTimeOffset): number; -export declare function dayOfYear(d: IDateTimeOffset): number; -export declare function add(d: IDateTimeOffset, ts: number): IDateTimeOffset; -export declare function addDays(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addHours(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addMinutes(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addSeconds(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addMilliseconds(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addTicks(d: IDateTimeOffset, v: int64): IDateTimeOffset; -export declare function addYears(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function addMonths(d: IDateTimeOffset, v: number): IDateTimeOffset; -export declare function subtract(d: IDateTimeOffset, that: Input): Output; -export declare function equals(d1: IDateTimeOffset, d2: IDateTimeOffset): boolean; -export declare function equalsExact(d1: IDateTimeOffset, d2: IDateTimeOffset): boolean; -export declare function compare(d1: IDateTimeOffset, d2: IDateTimeOffset): 0 | 1 | -1; -export declare const compareTo: typeof compare; -export declare function op_Addition(x: IDateTimeOffset, y: number): IDateTimeOffset; -export declare function op_Subtraction(x: IDateTimeOffset, y: Input): Output; -export declare function toOffset(d: IDateTimeOffset, offset: number): IDateTimeOffset; -export declare function toUnixTimeMilliseconds(d: IDateTimeOffset): int64; -export declare function toUnixTimeSeconds(d: IDateTimeOffset): int64; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.js deleted file mode 100644 index a5858109..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOffset.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * DateTimeOffset functions. - * - * Note: DateOffset instances are always DateObjects in local - * timezone (because JS dates are all kinds of messed up). - * A local date returns UTC epoch when `.getTime()` is called. - * - * However, this means that in order to construct an UTC date - * from a DateOffset with offset of +5 hours, you first need - * to subtract those 5 hours, than add the "local" offset. - * As said, all kinds of messed up. - * - * Basically; invariant: date.getTime() always return UTC time. - */ -import { fromFloat64, toFloat64 } from "./BigInt.js"; -import DateTime, { create as createDate, dateOffsetToString, daysInMonth, parseRaw, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from "./Date.js"; -import { compareDates, padWithZeros } from "./Util.js"; -export default function DateTimeOffset(value, offset) { - checkOffsetInRange(offset); - const d = new Date(value); - d.offset = offset != null ? offset : new Date().getTimezoneOffset() * -60000; - return d; -} -export function offset(value) { - return value.offset || 0; -} -function checkOffsetInRange(offset) { - if (offset != null && offset !== 0) { - if (offset % 60000 !== 0) { - throw new Error("Offset must be specified in whole minutes."); - } - if (Math.abs(offset / 3600000) > 14) { - throw new Error("Offset must be within plus or minus 14 hours."); - } - } -} -export function fromDate(date, offset) { - let offset2 = 0; - switch (date.kind) { - case 1 /* DateKind.UTC */: - if (offset != null && offset !== 0) { - throw new Error("The UTC Offset for Utc DateTime instances must be 0."); - } - offset2 = 0; - break; - case 2 /* DateKind.Local */: - offset2 = date.getTimezoneOffset() * -60000; - if (offset != null && offset !== offset2) { - throw new Error("The UTC Offset of the local dateTime parameter does not match the offset argument."); - } - break; - case 0 /* DateKind.Unspecified */: - default: - if (offset == null) { - offset2 = date.getTimezoneOffset() * -60000; - } - else { - offset2 = offset; - } - break; - } - return DateTimeOffset(date.getTime(), offset2); -} -export function fromTicks(ticks, offset) { - const ms = ticksToUnixEpochMilliseconds(ticks) - offset; - return DateTimeOffset(ms, offset); -} -export function fromUnixTimeMilliseconds(ms) { - return DateTimeOffset(toFloat64(ms), 0); -} -export function fromUnixTimeSeconds(seconds) { - return DateTimeOffset(toFloat64(seconds * 1000n), 0); -} -export function getUtcTicks(date) { - return unixEpochMillisecondsToTicks(date.getTime(), 0); -} -export function minValue() { - // This is "0001-01-01T00:00:00.000Z", actual JS min value is -8640000000000000 - return DateTimeOffset(-62135596800000, 0); -} -export function maxValue() { - // This is "9999-12-31T23:59:59.999Z", actual JS max value is 8640000000000000 - return DateTimeOffset(253402300799999, 0); -} -export function parse(str) { - const [date, offsetMatch] = parseRaw(str); - const offset = offsetMatch == null - ? date.getTimezoneOffset() * -60000 - : (offsetMatch === "Z" ? 0 : offsetMatch * 60000); - return DateTimeOffset(date.getTime(), offset); -} -export function tryParse(v, defValue) { - try { - defValue.contents = parse(v); - return true; - } - catch (_err) { - return false; - } -} -export function create(year, month, day, h, m, s, ms, offset) { - if (offset == null) { - offset = ms; - ms = 0; - } - checkOffsetInRange(offset); - let date; - if (offset === 0) { - date = new Date(Date.UTC(year, month - 1, day, h, m, s, ms)); - if (year <= 99) { - date.setUTCFullYear(year, month - 1, day); - } - } - else { - const str = padWithZeros(year, 4) + "-" + - padWithZeros(month, 2) + "-" + - padWithZeros(day, 2) + "T" + - padWithZeros(h, 2) + ":" + - padWithZeros(m, 2) + ":" + - padWithZeros(s, 2) + "." + - padWithZeros(ms, 3) + - dateOffsetToString(offset); - date = new Date(str); - } - const dateValue = date.getTime(); - if (isNaN(dateValue)) { - throw new Error("The parameters describe an unrepresentable Date"); - } - return DateTimeOffset(dateValue, offset); -} -export function now() { - const date = new Date(); - const offset = date.getTimezoneOffset() * -60000; - return DateTimeOffset(date.getTime(), offset); -} -export function utcNow() { - const date = now(); - return DateTimeOffset(date.getTime(), 0); -} -export function toUniversalTime(date) { - return DateTime(date.getTime(), 1 /* DateKind.UTC */); -} -export function toLocalTime(date) { - return DateTime(date.getTime(), 2 /* DateKind.Local */); -} -export function timeOfDay(d) { - const d2 = new Date(d.getTime() + (d.offset ?? 0)); - return d2.getUTCHours() * 3600000 - + d2.getUTCMinutes() * 60000 - + d2.getUTCSeconds() * 1000 - + d2.getUTCMilliseconds(); -} -export function date(d) { - const d2 = new Date(d.getTime() + (d.offset ?? 0)); - return createDate(d2.getUTCFullYear(), d2.getUTCMonth() + 1, d2.getUTCDate(), 0, 0, 0, 0); -} -export function day(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCDate(); -} -export function hour(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCHours(); -} -export function millisecond(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCMilliseconds(); -} -export function minute(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCMinutes(); -} -export function month(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCMonth() + 1; -} -export function second(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCSeconds(); -} -export function year(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCFullYear(); -} -export function dayOfWeek(d) { - return new Date(d.getTime() + (d.offset ?? 0)).getUTCDay(); -} -export function dayOfYear(d) { - const d2 = new Date(d.getTime() + (d.offset ?? 0)); - const _year = d2.getUTCFullYear(); - const _month = d2.getUTCMonth() + 1; - let _day = d2.getUTCDate(); - for (let i = 1; i < _month; i++) { - _day += daysInMonth(_year, i); - } - return _day; -} -export function add(d, ts) { - return DateTimeOffset(d.getTime() + ts, (d.offset ?? 0)); -} -export function addDays(d, v) { - return add(d, v * 86400000); -} -export function addHours(d, v) { - return add(d, v * 3600000); -} -export function addMinutes(d, v) { - return add(d, v * 60000); -} -export function addSeconds(d, v) { - return add(d, v * 1000); -} -export function addMilliseconds(d, v) { - return add(d, v); -} -export function addTicks(d, v) { - return add(d, toFloat64(v / 10000n)); -} -export function addYears(d, v) { - const newMonth = d.getUTCMonth() + 1; - const newYear = d.getUTCFullYear() + v; - const _daysInMonth = daysInMonth(newYear, newMonth); - const newDay = Math.min(_daysInMonth, d.getUTCDate()); - return create(newYear, newMonth, newDay, d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds(), (d.offset ?? 0)); -} -export function addMonths(d, v) { - const d2 = new Date(d.getTime() + (d.offset ?? 0)); - let newMonth = d2.getUTCMonth() + 1 + v; - let newMonth_ = 0; - let yearOffset = 0; - if (newMonth > 12) { - newMonth_ = newMonth % 12; - yearOffset = Math.floor(newMonth / 12); - newMonth = newMonth_; - } - else if (newMonth < 1) { - newMonth_ = 12 + newMonth % 12; - yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0); - newMonth = newMonth_; - } - const newYear = d2.getUTCFullYear() + yearOffset; - const _daysInMonth = daysInMonth(newYear, newMonth); - const newDay = Math.min(_daysInMonth, d2.getUTCDate()); - return create(newYear, newMonth, newDay, d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds(), (d.offset ?? 0)); -} -export function subtract(d, that) { - return typeof that === "number" - ? DateTimeOffset(d.getTime() - that, (d.offset ?? 0)) - : d.getTime() - that.getTime(); -} -export function equals(d1, d2) { - return d1.getTime() === d2.getTime(); -} -export function equalsExact(d1, d2) { - return d1.getTime() === d2.getTime() && d1.offset === d2.offset; -} -export function compare(d1, d2) { - return compareDates(d1, d2); -} -export const compareTo = compare; -export function op_Addition(x, y) { - return add(x, y); -} -export function op_Subtraction(x, y) { - return subtract(x, y); -} -export function toOffset(d, offset) { - return DateTimeOffset(d.getTime(), offset); -} -export function toUnixTimeMilliseconds(d) { - return fromFloat64(d.getTime()); -} -export function toUnixTimeSeconds(d) { - return fromFloat64(d.getTime() / 1000.0); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.d.ts deleted file mode 100644 index ace68d01..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { FSharpRef } from "./Types.js"; -import { IDateTime, DateKind } from "./Util.js"; -export declare function fromUnixMilliseconds(value: number): IDateTime; -export declare function create(year: number, month: number, day: number): IDateTime; -export declare function maxValue(): IDateTime; -export declare function minValue(): IDateTime; -export declare function dayNumber(d: IDateTime): number; -export declare function fromDayNumber(dayNumber: number): IDateTime; -export declare function fromDateTime(d: IDateTime): IDateTime; -export declare function day(d: IDateTime): number; -export declare function month(d: IDateTime): number; -export declare function year(d: IDateTime): number; -export declare function dayOfWeek(d: IDateTime): number; -export declare function dayOfYear(d: IDateTime): number; -export declare function toDateTime(d: IDateTime, time: number, kind?: DateKind): IDateTime; -export declare function toString(d: IDateTime, format?: string, _provider?: any): string; -export declare function parse(str: string): IDateTime; -export declare function tryParse(v: string, defValue: FSharpRef): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.js deleted file mode 100644 index dbb4de91..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/DateOnly.js +++ /dev/null @@ -1,124 +0,0 @@ -import { DateTime, getTicks, dayOfYear as Date_dayOfYear, year as Date_year, month as Date_month, day as Date_day, daysInMonth as Date_daysInMonth, ticksToUnixEpochMilliseconds } from "./Date.js"; -import { padWithZeros } from "./Util.js"; -export function fromUnixMilliseconds(value) { - return DateTime(value, 1 /* DateKind.UTC */); -} -export function create(year, month, day) { - const d = fromUnixMilliseconds(Date.UTC(year, month - 1, day)); - if (year <= 99) { - d.setUTCFullYear(year); - } - return d; -} -export function maxValue() { - // This is "9999-12-31T00:00:00.000Z" - return fromUnixMilliseconds(253402214400000); -} -export function minValue() { - // This is "0001-01-01T00:00:00.000Z" - return fromUnixMilliseconds(-62135596800000); -} -export function dayNumber(d) { - return Number((getTicks(d) / 864000000000n)); -} -export function fromDayNumber(dayNumber) { - const ticks = 864000000000n * BigInt(dayNumber); - return fromUnixMilliseconds(ticksToUnixEpochMilliseconds(ticks)); -} -export function fromDateTime(d) { - return create(Date_year(d), Date_month(d), Date_day(d)); -} -export function day(d) { - return d.getUTCDate(); -} -export function month(d) { - return d.getUTCMonth() + 1; -} -export function year(d) { - return d.getUTCFullYear(); -} -export function dayOfWeek(d) { - return d.getUTCDay(); -} -export function dayOfYear(d) { - return Date_dayOfYear(d); -} -export function toDateTime(d, time, kind = 0 /* DateKind.Unspecified */) { - return DateTime(d.getTime() + time + (kind !== 1 /* DateKind.UTC */ ? d.getTimezoneOffset() : 0) * 60000, kind); -} -export function toString(d, format = "d", _provider) { - if (["d", "o", "O"].indexOf(format) === -1) { - throw new Error("Custom formats are not supported"); - } - const y = padWithZeros(year(d), 4); - const m = padWithZeros(month(d), 2); - const dd = padWithZeros(day(d), 2); - return format === "d" ? `${m}/${dd}/${y}` : `${y}-${m}-${dd}`; -} -export function parse(str) { - function fail() { - throw new Error(`String '${str}' was not recognized as a valid DateOnly.`); - } - // Allowed separators: . , / - - // TODO whitespace alone as the separator - // - // Whitespace around separators - // - // Allowed format types: - // yyyy/mm/dd - // mm/dd/yyyy - // mm/dd - // mm/yyyy - // yyyy/mm - const r = /^\s*(\d{1,4})(?:\s*[.,-\/]\s*(\d{1,2}))?\s*[.,-\/]\s*(\d{1,4})\s*$/.exec(str); - if (r != null) { - let y = 0; - let m = 0; - let d = 1; - if (r[2] == null) { - if (r[1].length < 3) { - if (r[3].length < 3) { - // 12/30 = December 30, {CurrentYear} - y = new Date().getFullYear(); - m = +r[1]; - d = +r[3]; - } - else { - // 12/2000 = December 1, 2000 - m = +r[1]; - y = +r[3]; - } - } - else { - if (r[3].length > 2) - fail(); - // 2000/12 = December 1, 2000 - y = +r[1]; - m = +r[3]; - } - } - else { - // 2000/1/30 or 1/30/2000 - const yearFirst = r[1].length > 2; - const yTmp = r[yearFirst ? 1 : 3]; - y = +yTmp; - // year 0-29 is 2000-2029, 30-99 is 1930-1999 - if (yTmp.length < 3) - y += y >= 30 ? 1900 : 2000; - m = +r[yearFirst ? 2 : 1]; - d = +r[yearFirst ? 3 : 2]; - } - if (y > 0 && m > 0 && m < 13 && d > 0 && d <= Date_daysInMonth(y, m)) - return create(y, m, d); - } - return fail(); -} -export function tryParse(v, defValue) { - try { - defValue.contents = parse(v); - return true; - } - catch { - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.d.ts deleted file mode 100644 index 83d7a010..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import Decimal from "./lib/big.js"; -import { FSharpRef } from "./Types.js"; -export default Decimal; -export type decimal = Decimal; -export declare const get_Zero: Decimal; -export declare const get_One: Decimal; -export declare const get_MinusOne: Decimal; -export declare const get_MaxValue: Decimal; -export declare const get_MinValue: Decimal; -export declare function compare(x: Decimal, y: Decimal): import("./lib/big.js").Comparison; -export declare function equals(x: Decimal, y: Decimal): boolean; -export declare function abs(x: Decimal): Decimal; -export declare function sign(x: Decimal): number; -export declare function max(x: Decimal, y: Decimal): Decimal; -export declare function min(x: Decimal, y: Decimal): Decimal; -export declare function maxMagnitude(x: Decimal, y: Decimal): Decimal; -export declare function minMagnitude(x: Decimal, y: Decimal): Decimal; -export declare function clamp(x: Decimal, min: Decimal, max: Decimal): Decimal; -export declare function round(x: Decimal, digits?: number): Decimal; -export declare function truncate(x: Decimal): Decimal; -export declare function ceiling(x: Decimal): Decimal; -export declare function floor(x: Decimal): Decimal; -export declare function pow(x: Decimal, n: number): Decimal; -export declare function sqrt(x: Decimal): Decimal; -export declare function op_Addition(x: Decimal, y: Decimal): Decimal; -export declare function op_Subtraction(x: Decimal, y: Decimal): Decimal; -export declare function op_Multiply(x: Decimal, y: Decimal): Decimal; -export declare function op_Division(x: Decimal, y: Decimal): Decimal; -export declare function op_Modulus(x: Decimal, y: Decimal): Decimal; -export declare function op_UnaryNegation(x: Decimal): Decimal; -export declare function op_UnaryPlus(x: Decimal): Decimal; -export declare const add: typeof op_Addition; -export declare const subtract: typeof op_Subtraction; -export declare const multiply: typeof op_Multiply; -export declare const divide: typeof op_Division; -export declare const remainder: typeof op_Modulus; -export declare const negate: typeof op_UnaryNegation; -export declare function toString(x: Decimal): string; -export declare function tryParse(str: string, defValue: FSharpRef): boolean; -export declare function parse(str: string): Decimal; -export declare function toNumber(x: Decimal): number; -export declare function fromIntArray(bits: ArrayLike): Decimal; -export declare function fromInts(low: number, mid: number, high: number, signExp: number): Decimal; -export declare function fromParts(low: number, mid: number, high: number, isNegative: boolean, scale: number): Decimal; -export declare function getBits(d: Decimal): number[]; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.js deleted file mode 100644 index 574ab17b..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Decimal.js +++ /dev/null @@ -1,212 +0,0 @@ -import Decimal from "./lib/big.js"; -import { symbol } from "./Numeric.js"; -import { FSharpRef } from "./Types.js"; -import { combineHashCodes } from "./Util.js"; -Decimal.prototype.GetHashCode = function () { - return combineHashCodes([this.s, this.e].concat(this.c)); -}; -Decimal.prototype.Equals = function (x) { - return !this.cmp(x); -}; -Decimal.prototype.CompareTo = function (x) { - return this.cmp(x); -}; -Decimal.prototype[symbol] = function () { - const _this = this; - return { - multiply: (y) => _this.mul(y), - toPrecision: (sd) => _this.toPrecision(sd), - toExponential: (dp) => _this.toExponential(dp), - toFixed: (dp) => _this.toFixed(dp), - toHex: () => (Number(_this) >>> 0).toString(16), - }; -}; -export default Decimal; -export const get_Zero = new Decimal(0); -export const get_One = new Decimal(1); -export const get_MinusOne = new Decimal(-1); -export const get_MaxValue = new Decimal("79228162514264337593543950335"); -export const get_MinValue = new Decimal("-79228162514264337593543950335"); -export function compare(x, y) { - return x.cmp(y); -} -export function equals(x, y) { - return !x.cmp(y); -} -export function abs(x) { return x.abs(); } -export function sign(x) { return x < get_Zero ? -1 : x > get_Zero ? 1 : 0; } -export function max(x, y) { return x > y ? x : y; } -export function min(x, y) { return x < y ? x : y; } -export function maxMagnitude(x, y) { return abs(x) > abs(y) ? x : y; } -export function minMagnitude(x, y) { return abs(x) < abs(y) ? x : y; } -export function clamp(x, min, max) { - return x < min ? min : x > max ? max : x; -} -export function round(x, digits = 0) { - return x.round(digits, 2 /* ROUND_HALF_EVEN */); -} -export function truncate(x) { - return x.round(0, 0 /* ROUND_DOWN */); -} -export function ceiling(x) { - return x.round(0, x.cmp(0) >= 0 ? 3 /* ROUND_UP */ : 0 /* ROUND_DOWN */); -} -export function floor(x) { - return x.round(0, x.cmp(0) >= 0 ? 0 /* ROUND_DOWN */ : 3 /* ROUND_UP */); -} -export function pow(x, n) { - return x.pow(n); -} -export function sqrt(x) { - return x.sqrt(); -} -export function op_Addition(x, y) { - return x.add(y); -} -export function op_Subtraction(x, y) { - return x.sub(y); -} -export function op_Multiply(x, y) { - return x.mul(y); -} -export function op_Division(x, y) { - return x.div(y); -} -export function op_Modulus(x, y) { - return x.mod(y); -} -export function op_UnaryNegation(x) { - const x2 = new Decimal(x); - x2.s = -x2.s || 0; - return x2; -} -export function op_UnaryPlus(x) { - return x; -} -export const add = op_Addition; -export const subtract = op_Subtraction; -export const multiply = op_Multiply; -export const divide = op_Division; -export const remainder = op_Modulus; -export const negate = op_UnaryNegation; -export function toString(x) { - return x.toString(); -} -export function tryParse(str, defValue) { - try { - defValue.contents = new Decimal(str.trim()); - return true; - } - catch { - return false; - } -} -export function parse(str) { - const defValue = new FSharpRef(get_Zero); - if (tryParse(str, defValue)) { - return defValue.contents; - } - else { - throw new Error(`The input string ${str} was not in a correct format.`); - } -} -export function toNumber(x) { - return +x; -} -function decimalToHex(dec, bitSize) { - const hex = new Uint8Array(bitSize / 4 | 0); - let hexCount = 1; - for (let d = 0; d < dec.length; d++) { - let value = dec[d]; - for (let i = 0; i < hexCount; i++) { - const digit = hex[i] * 10 + value | 0; - hex[i] = digit & 0xF; - value = digit >> 4; - } - if (value !== 0) { - hex[hexCount++] = value; - } - } - return hex.slice(0, hexCount); // digits in reverse order -} -function hexToDecimal(hex, bitSize) { - const dec = new Uint8Array(bitSize * 301 / 1000 + 1 | 0); - let decCount = 1; - for (let d = hex.length - 1; d >= 0; d--) { - let carry = hex[d]; - for (let i = 0; i < decCount; i++) { - const val = dec[i] * 16 + carry | 0; - dec[i] = (val % 10) | 0; - carry = (val / 10) | 0; - } - while (carry > 0) { - dec[decCount++] = (carry % 10) | 0; - carry = (carry / 10) | 0; - } - } - return dec.slice(0, decCount); // digits in reverse order -} -function setInt32Bits(hexDigits, bits, offset) { - for (let i = 0; i < 8; i++) { - hexDigits[offset + i] = (bits >> (i * 4)) & 0xF; - } -} -function getInt32Bits(hexDigits, offset) { - let bits = 0; - for (let i = 0; i < 8; i++) { - bits = bits | (hexDigits[offset + i] << (i * 4)); - } - return bits; -} -export function fromIntArray(bits) { - return fromInts(bits[0], bits[1], bits[2], bits[3]); -} -export function fromInts(low, mid, high, signExp) { - const isNegative = signExp < 0; - const scale = (signExp >> 16) & 0x7F; - return fromParts(low, mid, high, isNegative, scale); -} -export function fromParts(low, mid, high, isNegative, scale) { - const bitSize = 96; - const hexDigits = new Uint8Array(bitSize / 4); - setInt32Bits(hexDigits, low, 0); - setInt32Bits(hexDigits, mid, 8); - setInt32Bits(hexDigits, high, 16); - const decDigits = hexToDecimal(hexDigits, bitSize); - scale = scale & 0x7F; - const big = new Decimal(0); - big.c = Array.from(decDigits.reverse()); - big.e = decDigits.length - scale - 1; - big.s = isNegative ? -1 : 1; - const d = new Decimal(big); - return d; -} -export function getBits(d) { - const bitSize = 96; - const decDigits = Uint8Array.from(d.c); - const hexDigits = decimalToHex(decDigits, bitSize); - const low = getInt32Bits(hexDigits, 0); - const mid = getInt32Bits(hexDigits, 8); - const high = getInt32Bits(hexDigits, 16); - const decStr = d.toString(); - const dotPos = decStr.indexOf("."); - const scale = dotPos < 0 ? 0 : decStr.length - dotPos - 1; - const signExp = ((scale & 0x7F) << 16) | (d.s < 0 ? 0x80000000 : 0); - return [low, mid, high, signExp]; -} -// export function makeRangeStepFunction(step: Decimal, last: Decimal) { -// const stepComparedWithZero = step.cmp(get_Zero); -// if (stepComparedWithZero === 0) { -// throw new Error("The step of a range cannot be zero"); -// } -// const stepGreaterThanZero = stepComparedWithZero > 0; -// return (x: Decimal) => { -// const comparedWithLast = x.cmp(last); -// if ((stepGreaterThanZero && comparedWithLast <= 0) -// || (!stepGreaterThanZero && comparedWithLast >= 0)) { -// return [x, op_Addition(x, step)]; -// } else { -// return undefined; -// } -// }; -// } diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.d.ts deleted file mode 100644 index 8c8e2ba1..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export declare function tryParse(str: string, defValue: FSharpRef): boolean; -export declare function parse(str: string): number; -export declare function isPositiveInfinity(x: number): boolean; -export declare function isNegativeInfinity(x: number): boolean; -export declare function isInfinity(x: number): boolean; -export declare function max(x: number, y: number): number; -export declare function min(x: number, y: number): number; -export declare function maxMagnitude(x: number, y: number): number; -export declare function minMagnitude(x: number, y: number): number; -export declare function clamp(x: number, min: number, max: number): number; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.js deleted file mode 100644 index cae9486c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Double.js +++ /dev/null @@ -1,46 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export function tryParse(str, defValue) { - // TODO: test if value is valid and in range - if (str != null && /\S/.test(str)) { - const v = +str.replace("_", ""); - if (!Number.isNaN(v)) { - defValue.contents = v; - return true; - } - } - return false; -} -export function parse(str) { - const defValue = new FSharpRef(0); - if (tryParse(str, defValue)) { - return defValue.contents; - } - else { - throw new Error(`The input string ${str} was not in a correct format.`); - } -} -// JS Number.isFinite function evals false for NaN -export function isPositiveInfinity(x) { - return x === Number.POSITIVE_INFINITY; -} -export function isNegativeInfinity(x) { - return x === Number.NEGATIVE_INFINITY; -} -export function isInfinity(x) { - return x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY; -} -export function max(x, y) { - return x > y ? x : y; -} -export function min(x, y) { - return x < y ? x : y; -} -export function maxMagnitude(x, y) { - return Math.abs(x) > Math.abs(y) ? x : y; -} -export function minMagnitude(x, y) { - return Math.abs(x) < Math.abs(y) ? x : y; -} -export function clamp(x, min, max) { - return x < min ? min : x > max ? max : x; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.d.ts deleted file mode 100644 index 3804844f..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { uint8 } from "./Int32.js"; -declare class UTF16LE { - getBytes(str: string | string[], index?: number, count?: number): Uint8Array; - getString(bytes: ArrayLike, index?: number, count?: number): string; -} -declare class UTF8 { - getBytes(str: string | string[], index?: number, count?: number): Uint8Array; - getString(bytes: ArrayLike, index?: number, count?: number): string; -} -export declare function get_Unicode(): UTF16LE; -export declare function get_UTF8(): UTF8; -export {}; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.js deleted file mode 100644 index e9cdbf56..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Encoding.js +++ /dev/null @@ -1,173 +0,0 @@ -const littleEndian = true; -function utf16le_encode(str) { - const bytes = new Uint8Array(str.length * 2); - const view = new DataView(bytes.buffer); - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - view.setUint16(i * 2, code, littleEndian); - } - return bytes; -} -function utf16le_decode(bytes) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - const view = new DataView(array.buffer, array.byteOffset, array.byteLength); - const chars = new Array(view.byteLength / 2); - for (let i = 0; i < chars.length; i++) { - const code = view.getUint16(i * 2, littleEndian); - chars[i] = String.fromCharCode(code); - } - return chars.join(""); -} -function utf8_encode(str) { - let pos = 0; - let buf = new Uint8Array(str.length * 3); - for (let i = 0; i < str.length; i++) { - let code = str.charCodeAt(i); - if (code >= 0xD800 && code <= 0xDBFF) { - const nextCode = (i < str.length) ? str.charCodeAt(i + 1) : 0; - if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { - i += 1; - code = (code - 0xD800) * 0x400 + nextCode - 0xDC00 + 0x10000; - if (code > 0xFFFF) { - buf[pos++] = (0x1E << 3) | (code >>> 18); - buf[pos++] = (0x2 << 6) | ((code >>> 12) & 0x3F); - buf[pos++] = (0x2 << 6) | ((code >>> 6) & 0x3F); - buf[pos++] = (0x2 << 6) | (code & 0x3F); - } - } - else { - buf[pos++] = 0xEF; - buf[pos++] = 0xBF; - buf[pos++] = 0xBD; - } - } - else if (code <= 0x007F) { - buf[pos++] = (0x0 << 7) | code; - } - else if (code <= 0x07FF) { - buf[pos++] = (0x6 << 5) | (code >>> 6); - buf[pos++] = (0x2 << 6) | (code & 0x3F); - } - else { - buf[pos++] = (0xE << 4) | (code >>> 12); - buf[pos++] = (0x2 << 6) | ((code >>> 6) & 0x3F); - buf[pos++] = (0x2 << 6) | (code & 0x3F); - } - } - buf = new Uint8Array(buf.buffer.slice(0, pos)); - return buf; -} -function utf8_decode(bytes) { - let pos = 0; - const decodeUtf8 = () => { - const i1 = bytes[pos++]; - if ((i1 & 0x80) === 0) { - return i1; - } - else if ((i1 & 0xE0) === 0xC0) { - const i2 = bytes[pos++]; - return ((i1 & 0x1F) << 6) | (i2 & 0x3F); - } - else if ((i1 & 0xF0) === 0xE0) { - const i2 = bytes[pos++]; - const i3 = bytes[pos++]; - return ((i1 & 0x0F) << 12) | ((i2 & 0x3F) << 6) | (i3 & 0x3F); - } - else if ((i1 & 0xF8) === 0xF0) { - const i2 = bytes[pos++]; - const i3 = bytes[pos++]; - const i4 = bytes[pos++]; - return ((i1 & 0x07) << 18) | ((i2 & 0x3F) << 12) | ((i3 & 0x3F) << 6) | (i4 & 0x3F); - } - else { - throw new RangeError("Invalid UTF8 byte: " + i1); - } - }; - const chars = new Array(); - while (pos < bytes.length) { - const code = decodeUtf8(); - chars.push(String.fromCodePoint(code)); - } - return chars.join(""); -} -class UTF16LE { - getBytes(str, index, count) { - str = Array.isArray(str) ? str.join("") : str; - if (index != null && count != null) { - str = str.substring(index, index + count); - } - else if (index != null) { - str = str.substring(index); - } - if (typeof Buffer !== "undefined") { - const bytes = Buffer.from(str, "utf16le"); - return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - } - else { - return utf16le_encode(str); // polyfill - } - } - getString(bytes, index, count) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); - if (index != null && count != null) { - buffer = buffer.subarray(index, index + count); - } - else if (index != null) { - buffer = buffer.subarray(index); - } - if (typeof TextDecoder !== "undefined") { - return new TextDecoder("utf-16le").decode(buffer); - } - else if (typeof Buffer !== "undefined") { - return Buffer.from(buffer).toString("utf16le"); - } - else { - return utf16le_decode(buffer); // polyfill - } - } -} -class UTF8 { - getBytes(str, index, count) { - str = Array.isArray(str) ? str.join("") : str; - if (index != null && count != null) { - str = str.substring(index, index + count); - } - else if (index != null) { - str = str.substring(index); - } - if (typeof TextEncoder !== "undefined") { - return new TextEncoder().encode(str); - } - else if (typeof Buffer !== "undefined") { - const bytes = Buffer.from(str, "utf8"); - return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - } - else { - return utf8_encode(str); // polyfill - } - } - getString(bytes, index, count) { - const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes); - let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); - if (index != null && count != null) { - buffer = buffer.subarray(index, index + count); - } - else if (index != null) { - buffer = buffer.subarray(index); - } - if (typeof TextDecoder !== "undefined") { - return new TextDecoder().decode(buffer); - } - else if (typeof Buffer !== "undefined") { - return Buffer.from(buffer).toString("utf8"); - } - else { - return utf8_decode(buffer); // polyfill - } - } -} -const _UTF16 = new UTF16LE(); -const _UTF8 = new UTF8(); -export function get_Unicode() { return _UTF16; } -export function get_UTF8() { return _UTF8; } diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.d.ts deleted file mode 100644 index 4610faa9..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IObservable } from "./Observable.js"; -import { Option } from "./Option.js"; -import { FSharpChoice$2_$union } from "./Choice.js"; -export type Handler = (sender: any, x: T) => void; -export interface IDelegateEvent { - AddHandler(d: Delegate): void; - RemoveHandler(d: Delegate): void; -} -export interface IEvent$2 extends IDelegateEvent, IObservable { -} -export type IEvent = IEvent$2, T>; -export declare class Event$2 { - private delegates; - private _add; - private _remove; - get Publish(): IEvent$2; - Trigger(value: Args): void; - Trigger(sender: any, value: Args): void; -} -export declare class Event extends Event$2, T> { -} -export declare function add(callback: (x: T) => void, sourceEvent: IEvent$2): void; -export declare function choose(chooser: (x: T) => Option, sourceEvent: IEvent$2): IEvent; -export declare function filter(predicate: (x: T) => boolean, sourceEvent: IEvent$2): IEvent; -export declare function map(mapping: (x: T) => U, sourceEvent: IEvent$2): IEvent; -export declare function merge(event1: IEvent$2, event2: IEvent$2): IEvent; -export declare function pairwise(sourceEvent: IEvent$2): IEvent<[T, T]>; -export declare function partition(predicate: (x: T) => boolean, sourceEvent: IEvent$2): [IEvent, IEvent]; -export declare function scan(collector: (u: U, t: T) => U, state: U, sourceEvent: IEvent$2): IEvent; -export declare function split(splitter: (x: T) => FSharpChoice$2_$union, sourceEvent: IEvent$2): [IEvent, IEvent]; -export declare function createEvent(addHandler: (h: Del) => void, removeHandler: (h: Del) => void): IEvent$2; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.js deleted file mode 100644 index 0a813495..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Event.js +++ /dev/null @@ -1,93 +0,0 @@ -import { subscribe } from "./Observable.js"; -import { some, value } from "./Option.js"; -import { Choice_tryValueIfChoice1Of2, Choice_tryValueIfChoice2Of2 } from "./Choice.js"; -export class Event$2 { - constructor() { - this.delegates = []; - } - _add(d) { - this.delegates.push(d); - } - _remove(d) { - const index = this.delegates.indexOf(d); - if (index > -1) { - this.delegates.splice(index, 1); - } - } - get Publish() { - return createEvent(h => { this._add(h); }, h => { this._remove(h); }); - } - Trigger(senderOrValue, valueOrUndefined) { - let sender = null; - const value = valueOrUndefined === undefined ? senderOrValue : (sender = senderOrValue, valueOrUndefined); - this.delegates.forEach(f => { f(sender, value); }); - } -} -export class Event extends Event$2 { -} -export function add(callback, sourceEvent) { - subscribe(callback, sourceEvent); -} -export function choose(chooser, sourceEvent) { - const ev = new Event(); - add((t) => { - const u = chooser(t); - if (u != null) { - ev.Trigger(value(u)); - } - }, sourceEvent); - return ev.Publish; -} -export function filter(predicate, sourceEvent) { - return choose((x) => predicate(x) ? some(x) : undefined, sourceEvent); -} -export function map(mapping, sourceEvent) { - const ev = new Event(); - add((t) => ev.Trigger(mapping(t)), sourceEvent); - return ev.Publish; -} -export function merge(event1, event2) { - const ev = new Event(); - const fn = (x) => ev.Trigger(x); - add(fn, event1); - add(fn, event2); - return ev.Publish; -} -export function pairwise(sourceEvent) { - const ev = new Event(); - let last; - let haveLast = false; - add((next) => { - if (haveLast) { - ev.Trigger([last, next]); - } - last = next; - haveLast = true; - }, sourceEvent); - return ev.Publish; -} -export function partition(predicate, sourceEvent) { - return [filter(predicate, sourceEvent), filter((x) => !predicate(x), sourceEvent)]; -} -export function scan(collector, state, sourceEvent) { - return map((t) => state = collector(state, t), sourceEvent); -} -export function split(splitter, sourceEvent) { - return [ - choose((v) => Choice_tryValueIfChoice1Of2(splitter(v)), sourceEvent), - choose((v) => Choice_tryValueIfChoice2Of2(splitter(v)), sourceEvent), - ]; -} -export function createEvent(addHandler, removeHandler) { - return { - AddHandler(h) { addHandler(h); }, - RemoveHandler(h) { removeHandler(h); }, - Subscribe(r) { - const h = ((_, args) => r.OnNext(args)); - addHandler(h); - return { - Dispose() { removeHandler(h); } - }; - } - }; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.d.ts deleted file mode 100644 index 8a571eab..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { int32 } from "./Int32.js"; -import { IComparer, IEqualityComparer } from "./Util.js"; -export declare function HashIdentity_FromFunctions(hash: ((arg0: T) => int32), eq: ((arg0: T, arg1: T) => boolean)): IEqualityComparer; -export declare function HashIdentity_Structural(): IEqualityComparer; -export declare function HashIdentity_Reference(): IEqualityComparer; -export declare function ComparisonIdentity_FromFunction(comparer: ((arg0: T, arg1: T) => int32)): IComparer; -export declare function ComparisonIdentity_Structural(): IComparer; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.js deleted file mode 100644 index 900f5372..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Collections.js +++ /dev/null @@ -1,27 +0,0 @@ -import { compare, physicalHash, equals, structuralHash } from "./Util.js"; -export function HashIdentity_FromFunctions(hash, eq) { - return { - Equals(x, y) { - return eq(x, y); - }, - GetHashCode(x_1) { - return hash(x_1); - }, - }; -} -export function HashIdentity_Structural() { - return HashIdentity_FromFunctions(structuralHash, equals); -} -export function HashIdentity_Reference() { - return HashIdentity_FromFunctions(physicalHash, (e, e_1) => (e === e_1)); -} -export function ComparisonIdentity_FromFunction(comparer) { - return { - Compare(x, y) { - return comparer(x, y); - }, - }; -} -export function ComparisonIdentity_Structural() { - return ComparisonIdentity_FromFunction(compare); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.d.ts deleted file mode 100644 index 1c347714..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IDisposable, IEqualityComparer, IComparer } from "./Util.js"; -import { Option } from "./Option.js"; -import { StringBuilder } from "./System.Text.js"; -export declare const LanguagePrimitives_GenericEqualityComparer: any; -export declare const LanguagePrimitives_GenericEqualityERComparer: any; -export declare function LanguagePrimitives_FastGenericComparer(): IComparer; -export declare function LanguagePrimitives_FastGenericComparerFromTable(): IComparer; -export declare function LanguagePrimitives_FastGenericEqualityComparer(): IEqualityComparer; -export declare function LanguagePrimitives_FastGenericEqualityComparerFromTable(): IEqualityComparer; -export declare function Operators_Failure(message: string): Error; -export declare function Operators_FailurePattern(exn: Error): Option; -export declare function Operators_NullArg<$a>(x: string): $a; -export declare function Operators_Using(resource: T, action: ((arg0: T) => R)): R; -export declare function Operators_Lock<$a, $b>(_lockObj: $a, action: (() => $b)): $b; -export declare function ExtraTopLevelOperators_LazyPattern<$a>(input: any): $a; -export declare function PrintfModule_PrintFormatToStringBuilderThen<$a, $b>(continuation: (() => $a), builder: StringBuilder, format: any): $b; -export declare function PrintfModule_PrintFormatToStringBuilder<$a>(builder: StringBuilder, format: any): $a; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.js deleted file mode 100644 index 5a8f53b3..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/FSharp.Core.js +++ /dev/null @@ -1,69 +0,0 @@ -import { disposeSafe, defaultOf, structuralHash, equals } from "./Util.js"; -import { HashIdentity_Structural, ComparisonIdentity_Structural } from "./FSharp.Collections.js"; -import { StringBuilder__Append_Z721C83C5 } from "./System.Text.js"; -export const LanguagePrimitives_GenericEqualityComparer = { - "System.Collections.IEqualityComparer.Equals541DA560"(x, y) { - return equals(x, y); - }, - "System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) { - return structuralHash(x_1); - }, -}; -export const LanguagePrimitives_GenericEqualityERComparer = { - "System.Collections.IEqualityComparer.Equals541DA560"(x, y) { - return equals(x, y); - }, - "System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) { - return structuralHash(x_1); - }, -}; -export function LanguagePrimitives_FastGenericComparer() { - return ComparisonIdentity_Structural(); -} -export function LanguagePrimitives_FastGenericComparerFromTable() { - return ComparisonIdentity_Structural(); -} -export function LanguagePrimitives_FastGenericEqualityComparer() { - return HashIdentity_Structural(); -} -export function LanguagePrimitives_FastGenericEqualityComparerFromTable() { - return HashIdentity_Structural(); -} -export function Operators_Failure(message) { - return new Error(message); -} -export function Operators_FailurePattern(exn) { - return exn.message; -} -export function Operators_NullArg(x) { - throw new Error(x); -} -export function Operators_Using(resource, action) { - try { - return action(resource); - } - finally { - if (equals(resource, defaultOf())) { - } - else { - let copyOfStruct = resource; - disposeSafe(copyOfStruct); - } - } -} -export function Operators_Lock(_lockObj, action) { - return action(); -} -export function ExtraTopLevelOperators_LazyPattern(input) { - return input.Value; -} -export function PrintfModule_PrintFormatToStringBuilderThen(continuation, builder, format) { - return format.cont((s) => { - StringBuilder__Append_Z721C83C5(builder, s); - return continuation(); - }); -} -export function PrintfModule_PrintFormatToStringBuilder(builder, format) { - return PrintfModule_PrintFormatToStringBuilderThen(() => { - }, builder, format); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.d.ts deleted file mode 100644 index 304c0d67..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { int32 } from "./Int32.js"; -export interface Fable_Core_IGenericAdder$1 { - Add(arg0: T, arg1: T): T; - GetZero(): T; -} -export interface Fable_Core_IGenericAverager$1 { - Add(arg0: T, arg1: T): T; - DivideByInt(arg0: T, arg1: int32): T; - GetZero(): T; -} -export interface Fable_Core_Symbol_wellknown { - [Symbol.toStringTag]: string; -} -export interface Fable_Core_IJsonSerializable { - toJSON(): any; -} -export declare const SR_indexOutOfBounds = "The index was outside the range of elements in the collection."; -export declare const SR_inputWasEmpty = "Collection was empty."; -export declare const SR_inputMustBeNonNegative = "The input must be non-negative."; -export declare const SR_inputSequenceEmpty = "The input sequence was empty."; -export declare const SR_inputSequenceTooLong = "The input sequence contains more than one element."; -export declare const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection."; -export declare const SR_differentLengths = "The collections had different lengths."; -export declare const SR_notEnoughElements = "The input sequence has an insufficient number of elements."; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.js deleted file mode 100644 index 330c7c2c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Global.js +++ /dev/null @@ -1,8 +0,0 @@ -export const SR_indexOutOfBounds = "The index was outside the range of elements in the collection."; -export const SR_inputWasEmpty = "Collection was empty."; -export const SR_inputMustBeNonNegative = "The input must be non-negative."; -export const SR_inputSequenceEmpty = "The input sequence was empty."; -export const SR_inputSequenceTooLong = "The input sequence contains more than one element."; -export const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection."; -export const SR_differentLengths = "The collections had different lengths."; -export const SR_notEnoughElements = "The input sequence has an insufficient number of elements."; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.d.ts deleted file mode 100644 index a80e2d5f..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export declare function toString(str: string, format?: string, _provider?: any): string; -/** Validates UUID as specified in RFC4122 (versions 1-5). */ -export declare function parse(str: string): string; -export declare function tryParse(str: string, defValue: FSharpRef): boolean; -export declare function newGuid(): string; -/** Parse a UUID into it's component bytes */ -export declare function guidToArray(s: string): number[]; -/** Convert UUID byte array into a string */ -export declare function arrayToGuid(buf: ArrayLike): string; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.js deleted file mode 100644 index 7c818433..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Guid.js +++ /dev/null @@ -1,142 +0,0 @@ -import { trim } from "./String.js"; -// RFC 4122 compliant. From https://stackoverflow.com/a/13653180/3922220 -// 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}$/; -// Relax GUID parsing, see #1637 -const 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}$/; -const guidRegexNoHyphen = /^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/; -const guidRegexHex = /^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/; -const 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})$/; -export function toString(str, format, _provider) { - if (format && format?.length > 0) { - switch (format) { - case "N": - return str.replace(/-/g, ''); - case "D": - return str; - case "B": - return "{" + str + "}"; - case "P": - return "(" + str + ")"; - case "X": - 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}}"); - default: - throw new Error("Unrecognized Guid print format"); - } - } - else { - return str; - } -} -/** Validates UUID as specified in RFC4122 (versions 1-5). */ -export function parse(str) { - function hyphenateGuid(str) { - return str.replace(guidRegexNoHyphen, "$1-$2-$3-$4-$5"); - } - const wsTrimAndLowered = str.trim().toLowerCase(); - if (guidRegex.test(wsTrimAndLowered)) { - return trim(wsTrimAndLowered, "{", "}", "(", ")"); - } - else if (guidRegexNoHyphen.test(wsTrimAndLowered)) { - return hyphenateGuid(wsTrimAndLowered); - } - else if (guidRegexHex.test(wsTrimAndLowered)) { - return hyphenateGuid(wsTrimAndLowered.replace(/[\{\},]|0x/g, '')); - } - else { - throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"); - } -} -export function tryParse(str, defValue) { - try { - defValue.contents = parse(str); - return true; - } - catch { - return false; - } -} -// From https://gist.github.com/LeverOne/1308368 -export function newGuid() { - let b = ""; - for (let a = 0; a++ < 36;) { - b += a * 51 & 52 - ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16) - : "-"; - } - return b; -} -// Maps for number <-> hex string conversion -let _convertMapsInitialized = false; -let _byteToHex; -let _hexToByte; -function initConvertMaps() { - _byteToHex = new Array(256); - _hexToByte = {}; - for (let i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - _convertMapsInitialized = true; -} -/** Parse a UUID into it's component bytes */ -// Adapted from https://github.com/zefferus/uuid-parse -export function guidToArray(s) { - if (!_convertMapsInitialized) { - initConvertMaps(); - } - let i = 0; - const buf = new Uint8Array(16); - s.toLowerCase().replace(/[0-9a-f]{2}/g, ((oct) => { - switch (i) { - // .NET saves first three byte groups with different endianness - // See https://stackoverflow.com/a/16722909/3922220 - case 0: - case 1: - case 2: - case 3: - buf[3 - i++] = _hexToByte[oct]; - break; - case 4: - case 5: - buf[9 - i++] = _hexToByte[oct]; - break; - case 6: - case 7: - buf[13 - i++] = _hexToByte[oct]; - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - buf[i++] = _hexToByte[oct]; - break; - } - })); - // Zero out remaining bytes if string was short - while (i < 16) { - buf[i++] = 0; - } - return buf; -} -/** Convert UUID byte array into a string */ -export function arrayToGuid(buf) { - if (buf.length !== 16) { - throw new Error("Byte array for GUID must be exactly 16 bytes long"); - } - if (!_convertMapsInitialized) { - initConvertMaps(); - } - const guid = _byteToHex[buf[3]] + _byteToHex[buf[2]] + - _byteToHex[buf[1]] + _byteToHex[buf[0]] + "-" + - _byteToHex[buf[5]] + _byteToHex[buf[4]] + "-" + - _byteToHex[buf[7]] + _byteToHex[buf[6]] + "-" + - _byteToHex[buf[8]] + _byteToHex[buf[9]] + "-" + - _byteToHex[buf[10]] + _byteToHex[buf[11]] + - _byteToHex[buf[12]] + _byteToHex[buf[13]] + - _byteToHex[buf[14]] + _byteToHex[buf[15]]; - return guid; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.d.ts deleted file mode 100644 index 02d3ad1e..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export type int8 = number; -export type uint8 = number; -export type int16 = number; -export type uint16 = number; -export type int32 = number; -export type uint32 = number; -export type float16 = number; -export type float32 = number; -export type float64 = number; -export declare enum NumberStyles { - AllowHexSpecifier = 512 -} -export declare function getPrefix(radix: number): string; -export declare function getRadix(prefix: string, style: number): 2 | 8 | 16 | 10; -export declare function isValid(str: string, style: number, radix?: number): { - sign: string; - prefix: string; - digits: string; - radix: number; -} | null; -export declare function parse(str: string, style: number, unsigned: boolean, bitsize: number, radix?: number): number; -export declare function tryParse(str: string, style: number, unsigned: boolean, bitsize: number, defValue: FSharpRef): boolean; -export declare function op_UnaryNegation_Int8(x: number): number; -export declare function op_UnaryNegation_Int16(x: number): number; -export declare function op_UnaryNegation_Int32(x: number): number; -export declare function divRem(x: number, y: number): [number, number]; -export declare function divRem(x: number, y: number, out: FSharpRef): number; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.js deleted file mode 100644 index adb19761..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Int32.js +++ /dev/null @@ -1,135 +0,0 @@ -export var NumberStyles; -(function (NumberStyles) { - // None = 0x00000000, - // AllowLeadingWhite = 0x00000001, - // AllowTrailingWhite = 0x00000002, - // AllowLeadingSign = 0x00000004, - // AllowTrailingSign = 0x00000008, - // AllowParentheses = 0x00000010, - // AllowDecimalPoint = 0x00000020, - // AllowThousands = 0x00000040, - // AllowExponent = 0x00000080, - // AllowCurrencySymbol = 0x00000100, - NumberStyles[NumberStyles["AllowHexSpecifier"] = 512] = "AllowHexSpecifier"; - // Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign, - // HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier, - // Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | - // AllowTrailingSign | AllowDecimalPoint | AllowThousands, - // Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | - // AllowDecimalPoint | AllowExponent, - // Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | - // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol, - // Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | - // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol | AllowExponent, -})(NumberStyles || (NumberStyles = {})); -function validResponse(regexMatch, radix) { - const [/*all*/ , sign, prefix, digits] = regexMatch; - return { - sign: sign || "", - prefix: prefix || "", - digits, - radix, - }; -} -function getRange(unsigned, bitsize) { - switch (bitsize) { - case 8: return unsigned ? [0, 255] : [-128, 127]; - case 16: return unsigned ? [0, 65535] : [-32768, 32767]; - case 32: return unsigned ? [0, 4294967295] : [-2147483648, 2147483647]; - default: throw new Error("Invalid bit size."); - } -} -function getInvalidDigits(radix) { - switch (radix) { - case 2: return /[^0-1]/; - case 8: return /[^0-7]/; - case 10: return /[^0-9]/; - case 16: return /[^0-9a-fA-F]/; - default: - throw new Error("Invalid Base."); - } -} -export function getPrefix(radix) { - switch (radix) { - case 2: return "0b"; - case 8: return "0o"; - case 10: return ""; - case 16: return "0x"; - default: return ""; - } -} -export function getRadix(prefix, style) { - if (style & NumberStyles.AllowHexSpecifier) { - return 16; - } - else { - switch (prefix) { - case "0b": - case "0B": return 2; - case "0o": - case "0O": return 8; - case "0x": - case "0X": return 16; - default: return 10; - } - } -} -export function isValid(str, style, radix) { - const integerRegex = /^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/; - const res = integerRegex.exec(str.replace(/_/g, "")); - if (res != null) { - const [/*all*/ , /*sign*/ , prefix, digits] = res; - radix = radix || getRadix(prefix, style); - const invalidDigits = getInvalidDigits(radix); - if (!invalidDigits.test(digits)) { - return validResponse(res, radix); - } - } - return null; -} -export function parse(str, style, unsigned, bitsize, radix) { - const res = isValid(str, style, radix); - if (res != null) { - let v = Number.parseInt(res.sign + res.digits, res.radix); - if (!Number.isNaN(v)) { - const [umin, umax] = getRange(true, bitsize); - if (!unsigned && res.radix !== 10 && v >= umin && v <= umax) { - v = v << (32 - bitsize) >> (32 - bitsize); - } - const [min, max] = getRange(unsigned, bitsize); - if (v >= min && v <= max) { - return v; - } - } - } - throw new Error(`The input string ${str} was not in a correct format.`); -} -export function tryParse(str, style, unsigned, bitsize, defValue) { - try { - defValue.contents = parse(str, style, unsigned, bitsize); - return true; - } - catch { - return false; - } -} -export function op_UnaryNegation_Int8(x) { - return x === -128 ? x : -x; -} -export function op_UnaryNegation_Int16(x) { - return x === -32768 ? x : -x; -} -export function op_UnaryNegation_Int32(x) { - return x === -2147483648 ? x : -x; -} -export function divRem(x, y, out) { - const div = ~~(x / y); - const rem = x % y; - if (out === void 0) { - return [div, rem]; - } - else { - out.contents = rem; - return div; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.d.ts deleted file mode 100644 index ba3988a1..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Option } from "./Option.js"; -import { IComparer, IEqualityComparer, IDisposable, IEnumerator } from "./Util.js"; -import { int32 } from "./Int32.js"; -import { Record } from "./Types.js"; -import { TypeInfo } from "./Reflection.js"; -export declare class FSharpList extends Record implements Iterable { - readonly head: T; - tail: Option>; - constructor(head: T, tail: Option>); - toString(): string; - Equals(other: any): boolean; - GetHashCode(): int32; - toJSON(): any; - CompareTo(other: any): int32; - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare function FSharpList_$reflection(gen0: TypeInfo): TypeInfo; -export declare class ListEnumerator$1 implements IEnumerator, IDisposable { - readonly xs: FSharpList; - it: FSharpList; - current: T; - constructor(xs: FSharpList); - "System.Collections.Generic.IEnumerator`1.get_Current"(): T; - "System.Collections.IEnumerator.get_Current"(): any; - "System.Collections.IEnumerator.MoveNext"(): boolean; - "System.Collections.IEnumerator.Reset"(): void; - Dispose(): void; -} -export declare function ListEnumerator$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function ListEnumerator$1_$ctor_3002E699(xs: FSharpList): ListEnumerator$1; -export declare function FSharpList_get_Empty(): FSharpList; -export declare function FSharpList_Cons_305B8EAC(x: T, xs: FSharpList): FSharpList; -export declare function FSharpList__get_IsEmpty(xs: FSharpList): boolean; -export declare function FSharpList__get_Length(xs: FSharpList): int32; -export declare function FSharpList__get_Head(xs: FSharpList): T; -export declare function FSharpList__get_Tail(xs: FSharpList): FSharpList; -export declare function FSharpList__get_Item_Z524259A4(xs: FSharpList, index: int32): T; -export declare function indexNotFound<$a>(): $a; -export declare function empty<$a>(): FSharpList<$a>; -export declare function cons(x: T, xs: FSharpList): FSharpList; -export declare function singleton<$a>(x: $a): FSharpList<$a>; -export declare function isEmpty(xs: FSharpList): boolean; -export declare function length(xs: FSharpList): int32; -export declare function head(xs: FSharpList): T; -export declare function tryHead(xs: FSharpList): Option; -export declare function tail(xs: FSharpList): FSharpList; -export declare function tryLast(xs_mut: FSharpList): Option; -export declare function last(xs: FSharpList): T; -export declare function compareWith(comparer: ((arg0: T, arg1: T) => int32), xs: FSharpList, ys: FSharpList): int32; -export declare function toArray(xs: FSharpList): T[]; -export declare function fold(folder: ((arg0: State, arg1: T) => State), state: State, xs: FSharpList): State; -export declare function reverse(xs: FSharpList): FSharpList; -export declare function foldBack(folder: ((arg0: T, arg1: State) => State), xs: FSharpList, state: State): State; -export declare function foldIndexed(folder: ((arg0: int32, arg1: State, arg2: T) => State), state: State, xs: FSharpList): State; -export declare function fold2(folder: ((arg0: State, arg1: T1, arg2: T2) => State), state: State, xs: FSharpList, ys: FSharpList): State; -export declare function foldBack2(folder: ((arg0: T1, arg1: T2, arg2: State) => State), xs: FSharpList, ys: FSharpList, state: State): State; -export declare function unfold(gen: ((arg0: State) => Option<[T, State]>), state: State): FSharpList; -export declare function iterate<$a>(action: ((arg0: $a) => void), xs: FSharpList<$a>): void; -export declare function iterate2<$a, $b>(action: ((arg0: $a, arg1: $b) => void), xs: FSharpList<$a>, ys: FSharpList<$b>): void; -export declare function iterateIndexed<$a>(action: ((arg0: int32, arg1: $a) => void), xs: FSharpList<$a>): void; -export declare function iterateIndexed2<$a, $b>(action: ((arg0: int32, arg1: $a, arg2: $b) => void), xs: FSharpList<$a>, ys: FSharpList<$b>): void; -export declare function toSeq(xs: FSharpList): Iterable; -export declare function ofArrayWithTail(xs: T[], tail_1: FSharpList): FSharpList; -export declare function ofArray(xs: T[]): FSharpList; -export declare function ofSeq(xs: Iterable): FSharpList; -export declare function concat(lists: Iterable>): FSharpList; -export declare function scan(folder: ((arg0: State, arg1: T) => State), state: State, xs: FSharpList): FSharpList; -export declare function scanBack(folder: ((arg0: T, arg1: State) => State), xs: FSharpList, state: State): FSharpList; -export declare function append(xs: FSharpList, ys: FSharpList): FSharpList; -export declare function collect(mapping: ((arg0: T) => FSharpList), xs: FSharpList): FSharpList; -export declare function mapIndexed(mapping: ((arg0: int32, arg1: T) => U), xs: FSharpList): FSharpList; -export declare function map(mapping: ((arg0: T) => U), xs: FSharpList): FSharpList; -export declare function indexed<$a>(xs: FSharpList<$a>): FSharpList<[int32, $a]>; -export declare function map2(mapping: ((arg0: T1, arg1: T2) => U), xs: FSharpList, ys: FSharpList): FSharpList; -export declare function mapIndexed2(mapping: ((arg0: int32, arg1: T1, arg2: T2) => U), xs: FSharpList, ys: FSharpList): FSharpList; -export declare function map3(mapping: ((arg0: T1, arg1: T2, arg2: T3) => U), xs: FSharpList, ys: FSharpList, zs: FSharpList): FSharpList; -export declare function mapFold(mapping: ((arg0: State, arg1: T) => [Result, State]), state: State, xs: FSharpList): [FSharpList, State]; -export declare function mapFoldBack(mapping: ((arg0: T, arg1: State) => [Result, State]), xs: FSharpList, state: State): [FSharpList, State]; -export declare function tryPick(f: ((arg0: T) => Option<$a>), xs: FSharpList): Option<$a>; -export declare function pick<$a, $b>(f: ((arg0: $a) => Option<$b>), xs: FSharpList<$a>): $b; -export declare function tryFind<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option<$a>; -export declare function find<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): $a; -export declare function tryFindBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option<$a>; -export declare function findBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): $a; -export declare function tryFindIndex(f: ((arg0: T) => boolean), xs: FSharpList): Option; -export declare function findIndex<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): int32; -export declare function tryFindIndexBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option; -export declare function findIndexBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): int32; -export declare function tryItem(n: int32, xs: FSharpList): Option; -export declare function item(n: int32, xs: FSharpList): T; -export declare function filter(f: ((arg0: T) => boolean), xs: FSharpList): FSharpList; -export declare function partition(f: ((arg0: T) => boolean), xs: FSharpList): [FSharpList, FSharpList]; -export declare function choose(f: ((arg0: T) => Option), xs: FSharpList): FSharpList; -export declare function contains(value: T, xs: FSharpList, eq: IEqualityComparer): boolean; -export declare function initialize(n: int32, f: ((arg0: int32) => T)): FSharpList; -export declare function replicate<$a>(n: int32, x: $a): FSharpList<$a>; -export declare function reduce(f: ((arg0: T, arg1: T) => T), xs: FSharpList): T; -export declare function reduceBack(f: ((arg0: T, arg1: T) => T), xs: FSharpList): T; -export declare function forAll<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): boolean; -export declare function forAll2<$a, $b>(f: ((arg0: $a, arg1: $b) => boolean), xs: FSharpList<$a>, ys: FSharpList<$b>): boolean; -export declare function exists<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): boolean; -export declare function exists2(f_mut: ((arg0: T1, arg1: T2) => boolean), xs_mut: FSharpList, ys_mut: FSharpList): boolean; -export declare function unzip<$a, $b>(xs: FSharpList<[$a, $b]>): [FSharpList<$a>, FSharpList<$b>]; -export declare function unzip3<$a, $b, $c>(xs: FSharpList<[$a, $b, $c]>): [FSharpList<$a>, FSharpList<$b>, FSharpList<$c>]; -export declare function zip<$a, $b>(xs: FSharpList<$a>, ys: FSharpList<$b>): FSharpList<[$a, $b]>; -export declare function zip3<$a, $b, $c>(xs: FSharpList<$a>, ys: FSharpList<$b>, zs: FSharpList<$c>): FSharpList<[$a, $b, $c]>; -export declare function sortWith(comparer: ((arg0: T, arg1: T) => int32), xs: FSharpList): FSharpList; -export declare function sort(xs: FSharpList, comparer: IComparer): FSharpList; -export declare function sortBy(projection: ((arg0: T) => U), xs: FSharpList, comparer: IComparer): FSharpList; -export declare function sortDescending(xs: FSharpList, comparer: IComparer): FSharpList; -export declare function sortByDescending(projection: ((arg0: T) => U), xs: FSharpList, comparer: IComparer): FSharpList; -export declare function sum(xs: FSharpList, adder: any): T; -export declare function sumBy(f: ((arg0: T) => U), xs: FSharpList, adder: any): U; -export declare function maxBy(projection: ((arg0: T) => U), xs: FSharpList, comparer: IComparer): T; -export declare function max(xs: FSharpList, comparer: IComparer): T; -export declare function minBy(projection: ((arg0: T) => U), xs: FSharpList, comparer: IComparer): T; -export declare function min(xs: FSharpList, comparer: IComparer): T; -export declare function average(xs: FSharpList, averager: any): T; -export declare function averageBy(f: ((arg0: T) => U), xs: FSharpList, averager: any): U; -export declare function permute(f: ((arg0: int32) => int32), xs: FSharpList): FSharpList; -export declare function chunkBySize(chunkSize: int32, xs: FSharpList): FSharpList>; -export declare function allPairs(xs: FSharpList, ys: FSharpList): FSharpList<[T1, T2]>; -export declare function skip(count_mut: int32, xs_mut: FSharpList): FSharpList; -export declare function skipWhile(predicate_mut: ((arg0: T) => boolean), xs_mut: FSharpList): FSharpList; -export declare function take(count: int32, xs: FSharpList): FSharpList; -export declare function takeWhile(predicate: ((arg0: T) => boolean), xs: FSharpList): FSharpList; -export declare function truncate(count: int32, xs: FSharpList): FSharpList; -export declare function getSlice(startIndex: Option, endIndex: Option, xs: FSharpList): FSharpList; -export declare function splitAt(index: int32, xs: FSharpList): [FSharpList, FSharpList]; -export declare function exactlyOne(xs: FSharpList): T; -export declare function tryExactlyOne(xs: FSharpList): Option; -export declare function where(predicate: ((arg0: T) => boolean), xs: FSharpList): FSharpList; -export declare function pairwise(xs: FSharpList): FSharpList<[T, T]>; -export declare function windowed(windowSize: int32, xs: FSharpList): FSharpList>; -export declare function splitInto(chunks: int32, xs: FSharpList): FSharpList>; -export declare function transpose(lists: Iterable>): FSharpList>; -export declare function insertAt(index: int32, y: T, xs: FSharpList): FSharpList; -export declare function insertManyAt(index: int32, ys: Iterable, xs: FSharpList): FSharpList; -export declare function removeAt(index: int32, xs: FSharpList): FSharpList; -export declare function removeManyAt(index: int32, count: int32, xs: FSharpList): FSharpList; -export declare function updateAt(index: int32, y: T, xs: FSharpList): FSharpList; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.js deleted file mode 100644 index b845283e..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/List.js +++ /dev/null @@ -1,1273 +0,0 @@ -import { join } from "./String.js"; -import { defaultArg, some, value as value_1 } from "./Option.js"; -import { disposeSafe, isArrayLike, defaultOf, toIterator, getEnumerator, compare, structuralHash, equals } from "./Util.js"; -import { Record } from "./Types.js"; -import { class_type, record_type, option_type } from "./Reflection.js"; -import { SR_inputSequenceTooLong, SR_inputSequenceEmpty, SR_inputMustBeNonNegative, SR_notEnoughElements, SR_differentLengths, SR_keyNotFoundAlt, SR_indexOutOfBounds, SR_inputWasEmpty } from "./Global.js"; -import { 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"; -export class FSharpList extends Record { - constructor(head, tail) { - super(); - this.head = head; - this.tail = tail; - } - toString() { - const xs = this; - return ("[" + join("; ", xs)) + "]"; - } - Equals(other) { - const xs = this; - if (xs === other) { - return true; - } - else { - const loop = (xs_1_mut, ys_1_mut) => { - loop: while (true) { - const xs_1 = xs_1_mut, ys_1 = ys_1_mut; - const matchValue = xs_1.tail; - const matchValue_1 = ys_1.tail; - if (matchValue != null) { - if (matchValue_1 != null) { - const xt = value_1(matchValue); - const yt = value_1(matchValue_1); - if (equals(xs_1.head, ys_1.head)) { - xs_1_mut = xt; - ys_1_mut = yt; - continue loop; - } - else { - return false; - } - } - else { - return false; - } - } - else if (matchValue_1 != null) { - return false; - } - else { - return true; - } - break; - } - }; - return loop(xs, other); - } - } - GetHashCode() { - const xs = this; - const loop = (i_mut, h_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, h = h_mut, xs_1 = xs_1_mut; - const matchValue = xs_1.tail; - if (matchValue != null) { - const t = value_1(matchValue); - if (i > 18) { - return h | 0; - } - else { - i_mut = (i + 1); - h_mut = (((h << 1) + structuralHash(xs_1.head)) + (631 * i)); - xs_1_mut = t; - continue loop; - } - } - else { - return h | 0; - } - break; - } - }; - return loop(0, 0, xs) | 0; - } - toJSON() { - const this$ = this; - return Array.from(this$); - } - CompareTo(other) { - const xs = this; - const loop = (xs_1_mut, ys_1_mut) => { - loop: while (true) { - const xs_1 = xs_1_mut, ys_1 = ys_1_mut; - const matchValue = xs_1.tail; - const matchValue_1 = ys_1.tail; - if (matchValue != null) { - if (matchValue_1 != null) { - const xt = value_1(matchValue); - const yt = value_1(matchValue_1); - const c = compare(xs_1.head, ys_1.head) | 0; - if (c === 0) { - xs_1_mut = xt; - ys_1_mut = yt; - continue loop; - } - else { - return c | 0; - } - } - else { - return 1; - } - } - else if (matchValue_1 != null) { - return -1; - } - else { - return 0; - } - break; - } - }; - return loop(xs, other) | 0; - } - GetEnumerator() { - const xs = this; - return ListEnumerator$1_$ctor_3002E699(xs); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const xs = this; - return getEnumerator(xs); - } -} -export function FSharpList_$reflection(gen0) { - return record_type("ListModule.FSharpList", [gen0], FSharpList, () => [["head", gen0], ["tail", option_type(FSharpList_$reflection(gen0))]]); -} -export class ListEnumerator$1 { - constructor(xs) { - this.xs = xs; - this.it = this.xs; - this.current = defaultOf(); - } - "System.Collections.Generic.IEnumerator`1.get_Current"() { - const _ = this; - return _.current; - } - "System.Collections.IEnumerator.get_Current"() { - const _ = this; - return _.current; - } - "System.Collections.IEnumerator.MoveNext"() { - const _ = this; - const matchValue = _.it.tail; - if (matchValue != null) { - const t = value_1(matchValue); - _.current = _.it.head; - _.it = t; - return true; - } - else { - return false; - } - } - "System.Collections.IEnumerator.Reset"() { - const _ = this; - _.it = _.xs; - _.current = defaultOf(); - } - Dispose() { - } -} -export function ListEnumerator$1_$reflection(gen0) { - return class_type("ListModule.ListEnumerator`1", [gen0], ListEnumerator$1); -} -export function ListEnumerator$1_$ctor_3002E699(xs) { - return new ListEnumerator$1(xs); -} -export function FSharpList_get_Empty() { - return new FSharpList(defaultOf(), void 0); -} -export function FSharpList_Cons_305B8EAC(x, xs) { - return new FSharpList(x, xs); -} -export function FSharpList__get_IsEmpty(xs) { - return xs.tail == null; -} -export function FSharpList__get_Length(xs) { - const loop = (i_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, xs_1 = xs_1_mut; - const matchValue = xs_1.tail; - if (matchValue != null) { - i_mut = (i + 1); - xs_1_mut = value_1(matchValue); - continue loop; - } - else { - return i | 0; - } - break; - } - }; - return loop(0, xs) | 0; -} -export function FSharpList__get_Head(xs) { - const matchValue = xs.tail; - if (matchValue != null) { - return xs.head; - } - else { - throw new Error((SR_inputWasEmpty + "\\nParameter name: ") + "list"); - } -} -export function FSharpList__get_Tail(xs) { - const matchValue = xs.tail; - if (matchValue != null) { - return value_1(matchValue); - } - else { - throw new Error((SR_inputWasEmpty + "\\nParameter name: ") + "list"); - } -} -export function FSharpList__get_Item_Z524259A4(xs, index) { - const loop = (i_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, xs_1 = xs_1_mut; - const matchValue = xs_1.tail; - if (matchValue != null) { - if (i === index) { - return xs_1.head; - } - else { - i_mut = (i + 1); - xs_1_mut = value_1(matchValue); - continue loop; - } - } - else { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - break; - } - }; - return loop(0, xs); -} -export function indexNotFound() { - throw new Error(SR_keyNotFoundAlt); -} -export function empty() { - return FSharpList_get_Empty(); -} -export function cons(x, xs) { - return FSharpList_Cons_305B8EAC(x, xs); -} -export function singleton(x) { - return FSharpList_Cons_305B8EAC(x, FSharpList_get_Empty()); -} -export function isEmpty(xs) { - return FSharpList__get_IsEmpty(xs); -} -export function length(xs) { - return FSharpList__get_Length(xs); -} -export function head(xs) { - return FSharpList__get_Head(xs); -} -export function tryHead(xs) { - if (FSharpList__get_IsEmpty(xs)) { - return void 0; - } - else { - return some(FSharpList__get_Head(xs)); - } -} -export function tail(xs) { - return FSharpList__get_Tail(xs); -} -export function tryLast(xs_mut) { - tryLast: while (true) { - const xs = xs_mut; - if (FSharpList__get_IsEmpty(xs)) { - return void 0; - } - else { - const t = FSharpList__get_Tail(xs); - if (FSharpList__get_IsEmpty(t)) { - return some(FSharpList__get_Head(xs)); - } - else { - xs_mut = t; - continue tryLast; - } - } - break; - } -} -export function last(xs) { - const matchValue = tryLast(xs); - if (matchValue == null) { - throw new Error(SR_inputWasEmpty); - } - else { - return value_1(matchValue); - } -} -export function compareWith(comparer, xs, ys) { - const loop = (xs_1_mut, ys_1_mut) => { - loop: while (true) { - const xs_1 = xs_1_mut, ys_1 = ys_1_mut; - const matchValue = FSharpList__get_IsEmpty(xs_1); - const matchValue_1 = FSharpList__get_IsEmpty(ys_1); - if (matchValue) { - if (matchValue_1) { - return 0; - } - else { - return -1; - } - } - else if (matchValue_1) { - return 1; - } - else { - const c = comparer(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)) | 0; - if (c === 0) { - xs_1_mut = FSharpList__get_Tail(xs_1); - ys_1_mut = FSharpList__get_Tail(ys_1); - continue loop; - } - else { - return c | 0; - } - } - break; - } - }; - return loop(xs, ys) | 0; -} -export function toArray(xs) { - const len = FSharpList__get_Length(xs) | 0; - const res = fill(new Array(len), 0, len, null); - const loop = (i_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, xs_1 = xs_1_mut; - if (!FSharpList__get_IsEmpty(xs_1)) { - res[i] = FSharpList__get_Head(xs_1); - i_mut = (i + 1); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - loop(0, xs); - return res; -} -export function fold(folder, state, xs) { - let acc = state; - let xs_1 = xs; - while (!FSharpList__get_IsEmpty(xs_1)) { - acc = folder(acc, head(xs_1)); - xs_1 = FSharpList__get_Tail(xs_1); - } - return acc; -} -export function reverse(xs) { - return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), FSharpList_get_Empty(), xs); -} -export function foldBack(folder, xs, state) { - return foldBack_1(folder, toArray(xs), state); -} -export function foldIndexed(folder, state, xs) { - const loop = (i_mut, acc_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut; - if (FSharpList__get_IsEmpty(xs_1)) { - return acc; - } - else { - i_mut = (i + 1); - acc_mut = folder(i, acc, FSharpList__get_Head(xs_1)); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - return loop(0, state, xs); -} -export function fold2(folder, state, xs, ys) { - let acc = state; - let xs_1 = xs; - let ys_1 = ys; - while (!FSharpList__get_IsEmpty(xs_1) && !FSharpList__get_IsEmpty(ys_1)) { - acc = folder(acc, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)); - xs_1 = FSharpList__get_Tail(xs_1); - ys_1 = FSharpList__get_Tail(ys_1); - } - return acc; -} -export function foldBack2(folder, xs, ys, state) { - return foldBack2_1(folder, toArray(xs), toArray(ys), state); -} -export function unfold(gen, state) { - const loop = (acc_mut, node_mut) => { - let t; - loop: while (true) { - const acc = acc_mut, node = node_mut; - const matchValue = gen(acc); - if (matchValue != null) { - acc_mut = value_1(matchValue)[1]; - node_mut = ((t = (new FSharpList(value_1(matchValue)[0], void 0)), (node.tail = t, t))); - continue loop; - } - else { - return node; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node_1 = loop(state, root); - const t_2 = FSharpList_get_Empty(); - node_1.tail = t_2; - return FSharpList__get_Tail(root); -} -export function iterate(action, xs) { - fold((unitVar, x) => { - action(x); - }, void 0, xs); -} -export function iterate2(action, xs, ys) { - fold2((unitVar, x, y) => { - action(x, y); - }, void 0, xs, ys); -} -export function iterateIndexed(action, xs) { - fold((i, x) => { - action(i, x); - return (i + 1) | 0; - }, 0, xs); -} -export function iterateIndexed2(action, xs, ys) { - fold2((i, x, y) => { - action(i, x, y); - return (i + 1) | 0; - }, 0, xs, ys); -} -export function toSeq(xs) { - return xs; -} -export function ofArrayWithTail(xs, tail_1) { - let res = tail_1; - for (let i = xs.length - 1; i >= 0; i--) { - res = FSharpList_Cons_305B8EAC(xs[i], res); - } - return res; -} -export function ofArray(xs) { - return ofArrayWithTail(xs, FSharpList_get_Empty()); -} -export function ofSeq(xs) { - let xs_3, t; - if (isArrayLike(xs)) { - return ofArray(xs); - } - else if (xs instanceof FSharpList) { - return xs; - } - else { - const root = FSharpList_get_Empty(); - let node = root; - const enumerator = getEnumerator(xs); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const x = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - node = ((xs_3 = node, (t = (new FSharpList(x, void 0)), (xs_3.tail = t, t)))); - } - } - finally { - disposeSafe(enumerator); - } - const xs_5 = node; - const t_2 = FSharpList_get_Empty(); - xs_5.tail = t_2; - return FSharpList__get_Tail(root); - } -} -export function concat(lists) { - const root = FSharpList_get_Empty(); - let node = root; - const action = (xs) => { - node = fold((acc, x) => { - const t = new FSharpList(x, void 0); - acc.tail = t; - return t; - }, node, xs); - }; - if (isArrayLike(lists)) { - const xs_3 = lists; - xs_3.forEach(action); - } - else if (lists instanceof FSharpList) { - iterate(action, lists); - } - else { - const enumerator = getEnumerator(lists); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - action(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - } - finally { - disposeSafe(enumerator); - } - } - const xs_6 = node; - const t_2 = FSharpList_get_Empty(); - xs_6.tail = t_2; - return FSharpList__get_Tail(root); -} -export function scan(folder, state, xs) { - let xs_4, t_2; - const root = FSharpList_get_Empty(); - let node; - const t = new FSharpList(state, void 0); - root.tail = t; - node = t; - let acc = state; - let xs_3 = xs; - while (!FSharpList__get_IsEmpty(xs_3)) { - acc = folder(acc, FSharpList__get_Head(xs_3)); - node = ((xs_4 = node, (t_2 = (new FSharpList(acc, void 0)), (xs_4.tail = t_2, t_2)))); - xs_3 = FSharpList__get_Tail(xs_3); - } - const xs_6 = node; - const t_4 = FSharpList_get_Empty(); - xs_6.tail = t_4; - return FSharpList__get_Tail(root); -} -export function scanBack(folder, xs, state) { - return ofArray(scanBack_1(folder, toArray(xs), state)); -} -export function append(xs, ys) { - return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), ys, reverse(xs)); -} -export function collect(mapping, xs) { - let xs_1, t; - const root = FSharpList_get_Empty(); - let node = root; - let ys = xs; - while (!FSharpList__get_IsEmpty(ys)) { - let zs = mapping(FSharpList__get_Head(ys)); - while (!FSharpList__get_IsEmpty(zs)) { - node = ((xs_1 = node, (t = (new FSharpList(FSharpList__get_Head(zs), void 0)), (xs_1.tail = t, t)))); - zs = FSharpList__get_Tail(zs); - } - ys = FSharpList__get_Tail(ys); - } - const xs_3 = node; - const t_2 = FSharpList_get_Empty(); - xs_3.tail = t_2; - return FSharpList__get_Tail(root); -} -export function mapIndexed(mapping, xs) { - const root = FSharpList_get_Empty(); - const node = foldIndexed((i, acc, x) => { - const t = new FSharpList(mapping(i, x), void 0); - acc.tail = t; - return t; - }, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function map(mapping, xs) { - const root = FSharpList_get_Empty(); - const node = fold((acc, x) => { - const t = new FSharpList(mapping(x), void 0); - acc.tail = t; - return t; - }, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function indexed(xs) { - return mapIndexed((i, x) => [i, x], xs); -} -export function map2(mapping, xs, ys) { - const root = FSharpList_get_Empty(); - const node = fold2((acc, x, y) => { - const t = new FSharpList(mapping(x, y), void 0); - acc.tail = t; - return t; - }, root, xs, ys); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function mapIndexed2(mapping, xs, ys) { - const loop = (i_mut, acc_mut, xs_1_mut, ys_1_mut) => { - let t; - loop: while (true) { - const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut; - if (FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) { - return acc; - } - else { - i_mut = (i + 1); - acc_mut = ((t = (new FSharpList(mapping(i, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)), void 0)), (acc.tail = t, t))); - xs_1_mut = FSharpList__get_Tail(xs_1); - ys_1_mut = FSharpList__get_Tail(ys_1); - continue loop; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node_1 = loop(0, root, xs, ys); - const t_2 = FSharpList_get_Empty(); - node_1.tail = t_2; - return FSharpList__get_Tail(root); -} -export function map3(mapping, xs, ys, zs) { - const loop = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut) => { - let t; - loop: while (true) { - const acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut, zs_1 = zs_1_mut; - if ((FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) ? true : FSharpList__get_IsEmpty(zs_1)) { - return acc; - } - else { - 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))); - xs_1_mut = FSharpList__get_Tail(xs_1); - ys_1_mut = FSharpList__get_Tail(ys_1); - zs_1_mut = FSharpList__get_Tail(zs_1); - continue loop; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node_1 = loop(root, xs, ys, zs); - const t_2 = FSharpList_get_Empty(); - node_1.tail = t_2; - return FSharpList__get_Tail(root); -} -export function mapFold(mapping, state, xs) { - const root = FSharpList_get_Empty(); - const patternInput_1 = fold((tupledArg, x) => { - let t; - const patternInput = mapping(tupledArg[1], x); - return [(t = (new FSharpList(patternInput[0], void 0)), (tupledArg[0].tail = t, t)), patternInput[1]]; - }, [root, state], xs); - const t_2 = FSharpList_get_Empty(); - patternInput_1[0].tail = t_2; - return [FSharpList__get_Tail(root), patternInput_1[1]]; -} -export function mapFoldBack(mapping, xs, state) { - return mapFold((acc, x) => mapping(x, acc), state, reverse(xs)); -} -export function tryPick(f, xs) { - const loop = (xs_1_mut) => { - loop: while (true) { - const xs_1 = xs_1_mut; - if (FSharpList__get_IsEmpty(xs_1)) { - return void 0; - } - else { - const matchValue = f(FSharpList__get_Head(xs_1)); - if (matchValue == null) { - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - else { - return matchValue; - } - } - break; - } - }; - return loop(xs); -} -export function pick(f, xs) { - const matchValue = tryPick(f, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function tryFind(f, xs) { - return tryPick((x) => (f(x) ? some(x) : void 0), xs); -} -export function find(f, xs) { - const matchValue = tryFind(f, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function tryFindBack(f, xs) { - return tryFindBack_1(f, toArray(xs)); -} -export function findBack(f, xs) { - const matchValue = tryFindBack(f, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function tryFindIndex(f, xs) { - const loop = (i_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, xs_1 = xs_1_mut; - if (FSharpList__get_IsEmpty(xs_1)) { - return void 0; - } - else if (f(FSharpList__get_Head(xs_1))) { - return i; - } - else { - i_mut = (i + 1); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - return loop(0, xs); -} -export function findIndex(f, xs) { - const matchValue = tryFindIndex(f, xs); - if (matchValue == null) { - indexNotFound(); - return -1; - } - else { - return value_1(matchValue) | 0; - } -} -export function tryFindIndexBack(f, xs) { - return tryFindIndexBack_1(f, toArray(xs)); -} -export function findIndexBack(f, xs) { - const matchValue = tryFindIndexBack(f, xs); - if (matchValue == null) { - indexNotFound(); - return -1; - } - else { - return value_1(matchValue) | 0; - } -} -export function tryItem(n, xs) { - const loop = (i_mut, xs_1_mut) => { - loop: while (true) { - const i = i_mut, xs_1 = xs_1_mut; - if (FSharpList__get_IsEmpty(xs_1)) { - return void 0; - } - else if (i === n) { - return some(FSharpList__get_Head(xs_1)); - } - else { - i_mut = (i + 1); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - return loop(0, xs); -} -export function item(n, xs) { - return FSharpList__get_Item_Z524259A4(xs, n); -} -export function filter(f, xs) { - const root = FSharpList_get_Empty(); - const node = fold((acc, x) => { - if (f(x)) { - const t = new FSharpList(x, void 0); - acc.tail = t; - return t; - } - else { - return acc; - } - }, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function partition(f, xs) { - const matchValue = FSharpList_get_Empty(); - const root2 = FSharpList_get_Empty(); - const root1 = matchValue; - const patternInput_1 = fold((tupledArg, x) => { - let t, t_2; - const lacc = tupledArg[0]; - const racc = tupledArg[1]; - if (f(x)) { - return [(t = (new FSharpList(x, void 0)), (lacc.tail = t, t)), racc]; - } - else { - return [lacc, (t_2 = (new FSharpList(x, void 0)), (racc.tail = t_2, t_2))]; - } - }, [root1, root2], xs); - const t_4 = FSharpList_get_Empty(); - patternInput_1[0].tail = t_4; - const t_5 = FSharpList_get_Empty(); - patternInput_1[1].tail = t_5; - return [FSharpList__get_Tail(root1), FSharpList__get_Tail(root2)]; -} -export function choose(f, xs) { - const root = FSharpList_get_Empty(); - const node = fold((acc, x) => { - const matchValue = f(x); - if (matchValue == null) { - return acc; - } - else { - const t = new FSharpList(value_1(matchValue), void 0); - acc.tail = t; - return t; - } - }, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function contains(value, xs, eq) { - return tryFindIndex((v) => eq.Equals(value, v), xs) != null; -} -export function initialize(n, f) { - let xs, t; - const root = FSharpList_get_Empty(); - let node = root; - for (let i = 0; i <= (n - 1); i++) { - node = ((xs = node, (t = (new FSharpList(f(i), void 0)), (xs.tail = t, t)))); - } - const xs_2 = node; - const t_2 = FSharpList_get_Empty(); - xs_2.tail = t_2; - return FSharpList__get_Tail(root); -} -export function replicate(n, x) { - return initialize(n, (_arg) => x); -} -export function reduce(f, xs) { - if (FSharpList__get_IsEmpty(xs)) { - throw new Error(SR_inputWasEmpty); - } - else { - return fold(f, head(xs), tail(xs)); - } -} -export function reduceBack(f, xs) { - if (FSharpList__get_IsEmpty(xs)) { - throw new Error(SR_inputWasEmpty); - } - else { - return foldBack(f, tail(xs), head(xs)); - } -} -export function forAll(f, xs) { - return fold((acc, x) => (acc && f(x)), true, xs); -} -export function forAll2(f, xs, ys) { - return fold2((acc, x, y) => (acc && f(x, y)), true, xs, ys); -} -export function exists(f, xs) { - return tryFindIndex(f, xs) != null; -} -export function exists2(f_mut, xs_mut, ys_mut) { - exists2: while (true) { - const f = f_mut, xs = xs_mut, ys = ys_mut; - const matchValue = FSharpList__get_IsEmpty(xs); - const matchValue_1 = FSharpList__get_IsEmpty(ys); - let matchResult; - if (matchValue) { - if (matchValue_1) { - matchResult = 0; - } - else { - matchResult = 2; - } - } - else if (matchValue_1) { - matchResult = 2; - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return false; - case 1: - if (f(FSharpList__get_Head(xs), FSharpList__get_Head(ys))) { - return true; - } - else { - f_mut = f; - xs_mut = FSharpList__get_Tail(xs); - ys_mut = FSharpList__get_Tail(ys); - continue exists2; - } - default: - throw new Error((SR_differentLengths + "\\nParameter name: ") + "list2"); - } - break; - } -} -export function unzip(xs) { - 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()]); -} -export function unzip3(xs) { - 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()]); -} -export function zip(xs, ys) { - return map2((x, y) => [x, y], xs, ys); -} -export function zip3(xs, ys, zs) { - return map3((x, y, z) => [x, y, z], xs, ys, zs); -} -export function sortWith(comparer, xs) { - const arr = toArray(xs); - arr.sort(comparer); - return ofArray(arr); -} -export function sort(xs, comparer) { - return sortWith((x, y) => comparer.Compare(x, y), xs); -} -export function sortBy(projection, xs, comparer) { - return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs); -} -export function sortDescending(xs, comparer) { - return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs); -} -export function sortByDescending(projection, xs, comparer) { - return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs); -} -export function sum(xs, adder) { - return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs); -} -export function sumBy(f, xs, adder) { - return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs); -} -export function maxBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs); -} -export function max(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs); -} -export function minBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs); -} -export function min(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs); -} -export function average(xs, averager) { - let count = 0; - const total = fold((acc, x) => { - count = ((count + 1) | 0); - return averager.Add(acc, x); - }, averager.GetZero(), xs); - return averager.DivideByInt(total, count); -} -export function averageBy(f, xs, averager) { - let count = 0; - const total = fold((acc, x) => { - count = ((count + 1) | 0); - return averager.Add(acc, f(x)); - }, averager.GetZero(), xs); - return averager.DivideByInt(total, count); -} -export function permute(f, xs) { - return ofArray(permute_1(f, toArray(xs))); -} -export function chunkBySize(chunkSize, xs) { - return ofArray(map_1(ofArray, chunkBySize_1(chunkSize, toArray(xs)))); -} -export function allPairs(xs, ys) { - const root = FSharpList_get_Empty(); - let node = root; - iterate((x) => { - iterate((y) => { - let xs_1, t; - node = ((xs_1 = node, (t = (new FSharpList([x, y], void 0)), (xs_1.tail = t, t)))); - }, ys); - }, xs); - const xs_3 = node; - const t_2 = FSharpList_get_Empty(); - xs_3.tail = t_2; - return FSharpList__get_Tail(root); -} -export function skip(count_mut, xs_mut) { - skip: while (true) { - const count = count_mut, xs = xs_mut; - if (count <= 0) { - return xs; - } - else if (FSharpList__get_IsEmpty(xs)) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "list"); - } - else { - count_mut = (count - 1); - xs_mut = FSharpList__get_Tail(xs); - continue skip; - } - break; - } -} -export function skipWhile(predicate_mut, xs_mut) { - skipWhile: while (true) { - const predicate = predicate_mut, xs = xs_mut; - if (FSharpList__get_IsEmpty(xs)) { - return xs; - } - else if (!predicate(FSharpList__get_Head(xs))) { - return xs; - } - else { - predicate_mut = predicate; - xs_mut = FSharpList__get_Tail(xs); - continue skipWhile; - } - break; - } -} -export function take(count, xs) { - if (count < 0) { - throw new Error((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count"); - } - const loop = (i_mut, acc_mut, xs_1_mut) => { - let t; - loop: while (true) { - const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut; - if (i <= 0) { - return acc; - } - else if (FSharpList__get_IsEmpty(xs_1)) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "list"); - } - else { - i_mut = (i - 1); - acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t))); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node = loop(count, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function takeWhile(predicate, xs) { - const loop = (acc_mut, xs_1_mut) => { - let t; - loop: while (true) { - const acc = acc_mut, xs_1 = xs_1_mut; - if (FSharpList__get_IsEmpty(xs_1)) { - return acc; - } - else if (!predicate(FSharpList__get_Head(xs_1))) { - return acc; - } - else { - acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t))); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node = loop(root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function truncate(count, xs) { - const loop = (i_mut, acc_mut, xs_1_mut) => { - let t; - loop: while (true) { - const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut; - if (i <= 0) { - return acc; - } - else if (FSharpList__get_IsEmpty(xs_1)) { - return acc; - } - else { - i_mut = (i - 1); - acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t))); - xs_1_mut = FSharpList__get_Tail(xs_1); - continue loop; - } - break; - } - }; - const root = FSharpList_get_Empty(); - const node = loop(count, root, xs); - const t_2 = FSharpList_get_Empty(); - node.tail = t_2; - return FSharpList__get_Tail(root); -} -export function getSlice(startIndex, endIndex, xs) { - const len = length(xs) | 0; - let startIndex_1; - const index = defaultArg(startIndex, 0) | 0; - startIndex_1 = ((index < 0) ? 0 : index); - let endIndex_1; - const index_1 = defaultArg(endIndex, len - 1) | 0; - endIndex_1 = ((index_1 >= len) ? (len - 1) : index_1); - if (endIndex_1 < startIndex_1) { - return FSharpList_get_Empty(); - } - else { - return take((endIndex_1 - startIndex_1) + 1, skip(startIndex_1, xs)); - } -} -export function splitAt(index, xs) { - if (index < 0) { - throw new Error((SR_inputMustBeNonNegative + "\\nParameter name: ") + "index"); - } - if (index > FSharpList__get_Length(xs)) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "index"); - } - return [take(index, xs), skip(index, xs)]; -} -export function exactlyOne(xs) { - if (FSharpList__get_IsEmpty(xs)) { - throw new Error((SR_inputSequenceEmpty + "\\nParameter name: ") + "list"); - } - else if (FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) { - return FSharpList__get_Head(xs); - } - else { - throw new Error((SR_inputSequenceTooLong + "\\nParameter name: ") + "list"); - } -} -export function tryExactlyOne(xs) { - if (!FSharpList__get_IsEmpty(xs) && FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) { - return some(FSharpList__get_Head(xs)); - } - else { - return void 0; - } -} -export function where(predicate, xs) { - return filter(predicate, xs); -} -export function pairwise(xs) { - return ofArray(pairwise_1(toArray(xs))); -} -export function windowed(windowSize, xs) { - return ofArray(map_1(ofArray, windowed_1(windowSize, toArray(xs)))); -} -export function splitInto(chunks, xs) { - return ofArray(map_1(ofArray, splitInto_1(chunks, toArray(xs)))); -} -export function transpose(lists) { - return ofArray(map_1(ofArray, transpose_1(map_1(toArray, Array.from(lists))))); -} -export function insertAt(index, y, xs) { - let i = -1; - let isDone = false; - const result = fold((acc, x) => { - i = ((i + 1) | 0); - if (i === index) { - isDone = true; - return FSharpList_Cons_305B8EAC(x, FSharpList_Cons_305B8EAC(y, acc)); - } - else { - return FSharpList_Cons_305B8EAC(x, acc); - } - }, FSharpList_get_Empty(), xs); - return reverse(isDone ? result : (((i + 1) === index) ? FSharpList_Cons_305B8EAC(y, result) : (() => { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - })())); -} -export function insertManyAt(index, ys, xs) { - let i = -1; - let isDone = false; - const ys_1 = ofSeq(ys); - const result = fold((acc, x) => { - i = ((i + 1) | 0); - if (i === index) { - isDone = true; - return FSharpList_Cons_305B8EAC(x, append(ys_1, acc)); - } - else { - return FSharpList_Cons_305B8EAC(x, acc); - } - }, FSharpList_get_Empty(), xs); - return reverse(isDone ? result : (((i + 1) === index) ? append(ys_1, result) : (() => { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - })())); -} -export function removeAt(index, xs) { - let i = -1; - let isDone = false; - const ys = filter((_arg) => { - i = ((i + 1) | 0); - if (i === index) { - isDone = true; - return false; - } - else { - return true; - } - }, xs); - if (!isDone) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return ys; -} -export function removeManyAt(index, count, xs) { - let i = -1; - let status = -1; - const ys = filter((_arg) => { - i = ((i + 1) | 0); - if (i === index) { - status = 0; - return false; - } - else if (i > index) { - if (i < (index + count)) { - return false; - } - else { - status = 1; - return true; - } - } - else { - return true; - } - }, xs); - const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0; - if (status_1 < 1) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + ((status_1 < 0) ? "index" : "count")); - } - return ys; -} -export function updateAt(index, y, xs) { - let isDone = false; - const ys = mapIndexed((i, x) => { - if (i === index) { - isDone = true; - return y; - } - else { - return x; - } - }, xs); - if (!isDone) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return ys; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.d.ts deleted file mode 100644 index 5f19c4d5..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export declare function parse(str: string, style: number, unsigned: boolean, _bitsize: number, radix?: number): bigint; -export declare function tryParse(str: string, style: number, unsigned: boolean, bitsize: number, defValue: FSharpRef): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.js deleted file mode 100644 index 9cd6f1aa..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Long.js +++ /dev/null @@ -1,46 +0,0 @@ -import { getPrefix, isValid } from "./Int32.js"; -import { fromString } from "./BigInt.js"; -function getMaxValue(unsigned, radix, isNegative) { - switch (radix) { - case 2: return unsigned ? - "1111111111111111111111111111111111111111111111111111111111111111" : - (isNegative ? "1000000000000000000000000000000000000000000000000000000000000000" - : "111111111111111111111111111111111111111111111111111111111111111"); - case 8: return unsigned ? - "1777777777777777777777" : - (isNegative ? "1000000000000000000000" : "777777777777777777777"); - case 10: return unsigned ? - "18446744073709551615" : - (isNegative ? "9223372036854775808" : "9223372036854775807"); - case 16: return unsigned ? - "FFFFFFFFFFFFFFFF" : - (isNegative ? "8000000000000000" : "7FFFFFFFFFFFFFFF"); - default: throw new Error("Invalid radix."); - } -} -export function parse(str, style, unsigned, _bitsize, radix) { - const res = isValid(str, style, radix); - if (res != null) { - const lessOrEqual = (x, y) => { - const len = Math.max(x.length, y.length); - return x.padStart(len, "0") <= y.padStart(len, "0"); - }; - const isNegative = res.sign === "-"; - const maxValue = getMaxValue(unsigned || res.radix !== 10, res.radix, isNegative); - if (lessOrEqual(res.digits.toUpperCase(), maxValue)) { - str = getPrefix(res.radix) + res.digits; - str = isNegative ? res.sign + str : str; - return fromString(str); - } - } - throw new Error(`The input string ${str} was not in a correct format.`); -} -export function tryParse(str, style, unsigned, bitsize, defValue) { - try { - defValue.contents = parse(str, style, unsigned, bitsize); - return true; - } - catch { - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.d.ts deleted file mode 100644 index 99051a68..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IAsync } from "./AsyncBuilder.js"; -import { Continuation } from "./AsyncBuilder.js"; -import { CancellationToken } from "./AsyncBuilder.js"; -declare class MailboxQueue { - private firstAndLast?; - add(message: Msg): void; - tryGet(): Msg | undefined; -} -export type MailboxBody = (m: MailboxProcessor) => IAsync; -export interface AsyncReplyChannel { - reply: (r: Reply) => void; -} -export declare class MailboxProcessor { - body: MailboxBody; - cancellationToken: CancellationToken; - messages: MailboxQueue; - continuation?: Continuation; - constructor(body: MailboxBody, cancellationToken?: CancellationToken); -} -export declare function startInstance($this: MailboxProcessor): void; -export declare function receive($this: MailboxProcessor): (ctx: import("./AsyncBuilder.js").IAsyncContext) => void; -export declare function post($this: MailboxProcessor, message: Msg): void; -export declare function postAndAsyncReply($this: MailboxProcessor, buildMessage: (c: AsyncReplyChannel) => Msg): (ctx: import("./AsyncBuilder.js").IAsyncContext) => void; -export declare function start(body: MailboxBody, cancellationToken?: CancellationToken): MailboxProcessor; -export default MailboxProcessor; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.js deleted file mode 100644 index 5b16ca8a..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MailboxProcessor.js +++ /dev/null @@ -1,93 +0,0 @@ -import { defaultCancellationToken } from "./Async.js"; -import { fromContinuations } from "./Async.js"; -import { startImmediate } from "./Async.js"; -class QueueCell { - constructor(message) { - this.value = message; - } -} -class MailboxQueue { - add(message) { - const itCell = new QueueCell(message); - if (this.firstAndLast) { - this.firstAndLast[1].next = itCell; - this.firstAndLast = [this.firstAndLast[0], itCell]; - } - else { - this.firstAndLast = [itCell, itCell]; - } - } - tryGet() { - if (this.firstAndLast) { - const value = this.firstAndLast[0].value; - if (this.firstAndLast[0].next) { - this.firstAndLast = [this.firstAndLast[0].next, this.firstAndLast[1]]; - } - else { - delete this.firstAndLast; - } - return value; - } - return void 0; - } -} -export class MailboxProcessor { - constructor(body, cancellationToken) { - this.body = body; - this.cancellationToken = cancellationToken || defaultCancellationToken; - this.messages = new MailboxQueue(); - } -} -function __processEvents($this) { - if ($this.continuation) { - const value = $this.messages.tryGet(); - if (value) { - const cont = $this.continuation; - delete $this.continuation; - cont(value); - } - } -} -export function startInstance($this) { - startImmediate($this.body($this), $this.cancellationToken); -} -export function receive($this) { - return fromContinuations((conts) => { - if ($this.continuation) { - throw new Error("Receive can only be called once!"); - } - $this.continuation = conts[0]; - __processEvents($this); - }); -} -export function post($this, message) { - $this.messages.add(message); - __processEvents($this); -} -export function postAndAsyncReply($this, buildMessage) { - let result; - let continuation; - function checkCompletion() { - if (result !== void 0 && continuation !== void 0) { - continuation(result); - } - } - const reply = { - reply: (res) => { - result = res; - checkCompletion(); - }, - }; - $this.messages.add(buildMessage(reply)); - __processEvents($this); - return fromContinuations((conts) => { - continuation = conts[0]; - checkCompletion(); - }); -} -export function start(body, cancellationToken) { - const mbox = new MailboxProcessor(body, cancellationToken); - startInstance(mbox); - return mbox; -} -export default MailboxProcessor; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.d.ts deleted file mode 100644 index c5988ef1..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { TypeInfo } from "./Reflection.js"; -import { Option } from "./Option.js"; -import { int32 } from "./Int32.js"; -import { IMap, IEnumerator, IComparer } from "./Util.js"; -import { FSharpList } from "./List.js"; -import { FSharpRef, Record } from "./Types.js"; -export declare class MapTreeLeaf$2 { - readonly v: Value; - readonly k: Key; - constructor(k: Key, v: Value); -} -export declare function MapTreeLeaf$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function MapTreeLeaf$2_$ctor_5BDDA1(k: Key, v: Value): MapTreeLeaf$2; -export declare function MapTreeLeaf$2__get_Key(_: MapTreeLeaf$2): Key; -export declare function MapTreeLeaf$2__get_Value(_: MapTreeLeaf$2): Value; -export declare class MapTreeNode$2 extends MapTreeLeaf$2 { - readonly right: Option>; - readonly left: Option>; - readonly h: int32; - constructor(k: Key, v: Value, left: Option>, right: Option>, h: int32); -} -export declare function MapTreeNode$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function MapTreeNode$2_$ctor_Z39DE9543(k: Key, v: Value, left: Option>, right: Option>, h: int32): MapTreeNode$2; -export declare function MapTreeNode$2__get_Left(_: MapTreeNode$2): Option>; -export declare function MapTreeNode$2__get_Right(_: MapTreeNode$2): Option>; -export declare function MapTreeNode$2__get_Height(_: MapTreeNode$2): int32; -export declare function MapTreeModule_empty(): Option>; -export declare function MapTreeModule_sizeAux(acc_mut: int32, m_mut: Option>): int32; -export declare function MapTreeModule_size<$a, $b>(x: Option>): int32; -export declare function MapTreeModule_mk(l: Option>, k: Key, v: Value, r: Option>): Option>; -export declare function MapTreeModule_rebalance(t1: Option>, k: Key, v: Value, t2: Option>): Option>; -export declare function MapTreeModule_add(comparer: IComparer, k: Key, v: Value, m: Option>): Option>; -export declare function MapTreeModule_tryFind(comparer_mut: IComparer, k_mut: Key, m_mut: Option>): Option; -export declare function MapTreeModule_find(comparer: IComparer, k: Key, m: Option>): Value; -export declare function MapTreeModule_partition1(comparer: IComparer, f: any, k: Key, v: $a, acc1: Option>, acc2: Option>): [Option>, Option>]; -export declare function MapTreeModule_partitionAux(comparer_mut: IComparer, f_mut: any, m_mut: Option>, acc__mut: Option>, acc__1_mut: Option>): [Option>, Option>]; -export declare function MapTreeModule_partition(comparer: IComparer, f: ((arg0: Key, arg1: $a) => boolean), m: Option>): [Option>, Option>]; -export declare function MapTreeModule_filter1(comparer: IComparer, f: any, k: Key, v: $a, acc: Option>): Option>; -export declare function MapTreeModule_filterAux(comparer_mut: IComparer, f_mut: any, m_mut: Option>, acc_mut: Option>): Option>; -export declare function MapTreeModule_filter(comparer: IComparer, f: ((arg0: Key, arg1: $a) => boolean), m: Option>): Option>; -export declare function MapTreeModule_spliceOutSuccessor(m: Option>): [Key, Value, Option>]; -export declare function MapTreeModule_remove(comparer: IComparer, k: Key, m: Option>): Option>; -export declare function MapTreeModule_change(comparer: IComparer, k: Key, u: ((arg0: Option) => Option), m: Option>): Option>; -export declare function MapTreeModule_mem(comparer_mut: IComparer, k_mut: Key, m_mut: Option>): boolean; -export declare function MapTreeModule_iterOpt(f_mut: any, m_mut: Option>): void; -export declare function MapTreeModule_iter<$a, $b>(f: ((arg0: $a, arg1: $b) => void), m: Option>): void; -export declare function MapTreeModule_tryPickOpt(f_mut: any, m_mut: Option>): Option<$a>; -export declare function MapTreeModule_tryPick<$a, $b, $c>(f: ((arg0: $a, arg1: $b) => Option<$c>), m: Option>): Option<$c>; -export declare function MapTreeModule_existsOpt(f_mut: any, m_mut: Option>): boolean; -export declare function MapTreeModule_exists<$a, $b>(f: ((arg0: $a, arg1: $b) => boolean), m: Option>): boolean; -export declare function MapTreeModule_forallOpt(f_mut: any, m_mut: Option>): boolean; -export declare function MapTreeModule_forall<$a, $b>(f: ((arg0: $a, arg1: $b) => boolean), m: Option>): boolean; -export declare function MapTreeModule_map(f: ((arg0: Value) => Result), m: Option>): Option>; -export declare function MapTreeModule_mapiOpt(f: any, m: Option>): Option>; -export declare function MapTreeModule_mapi<$a, $b, $c>(f: ((arg0: $a, arg1: $b) => $c), m: Option>): Option>; -export declare function MapTreeModule_foldBackOpt(f_mut: any, m_mut: Option>, x_mut: $a): $a; -export declare function MapTreeModule_foldBack<$a, $b, $c>(f: ((arg0: $a, arg1: $b, arg2: $c) => $c), m: Option>, x: $c): $c; -export declare function MapTreeModule_foldOpt<$a, Key, Value>(f_mut: any, x_mut: $a, m_mut: Option>): $a; -export declare function MapTreeModule_fold<$a, $b, $c>(f: ((arg0: $a, arg1: $b, arg2: $c) => $a), x: $a, m: Option>): $a; -export declare function MapTreeModule_foldSectionOpt(comparer: IComparer, lo: Key, hi: Key, f: any, m: Option>, x: a): a; -export declare function MapTreeModule_foldSection(comparer: IComparer, lo: Key, hi: Key, f: ((arg0: Key, arg1: $a, arg2: $b) => $b), m: Option>, x: $b): $b; -export declare function MapTreeModule_toList(m: Option>): FSharpList<[Key, Value]>; -export declare function MapTreeModule_copyToArray<$a, $b>(m: Option>, arr: [$a, $b][], i: int32): void; -export declare function MapTreeModule_toArray<$a, $b>(m: Option>): [$a, $b][]; -export declare function MapTreeModule_ofList<$a, $b>(comparer: IComparer<$a>, l: FSharpList<[$a, $b]>): Option>; -export declare function MapTreeModule_mkFromEnumerator<$a, $b>(comparer_mut: IComparer<$a>, acc_mut: Option>, e_mut: IEnumerator<[$a, $b]>): Option>; -export declare function MapTreeModule_ofArray(comparer: IComparer, arr: [Key, Value][]): Option>; -export declare function MapTreeModule_ofSeq(comparer: IComparer, c: Iterable<[Key, Value]>): Option>; -export declare class MapTreeModule_MapIterator$2 extends Record { - stack: FSharpList>>; - started: boolean; - constructor(stack: FSharpList>>, started: boolean); -} -export declare function MapTreeModule_MapIterator$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function MapTreeModule_collapseLHS(stack_mut: FSharpList>>): FSharpList>>; -export declare function MapTreeModule_mkIterator<$a, $b>(m: Option>): MapTreeModule_MapIterator$2<$a, $b>; -export declare function MapTreeModule_notStarted<$a>(): $a; -export declare function MapTreeModule_alreadyFinished<$a>(): $a; -export declare function MapTreeModule_current(i: MapTreeModule_MapIterator$2): [Key, Value]; -export declare function MapTreeModule_moveNext(i: MapTreeModule_MapIterator$2): boolean; -export declare function MapTreeModule_mkIEnumerator(m: Option>): IEnumerator<[a, b]>; -export declare function MapTreeModule_toSeq<$a, $b>(s: Option>): Iterable<[$a, $b]>; -export declare function MapTreeModule_leftmost(m_mut: Option>): [Key, Value]; -export declare function MapTreeModule_rightmost(m_mut: Option>): [Key, Value]; -export declare class FSharpMap implements IMap, Iterable<[Key, Value]>, Iterable<[Key, Value]> { - readonly tree: Option>; - readonly comparer: IComparer; - constructor(comparer: IComparer, tree: Option>); - GetHashCode(): int32; - Equals(that: any): boolean; - toString(): string; - get [Symbol.toStringTag](): string; - toJSON(): any; - GetEnumerator(): IEnumerator<[Key, Value]>; - [Symbol.iterator](): Iterator<[Key, Value]>; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; - CompareTo(obj: any): int32; - "System.Collections.Generic.ICollection`1.Add2B595"(x: [Key, Value]): void; - "System.Collections.Generic.ICollection`1.Clear"(): void; - "System.Collections.Generic.ICollection`1.Remove2B595"(x: [Key, Value]): boolean; - "System.Collections.Generic.ICollection`1.Contains2B595"(x: [Key, Value]): boolean; - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(arr: [Key, Value][], i: int32): void; - "System.Collections.Generic.ICollection`1.get_IsReadOnly"(): boolean; - "System.Collections.Generic.ICollection`1.get_Count"(): int32; - "System.Collections.Generic.IReadOnlyCollection`1.get_Count"(): int32; - get size(): int32; - clear(): void; - delete(_arg: Key): boolean; - entries(): Iterable<[Key, Value]>; - get(k: Key): Value; - has(k: Key): boolean; - keys(): Iterable; - set(k: Key, v: Value): IMap; - values(): Iterable; - forEach(f: ((arg0: Value, arg1: Key, arg2: IMap) => void), thisArg?: Option): void; -} -export declare function FSharpMap_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function FSharpMap_$ctor(comparer: IComparer, tree: Option>): FSharpMap; -export declare function FSharpMap_Empty(comparer: IComparer): FSharpMap; -export declare function FSharpMap__get_Comparer(m: FSharpMap): IComparer; -export declare function FSharpMap__get_Tree(m: FSharpMap): Option>; -export declare function FSharpMap__Add(m: FSharpMap, key: Key, value: Value): FSharpMap; -export declare function FSharpMap__Change(m: FSharpMap, key: Key, f: ((arg0: Option) => Option)): FSharpMap; -export declare function FSharpMap__get_IsEmpty(m: FSharpMap): boolean; -export declare function FSharpMap__get_Item(m: FSharpMap, key: Key): Value; -export declare function FSharpMap__TryPick(m: FSharpMap, f: ((arg0: Key, arg1: Value) => Option<$a>)): Option<$a>; -export declare function FSharpMap__Exists(m: FSharpMap, predicate: ((arg0: Key, arg1: Value) => boolean)): boolean; -export declare function FSharpMap__Filter(m: FSharpMap, predicate: ((arg0: Key, arg1: Value) => boolean)): FSharpMap; -export declare function FSharpMap__ForAll(m: FSharpMap, predicate: ((arg0: Key, arg1: Value) => boolean)): boolean; -export declare function FSharpMap__Fold(m: FSharpMap, f: ((arg0: Key, arg1: Value, arg2: $a) => $a), acc: $a): $a; -export declare function FSharpMap__FoldSection(m: FSharpMap, lo: Key, hi: Key, f: ((arg0: Key, arg1: Value, arg2: z) => z), acc: z): z; -export declare function FSharpMap__Iterate(m: FSharpMap, f: ((arg0: Key, arg1: Value) => void)): void; -export declare function FSharpMap__MapRange(m: FSharpMap, f: ((arg0: Value) => Result)): FSharpMap; -export declare function FSharpMap__Map(m: FSharpMap, f: ((arg0: Key, arg1: Value) => b)): FSharpMap; -export declare function FSharpMap__Partition(m: FSharpMap, predicate: ((arg0: Key, arg1: Value) => boolean)): [FSharpMap, FSharpMap]; -export declare function FSharpMap__get_Count(m: FSharpMap): int32; -export declare function FSharpMap__ContainsKey(m: FSharpMap, key: Key): boolean; -export declare function FSharpMap__Remove(m: FSharpMap, key: Key): FSharpMap; -export declare function FSharpMap__TryGetValue(_: FSharpMap, key: Key, value: FSharpRef): boolean; -export declare function FSharpMap__get_Keys(_: FSharpMap): Iterable; -export declare function FSharpMap__get_Values(_: FSharpMap): Iterable; -export declare function FSharpMap__get_MinKeyValue(m: FSharpMap): [Key, Value]; -export declare function FSharpMap__get_MaxKeyValue(m: FSharpMap): [Key, Value]; -export declare function FSharpMap__TryFind(m: FSharpMap, key: Key): Option; -export declare function FSharpMap__ToList(m: FSharpMap): FSharpList<[Key, Value]>; -export declare function FSharpMap__ToArray(m: FSharpMap): [Key, Value][]; -export declare function FSharpMap__ComputeHashCode(this$: FSharpMap): int32; -export declare function isEmpty<$a, $b>(table: FSharpMap<$a, $b>): boolean; -export declare function add<$a, $b>(key: $a, value: $b, table: FSharpMap<$a, $b>): FSharpMap<$a, $b>; -export declare function change<$a, $b>(key: $a, f: ((arg0: Option<$b>) => Option<$b>), table: FSharpMap<$a, $b>): FSharpMap<$a, $b>; -export declare function find<$a, $b>(key: $a, table: FSharpMap<$a, $b>): $b; -export declare function tryFind<$a, $b>(key: $a, table: FSharpMap<$a, $b>): Option<$b>; -export declare function remove<$a, $b>(key: $a, table: FSharpMap<$a, $b>): FSharpMap<$a, $b>; -export declare function containsKey<$a, $b>(key: $a, table: FSharpMap<$a, $b>): boolean; -export declare function iterate<$a, $b>(action: ((arg0: $a, arg1: $b) => void), table: FSharpMap<$a, $b>): void; -export declare function tryPick<$a, $b, $c>(chooser: ((arg0: $a, arg1: $b) => Option<$c>), table: FSharpMap<$a, $b>): Option<$c>; -export declare function pick<$a, $b, $c>(chooser: ((arg0: $a, arg1: $b) => Option<$c>), table: FSharpMap<$a, $b>): $c; -export declare function exists<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): boolean; -export declare function filter<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): FSharpMap<$a, $b>; -export declare function partition<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): [FSharpMap<$a, $b>, FSharpMap<$a, $b>]; -export declare function forAll<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): boolean; -export declare function map<$a, $b, $c>(mapping: ((arg0: $a, arg1: $b) => $c), table: FSharpMap<$a, $b>): FSharpMap<$a, $c>; -export declare function fold(folder: ((arg0: State, arg1: Key, arg2: T) => State), state: State, table: FSharpMap): State; -export declare function foldBack(folder: ((arg0: Key, arg1: T, arg2: State) => State), table: FSharpMap, state: State): State; -export declare function toSeq<$a, $b>(table: FSharpMap<$a, $b>): Iterable<[$a, $b]>; -export declare function findKey<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): $a; -export declare function tryFindKey<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), table: FSharpMap<$a, $b>): Option<$a>; -export declare function ofList(elements: FSharpList<[Key, Value]>, comparer: IComparer): FSharpMap; -export declare function ofSeq(elements: Iterable<[T, $a]>, comparer: IComparer): FSharpMap; -export declare function ofArray(elements: [Key, Value][], comparer: IComparer): FSharpMap; -export declare function toList<$a, $b>(table: FSharpMap<$a, $b>): FSharpList<[$a, $b]>; -export declare function toArray<$a, $b>(table: FSharpMap<$a, $b>): [$a, $b][]; -export declare function keys(table: FSharpMap): Iterable; -export declare function values(table: FSharpMap): Iterable; -export declare function minKeyValue<$a, $b>(table: FSharpMap<$a, $b>): [$a, $b]; -export declare function maxKeyValue<$a, $b>(table: FSharpMap<$a, $b>): [$a, $b]; -export declare function empty(comparer: IComparer): FSharpMap; -export declare function count<$a, $b>(table: FSharpMap<$a, $b>): int32; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.js deleted file mode 100644 index e7ae0dfe..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Map.js +++ /dev/null @@ -1,1396 +0,0 @@ -import { record_type, bool_type, list_type, option_type, class_type } from "./Reflection.js"; -import { some, value as value_1 } from "./Option.js"; -import { structuralHash, compare, toIterator, equals, disposeSafe, getEnumerator, isArrayLike } from "./Util.js"; -import { singleton, ofArrayWithTail, head, tail, isEmpty as isEmpty_1, fold as fold_1, empty as empty_1, FSharpList, cons } from "./List.js"; -import { map as map_2, fill } from "./Array.js"; -import { Record } from "./Types.js"; -import { tryPick as tryPick_1, pick as pick_1, iterate as iterate_1, compareWith, map as map_1, unfold } from "./Seq.js"; -import { format, join } from "./String.js"; -export class MapTreeLeaf$2 { - constructor(k, v) { - this.k = k; - this.v = v; - } -} -export function MapTreeLeaf$2_$reflection(gen0, gen1) { - return class_type("Map.MapTreeLeaf`2", [gen0, gen1], MapTreeLeaf$2); -} -export function MapTreeLeaf$2_$ctor_5BDDA1(k, v) { - return new MapTreeLeaf$2(k, v); -} -export function MapTreeLeaf$2__get_Key(_) { - return _.k; -} -export function MapTreeLeaf$2__get_Value(_) { - return _.v; -} -export class MapTreeNode$2 extends MapTreeLeaf$2 { - constructor(k, v, left, right, h) { - super(k, v); - this.left = left; - this.right = right; - this.h = (h | 0); - } -} -export function MapTreeNode$2_$reflection(gen0, gen1) { - return class_type("Map.MapTreeNode`2", [gen0, gen1], MapTreeNode$2, MapTreeLeaf$2_$reflection(gen0, gen1)); -} -export function MapTreeNode$2_$ctor_Z39DE9543(k, v, left, right, h) { - return new MapTreeNode$2(k, v, left, right, h); -} -export function MapTreeNode$2__get_Left(_) { - return _.left; -} -export function MapTreeNode$2__get_Right(_) { - return _.right; -} -export function MapTreeNode$2__get_Height(_) { - return _.h; -} -export function MapTreeModule_empty() { - return void 0; -} -export function MapTreeModule_sizeAux(acc_mut, m_mut) { - MapTreeModule_sizeAux: while (true) { - const acc = acc_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - acc_mut = MapTreeModule_sizeAux(acc + 1, MapTreeNode$2__get_Left(mn)); - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_sizeAux; - } - else { - return (acc + 1) | 0; - } - } - else { - return acc | 0; - } - break; - } -} -export function MapTreeModule_size(x) { - return MapTreeModule_sizeAux(0, x); -} -export function MapTreeModule_mk(l, k, v, r) { - let mn, mn_1; - let hl; - const m = l; - if (m != null) { - const m2 = value_1(m); - hl = ((m2 instanceof MapTreeNode$2) ? ((mn = m2, MapTreeNode$2__get_Height(mn))) : 1); - } - else { - hl = 0; - } - let hr; - const m_1 = r; - if (m_1 != null) { - const m2_1 = value_1(m_1); - hr = ((m2_1 instanceof MapTreeNode$2) ? ((mn_1 = m2_1, MapTreeNode$2__get_Height(mn_1))) : 1); - } - else { - hr = 0; - } - const m_2 = ((hl < hr) ? hr : hl) | 0; - if (m_2 === 0) { - return MapTreeLeaf$2_$ctor_5BDDA1(k, v); - } - else { - return MapTreeNode$2_$ctor_Z39DE9543(k, v, l, r, m_2 + 1); - } -} -export function MapTreeModule_rebalance(t1, k, v, t2) { - let mn, mn_1, m_2, m2_2, mn_2, m_3, m2_3, mn_3; - let t1h; - const m = t1; - if (m != null) { - const m2 = value_1(m); - t1h = ((m2 instanceof MapTreeNode$2) ? ((mn = m2, MapTreeNode$2__get_Height(mn))) : 1); - } - else { - t1h = 0; - } - let t2h; - const m_1 = t2; - if (m_1 != null) { - const m2_1 = value_1(m_1); - t2h = ((m2_1 instanceof MapTreeNode$2) ? ((mn_1 = m2_1, MapTreeNode$2__get_Height(mn_1))) : 1); - } - else { - t2h = 0; - } - if (t2h > (t1h + 2)) { - const matchValue = value_1(t2); - if (matchValue instanceof MapTreeNode$2) { - const t2$0027 = matchValue; - if (((m_2 = MapTreeNode$2__get_Left(t2$0027), (m_2 != null) ? ((m2_2 = value_1(m_2), (m2_2 instanceof MapTreeNode$2) ? ((mn_2 = m2_2, MapTreeNode$2__get_Height(mn_2))) : 1)) : 0)) > (t1h + 1)) { - const matchValue_1 = value_1(MapTreeNode$2__get_Left(t2$0027)); - if (matchValue_1 instanceof MapTreeNode$2) { - const t2l = matchValue_1; - return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(t2l)), MapTreeLeaf$2__get_Key(t2l), MapTreeLeaf$2__get_Value(t2l), MapTreeModule_mk(MapTreeNode$2__get_Right(t2l), MapTreeLeaf$2__get_Key(t2$0027), MapTreeLeaf$2__get_Value(t2$0027), MapTreeNode$2__get_Right(t2$0027))); - } - else { - throw new Error("internal error: Map.rebalance"); - } - } - else { - return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(t2$0027)), MapTreeLeaf$2__get_Key(t2$0027), MapTreeLeaf$2__get_Value(t2$0027), MapTreeNode$2__get_Right(t2$0027)); - } - } - else { - throw new Error("internal error: Map.rebalance"); - } - } - else if (t1h > (t2h + 2)) { - const matchValue_2 = value_1(t1); - if (matchValue_2 instanceof MapTreeNode$2) { - const t1$0027 = matchValue_2; - if (((m_3 = MapTreeNode$2__get_Right(t1$0027), (m_3 != null) ? ((m2_3 = value_1(m_3), (m2_3 instanceof MapTreeNode$2) ? ((mn_3 = m2_3, MapTreeNode$2__get_Height(mn_3))) : 1)) : 0)) > (t2h + 1)) { - const matchValue_3 = value_1(MapTreeNode$2__get_Right(t1$0027)); - if (matchValue_3 instanceof MapTreeNode$2) { - const t1r = matchValue_3; - return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(t1$0027), MapTreeLeaf$2__get_Key(t1$0027), MapTreeLeaf$2__get_Value(t1$0027), MapTreeNode$2__get_Left(t1r)), MapTreeLeaf$2__get_Key(t1r), MapTreeLeaf$2__get_Value(t1r), MapTreeModule_mk(MapTreeNode$2__get_Right(t1r), k, v, t2)); - } - else { - throw new Error("internal error: Map.rebalance"); - } - } - else { - return MapTreeModule_mk(MapTreeNode$2__get_Left(t1$0027), MapTreeLeaf$2__get_Key(t1$0027), MapTreeLeaf$2__get_Value(t1$0027), MapTreeModule_mk(MapTreeNode$2__get_Right(t1$0027), k, v, t2)); - } - } - else { - throw new Error("internal error: Map.rebalance"); - } - } - else { - return MapTreeModule_mk(t1, k, v, t2); - } -} -export function MapTreeModule_add(comparer, k, v, m) { - if (m != null) { - const m2 = value_1(m); - const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0; - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (c < 0) { - return MapTreeModule_rebalance(MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Left(mn)), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeNode$2__get_Right(mn)); - } - else if (c === 0) { - return MapTreeNode$2_$ctor_Z39DE9543(k, v, MapTreeNode$2__get_Left(mn), MapTreeNode$2__get_Right(mn), MapTreeNode$2__get_Height(mn)); - } - else { - return MapTreeModule_rebalance(MapTreeNode$2__get_Left(mn), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Right(mn))); - } - } - else if (c < 0) { - return MapTreeNode$2_$ctor_Z39DE9543(k, v, MapTreeModule_empty(), m, 2); - } - else if (c === 0) { - return MapTreeLeaf$2_$ctor_5BDDA1(k, v); - } - else { - return MapTreeNode$2_$ctor_Z39DE9543(k, v, m, MapTreeModule_empty(), 2); - } - } - else { - return MapTreeLeaf$2_$ctor_5BDDA1(k, v); - } -} -export function MapTreeModule_tryFind(comparer_mut, k_mut, m_mut) { - MapTreeModule_tryFind: while (true) { - const comparer = comparer_mut, k = k_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0; - if (c === 0) { - return some(MapTreeLeaf$2__get_Value(m2)); - } - else if (m2 instanceof MapTreeNode$2) { - const mn = m2; - comparer_mut = comparer; - k_mut = k; - m_mut = ((c < 0) ? MapTreeNode$2__get_Left(mn) : MapTreeNode$2__get_Right(mn)); - continue MapTreeModule_tryFind; - } - else { - return void 0; - } - } - else { - return void 0; - } - break; - } -} -export function MapTreeModule_find(comparer, k, m) { - const matchValue = MapTreeModule_tryFind(comparer, k, m); - if (matchValue == null) { - throw new Error(); - } - else { - return value_1(matchValue); - } -} -export function MapTreeModule_partition1(comparer, f, k, v, acc1, acc2) { - if (f(k, v)) { - return [MapTreeModule_add(comparer, k, v, acc1), acc2]; - } - else { - return [acc1, MapTreeModule_add(comparer, k, v, acc2)]; - } -} -export function MapTreeModule_partitionAux(comparer_mut, f_mut, m_mut, acc__mut, acc__1_mut) { - MapTreeModule_partitionAux: while (true) { - const comparer = comparer_mut, f = f_mut, m = m_mut, acc_ = acc__mut, acc__1 = acc__1_mut; - const acc = [acc_, acc__1]; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const acc_1 = MapTreeModule_partitionAux(comparer, f, MapTreeNode$2__get_Right(mn), acc[0], acc[1]); - const acc_4 = MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), acc_1[0], acc_1[1]); - comparer_mut = comparer; - f_mut = f; - m_mut = MapTreeNode$2__get_Left(mn); - acc__mut = acc_4[0]; - acc__1_mut = acc_4[1]; - continue MapTreeModule_partitionAux; - } - else { - return MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc[0], acc[1]); - } - } - else { - return acc; - } - break; - } -} -export function MapTreeModule_partition(comparer, f, m) { - return MapTreeModule_partitionAux(comparer, f, m, MapTreeModule_empty(), MapTreeModule_empty()); -} -export function MapTreeModule_filter1(comparer, f, k, v, acc) { - if (f(k, v)) { - return MapTreeModule_add(comparer, k, v, acc); - } - else { - return acc; - } -} -export function MapTreeModule_filterAux(comparer_mut, f_mut, m_mut, acc_mut) { - MapTreeModule_filterAux: while (true) { - const comparer = comparer_mut, f = f_mut, m = m_mut, acc = acc_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const acc_1 = MapTreeModule_filterAux(comparer, f, MapTreeNode$2__get_Left(mn), acc); - const acc_2 = MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), acc_1); - comparer_mut = comparer; - f_mut = f; - m_mut = MapTreeNode$2__get_Right(mn); - acc_mut = acc_2; - continue MapTreeModule_filterAux; - } - else { - return MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc); - } - } - else { - return acc; - } - break; - } -} -export function MapTreeModule_filter(comparer, f, m) { - return MapTreeModule_filterAux(comparer, f, m, MapTreeModule_empty()); -} -export function MapTreeModule_spliceOutSuccessor(m) { - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (MapTreeNode$2__get_Left(mn) == null) { - return [MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeNode$2__get_Right(mn)]; - } - else { - const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Left(mn)); - return [patternInput[0], patternInput[1], MapTreeModule_mk(patternInput[2], MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeNode$2__get_Right(mn))]; - } - } - else { - return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_empty()]; - } - } - else { - throw new Error("internal error: Map.spliceOutSuccessor"); - } -} -export function MapTreeModule_remove(comparer, k, m) { - if (m != null) { - const m2 = value_1(m); - const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0; - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (c < 0) { - return MapTreeModule_rebalance(MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Left(mn)), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeNode$2__get_Right(mn)); - } - else if (c === 0) { - if (MapTreeNode$2__get_Left(mn) == null) { - return MapTreeNode$2__get_Right(mn); - } - else if (MapTreeNode$2__get_Right(mn) == null) { - return MapTreeNode$2__get_Left(mn); - } - else { - const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(mn)); - return MapTreeModule_mk(MapTreeNode$2__get_Left(mn), patternInput[0], patternInput[1], patternInput[2]); - } - } - else { - return MapTreeModule_rebalance(MapTreeNode$2__get_Left(mn), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Right(mn))); - } - } - else if (c === 0) { - return MapTreeModule_empty(); - } - else { - return m; - } - } - else { - return MapTreeModule_empty(); - } -} -export function MapTreeModule_change(comparer, k, u, m) { - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(mn)) | 0; - if (c < 0) { - return MapTreeModule_rebalance(MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Left(mn)), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeNode$2__get_Right(mn)); - } - else if (c === 0) { - const matchValue_1 = u(some(MapTreeLeaf$2__get_Value(mn))); - if (matchValue_1 != null) { - return MapTreeNode$2_$ctor_Z39DE9543(k, value_1(matchValue_1), MapTreeNode$2__get_Left(mn), MapTreeNode$2__get_Right(mn), MapTreeNode$2__get_Height(mn)); - } - else if (MapTreeNode$2__get_Left(mn) == null) { - return MapTreeNode$2__get_Right(mn); - } - else if (MapTreeNode$2__get_Right(mn) == null) { - return MapTreeNode$2__get_Left(mn); - } - else { - const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(mn)); - return MapTreeModule_mk(MapTreeNode$2__get_Left(mn), patternInput[0], patternInput[1], patternInput[2]); - } - } - else { - return MapTreeModule_rebalance(MapTreeNode$2__get_Left(mn), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Right(mn))); - } - } - else { - const c_1 = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0; - if (c_1 < 0) { - const matchValue_2 = u(void 0); - if (matchValue_2 != null) { - return MapTreeNode$2_$ctor_Z39DE9543(k, value_1(matchValue_2), MapTreeModule_empty(), m, 2); - } - else { - return m; - } - } - else if (c_1 === 0) { - const matchValue_3 = u(some(MapTreeLeaf$2__get_Value(m2))); - if (matchValue_3 != null) { - return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue_3)); - } - else { - return MapTreeModule_empty(); - } - } - else { - const matchValue_4 = u(void 0); - if (matchValue_4 != null) { - return MapTreeNode$2_$ctor_Z39DE9543(k, value_1(matchValue_4), m, MapTreeModule_empty(), 2); - } - else { - return m; - } - } - } - } - else { - const matchValue = u(void 0); - if (matchValue != null) { - return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue)); - } - else { - return m; - } - } -} -export function MapTreeModule_mem(comparer_mut, k_mut, m_mut) { - MapTreeModule_mem: while (true) { - const comparer = comparer_mut, k = k_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0; - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (c < 0) { - comparer_mut = comparer; - k_mut = k; - m_mut = MapTreeNode$2__get_Left(mn); - continue MapTreeModule_mem; - } - else if (c === 0) { - return true; - } - else { - comparer_mut = comparer; - k_mut = k; - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_mem; - } - } - else { - return c === 0; - } - } - else { - return false; - } - break; - } -} -export function MapTreeModule_iterOpt(f_mut, m_mut) { - MapTreeModule_iterOpt: while (true) { - const f = f_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - MapTreeModule_iterOpt(f, MapTreeNode$2__get_Left(mn)); - f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)); - f_mut = f; - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_iterOpt; - } - else { - f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)); - } - } - break; - } -} -export function MapTreeModule_iter(f, m) { - MapTreeModule_iterOpt(f, m); -} -export function MapTreeModule_tryPickOpt(f_mut, m_mut) { - MapTreeModule_tryPickOpt: while (true) { - const f = f_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const matchValue = MapTreeModule_tryPickOpt(f, MapTreeNode$2__get_Left(mn)); - if (matchValue == null) { - const matchValue_1 = f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)); - if (matchValue_1 == null) { - f_mut = f; - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_tryPickOpt; - } - else { - return matchValue_1; - } - } - else { - return matchValue; - } - } - else { - return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)); - } - } - else { - return void 0; - } - break; - } -} -export function MapTreeModule_tryPick(f, m) { - return MapTreeModule_tryPickOpt(f, m); -} -export function MapTreeModule_existsOpt(f_mut, m_mut) { - MapTreeModule_existsOpt: while (true) { - const f = f_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (MapTreeModule_existsOpt(f, MapTreeNode$2__get_Left(mn)) ? true : f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn))) { - return true; - } - else { - f_mut = f; - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_existsOpt; - } - } - else { - return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)); - } - } - else { - return false; - } - break; - } -} -export function MapTreeModule_exists(f, m) { - return MapTreeModule_existsOpt(f, m); -} -export function MapTreeModule_forallOpt(f_mut, m_mut) { - MapTreeModule_forallOpt: while (true) { - const f = f_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - if (MapTreeModule_forallOpt(f, MapTreeNode$2__get_Left(mn)) && f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn))) { - f_mut = f; - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_forallOpt; - } - else { - return false; - } - } - else { - return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)); - } - } - else { - return true; - } - break; - } -} -export function MapTreeModule_forall(f, m) { - return MapTreeModule_forallOpt(f, m); -} -export function MapTreeModule_map(f, m) { - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const l2 = MapTreeModule_map(f, MapTreeNode$2__get_Left(mn)); - const v2 = f(MapTreeLeaf$2__get_Value(mn)); - const r2 = MapTreeModule_map(f, MapTreeNode$2__get_Right(mn)); - return MapTreeNode$2_$ctor_Z39DE9543(MapTreeLeaf$2__get_Key(mn), v2, l2, r2, MapTreeNode$2__get_Height(mn)); - } - else { - return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Value(m2))); - } - } - else { - return MapTreeModule_empty(); - } -} -export function MapTreeModule_mapiOpt(f, m) { - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const l2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Left(mn)); - const v2 = f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)); - const r2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Right(mn)); - return MapTreeNode$2_$ctor_Z39DE9543(MapTreeLeaf$2__get_Key(mn), v2, l2, r2, MapTreeNode$2__get_Height(mn)); - } - else { - return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))); - } - } - else { - return MapTreeModule_empty(); - } -} -export function MapTreeModule_mapi(f, m) { - return MapTreeModule_mapiOpt(f, m); -} -export function MapTreeModule_foldBackOpt(f_mut, m_mut, x_mut) { - MapTreeModule_foldBackOpt: while (true) { - const f = f_mut, m = m_mut, x = x_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const x_1 = MapTreeModule_foldBackOpt(f, MapTreeNode$2__get_Right(mn), x); - const x_2 = f(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), x_1); - f_mut = f; - m_mut = MapTreeNode$2__get_Left(mn); - x_mut = x_2; - continue MapTreeModule_foldBackOpt; - } - else { - return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x); - } - } - else { - return x; - } - break; - } -} -export function MapTreeModule_foldBack(f, m, x) { - return MapTreeModule_foldBackOpt(f, m, x); -} -export function MapTreeModule_foldOpt(f_mut, x_mut, m_mut) { - MapTreeModule_foldOpt: while (true) { - const f = f_mut, x = x_mut, m = m_mut; - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - f_mut = f; - x_mut = f(MapTreeModule_foldOpt(f, x, MapTreeNode$2__get_Left(mn)), MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)); - m_mut = MapTreeNode$2__get_Right(mn); - continue MapTreeModule_foldOpt; - } - else { - return f(x, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)); - } - } - else { - return x; - } - break; - } -} -export function MapTreeModule_fold(f, x, m) { - return MapTreeModule_foldOpt(f, x, m); -} -export function MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x) { - const foldFromTo = (f_1_mut, m_1_mut, x_1_mut) => { - foldFromTo: while (true) { - const f_1 = f_1_mut, m_1 = m_1_mut, x_1 = x_1_mut; - if (m_1 != null) { - const m2 = value_1(m_1); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - const cLoKey = comparer.Compare(lo, MapTreeLeaf$2__get_Key(mn)) | 0; - const cKeyHi = comparer.Compare(MapTreeLeaf$2__get_Key(mn), hi) | 0; - const x_2 = (cLoKey < 0) ? foldFromTo(f_1, MapTreeNode$2__get_Left(mn), x_1) : x_1; - const x_3 = ((cLoKey <= 0) && (cKeyHi <= 0)) ? f_1(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn), x_2) : x_2; - if (cKeyHi < 0) { - f_1_mut = f_1; - m_1_mut = MapTreeNode$2__get_Right(mn); - x_1_mut = x_3; - continue foldFromTo; - } - else { - return x_3; - } - } - else if ((comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) <= 0) && (comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) <= 0)) { - return f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1); - } - else { - return x_1; - } - } - else { - return x_1; - } - break; - } - }; - if (comparer.Compare(lo, hi) === 1) { - return x; - } - else { - return foldFromTo(f, m, x); - } -} -export function MapTreeModule_foldSection(comparer, lo, hi, f, m, x) { - return MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x); -} -export function MapTreeModule_toList(m) { - const loop = (m_1_mut, acc_mut) => { - loop: while (true) { - const m_1 = m_1_mut, acc = acc_mut; - if (m_1 != null) { - const m2 = value_1(m_1); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - m_1_mut = MapTreeNode$2__get_Left(mn); - acc_mut = cons([MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)], loop(MapTreeNode$2__get_Right(mn), acc)); - continue loop; - } - else { - return cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], acc); - } - } - else { - return acc; - } - break; - } - }; - return loop(m, empty_1()); -} -export function MapTreeModule_copyToArray(m, arr, i) { - let j = i; - MapTreeModule_iter((x, y) => { - arr[j] = [x, y]; - j = ((j + 1) | 0); - }, m); -} -export function MapTreeModule_toArray(m) { - const n = MapTreeModule_size(m) | 0; - const res = fill(new Array(n), 0, n, [null, null]); - MapTreeModule_copyToArray(m, res, 0); - return res; -} -export function MapTreeModule_ofList(comparer, l) { - return fold_1((acc, tupledArg) => MapTreeModule_add(comparer, tupledArg[0], tupledArg[1], acc), MapTreeModule_empty(), l); -} -export function MapTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) { - MapTreeModule_mkFromEnumerator: while (true) { - const comparer = comparer_mut, acc = acc_mut, e = e_mut; - if (e["System.Collections.IEnumerator.MoveNext"]()) { - const patternInput = e["System.Collections.Generic.IEnumerator`1.get_Current"](); - comparer_mut = comparer; - acc_mut = MapTreeModule_add(comparer, patternInput[0], patternInput[1], acc); - e_mut = e; - continue MapTreeModule_mkFromEnumerator; - } - else { - return acc; - } - break; - } -} -export function MapTreeModule_ofArray(comparer, arr) { - let res = MapTreeModule_empty(); - for (let idx = 0; idx <= (arr.length - 1); idx++) { - const forLoopVar = arr[idx]; - res = MapTreeModule_add(comparer, forLoopVar[0], forLoopVar[1], res); - } - return res; -} -export function MapTreeModule_ofSeq(comparer, c) { - if (isArrayLike(c)) { - return MapTreeModule_ofArray(comparer, c); - } - else if (c instanceof FSharpList) { - return MapTreeModule_ofList(comparer, c); - } - else { - const ie = getEnumerator(c); - try { - return MapTreeModule_mkFromEnumerator(comparer, MapTreeModule_empty(), ie); - } - finally { - disposeSafe(ie); - } - } -} -export class MapTreeModule_MapIterator$2 extends Record { - constructor(stack, started) { - super(); - this.stack = stack; - this.started = started; - } -} -export function MapTreeModule_MapIterator$2_$reflection(gen0, gen1) { - 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]]); -} -export function MapTreeModule_collapseLHS(stack_mut) { - MapTreeModule_collapseLHS: while (true) { - const stack = stack_mut; - if (!isEmpty_1(stack)) { - const rest = tail(stack); - const m = head(stack); - if (m != null) { - const m2 = value_1(m); - if (m2 instanceof MapTreeNode$2) { - const mn = m2; - stack_mut = ofArrayWithTail([MapTreeNode$2__get_Left(mn), MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(mn), MapTreeLeaf$2__get_Value(mn)), MapTreeNode$2__get_Right(mn)], rest); - continue MapTreeModule_collapseLHS; - } - else { - return stack; - } - } - else { - stack_mut = rest; - continue MapTreeModule_collapseLHS; - } - } - else { - return empty_1(); - } - break; - } -} -export function MapTreeModule_mkIterator(m) { - return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton(m)), false); -} -export function MapTreeModule_notStarted() { - throw new Error("enumeration not started"); -} -export function MapTreeModule_alreadyFinished() { - throw new Error("enumeration already finished"); -} -export function MapTreeModule_current(i) { - if (i.started) { - const matchValue = i.stack; - if (!isEmpty_1(matchValue)) { - if (head(matchValue) != null) { - const m = value_1(head(matchValue)); - if (m instanceof MapTreeNode$2) { - throw new Error("Please report error: Map iterator, unexpected stack for current"); - } - else { - return [MapTreeLeaf$2__get_Key(m), MapTreeLeaf$2__get_Value(m)]; - } - } - else { - throw new Error("Please report error: Map iterator, unexpected stack for current"); - } - } - else { - return MapTreeModule_alreadyFinished(); - } - } - else { - return MapTreeModule_notStarted(); - } -} -export function MapTreeModule_moveNext(i) { - if (i.started) { - const matchValue = i.stack; - if (!isEmpty_1(matchValue)) { - if (head(matchValue) != null) { - const m = value_1(head(matchValue)); - if (m instanceof MapTreeNode$2) { - throw new Error("Please report error: Map iterator, unexpected stack for moveNext"); - } - else { - i.stack = MapTreeModule_collapseLHS(tail(matchValue)); - return !isEmpty_1(i.stack); - } - } - else { - throw new Error("Please report error: Map iterator, unexpected stack for moveNext"); - } - } - else { - return false; - } - } - else { - i.started = true; - return !isEmpty_1(i.stack); - } -} -export function MapTreeModule_mkIEnumerator(m) { - let i = MapTreeModule_mkIterator(m); - return { - "System.Collections.Generic.IEnumerator`1.get_Current"() { - return MapTreeModule_current(i); - }, - "System.Collections.IEnumerator.get_Current"() { - return MapTreeModule_current(i); - }, - "System.Collections.IEnumerator.MoveNext"() { - return MapTreeModule_moveNext(i); - }, - "System.Collections.IEnumerator.Reset"() { - i = MapTreeModule_mkIterator(m); - }, - Dispose() { - }, - }; -} -export function MapTreeModule_toSeq(s) { - return unfold((en_1) => { - if (en_1["System.Collections.IEnumerator.MoveNext"]()) { - return [en_1["System.Collections.Generic.IEnumerator`1.get_Current"](), en_1]; - } - else { - return void 0; - } - }, MapTreeModule_mkIEnumerator(s)); -} -export function MapTreeModule_leftmost(m_mut) { - MapTreeModule_leftmost: while (true) { - const m = m_mut; - if (m != null) { - const m2 = value_1(m); - let matchResult, nd_1; - if (m2 instanceof MapTreeNode$2) { - if (MapTreeNode$2__get_Height(m2) > 1) { - matchResult = 0; - nd_1 = m2; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - if (MapTreeNode$2__get_Left(nd_1) == null) { - return [MapTreeLeaf$2__get_Key(nd_1), MapTreeLeaf$2__get_Value(nd_1)]; - } - else { - m_mut = MapTreeNode$2__get_Left(nd_1); - continue MapTreeModule_leftmost; - } - default: - return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)]; - } - } - else { - throw new Error(); - } - break; - } -} -export function MapTreeModule_rightmost(m_mut) { - MapTreeModule_rightmost: while (true) { - const m = m_mut; - if (m != null) { - const m2 = value_1(m); - let matchResult, nd_1; - if (m2 instanceof MapTreeNode$2) { - if (MapTreeNode$2__get_Height(m2) > 1) { - matchResult = 0; - nd_1 = m2; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - if (MapTreeNode$2__get_Right(nd_1) == null) { - return [MapTreeLeaf$2__get_Key(nd_1), MapTreeLeaf$2__get_Value(nd_1)]; - } - else { - m_mut = MapTreeNode$2__get_Right(nd_1); - continue MapTreeModule_rightmost; - } - default: - return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)]; - } - } - else { - throw new Error(); - } - break; - } -} -export class FSharpMap { - constructor(comparer, tree) { - this.comparer = comparer; - this.tree = tree; - } - GetHashCode() { - const this$ = this; - return FSharpMap__ComputeHashCode(this$) | 0; - } - Equals(that) { - const this$ = this; - if (that instanceof FSharpMap) { - const that_1 = that; - const e1 = getEnumerator(this$); - try { - const e2 = getEnumerator(that_1); - try { - const loop = () => { - const m1 = e1["System.Collections.IEnumerator.MoveNext"](); - if (m1 === e2["System.Collections.IEnumerator.MoveNext"]()) { - if (!m1) { - return true; - } - else { - const e1c = e1["System.Collections.Generic.IEnumerator`1.get_Current"](); - const e2c = e2["System.Collections.Generic.IEnumerator`1.get_Current"](); - if (equals(e1c[0], e2c[0]) && equals(e1c[1], e2c[1])) { - return loop(); - } - else { - return false; - } - } - } - else { - return false; - } - }; - return loop(); - } - finally { - disposeSafe(e2); - } - } - finally { - disposeSafe(e1); - } - } - else { - return false; - } - } - toString() { - const this$ = this; - return ("map [" + join("; ", map_1((kv) => format("({0}, {1})", kv[0], kv[1]), this$))) + "]"; - } - get [Symbol.toStringTag]() { - return "FSharpMap"; - } - toJSON() { - const this$ = this; - return Array.from(this$); - } - GetEnumerator() { - const _ = this; - return MapTreeModule_mkIEnumerator(_.tree); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const _ = this; - return MapTreeModule_mkIEnumerator(_.tree); - } - CompareTo(obj) { - const m = this; - if (obj instanceof FSharpMap) { - const m2 = obj; - return compareWith((kvp1, kvp2) => { - const c = m.comparer.Compare(kvp1[0], kvp2[0]) | 0; - return ((c !== 0) ? c : compare(kvp1[1], kvp2[1])) | 0; - }, m, m2) | 0; - } - else { - throw new Error("not comparable\\nParameter name: obj"); - } - } - "System.Collections.Generic.ICollection`1.Add2B595"(x) { - throw new Error("Map cannot be mutated"); - } - "System.Collections.Generic.ICollection`1.Clear"() { - throw new Error("Map cannot be mutated"); - } - "System.Collections.Generic.ICollection`1.Remove2B595"(x) { - throw new Error("Map cannot be mutated"); - } - "System.Collections.Generic.ICollection`1.Contains2B595"(x) { - const m = this; - return FSharpMap__ContainsKey(m, x[0]) && equals(FSharpMap__get_Item(m, x[0]), x[1]); - } - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(arr, i) { - const m = this; - MapTreeModule_copyToArray(m.tree, arr, i); - } - "System.Collections.Generic.ICollection`1.get_IsReadOnly"() { - return true; - } - "System.Collections.Generic.ICollection`1.get_Count"() { - const m = this; - return FSharpMap__get_Count(m) | 0; - } - "System.Collections.Generic.IReadOnlyCollection`1.get_Count"() { - const m = this; - return FSharpMap__get_Count(m) | 0; - } - get size() { - const m = this; - return FSharpMap__get_Count(m) | 0; - } - clear() { - throw new Error("Map cannot be mutated"); - } - delete(_arg) { - throw new Error("Map cannot be mutated"); - return false; - } - entries() { - const m = this; - return map_1((p) => [p[0], p[1]], m); - } - get(k) { - const m = this; - return FSharpMap__get_Item(m, k); - } - has(k) { - const m = this; - return FSharpMap__ContainsKey(m, k); - } - keys() { - const m = this; - return map_1((p) => p[0], m); - } - set(k, v) { - const m = this; - throw new Error("Map cannot be mutated"); - return m; - } - values() { - const m = this; - return map_1((p) => p[1], m); - } - forEach(f, thisArg) { - const m = this; - iterate_1((p) => { - f(p[1], p[0], m); - }, m); - } -} -export function FSharpMap_$reflection(gen0, gen1) { - return class_type("Map.FSharpMap", [gen0, gen1], FSharpMap); -} -export function FSharpMap_$ctor(comparer, tree) { - return new FSharpMap(comparer, tree); -} -export function FSharpMap_Empty(comparer) { - return FSharpMap_$ctor(comparer, MapTreeModule_empty()); -} -export function FSharpMap__get_Comparer(m) { - return m.comparer; -} -export function FSharpMap__get_Tree(m) { - return m.tree; -} -export function FSharpMap__Add(m, key, value) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_add(m.comparer, key, value, m.tree)); -} -export function FSharpMap__Change(m, key, f) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_change(m.comparer, key, f, m.tree)); -} -export function FSharpMap__get_IsEmpty(m) { - return m.tree == null; -} -export function FSharpMap__get_Item(m, key) { - return MapTreeModule_find(m.comparer, key, m.tree); -} -export function FSharpMap__TryPick(m, f) { - return MapTreeModule_tryPick(f, m.tree); -} -export function FSharpMap__Exists(m, predicate) { - return MapTreeModule_exists(predicate, m.tree); -} -export function FSharpMap__Filter(m, predicate) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_filter(m.comparer, predicate, m.tree)); -} -export function FSharpMap__ForAll(m, predicate) { - return MapTreeModule_forall(predicate, m.tree); -} -export function FSharpMap__Fold(m, f, acc) { - return MapTreeModule_foldBack(f, m.tree, acc); -} -export function FSharpMap__FoldSection(m, lo, hi, f, acc) { - return MapTreeModule_foldSection(m.comparer, lo, hi, f, m.tree, acc); -} -export function FSharpMap__Iterate(m, f) { - MapTreeModule_iter(f, m.tree); -} -export function FSharpMap__MapRange(m, f) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_map(f, m.tree)); -} -export function FSharpMap__Map(m, f) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_mapi(f, m.tree)); -} -export function FSharpMap__Partition(m, predicate) { - const patternInput = MapTreeModule_partition(m.comparer, predicate, m.tree); - return [FSharpMap_$ctor(m.comparer, patternInput[0]), FSharpMap_$ctor(m.comparer, patternInput[1])]; -} -export function FSharpMap__get_Count(m) { - return MapTreeModule_size(m.tree); -} -export function FSharpMap__ContainsKey(m, key) { - return MapTreeModule_mem(m.comparer, key, m.tree); -} -export function FSharpMap__Remove(m, key) { - return FSharpMap_$ctor(m.comparer, MapTreeModule_remove(m.comparer, key, m.tree)); -} -export function FSharpMap__TryGetValue(_, key, value) { - const matchValue = MapTreeModule_tryFind(_.comparer, key, _.tree); - if (matchValue == null) { - return false; - } - else { - const v = value_1(matchValue); - value.contents = v; - return true; - } -} -export function FSharpMap__get_Keys(_) { - return map_2((kvp) => kvp[0], MapTreeModule_toArray(_.tree)); -} -export function FSharpMap__get_Values(_) { - return map_2((kvp) => kvp[1], MapTreeModule_toArray(_.tree)); -} -export function FSharpMap__get_MinKeyValue(m) { - return MapTreeModule_leftmost(m.tree); -} -export function FSharpMap__get_MaxKeyValue(m) { - return MapTreeModule_rightmost(m.tree); -} -export function FSharpMap__TryFind(m, key) { - return MapTreeModule_tryFind(m.comparer, key, m.tree); -} -export function FSharpMap__ToList(m) { - return MapTreeModule_toList(m.tree); -} -export function FSharpMap__ToArray(m) { - return MapTreeModule_toArray(m.tree); -} -export function FSharpMap__ComputeHashCode(this$) { - const combineHash = (x, y) => (((x << 1) + y) + 631); - let res = 0; - const enumerator = getEnumerator(this$); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const activePatternResult = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - res = (combineHash(res, structuralHash(activePatternResult[0])) | 0); - res = (combineHash(res, structuralHash(activePatternResult[1])) | 0); - } - } - finally { - disposeSafe(enumerator); - } - return res | 0; -} -export function isEmpty(table) { - return FSharpMap__get_IsEmpty(table); -} -export function add(key, value, table) { - return FSharpMap__Add(table, key, value); -} -export function change(key, f, table) { - return FSharpMap__Change(table, key, f); -} -export function find(key, table) { - return FSharpMap__get_Item(table, key); -} -export function tryFind(key, table) { - return FSharpMap__TryFind(table, key); -} -export function remove(key, table) { - return FSharpMap__Remove(table, key); -} -export function containsKey(key, table) { - return FSharpMap__ContainsKey(table, key); -} -export function iterate(action, table) { - FSharpMap__Iterate(table, action); -} -export function tryPick(chooser, table) { - return FSharpMap__TryPick(table, chooser); -} -export function pick(chooser, table) { - const matchValue = tryPick(chooser, table); - if (matchValue != null) { - return value_1(matchValue); - } - else { - throw new Error(); - } -} -export function exists(predicate, table) { - return FSharpMap__Exists(table, predicate); -} -export function filter(predicate, table) { - return FSharpMap__Filter(table, predicate); -} -export function partition(predicate, table) { - return FSharpMap__Partition(table, predicate); -} -export function forAll(predicate, table) { - return FSharpMap__ForAll(table, predicate); -} -export function map(mapping, table) { - return FSharpMap__Map(table, mapping); -} -export function fold(folder, state, table) { - return MapTreeModule_fold(folder, state, FSharpMap__get_Tree(table)); -} -export function foldBack(folder, table, state) { - return MapTreeModule_foldBack(folder, FSharpMap__get_Tree(table), state); -} -export function toSeq(table) { - return map_1((kvp) => [kvp[0], kvp[1]], table); -} -export function findKey(predicate, table) { - return pick_1((kvp) => { - const k = kvp[0]; - if (predicate(k, kvp[1])) { - return some(k); - } - else { - return void 0; - } - }, table); -} -export function tryFindKey(predicate, table) { - return tryPick_1((kvp) => { - const k = kvp[0]; - if (predicate(k, kvp[1])) { - return some(k); - } - else { - return void 0; - } - }, table); -} -export function ofList(elements, comparer) { - return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, elements)); -} -export function ofSeq(elements, comparer) { - return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, elements)); -} -export function ofArray(elements, comparer) { - return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, elements)); -} -export function toList(table) { - return FSharpMap__ToList(table); -} -export function toArray(table) { - return FSharpMap__ToArray(table); -} -export function keys(table) { - return FSharpMap__get_Keys(table); -} -export function values(table) { - return FSharpMap__get_Values(table); -} -export function minKeyValue(table) { - return FSharpMap__get_MinKeyValue(table); -} -export function maxKeyValue(table) { - return FSharpMap__get_MaxKeyValue(table); -} -export function empty(comparer) { - return FSharpMap_Empty(comparer); -} -export function count(table) { - return FSharpMap__get_Count(table); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.d.ts deleted file mode 100644 index 2edf5c45..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IMap, ISet } from "./Util.js"; -import { FSharpRef } from "./Types.js"; -export declare function keyValueList(fields: Iterable, caseRule?: number): { - [k: string]: any; -}; -export declare function containsValue(v: V, map: IMap): boolean; -export declare function tryGetValue(map: IMap, key: K, defaultValue: FSharpRef): boolean; -export declare function addToSet(v: T, set: ISet): boolean; -export declare function addToDict(dict: IMap, k: K, v: V): void; -export declare function getItemFromDict(map: IMap, key: K): V; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.js deleted file mode 100644 index ec172bed..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MapUtil.js +++ /dev/null @@ -1,112 +0,0 @@ -import { equals } from "./Util.js"; -import { Union } from "./Types.js"; -const CaseRules = { - None: 0, - LowerFirst: 1, - SnakeCase: 2, - SnakeCaseAllCaps: 3, - KebabCase: 4, -}; -function dashify(str, separator) { - return str.replace(/[a-z]?[A-Z]/g, (m) => m.length === 1 - ? m.toLowerCase() - : m.charAt(0) + separator + m.charAt(1).toLowerCase()); -} -function changeCase(str, caseRule) { - switch (caseRule) { - case CaseRules.LowerFirst: - return str.charAt(0).toLowerCase() + str.slice(1); - case CaseRules.SnakeCase: - return dashify(str, "_"); - case CaseRules.SnakeCaseAllCaps: - return dashify(str, "_").toUpperCase(); - case CaseRules.KebabCase: - return dashify(str, "-"); - case CaseRules.None: - default: - return str; - } -} -export function keyValueList(fields, caseRule = CaseRules.None) { - const obj = {}; - const definedCaseRule = caseRule; - function fail(kvPair) { - throw new Error("Cannot infer key and value of " + String(kvPair)); - } - function assign(key, caseRule, value) { - key = changeCase(key, caseRule); - obj[key] = value; - } - for (let kvPair of fields) { - let caseRule = CaseRules.None; - if (kvPair == null) { - fail(kvPair); - } - // Deflate unions and use the defined case rule - if (kvPair instanceof Union) { - const name = kvPair.cases()[kvPair.tag]; - kvPair = kvPair.fields.length === 0 ? name : [name].concat(kvPair.fields); - caseRule = definedCaseRule; - } - if (Array.isArray(kvPair)) { - switch (kvPair.length) { - case 0: - fail(kvPair); - break; - case 1: - assign(kvPair[0], caseRule, true); - break; - case 2: - const value = kvPair[1]; - assign(kvPair[0], caseRule, value); - break; - default: - assign(kvPair[0], caseRule, kvPair.slice(1)); - } - } - else if (typeof kvPair === "string") { - assign(kvPair, caseRule, true); - } - else { - fail(kvPair); - } - } - return obj; -} -// TODO: Move these methods to Map and Set modules -export function containsValue(v, map) { - for (const kv of map) { - if (equals(v, kv[1])) { - return true; - } - } - return false; -} -export function tryGetValue(map, key, defaultValue) { - if (map.has(key)) { - defaultValue.contents = map.get(key); - return true; - } - return false; -} -export function addToSet(v, set) { - if (set.has(v)) { - return false; - } - set.add(v); - return true; -} -export function addToDict(dict, k, v) { - if (dict.has(k)) { - throw new Error("An item with the same key has already been added. Key: " + k); - } - dict.set(k, v); -} -export function getItemFromDict(map, key) { - if (map.has(key)) { - return map.get(key); - } - else { - throw new Error(`The given key '${key}' was not present in the dictionary.`); - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.d.ts deleted file mode 100644 index a4f51755..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { IEqualityComparer, IMap, IEnumerator } from "./Util.js"; -import { Option } from "./Option.js"; -import { int32 } from "./Int32.js"; -import { FSharpRef } from "./Types.js"; -import { TypeInfo } from "./Reflection.js"; -export declare class Dictionary implements IMap, Iterable<[Key, Value]>, Iterable<[Key, Value]> { - readonly comparer: IEqualityComparer; - readonly hashMap: IMap; - "init@9": int32; - constructor(pairs: Iterable<[Key, Value]>, comparer: IEqualityComparer); - get [Symbol.toStringTag](): string; - toJSON(): any; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; - GetEnumerator(): IEnumerator<[Key, Value]>; - [Symbol.iterator](): Iterator<[Key, Value]>; - "System.Collections.Generic.ICollection`1.Add2B595"(item: [Key, Value]): void; - "System.Collections.Generic.ICollection`1.Clear"(): void; - "System.Collections.Generic.ICollection`1.Contains2B595"(item: [Key, Value]): boolean; - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array: [Key, Value][], arrayIndex: int32): void; - "System.Collections.Generic.ICollection`1.get_Count"(): int32; - "System.Collections.Generic.ICollection`1.get_IsReadOnly"(): boolean; - "System.Collections.Generic.ICollection`1.Remove2B595"(item: [Key, Value]): boolean; - "System.Collections.Generic.IDictionary`2.Add5BDDA1"(key: Key, value: Value): void; - "System.Collections.Generic.IDictionary`2.ContainsKey2B595"(key: Key): boolean; - "System.Collections.Generic.IDictionary`2.get_Item2B595"(key: Key): Value; - "System.Collections.Generic.IDictionary`2.set_Item5BDDA1"(key: Key, v: Value): void; - "System.Collections.Generic.IDictionary`2.get_Keys"(): Iterable; - "System.Collections.Generic.IDictionary`2.Remove2B595"(key: Key): boolean; - "System.Collections.Generic.IDictionary`2.TryGetValue6DC89625"(key: Key, value: FSharpRef): boolean; - "System.Collections.Generic.IDictionary`2.get_Values"(): Iterable; - get size(): int32; - clear(): void; - delete(k: Key): boolean; - entries(): Iterable<[Key, Value]>; - get(k: Key): Value; - has(k: Key): boolean; - keys(): Iterable; - set(k: Key, v: Value): IMap; - values(): Iterable; - forEach(f: ((arg0: Value, arg1: Key, arg2: IMap) => void), thisArg?: Option): void; -} -export declare function Dictionary_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo; -export declare function Dictionary_$ctor_6623D9B3(pairs: Iterable<[Key, Value]>, comparer: IEqualityComparer): Dictionary; -export declare function Dictionary__TryFind_2B595(this$: Dictionary, k: Key): Option<[Key, Value]>; -export declare function Dictionary__get_Comparer(this$: Dictionary): IEqualityComparer; -export declare function Dictionary__Clear(this$: Dictionary): void; -export declare function Dictionary__get_Count(this$: Dictionary): int32; -export declare function Dictionary__get_Item_2B595(this$: Dictionary, k: Key): Value; -export declare function Dictionary__set_Item_5BDDA1(this$: Dictionary, k: Key, v: Value): void; -export declare function Dictionary__Add_5BDDA1(this$: Dictionary, k: Key, v: Value): void; -export declare function Dictionary__ContainsKey_2B595(this$: Dictionary, k: Key): boolean; -export declare function Dictionary__Remove_2B595(this$: Dictionary, k: Key): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.js deleted file mode 100644 index b134922b..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableMap.js +++ /dev/null @@ -1,326 +0,0 @@ -import { disposeSafe, defaultOf, equals, toIterator, getEnumerator } from "./Util.js"; -import { iterate, map, delay, toArray, iterateIndexed, concat } from "./Seq.js"; -import { value as value_1 } from "./Option.js"; -import { FSharpRef } from "./Types.js"; -import { class_type } from "./Reflection.js"; -import { getItemFromDict, tryGetValue } from "./MapUtil.js"; -import { format } from "./String.js"; -export class Dictionary { - constructor(pairs, comparer) { - const this$ = new FSharpRef(defaultOf()); - this.comparer = comparer; - this$.contents = this; - this.hashMap = (new Map([])); - this["init@9"] = 1; - const enumerator = getEnumerator(pairs); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const pair = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - Dictionary__Add_5BDDA1(this$.contents, pair[0], pair[1]); - } - } - finally { - disposeSafe(enumerator); - } - } - get [Symbol.toStringTag]() { - return "Dictionary"; - } - toJSON() { - const this$ = this; - return Array.from(this$); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const this$ = this; - return getEnumerator(this$); - } - GetEnumerator() { - const this$ = this; - return getEnumerator(concat(this$.hashMap.values())); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.Generic.ICollection`1.Add2B595"(item) { - const this$ = this; - Dictionary__Add_5BDDA1(this$, item[0], item[1]); - } - "System.Collections.Generic.ICollection`1.Clear"() { - const this$ = this; - Dictionary__Clear(this$); - } - "System.Collections.Generic.ICollection`1.Contains2B595"(item) { - const this$ = this; - const matchValue = Dictionary__TryFind_2B595(this$, item[0]); - let matchResult, p_1; - if (matchValue != null) { - if (equals(value_1(matchValue)[1], item[1])) { - matchResult = 0; - p_1 = value_1(matchValue); - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return true; - default: - return false; - } - } - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) { - const this$ = this; - iterateIndexed((i, e) => { - array[arrayIndex + i] = e; - }, this$); - } - "System.Collections.Generic.ICollection`1.get_Count"() { - const this$ = this; - return Dictionary__get_Count(this$) | 0; - } - "System.Collections.Generic.ICollection`1.get_IsReadOnly"() { - return false; - } - "System.Collections.Generic.ICollection`1.Remove2B595"(item) { - const this$ = this; - const matchValue = Dictionary__TryFind_2B595(this$, item[0]); - if (matchValue != null) { - if (equals(value_1(matchValue)[1], item[1])) { - Dictionary__Remove_2B595(this$, item[0]); - } - return true; - } - else { - return false; - } - } - "System.Collections.Generic.IDictionary`2.Add5BDDA1"(key, value) { - const this$ = this; - Dictionary__Add_5BDDA1(this$, key, value); - } - "System.Collections.Generic.IDictionary`2.ContainsKey2B595"(key) { - const this$ = this; - return Dictionary__ContainsKey_2B595(this$, key); - } - "System.Collections.Generic.IDictionary`2.get_Item2B595"(key) { - const this$ = this; - return Dictionary__get_Item_2B595(this$, key); - } - "System.Collections.Generic.IDictionary`2.set_Item5BDDA1"(key, v) { - const this$ = this; - Dictionary__set_Item_5BDDA1(this$, key, v); - } - "System.Collections.Generic.IDictionary`2.get_Keys"() { - const this$ = this; - return toArray(delay(() => map((pair) => pair[0], this$))); - } - "System.Collections.Generic.IDictionary`2.Remove2B595"(key) { - const this$ = this; - return Dictionary__Remove_2B595(this$, key); - } - "System.Collections.Generic.IDictionary`2.TryGetValue6DC89625"(key, value) { - const this$ = this; - const matchValue = Dictionary__TryFind_2B595(this$, key); - if (matchValue != null) { - const pair = value_1(matchValue); - value.contents = pair[1]; - return true; - } - else { - return false; - } - } - "System.Collections.Generic.IDictionary`2.get_Values"() { - const this$ = this; - return toArray(delay(() => map((pair) => pair[1], this$))); - } - get size() { - const this$ = this; - return Dictionary__get_Count(this$) | 0; - } - clear() { - const this$ = this; - Dictionary__Clear(this$); - } - delete(k) { - const this$ = this; - return Dictionary__Remove_2B595(this$, k); - } - entries() { - const this$ = this; - return map((p) => [p[0], p[1]], this$); - } - get(k) { - const this$ = this; - return Dictionary__get_Item_2B595(this$, k); - } - has(k) { - const this$ = this; - return Dictionary__ContainsKey_2B595(this$, k); - } - keys() { - const this$ = this; - return map((p) => p[0], this$); - } - set(k, v) { - const this$ = this; - Dictionary__set_Item_5BDDA1(this$, k, v); - return this$; - } - values() { - const this$ = this; - return map((p) => p[1], this$); - } - forEach(f, thisArg) { - const this$ = this; - iterate((p) => { - f(p[1], p[0], this$); - }, this$); - } -} -export function Dictionary_$reflection(gen0, gen1) { - return class_type("Fable.Collections.Dictionary", [gen0, gen1], Dictionary); -} -export function Dictionary_$ctor_6623D9B3(pairs, comparer) { - return new Dictionary(pairs, comparer); -} -function Dictionary__TryFindIndex_2B595(this$, k) { - const h = this$.comparer.GetHashCode(k) | 0; - let matchValue; - let outArg = defaultOf(); - matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => { - outArg = v; - })), outArg]; - if (matchValue[0]) { - return [true, h, matchValue[1].findIndex((pair) => this$.comparer.Equals(k, pair[0]))]; - } - else { - return [false, h, -1]; - } -} -export function Dictionary__TryFind_2B595(this$, k) { - const matchValue = Dictionary__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]]; - default: - return void 0; - } -} -export function Dictionary__get_Comparer(this$) { - return this$.comparer; -} -export function Dictionary__Clear(this$) { - this$.hashMap.clear(); -} -export function Dictionary__get_Count(this$) { - let count = 0; - let enumerator = getEnumerator(this$.hashMap.values()); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const pairs = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - count = ((count + pairs.length) | 0); - } - } - finally { - disposeSafe(enumerator); - } - return count | 0; -} -export function Dictionary__get_Item_2B595(this$, k) { - const matchValue = Dictionary__TryFind_2B595(this$, k); - if (matchValue != null) { - return value_1(matchValue)[1]; - } - else { - throw new Error("The item was not found in collection"); - } -} -export function Dictionary__set_Item_5BDDA1(this$, k, v) { - const matchValue = Dictionary__TryFindIndex_2B595(this$, k); - if (matchValue[0]) { - if (matchValue[2] > -1) { - getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]] = [k, v]; - } - else { - const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v])); - } - } - else { - this$.hashMap.set(matchValue[1], [[k, v]]); - } -} -export function Dictionary__Add_5BDDA1(this$, k, v) { - const matchValue = Dictionary__TryFindIndex_2B595(this$, k); - if (matchValue[0]) { - if (matchValue[2] > -1) { - throw new Error(format("An item with the same key has already been added. Key: {0}", k)); - } - else { - const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v])); - } - } - else { - this$.hashMap.set(matchValue[1], [[k, v]]); - } -} -export function Dictionary__ContainsKey_2B595(this$, k) { - const matchValue = Dictionary__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return true; - default: - return false; - } -} -export function Dictionary__Remove_2B595(this$, k) { - const matchValue = Dictionary__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: { - getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1); - return true; - } - default: - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.d.ts deleted file mode 100644 index f9f3c599..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { IMap, IEqualityComparer, ISet, IEnumerator } from "./Util.js"; -import { int32 } from "./Int32.js"; -import { Option } from "./Option.js"; -import { TypeInfo } from "./Reflection.js"; -export declare class HashSet implements ISet, Iterable, Iterable { - readonly comparer: IEqualityComparer; - readonly hashMap: IMap; - "init@9": int32; - constructor(items: Iterable, comparer: IEqualityComparer); - get [Symbol.toStringTag](): string; - toJSON(): any; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.Generic.ICollection`1.Add2B595"(item: T): void; - "System.Collections.Generic.ICollection`1.Clear"(): void; - "System.Collections.Generic.ICollection`1.Contains2B595"(item: T): boolean; - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array: T[], arrayIndex: int32): void; - "System.Collections.Generic.ICollection`1.get_Count"(): int32; - "System.Collections.Generic.ICollection`1.get_IsReadOnly"(): boolean; - "System.Collections.Generic.ICollection`1.Remove2B595"(item: T): boolean; - get size(): int32; - add(k: T): ISet; - clear(): void; - delete(k: T): boolean; - has(k: T): boolean; - keys(): Iterable; - values(): Iterable; - entries(): Iterable<[T, T]>; - forEach(f: ((arg0: T, arg1: T, arg2: ISet) => void), thisArg?: Option): void; -} -export declare function HashSet_$reflection(gen0: TypeInfo): TypeInfo; -export declare function HashSet_$ctor_Z6150332D(items: Iterable, comparer: IEqualityComparer): HashSet; -export declare function HashSet__get_Comparer(this$: HashSet): IEqualityComparer; -export declare function HashSet__Clear(this$: HashSet): void; -export declare function HashSet__get_Count(this$: HashSet): int32; -export declare function HashSet__Add_2B595(this$: HashSet, k: T): boolean; -export declare function HashSet__Contains_2B595(this$: HashSet, k: T): boolean; -export declare function HashSet__Remove_2B595(this$: HashSet, k: T): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.js deleted file mode 100644 index e12b4c79..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/MutableSet.js +++ /dev/null @@ -1,232 +0,0 @@ -import { disposeSafe, defaultOf, toIterator, getEnumerator } from "./Util.js"; -import { iterate, map, iterateIndexed, concat } from "./Seq.js"; -import { some } from "./Option.js"; -import { FSharpRef } from "./Types.js"; -import { class_type } from "./Reflection.js"; -import { getItemFromDict, tryGetValue } from "./MapUtil.js"; -export class HashSet { - constructor(items, comparer) { - const this$ = new FSharpRef(defaultOf()); - this.comparer = comparer; - this$.contents = this; - this.hashMap = (new Map([])); - this["init@9"] = 1; - const enumerator = getEnumerator(items); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - HashSet__Add_2B595(this$.contents, item); - } - } - finally { - disposeSafe(enumerator); - } - } - get [Symbol.toStringTag]() { - return "HashSet"; - } - toJSON() { - const this$ = this; - return Array.from(this$); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const this$ = this; - return getEnumerator(this$); - } - GetEnumerator() { - const this$ = this; - return getEnumerator(concat(this$.hashMap.values())); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.Generic.ICollection`1.Add2B595"(item) { - const this$ = this; - HashSet__Add_2B595(this$, item); - } - "System.Collections.Generic.ICollection`1.Clear"() { - const this$ = this; - HashSet__Clear(this$); - } - "System.Collections.Generic.ICollection`1.Contains2B595"(item) { - const this$ = this; - return HashSet__Contains_2B595(this$, item); - } - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) { - const this$ = this; - iterateIndexed((i, e) => { - array[arrayIndex + i] = e; - }, this$); - } - "System.Collections.Generic.ICollection`1.get_Count"() { - const this$ = this; - return HashSet__get_Count(this$) | 0; - } - "System.Collections.Generic.ICollection`1.get_IsReadOnly"() { - return false; - } - "System.Collections.Generic.ICollection`1.Remove2B595"(item) { - const this$ = this; - return HashSet__Remove_2B595(this$, item); - } - get size() { - const this$ = this; - return HashSet__get_Count(this$) | 0; - } - add(k) { - const this$ = this; - HashSet__Add_2B595(this$, k); - return this$; - } - clear() { - const this$ = this; - HashSet__Clear(this$); - } - delete(k) { - const this$ = this; - return HashSet__Remove_2B595(this$, k); - } - has(k) { - const this$ = this; - return HashSet__Contains_2B595(this$, k); - } - keys() { - const this$ = this; - return map((x) => x, this$); - } - values() { - const this$ = this; - return map((x) => x, this$); - } - entries() { - const this$ = this; - return map((v) => [v, v], this$); - } - forEach(f, thisArg) { - const this$ = this; - iterate((x) => { - f(x, x, this$); - }, this$); - } -} -export function HashSet_$reflection(gen0) { - return class_type("Fable.Collections.HashSet", [gen0], HashSet); -} -export function HashSet_$ctor_Z6150332D(items, comparer) { - return new HashSet(items, comparer); -} -function HashSet__TryFindIndex_2B595(this$, k) { - const h = this$.comparer.GetHashCode(k) | 0; - let matchValue; - let outArg = defaultOf(); - matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => { - outArg = v; - })), outArg]; - if (matchValue[0]) { - return [true, h, matchValue[1].findIndex((v_1) => this$.comparer.Equals(k, v_1))]; - } - else { - return [false, h, -1]; - } -} -function HashSet__TryFind_2B595(this$, k) { - const matchValue = HashSet__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return some(getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]]); - default: - return void 0; - } -} -export function HashSet__get_Comparer(this$) { - return this$.comparer; -} -export function HashSet__Clear(this$) { - this$.hashMap.clear(); -} -export function HashSet__get_Count(this$) { - let count = 0; - let enumerator = getEnumerator(this$.hashMap.values()); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const items = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - count = ((count + items.length) | 0); - } - } - finally { - disposeSafe(enumerator); - } - return count | 0; -} -export function HashSet__Add_2B595(this$, k) { - const matchValue = HashSet__TryFindIndex_2B595(this$, k); - if (matchValue[0]) { - if (matchValue[2] > -1) { - return false; - } - else { - const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k)); - return true; - } - } - else { - this$.hashMap.set(matchValue[1], [k]); - return true; - } -} -export function HashSet__Contains_2B595(this$, k) { - const matchValue = HashSet__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: - return true; - default: - return false; - } -} -export function HashSet__Remove_2B595(this$, k) { - const matchValue = HashSet__TryFindIndex_2B595(this$, k); - let matchResult; - if (matchValue[0]) { - if (matchValue[2] > -1) { - matchResult = 0; - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: { - getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1); - return true; - } - default: - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.d.ts deleted file mode 100644 index 553575ee..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { int32 } from "./Int32.js"; -export declare function Helpers_allocateArrayFromCons(cons: any, len: int32): T[]; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.js deleted file mode 100644 index bbb0d1f5..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Native.js +++ /dev/null @@ -1,8 +0,0 @@ -export function Helpers_allocateArrayFromCons(cons, len) { - if ((typeof cons) === "function") { - return new cons(len); - } - else { - return new Array(len); - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.d.ts deleted file mode 100644 index 370a54e4..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IComparable } from "./Util.js"; -export declare const symbol: unique symbol; -export interface CustomNumeric extends IComparable { - [symbol](): { - multiply(y: Numeric): Numeric; - toPrecision(sd?: number): string; - toExponential(dp?: number): string; - toFixed(dp?: number): string; - toHex(): string; - }; -} -export type Numeric = number | bigint | CustomNumeric; -export declare function isNumeric(x: any): any; -export declare function compare(x: Numeric, y: number): number; -export declare function multiply(x: Numeric, y: number): Numeric; -export declare function toFixed(x: Numeric, dp?: number): string | bigint; -export declare function toPrecision(x: Numeric, sd?: number): string | bigint; -export declare function toExponential(x: Numeric, dp?: number): string | bigint; -export declare function toHex(x: Numeric): string; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.js deleted file mode 100644 index 7e453658..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Numeric.js +++ /dev/null @@ -1,71 +0,0 @@ -export const symbol = Symbol("numeric"); -export function isNumeric(x) { - return typeof x === "number" || typeof x === "bigint" || x?.[symbol]; -} -export function compare(x, y) { - if (typeof x === "number") { - return x < y ? -1 : (x > y ? 1 : 0); - } - else if (typeof x === "bigint") { - return x < y ? -1 : (x > y ? 1 : 0); - } - else { - return x.CompareTo(y); - } -} -export function multiply(x, y) { - if (typeof x === "number") { - return x * y; - } - else if (typeof x === "bigint") { - return x * BigInt(y); - } - else { - return x[symbol]().multiply(y); - } -} -export function toFixed(x, dp) { - if (typeof x === "number") { - return x.toFixed(dp); - } - else if (typeof x === "bigint") { - return x; - } - else { - return x[symbol]().toFixed(dp); - } -} -export function toPrecision(x, sd) { - if (typeof x === "number") { - return x.toPrecision(sd); - } - else if (typeof x === "bigint") { - return x; - } - else { - return x[symbol]().toPrecision(sd); - } -} -export function toExponential(x, dp) { - if (typeof x === "number") { - return x.toExponential(dp); - } - else if (typeof x === "bigint") { - return x; - } - else { - return x[symbol]().toExponential(dp); - } -} -export function toHex(x) { - if (typeof x === "number") { - return (Number(x) >>> 0).toString(16); - } - else if (typeof x === "bigint") { - // TODO: properly handle other bit sizes - return BigInt.asUintN(64, x).toString(16); - } - else { - return x[symbol]().toHex(); - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.d.ts deleted file mode 100644 index 9849d50c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { FSharpChoice$2_$union } from "./Choice.js"; -import { Option } from "./Option.js"; -import { IDisposable } from "./Util.js"; -export interface IObserver { - OnNext: (x: T) => void; - OnError: (e: any) => void; - OnCompleted: () => void; -} -export declare class Observer implements IObserver { - OnNext: (x: T) => void; - OnError: (e: any) => void; - OnCompleted: () => void; - constructor(onNext: (x: T) => void, onError?: (e: any) => void, onCompleted?: () => void); -} -export interface IObservable { - Subscribe: (o: IObserver) => IDisposable; -} -declare class Observable implements IObservable { - Subscribe: (o: IObserver) => IDisposable; - constructor(subscribe: (o: IObserver) => IDisposable); -} -export declare function add(callback: (x: T) => void, source: IObservable): void; -export declare function choose(chooser: (x: T) => Option, source: IObservable): Observable; -export declare function filter(predicate: (x: T) => boolean, source: IObservable): IObservable; -export declare function map(mapping: (x: T) => U, source: IObservable): IObservable; -export declare function merge(source1: IObservable, source2: IObservable): IObservable; -export declare function pairwise(source: IObservable): IObservable<[T, T]>; -export declare function partition(predicate: (x: T) => boolean, source: IObservable): [Observable, Observable]; -export declare function scan(collector: (u: U, t: T) => U, state: U, source: IObservable): IObservable; -export declare function split(splitter: (x: T) => FSharpChoice$2_$union, source: IObservable): [Observable, Observable]; -export declare function subscribe(callback: (x: T) => void, source: IObservable): IDisposable; -export {}; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.js deleted file mode 100644 index 966b05a3..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Observable.js +++ /dev/null @@ -1,113 +0,0 @@ -import { Choice_tryValueIfChoice1Of2, Choice_tryValueIfChoice2Of2 } from "./Choice.js"; -import { value } from "./Option.js"; -export class Observer { - constructor(onNext, onError, onCompleted) { - this.OnNext = onNext; - this.OnError = onError || ((_e) => { return; }); - this.OnCompleted = onCompleted || (() => { return; }); - } -} -class Observable { - constructor(subscribe) { - this.Subscribe = subscribe; - } -} -function protect(f, succeed, fail) { - try { - return succeed(f()); - } - catch (e) { - fail(e); - } -} -export function add(callback, source) { - source.Subscribe(new Observer(callback)); -} -export function choose(chooser, source) { - return new Observable((observer) => source.Subscribe(new Observer((t) => protect(() => chooser(t), (u) => { if (u != null) { - observer.OnNext(value(u)); - } }, observer.OnError), observer.OnError, observer.OnCompleted))); -} -export function filter(predicate, source) { - return choose((x) => predicate(x) ? x : void 0, source); -} -export function map(mapping, source) { - return new Observable((observer) => source.Subscribe(new Observer((t) => { - protect(() => mapping(t), observer.OnNext, observer.OnError); - }, observer.OnError, observer.OnCompleted))); -} -export function merge(source1, source2) { - return new Observable((observer) => { - let stopped = false; - let completed1 = false; - let completed2 = false; - const h1 = source1.Subscribe(new Observer((v) => { if (!stopped) { - observer.OnNext(v); - } }, (e) => { - if (!stopped) { - stopped = true; - observer.OnError(e); - } - }, () => { - if (!stopped) { - completed1 = true; - if (completed2) { - stopped = true; - observer.OnCompleted(); - } - } - })); - const h2 = source2.Subscribe(new Observer((v) => { if (!stopped) { - observer.OnNext(v); - } }, (e) => { - if (!stopped) { - stopped = true; - observer.OnError(e); - } - }, () => { - if (!stopped) { - completed2 = true; - if (completed1) { - stopped = true; - observer.OnCompleted(); - } - } - })); - return { - Dispose() { - h1.Dispose(); - h2.Dispose(); - }, - }; - }); -} -export function pairwise(source) { - return new Observable((observer) => { - let last; - return source.Subscribe(new Observer((next) => { - if (last != null) { - observer.OnNext([last, next]); - } - last = next; - }, observer.OnError, observer.OnCompleted)); - }); -} -export function partition(predicate, source) { - return [filter(predicate, source), filter((x) => !predicate(x), source)]; -} -export function scan(collector, state, source) { - return new Observable((observer) => { - return source.Subscribe(new Observer((t) => { - protect(() => collector(state, t), (u) => { state = u; observer.OnNext(u); }, observer.OnError); - }, observer.OnError, observer.OnCompleted)); - }); -} -export function split(splitter, source) { - return [ - choose((v) => Choice_tryValueIfChoice1Of2(splitter(v)), source), - choose((v) => Choice_tryValueIfChoice2Of2(splitter(v)), source) - ]; -} -export function subscribe(callback, source) { - return source.Subscribe(new Observer(callback)); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.d.ts deleted file mode 100644 index f7bedab3..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export type Nullable = T | null | undefined; -export type Option = T | Some | undefined; -export declare class Some { - value: T; - constructor(value: T); - toJSON(): T; - toString(): string; - GetHashCode(): number; - Equals(other: Option): boolean; - CompareTo(other: Option): number; -} -export declare function value(x: Option): T; -export declare function unwrap(opt: Option): T | undefined; -export declare function some(x: T): Option; -export declare function ofNullable(x: Nullable): Option; -export declare function toNullable(x: Option): Nullable; -export declare function flatten(x: Option>): T | Some | undefined; -export declare function toArray(opt: Option): T[]; -export declare function defaultArg(opt: Option, defaultValue: T): T; -export declare function defaultArgWith(opt: Option, defThunk: () => T): T; -export declare function orElse(opt: Option, ifNone: Option): Option; -export declare function orElseWith(opt: Option, ifNoneThunk: () => Option): Option; -export declare function filter(predicate: (arg: T) => boolean, opt: Option): Option; -export declare function map(mapping: (arg: T) => U, opt: Option): Option; -export declare function map2(mapping: (arg1: T1, arg2: T2) => Option, opt1: Option, opt2: Option): Option; -export declare function map3(mapping: (arg1: T1, arg2: T2, arg3: T3) => Option, opt1: Option, opt2: Option, opt3: Option): Option; -export declare function bind(binder: (arg: T) => Option, opt: Option): Option; -export declare function tryOp(op: (x: T) => U, arg: T): Option; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.js deleted file mode 100644 index 38ee58d5..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Option.js +++ /dev/null @@ -1,96 +0,0 @@ -import { structuralHash, equals, compare } from "./Util.js"; -// Using a class here for better compatibility with TS files importing Some -export class Some { - constructor(value) { - this.value = value; - } - toJSON() { - return this.value; - } - // Don't add "Some" for consistency with erased options - toString() { - return String(this.value); - } - GetHashCode() { - return structuralHash(this.value); - } - Equals(other) { - if (other == null) { - return false; - } - else { - return equals(this.value, other instanceof Some ? other.value : other); - } - } - CompareTo(other) { - if (other == null) { - return 1; - } - else { - return compare(this.value, other instanceof Some ? other.value : other); - } - } -} -export function value(x) { - if (x == null) { - throw new Error("Option has no value"); - } - else { - return x instanceof Some ? x.value : x; - } -} -export function unwrap(opt) { - return opt instanceof Some ? opt.value : opt; -} -export function some(x) { - return x == null || x instanceof Some ? new Some(x) : x; -} -export function ofNullable(x) { - // This will fail with unit probably, an alternative would be: - // return x === null ? undefined : (x === undefined ? new Some(x) : x); - return x == null ? undefined : x; -} -export function toNullable(x) { - return x == null ? null : value(x); -} -export function flatten(x) { - return x == null ? undefined : value(x); -} -export function toArray(opt) { - return (opt == null) ? [] : [value(opt)]; -} -export function defaultArg(opt, defaultValue) { - return (opt != null) ? value(opt) : defaultValue; -} -export function defaultArgWith(opt, defThunk) { - return (opt != null) ? value(opt) : defThunk(); -} -export function orElse(opt, ifNone) { - return opt == null ? ifNone : opt; -} -export function orElseWith(opt, ifNoneThunk) { - return opt == null ? ifNoneThunk() : opt; -} -export function filter(predicate, opt) { - return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt; -} -export function map(mapping, opt) { - return (opt != null) ? some(mapping(value(opt))) : undefined; -} -export function map2(mapping, opt1, opt2) { - return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined; -} -export function map3(mapping, opt1, opt2, opt3) { - return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined; -} -export function bind(binder, opt) { - return opt != null ? binder(value(opt)) : undefined; -} -export function tryOp(op, arg) { - try { - return some(op(arg)); - } - catch { - return undefined; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/README.md b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/README.md deleted file mode 100644 index 835ad4a3..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# fable-library - -Core library used by F# projects compiled with [Fable](https://fable.io). \ No newline at end of file diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.d.ts deleted file mode 100644 index e2912236..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { uint8, int32, float64 } from "./Int32.js"; -import { TypeInfo } from "./Reflection.js"; -export interface IRandom { - Next0(): int32; - Next1(maxValue: int32): int32; - Next2(minValue: int32, maxValue: int32): int32; - NextBytes(buffer: uint8[]): void; - NextDouble(): float64; -} -export declare class NonSeeded implements IRandom { - constructor(); - Next0(): int32; - Next1(maxValue: int32): int32; - Next2(minValue: int32, maxValue: int32): int32; - NextDouble(): float64; - NextBytes(buffer: uint8[]): void; -} -export declare function NonSeeded_$reflection(): TypeInfo; -export declare function NonSeeded_$ctor(): NonSeeded; -export declare class Seeded implements IRandom { - readonly MBIG: int32; - inext: int32; - inextp: int32; - seedArray: int32[]; - constructor(seed: int32); - Next0(): int32; - Next1(maxValue: int32): int32; - Next2(minValue: int32, maxValue: int32): int32; - NextDouble(): float64; - NextBytes(buffer: uint8[]): void; -} -export declare function Seeded_$reflection(): TypeInfo; -export declare function Seeded_$ctor_Z524259A4(seed: int32): Seeded; -export declare function Seeded__Sample(this$: Seeded): float64; -export declare function Seeded__GetSampleForLargeRange(this$: Seeded): float64; -export declare function nonSeeded(): NonSeeded; -export declare function seeded(seed: int32): Seeded; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.js deleted file mode 100644 index 7b67ec3c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Random.js +++ /dev/null @@ -1,170 +0,0 @@ -import { class_type } from "./Reflection.js"; -import { fromFloat64, op_Addition, toInt32, toFloat64, compare, fromInt32, toInt64 } from "./BigInt.js"; -import { fill } from "./Array.js"; -function Native_random() { - return Math.random(); -} -function Native_randomNext(min, max) { - if (max < min) { - throw new Error("minValue must be less than maxValue"); - } - return Math.floor(Math.random() * (max - min)) + min; -} -function Native_randomBytes(buffer) { - if (buffer == null) { - throw new Error("Buffer cannot be null"); - } - for (let i = 0; i < buffer.length; i += 6) { - // Pick random 48-bit number. Fill buffer in 2 24-bit chunks to avoid bitwise truncation. - let r = Math.floor(Math.random() * 281474976710656); // Low 24 bits = chunk 1. - const rhi = Math.floor(r / 16777216); // High 24 bits shifted via division = chunk 2. - for (let j = 0; j < 6 && i + j < buffer.length; j++) { - if (j === 3) { - r = rhi; - } - buffer[i + j] = r & 255; - r >>>= 8; - } - } - ; -} -export class NonSeeded { - constructor() { - } - Next0() { - return Native_randomNext(0, 2147483647); - } - Next1(maxValue) { - return Native_randomNext(0, maxValue); - } - Next2(minValue, maxValue) { - return Native_randomNext(minValue, maxValue); - } - NextDouble() { - return Native_random(); - } - NextBytes(buffer) { - Native_randomBytes(buffer); - } -} -export function NonSeeded_$reflection() { - return class_type("Random.NonSeeded", void 0, NonSeeded); -} -export function NonSeeded_$ctor() { - return new NonSeeded(); -} -export class Seeded { - constructor(seed) { - this.MBIG = 2147483647; - this.inext = 0; - this.inextp = 0; - this.seedArray = fill(new Array(56), 0, 56, 0); - let ii = 0; - let mj = 0; - let mk = 0; - const subtraction = ((seed === -2147483648) ? 2147483647 : Math.abs(seed)) | 0; - mj = ((161803398 - subtraction) | 0); - this.seedArray[55] = (mj | 0); - mk = 1; - for (let i = 1; i <= 54; i++) { - ii = (((21 * i) % 55) | 0); - this.seedArray[ii] = (mk | 0); - mk = ((mj - mk) | 0); - if (mk < 0) { - mk = ((mk + this.MBIG) | 0); - } - mj = (this.seedArray[ii] | 0); - } - for (let k = 1; k <= 4; k++) { - for (let i_1 = 1; i_1 <= 55; i_1++) { - this.seedArray[i_1] = ((this.seedArray[i_1] - this.seedArray[1 + ((i_1 + 30) % 55)]) | 0); - if (this.seedArray[i_1] < 0) { - this.seedArray[i_1] = ((this.seedArray[i_1] + this.MBIG) | 0); - } - } - } - this.inext = 0; - this.inextp = 21; - } - Next0() { - const this$ = this; - return Seeded__InternalSample(this$) | 0; - } - Next1(maxValue) { - const this$ = this; - if (maxValue < 0) { - throw new Error("maxValue must be positive"); - } - return ~~(Seeded__Sample(this$) * maxValue) | 0; - } - Next2(minValue, maxValue) { - const this$ = this; - if (minValue > maxValue) { - throw new Error("minValue must be less than maxValue"); - } - const range = toInt64(fromInt32(maxValue - minValue)); - return ((compare(range, toInt64(fromInt32(2147483647))) <= 0) ? (~~(Seeded__Sample(this$) * toFloat64(range)) + minValue) : ~~toInt32(toInt64(op_Addition(toInt64(fromFloat64(Seeded__GetSampleForLargeRange(this$) * toFloat64(range))), toInt64(fromInt32(minValue)))))) | 0; - } - NextDouble() { - const this$ = this; - return Seeded__Sample(this$); - } - NextBytes(buffer) { - const this$ = this; - if (buffer == null) { - throw new Error("buffer"); - } - for (let i = 0; i <= (buffer.length - 1); i++) { - buffer[i] = ((Seeded__InternalSample(this$) % (~~255 + 1)) & 0xFF); - } - } -} -export function Seeded_$reflection() { - return class_type("Random.Seeded", void 0, Seeded); -} -export function Seeded_$ctor_Z524259A4(seed) { - return new Seeded(seed); -} -function Seeded__InternalSample(_) { - let retVal = 0; - let locINext = _.inext; - let locINextp = _.inextp; - locINext = ((locINext + 1) | 0); - if (locINext >= 56) { - locINext = 1; - } - locINextp = ((locINextp + 1) | 0); - if (locINextp >= 56) { - locINextp = 1; - } - retVal = ((_.seedArray[locINext] - _.seedArray[locINextp]) | 0); - if (retVal === _.MBIG) { - retVal = ((retVal - 1) | 0); - } - if (retVal < 0) { - retVal = ((retVal + _.MBIG) | 0); - } - _.seedArray[locINext] = (retVal | 0); - _.inext = (locINext | 0); - _.inextp = (locINextp | 0); - return retVal | 0; -} -export function Seeded__Sample(this$) { - return Seeded__InternalSample(this$) * (1 / this$.MBIG); -} -export function Seeded__GetSampleForLargeRange(this$) { - let result = Seeded__InternalSample(this$); - if ((Seeded__InternalSample(this$) % 2) === 0) { - result = -result; - } - let d = result; - d = (d + (2147483647 - 1)); - d = (d / (2 * ((2147483647 - 1) >>> 0))); - return d; -} -export function nonSeeded() { - return NonSeeded_$ctor(); -} -export function seeded(seed) { - return Seeded_$ctor_Z524259A4(seed); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.d.ts deleted file mode 100644 index da5dfc34..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { float64 } from "./Int32.js"; -import { Option } from "./Option.js"; -import { uint64, int64 } from "./BigInt.js"; -import { decimal } from "./Decimal.js"; -export declare function makeRangeStepFunction(step: T, stop: T, zero: T, add: ((arg0: T, arg1: T) => T)): ((arg0: T) => Option<[T, T]>); -export declare function integralRangeStep(start: T, step: T, stop: T, zero: T, add: ((arg0: T, arg1: T) => T)): Iterable; -export declare function rangeBigInt(start: bigint, step: bigint, stop: bigint): Iterable; -export declare function rangeDecimal(start: decimal, step: decimal, stop: decimal): Iterable; -export declare function rangeDouble(start: float64, step: float64, stop: float64): Iterable; -export declare function rangeInt64(start: int64, step: int64, stop: int64): Iterable; -export declare function rangeUInt64(start: uint64, step: uint64, stop: uint64): Iterable; -export declare function rangeChar(start: string, stop: string): Iterable; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.js deleted file mode 100644 index 792fb6ef..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Range.js +++ /dev/null @@ -1,45 +0,0 @@ -import { compare } from "./Util.js"; -import { unfold, delay } from "./Seq.js"; -import { toUInt64, toInt64, op_Addition, fromZero } from "./BigInt.js"; -import { op_Addition as op_Addition_1, fromParts } from "./Decimal.js"; -export function makeRangeStepFunction(step, stop, zero, add) { - const stepComparedWithZero = compare(step, zero) | 0; - if (stepComparedWithZero === 0) { - throw new Error("The step of a range cannot be zero"); - } - const stepGreaterThanZero = stepComparedWithZero > 0; - return (x) => { - const comparedWithLast = compare(x, stop) | 0; - return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : (!stepGreaterThanZero && (comparedWithLast >= 0))) ? [x, add(x, step)] : void 0; - }; -} -export function integralRangeStep(start, step, stop, zero, add) { - const stepFn = makeRangeStepFunction(step, stop, zero, add); - return delay(() => unfold(stepFn, start)); -} -export function rangeBigInt(start, step, stop) { - return integralRangeStep(start, step, stop, fromZero(), op_Addition); -} -export function rangeDecimal(start, step, stop) { - return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), op_Addition_1); -} -export function rangeDouble(start, step, stop) { - return integralRangeStep(start, step, stop, 0, (x, y) => (x + y)); -} -export function rangeInt64(start, step, stop) { - return integralRangeStep(start, step, stop, 0n, (x, y) => toInt64(op_Addition(x, y))); -} -export function rangeUInt64(start, step, stop) { - return integralRangeStep(start, step, stop, 0n, (x, y) => toUInt64(op_Addition(x, y))); -} -export function rangeChar(start, stop) { - const intStop = stop.charCodeAt(0) | 0; - return delay(() => unfold((c) => { - if (c <= intStop) { - return [String.fromCharCode(c), c + 1]; - } - else { - return void 0; - } - }, start.charCodeAt(0))); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.d.ts deleted file mode 100644 index 3ac5eb83..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { FSharpRef } from "./Types.js"; -import { IEquatable } from "./Util.js"; -export type FieldInfo = [string, TypeInfo]; -export type PropertyInfo = FieldInfo; -export type ParameterInfo = FieldInfo; -export type Constructor = new (...args: any[]) => any; -export declare class CaseInfo { - declaringType: TypeInfo; - tag: number; - name: string; - fields?: FieldInfo[] | undefined; - constructor(declaringType: TypeInfo, tag: number, name: string, fields?: FieldInfo[] | undefined); -} -export type EnumCase = [string, number]; -export declare class MethodInfo { - name: string; - parameters: ParameterInfo[]; - returnType: TypeInfo; - constructor(name: string, parameters: ParameterInfo[], returnType: TypeInfo); -} -export declare class TypeInfo implements IEquatable { - fullname: string; - generics?: TypeInfo[] | undefined; - construct?: Constructor | undefined; - parent?: TypeInfo | undefined; - fields?: (() => FieldInfo[]) | undefined; - cases?: (() => CaseInfo[]) | undefined; - enumCases?: EnumCase[] | undefined; - constructor(fullname: string, generics?: TypeInfo[] | undefined, construct?: Constructor | undefined, parent?: TypeInfo | undefined, fields?: (() => FieldInfo[]) | undefined, cases?: (() => CaseInfo[]) | undefined, enumCases?: EnumCase[] | undefined); - toString(): string; - GetHashCode(): number; - Equals(other: TypeInfo): boolean; -} -export declare class GenericParameter extends TypeInfo { - constructor(name: string); -} -export declare function getGenerics(t: TypeInfo): TypeInfo[]; -export declare function getHashCode(t: TypeInfo): number; -export declare function equals(t1: TypeInfo, t2: TypeInfo): boolean; -export declare function class_type(fullname: string, generics?: TypeInfo[], construct?: Constructor, parent?: TypeInfo): TypeInfo; -export declare function record_type(fullname: string, generics: TypeInfo[], construct: Constructor, fields: () => FieldInfo[]): TypeInfo; -export declare function anonRecord_type(...fields: FieldInfo[]): TypeInfo; -export declare function union_type(fullname: string, generics: TypeInfo[], construct: Constructor, cases: () => FieldInfo[][]): TypeInfo; -export declare function tuple_type(...generics: TypeInfo[]): TypeInfo; -export declare function delegate_type(...generics: TypeInfo[]): TypeInfo; -export declare function lambda_type(argType: TypeInfo, returnType: TypeInfo): TypeInfo; -export declare function option_type(generic: TypeInfo): TypeInfo; -export declare function list_type(generic: TypeInfo): TypeInfo; -export declare function array_type(generic: TypeInfo): TypeInfo; -export declare function enum_type(fullname: string, underlyingType: TypeInfo, enumCases: EnumCase[]): TypeInfo; -export declare function measure_type(fullname: string): TypeInfo; -export declare function generic_type(name: string): TypeInfo; -export declare const obj_type: TypeInfo; -export declare const unit_type: TypeInfo; -export declare const char_type: TypeInfo; -export declare const string_type: TypeInfo; -export declare const bool_type: TypeInfo; -export declare const int8_type: TypeInfo; -export declare const uint8_type: TypeInfo; -export declare const int16_type: TypeInfo; -export declare const uint16_type: TypeInfo; -export declare const int32_type: TypeInfo; -export declare const uint32_type: TypeInfo; -export declare const int64_type: TypeInfo; -export declare const uint64_type: TypeInfo; -export declare const int128_type: TypeInfo; -export declare const uint128_type: TypeInfo; -export declare const nativeint_type: TypeInfo; -export declare const unativeint_type: TypeInfo; -export declare const float16_type: TypeInfo; -export declare const float32_type: TypeInfo; -export declare const float64_type: TypeInfo; -export declare const decimal_type: TypeInfo; -export declare const bigint_type: TypeInfo; -export declare function name(info: FieldInfo | TypeInfo | CaseInfo | MethodInfo): string; -export declare function fullName(t: TypeInfo): string; -export declare function namespace(t: TypeInfo): string; -export declare function isArray(t: TypeInfo): boolean; -export declare function getElementType(t: TypeInfo): TypeInfo | undefined; -export declare function isGenericType(t: TypeInfo): boolean; -export declare function isGenericParameter(t: TypeInfo): boolean; -export declare function isEnum(t: TypeInfo): boolean; -export declare function isSubclassOf(t1: TypeInfo, t2: TypeInfo): boolean; -export declare function isInstanceOfType(t: TypeInfo, o: any): boolean; -/** - * This doesn't replace types for fields (records) or cases (unions) - * but it should be enough for type comparison purposes - */ -export declare function getGenericTypeDefinition(t: TypeInfo): TypeInfo; -export declare function getEnumUnderlyingType(t: TypeInfo): TypeInfo | undefined; -export declare function getEnumValues(t: TypeInfo): number[]; -export declare function getEnumNames(t: TypeInfo): string[]; -export declare function parseEnum(t: TypeInfo, str: string): number; -export declare function tryParseEnum(t: TypeInfo, str: string, defValue: FSharpRef): boolean; -export declare function getEnumName(t: TypeInfo, v: number): string; -export declare function isEnumDefined(t: TypeInfo, v: string | number): boolean; -export declare function getUnionCases(t: TypeInfo): CaseInfo[]; -export declare function getRecordElements(t: TypeInfo): FieldInfo[]; -export declare function getTupleElements(t: TypeInfo): TypeInfo[]; -export declare function getFunctionElements(t: TypeInfo): [TypeInfo, TypeInfo]; -export declare function isUnion(t: any): boolean; -export declare function isRecord(t: any): boolean; -export declare function isTuple(t: TypeInfo): boolean; -export declare function isFunction(t: TypeInfo): boolean; -export declare function getUnionFields(v: any, t: TypeInfo): [CaseInfo, any[]]; -export declare function getUnionCaseFields(uci: CaseInfo): FieldInfo[]; -export declare function getRecordFields(v: any): any[]; -export declare function getRecordField(v: any, field: FieldInfo): any; -export declare function getTupleFields(v: any): any[]; -export declare function getTupleField(v: any, i: number): any; -export declare function makeUnion(uci: CaseInfo, values: any[]): any; -export declare function makeRecord(t: TypeInfo, values: any[]): any; -export declare function makeTuple(values: any[], _t: TypeInfo): any; -export declare function makeGenericType(t: TypeInfo, generics: TypeInfo[]): TypeInfo; -export declare function createInstance(t: TypeInfo, consArgs?: any[]): any; -export declare function getValue(propertyInfo: PropertyInfo, v: any): any; -export declare function getCaseTag(x: any): number; -export declare function getCaseName(x: any): string; -export declare function getCaseFields(x: any): any[]; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.js deleted file mode 100644 index 9c976581..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Reflection.js +++ /dev/null @@ -1,461 +0,0 @@ -import { Record, Union } from "./Types.js"; -import { combineHashCodes, equalArraysWith, stringHash } from "./Util.js"; -import Decimal from "./Decimal.js"; -export class CaseInfo { - constructor(declaringType, tag, name, fields) { - this.declaringType = declaringType; - this.tag = tag; - this.name = name; - this.fields = fields; - } -} -export class MethodInfo { - constructor(name, parameters, returnType) { - this.name = name; - this.parameters = parameters; - this.returnType = returnType; - } -} -export class TypeInfo { - constructor(fullname, generics, construct, parent, fields, cases, enumCases) { - this.fullname = fullname; - this.generics = generics; - this.construct = construct; - this.parent = parent; - this.fields = fields; - this.cases = cases; - this.enumCases = enumCases; - } - toString() { - return fullName(this); - } - GetHashCode() { - return getHashCode(this); - } - Equals(other) { - return equals(this, other); - } -} -export class GenericParameter extends TypeInfo { - constructor(name) { - super(name); - } -} -export function getGenerics(t) { - return t.generics != null ? t.generics : []; -} -export function getHashCode(t) { - const fullnameHash = stringHash(t.fullname); - const genHashes = getGenerics(t).map(getHashCode); - return combineHashCodes([fullnameHash, ...genHashes]); -} -export function equals(t1, t2) { - if (t1.fullname === "") { // Anonymous records - return t2.fullname === "" - && equalArraysWith(getRecordElements(t1), getRecordElements(t2), ([k1, v1], [k2, v2]) => k1 === k2 && equals(v1, v2)); - } - else { - return t1.fullname === t2.fullname - && equalArraysWith(getGenerics(t1), getGenerics(t2), equals); - } -} -export function class_type(fullname, generics, construct, parent) { - return new TypeInfo(fullname, generics, construct, parent); -} -export function record_type(fullname, generics, construct, fields) { - return new TypeInfo(fullname, generics, construct, undefined, fields); -} -export function anonRecord_type(...fields) { - return new TypeInfo("", undefined, undefined, undefined, () => fields); -} -export function union_type(fullname, generics, construct, cases) { - const t = new TypeInfo(fullname, generics, construct, undefined, undefined, () => { - const caseNames = construct.prototype.cases(); - return cases().map((fields, i) => new CaseInfo(t, i, caseNames[i], fields)); - }); - return t; -} -export function tuple_type(...generics) { - return new TypeInfo("System.Tuple`" + generics.length, generics); -} -export function delegate_type(...generics) { - return new TypeInfo("System.Func`" + generics.length, generics); -} -export function lambda_type(argType, returnType) { - return new TypeInfo("Microsoft.FSharp.Core.FSharpFunc`2", [argType, returnType]); -} -export function option_type(generic) { - return new TypeInfo("Microsoft.FSharp.Core.FSharpOption`1", [generic]); -} -export function list_type(generic) { - return new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1", [generic]); -} -export function array_type(generic) { - return new TypeInfo("[]", [generic]); -} -export function enum_type(fullname, underlyingType, enumCases) { - return new TypeInfo(fullname, [underlyingType], undefined, undefined, undefined, undefined, enumCases); -} -export function measure_type(fullname) { - return new TypeInfo(fullname); -} -export function generic_type(name) { - return new GenericParameter(name); -} -export const obj_type = new TypeInfo("System.Object"); -export const unit_type = new TypeInfo("Microsoft.FSharp.Core.Unit"); -export const char_type = new TypeInfo("System.Char"); -export const string_type = new TypeInfo("System.String"); -export const bool_type = new TypeInfo("System.Boolean"); -export const int8_type = new TypeInfo("System.SByte"); -export const uint8_type = new TypeInfo("System.Byte"); -export const int16_type = new TypeInfo("System.Int16"); -export const uint16_type = new TypeInfo("System.UInt16"); -export const int32_type = new TypeInfo("System.Int32"); -export const uint32_type = new TypeInfo("System.UInt32"); -export const int64_type = new TypeInfo("System.Int64"); -export const uint64_type = new TypeInfo("System.UInt64"); -export const int128_type = new TypeInfo("System.Int128"); -export const uint128_type = new TypeInfo("System.UInt128"); -export const nativeint_type = new TypeInfo("System.IntPtr"); -export const unativeint_type = new TypeInfo("System.UIntPtr"); -export const float16_type = new TypeInfo("System.Half"); -export const float32_type = new TypeInfo("System.Single"); -export const float64_type = new TypeInfo("System.Double"); -export const decimal_type = new TypeInfo("System.Decimal"); -export const bigint_type = new TypeInfo("System.Numerics.BigInteger"); -export function name(info) { - if (Array.isArray(info)) { - return info[0]; - } - else if (info instanceof TypeInfo) { - const elemType = getElementType(info); - if (elemType != null) { - return name(elemType) + "[]"; - } - else { - const i = info.fullname.lastIndexOf("."); - return i === -1 ? info.fullname : info.fullname.substr(i + 1); - } - } - else { - return info.name; - } -} -export function fullName(t) { - const elemType = getElementType(t); - if (elemType != null) { - return fullName(elemType) + "[]"; - } - else if (t.generics == null || t.generics.length === 0) { - return t.fullname; - } - else { - return t.fullname + "[" + t.generics.map((x) => fullName(x)).join(",") + "]"; - } -} -export function namespace(t) { - const elemType = getElementType(t); - if (elemType != null) { - return namespace(elemType); - } - else { - const i = t.fullname.lastIndexOf("."); - return i === -1 ? "" : t.fullname.substr(0, i); - } -} -export function isArray(t) { - return getElementType(t) != null; -} -export function getElementType(t) { - return t.fullname === "[]" && t.generics?.length === 1 ? t.generics[0] : undefined; -} -export function isGenericType(t) { - return t.generics != null && t.generics.length > 0; -} -export function isGenericParameter(t) { - return t instanceof GenericParameter; -} -export function isEnum(t) { - return t.enumCases != null && t.enumCases.length > 0; -} -export function isSubclassOf(t1, t2) { - return (t2.fullname === obj_type.fullname) || (t1.parent != null && (t1.parent.Equals(t2) || isSubclassOf(t1.parent, t2))); -} -function isErasedToNumber(t) { - return isEnum(t) || [ - int8_type.fullname, - uint8_type.fullname, - int16_type.fullname, - uint16_type.fullname, - int32_type.fullname, - uint32_type.fullname, - float16_type.fullname, - float32_type.fullname, - float64_type.fullname, - ].includes(t.fullname); -} -function isErasedToBigInt(t) { - return isEnum(t) || [ - int64_type.fullname, - uint64_type.fullname, - int128_type.fullname, - uint128_type.fullname, - nativeint_type.fullname, - unativeint_type.fullname, - bigint_type.fullname, - ].includes(t.fullname); -} -export function isInstanceOfType(t, o) { - if (t.fullname === obj_type.fullname) - return true; - switch (typeof o) { - case "boolean": - return t.fullname === bool_type.fullname; - case "string": - return t.fullname === string_type.fullname; - case "function": - return isFunction(t); - case "number": - return isErasedToNumber(t); - case "bigint": - return isErasedToBigInt(t); - default: - return t.construct != null && o instanceof t.construct; - } -} -/** - * This doesn't replace types for fields (records) or cases (unions) - * but it should be enough for type comparison purposes - */ -export function getGenericTypeDefinition(t) { - return t.generics == null ? t : new TypeInfo(t.fullname, t.generics.map(() => obj_type)); -} -export function getEnumUnderlyingType(t) { - return t.generics?.[0]; -} -export function getEnumValues(t) { - if (isEnum(t) && t.enumCases != null) { - return t.enumCases.map((kv) => kv[1]); - } - else { - throw new Error(`${t.fullname} is not an enum type`); - } -} -export function getEnumNames(t) { - if (isEnum(t) && t.enumCases != null) { - return t.enumCases.map((kv) => kv[0]); - } - else { - throw new Error(`${t.fullname} is not an enum type`); - } -} -function getEnumCase(t, v) { - if (t.enumCases != null) { - if (typeof v === "string") { - for (const kv of t.enumCases) { - if (kv[0] === v) { - return kv; - } - } - throw new Error(`'${v}' was not found in ${t.fullname}`); - } - else { - for (const kv of t.enumCases) { - if (kv[1] === v) { - return kv; - } - } - // .NET returns the number even if it doesn't match any of the cases - return ["", v]; - } - } - else { - throw new Error(`${t.fullname} is not an enum type`); - } -} -export function parseEnum(t, str) { - // TODO: better int parsing here, parseInt ceils floats: "4.8" -> 4 - const value = parseInt(str, 10); - return getEnumCase(t, isNaN(value) ? str : value)[1]; -} -export function tryParseEnum(t, str, defValue) { - try { - defValue.contents = parseEnum(t, str); - return true; - } - catch { - return false; - } -} -export function getEnumName(t, v) { - return getEnumCase(t, v)[0]; -} -export function isEnumDefined(t, v) { - try { - const kv = getEnumCase(t, v); - return kv[0] != null && kv[0] !== ""; - } - catch { - // supress error - } - return false; -} -// FSharpType -export function getUnionCases(t) { - if (t.cases != null) { - return t.cases(); - } - else { - throw new Error(`${t.fullname} is not an F# union type`); - } -} -export function getRecordElements(t) { - if (t.fields != null) { - return t.fields(); - } - else { - throw new Error(`${t.fullname} is not an F# record type`); - } -} -export function getTupleElements(t) { - if (isTuple(t) && t.generics != null) { - return t.generics; - } - else { - throw new Error(`${t.fullname} is not a tuple type`); - } -} -export function getFunctionElements(t) { - if (isFunction(t) && t.generics != null) { - const gen = t.generics; - return [gen[0], gen[1]]; - } - else { - throw new Error(`${t.fullname} is not an F# function type`); - } -} -export function isUnion(t) { - return t instanceof TypeInfo ? t.cases != null : t instanceof Union; -} -export function isRecord(t) { - return t instanceof TypeInfo ? t.fields != null : t instanceof Record; -} -export function isTuple(t) { - return t.fullname.startsWith("System.Tuple"); -} -// In .NET this is false for delegates -export function isFunction(t) { - return t.fullname === "Microsoft.FSharp.Core.FSharpFunc`2"; -} -// FSharpValue -export function getUnionFields(v, t) { - const cases = getUnionCases(t); - const case_ = cases[v.tag]; - if (case_ == null) { - throw new Error(`Cannot find case ${v.name} in union type`); - } - return [case_, v.fields]; -} -export function getUnionCaseFields(uci) { - return uci.fields == null ? [] : uci.fields; -} -// This is used as replacement of `FSharpValue.GetRecordFields` -// For `FSharpTypes.GetRecordFields` see `getRecordElements` -// Object.keys returns keys in the order they were added to the object -export function getRecordFields(v) { - return Object.keys(v).map((k) => v[k]); -} -export function getRecordField(v, field) { - return v[field[0]]; -} -export function getTupleFields(v) { - return v; -} -export function getTupleField(v, i) { - return v[i]; -} -export function makeUnion(uci, values) { - const expectedLength = (uci.fields || []).length; - if (values.length !== expectedLength) { - throw new Error(`Expected an array of length ${expectedLength} but got ${values.length}`); - } - const construct = uci.declaringType.construct; - if (construct == null) { - return {}; - } - const isSingleCase = uci.declaringType.cases ? uci.declaringType.cases().length == 1 : false; - if (isSingleCase) { - return new construct(...values); - } - else { - return new construct(uci.tag, values); - } -} -export function makeRecord(t, values) { - const fields = getRecordElements(t); - if (fields.length !== values.length) { - throw new Error(`Expected an array of length ${fields.length} but got ${values.length}`); - } - return t.construct != null - ? new t.construct(...values) - : fields.reduce((obj, [key, _t], i) => { - obj[key] = values[i]; - return obj; - }, {}); -} -export function makeTuple(values, _t) { - return values; -} -export function makeGenericType(t, generics) { - return new TypeInfo(t.fullname, generics, t.construct, t.parent, t.fields, t.cases); -} -export function createInstance(t, consArgs) { - // TODO: Check if consArgs length is same as t.construct? - // (Arg types can still be different) - if (typeof t.construct === "function") { - return new t.construct(...(consArgs ?? [])); - } - else if (isErasedToNumber(t)) { - return 0; - } - else if (isErasedToBigInt(t)) { - return 0n; - } - else { - switch (t.fullname) { - case obj_type.fullname: - return {}; - case bool_type.fullname: - return false; - case decimal_type.fullname: - return new Decimal(0); - case char_type.fullname: - // Even though char is a value type, it's erased to string, and Unchecked.defaultof is null - return null; - default: - throw new Error(`Cannot access constructor of ${t.fullname}`); - } - } -} -export function getValue(propertyInfo, v) { - return v[propertyInfo[0]]; -} -// Fable.Core.Reflection -function assertUnion(x) { - if (!(x instanceof Union)) { - throw new Error(`Value is not an F# union type`); - } -} -export function getCaseTag(x) { - assertUnion(x); - return x.tag; -} -export function getCaseName(x) { - assertUnion(x); - return x.cases()[x.tag]; -} -export function getCaseFields(x) { - assertUnion(x); - return x.fields; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.d.ts deleted file mode 100644 index 104114fc..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type MatchEvaluator = (match: any) => string; -export declare function create(pattern: string, options?: number): RegExp; -export declare function escape(str: string): string; -export declare function unescape(str: string): string; -export declare function isMatch(reg: RegExp, input: string, startAt?: number): boolean; -export declare function match(reg: RegExp, input: string, startAt?: number): RegExpExecArray | null; -export declare function matches(reg: RegExp, input: string, startAt?: number): RegExpExecArray[]; -export declare function options(reg: RegExp): number; -export declare function replace(reg: string | RegExp, input: string, replacement: string | MatchEvaluator, limit?: number, offset?: number): string; -export declare function split(reg: string | RegExp, input: string, limit?: number, offset?: number): string[]; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.js deleted file mode 100644 index 622b82c1..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/RegExp.js +++ /dev/null @@ -1,132 +0,0 @@ -export function create(pattern, options = 0) { - // Supported RegexOptions - // * IgnoreCase: 0x0001 - // * Multiline: 0x0002 - // * Compiled: 0x0008 (ignored) - // * Singleline: 0x0010 - // * ECMAScript: 0x0100 (ignored) - if ((options & ~(1 ^ 2 ^ 8 ^ 16 ^ 256)) !== 0) { - throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript"); - } - // Set always global and unicode flags for compatibility with dotnet, see #2925 - let flags = "gu"; - flags += options & 1 ? "i" : ""; // 0x0001 RegexOptions.IgnoreCase - flags += options & 2 ? "m" : ""; - flags += options & 16 ? "s" : ""; - return new RegExp(pattern, flags); -} -// From http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex -export function escape(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); -} -export function unescape(str) { - return str.replace(/\\([\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|])/g, "$1"); -} -export function isMatch(reg, input, startAt = 0) { - reg.lastIndex = startAt; - return reg.test(input); -} -export function match(reg, input, startAt = 0) { - reg.lastIndex = startAt; - return reg.exec(input); -} -export function matches(reg, input, startAt = 0) { - if (input == null) { - throw new Error("Input cannot ve null"); - } - if (!reg.global) { - throw new Error("Non-global RegExp"); // Prevent infinite loop - } - reg.lastIndex = startAt; - const matches = []; - let m; - let lastMatchIndex = -1; - // tslint:disable-next-line:no-conditional-assignment - while ((m = reg.exec(input)) != null) { - // It can happen even global regex get stuck, see #2845 - if (m.index === lastMatchIndex) { - reg.lastIndex++; - } - else { - lastMatchIndex = m.index; - matches.push(m); - } - } - return matches; -} -export function options(reg) { - let options = 256; // ECMAScript - options |= reg.ignoreCase ? 1 : 0; - options |= reg.multiline ? 2 : 0; - return options; -} -export function replace(reg, input, replacement, limit, offset = 0) { - function replacer() { - let res = arguments[0]; - if (limit) { - limit--; - const match = []; - const len = arguments.length; - // arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter - // * match: matched substring - // * p1, p2, ...: nth capture group string - // * offset: offset of matched substring - // * string: whole string examined - // * groups: named capturing groups - // ONLY if regex contains a named capture group AND browser supports named groups - // -> last element can be groups OR input string - // -> check if last element is string - const withGroups = typeof arguments[len - 1] !== "string"; - let pLast = withGroups ? len - 3 : len - 2; - for (let i = 0; i < pLast; i++) { - match.push(arguments[i]); - } - match.index = arguments[pLast++]; - match.input = arguments[pLast++]; - if (withGroups) { - match.groups = arguments[pLast]; - } - res = replacement(match); - } - return res; - } - if (typeof reg === "string") { - const tmp = reg; - reg = create(input, limit ?? 0); - input = tmp; - limit = undefined; - } - if (typeof replacement === "function") { - limit = limit == null ? -1 : limit; - return input.substring(0, offset) + input.substring(offset).replace(reg, replacer); - } - else { - replacement = - replacement - // $0 doesn't work with JS regex, see #1155 - .replace(/\$0/g, (_s) => "$&") - // named groups in replacement are `${name}` in .Net, but `$` in JS (in regex: groups are `(?...)` in both) - .replace(/\${([^}]+)}/g, "\$<$1>"); - if (limit != null) { - let m; - const sub1 = input.substring(offset); - const _matches = matches(reg, sub1); - const sub2 = matches.length > limit ? (m = _matches[limit - 1], sub1.substring(0, m.index + m[0].length)) : sub1; - return input.substring(0, offset) + sub2.replace(reg, replacement) - + input.substring(offset + sub2.length); - } - else { - return input.replace(reg, replacement); - } - } -} -export function split(reg, input, limit, offset = 0) { - if (typeof reg === "string") { - const tmp = reg; - reg = create(input, limit ?? 0); - input = tmp; - limit = undefined; - } - input = input.substring(offset); - return input.split(reg, limit); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.d.ts deleted file mode 100644 index 8af6c192..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { IComparer, IEqualityComparer, IDisposable, IEnumerator } from "./Util.js"; -import { TypeInfo } from "./Reflection.js"; -import { Option } from "./Option.js"; -import { FSharpList } from "./List.js"; -import { int32 } from "./Int32.js"; -export declare const SR_enumerationAlreadyFinished = "Enumeration already finished."; -export declare const SR_enumerationNotStarted = "Enumeration has not started. Call MoveNext."; -export declare const SR_inputSequenceEmpty = "The input sequence was empty."; -export declare const SR_inputSequenceTooLong = "The input sequence contains more than one element."; -export declare const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection."; -export declare const SR_notEnoughElements = "The input sequence has an insufficient number of elements."; -export declare const SR_resetNotSupported = "Reset is not supported on this enumerator."; -export declare function Enumerator_noReset<$a>(): $a; -export declare function Enumerator_notStarted<$a>(): $a; -export declare function Enumerator_alreadyFinished<$a>(): $a; -export declare class Enumerator_Seq implements Iterable { - readonly f: (() => IEnumerator); - constructor(f: (() => IEnumerator)); - toString(): string; - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare function Enumerator_Seq_$reflection(gen0: TypeInfo): TypeInfo; -export declare function Enumerator_Seq_$ctor_673A07F2(f: (() => IEnumerator)): Enumerator_Seq; -export declare class Enumerator_FromFunctions$1 implements IEnumerator, IDisposable { - readonly next: (() => boolean); - readonly dispose: (() => void); - readonly current: (() => T); - constructor(current: (() => T), next: (() => boolean), dispose: (() => void)); - "System.Collections.Generic.IEnumerator`1.get_Current"(): T; - "System.Collections.IEnumerator.get_Current"(): any; - "System.Collections.IEnumerator.MoveNext"(): boolean; - "System.Collections.IEnumerator.Reset"(): void; - Dispose(): void; -} -export declare function Enumerator_FromFunctions$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function Enumerator_FromFunctions$1_$ctor_58C54629(current: (() => T), next: (() => boolean), dispose: (() => void)): Enumerator_FromFunctions$1; -export declare function Enumerator_cast(e: IEnumerator): IEnumerator; -export declare function Enumerator_concat>(sources: Iterable): IEnumerator; -export declare function Enumerator_enumerateThenFinally(f: (() => void), e: IEnumerator): IEnumerator; -export declare function Enumerator_generateWhileSome(openf: (() => T), compute: ((arg0: T) => Option), closef: ((arg0: T) => void)): IEnumerator; -export declare function Enumerator_unfold(f: ((arg0: State) => Option<[T, State]>), state: State): IEnumerator; -export declare function indexNotFound<$a>(): $a; -export declare function checkNonNull<$a>(argName: string, arg: $a): void; -export declare function mkSeq(f: (() => IEnumerator)): Iterable; -export declare function ofSeq(xs: Iterable): IEnumerator; -export declare function delay(generator: (() => Iterable)): Iterable; -export declare function concat, T>(sources: Iterable): Iterable; -export declare function unfold(generator: ((arg0: State) => Option<[T, State]>), state: State): Iterable; -export declare function empty(): Iterable; -export declare function singleton(x: T): Iterable; -export declare function ofArray(arr: T[]): Iterable; -export declare function toArray(xs: Iterable): T[]; -export declare function ofList(xs: FSharpList): Iterable; -export declare function toList(xs: Iterable): FSharpList; -export declare function generate<$a, $b>(create: (() => $a), compute: ((arg0: $a) => Option<$b>), dispose: ((arg0: $a) => void)): Iterable<$b>; -export declare function generateIndexed<$a, $b>(create: (() => $a), compute: ((arg0: int32, arg1: $a) => Option<$b>), dispose: ((arg0: $a) => void)): Iterable<$b>; -export declare function append(xs: Iterable, ys: Iterable): Iterable; -export declare function cast(xs: Iterable): Iterable; -export declare function choose(chooser: ((arg0: T) => Option), xs: Iterable): Iterable; -export declare function compareWith(comparer: ((arg0: T, arg1: T) => int32), xs: Iterable, ys: Iterable): int32; -export declare function contains(value: T, xs: Iterable, comparer: IEqualityComparer): boolean; -export declare function enumerateFromFunctions<$a, $b>(create: (() => $a), moveNext: ((arg0: $a) => boolean), current: ((arg0: $a) => $b)): Iterable<$b>; -export declare function enumerateThenFinally(source: Iterable, compensation: (() => void)): Iterable; -export declare function enumerateUsing, U>(resource: T, source: ((arg0: T) => $a)): Iterable; -export declare function enumerateWhile(guard: (() => boolean), xs: Iterable): Iterable; -export declare function filter(f: ((arg0: T) => boolean), xs: Iterable): Iterable; -export declare function exists(predicate: ((arg0: T) => boolean), xs: Iterable): boolean; -export declare function exists2(predicate: ((arg0: T1, arg1: T2) => boolean), xs: Iterable, ys: Iterable): boolean; -export declare function exactlyOne(xs: Iterable): T; -export declare function tryExactlyOne(xs: Iterable): Option; -export declare function tryFind(predicate: ((arg0: T) => boolean), xs: Iterable): Option; -export declare function find(predicate: ((arg0: T) => boolean), xs: Iterable): T; -export declare function tryFindBack(predicate: ((arg0: T) => boolean), xs: Iterable): Option; -export declare function findBack(predicate: ((arg0: T) => boolean), xs: Iterable): T; -export declare function tryFindIndex(predicate: ((arg0: T) => boolean), xs: Iterable): Option; -export declare function findIndex(predicate: ((arg0: T) => boolean), xs: Iterable): int32; -export declare function tryFindIndexBack(predicate: ((arg0: T) => boolean), xs: Iterable): Option; -export declare function findIndexBack(predicate: ((arg0: T) => boolean), xs: Iterable): int32; -export declare function fold(folder: ((arg0: State, arg1: T) => State), state: State, xs: Iterable): State; -export declare function foldBack(folder: ((arg0: T, arg1: any) => any), xs: Iterable, state: any): any; -export declare function fold2(folder: ((arg0: State, arg1: T1, arg2: T2) => State), state: State, xs: Iterable, ys: Iterable): State; -export declare function foldBack2(folder: ((arg0: T1, arg1: T2, arg2: State) => State), xs: Iterable, ys: Iterable, state: State): State; -export declare function forAll<$a>(predicate: ((arg0: $a) => boolean), xs: Iterable<$a>): boolean; -export declare function forAll2<$a, $b>(predicate: ((arg0: $a, arg1: $b) => boolean), xs: Iterable<$a>, ys: Iterable<$b>): boolean; -export declare function tryHead(xs: Iterable): Option; -export declare function head(xs: Iterable): T; -export declare function initialize<$a>(count: int32, f: ((arg0: int32) => $a)): Iterable<$a>; -export declare function initializeInfinite<$a>(f: ((arg0: int32) => $a)): Iterable<$a>; -export declare function isEmpty(xs: Iterable): boolean; -export declare function tryItem(index: int32, xs: Iterable): Option; -export declare function item(index: int32, xs: Iterable): T; -export declare function iterate<$a>(action: ((arg0: $a) => void), xs: Iterable<$a>): void; -export declare function iterate2<$a, $b>(action: ((arg0: $a, arg1: $b) => void), xs: Iterable<$a>, ys: Iterable<$b>): void; -export declare function iterateIndexed<$a>(action: ((arg0: int32, arg1: $a) => void), xs: Iterable<$a>): void; -export declare function iterateIndexed2<$a, $b>(action: ((arg0: int32, arg1: $a, arg2: $b) => void), xs: Iterable<$a>, ys: Iterable<$b>): void; -export declare function tryLast(xs: Iterable): Option; -export declare function last(xs: Iterable): T; -export declare function length(xs: Iterable): int32; -export declare function map(mapping: ((arg0: T) => U), xs: Iterable): Iterable; -export declare function mapIndexed(mapping: ((arg0: int32, arg1: T) => U), xs: Iterable): Iterable; -export declare function indexed(xs: Iterable): Iterable<[int32, T]>; -export declare function map2(mapping: ((arg0: T1, arg1: T2) => U), xs: Iterable, ys: Iterable): Iterable; -export declare function mapIndexed2(mapping: ((arg0: int32, arg1: T1, arg2: T2) => U), xs: Iterable, ys: Iterable): Iterable; -export declare function map3(mapping: ((arg0: T1, arg1: T2, arg2: T3) => U), xs: Iterable, ys: Iterable, zs: Iterable): Iterable; -export declare function readOnly(xs: Iterable): Iterable; -export declare class CachedSeq$1 implements Iterable, IDisposable { - readonly res: Iterable; - readonly cleanup: (() => void); - constructor(cleanup: (() => void), res: Iterable); - Dispose(): void; - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare function CachedSeq$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function CachedSeq$1_$ctor_Z7A8347D4(cleanup: (() => void), res: Iterable): CachedSeq$1; -export declare function CachedSeq$1__Clear(_: CachedSeq$1): void; -export declare function cache(source: Iterable): Iterable; -export declare function allPairs(xs: Iterable, ys: Iterable): Iterable<[T1, T2]>; -export declare function mapFold(mapping: ((arg0: State, arg1: T) => [Result, State]), state: State, xs: Iterable): [Iterable, State]; -export declare function mapFoldBack(mapping: ((arg0: T, arg1: State) => [Result, State]), xs: Iterable, state: State): [Iterable, State]; -export declare function tryPick(chooser: ((arg0: T) => Option<$a>), xs: Iterable): Option<$a>; -export declare function pick(chooser: ((arg0: T) => Option<$a>), xs: Iterable): $a; -export declare function reduce(folder: ((arg0: T, arg1: T) => T), xs: Iterable): T; -export declare function reduceBack(folder: ((arg0: T, arg1: T) => T), xs: Iterable): T; -export declare function replicate<$a>(n: int32, x: $a): Iterable<$a>; -export declare function reverse(xs: Iterable): Iterable; -export declare function scan(folder: ((arg0: State, arg1: T) => State), state: State, xs: Iterable): Iterable; -export declare function scanBack(folder: ((arg0: T, arg1: State) => State), xs: Iterable, state: State): Iterable; -export declare function skip(count: int32, source: Iterable): Iterable; -export declare function skipWhile(predicate: ((arg0: T) => boolean), xs: Iterable): Iterable; -export declare function tail(xs: Iterable): Iterable; -export declare function take(count: int32, xs: Iterable): Iterable; -export declare function takeWhile(predicate: ((arg0: T) => boolean), xs: Iterable): Iterable; -export declare function truncate(count: int32, xs: Iterable): Iterable; -export declare function zip(xs: Iterable, ys: Iterable): Iterable<[T1, T2]>; -export declare function zip3(xs: Iterable, ys: Iterable, zs: Iterable): Iterable<[T1, T2, T3]>; -export declare function collect, U>(mapping: ((arg0: T) => Collection), xs: Iterable): Iterable; -export declare function where(predicate: ((arg0: T) => boolean), xs: Iterable): Iterable; -export declare function pairwise(xs: Iterable): Iterable<[T, T]>; -export declare function splitInto(chunks: int32, xs: Iterable): Iterable; -export declare function windowed(windowSize: int32, xs: Iterable): Iterable; -export declare function transpose<$a extends Iterable, T>(xss: Iterable<$a>): Iterable>; -export declare function sortWith(comparer: ((arg0: T, arg1: T) => int32), xs: Iterable): Iterable; -export declare function sort(xs: Iterable, comparer: IComparer): Iterable; -export declare function sortBy(projection: ((arg0: T) => U), xs: Iterable, comparer: IComparer): Iterable; -export declare function sortDescending(xs: Iterable, comparer: IComparer): Iterable; -export declare function sortByDescending(projection: ((arg0: T) => U), xs: Iterable, comparer: IComparer): Iterable; -export declare function sum(xs: Iterable, adder: any): T; -export declare function sumBy(f: ((arg0: T) => U), xs: Iterable, adder: any): U; -export declare function maxBy(projection: ((arg0: T) => U), xs: Iterable, comparer: IComparer): T; -export declare function max(xs: Iterable, comparer: IComparer): T; -export declare function minBy(projection: ((arg0: T) => U), xs: Iterable, comparer: IComparer): T; -export declare function min(xs: Iterable, comparer: IComparer): T; -export declare function average(xs: Iterable, averager: any): T; -export declare function averageBy(f: ((arg0: T) => U), xs: Iterable, averager: any): U; -export declare function permute(f: ((arg0: int32) => int32), xs: Iterable): Iterable; -export declare function chunkBySize(chunkSize: int32, xs: Iterable): Iterable; -export declare function insertAt(index: int32, y: T, xs: Iterable): Iterable; -export declare function insertManyAt(index: int32, ys: Iterable, xs: Iterable): Iterable; -export declare function removeAt(index: int32, xs: Iterable): Iterable; -export declare function removeManyAt(index: int32, count: int32, xs: Iterable): Iterable; -export declare function updateAt(index: int32, y: T, xs: Iterable): Iterable; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.js deleted file mode 100644 index fd38a27f..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq.js +++ /dev/null @@ -1,1379 +0,0 @@ -import { clear, defaultOf, equals, isDisposable, isArrayLike, toIterator, disposeSafe, getEnumerator } from "./Util.js"; -import { toString } from "./Types.js"; -import { class_type } from "./Reflection.js"; -import { some, value as value_1 } from "./Option.js"; -import { Operators_Lock, Operators_NullArg } from "./FSharp.Core.js"; -import { chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, map as map_1, windowed as windowed_1, splitInto as splitInto_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"; -import { 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"; -import { SR_indexOutOfBounds } from "./Global.js"; -export const SR_enumerationAlreadyFinished = "Enumeration already finished."; -export const SR_enumerationNotStarted = "Enumeration has not started. Call MoveNext."; -export const SR_inputSequenceEmpty = "The input sequence was empty."; -export const SR_inputSequenceTooLong = "The input sequence contains more than one element."; -export const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection."; -export const SR_notEnoughElements = "The input sequence has an insufficient number of elements."; -export const SR_resetNotSupported = "Reset is not supported on this enumerator."; -export function Enumerator_noReset() { - throw new Error(SR_resetNotSupported); -} -export function Enumerator_notStarted() { - throw new Error(SR_enumerationNotStarted); -} -export function Enumerator_alreadyFinished() { - throw new Error(SR_enumerationAlreadyFinished); -} -export class Enumerator_Seq { - constructor(f) { - this.f = f; - } - toString() { - const xs = this; - let i = 0; - let str = "seq ["; - const e = getEnumerator(xs); - try { - while ((i < 4) && e["System.Collections.IEnumerator.MoveNext"]()) { - if (i > 0) { - str = (str + "; "); - } - str = (str + toString(e["System.Collections.Generic.IEnumerator`1.get_Current"]())); - i = ((i + 1) | 0); - } - if (i === 4) { - str = (str + "; ..."); - } - return str + "]"; - } - finally { - disposeSafe(e); - } - } - GetEnumerator() { - const x = this; - return x.f(); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const x = this; - return x.f(); - } -} -export function Enumerator_Seq_$reflection(gen0) { - return class_type("SeqModule.Enumerator.Seq", [gen0], Enumerator_Seq); -} -export function Enumerator_Seq_$ctor_673A07F2(f) { - return new Enumerator_Seq(f); -} -export class Enumerator_FromFunctions$1 { - constructor(current, next, dispose) { - this.current = current; - this.next = next; - this.dispose = dispose; - } - "System.Collections.Generic.IEnumerator`1.get_Current"() { - const _ = this; - return _.current(); - } - "System.Collections.IEnumerator.get_Current"() { - const _ = this; - return _.current(); - } - "System.Collections.IEnumerator.MoveNext"() { - const _ = this; - return _.next(); - } - "System.Collections.IEnumerator.Reset"() { - Enumerator_noReset(); - } - Dispose() { - const _ = this; - _.dispose(); - } -} -export function Enumerator_FromFunctions$1_$reflection(gen0) { - return class_type("SeqModule.Enumerator.FromFunctions`1", [gen0], Enumerator_FromFunctions$1); -} -export function Enumerator_FromFunctions$1_$ctor_58C54629(current, next, dispose) { - return new Enumerator_FromFunctions$1(current, next, dispose); -} -export function Enumerator_cast(e) { - return Enumerator_FromFunctions$1_$ctor_58C54629(() => e["System.Collections.Generic.IEnumerator`1.get_Current"](), () => e["System.Collections.IEnumerator.MoveNext"](), () => { - const e_1 = e; - disposeSafe(e_1); - }); -} -export function Enumerator_concat(sources) { - let outerOpt = void 0; - let innerOpt = void 0; - let started = false; - let finished = false; - let curr = void 0; - const finish = () => { - finished = true; - if (innerOpt != null) { - const inner = value_1(innerOpt); - try { - disposeSafe(inner); - } - finally { - innerOpt = void 0; - } - } - if (outerOpt != null) { - const outer = value_1(outerOpt); - try { - disposeSafe(outer); - } - finally { - outerOpt = void 0; - } - } - }; - return Enumerator_FromFunctions$1_$ctor_58C54629(() => { - if (!started) { - Enumerator_notStarted(); - } - else if (finished) { - Enumerator_alreadyFinished(); - } - if (curr != null) { - return value_1(curr); - } - else { - return Enumerator_alreadyFinished(); - } - }, () => { - let copyOfStruct; - if (!started) { - started = true; - } - if (finished) { - return false; - } - else { - let res = void 0; - while (res == null) { - const outerOpt_1 = outerOpt; - const innerOpt_1 = innerOpt; - if (outerOpt_1 != null) { - if (innerOpt_1 != null) { - const inner_1 = value_1(innerOpt_1); - if (inner_1["System.Collections.IEnumerator.MoveNext"]()) { - curr = some(inner_1["System.Collections.Generic.IEnumerator`1.get_Current"]()); - res = true; - } - else { - try { - disposeSafe(inner_1); - } - finally { - innerOpt = void 0; - } - } - } - else { - const outer_1 = value_1(outerOpt_1); - if (outer_1["System.Collections.IEnumerator.MoveNext"]()) { - const ie = outer_1["System.Collections.Generic.IEnumerator`1.get_Current"](); - innerOpt = ((copyOfStruct = ie, getEnumerator(copyOfStruct))); - } - else { - finish(); - res = false; - } - } - } - else { - outerOpt = getEnumerator(sources); - } - } - return value_1(res); - } - }, () => { - if (!finished) { - finish(); - } - }); -} -export function Enumerator_enumerateThenFinally(f, e) { - return Enumerator_FromFunctions$1_$ctor_58C54629(() => e["System.Collections.Generic.IEnumerator`1.get_Current"](), () => e["System.Collections.IEnumerator.MoveNext"](), () => { - try { - disposeSafe(e); - } - finally { - f(); - } - }); -} -export function Enumerator_generateWhileSome(openf, compute, closef) { - let started = false; - let curr = void 0; - let state = some(openf()); - const dispose = () => { - if (state != null) { - const x_1 = value_1(state); - try { - closef(x_1); - } - finally { - state = void 0; - } - } - }; - const finish = () => { - try { - dispose(); - } - finally { - curr = void 0; - } - }; - return Enumerator_FromFunctions$1_$ctor_58C54629(() => { - if (!started) { - Enumerator_notStarted(); - } - if (curr != null) { - return value_1(curr); - } - else { - return Enumerator_alreadyFinished(); - } - }, () => { - if (!started) { - started = true; - } - if (state != null) { - const s = value_1(state); - let matchValue_1; - try { - matchValue_1 = compute(s); - } - catch (matchValue) { - finish(); - throw matchValue; - } - if (matchValue_1 != null) { - curr = matchValue_1; - return true; - } - else { - finish(); - return false; - } - } - else { - return false; - } - }, dispose); -} -export function Enumerator_unfold(f, state) { - let curr = void 0; - let acc = state; - return Enumerator_FromFunctions$1_$ctor_58C54629(() => { - if (curr != null) { - const x = value_1(curr)[0]; - const st = value_1(curr)[1]; - return x; - } - else { - return Enumerator_notStarted(); - } - }, () => { - curr = f(acc); - if (curr != null) { - const x_1 = value_1(curr)[0]; - const st_1 = value_1(curr)[1]; - acc = st_1; - return true; - } - else { - return false; - } - }, () => { - }); -} -export function indexNotFound() { - throw new Error(SR_keyNotFoundAlt); -} -export function checkNonNull(argName, arg) { - if (arg == null) { - Operators_NullArg(argName); - } -} -export function mkSeq(f) { - return Enumerator_Seq_$ctor_673A07F2(f); -} -export function ofSeq(xs) { - checkNonNull("source", xs); - return getEnumerator(xs); -} -export function delay(generator) { - return mkSeq(() => getEnumerator(generator())); -} -export function concat(sources) { - return mkSeq(() => Enumerator_concat(sources)); -} -export function unfold(generator, state) { - return mkSeq(() => Enumerator_unfold(generator, state)); -} -export function empty() { - return delay(() => (new Array(0))); -} -export function singleton(x) { - return delay(() => singleton_1(x)); -} -export function ofArray(arr) { - return arr; -} -export function toArray(xs) { - if (xs instanceof FSharpList) { - const a = xs; - return toArray_1(a); - } - else { - return Array.from(xs); - } -} -export function ofList(xs) { - return xs; -} -export function toList(xs) { - if (isArrayLike(xs)) { - return ofArray_1(xs); - } - else if (xs instanceof FSharpList) { - return xs; - } - else { - return ofSeq_1(xs); - } -} -export function generate(create, compute, dispose) { - return mkSeq(() => Enumerator_generateWhileSome(create, compute, dispose)); -} -export function generateIndexed(create, compute, dispose) { - return mkSeq(() => { - let i = -1; - return Enumerator_generateWhileSome(create, (x) => { - i = ((i + 1) | 0); - return compute(i, x); - }, dispose); - }); -} -export function append(xs, ys) { - return concat([xs, ys]); -} -export function cast(xs) { - return mkSeq(() => { - checkNonNull("source", xs); - return Enumerator_cast(getEnumerator(xs)); - }); -} -export function choose(chooser, xs) { - return generate(() => ofSeq(xs), (e) => { - let curr = void 0; - while ((curr == null) && e["System.Collections.IEnumerator.MoveNext"]()) { - curr = chooser(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return curr; - }, (e_1) => { - disposeSafe(e_1); - }); -} -export function compareWith(comparer, xs, ys) { - const e1 = ofSeq(xs); - try { - const e2 = ofSeq(ys); - try { - let c = 0; - let b1 = e1["System.Collections.IEnumerator.MoveNext"](); - let b2 = e2["System.Collections.IEnumerator.MoveNext"](); - while (((c === 0) && b1) && b2) { - c = (comparer(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]()) | 0); - if (c === 0) { - b1 = e1["System.Collections.IEnumerator.MoveNext"](); - b2 = e2["System.Collections.IEnumerator.MoveNext"](); - } - } - return ((c !== 0) ? c : (b1 ? 1 : (b2 ? -1 : 0))) | 0; - } - finally { - disposeSafe(e2); - } - } - finally { - disposeSafe(e1); - } -} -export function contains(value, xs, comparer) { - const e = ofSeq(xs); - try { - let found = false; - while (!found && e["System.Collections.IEnumerator.MoveNext"]()) { - found = comparer.Equals(value, e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return found; - } - finally { - disposeSafe(e); - } -} -export function enumerateFromFunctions(create, moveNext, current) { - return generate(create, (x) => (moveNext(x) ? some(current(x)) : void 0), (x_1) => { - const matchValue = x_1; - if (isDisposable(matchValue)) { - const id = matchValue; - disposeSafe(id); - } - }); -} -export function enumerateThenFinally(source, compensation) { - const compensation_1 = compensation; - return mkSeq(() => { - try { - return Enumerator_enumerateThenFinally(compensation_1, ofSeq(source)); - } - catch (matchValue) { - compensation_1(); - throw matchValue; - } - }); -} -export function enumerateUsing(resource, source) { - const compensation = () => { - if (equals(resource, defaultOf())) { - } - else { - let copyOfStruct = resource; - disposeSafe(copyOfStruct); - } - }; - return mkSeq(() => { - try { - return Enumerator_enumerateThenFinally(compensation, ofSeq(source(resource))); - } - catch (matchValue_1) { - compensation(); - throw matchValue_1; - } - }); -} -export function enumerateWhile(guard, xs) { - return concat(unfold((i) => (guard() ? [xs, i + 1] : void 0), 0)); -} -export function filter(f, xs) { - return choose((x) => { - if (f(x)) { - return some(x); - } - else { - return void 0; - } - }, xs); -} -export function exists(predicate, xs) { - const e = ofSeq(xs); - try { - let found = false; - while (!found && e["System.Collections.IEnumerator.MoveNext"]()) { - found = predicate(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return found; - } - finally { - disposeSafe(e); - } -} -export function exists2(predicate, xs, ys) { - const e1 = ofSeq(xs); - try { - const e2 = ofSeq(ys); - try { - let found = false; - while ((!found && e1["System.Collections.IEnumerator.MoveNext"]()) && e2["System.Collections.IEnumerator.MoveNext"]()) { - found = predicate(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return found; - } - finally { - disposeSafe(e2); - } - } - finally { - disposeSafe(e1); - } -} -export function exactlyOne(xs) { - const e = ofSeq(xs); - try { - if (e["System.Collections.IEnumerator.MoveNext"]()) { - const v = e["System.Collections.Generic.IEnumerator`1.get_Current"](); - if (e["System.Collections.IEnumerator.MoveNext"]()) { - throw new Error((SR_inputSequenceTooLong + "\\nParameter name: ") + "source"); - } - else { - return v; - } - } - else { - throw new Error((SR_inputSequenceEmpty + "\\nParameter name: ") + "source"); - } - } - finally { - disposeSafe(e); - } -} -export function tryExactlyOne(xs) { - const e = ofSeq(xs); - try { - if (e["System.Collections.IEnumerator.MoveNext"]()) { - const v = e["System.Collections.Generic.IEnumerator`1.get_Current"](); - return e["System.Collections.IEnumerator.MoveNext"]() ? void 0 : some(v); - } - else { - return void 0; - } - } - finally { - disposeSafe(e); - } -} -export function tryFind(predicate, xs) { - const e = ofSeq(xs); - try { - let res = void 0; - while ((res == null) && e["System.Collections.IEnumerator.MoveNext"]()) { - const c = e["System.Collections.Generic.IEnumerator`1.get_Current"](); - if (predicate(c)) { - res = some(c); - } - } - return res; - } - finally { - disposeSafe(e); - } -} -export function find(predicate, xs) { - const matchValue = tryFind(predicate, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function tryFindBack(predicate, xs) { - return tryFindBack_1(predicate, toArray(xs)); -} -export function findBack(predicate, xs) { - const matchValue = tryFindBack(predicate, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function tryFindIndex(predicate, xs) { - const e = ofSeq(xs); - try { - const loop = (i_mut) => { - loop: while (true) { - const i = i_mut; - if (e["System.Collections.IEnumerator.MoveNext"]()) { - if (predicate(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) { - return i; - } - else { - i_mut = (i + 1); - continue loop; - } - } - else { - return void 0; - } - break; - } - }; - return loop(0); - } - finally { - disposeSafe(e); - } -} -export function findIndex(predicate, xs) { - const matchValue = tryFindIndex(predicate, xs); - if (matchValue == null) { - indexNotFound(); - return -1; - } - else { - return value_1(matchValue) | 0; - } -} -export function tryFindIndexBack(predicate, xs) { - return tryFindIndexBack_1(predicate, toArray(xs)); -} -export function findIndexBack(predicate, xs) { - const matchValue = tryFindIndexBack(predicate, xs); - if (matchValue == null) { - indexNotFound(); - return -1; - } - else { - return value_1(matchValue) | 0; - } -} -export function fold(folder, state, xs) { - const e = ofSeq(xs); - try { - let acc = state; - while (e["System.Collections.IEnumerator.MoveNext"]()) { - acc = folder(acc, e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return acc; - } - finally { - disposeSafe(e); - } -} -export function foldBack(folder, xs, state) { - return foldBack_1(folder, toArray(xs), state); -} -export function fold2(folder, state, xs, ys) { - const e1 = ofSeq(xs); - try { - const e2 = ofSeq(ys); - try { - let acc = state; - while (e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) { - acc = folder(acc, e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return acc; - } - finally { - disposeSafe(e2); - } - } - finally { - disposeSafe(e1); - } -} -export function foldBack2(folder, xs, ys, state) { - return foldBack2_1(folder, toArray(xs), toArray(ys), state); -} -export function forAll(predicate, xs) { - return !exists((x) => !predicate(x), xs); -} -export function forAll2(predicate, xs, ys) { - return !exists2((x, y) => !predicate(x, y), xs, ys); -} -export function tryHead(xs) { - if (isArrayLike(xs)) { - return tryHead_1(xs); - } - else if (xs instanceof FSharpList) { - return tryHead_2(xs); - } - else { - const e = ofSeq(xs); - try { - return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : void 0; - } - finally { - disposeSafe(e); - } - } -} -export function head(xs) { - const matchValue = tryHead(xs); - if (matchValue == null) { - throw new Error((SR_inputSequenceEmpty + "\\nParameter name: ") + "source"); - } - else { - return value_1(matchValue); - } -} -export function initialize(count, f) { - return unfold((i) => ((i < count) ? [f(i), i + 1] : void 0), 0); -} -export function initializeInfinite(f) { - return initialize(2147483647, f); -} -export function isEmpty(xs) { - if (isArrayLike(xs)) { - const a = xs; - return a.length === 0; - } - else if (xs instanceof FSharpList) { - return isEmpty_1(xs); - } - else { - const e = ofSeq(xs); - try { - return !e["System.Collections.IEnumerator.MoveNext"](); - } - finally { - disposeSafe(e); - } - } -} -export function tryItem(index, xs) { - if (isArrayLike(xs)) { - return tryItem_1(index, xs); - } - else if (xs instanceof FSharpList) { - return tryItem_2(index, xs); - } - else { - const e = ofSeq(xs); - try { - const loop = (index_1_mut) => { - loop: while (true) { - const index_1 = index_1_mut; - if (!e["System.Collections.IEnumerator.MoveNext"]()) { - return void 0; - } - else if (index_1 === 0) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - index_1_mut = (index_1 - 1); - continue loop; - } - break; - } - }; - return loop(index); - } - finally { - disposeSafe(e); - } - } -} -export function item(index, xs) { - const matchValue = tryItem(index, xs); - if (matchValue == null) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "index"); - } - else { - return value_1(matchValue); - } -} -export function iterate(action, xs) { - fold((unitVar, x) => { - action(x); - }, void 0, xs); -} -export function iterate2(action, xs, ys) { - fold2((unitVar, x, y) => { - action(x, y); - }, void 0, xs, ys); -} -export function iterateIndexed(action, xs) { - fold((i, x) => { - action(i, x); - return (i + 1) | 0; - }, 0, xs); -} -export function iterateIndexed2(action, xs, ys) { - fold2((i, x, y) => { - action(i, x, y); - return (i + 1) | 0; - }, 0, xs, ys); -} -export function tryLast(xs) { - const e = ofSeq(xs); - try { - const loop = (acc_mut) => { - loop: while (true) { - const acc = acc_mut; - if (!e["System.Collections.IEnumerator.MoveNext"]()) { - return acc; - } - else { - acc_mut = e["System.Collections.Generic.IEnumerator`1.get_Current"](); - continue loop; - } - break; - } - }; - return e["System.Collections.IEnumerator.MoveNext"]() ? some(loop(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) : void 0; - } - finally { - disposeSafe(e); - } -} -export function last(xs) { - const matchValue = tryLast(xs); - if (matchValue == null) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "source"); - } - else { - return value_1(matchValue); - } -} -export function length(xs) { - if (isArrayLike(xs)) { - const a = xs; - return a.length | 0; - } - else if (xs instanceof FSharpList) { - return length_1(xs) | 0; - } - else { - const e = ofSeq(xs); - try { - let count = 0; - while (e["System.Collections.IEnumerator.MoveNext"]()) { - count = ((count + 1) | 0); - } - return count | 0; - } - finally { - disposeSafe(e); - } - } -} -export function map(mapping, xs) { - return generate(() => ofSeq(xs), (e) => (e["System.Collections.IEnumerator.MoveNext"]() ? some(mapping(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) : void 0), (e_1) => { - disposeSafe(e_1); - }); -} -export function mapIndexed(mapping, xs) { - 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) => { - disposeSafe(e_1); - }); -} -export function indexed(xs) { - return mapIndexed((i, x) => [i, x], xs); -} -export function map2(mapping, xs, ys) { - return generate(() => [ofSeq(xs), ofSeq(ys)], (tupledArg) => { - const e1 = tupledArg[0]; - const e2 = tupledArg[1]; - 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; - }, (tupledArg_1) => { - try { - disposeSafe(tupledArg_1[0]); - } - finally { - disposeSafe(tupledArg_1[1]); - } - }); -} -export function mapIndexed2(mapping, xs, ys) { - return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => { - const e1 = tupledArg[0]; - const e2 = tupledArg[1]; - 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; - }, (tupledArg_1) => { - try { - disposeSafe(tupledArg_1[0]); - } - finally { - disposeSafe(tupledArg_1[1]); - } - }); -} -export function map3(mapping, xs, ys, zs) { - return generate(() => [ofSeq(xs), ofSeq(ys), ofSeq(zs)], (tupledArg) => { - const e1 = tupledArg[0]; - const e2 = tupledArg[1]; - const e3 = tupledArg[2]; - 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; - }, (tupledArg_1) => { - try { - disposeSafe(tupledArg_1[0]); - } - finally { - try { - disposeSafe(tupledArg_1[1]); - } - finally { - disposeSafe(tupledArg_1[2]); - } - } - }); -} -export function readOnly(xs) { - checkNonNull("source", xs); - return map((x) => x, xs); -} -export class CachedSeq$1 { - constructor(cleanup, res) { - this.cleanup = cleanup; - this.res = res; - } - Dispose() { - const _ = this; - _.cleanup(); - } - GetEnumerator() { - const _ = this; - return getEnumerator(_.res); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const _ = this; - return getEnumerator(_.res); - } -} -export function CachedSeq$1_$reflection(gen0) { - return class_type("SeqModule.CachedSeq`1", [gen0], CachedSeq$1); -} -export function CachedSeq$1_$ctor_Z7A8347D4(cleanup, res) { - return new CachedSeq$1(cleanup, res); -} -export function CachedSeq$1__Clear(_) { - _.cleanup(); -} -export function cache(source) { - checkNonNull("source", source); - const prefix = []; - let enumeratorR = void 0; - return CachedSeq$1_$ctor_Z7A8347D4(() => { - Operators_Lock(prefix, () => { - clear(prefix); - let matchResult, e; - if (enumeratorR != null) { - if (value_1(enumeratorR) != null) { - matchResult = 0; - e = value_1(value_1(enumeratorR)); - } - else { - matchResult = 1; - } - } - else { - matchResult = 1; - } - switch (matchResult) { - case 0: { - disposeSafe(e); - break; - } - } - enumeratorR = void 0; - }); - }, unfold((i_1) => Operators_Lock(prefix, () => { - if (i_1 < prefix.length) { - return [prefix[i_1], i_1 + 1]; - } - else { - if (i_1 >= prefix.length) { - let optEnumerator_2; - if (enumeratorR != null) { - optEnumerator_2 = value_1(enumeratorR); - } - else { - const optEnumerator = getEnumerator(source); - enumeratorR = some(optEnumerator); - optEnumerator_2 = optEnumerator; - } - if (optEnumerator_2 == null) { - } - else { - const enumerator = value_1(optEnumerator_2); - if (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - void (prefix.push(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]())); - } - else { - disposeSafe(enumerator); - enumeratorR = some(void 0); - } - } - } - if (i_1 < prefix.length) { - return [prefix[i_1], i_1 + 1]; - } - else { - return void 0; - } - } - }), 0)); -} -export function allPairs(xs, ys) { - const ysCache = cache(ys); - return delay(() => concat(map((x) => map((y) => [x, y], ysCache), xs))); -} -export function mapFold(mapping, state, xs) { - const patternInput = mapFold_1(mapping, state, toArray(xs)); - return [readOnly(patternInput[0]), patternInput[1]]; -} -export function mapFoldBack(mapping, xs, state) { - const patternInput = mapFoldBack_1(mapping, toArray(xs), state); - return [readOnly(patternInput[0]), patternInput[1]]; -} -export function tryPick(chooser, xs) { - const e = ofSeq(xs); - try { - let res = void 0; - while ((res == null) && e["System.Collections.IEnumerator.MoveNext"]()) { - res = chooser(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - return res; - } - finally { - disposeSafe(e); - } -} -export function pick(chooser, xs) { - const matchValue = tryPick(chooser, xs); - if (matchValue == null) { - return indexNotFound(); - } - else { - return value_1(matchValue); - } -} -export function reduce(folder, xs) { - const e = ofSeq(xs); - try { - const loop = (acc_mut) => { - loop: while (true) { - const acc = acc_mut; - if (e["System.Collections.IEnumerator.MoveNext"]()) { - acc_mut = folder(acc, e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - continue loop; - } - else { - return acc; - } - break; - } - }; - if (e["System.Collections.IEnumerator.MoveNext"]()) { - return loop(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - throw new Error(SR_inputSequenceEmpty); - } - } - finally { - disposeSafe(e); - } -} -export function reduceBack(folder, xs) { - const arr = toArray(xs); - if (arr.length > 0) { - return arr.reduceRight(folder); - } - else { - throw new Error(SR_inputSequenceEmpty); - } -} -export function replicate(n, x) { - return initialize(n, (_arg) => x); -} -export function reverse(xs) { - return delay(() => ofArray(reverse_1(toArray(xs)))); -} -export function scan(folder, state, xs) { - return delay(() => { - let acc = state; - return concat([singleton(state), map((x) => { - acc = folder(acc, x); - return acc; - }, xs)]); - }); -} -export function scanBack(folder, xs, state) { - return delay(() => ofArray(scanBack_1(folder, toArray(xs), state))); -} -export function skip(count, source) { - return mkSeq(() => { - const e = ofSeq(source); - try { - for (let _ = 1; _ <= count; _++) { - if (!e["System.Collections.IEnumerator.MoveNext"]()) { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "source"); - } - } - return Enumerator_enumerateThenFinally(() => { - }, e); - } - catch (matchValue) { - disposeSafe(e); - throw matchValue; - } - }); -} -export function skipWhile(predicate, xs) { - return delay(() => { - let skipped = true; - return filter((x) => { - if (skipped) { - skipped = predicate(x); - } - return !skipped; - }, xs); - }); -} -export function tail(xs) { - return skip(1, xs); -} -export function take(count, xs) { - return generateIndexed(() => ofSeq(xs), (i, e) => { - if (i < count) { - if (e["System.Collections.IEnumerator.MoveNext"]()) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - throw new Error((SR_notEnoughElements + "\\nParameter name: ") + "source"); - } - } - else { - return void 0; - } - }, (e_1) => { - disposeSafe(e_1); - }); -} -export function takeWhile(predicate, xs) { - 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) => { - disposeSafe(e_1); - }); -} -export function truncate(count, xs) { - 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) => { - disposeSafe(e_1); - }); -} -export function zip(xs, ys) { - return map2((x, y) => [x, y], xs, ys); -} -export function zip3(xs, ys, zs) { - return map3((x, y, z) => [x, y, z], xs, ys, zs); -} -export function collect(mapping, xs) { - return delay(() => concat(map(mapping, xs))); -} -export function where(predicate, xs) { - return filter(predicate, xs); -} -export function pairwise(xs) { - return delay(() => ofArray(pairwise_1(toArray(xs)))); -} -export function splitInto(chunks, xs) { - return delay(() => ofArray(splitInto_1(chunks, toArray(xs)))); -} -export function windowed(windowSize, xs) { - return delay(() => ofArray(windowed_1(windowSize, toArray(xs)))); -} -export function transpose(xss) { - return delay(() => ofArray(map_1(ofArray, transpose_1(map_1(toArray, toArray(xss)))))); -} -export function sortWith(comparer, xs) { - return delay(() => { - const arr = toArray(xs); - arr.sort(comparer); - return ofArray(arr); - }); -} -export function sort(xs, comparer) { - return sortWith((x, y) => comparer.Compare(x, y), xs); -} -export function sortBy(projection, xs, comparer) { - return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs); -} -export function sortDescending(xs, comparer) { - return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs); -} -export function sortByDescending(projection, xs, comparer) { - return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs); -} -export function sum(xs, adder) { - return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs); -} -export function sumBy(f, xs, adder) { - return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs); -} -export function maxBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs); -} -export function max(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs); -} -export function minBy(projection, xs, comparer) { - return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs); -} -export function min(xs, comparer) { - return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs); -} -export function average(xs, averager) { - let count = 0; - const total = fold((acc, x) => { - count = ((count + 1) | 0); - return averager.Add(acc, x); - }, averager.GetZero(), xs); - if (count === 0) { - throw new Error((SR_inputSequenceEmpty + "\\nParameter name: ") + "source"); - } - else { - return averager.DivideByInt(total, count); - } -} -export function averageBy(f, xs, averager) { - let count = 0; - const total = fold((acc, x) => { - count = ((count + 1) | 0); - return averager.Add(acc, f(x)); - }, averager.GetZero(), xs); - if (count === 0) { - throw new Error((SR_inputSequenceEmpty + "\\nParameter name: ") + "source"); - } - else { - return averager.DivideByInt(total, count); - } -} -export function permute(f, xs) { - return delay(() => ofArray(permute_1(f, toArray(xs)))); -} -export function chunkBySize(chunkSize, xs) { - return delay(() => ofArray(chunkBySize_1(chunkSize, toArray(xs)))); -} -export function insertAt(index, y, xs) { - let isDone = false; - if (index < 0) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return generateIndexed(() => ofSeq(xs), (i, e) => { - if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else if (i === index) { - isDone = true; - return some(y); - } - else { - if (!isDone) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return void 0; - } - }, (e_1) => { - disposeSafe(e_1); - }); -} -export function insertManyAt(index, ys, xs) { - let status = -1; - if (index < 0) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => { - const e1 = tupledArg[0]; - const e2 = tupledArg[1]; - if (i === index) { - status = 0; - } - let inserted; - if (status === 0) { - if (e2["System.Collections.IEnumerator.MoveNext"]()) { - inserted = some(e2["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - status = 1; - inserted = void 0; - } - } - else { - inserted = void 0; - } - if (inserted == null) { - if (e1["System.Collections.IEnumerator.MoveNext"]()) { - return some(e1["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - if (status < 1) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return void 0; - } - } - else { - return some(value_1(inserted)); - } - }, (tupledArg_1) => { - disposeSafe(tupledArg_1[0]); - disposeSafe(tupledArg_1[1]); - }); -} -export function removeAt(index, xs) { - let isDone = false; - if (index < 0) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return generateIndexed(() => ofSeq(xs), (i, e) => { - if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else if ((i === index) && e["System.Collections.IEnumerator.MoveNext"]()) { - isDone = true; - return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : void 0; - } - else { - if (!isDone) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return void 0; - } - }, (e_1) => { - disposeSafe(e_1); - }); -} -export function removeManyAt(index, count, xs) { - if (index < 0) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return generateIndexed(() => ofSeq(xs), (i, e) => { - if (i < index) { - if (e["System.Collections.IEnumerator.MoveNext"]()) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - } - else { - if (i === index) { - for (let _ = 1; _ <= count; _++) { - if (!e["System.Collections.IEnumerator.MoveNext"]()) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "count"); - } - } - } - return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : void 0; - } - }, (e_1) => { - disposeSafe(e_1); - }); -} -export function updateAt(index, y, xs) { - let isDone = false; - if (index < 0) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return generateIndexed(() => ofSeq(xs), (i, e) => { - if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) { - return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()); - } - else if ((i === index) && e["System.Collections.IEnumerator.MoveNext"]()) { - isDone = true; - return some(y); - } - else { - if (!isDone) { - throw new Error((SR_indexOutOfBounds + "\\nParameter name: ") + "index"); - } - return void 0; - } - }, (e_1) => { - disposeSafe(e_1); - }); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.d.ts deleted file mode 100644 index b5e9043f..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IEqualityComparer } from "./Util.js"; -import { int32 } from "./Int32.js"; -import { FSharpList } from "./List.js"; -export declare function distinct(xs: Iterable, comparer: IEqualityComparer): Iterable; -export declare function distinctBy(projection: ((arg0: T) => Key), xs: Iterable, comparer: IEqualityComparer): Iterable; -export declare function except(itemsToExclude: Iterable, xs: Iterable, comparer: IEqualityComparer): Iterable; -export declare function countBy(projection: ((arg0: T) => Key), xs: Iterable, comparer: IEqualityComparer): Iterable<[Key, int32]>; -export declare function groupBy(projection: ((arg0: T) => Key), xs: Iterable, comparer: IEqualityComparer): Iterable<[Key, Iterable]>; -export declare function Array_distinct(xs: T[], comparer: IEqualityComparer): T[]; -export declare function Array_distinctBy(projection: ((arg0: T) => Key), xs: T[], comparer: IEqualityComparer): T[]; -export declare function Array_except(itemsToExclude: Iterable, xs: T[], comparer: IEqualityComparer): T[]; -export declare function Array_countBy(projection: ((arg0: T) => Key), xs: T[], comparer: IEqualityComparer): [Key, int32][]; -export declare function Array_groupBy(projection: ((arg0: T) => Key), xs: T[], comparer: IEqualityComparer): [Key, T[]][]; -export declare function List_distinct(xs: FSharpList, comparer: IEqualityComparer): FSharpList; -export declare function List_distinctBy(projection: ((arg0: T) => Key), xs: FSharpList, comparer: IEqualityComparer): FSharpList; -export declare function List_except(itemsToExclude: Iterable, xs: FSharpList, comparer: IEqualityComparer): FSharpList; -export declare function List_countBy(projection: ((arg0: T) => Key), xs: FSharpList, comparer: IEqualityComparer): FSharpList<[Key, int32]>; -export declare function List_groupBy(projection: ((arg0: T) => Key), xs: FSharpList, comparer: IEqualityComparer): FSharpList<[Key, FSharpList]>; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.js deleted file mode 100644 index 4d484351..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Seq2.js +++ /dev/null @@ -1,111 +0,0 @@ -import { toList, toArray, map, filter, delay } from "./Seq.js"; -import { HashSet } from "./MutableSet.js"; -import { defaultOf, disposeSafe, getEnumerator } from "./Util.js"; -import { addToDict, getItemFromDict, tryGetValue, addToSet } from "./MapUtil.js"; -import { Dictionary } from "./MutableMap.js"; -import { FSharpRef } from "./Types.js"; -export function distinct(xs, comparer) { - return delay(() => { - const hashSet = new HashSet([], comparer); - return filter((x) => addToSet(x, hashSet), xs); - }); -} -export function distinctBy(projection, xs, comparer) { - return delay(() => { - const hashSet = new HashSet([], comparer); - return filter((x) => addToSet(projection(x), hashSet), xs); - }); -} -export function except(itemsToExclude, xs, comparer) { - return delay(() => { - const hashSet = new HashSet(itemsToExclude, comparer); - return filter((x) => addToSet(x, hashSet), xs); - }); -} -export function countBy(projection, xs, comparer) { - return delay(() => { - const dict = new Dictionary([], comparer); - const keys = []; - const enumerator = getEnumerator(xs); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const key = projection(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]()); - let matchValue; - let outArg = 0; - matchValue = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => { - outArg = (v | 0); - })), outArg]; - if (matchValue[0]) { - dict.set(key, matchValue[1] + 1); - } - else { - dict.set(key, 1); - void (keys.push(key)); - } - } - } - finally { - disposeSafe(enumerator); - } - return map((key_1) => [key_1, getItemFromDict(dict, key_1)], keys); - }); -} -export function groupBy(projection, xs, comparer) { - return delay(() => { - const dict = new Dictionary([], comparer); - const keys = []; - const enumerator = getEnumerator(xs); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const x = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - const key = projection(x); - let matchValue; - let outArg = defaultOf(); - matchValue = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => { - outArg = v; - })), outArg]; - if (matchValue[0]) { - void (matchValue[1].push(x)); - } - else { - addToDict(dict, key, [x]); - void (keys.push(key)); - } - } - } - finally { - disposeSafe(enumerator); - } - return map((key_1) => [key_1, getItemFromDict(dict, key_1)], keys); - }); -} -export function Array_distinct(xs, comparer) { - return toArray(distinct(xs, comparer)); -} -export function Array_distinctBy(projection, xs, comparer) { - return toArray(distinctBy(projection, xs, comparer)); -} -export function Array_except(itemsToExclude, xs, comparer) { - return toArray(except(itemsToExclude, xs, comparer)); -} -export function Array_countBy(projection, xs, comparer) { - return toArray(countBy(projection, xs, comparer)); -} -export function Array_groupBy(projection, xs, comparer) { - return toArray(map((tupledArg) => [tupledArg[0], toArray(tupledArg[1])], groupBy(projection, xs, comparer))); -} -export function List_distinct(xs, comparer) { - return toList(distinct(xs, comparer)); -} -export function List_distinctBy(projection, xs, comparer) { - return toList(distinctBy(projection, xs, comparer)); -} -export function List_except(itemsToExclude, xs, comparer) { - return toList(except(itemsToExclude, xs, comparer)); -} -export function List_countBy(projection, xs, comparer) { - return toList(countBy(projection, xs, comparer)); -} -export function List_groupBy(projection, xs, comparer) { - return toList(map((tupledArg) => [tupledArg[0], toList(tupledArg[1])], groupBy(projection, xs, comparer))); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.d.ts deleted file mode 100644 index 1a247c63..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { TypeInfo } from "./Reflection.js"; -import { Option } from "./Option.js"; -import { int32 } from "./Int32.js"; -import { ISet, IEnumerator, IComparer } from "./Util.js"; -import { Record } from "./Types.js"; -import { FSharpList } from "./List.js"; -export declare class SetTreeLeaf$1 { - readonly k: T; - constructor(k: T); -} -export declare function SetTreeLeaf$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function SetTreeLeaf$1_$ctor_2B595(k: T): SetTreeLeaf$1; -export declare function SetTreeLeaf$1__get_Key(_: SetTreeLeaf$1): T; -export declare class SetTreeNode$1 extends SetTreeLeaf$1 { - readonly right: Option>; - readonly left: Option>; - readonly h: int32; - constructor(v: T, left: Option>, right: Option>, h: int32); -} -export declare function SetTreeNode$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function SetTreeNode$1_$ctor_5F465FC9(v: T, left: Option>, right: Option>, h: int32): SetTreeNode$1; -export declare function SetTreeNode$1__get_Left(_: SetTreeNode$1): Option>; -export declare function SetTreeNode$1__get_Right(_: SetTreeNode$1): Option>; -export declare function SetTreeNode$1__get_Height(_: SetTreeNode$1): int32; -export declare function SetTreeModule_empty(): Option>; -export declare function SetTreeModule_countAux(t_mut: Option>, acc_mut: int32): int32; -export declare function SetTreeModule_count<$a>(s: Option>): int32; -export declare function SetTreeModule_mk(l: Option>, k: T, r: Option>): Option>; -export declare function SetTreeModule_rebalance(t1: Option>, v: T, t2: Option>): Option>; -export declare function SetTreeModule_add(comparer: IComparer, k: T, t: Option>): Option>; -export declare function SetTreeModule_balance(comparer: IComparer, t1: Option>, k: T, t2: Option>): Option>; -export declare function SetTreeModule_split(comparer: IComparer, pivot: T, t: Option>): [Option>, boolean, Option>]; -export declare function SetTreeModule_spliceOutSuccessor(t: Option>): [T, Option>]; -export declare function SetTreeModule_remove(comparer: IComparer, k: T, t: Option>): Option>; -export declare function SetTreeModule_mem(comparer_mut: IComparer, k_mut: T, t_mut: Option>): boolean; -export declare function SetTreeModule_iter(f_mut: ((arg0: T) => void), t_mut: Option>): void; -export declare function SetTreeModule_foldBackOpt(f_mut: any, t_mut: Option>, x_mut: $a): $a; -export declare function SetTreeModule_foldBack<$a, $b>(f: ((arg0: $a, arg1: $b) => $b), m: Option>, x: $b): $b; -export declare function SetTreeModule_foldOpt<$a, T>(f_mut: any, x_mut: $a, t_mut: Option>): $a; -export declare function SetTreeModule_fold<$a, $b>(f: ((arg0: $a, arg1: $b) => $a), x: $a, m: Option>): $a; -export declare function SetTreeModule_forall(f_mut: ((arg0: T) => boolean), t_mut: Option>): boolean; -export declare function SetTreeModule_exists(f_mut: ((arg0: T) => boolean), t_mut: Option>): boolean; -export declare function SetTreeModule_subset<$a>(comparer: IComparer<$a>, a: Option>, b: Option>): boolean; -export declare function SetTreeModule_properSubset<$a>(comparer: IComparer<$a>, a: Option>, b: Option>): boolean; -export declare function SetTreeModule_filterAux(comparer_mut: IComparer, f_mut: ((arg0: T) => boolean), t_mut: Option>, acc_mut: Option>): Option>; -export declare function SetTreeModule_filter<$a>(comparer: IComparer<$a>, f: ((arg0: $a) => boolean), s: Option>): Option>; -export declare function SetTreeModule_diffAux(comparer_mut: IComparer, t_mut: Option>, acc_mut: Option>): Option>; -export declare function SetTreeModule_diff<$a>(comparer: IComparer<$a>, a: Option>, b: Option>): Option>; -export declare function SetTreeModule_union(comparer: IComparer, t1: Option>, t2: Option>): Option>; -export declare function SetTreeModule_intersectionAux(comparer_mut: IComparer, b_mut: Option>, t_mut: Option>, acc_mut: Option>): Option>; -export declare function SetTreeModule_intersection<$a>(comparer: IComparer<$a>, a: Option>, b: Option>): Option>; -export declare function SetTreeModule_partition1<$a>(comparer: IComparer<$a>, f: ((arg0: $a) => boolean), k: $a, acc1: Option>, acc2: Option>): [Option>, Option>]; -export declare function SetTreeModule_partitionAux(comparer_mut: IComparer, f_mut: ((arg0: T) => boolean), t_mut: Option>, acc__mut: Option>, acc__1_mut: Option>): [Option>, Option>]; -export declare function SetTreeModule_partition<$a>(comparer: IComparer<$a>, f: ((arg0: $a) => boolean), s: Option>): [Option>, Option>]; -export declare function SetTreeModule_minimumElementAux(t_mut: Option>, n_mut: T): T; -export declare function SetTreeModule_minimumElementOpt(t: Option>): Option; -export declare function SetTreeModule_maximumElementAux(t_mut: Option>, n_mut: T): T; -export declare function SetTreeModule_maximumElementOpt(t: Option>): Option; -export declare function SetTreeModule_minimumElement<$a>(s: Option>): $a; -export declare function SetTreeModule_maximumElement<$a>(s: Option>): $a; -export declare class SetTreeModule_SetIterator$1 extends Record { - stack: FSharpList>>; - started: boolean; - constructor(stack: FSharpList>>, started: boolean); -} -export declare function SetTreeModule_SetIterator$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function SetTreeModule_collapseLHS(stack_mut: FSharpList>>): FSharpList>>; -export declare function SetTreeModule_mkIterator<$a>(s: Option>): SetTreeModule_SetIterator$1<$a>; -export declare function SetTreeModule_notStarted<$a>(): $a; -export declare function SetTreeModule_alreadyFinished<$a>(): $a; -export declare function SetTreeModule_current<$a>(i: SetTreeModule_SetIterator$1<$a>): $a; -export declare function SetTreeModule_moveNext(i: SetTreeModule_SetIterator$1): boolean; -export declare function SetTreeModule_mkIEnumerator(s: Option>): IEnumerator; -/** - * Set comparison. Note this can be expensive. - */ -export declare function SetTreeModule_compareStacks(comparer_mut: IComparer, l1_mut: FSharpList>>, l2_mut: FSharpList>>): int32; -export declare function SetTreeModule_compare(comparer: IComparer, t1: Option>, t2: Option>): int32; -export declare function SetTreeModule_choose<$a>(s: Option>): $a; -export declare function SetTreeModule_toList(t: Option>): FSharpList; -export declare function SetTreeModule_copyToArray<$a>(s: Option>, arr: $a[], i: int32): void; -export declare function SetTreeModule_toArray<$a>(s: Option>): $a[]; -export declare function SetTreeModule_mkFromEnumerator<$a>(comparer_mut: IComparer<$a>, acc_mut: Option>, e_mut: IEnumerator<$a>): Option>; -export declare function SetTreeModule_ofArray<$a>(comparer: IComparer<$a>, l: $a[]): Option>; -export declare function SetTreeModule_ofList<$a>(comparer: IComparer<$a>, l: FSharpList<$a>): Option>; -export declare function SetTreeModule_ofSeq(comparer: IComparer, c: Iterable): Option>; -export declare class FSharpSet implements ISet, Iterable, Iterable { - readonly tree: Option>; - readonly comparer: IComparer; - constructor(comparer: IComparer, tree: Option>); - GetHashCode(): int32; - Equals(that: any): boolean; - toString(): string; - get [Symbol.toStringTag](): string; - toJSON(): any; - CompareTo(that: any): int32; - "System.Collections.Generic.ICollection`1.Add2B595"(x: T): void; - "System.Collections.Generic.ICollection`1.Clear"(): void; - "System.Collections.Generic.ICollection`1.Remove2B595"(x: T): boolean; - "System.Collections.Generic.ICollection`1.Contains2B595"(x: T): boolean; - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(arr: T[], i: int32): void; - "System.Collections.Generic.ICollection`1.get_IsReadOnly"(): boolean; - "System.Collections.Generic.ICollection`1.get_Count"(): int32; - "System.Collections.Generic.IReadOnlyCollection`1.get_Count"(): int32; - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; - get size(): int32; - add(k: T): ISet; - clear(): void; - delete(k: T): boolean; - has(k: T): boolean; - keys(): Iterable; - values(): Iterable; - entries(): Iterable<[T, T]>; - forEach(f: ((arg0: T, arg1: T, arg2: ISet) => void), thisArg?: Option): void; -} -export declare function FSharpSet_$reflection(gen0: TypeInfo): TypeInfo; -export declare function FSharpSet_$ctor(comparer: IComparer, tree: Option>): FSharpSet; -export declare function FSharpSet__get_Comparer(set$: FSharpSet): IComparer; -export declare function FSharpSet__get_Tree(set$: FSharpSet): Option>; -export declare function FSharpSet_Empty(comparer: IComparer): FSharpSet; -export declare function FSharpSet__Add(s: FSharpSet, value: T): FSharpSet; -export declare function FSharpSet__Remove(s: FSharpSet, value: T): FSharpSet; -export declare function FSharpSet__get_Count(s: FSharpSet): int32; -export declare function FSharpSet__Contains(s: FSharpSet, value: T): boolean; -export declare function FSharpSet__Iterate(s: FSharpSet, x: ((arg0: T) => void)): void; -export declare function FSharpSet__Fold(s: FSharpSet, f: ((arg0: T, arg1: $a) => $a), z: $a): $a; -export declare function FSharpSet__get_IsEmpty(s: FSharpSet): boolean; -export declare function FSharpSet__Partition(s: FSharpSet, f: ((arg0: T) => boolean)): [FSharpSet, FSharpSet]; -export declare function FSharpSet__Filter(s: FSharpSet, f: ((arg0: T) => boolean)): FSharpSet; -export declare function FSharpSet__Map(s: FSharpSet, f: ((arg0: T) => U), comparer: IComparer): FSharpSet; -export declare function FSharpSet__Exists(s: FSharpSet, f: ((arg0: T) => boolean)): boolean; -export declare function FSharpSet__ForAll(s: FSharpSet, f: ((arg0: T) => boolean)): boolean; -export declare function FSharpSet_op_Subtraction(set1: FSharpSet, set2: FSharpSet): FSharpSet; -export declare function FSharpSet_op_Addition(set1: FSharpSet, set2: FSharpSet): FSharpSet; -export declare function FSharpSet_Intersection(a: FSharpSet, b: FSharpSet): FSharpSet; -export declare function FSharpSet_IntersectionMany(sets: Iterable>): FSharpSet; -export declare function FSharpSet_Equality(a: FSharpSet, b: FSharpSet): boolean; -export declare function FSharpSet_Compare(a: FSharpSet, b: FSharpSet): int32; -export declare function FSharpSet__get_Choose(x: FSharpSet): T; -export declare function FSharpSet__get_MinimumElement(x: FSharpSet): T; -export declare function FSharpSet__get_MaximumElement(x: FSharpSet): T; -export declare function FSharpSet__IsSubsetOf(x: FSharpSet, otherSet: FSharpSet): boolean; -export declare function FSharpSet__IsSupersetOf(x: FSharpSet, otherSet: FSharpSet): boolean; -export declare function FSharpSet__IsProperSubsetOf(x: FSharpSet, otherSet: FSharpSet): boolean; -export declare function FSharpSet__IsProperSupersetOf(x: FSharpSet, otherSet: FSharpSet): boolean; -export declare function FSharpSet__ToList(x: FSharpSet): FSharpList; -export declare function FSharpSet__ToArray(x: FSharpSet): T[]; -export declare function FSharpSet__ComputeHashCode(this$: FSharpSet): int32; -export declare function isEmpty(set$: FSharpSet): boolean; -export declare function contains(element: T, set$: FSharpSet): boolean; -export declare function add(value: T, set$: FSharpSet): FSharpSet; -export declare function singleton(value: T, comparer: IComparer): FSharpSet; -export declare function remove(value: T, set$: FSharpSet): FSharpSet; -export declare function union(set1: FSharpSet, set2: FSharpSet): FSharpSet; -export declare function unionMany(sets: Iterable>, comparer: IComparer): FSharpSet; -export declare function intersect(set1: FSharpSet, set2: FSharpSet): FSharpSet; -export declare function intersectMany(sets: Iterable>): FSharpSet; -export declare function iterate(action: ((arg0: T) => void), set$: FSharpSet): void; -export declare function empty(comparer: IComparer): FSharpSet; -export declare function forAll(predicate: ((arg0: T) => boolean), set$: FSharpSet): boolean; -export declare function exists(predicate: ((arg0: T) => boolean), set$: FSharpSet): boolean; -export declare function filter(predicate: ((arg0: T) => boolean), set$: FSharpSet): FSharpSet; -export declare function partition(predicate: ((arg0: T) => boolean), set$: FSharpSet): [FSharpSet, FSharpSet]; -export declare function fold(folder: ((arg0: State, arg1: T) => State), state: State, set$: FSharpSet): State; -export declare function foldBack(folder: ((arg0: T, arg1: State) => State), set$: FSharpSet, state: State): State; -export declare function map(mapping: ((arg0: T) => U), set$: FSharpSet, comparer: IComparer): FSharpSet; -export declare function count(set$: FSharpSet): int32; -export declare function ofList(elements: Iterable, comparer: IComparer): FSharpSet; -export declare function ofArray(array: T[], comparer: IComparer): FSharpSet; -export declare function toList(set$: FSharpSet): FSharpList; -export declare function toArray(set$: FSharpSet): T[]; -export declare function toSeq(set$: FSharpSet): Iterable; -export declare function ofSeq(elements: Iterable, comparer: IComparer): FSharpSet; -export declare function difference(set1: FSharpSet, set2: FSharpSet): FSharpSet; -export declare function isSubset(set1: FSharpSet, set2: FSharpSet): boolean; -export declare function isSuperset(set1: FSharpSet, set2: FSharpSet): boolean; -export declare function isProperSubset(set1: FSharpSet, set2: FSharpSet): boolean; -export declare function isProperSuperset(set1: FSharpSet, set2: FSharpSet): boolean; -export declare function minElement(set$: FSharpSet): T; -export declare function maxElement(set$: FSharpSet): T; -export declare function unionWith(s1: ISet, s2: Iterable): ISet; -export declare function newMutableSetWith(s1: ISet, s2: Iterable): ISet; -export declare function intersectWith(s1: ISet, s2: Iterable): void; -export declare function exceptWith(s1: ISet, s2: Iterable): void; -export declare function isSubsetOf(s1: ISet, s2: Iterable): boolean; -export declare function isSupersetOf(s1: ISet, s2: Iterable): boolean; -export declare function isProperSubsetOf(s1: ISet, s2: Iterable): boolean; -export declare function isProperSupersetOf(s1: ISet, s2: Iterable): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.js deleted file mode 100644 index e0ea6e76..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Set.js +++ /dev/null @@ -1,1789 +0,0 @@ -import { record_type, bool_type, list_type, option_type, class_type } from "./Reflection.js"; -import { some, value as value_3 } from "./Option.js"; -import { structuralHash, toIterator, disposeSafe, getEnumerator, isArrayLike } from "./Util.js"; -import { toString, Record } from "./Types.js"; -import { fold as fold_2, cons, singleton as singleton_1, empty as empty_1, ofArrayWithTail, tail, head, isEmpty as isEmpty_1, FSharpList } from "./List.js"; -import { fold as fold_1, fill } from "./Array.js"; -import { join } from "./String.js"; -import { 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"; -import { HashSet__get_Comparer, HashSet_$ctor_Z6150332D, HashSet } from "./MutableSet.js"; -export class SetTreeLeaf$1 { - constructor(k) { - this.k = k; - } -} -export function SetTreeLeaf$1_$reflection(gen0) { - return class_type("Set.SetTreeLeaf`1", [gen0], SetTreeLeaf$1); -} -export function SetTreeLeaf$1_$ctor_2B595(k) { - return new SetTreeLeaf$1(k); -} -export function SetTreeLeaf$1__get_Key(_) { - return _.k; -} -export class SetTreeNode$1 extends SetTreeLeaf$1 { - constructor(v, left, right, h) { - super(v); - this.left = left; - this.right = right; - this.h = (h | 0); - } -} -export function SetTreeNode$1_$reflection(gen0) { - return class_type("Set.SetTreeNode`1", [gen0], SetTreeNode$1, SetTreeLeaf$1_$reflection(gen0)); -} -export function SetTreeNode$1_$ctor_5F465FC9(v, left, right, h) { - return new SetTreeNode$1(v, left, right, h); -} -export function SetTreeNode$1__get_Left(_) { - return _.left; -} -export function SetTreeNode$1__get_Right(_) { - return _.right; -} -export function SetTreeNode$1__get_Height(_) { - return _.h; -} -export function SetTreeModule_empty() { - return void 0; -} -export function SetTreeModule_countAux(t_mut, acc_mut) { - SetTreeModule_countAux: while (true) { - const t = t_mut, acc = acc_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - t_mut = SetTreeNode$1__get_Left(tn); - acc_mut = SetTreeModule_countAux(SetTreeNode$1__get_Right(tn), acc + 1); - continue SetTreeModule_countAux; - } - else { - return (acc + 1) | 0; - } - } - else { - return acc | 0; - } - break; - } -} -export function SetTreeModule_count(s) { - return SetTreeModule_countAux(s, 0); -} -export function SetTreeModule_mk(l, k, r) { - let tn, tn_1; - let hl; - const t = l; - if (t != null) { - const t2 = value_3(t); - hl = ((t2 instanceof SetTreeNode$1) ? ((tn = t2, SetTreeNode$1__get_Height(tn))) : 1); - } - else { - hl = 0; - } - let hr; - const t_1 = r; - if (t_1 != null) { - const t2_1 = value_3(t_1); - hr = ((t2_1 instanceof SetTreeNode$1) ? ((tn_1 = t2_1, SetTreeNode$1__get_Height(tn_1))) : 1); - } - else { - hr = 0; - } - const m = ((hl < hr) ? hr : hl) | 0; - if (m === 0) { - return SetTreeLeaf$1_$ctor_2B595(k); - } - else { - return SetTreeNode$1_$ctor_5F465FC9(k, l, r, m + 1); - } -} -export function SetTreeModule_rebalance(t1, v, t2) { - let tn, tn_1, t_2, t2_3, tn_2, t_3, t2_4, tn_3; - let t1h; - const t = t1; - if (t != null) { - const t2_1 = value_3(t); - t1h = ((t2_1 instanceof SetTreeNode$1) ? ((tn = t2_1, SetTreeNode$1__get_Height(tn))) : 1); - } - else { - t1h = 0; - } - let t2h; - const t_1 = t2; - if (t_1 != null) { - const t2_2 = value_3(t_1); - t2h = ((t2_2 instanceof SetTreeNode$1) ? ((tn_1 = t2_2, SetTreeNode$1__get_Height(tn_1))) : 1); - } - else { - t2h = 0; - } - if (t2h > (t1h + 2)) { - const matchValue = value_3(t2); - if (matchValue instanceof SetTreeNode$1) { - const t2$0027 = matchValue; - if (((t_2 = SetTreeNode$1__get_Left(t2$0027), (t_2 != null) ? ((t2_3 = value_3(t_2), (t2_3 instanceof SetTreeNode$1) ? ((tn_2 = t2_3, SetTreeNode$1__get_Height(tn_2))) : 1)) : 0)) > (t1h + 1)) { - const matchValue_1 = value_3(SetTreeNode$1__get_Left(t2$0027)); - if (matchValue_1 instanceof SetTreeNode$1) { - const t2l = matchValue_1; - return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(t2l)), SetTreeLeaf$1__get_Key(t2l), SetTreeModule_mk(SetTreeNode$1__get_Right(t2l), SetTreeLeaf$1__get_Key(t2$0027), SetTreeNode$1__get_Right(t2$0027))); - } - else { - throw new Error("internal error: Set.rebalance"); - } - } - else { - return SetTreeModule_mk(SetTreeModule_mk(t1, v, SetTreeNode$1__get_Left(t2$0027)), SetTreeLeaf$1__get_Key(t2$0027), SetTreeNode$1__get_Right(t2$0027)); - } - } - else { - throw new Error("internal error: Set.rebalance"); - } - } - else if (t1h > (t2h + 2)) { - const matchValue_2 = value_3(t1); - if (matchValue_2 instanceof SetTreeNode$1) { - const t1$0027 = matchValue_2; - if (((t_3 = SetTreeNode$1__get_Right(t1$0027), (t_3 != null) ? ((t2_4 = value_3(t_3), (t2_4 instanceof SetTreeNode$1) ? ((tn_3 = t2_4, SetTreeNode$1__get_Height(tn_3))) : 1)) : 0)) > (t2h + 1)) { - const matchValue_3 = value_3(SetTreeNode$1__get_Right(t1$0027)); - if (matchValue_3 instanceof SetTreeNode$1) { - const t1r = matchValue_3; - return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(t1$0027), SetTreeLeaf$1__get_Key(t1$0027), SetTreeNode$1__get_Left(t1r)), SetTreeLeaf$1__get_Key(t1r), SetTreeModule_mk(SetTreeNode$1__get_Right(t1r), v, t2)); - } - else { - throw new Error("internal error: Set.rebalance"); - } - } - else { - return SetTreeModule_mk(SetTreeNode$1__get_Left(t1$0027), SetTreeLeaf$1__get_Key(t1$0027), SetTreeModule_mk(SetTreeNode$1__get_Right(t1$0027), v, t2)); - } - } - else { - throw new Error("internal error: Set.rebalance"); - } - } - else { - return SetTreeModule_mk(t1, v, t2); - } -} -export function SetTreeModule_add(comparer, k, t) { - if (t != null) { - const t2 = value_3(t); - const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0; - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (c < 0) { - return SetTreeModule_rebalance(SetTreeModule_add(comparer, k, SetTreeNode$1__get_Left(tn)), SetTreeLeaf$1__get_Key(tn), SetTreeNode$1__get_Right(tn)); - } - else if (c === 0) { - return t; - } - else { - return SetTreeModule_rebalance(SetTreeNode$1__get_Left(tn), SetTreeLeaf$1__get_Key(tn), SetTreeModule_add(comparer, k, SetTreeNode$1__get_Right(tn))); - } - } - else { - const c_1 = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0; - if (c_1 < 0) { - return SetTreeNode$1_$ctor_5F465FC9(k, SetTreeModule_empty(), t, 2); - } - else if (c_1 === 0) { - return t; - } - else { - return SetTreeNode$1_$ctor_5F465FC9(k, t, SetTreeModule_empty(), 2); - } - } - } - else { - return SetTreeLeaf$1_$ctor_2B595(k); - } -} -export function SetTreeModule_balance(comparer, t1, k, t2) { - if (t1 != null) { - const t1$0027 = value_3(t1); - if (t2 != null) { - const t2$0027 = value_3(t2); - if (t1$0027 instanceof SetTreeNode$1) { - const t1n = t1$0027; - if (t2$0027 instanceof SetTreeNode$1) { - const t2n = t2$0027; - if ((SetTreeNode$1__get_Height(t1n) + 2) < SetTreeNode$1__get_Height(t2n)) { - return SetTreeModule_rebalance(SetTreeModule_balance(comparer, t1, k, SetTreeNode$1__get_Left(t2n)), SetTreeLeaf$1__get_Key(t2n), SetTreeNode$1__get_Right(t2n)); - } - else if ((SetTreeNode$1__get_Height(t2n) + 2) < SetTreeNode$1__get_Height(t1n)) { - return SetTreeModule_rebalance(SetTreeNode$1__get_Left(t1n), SetTreeLeaf$1__get_Key(t1n), SetTreeModule_balance(comparer, SetTreeNode$1__get_Right(t1n), k, t2)); - } - else { - return SetTreeModule_mk(t1, k, t2); - } - } - else { - return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1)); - } - } - else { - return SetTreeModule_add(comparer, k, SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2)); - } - } - else { - return SetTreeModule_add(comparer, k, t1); - } - } - else { - return SetTreeModule_add(comparer, k, t2); - } -} -export function SetTreeModule_split(comparer, pivot, t) { - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - const c = comparer.Compare(pivot, SetTreeLeaf$1__get_Key(tn)) | 0; - if (c < 0) { - const patternInput = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Left(tn)); - return [patternInput[0], patternInput[1], SetTreeModule_balance(comparer, patternInput[2], SetTreeLeaf$1__get_Key(tn), SetTreeNode$1__get_Right(tn))]; - } - else if (c === 0) { - return [SetTreeNode$1__get_Left(tn), true, SetTreeNode$1__get_Right(tn)]; - } - else { - const patternInput_1 = SetTreeModule_split(comparer, pivot, SetTreeNode$1__get_Right(tn)); - return [SetTreeModule_balance(comparer, SetTreeNode$1__get_Left(tn), SetTreeLeaf$1__get_Key(tn), patternInput_1[0]), patternInput_1[1], patternInput_1[2]]; - } - } - else { - const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(t2), pivot) | 0; - if (c_1 < 0) { - return [t, false, SetTreeModule_empty()]; - } - else if (c_1 === 0) { - return [SetTreeModule_empty(), true, SetTreeModule_empty()]; - } - else { - return [SetTreeModule_empty(), false, t]; - } - } - } - else { - return [SetTreeModule_empty(), false, SetTreeModule_empty()]; - } -} -export function SetTreeModule_spliceOutSuccessor(t) { - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (SetTreeNode$1__get_Left(tn) == null) { - return [SetTreeLeaf$1__get_Key(tn), SetTreeNode$1__get_Right(tn)]; - } - else { - const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Left(tn)); - return [patternInput[0], SetTreeModule_mk(patternInput[1], SetTreeLeaf$1__get_Key(tn), SetTreeNode$1__get_Right(tn))]; - } - } - else { - return [SetTreeLeaf$1__get_Key(t2), SetTreeModule_empty()]; - } - } - else { - throw new Error("internal error: Set.spliceOutSuccessor"); - } -} -export function SetTreeModule_remove(comparer, k, t) { - if (t != null) { - const t2 = value_3(t); - const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0; - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (c < 0) { - return SetTreeModule_rebalance(SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Left(tn)), SetTreeLeaf$1__get_Key(tn), SetTreeNode$1__get_Right(tn)); - } - else if (c === 0) { - if (SetTreeNode$1__get_Left(tn) == null) { - return SetTreeNode$1__get_Right(tn); - } - else if (SetTreeNode$1__get_Right(tn) == null) { - return SetTreeNode$1__get_Left(tn); - } - else { - const patternInput = SetTreeModule_spliceOutSuccessor(SetTreeNode$1__get_Right(tn)); - return SetTreeModule_mk(SetTreeNode$1__get_Left(tn), patternInput[0], patternInput[1]); - } - } - else { - return SetTreeModule_rebalance(SetTreeNode$1__get_Left(tn), SetTreeLeaf$1__get_Key(tn), SetTreeModule_remove(comparer, k, SetTreeNode$1__get_Right(tn))); - } - } - else if (c === 0) { - return SetTreeModule_empty(); - } - else { - return t; - } - } - else { - return t; - } -} -export function SetTreeModule_mem(comparer_mut, k_mut, t_mut) { - SetTreeModule_mem: while (true) { - const comparer = comparer_mut, k = k_mut, t = t_mut; - if (t != null) { - const t2 = value_3(t); - const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0; - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (c < 0) { - comparer_mut = comparer; - k_mut = k; - t_mut = SetTreeNode$1__get_Left(tn); - continue SetTreeModule_mem; - } - else if (c === 0) { - return true; - } - else { - comparer_mut = comparer; - k_mut = k; - t_mut = SetTreeNode$1__get_Right(tn); - continue SetTreeModule_mem; - } - } - else { - return c === 0; - } - } - else { - return false; - } - break; - } -} -export function SetTreeModule_iter(f_mut, t_mut) { - SetTreeModule_iter: while (true) { - const f = f_mut, t = t_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - SetTreeModule_iter(f, SetTreeNode$1__get_Left(tn)); - f(SetTreeLeaf$1__get_Key(tn)); - f_mut = f; - t_mut = SetTreeNode$1__get_Right(tn); - continue SetTreeModule_iter; - } - else { - f(SetTreeLeaf$1__get_Key(t2)); - } - } - break; - } -} -export function SetTreeModule_foldBackOpt(f_mut, t_mut, x_mut) { - SetTreeModule_foldBackOpt: while (true) { - const f = f_mut, t = t_mut, x = x_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - f_mut = f; - t_mut = SetTreeNode$1__get_Left(tn); - x_mut = f(SetTreeLeaf$1__get_Key(tn), SetTreeModule_foldBackOpt(f, SetTreeNode$1__get_Right(tn), x)); - continue SetTreeModule_foldBackOpt; - } - else { - return f(SetTreeLeaf$1__get_Key(t2), x); - } - } - else { - return x; - } - break; - } -} -export function SetTreeModule_foldBack(f, m, x) { - return SetTreeModule_foldBackOpt(f, m, x); -} -export function SetTreeModule_foldOpt(f_mut, x_mut, t_mut) { - SetTreeModule_foldOpt: while (true) { - const f = f_mut, x = x_mut, t = t_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - f_mut = f; - x_mut = f(SetTreeModule_foldOpt(f, x, SetTreeNode$1__get_Left(tn)), SetTreeLeaf$1__get_Key(tn)); - t_mut = SetTreeNode$1__get_Right(tn); - continue SetTreeModule_foldOpt; - } - else { - return f(x, SetTreeLeaf$1__get_Key(t2)); - } - } - else { - return x; - } - break; - } -} -export function SetTreeModule_fold(f, x, m) { - return SetTreeModule_foldOpt(f, x, m); -} -export function SetTreeModule_forall(f_mut, t_mut) { - SetTreeModule_forall: while (true) { - const f = f_mut, t = t_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (f(SetTreeLeaf$1__get_Key(tn)) && SetTreeModule_forall(f, SetTreeNode$1__get_Left(tn))) { - f_mut = f; - t_mut = SetTreeNode$1__get_Right(tn); - continue SetTreeModule_forall; - } - else { - return false; - } - } - else { - return f(SetTreeLeaf$1__get_Key(t2)); - } - } - else { - return true; - } - break; - } -} -export function SetTreeModule_exists(f_mut, t_mut) { - SetTreeModule_exists: while (true) { - const f = f_mut, t = t_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - if (f(SetTreeLeaf$1__get_Key(tn)) ? true : SetTreeModule_exists(f, SetTreeNode$1__get_Left(tn))) { - return true; - } - else { - f_mut = f; - t_mut = SetTreeNode$1__get_Right(tn); - continue SetTreeModule_exists; - } - } - else { - return f(SetTreeLeaf$1__get_Key(t2)); - } - } - else { - return false; - } - break; - } -} -export function SetTreeModule_subset(comparer, a, b) { - return SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a); -} -export function SetTreeModule_properSubset(comparer, a, b) { - if (SetTreeModule_forall((x) => SetTreeModule_mem(comparer, x, b), a)) { - return SetTreeModule_exists((x_1) => !SetTreeModule_mem(comparer, x_1, a), b); - } - else { - return false; - } -} -export function SetTreeModule_filterAux(comparer_mut, f_mut, t_mut, acc_mut) { - SetTreeModule_filterAux: while (true) { - const comparer = comparer_mut, f = f_mut, t = t_mut, acc = acc_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - const acc_1 = f(SetTreeLeaf$1__get_Key(tn)) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(tn), acc) : acc; - comparer_mut = comparer; - f_mut = f; - t_mut = SetTreeNode$1__get_Left(tn); - acc_mut = SetTreeModule_filterAux(comparer, f, SetTreeNode$1__get_Right(tn), acc_1); - continue SetTreeModule_filterAux; - } - else if (f(SetTreeLeaf$1__get_Key(t2))) { - return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc); - } - else { - return acc; - } - } - else { - return acc; - } - break; - } -} -export function SetTreeModule_filter(comparer, f, s) { - return SetTreeModule_filterAux(comparer, f, s, SetTreeModule_empty()); -} -export function SetTreeModule_diffAux(comparer_mut, t_mut, acc_mut) { - SetTreeModule_diffAux: while (true) { - const comparer = comparer_mut, t = t_mut, acc = acc_mut; - if (acc == null) { - return acc; - } - else if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - comparer_mut = comparer; - t_mut = SetTreeNode$1__get_Left(tn); - acc_mut = SetTreeModule_diffAux(comparer, SetTreeNode$1__get_Right(tn), SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(tn), acc)); - continue SetTreeModule_diffAux; - } - else { - return SetTreeModule_remove(comparer, SetTreeLeaf$1__get_Key(t2), acc); - } - } - else { - return acc; - } - break; - } -} -export function SetTreeModule_diff(comparer, a, b) { - return SetTreeModule_diffAux(comparer, b, a); -} -export function SetTreeModule_union(comparer, t1, t2) { - if (t1 != null) { - const t1$0027 = value_3(t1); - if (t2 != null) { - const t2$0027 = value_3(t2); - if (t1$0027 instanceof SetTreeNode$1) { - const t1n = t1$0027; - if (t2$0027 instanceof SetTreeNode$1) { - const t2n = t2$0027; - if (SetTreeNode$1__get_Height(t1n) > SetTreeNode$1__get_Height(t2n)) { - const patternInput = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t1n), t2); - return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t1n), patternInput[0]), SetTreeLeaf$1__get_Key(t1n), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t1n), patternInput[2])); - } - else { - const patternInput_1 = SetTreeModule_split(comparer, SetTreeLeaf$1__get_Key(t2n), t1); - return SetTreeModule_balance(comparer, SetTreeModule_union(comparer, SetTreeNode$1__get_Left(t2n), patternInput_1[0]), SetTreeLeaf$1__get_Key(t2n), SetTreeModule_union(comparer, SetTreeNode$1__get_Right(t2n), patternInput_1[2])); - } - } - else { - return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2$0027), t1); - } - } - else { - return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t1$0027), t2); - } - } - else { - return t1; - } - } - else { - return t2; - } -} -export function SetTreeModule_intersectionAux(comparer_mut, b_mut, t_mut, acc_mut) { - SetTreeModule_intersectionAux: while (true) { - const comparer = comparer_mut, b = b_mut, t = t_mut, acc = acc_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - const acc_1 = SetTreeModule_intersectionAux(comparer, b, SetTreeNode$1__get_Right(tn), acc); - const acc_2 = SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(tn), b) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(tn), acc_1) : acc_1; - comparer_mut = comparer; - b_mut = b; - t_mut = SetTreeNode$1__get_Left(tn); - acc_mut = acc_2; - continue SetTreeModule_intersectionAux; - } - else if (SetTreeModule_mem(comparer, SetTreeLeaf$1__get_Key(t2), b)) { - return SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(t2), acc); - } - else { - return acc; - } - } - else { - return acc; - } - break; - } -} -export function SetTreeModule_intersection(comparer, a, b) { - return SetTreeModule_intersectionAux(comparer, b, a, SetTreeModule_empty()); -} -export function SetTreeModule_partition1(comparer, f, k, acc1, acc2) { - if (f(k)) { - return [SetTreeModule_add(comparer, k, acc1), acc2]; - } - else { - return [acc1, SetTreeModule_add(comparer, k, acc2)]; - } -} -export function SetTreeModule_partitionAux(comparer_mut, f_mut, t_mut, acc__mut, acc__1_mut) { - SetTreeModule_partitionAux: while (true) { - const comparer = comparer_mut, f = f_mut, t = t_mut, acc_ = acc__mut, acc__1 = acc__1_mut; - const acc = [acc_, acc__1]; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - const acc_1 = SetTreeModule_partitionAux(comparer, f, SetTreeNode$1__get_Right(tn), acc[0], acc[1]); - const acc_4 = SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(tn), acc_1[0], acc_1[1]); - comparer_mut = comparer; - f_mut = f; - t_mut = SetTreeNode$1__get_Left(tn); - acc__mut = acc_4[0]; - acc__1_mut = acc_4[1]; - continue SetTreeModule_partitionAux; - } - else { - return SetTreeModule_partition1(comparer, f, SetTreeLeaf$1__get_Key(t2), acc[0], acc[1]); - } - } - else { - return acc; - } - break; - } -} -export function SetTreeModule_partition(comparer, f, s) { - return SetTreeModule_partitionAux(comparer, f, s, SetTreeModule_empty(), SetTreeModule_empty()); -} -export function SetTreeModule_minimumElementAux(t_mut, n_mut) { - SetTreeModule_minimumElementAux: while (true) { - const t = t_mut, n = n_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - t_mut = SetTreeNode$1__get_Left(tn); - n_mut = SetTreeLeaf$1__get_Key(tn); - continue SetTreeModule_minimumElementAux; - } - else { - return SetTreeLeaf$1__get_Key(t2); - } - } - else { - return n; - } - break; - } -} -export function SetTreeModule_minimumElementOpt(t) { - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - return some(SetTreeModule_minimumElementAux(SetTreeNode$1__get_Left(tn), SetTreeLeaf$1__get_Key(tn))); - } - else { - return some(SetTreeLeaf$1__get_Key(t2)); - } - } - else { - return void 0; - } -} -export function SetTreeModule_maximumElementAux(t_mut, n_mut) { - SetTreeModule_maximumElementAux: while (true) { - const t = t_mut, n = n_mut; - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - t_mut = SetTreeNode$1__get_Right(tn); - n_mut = SetTreeLeaf$1__get_Key(tn); - continue SetTreeModule_maximumElementAux; - } - else { - return SetTreeLeaf$1__get_Key(t2); - } - } - else { - return n; - } - break; - } -} -export function SetTreeModule_maximumElementOpt(t) { - if (t != null) { - const t2 = value_3(t); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - return some(SetTreeModule_maximumElementAux(SetTreeNode$1__get_Right(tn), SetTreeLeaf$1__get_Key(tn))); - } - else { - return some(SetTreeLeaf$1__get_Key(t2)); - } - } - else { - return void 0; - } -} -export function SetTreeModule_minimumElement(s) { - const matchValue = SetTreeModule_minimumElementOpt(s); - if (matchValue == null) { - throw new Error("Set contains no elements"); - } - else { - return value_3(matchValue); - } -} -export function SetTreeModule_maximumElement(s) { - const matchValue = SetTreeModule_maximumElementOpt(s); - if (matchValue == null) { - throw new Error("Set contains no elements"); - } - else { - return value_3(matchValue); - } -} -export class SetTreeModule_SetIterator$1 extends Record { - constructor(stack, started) { - super(); - this.stack = stack; - this.started = started; - } -} -export function SetTreeModule_SetIterator$1_$reflection(gen0) { - return record_type("Set.SetTreeModule.SetIterator`1", [gen0], SetTreeModule_SetIterator$1, () => [["stack", list_type(option_type(SetTreeLeaf$1_$reflection(gen0)))], ["started", bool_type]]); -} -export function SetTreeModule_collapseLHS(stack_mut) { - SetTreeModule_collapseLHS: while (true) { - const stack = stack_mut; - if (!isEmpty_1(stack)) { - const x = head(stack); - const rest = tail(stack); - if (x != null) { - const x2 = value_3(x); - if (x2 instanceof SetTreeNode$1) { - const xn = x2; - stack_mut = ofArrayWithTail([SetTreeNode$1__get_Left(xn), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(xn)), SetTreeNode$1__get_Right(xn)], rest); - continue SetTreeModule_collapseLHS; - } - else { - return stack; - } - } - else { - stack_mut = rest; - continue SetTreeModule_collapseLHS; - } - } - else { - return empty_1(); - } - break; - } -} -export function SetTreeModule_mkIterator(s) { - return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton_1(s)), false); -} -export function SetTreeModule_notStarted() { - throw new Error("Enumeration not started"); -} -export function SetTreeModule_alreadyFinished() { - throw new Error("Enumeration already started"); -} -export function SetTreeModule_current(i) { - if (i.started) { - const matchValue = i.stack; - if (isEmpty_1(matchValue)) { - return SetTreeModule_alreadyFinished(); - } - else if (head(matchValue) != null) { - const t = value_3(head(matchValue)); - return SetTreeLeaf$1__get_Key(t); - } - else { - throw new Error("Please report error: Set iterator, unexpected stack for current"); - } - } - else { - return SetTreeModule_notStarted(); - } -} -export function SetTreeModule_moveNext(i) { - if (i.started) { - const matchValue = i.stack; - if (!isEmpty_1(matchValue)) { - if (head(matchValue) != null) { - const t = value_3(head(matchValue)); - if (t instanceof SetTreeNode$1) { - throw new Error("Please report error: Set iterator, unexpected stack for moveNext"); - } - else { - i.stack = SetTreeModule_collapseLHS(tail(matchValue)); - return !isEmpty_1(i.stack); - } - } - else { - throw new Error("Please report error: Set iterator, unexpected stack for moveNext"); - } - } - else { - return false; - } - } - else { - i.started = true; - return !isEmpty_1(i.stack); - } -} -export function SetTreeModule_mkIEnumerator(s) { - let i = SetTreeModule_mkIterator(s); - return { - "System.Collections.Generic.IEnumerator`1.get_Current"() { - return SetTreeModule_current(i); - }, - "System.Collections.IEnumerator.get_Current"() { - return SetTreeModule_current(i); - }, - "System.Collections.IEnumerator.MoveNext"() { - return SetTreeModule_moveNext(i); - }, - "System.Collections.IEnumerator.Reset"() { - i = SetTreeModule_mkIterator(s); - }, - Dispose() { - }, - }; -} -/** - * Set comparison. Note this can be expensive. - */ -export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) { - SetTreeModule_compareStacks: while (true) { - const comparer = comparer_mut, l1 = l1_mut, l2 = l2_mut; - if (!isEmpty_1(l1)) { - if (!isEmpty_1(l2)) { - if (head(l2) != null) { - if (head(l1) != null) { - const x1_3 = value_3(head(l1)); - const x2_3 = value_3(head(l2)); - if (x1_3 instanceof SetTreeNode$1) { - const x1n_2 = x1_3; - if (SetTreeNode$1__get_Left(x1n_2) == null) { - if (x2_3 instanceof SetTreeNode$1) { - const x2n_2 = x2_3; - if (SetTreeNode$1__get_Left(x2n_2) == null) { - const c = comparer.Compare(SetTreeLeaf$1__get_Key(x1n_2), SetTreeLeaf$1__get_Key(x2n_2)) | 0; - if (c !== 0) { - return c | 0; - } - else { - comparer_mut = comparer; - l1_mut = cons(SetTreeNode$1__get_Right(x1n_2), tail(l1)); - l2_mut = cons(SetTreeNode$1__get_Right(x2n_2), tail(l2)); - continue SetTreeModule_compareStacks; - } - } - else { - let matchResult, t1_6, x1_4, t2_6, x2_4; - if (!isEmpty_1(l1)) { - if (head(l1) != null) { - matchResult = 0; - t1_6 = tail(l1); - x1_4 = value_3(head(l1)); - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult = 1; - t2_6 = tail(l2); - x2_4 = value_3(head(l2)); - } - else { - matchResult = 2; - } - } - else { - matchResult = 2; - } - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult = 1; - t2_6 = tail(l2); - x2_4 = value_3(head(l2)); - } - else { - matchResult = 2; - } - } - else { - matchResult = 2; - } - switch (matchResult) { - case 0: - if (x1_4 instanceof SetTreeNode$1) { - const x1n_3 = x1_4; - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1n_3), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x1n_3), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1n_3), 0)], t1_6); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_4))], t1_6); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - case 1: - if (x2_4 instanceof SetTreeNode$1) { - const x2n_3 = x2_4; - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2n_3), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x2n_3), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2n_3), 0)], t2_6); - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_4))], t2_6); - continue SetTreeModule_compareStacks; - } - default: - throw new Error("unexpected state in SetTree.compareStacks"); - } - } - } - else { - const c_1 = comparer.Compare(SetTreeLeaf$1__get_Key(x1n_2), SetTreeLeaf$1__get_Key(x2_3)) | 0; - if (c_1 !== 0) { - return c_1 | 0; - } - else { - comparer_mut = comparer; - l1_mut = cons(SetTreeNode$1__get_Right(x1n_2), tail(l1)); - l2_mut = cons(SetTreeModule_empty(), tail(l2)); - continue SetTreeModule_compareStacks; - } - } - } - else { - let matchResult_1, t1_7, x1_5, t2_7, x2_5; - if (!isEmpty_1(l1)) { - if (head(l1) != null) { - matchResult_1 = 0; - t1_7 = tail(l1); - x1_5 = value_3(head(l1)); - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_1 = 1; - t2_7 = tail(l2); - x2_5 = value_3(head(l2)); - } - else { - matchResult_1 = 2; - } - } - else { - matchResult_1 = 2; - } - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_1 = 1; - t2_7 = tail(l2); - x2_5 = value_3(head(l2)); - } - else { - matchResult_1 = 2; - } - } - else { - matchResult_1 = 2; - } - switch (matchResult_1) { - case 0: - if (x1_5 instanceof SetTreeNode$1) { - const x1n_4 = x1_5; - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1n_4), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x1n_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1n_4), 0)], t1_7); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_5))], t1_7); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - case 1: - if (x2_5 instanceof SetTreeNode$1) { - const x2n_4 = x2_5; - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2n_4), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x2n_4), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2n_4), 0)], t2_7); - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_5))], t2_7); - continue SetTreeModule_compareStacks; - } - default: - throw new Error("unexpected state in SetTree.compareStacks"); - } - } - } - else if (x2_3 instanceof SetTreeNode$1) { - const x2n_5 = x2_3; - if (SetTreeNode$1__get_Left(x2n_5) == null) { - const c_2 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2n_5)) | 0; - if (c_2 !== 0) { - return c_2 | 0; - } - else { - comparer_mut = comparer; - l1_mut = cons(SetTreeModule_empty(), tail(l1)); - l2_mut = cons(SetTreeNode$1__get_Right(x2n_5), tail(l2)); - continue SetTreeModule_compareStacks; - } - } - else { - let matchResult_2, t1_8, x1_6, t2_8, x2_6; - if (!isEmpty_1(l1)) { - if (head(l1) != null) { - matchResult_2 = 0; - t1_8 = tail(l1); - x1_6 = value_3(head(l1)); - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_2 = 1; - t2_8 = tail(l2); - x2_6 = value_3(head(l2)); - } - else { - matchResult_2 = 2; - } - } - else { - matchResult_2 = 2; - } - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_2 = 1; - t2_8 = tail(l2); - x2_6 = value_3(head(l2)); - } - else { - matchResult_2 = 2; - } - } - else { - matchResult_2 = 2; - } - switch (matchResult_2) { - case 0: - if (x1_6 instanceof SetTreeNode$1) { - const x1n_5 = x1_6; - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1n_5), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x1n_5), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1n_5), 0)], t1_8); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_6))], t1_8); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - case 1: - if (x2_6 instanceof SetTreeNode$1) { - const x2n_6 = x2_6; - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2n_6), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x2n_6), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2n_6), 0)], t2_8); - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_6))], t2_8); - continue SetTreeModule_compareStacks; - } - default: - throw new Error("unexpected state in SetTree.compareStacks"); - } - } - } - else { - const c_3 = comparer.Compare(SetTreeLeaf$1__get_Key(x1_3), SetTreeLeaf$1__get_Key(x2_3)) | 0; - if (c_3 !== 0) { - return c_3 | 0; - } - else { - comparer_mut = comparer; - l1_mut = tail(l1); - l2_mut = tail(l2); - continue SetTreeModule_compareStacks; - } - } - } - else { - const x2 = value_3(head(l2)); - let matchResult_3, t1_2, x1, t2_2, x2_1; - if (!isEmpty_1(l1)) { - if (head(l1) != null) { - matchResult_3 = 0; - t1_2 = tail(l1); - x1 = value_3(head(l1)); - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_3 = 1; - t2_2 = tail(l2); - x2_1 = value_3(head(l2)); - } - else { - matchResult_3 = 2; - } - } - else { - matchResult_3 = 2; - } - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_3 = 1; - t2_2 = tail(l2); - x2_1 = value_3(head(l2)); - } - else { - matchResult_3 = 2; - } - } - else { - matchResult_3 = 2; - } - switch (matchResult_3) { - case 0: - if (x1 instanceof SetTreeNode$1) { - const x1n = x1; - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1n), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x1n), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1n), 0)], t1_2); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1))], t1_2); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - case 1: - if (x2_1 instanceof SetTreeNode$1) { - const x2n = x2_1; - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2n), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x2n), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2n), 0)], t2_2); - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_1))], t2_2); - continue SetTreeModule_compareStacks; - } - default: - throw new Error("unexpected state in SetTree.compareStacks"); - } - } - } - else if (head(l1) != null) { - const x1_1 = value_3(head(l1)); - let matchResult_4, t1_4, x1_2, t2_4, x2_2; - if (!isEmpty_1(l1)) { - if (head(l1) != null) { - matchResult_4 = 0; - t1_4 = tail(l1); - x1_2 = value_3(head(l1)); - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_4 = 1; - t2_4 = tail(l2); - x2_2 = value_3(head(l2)); - } - else { - matchResult_4 = 2; - } - } - else { - matchResult_4 = 2; - } - } - else if (!isEmpty_1(l2)) { - if (head(l2) != null) { - matchResult_4 = 1; - t2_4 = tail(l2); - x2_2 = value_3(head(l2)); - } - else { - matchResult_4 = 2; - } - } - else { - matchResult_4 = 2; - } - switch (matchResult_4) { - case 0: - if (x1_2 instanceof SetTreeNode$1) { - const x1n_1 = x1_2; - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x1n_1), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x1n_1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x1n_1), 0)], t1_4); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x1_2))], t1_4); - l2_mut = l2; - continue SetTreeModule_compareStacks; - } - case 1: - if (x2_2 instanceof SetTreeNode$1) { - const x2n_1 = x2_2; - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeNode$1__get_Left(x2n_1), SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(x2n_1), SetTreeModule_empty(), SetTreeNode$1__get_Right(x2n_1), 0)], t2_4); - continue SetTreeModule_compareStacks; - } - else { - comparer_mut = comparer; - l1_mut = l1; - l2_mut = ofArrayWithTail([SetTreeModule_empty(), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(x2_2))], t2_4); - continue SetTreeModule_compareStacks; - } - default: - throw new Error("unexpected state in SetTree.compareStacks"); - } - } - else { - comparer_mut = comparer; - l1_mut = tail(l1); - l2_mut = tail(l2); - continue SetTreeModule_compareStacks; - } - } - else { - return 1; - } - } - else if (isEmpty_1(l2)) { - return 0; - } - else { - return -1; - } - break; - } -} -export function SetTreeModule_compare(comparer, t1, t2) { - if (t1 == null) { - if (t2 == null) { - return 0; - } - else { - return -1; - } - } - else if (t2 == null) { - return 1; - } - else { - return SetTreeModule_compareStacks(comparer, singleton_1(t1), singleton_1(t2)) | 0; - } -} -export function SetTreeModule_choose(s) { - return SetTreeModule_minimumElement(s); -} -export function SetTreeModule_toList(t) { - const loop = (t$0027_mut, acc_mut) => { - loop: while (true) { - const t$0027 = t$0027_mut, acc = acc_mut; - if (t$0027 != null) { - const t2 = value_3(t$0027); - if (t2 instanceof SetTreeNode$1) { - const tn = t2; - t$0027_mut = SetTreeNode$1__get_Left(tn); - acc_mut = cons(SetTreeLeaf$1__get_Key(tn), loop(SetTreeNode$1__get_Right(tn), acc)); - continue loop; - } - else { - return cons(SetTreeLeaf$1__get_Key(t2), acc); - } - } - else { - return acc; - } - break; - } - }; - return loop(t, empty_1()); -} -export function SetTreeModule_copyToArray(s, arr, i) { - let j = i; - SetTreeModule_iter((x) => { - arr[j] = x; - j = ((j + 1) | 0); - }, s); -} -export function SetTreeModule_toArray(s) { - const n = SetTreeModule_count(s) | 0; - const res = fill(new Array(n), 0, n, null); - SetTreeModule_copyToArray(s, res, 0); - return res; -} -export function SetTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) { - SetTreeModule_mkFromEnumerator: while (true) { - const comparer = comparer_mut, acc = acc_mut, e = e_mut; - if (e["System.Collections.IEnumerator.MoveNext"]()) { - comparer_mut = comparer; - acc_mut = SetTreeModule_add(comparer, e["System.Collections.Generic.IEnumerator`1.get_Current"](), acc); - e_mut = e; - continue SetTreeModule_mkFromEnumerator; - } - else { - return acc; - } - break; - } -} -export function SetTreeModule_ofArray(comparer, l) { - return fold_1((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l); -} -export function SetTreeModule_ofList(comparer, l) { - return fold_2((acc, k) => SetTreeModule_add(comparer, k, acc), SetTreeModule_empty(), l); -} -export function SetTreeModule_ofSeq(comparer, c) { - if (isArrayLike(c)) { - return SetTreeModule_ofArray(comparer, c); - } - else if (c instanceof FSharpList) { - return SetTreeModule_ofList(comparer, c); - } - else { - const ie = getEnumerator(c); - try { - return SetTreeModule_mkFromEnumerator(comparer, SetTreeModule_empty(), ie); - } - finally { - disposeSafe(ie); - } - } -} -export class FSharpSet { - constructor(comparer, tree) { - this.comparer = comparer; - this.tree = tree; - } - GetHashCode() { - const this$ = this; - return FSharpSet__ComputeHashCode(this$) | 0; - } - Equals(that) { - let that_1; - const this$ = this; - return (that instanceof FSharpSet) && ((that_1 = that, SetTreeModule_compare(FSharpSet__get_Comparer(this$), FSharpSet__get_Tree(this$), FSharpSet__get_Tree(that_1)) === 0)); - } - toString() { - const this$ = this; - return ("set [" + join("; ", map_1((x) => { - let copyOfStruct = x; - return toString(copyOfStruct); - }, this$))) + "]"; - } - get [Symbol.toStringTag]() { - return "FSharpSet"; - } - toJSON() { - const this$ = this; - return Array.from(this$); - } - CompareTo(that) { - const s = this; - return SetTreeModule_compare(FSharpSet__get_Comparer(s), FSharpSet__get_Tree(s), FSharpSet__get_Tree(that)) | 0; - } - "System.Collections.Generic.ICollection`1.Add2B595"(x) { - throw new Error("ReadOnlyCollection"); - } - "System.Collections.Generic.ICollection`1.Clear"() { - throw new Error("ReadOnlyCollection"); - } - "System.Collections.Generic.ICollection`1.Remove2B595"(x) { - throw new Error("ReadOnlyCollection"); - } - "System.Collections.Generic.ICollection`1.Contains2B595"(x) { - const s = this; - return SetTreeModule_mem(FSharpSet__get_Comparer(s), x, FSharpSet__get_Tree(s)); - } - "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(arr, i) { - const s = this; - SetTreeModule_copyToArray(FSharpSet__get_Tree(s), arr, i); - } - "System.Collections.Generic.ICollection`1.get_IsReadOnly"() { - return true; - } - "System.Collections.Generic.ICollection`1.get_Count"() { - const s = this; - return FSharpSet__get_Count(s) | 0; - } - "System.Collections.Generic.IReadOnlyCollection`1.get_Count"() { - const s = this; - return FSharpSet__get_Count(s) | 0; - } - GetEnumerator() { - const s = this; - return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s)); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const s = this; - return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(s)); - } - get size() { - const s = this; - return FSharpSet__get_Count(s) | 0; - } - add(k) { - const s = this; - throw new Error("Set cannot be mutated"); - return s; - } - clear() { - throw new Error("Set cannot be mutated"); - } - delete(k) { - throw new Error("Set cannot be mutated"); - return false; - } - has(k) { - const s = this; - return FSharpSet__Contains(s, k); - } - keys() { - const s = this; - return map_1((x) => x, s); - } - values() { - const s = this; - return map_1((x) => x, s); - } - entries() { - const s = this; - return map_1((v) => [v, v], s); - } - forEach(f, thisArg) { - const s = this; - iterate_1((x) => { - f(x, x, s); - }, s); - } -} -export function FSharpSet_$reflection(gen0) { - return class_type("Set.FSharpSet", [gen0], FSharpSet); -} -export function FSharpSet_$ctor(comparer, tree) { - return new FSharpSet(comparer, tree); -} -export function FSharpSet__get_Comparer(set$) { - return set$.comparer; -} -export function FSharpSet__get_Tree(set$) { - return set$.tree; -} -export function FSharpSet_Empty(comparer) { - return FSharpSet_$ctor(comparer, SetTreeModule_empty()); -} -export function FSharpSet__Add(s, value) { - return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_add(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s))); -} -export function FSharpSet__Remove(s, value) { - return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_remove(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s))); -} -export function FSharpSet__get_Count(s) { - return SetTreeModule_count(FSharpSet__get_Tree(s)); -} -export function FSharpSet__Contains(s, value) { - return SetTreeModule_mem(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)); -} -export function FSharpSet__Iterate(s, x) { - SetTreeModule_iter(x, FSharpSet__get_Tree(s)); -} -export function FSharpSet__Fold(s, f, z) { - const f_1 = f; - return SetTreeModule_fold((x, z_1) => f_1(z_1, x), z, FSharpSet__get_Tree(s)); -} -export function FSharpSet__get_IsEmpty(s) { - return FSharpSet__get_Tree(s) == null; -} -export function FSharpSet__Partition(s, f) { - if (FSharpSet__get_Tree(s) == null) { - return [s, s]; - } - else { - const patternInput = SetTreeModule_partition(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s)); - return [FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[0]), FSharpSet_$ctor(FSharpSet__get_Comparer(s), patternInput[1])]; - } -} -export function FSharpSet__Filter(s, f) { - if (FSharpSet__get_Tree(s) == null) { - return s; - } - else { - return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_filter(FSharpSet__get_Comparer(s), f, FSharpSet__get_Tree(s))); - } -} -export function FSharpSet__Map(s, f, comparer) { - return FSharpSet_$ctor(comparer, SetTreeModule_fold((acc, k) => SetTreeModule_add(comparer, f(k), acc), SetTreeModule_empty(), FSharpSet__get_Tree(s))); -} -export function FSharpSet__Exists(s, f) { - return SetTreeModule_exists(f, FSharpSet__get_Tree(s)); -} -export function FSharpSet__ForAll(s, f) { - return SetTreeModule_forall(f, FSharpSet__get_Tree(s)); -} -export function FSharpSet_op_Subtraction(set1, set2) { - if (FSharpSet__get_Tree(set1) == null) { - return set1; - } - else if (FSharpSet__get_Tree(set2) == null) { - return set1; - } - else { - return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_diff(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2))); - } -} -export function FSharpSet_op_Addition(set1, set2) { - if (FSharpSet__get_Tree(set2) == null) { - return set1; - } - else if (FSharpSet__get_Tree(set1) == null) { - return set2; - } - else { - return FSharpSet_$ctor(FSharpSet__get_Comparer(set1), SetTreeModule_union(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2))); - } -} -export function FSharpSet_Intersection(a, b) { - if (FSharpSet__get_Tree(b) == null) { - return b; - } - else if (FSharpSet__get_Tree(a) == null) { - return a; - } - else { - return FSharpSet_$ctor(FSharpSet__get_Comparer(a), SetTreeModule_intersection(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b))); - } -} -export function FSharpSet_IntersectionMany(sets) { - return reduce(FSharpSet_Intersection, sets); -} -export function FSharpSet_Equality(a, b) { - return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)) === 0; -} -export function FSharpSet_Compare(a, b) { - return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)); -} -export function FSharpSet__get_Choose(x) { - return SetTreeModule_choose(FSharpSet__get_Tree(x)); -} -export function FSharpSet__get_MinimumElement(x) { - return SetTreeModule_minimumElement(FSharpSet__get_Tree(x)); -} -export function FSharpSet__get_MaximumElement(x) { - return SetTreeModule_maximumElement(FSharpSet__get_Tree(x)); -} -export function FSharpSet__IsSubsetOf(x, otherSet) { - return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet)); -} -export function FSharpSet__IsSupersetOf(x, otherSet) { - return SetTreeModule_subset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x)); -} -export function FSharpSet__IsProperSubsetOf(x, otherSet) { - return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(x), FSharpSet__get_Tree(otherSet)); -} -export function FSharpSet__IsProperSupersetOf(x, otherSet) { - return SetTreeModule_properSubset(FSharpSet__get_Comparer(x), FSharpSet__get_Tree(otherSet), FSharpSet__get_Tree(x)); -} -export function FSharpSet__ToList(x) { - return SetTreeModule_toList(FSharpSet__get_Tree(x)); -} -export function FSharpSet__ToArray(x) { - return SetTreeModule_toArray(FSharpSet__get_Tree(x)); -} -export function FSharpSet__ComputeHashCode(this$) { - let res = 0; - const enumerator = getEnumerator(this$); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const x_1 = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - res = ((((res << 1) + structuralHash(x_1)) + 631) | 0); - } - } - finally { - disposeSafe(enumerator); - } - return Math.abs(res) | 0; -} -export function isEmpty(set$) { - return FSharpSet__get_IsEmpty(set$); -} -export function contains(element, set$) { - return FSharpSet__Contains(set$, element); -} -export function add(value, set$) { - return FSharpSet__Add(set$, value); -} -export function singleton(value, comparer) { - return FSharpSet__Add(FSharpSet_Empty(comparer), value); -} -export function remove(value, set$) { - return FSharpSet__Remove(set$, value); -} -export function union(set1, set2) { - return FSharpSet_op_Addition(set1, set2); -} -export function unionMany(sets, comparer) { - return fold_3(FSharpSet_op_Addition, FSharpSet_Empty(comparer), sets); -} -export function intersect(set1, set2) { - return FSharpSet_Intersection(set1, set2); -} -export function intersectMany(sets) { - return FSharpSet_IntersectionMany(sets); -} -export function iterate(action, set$) { - FSharpSet__Iterate(set$, action); -} -export function empty(comparer) { - return FSharpSet_Empty(comparer); -} -export function forAll(predicate, set$) { - return FSharpSet__ForAll(set$, predicate); -} -export function exists(predicate, set$) { - return FSharpSet__Exists(set$, predicate); -} -export function filter(predicate, set$) { - return FSharpSet__Filter(set$, predicate); -} -export function partition(predicate, set$) { - return FSharpSet__Partition(set$, predicate); -} -export function fold(folder, state, set$) { - return SetTreeModule_fold(folder, state, FSharpSet__get_Tree(set$)); -} -export function foldBack(folder, set$, state) { - return SetTreeModule_foldBack(folder, FSharpSet__get_Tree(set$), state); -} -export function map(mapping, set$, comparer) { - return FSharpSet__Map(set$, mapping, comparer); -} -export function count(set$) { - return FSharpSet__get_Count(set$); -} -export function ofList(elements, comparer) { - return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements)); -} -export function ofArray(array, comparer) { - return FSharpSet_$ctor(comparer, SetTreeModule_ofArray(comparer, array)); -} -export function toList(set$) { - return FSharpSet__ToList(set$); -} -export function toArray(set$) { - return FSharpSet__ToArray(set$); -} -export function toSeq(set$) { - return map_1((x) => x, set$); -} -export function ofSeq(elements, comparer) { - return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements)); -} -export function difference(set1, set2) { - return FSharpSet_op_Subtraction(set1, set2); -} -export function isSubset(set1, set2) { - return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)); -} -export function isSuperset(set1, set2) { - return SetTreeModule_subset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1)); -} -export function isProperSubset(set1, set2) { - return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set1), FSharpSet__get_Tree(set2)); -} -export function isProperSuperset(set1, set2) { - return SetTreeModule_properSubset(FSharpSet__get_Comparer(set1), FSharpSet__get_Tree(set2), FSharpSet__get_Tree(set1)); -} -export function minElement(set$) { - return FSharpSet__get_MinimumElement(set$); -} -export function maxElement(set$) { - return FSharpSet__get_MaximumElement(set$); -} -export function unionWith(s1, s2) { - return fold_3((acc, x) => acc.add(x), s1, s2); -} -export function newMutableSetWith(s1, s2) { - if (s1 instanceof HashSet) { - const s1_1 = s1; - return HashSet_$ctor_Z6150332D(s2, HashSet__get_Comparer(s1_1)); - } - else { - return new Set(s2); - } -} -export function intersectWith(s1, s2) { - const s2_1 = newMutableSetWith(s1, s2); - iterate_1((x) => { - if (!s2_1.has(x)) { - s1.delete(x); - } - }, s1.values()); -} -export function exceptWith(s1, s2) { - iterate_1((x) => { - s1.delete(x); - }, s2); -} -export function isSubsetOf(s1, s2) { - const s2_1 = newMutableSetWith(s1, s2); - return forAll_1((value) => s2_1.has(value), s1.values()); -} -export function isSupersetOf(s1, s2) { - return forAll_1((value) => s1.has(value), s2); -} -export function isProperSubsetOf(s1, s2) { - const s2_1 = newMutableSetWith(s1, s2); - if (s2_1.size > s1.size) { - return forAll_1((value) => s2_1.has(value), s1.values()); - } - else { - return false; - } -} -export function isProperSupersetOf(s1, s2) { - const s2_1 = cache(s2); - if (exists_1((arg) => !s1.has(arg), s2_1)) { - return forAll_1((value_2) => s1.has(value_2), s2_1); - } - else { - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.d.ts deleted file mode 100644 index b7f0d540..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export declare function compare(...args: any[]): number; -export declare function compareOrdinal(x: string, y: string): number; -export declare function compareTo(x: string, y: string): number; -export declare function startsWith(str: string, pattern: string, ic: number): boolean; -export declare function indexOfAny(str: string, anyOf: string[], ...args: number[]): number; -export type IPrintfFormatContinuation = (f: (x: string) => any) => any; -export interface IPrintfFormat { - input: string; - cont: IPrintfFormatContinuation; -} -export declare function printf(input: string): IPrintfFormat; -export declare function interpolate(str: string, values: any[]): string; -export declare function toConsole(arg: IPrintfFormat | string): any; -export declare function toConsoleError(arg: IPrintfFormat | string): any; -export declare function toText(arg: IPrintfFormat | string): any; -export declare function toFail(arg: IPrintfFormat | string): any; -export declare function fsFormat(str: string): (cont: (...args: any[]) => any) => any; -export declare function format(str: string | object, ...args: any[]): string; -export declare function endsWith(str: string, search: string): boolean; -export declare function initialize(n: number, f: (i: number) => string): string; -export declare function insert(str: string, startIndex: number, value: string): string; -export declare function isNullOrEmpty(str: string | any): boolean; -export declare function isNullOrWhiteSpace(str: string | any): boolean; -export declare function concat(...xs: any[]): string; -export declare function join(delimiter: string, xs: Iterable): string; -export declare function joinWithIndices(delimiter: string, xs: string[], startIndex: number, count: number): string; -export declare function toBase64String(inArray: ArrayLike): string; -export declare function fromBase64String(b64Encoded: string): number[]; -export declare function padLeft(str: string, len: number, ch?: string): string; -export declare function padRight(str: string, len: number, ch?: string): string; -export declare function remove(str: string, startIndex: number, count?: number): string; -export declare function replace(str: string, search: string, replace: string): string; -export declare function replicate(n: number, x: string): string; -export declare function getCharAtIndex(input: string, index: number): string; -export declare function split(str: string, splitters: string[], count?: number, options?: number): string[]; -export declare function trim(str: string, ...chars: string[]): string; -export declare function trimStart(str: string, ...chars: string[]): any; -export declare function trimEnd(str: string, ...chars: string[]): any; -export declare function filter(pred: (char: string) => boolean, x: string): string; -export declare function substring(str: string, startIndex: number, length?: number): string; -interface FormattableString { - strs: TemplateStringsArray; - args: any[]; - fmts?: string[]; -} -export declare function fmt(strs: TemplateStringsArray, ...args: any[]): FormattableString; -export declare function fmtWith(fmts: string[]): (strs: TemplateStringsArray, ...args: any[]) => FormattableString; -export declare function getFormat(s: FormattableString): string; -export {}; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.js deleted file mode 100644 index 38cb5395..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/String.js +++ /dev/null @@ -1,540 +0,0 @@ -import { toString as dateToString } from "./Date.js"; -import { compare as numericCompare, isNumeric, multiply, toExponential, toFixed, toHex, toPrecision } from "./Numeric.js"; -import { escape } from "./RegExp.js"; -import { toString } from "./Types.js"; -const fsFormatRegExp = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g; -const interpolateRegExp = /(?:(^|[^%])%([0+\- ]*)(\d+)?(?:\.(\d+))?(\w))?%P\(\)/g; -const formatRegExp = /\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g; -function isLessThan(x, y) { - return numericCompare(x, y) < 0; -} -function cmp(x, y, ic) { - function isIgnoreCase(i) { - return i === true || - i === 1 /* StringComparison.CurrentCultureIgnoreCase */ || - i === 3 /* StringComparison.InvariantCultureIgnoreCase */ || - i === 5 /* StringComparison.OrdinalIgnoreCase */; - } - function isOrdinal(i) { - return i === 4 /* StringComparison.Ordinal */ || - i === 5 /* StringComparison.OrdinalIgnoreCase */; - } - if (x == null) { - return y == null ? 0 : -1; - } - if (y == null) { - return 1; - } // everything is bigger than null - if (isOrdinal(ic)) { - if (isIgnoreCase(ic)) { - x = x.toLowerCase(); - y = y.toLowerCase(); - } - return (x === y) ? 0 : (x < y ? -1 : 1); - } - else { - if (isIgnoreCase(ic)) { - x = x.toLocaleLowerCase(); - y = y.toLocaleLowerCase(); - } - return x.localeCompare(y); - } -} -export function compare(...args) { - switch (args.length) { - case 2: return cmp(args[0], args[1], false); - case 3: return cmp(args[0], args[1], args[2]); - case 4: return cmp(args[0], args[1], args[2] === true); - case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false); - case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]); - case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true); - default: throw new Error("String.compare: Unsupported number of parameters"); - } -} -export function compareOrdinal(x, y) { - return cmp(x, y, 4 /* StringComparison.Ordinal */); -} -export function compareTo(x, y) { - return cmp(x, y, 0 /* StringComparison.CurrentCulture */); -} -export function startsWith(str, pattern, ic) { - if (str.length >= pattern.length) { - return cmp(str.substr(0, pattern.length), pattern, ic) === 0; - } - return false; -} -export function indexOfAny(str, anyOf, ...args) { - if (str == null || str === "") { - return -1; - } - const startIndex = (args.length > 0) ? args[0] : 0; - if (startIndex < 0) { - throw new Error("Start index cannot be negative"); - } - const length = (args.length > 1) ? args[1] : str.length - startIndex; - if (length < 0) { - throw new Error("Length cannot be negative"); - } - if (startIndex + length > str.length) { - throw new Error("Invalid startIndex and length"); - } - const endIndex = startIndex + length; - const anyOfAsStr = "".concat.apply("", anyOf); - for (let i = startIndex; i < endIndex; i++) { - if (anyOfAsStr.indexOf(str[i]) > -1) { - return i; - } - } - return -1; -} -export function printf(input) { - return { - input, - cont: fsFormat(input), - }; -} -export function interpolate(str, values) { - let valIdx = 0; - let strIdx = 0; - let result = ""; - interpolateRegExp.lastIndex = 0; - let match = interpolateRegExp.exec(str); - while (match) { - // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char - // Note: we don't use negative lookbehind because some browsers don't support it yet - const matchIndex = match.index + (match[1] || "").length; - result += str.substring(strIdx, matchIndex).replace(/%%/g, "%"); - const [, , flags, padLength, precision, format] = match; - // Save interpolateRegExp.lastIndex before running formatReplacement because the values - // may also involve interpolation and make use of interpolateRegExp (see #3078) - strIdx = interpolateRegExp.lastIndex; - result += formatReplacement(values[valIdx++], flags, padLength, precision, format); - // Move interpolateRegExp.lastIndex one char behind to make sure we match the no-escape char next time - interpolateRegExp.lastIndex = strIdx - 1; - match = interpolateRegExp.exec(str); - } - result += str.substring(strIdx).replace(/%%/g, "%"); - return result; -} -function continuePrint(cont, arg) { - return typeof arg === "string" ? cont(arg) : arg.cont(cont); -} -export function toConsole(arg) { - // Don't remove the lambda here, see #1357 - return continuePrint((x) => console.log(x), arg); -} -export function toConsoleError(arg) { - return continuePrint((x) => console.error(x), arg); -} -export function toText(arg) { - return continuePrint((x) => x, arg); -} -export function toFail(arg) { - return continuePrint((x) => { - throw new Error(x); - }, arg); -} -function formatReplacement(rep, flags, padLength, precision, format) { - let sign = ""; - flags = flags || ""; - format = format || ""; - if (isNumeric(rep)) { - if (format.toLowerCase() !== "x") { - if (isLessThan(rep, 0)) { - rep = multiply(rep, -1); - sign = "-"; - } - else { - if (flags.indexOf(" ") >= 0) { - sign = " "; - } - else if (flags.indexOf("+") >= 0) { - sign = "+"; - } - } - } - precision = precision == null ? null : parseInt(precision, 10); - switch (format) { - case "f": - case "F": - precision = precision != null ? precision : 6; - rep = toFixed(rep, precision); - break; - case "g": - case "G": - rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep); - break; - case "e": - case "E": - rep = precision != null ? toExponential(rep, precision) : toExponential(rep); - break; - case "x": - rep = toHex(rep); - break; - case "X": - rep = toHex(rep).toUpperCase(); - break; - default: // AOid - rep = String(rep); - break; - } - } - else if (rep instanceof Date) { - rep = dateToString(rep); - } - else { - rep = toString(rep); - } - padLength = typeof padLength === "number" ? padLength : parseInt(padLength, 10); - if (!isNaN(padLength)) { - const zeroFlag = flags.indexOf("0") >= 0; // Use '0' for left padding - const minusFlag = flags.indexOf("-") >= 0; // Right padding - const ch = minusFlag || !zeroFlag ? " " : "0"; - if (ch === "0") { - rep = pad(rep, padLength - sign.length, ch, minusFlag); - rep = sign + rep; - } - else { - rep = pad(sign + rep, padLength, ch, minusFlag); - } - } - else { - rep = sign + rep; - } - return rep; -} -function createPrinter(cont, _strParts, _matches, _result = "", padArg = -1) { - return (...args) => { - // Make copies of the values passed by reference because the function can be used multiple times - let result = _result; - const strParts = _strParts.slice(); - const matches = _matches.slice(); - for (const arg of args) { - const [, , flags, _padLength, precision, format] = matches[0]; - let padLength = _padLength; - if (padArg >= 0) { - padLength = padArg; - padArg = -1; - } - else if (padLength === "*") { - if (arg < 0) { - throw new Error("Non-negative number required"); - } - padArg = arg; - continue; - } - result += strParts[0]; - result += formatReplacement(arg, flags, padLength, precision, format); - strParts.splice(0, 1); - matches.splice(0, 1); - } - if (matches.length === 0) { - result += strParts[0]; - return cont(result); - } - else { - return createPrinter(cont, strParts, matches, result, padArg); - } - }; -} -export function fsFormat(str) { - return (cont) => { - fsFormatRegExp.lastIndex = 0; - const strParts = []; - const matches = []; - let strIdx = 0; - let match = fsFormatRegExp.exec(str); - while (match) { - // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char - // Note: we don't use negative lookbehind because some browsers don't support it yet - const matchIndex = match.index + (match[1] || "").length; - strParts.push(str.substring(strIdx, matchIndex).replace(/%%/g, "%")); - matches.push(match); - strIdx = fsFormatRegExp.lastIndex; - // Likewise we need to move fsFormatRegExp.lastIndex one char behind to make sure we match the no-escape char next time - fsFormatRegExp.lastIndex -= 1; - match = fsFormatRegExp.exec(str); - } - if (strParts.length === 0) { - return cont(str.replace(/%%/g, "%")); - } - else { - strParts.push(str.substring(strIdx).replace(/%%/g, "%")); - return createPrinter(cont, strParts, matches); - } - }; -} -export function format(str, ...args) { - let str2; - if (typeof str === "object") { - // Called with culture info - str2 = String(args[0]); - args.shift(); - } - else { - str2 = str; - } - return str2.replace(formatRegExp, (_, idx, padLength, format, precision, pattern) => { - if (idx < 0 || idx >= args.length) { - throw new Error("Index must be greater or equal to zero and less than the arguments' length."); - } - let rep = args[idx]; - if (isNumeric(rep)) { - precision = precision == null ? null : parseInt(precision, 10); - switch (format) { - case "f": - case "F": - precision = precision != null ? precision : 2; - rep = toFixed(rep, precision); - break; - case "g": - case "G": - rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep); - break; - case "e": - case "E": - rep = precision != null ? toExponential(rep, precision) : toExponential(rep); - break; - case "p": - case "P": - precision = precision != null ? precision : 2; - rep = toFixed(multiply(rep, 100), precision) + " %"; - break; - case "d": - case "D": - rep = precision != null ? padLeft(String(rep), precision, "0") : String(rep); - break; - case "x": - case "X": - rep = precision != null ? padLeft(toHex(rep), precision, "0") : toHex(rep); - if (format === "X") { - rep = rep.toUpperCase(); - } - break; - default: - if (pattern) { - let sign = ""; - rep = pattern.replace(/([0#,]+)(\.[0#]+)?/, (_, intPart, decimalPart) => { - if (isLessThan(rep, 0)) { - rep = multiply(rep, -1); - sign = "-"; - } - decimalPart = decimalPart == null ? "" : decimalPart.substring(1); - rep = toFixed(rep, Math.max(decimalPart.length, 0)); - let [repInt, repDecimal] = rep.split("."); - repDecimal || (repDecimal = ""); - const leftZeroes = intPart.replace(/,/g, "").replace(/^#+/, "").length; - repInt = padLeft(repInt, leftZeroes, "0"); - const rightZeros = decimalPart.replace(/#+$/, "").length; - if (rightZeros > repDecimal.length) { - repDecimal = padRight(repDecimal, rightZeros, "0"); - } - else if (rightZeros < repDecimal.length) { - repDecimal = repDecimal.substring(0, rightZeros) + repDecimal.substring(rightZeros).replace(/0+$/, ""); - } - // Thousands separator - if (intPart.indexOf(",") > 0) { - const i = repInt.length % 3; - const thousandGroups = Math.floor(repInt.length / 3); - let thousands = i > 0 ? repInt.substr(0, i) + (thousandGroups > 0 ? "," : "") : ""; - for (let j = 0; j < thousandGroups; j++) { - thousands += repInt.substr(i + j * 3, 3) + (j < thousandGroups - 1 ? "," : ""); - } - repInt = thousands; - } - return repDecimal.length > 0 ? repInt + "." + repDecimal : repInt; - }); - rep = sign + rep; - } - } - } - else if (rep instanceof Date) { - rep = dateToString(rep, pattern || format); - } - else { - rep = toString(rep); - } - padLength = parseInt((padLength || " ").substring(1), 10); - if (!isNaN(padLength)) { - rep = pad(String(rep), Math.abs(padLength), " ", padLength < 0); - } - return rep; - }); -} -export function endsWith(str, search) { - const idx = str.lastIndexOf(search); - return idx >= 0 && idx === str.length - search.length; -} -export function initialize(n, f) { - if (n < 0) { - throw new Error("String length must be non-negative"); - } - const xs = new Array(n); - for (let i = 0; i < n; i++) { - xs[i] = f(i); - } - return xs.join(""); -} -export function insert(str, startIndex, value) { - if (startIndex < 0 || startIndex > str.length) { - throw new Error("startIndex is negative or greater than the length of this instance."); - } - return str.substring(0, startIndex) + value + str.substring(startIndex); -} -export function isNullOrEmpty(str) { - return typeof str !== "string" || str.length === 0; -} -export function isNullOrWhiteSpace(str) { - return typeof str !== "string" || /^\s*$/.test(str); -} -export function concat(...xs) { - return xs.map((x) => String(x)).join(""); -} -export function join(delimiter, xs) { - if (Array.isArray(xs)) { - return xs.join(delimiter); - } - else { - return Array.from(xs).join(delimiter); - } -} -export function joinWithIndices(delimiter, xs, startIndex, count) { - const endIndexPlusOne = startIndex + count; - if (endIndexPlusOne > xs.length) { - throw new Error("Index and count must refer to a location within the buffer."); - } - return xs.slice(startIndex, endIndexPlusOne).join(delimiter); -} -function notSupported(name) { - throw new Error("The environment doesn't support '" + name + "', please use a polyfill."); -} -export function toBase64String(inArray) { - let str = ""; - for (let i = 0; i < inArray.length; i++) { - str += String.fromCharCode(inArray[i]); - } - return typeof btoa === "function" ? btoa(str) : notSupported("btoa"); -} -export function fromBase64String(b64Encoded) { - const binary = typeof atob === "function" ? atob(b64Encoded) : notSupported("atob"); - const bytes = new Uint8Array(binary.length); - for (let i = 0; i < binary.length; i++) { - bytes[i] = binary.charCodeAt(i); - } - return bytes; -} -function pad(str, len, ch, isRight) { - ch = ch || " "; - len = len - str.length; - for (let i = 0; i < len; i++) { - str = isRight ? str + ch : ch + str; - } - return str; -} -export function padLeft(str, len, ch) { - return pad(str, len, ch); -} -export function padRight(str, len, ch) { - return pad(str, len, ch, true); -} -export function remove(str, startIndex, count) { - if (startIndex >= str.length) { - throw new Error("startIndex must be less than length of string"); - } - if (typeof count === "number" && (startIndex + count) > str.length) { - throw new Error("Index and count must refer to a location within the string."); - } - return str.slice(0, startIndex) + (typeof count === "number" ? str.substr(startIndex + count) : ""); -} -export function replace(str, search, replace) { - return str.replace(new RegExp(escape(search), "g"), replace); -} -export function replicate(n, x) { - return initialize(n, () => x); -} -export function getCharAtIndex(input, index) { - if (index < 0 || index >= input.length) { - throw new Error("Index was outside the bounds of the array."); - } - return input[index]; -} -export function split(str, splitters, count, options) { - count = typeof count === "number" ? count : undefined; - options = typeof options === "number" ? options : 0; - if (count && count < 0) { - throw new Error("Count cannot be less than zero"); - } - if (count === 0) { - return []; - } - const removeEmpty = (options & 1) === 1; - const trim = (options & 2) === 2; - splitters = splitters || []; - splitters = splitters.filter(x => x).map(escape); - splitters = splitters.length > 0 ? splitters : ["\\s"]; - const splits = []; - const reg = new RegExp(splitters.join("|"), "g"); - let findSplits = true; - let i = 0; - do { - const match = reg.exec(str); - if (match === null) { - const candidate = trim ? str.substring(i).trim() : str.substring(i); - if (!removeEmpty || candidate.length > 0) { - splits.push(candidate); - } - findSplits = false; - } - else { - const candidate = trim ? str.substring(i, match.index).trim() : str.substring(i, match.index); - if (!removeEmpty || candidate.length > 0) { - if (count != null && splits.length + 1 === count) { - splits.push(trim ? str.substring(i).trim() : str.substring(i)); - findSplits = false; - } - else { - splits.push(candidate); - } - } - i = reg.lastIndex; - } - } while (findSplits); - return splits; -} -export function trim(str, ...chars) { - if (chars.length === 0) { - return str.trim(); - } - const pattern = "[" + escape(chars.join("")) + "]+"; - return str.replace(new RegExp("^" + pattern), "").replace(new RegExp(pattern + "$"), ""); -} -export function trimStart(str, ...chars) { - return chars.length === 0 - ? str.trimStart() - : str.replace(new RegExp("^[" + escape(chars.join("")) + "]+"), ""); -} -export function trimEnd(str, ...chars) { - return chars.length === 0 - ? str.trimEnd() - : str.replace(new RegExp("[" + escape(chars.join("")) + "]+$"), ""); -} -export function filter(pred, x) { - return x.split("").filter((c) => pred(c)).join(""); -} -export function substring(str, startIndex, length) { - if ((startIndex + (length || 0) > str.length)) { - throw new Error("Invalid startIndex and/or length"); - } - return length != null ? str.substr(startIndex, length) : str.substr(startIndex); -} -export function fmt(strs, ...args) { - return ({ strs, args }); -} -export function fmtWith(fmts) { - return (strs, ...args) => ({ strs, args, fmts }); -} -export function getFormat(s) { - return s.fmts - ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart) - : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.d.ts deleted file mode 100644 index 8ccca2f7..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { IEnumerator, IEqualityComparer, IComparer } from "./Util.js"; -import { int32 } from "./Int32.js"; -import { TypeInfo } from "./Reflection.js"; -import { FSharpRef } from "./Types.js"; -export declare class Comparer$1 implements IComparer { - constructor(); - Compare(x: T, y: T): int32; -} -export declare function Comparer$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function Comparer$1_$ctor(): Comparer$1; -export declare function Comparer$1_get_Default(): IComparer; -export declare class EqualityComparer$1 implements IEqualityComparer { - constructor(); - Equals(x: T, y: T): boolean; - GetHashCode(x: T): int32; -} -export declare function EqualityComparer$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function EqualityComparer$1_$ctor(): EqualityComparer$1; -export declare function EqualityComparer$1_get_Default(): IEqualityComparer; -export declare class Stack$1 implements Iterable { - contents: T[]; - count: int32; - constructor(initialContents: T[], initialCount: int32); - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare function Stack$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function Stack$1_$ctor_Z524259A4(initialCapacity: int32): Stack$1; -export declare function Stack$1_$ctor(): Stack$1; -export declare function Stack$1_$ctor_BB573A(xs: Iterable): Stack$1; -export declare function Stack$1__Ensure_Z524259A4(_: Stack$1, newSize: int32): void; -export declare function Stack$1__get_Count(_: Stack$1): int32; -export declare function Stack$1__Pop(_: Stack$1): T; -export declare function Stack$1__Peek(_: Stack$1): T; -export declare function Stack$1__Contains_2B595(_: Stack$1, x: T): boolean; -export declare function Stack$1__TryPeek_1F3DB691(this$: Stack$1, result: FSharpRef): boolean; -export declare function Stack$1__TryPop_1F3DB691(this$: Stack$1, result: FSharpRef): boolean; -export declare function Stack$1__Push_2B595(this$: Stack$1, x: T): void; -export declare function Stack$1__Clear(_: Stack$1): void; -export declare function Stack$1__TrimExcess(this$: Stack$1): void; -export declare function Stack$1__ToArray(_: Stack$1): T[]; -export declare class Queue$1 implements Iterable { - contents: T[]; - count: int32; - head: int32; - tail: int32; - constructor(initialContents: T[], initialCount: int32); - GetEnumerator(): IEnumerator; - [Symbol.iterator](): Iterator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare function Queue$1_$reflection(gen0: TypeInfo): TypeInfo; -export declare function Queue$1_$ctor_Z524259A4(initialCapacity: int32): Queue$1; -export declare function Queue$1_$ctor(): Queue$1; -export declare function Queue$1_$ctor_BB573A(xs: Iterable): Queue$1; -export declare function Queue$1__get_Count(_: Queue$1): int32; -export declare function Queue$1__Enqueue_2B595(_: Queue$1, value: T): void; -export declare function Queue$1__Dequeue(_: Queue$1): T; -export declare function Queue$1__Peek(_: Queue$1): T; -export declare function Queue$1__TryDequeue_1F3DB691(this$: Queue$1, result: FSharpRef): boolean; -export declare function Queue$1__TryPeek_1F3DB691(this$: Queue$1, result: FSharpRef): boolean; -export declare function Queue$1__Contains_2B595(_: Queue$1, x: T): boolean; -export declare function Queue$1__Clear(_: Queue$1): void; -export declare function Queue$1__TrimExcess(_: Queue$1): void; -export declare function Queue$1__ToArray(_: Queue$1): T[]; -export declare function Queue$1__CopyTo_Z3B4C077E(_: Queue$1, target: T[], start: int32): void; -export declare function Queue$1__size(this$: Queue$1): int32; -export declare function Queue$1__toIndex_Z524259A4(this$: Queue$1, i: int32): int32; -export declare function Queue$1__ensure_Z524259A4(this$: Queue$1, requiredSize: int32): void; -export declare function Queue$1__toSeq(this$: Queue$1): Iterable; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.js deleted file mode 100644 index 00108291..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Collections.Generic.js +++ /dev/null @@ -1,307 +0,0 @@ -import { disposeSafe, defaultOf, toIterator, getEnumerator, structuralHash, equals, compare } from "./Util.js"; -import { class_type } from "./Reflection.js"; -import { toArray, empty, singleton, append, enumerateWhile, delay } from "./Seq.js"; -import { initialize, copyTo, fill } from "./Array.js"; -import { max } from "./Double.js"; -export class Comparer$1 { - constructor() { - } - Compare(x, y) { - return compare(x, y); - } -} -export function Comparer$1_$reflection(gen0) { - return class_type("System.Collections.Generic.Comparer`1", [gen0], Comparer$1); -} -export function Comparer$1_$ctor() { - return new Comparer$1(); -} -export function Comparer$1_get_Default() { - return { - Compare(x, y) { - return compare(x, y); - }, - }; -} -export class EqualityComparer$1 { - constructor() { - } - Equals(x, y) { - return equals(x, y); - } - GetHashCode(x) { - return structuralHash(x); - } -} -export function EqualityComparer$1_$reflection(gen0) { - return class_type("System.Collections.Generic.EqualityComparer`1", [gen0], EqualityComparer$1); -} -export function EqualityComparer$1_$ctor() { - return new EqualityComparer$1(); -} -export function EqualityComparer$1_get_Default() { - return { - Equals(x, y) { - return equals(x, y); - }, - GetHashCode(x_1) { - return structuralHash(x_1); - }, - }; -} -export class Stack$1 { - constructor(initialContents, initialCount) { - this.contents = initialContents; - this.count = (initialCount | 0); - } - GetEnumerator() { - const _ = this; - return getEnumerator(delay(() => { - let index = _.count - 1; - return enumerateWhile(() => (index >= 0), delay(() => append(singleton(_.contents[index]), delay(() => { - index = ((index - 1) | 0); - return empty(); - })))); - })); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const this$ = this; - return getEnumerator(this$); - } -} -export function Stack$1_$reflection(gen0) { - return class_type("System.Collections.Generic.Stack`1", [gen0], Stack$1); -} -function Stack$1_$ctor_Z3B4C077E(initialContents, initialCount) { - return new Stack$1(initialContents, initialCount); -} -export function Stack$1_$ctor_Z524259A4(initialCapacity) { - return Stack$1_$ctor_Z3B4C077E(fill(new Array(initialCapacity), 0, initialCapacity, null), 0); -} -export function Stack$1_$ctor() { - return Stack$1_$ctor_Z524259A4(4); -} -export function Stack$1_$ctor_BB573A(xs) { - const arr = Array.from(xs); - return Stack$1_$ctor_Z3B4C077E(arr, arr.length); -} -export function Stack$1__Ensure_Z524259A4(_, newSize) { - const oldSize = _.contents.length | 0; - if (newSize > oldSize) { - const old = _.contents; - _.contents = fill(new Array(max(newSize, oldSize * 2)), 0, max(newSize, oldSize * 2), null); - copyTo(old, 0, _.contents, 0, _.count); - } -} -export function Stack$1__get_Count(_) { - return _.count; -} -export function Stack$1__Pop(_) { - _.count = ((_.count - 1) | 0); - return _.contents[_.count]; -} -export function Stack$1__Peek(_) { - return _.contents[_.count - 1]; -} -export function Stack$1__Contains_2B595(_, x) { - let found = false; - let i = 0; - while ((i < _.count) && !found) { - if (equals(x, _.contents[i])) { - found = true; - } - else { - i = ((i + 1) | 0); - } - } - return found; -} -export function Stack$1__TryPeek_1F3DB691(this$, result) { - if (this$.count > 0) { - result.contents = Stack$1__Peek(this$); - return true; - } - else { - return false; - } -} -export function Stack$1__TryPop_1F3DB691(this$, result) { - if (this$.count > 0) { - result.contents = Stack$1__Pop(this$); - return true; - } - else { - return false; - } -} -export function Stack$1__Push_2B595(this$, x) { - Stack$1__Ensure_Z524259A4(this$, this$.count + 1); - this$.contents[this$.count] = x; - this$.count = ((this$.count + 1) | 0); -} -export function Stack$1__Clear(_) { - _.count = 0; - fill(_.contents, 0, _.contents.length, defaultOf()); -} -export function Stack$1__TrimExcess(this$) { - if ((this$.count / this$.contents.length) > 0.9) { - Stack$1__Ensure_Z524259A4(this$, this$.count); - } -} -export function Stack$1__ToArray(_) { - return initialize(_.count, (i) => _.contents[(_.count - 1) - i]); -} -export class Queue$1 { - constructor(initialContents, initialCount) { - this.contents = initialContents; - this.count = (initialCount | 0); - this.head = 0; - this.tail = (initialCount | 0); - } - GetEnumerator() { - const _ = this; - return getEnumerator(Queue$1__toSeq(_)); - } - [Symbol.iterator]() { - return toIterator(getEnumerator(this)); - } - "System.Collections.IEnumerable.GetEnumerator"() { - const this$ = this; - return getEnumerator(this$); - } -} -export function Queue$1_$reflection(gen0) { - return class_type("System.Collections.Generic.Queue`1", [gen0], Queue$1); -} -function Queue$1_$ctor_Z3B4C077E(initialContents, initialCount) { - return new Queue$1(initialContents, initialCount); -} -export function Queue$1_$ctor_Z524259A4(initialCapacity) { - if (initialCapacity < 0) { - throw new Error("capacity is less than 0"); - } - return Queue$1_$ctor_Z3B4C077E(fill(new Array(initialCapacity), 0, initialCapacity, null), 0); -} -export function Queue$1_$ctor() { - return Queue$1_$ctor_Z524259A4(4); -} -export function Queue$1_$ctor_BB573A(xs) { - const arr = Array.from(xs); - return Queue$1_$ctor_Z3B4C077E(arr, arr.length); -} -export function Queue$1__get_Count(_) { - return _.count; -} -export function Queue$1__Enqueue_2B595(_, value) { - if (_.count === Queue$1__size(_)) { - Queue$1__ensure_Z524259A4(_, _.count + 1); - } - _.contents[_.tail] = value; - _.tail = (((_.tail + 1) % Queue$1__size(_)) | 0); - _.count = ((_.count + 1) | 0); -} -export function Queue$1__Dequeue(_) { - if (_.count === 0) { - throw new Error("Queue is empty"); - } - const value = _.contents[_.head]; - _.head = (((_.head + 1) % Queue$1__size(_)) | 0); - _.count = ((_.count - 1) | 0); - return value; -} -export function Queue$1__Peek(_) { - if (_.count === 0) { - throw new Error("Queue is empty"); - } - return _.contents[_.head]; -} -export function Queue$1__TryDequeue_1F3DB691(this$, result) { - if (this$.count === 0) { - return false; - } - else { - result.contents = Queue$1__Dequeue(this$); - return true; - } -} -export function Queue$1__TryPeek_1F3DB691(this$, result) { - if (this$.count === 0) { - return false; - } - else { - result.contents = Queue$1__Peek(this$); - return true; - } -} -export function Queue$1__Contains_2B595(_, x) { - let found = false; - let i = 0; - while ((i < _.count) && !found) { - if (equals(x, _.contents[Queue$1__toIndex_Z524259A4(_, i)])) { - found = true; - } - else { - i = ((i + 1) | 0); - } - } - return found; -} -export function Queue$1__Clear(_) { - _.count = 0; - _.head = 0; - _.tail = 0; - fill(_.contents, 0, Queue$1__size(_), defaultOf()); -} -export function Queue$1__TrimExcess(_) { - if ((_.count / _.contents.length) > 0.9) { - Queue$1__ensure_Z524259A4(_, _.count); - } -} -export function Queue$1__ToArray(_) { - return toArray(Queue$1__toSeq(_)); -} -export function Queue$1__CopyTo_Z3B4C077E(_, target, start) { - let i = start; - const enumerator = getEnumerator(Queue$1__toSeq(_)); - try { - while (enumerator["System.Collections.IEnumerator.MoveNext"]()) { - const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](); - target[i] = item; - i = ((i + 1) | 0); - } - } - finally { - disposeSafe(enumerator); - } -} -export function Queue$1__size(this$) { - return this$.contents.length; -} -export function Queue$1__toIndex_Z524259A4(this$, i) { - return (this$.head + i) % Queue$1__size(this$); -} -export function Queue$1__ensure_Z524259A4(this$, requiredSize) { - const newBuffer = fill(new Array(requiredSize), 0, requiredSize, null); - if (this$.head < this$.tail) { - copyTo(this$.contents, this$.head, newBuffer, 0, this$.count); - } - else { - copyTo(this$.contents, this$.head, newBuffer, 0, Queue$1__size(this$) - this$.head); - copyTo(this$.contents, 0, newBuffer, Queue$1__size(this$) - this$.head, this$.tail); - } - this$.head = 0; - this$.tail = (this$.count | 0); - this$.contents = newBuffer; -} -export function Queue$1__toSeq(this$) { - return delay(() => { - let i = 0; - return enumerateWhile(() => (i < this$.count), delay(() => append(singleton(this$.contents[Queue$1__toIndex_Z524259A4(this$, i)]), delay(() => { - i = ((i + 1) | 0); - return empty(); - })))); - }); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.d.ts deleted file mode 100644 index a6c06271..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { float64, int32 } from "./Int32.js"; -import { TypeInfo } from "./Reflection.js"; -export declare class StringBuilder { - readonly buf: string[]; - constructor(value: string, capacity: int32); - toString(): string; -} -export declare function StringBuilder_$reflection(): TypeInfo; -export declare function StringBuilder_$ctor_Z18115A39(value: string, capacity: int32): StringBuilder; -export declare function StringBuilder_$ctor_Z524259A4(capacity: int32): StringBuilder; -export declare function StringBuilder_$ctor_Z721C83C5(value: string): StringBuilder; -export declare function StringBuilder_$ctor(): StringBuilder; -export declare function StringBuilder__Append_Z721C83C5(x: StringBuilder, s: string): StringBuilder; -export declare function StringBuilder__Append_487EF8FB(x: StringBuilder, s: string, startIndex: int32, count: int32): StringBuilder; -export declare function StringBuilder__Append_244C7CD6(x: StringBuilder, c: string): StringBuilder; -export declare function StringBuilder__Append_Z524259A4(x: StringBuilder, o: int32): StringBuilder; -export declare function StringBuilder__Append_5E38073B(x: StringBuilder, o: float64): StringBuilder; -export declare function StringBuilder__Append_Z1FBCCD16(x: StringBuilder, o: boolean): StringBuilder; -export declare function StringBuilder__Append_4E60E31B(x: StringBuilder, o: any): StringBuilder; -export declare function StringBuilder__Append_Z372E4D23(x: StringBuilder, cs: string[]): StringBuilder; -export declare function StringBuilder__Append_43A65C09(x: StringBuilder, s: StringBuilder): StringBuilder; -export declare function StringBuilder__AppendFormat_433E080(x: StringBuilder, fmt: string, o: any): StringBuilder; -export declare function StringBuilder__AppendFormat_Z696D8D1B(x: StringBuilder, provider: any, fmt: string, o: any): StringBuilder; -export declare function StringBuilder__AppendLine(x: StringBuilder): StringBuilder; -export declare function StringBuilder__AppendLine_Z721C83C5(x: StringBuilder, s: string): StringBuilder; -export declare function StringBuilder__Replace_Z766F94C0(x: StringBuilder, oldValue: string, newValue: string): StringBuilder; -export declare function StringBuilder__Replace_Z384F8060(x: StringBuilder, oldValue: string, newValue: string): StringBuilder; -export declare function StringBuilder__get_Length(x: StringBuilder): int32; -export declare function StringBuilder__ToString_Z37302880(x: StringBuilder, firstIndex: int32, length: int32): string; -export declare function StringBuilder__Clear(x: StringBuilder): StringBuilder; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.js deleted file mode 100644 index ac5990cd..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/System.Text.js +++ /dev/null @@ -1,110 +0,0 @@ -import { replace, format, substring, isNullOrEmpty, join } from "./String.js"; -import { class_type } from "./Reflection.js"; -import { clear, int32ToString } from "./Util.js"; -import { toString } from "./Types.js"; -export class StringBuilder { - constructor(value, capacity) { - this.buf = []; - if (!isNullOrEmpty(value)) { - void (this.buf.push(value)); - } - } - toString() { - const _ = this; - return join("", _.buf); - } -} -export function StringBuilder_$reflection() { - return class_type("System.Text.StringBuilder", void 0, StringBuilder); -} -export function StringBuilder_$ctor_Z18115A39(value, capacity) { - return new StringBuilder(value, capacity); -} -export function StringBuilder_$ctor_Z524259A4(capacity) { - return StringBuilder_$ctor_Z18115A39("", capacity); -} -export function StringBuilder_$ctor_Z721C83C5(value) { - return StringBuilder_$ctor_Z18115A39(value, 16); -} -export function StringBuilder_$ctor() { - return StringBuilder_$ctor_Z18115A39("", 16); -} -export function StringBuilder__Append_Z721C83C5(x, s) { - void (x.buf.push(s)); - return x; -} -export function StringBuilder__Append_487EF8FB(x, s, startIndex, count) { - void (x.buf.push(substring(s, startIndex, count))); - return x; -} -export function StringBuilder__Append_244C7CD6(x, c) { - void (x.buf.push(c)); - return x; -} -export function StringBuilder__Append_Z524259A4(x, o) { - void (x.buf.push(int32ToString(o))); - return x; -} -export function StringBuilder__Append_5E38073B(x, o) { - void (x.buf.push(o.toString())); - return x; -} -export function StringBuilder__Append_Z1FBCCD16(x, o) { - void (x.buf.push(toString(o))); - return x; -} -export function StringBuilder__Append_4E60E31B(x, o) { - void (x.buf.push(toString(o))); - return x; -} -export function StringBuilder__Append_Z372E4D23(x, cs) { - void (x.buf.push(cs.join(''))); - return x; -} -export function StringBuilder__Append_43A65C09(x, s) { - void (x.buf.push(toString(s))); - return x; -} -export function StringBuilder__AppendFormat_433E080(x, fmt, o) { - void (x.buf.push(format(fmt, o))); - return x; -} -export function StringBuilder__AppendFormat_Z696D8D1B(x, provider, fmt, o) { - void (x.buf.push(format(provider, fmt, o))); - return x; -} -export function StringBuilder__AppendLine(x) { - void (x.buf.push("\n")); - return x; -} -export function StringBuilder__AppendLine_Z721C83C5(x, s) { - void (x.buf.push(s)); - void (x.buf.push("\n")); - return x; -} -export function StringBuilder__Replace_Z766F94C0(x, oldValue, newValue) { - for (let i = x.buf.length - 1; i >= 0; i--) { - x.buf[i] = replace(x.buf[i], oldValue, newValue); - } - return x; -} -export function StringBuilder__Replace_Z384F8060(x, oldValue, newValue) { - for (let i = x.buf.length - 1; i >= 0; i--) { - x.buf[i] = replace(x.buf[i], oldValue, newValue); - } - return x; -} -export function StringBuilder__get_Length(x) { - let len = 0; - for (let i = x.buf.length - 1; i >= 0; i--) { - len = ((len + x.buf[i].length) | 0); - } - return len | 0; -} -export function StringBuilder__ToString_Z37302880(x, firstIndex, length) { - return substring(toString(x), firstIndex, length); -} -export function StringBuilder__Clear(x) { - clear(x.buf); - return x; -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.d.ts deleted file mode 100644 index ce854709..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Exception } from "./Types.js"; -export declare class SystemException extends Exception { -} -export declare class TimeoutException extends SystemException { -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.js deleted file mode 100644 index 72468312..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/SystemException.js +++ /dev/null @@ -1,5 +0,0 @@ -import { Exception } from "./Types.js"; -export class SystemException extends Exception { -} -export class TimeoutException extends SystemException { -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.d.ts deleted file mode 100644 index 8e79467e..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FSharpRef } from "./Types.js"; -import { IDateTime } from "./Util.js"; -export declare function create(h?: number, m?: number, s?: number, ms?: number): number; -export declare function fromTicks(ticks: number | bigint): number; -export declare function fromTimeSpan(timeSpan: number): number; -export declare function fromDateTime(d: IDateTime): number; -export declare function maxValue(): number; -export declare function add(t: number, ts: number, wrappedDays?: FSharpRef): number; -export declare function addHours(t: number, h: number): number; -export declare function addMinutes(t: number, m: number): number; -export declare function isBetween(t: number, start: number, end: number): boolean; -export declare function toString(t: number, format?: string, _provider?: any): string; -export declare function parse(str: string): number; -export declare function tryParse(v: string, defValue: FSharpRef): boolean; -export declare function op_Subtraction(left: number, right: number): number; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.js deleted file mode 100644 index be13a772..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeOnly.js +++ /dev/null @@ -1,122 +0,0 @@ -import { hours, minutes, seconds, milliseconds } from "./TimeSpan.js"; -import { padWithZeros } from "./Util.js"; -const millisecondsPerDay = 86400000; -export function create(h = 0, m = 0, s = 0, ms = 0) { - if (h < 0 || m < 0 || s < 0 || ms < 0) - throw new Error("The parameters describe an unrepresentable TimeOnly."); - return h * 3600000 + m * 60000 + s * 1000 + ms; -} -export function fromTicks(ticks) { - return Number(BigInt(ticks) / 10000n); -} -export function fromTimeSpan(timeSpan) { - if (timeSpan < 0 || timeSpan >= millisecondsPerDay) - throw new Error("The TimeSpan describes an unrepresentable TimeOnly."); - return timeSpan; -} -export function fromDateTime(d) { - return d.kind === 1 /* DateKind.UTC */ - ? create(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()) - : create(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); -} -export function maxValue() { - // This is "23:59:59.999" - return millisecondsPerDay - 1; -} -export function add(t, ts, wrappedDays) { - if (wrappedDays === undefined) { - const t2 = (t + ts) % millisecondsPerDay; - return t2 < 0 ? millisecondsPerDay + t2 : t2; - } - wrappedDays.contents = ts / millisecondsPerDay; - let newMs = t + ts % millisecondsPerDay; - if (newMs < 0) { - wrappedDays.contents--; - newMs += millisecondsPerDay; - } - else { - if (newMs >= millisecondsPerDay) { - wrappedDays.contents++; - newMs -= millisecondsPerDay; - } - } - return newMs; -} -export function addHours(t, h) { - return add(t, h * 3600000); -} -export function addMinutes(t, m) { - return add(t, m * 60000); -} -export function isBetween(t, start, end) { - return start <= end - ? (start <= t && end > t) - : (start <= t || end > t); -} -export function toString(t, format = "t", _provider) { - if (["r", "R", "o", "O", "t", "T"].indexOf(format) === -1) { - throw new Error("Custom formats are not supported"); - } - const base = `${padWithZeros(hours(t), 2)}:${padWithZeros(minutes(t), 2)}`; - if (format === "t") - return base; - const s = padWithZeros(seconds(t), 2); - // We're limited to millisecond precision, so the last 4 digits will always be 0 - return `${base}${format === "o" || format === "O" ? `:${s}.${padWithZeros(milliseconds(t), 3)}0000` : `:${s}`}`; -} -export function parse(str) { - // Allowed format types: - // hh:mm - // hh:mm:ss - // hh:mm:ss.fffffff - const r = /^\s*([0-1]?\d|2[0-3])\s*:\s*([0-5]?\d)(\s*:\s*([0-5]?\d)(\.(\d+))?)?\s*$/.exec(str); - if (r != null && r[1] != null && r[2] != null) { - let ms = 0; - let s = 0; - const h = +r[1]; - const m = +r[2]; - if (r[4] != null) { - s = +r[4]; - } - if (r[6] != null) { - // Depending on the number of decimals passed, we need to adapt the numbers - switch (r[6].length) { - case 1: - ms = +r[6] * 100; - break; - case 2: - ms = +r[6] * 10; - break; - case 3: - ms = +r[6]; - break; - case 4: - ms = +r[6] / 10; - break; - case 5: - ms = +r[6] / 100; - break; - case 6: - ms = +r[6] / 1000; - break; - default: - ms = +r[6].substring(0, 7) / 10000; - break; - } - } - return create(h, m, s, Math.trunc(ms)); - } - throw new Error(`String '${str}' was not recognized as a valid TimeOnly.`); -} -export function tryParse(v, defValue) { - try { - defValue.contents = parse(v); - return true; - } - catch { - return false; - } -} -export function op_Subtraction(left, right) { - return add(left, -right); -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.d.ts deleted file mode 100644 index 53030dac..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { FSharpRef } from "./Types.js"; -import { comparePrimitives } from "./Util.js"; -export type TimeSpan = number; -export declare function create(d?: number, h?: number, m?: number, s?: number, ms?: number): number; -export declare function fromTicks(ticks: number | bigint): number; -export declare function fromDays(d: number): number; -export declare function fromHours(h: number): number; -export declare function fromMinutes(m: number): number; -export declare function fromSeconds(s: number): number; -export declare function days(ts: TimeSpan): number; -export declare function hours(ts: TimeSpan): number; -export declare function minutes(ts: TimeSpan): number; -export declare function seconds(ts: TimeSpan): number; -export declare function milliseconds(ts: TimeSpan): number; -export declare function ticks(ts: TimeSpan): bigint; -export declare function totalDays(ts: TimeSpan): number; -export declare function totalHours(ts: TimeSpan): number; -export declare function totalMinutes(ts: TimeSpan): number; -export declare function totalSeconds(ts: TimeSpan): number; -export declare function negate(ts: TimeSpan): number; -export declare function add(ts1: number, ts2: number): number; -export declare function subtract(ts1: number, ts2: number): number; -export declare function multiply(ts: TimeSpan, factor: number): number; -export declare function divide(ts: TimeSpan, b: number): number; -export declare const op_Addition: typeof add; -export declare const op_Subtraction: typeof subtract; -export declare const op_Multiply: typeof multiply; -export declare const op_Division: typeof divide; -export declare const compare: typeof comparePrimitives; -export declare const compareTo: typeof comparePrimitives; -export declare function duration(x: number): number; -export declare function toString(ts: TimeSpan, format?: string, _provider?: any): string; -export declare function parse(str: string): number; -export declare function tryParse(v: string, defValue: FSharpRef): boolean; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.js deleted file mode 100644 index 8e0a2780..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/TimeSpan.js +++ /dev/null @@ -1,177 +0,0 @@ -import { comparePrimitives, padLeftAndRightWithZeros, padWithZeros } from "./Util.js"; -import { toInt64 } from "./BigInt.js"; -/** - * Calls: - * - `Math.ceil` if the `value` is **negative** - * - `Math.floor` if the `value` is **positive** - * @param value Value to round - */ -function signedRound(value) { - return value < 0 ? Math.ceil(value) : Math.floor(value); -} -export function create(d = 0, h = 0, m = 0, s = 0, ms = 0) { - switch (arguments.length) { - case 1: - // ticks - return fromTicks(arguments[0]); - case 3: - // h,m,s - d = 0, h = arguments[0], m = arguments[1], s = arguments[2], ms = 0; - break; - default: - // d,h,m,s,ms - break; - } - return d * 86400000 + h * 3600000 + m * 60000 + s * 1000 + ms; -} -export function fromTicks(ticks) { - return Number(BigInt(ticks) / 10000n); -} -export function fromDays(d) { - return create(d, 0, 0, 0); -} -export function fromHours(h) { - return create(h, 0, 0); -} -export function fromMinutes(m) { - return create(0, m, 0); -} -export function fromSeconds(s) { - return create(0, 0, s); -} -export function days(ts) { - return signedRound(ts / 86400000); -} -export function hours(ts) { - return signedRound(ts % 86400000 / 3600000); -} -export function minutes(ts) { - return signedRound(ts % 3600000 / 60000); -} -export function seconds(ts) { - return signedRound(ts % 60000 / 1000); -} -export function milliseconds(ts) { - return signedRound(ts % 1000); -} -export function ticks(ts) { - return toInt64(BigInt(ts) * 10000n); -} -export function totalDays(ts) { - return ts / 86400000; -} -export function totalHours(ts) { - return ts / 3600000; -} -export function totalMinutes(ts) { - return ts / 60000; -} -export function totalSeconds(ts) { - return ts / 1000; -} -export function negate(ts) { - return ts * -1; -} -export function add(ts1, ts2) { - return ts1 + ts2; -} -export function subtract(ts1, ts2) { - return ts1 - ts2; -} -export function multiply(ts, factor) { - return ts * factor; -} -export function divide(ts, b) { - return ts / b; -} -export const op_Addition = add; -export const op_Subtraction = subtract; -export const op_Multiply = multiply; -export const op_Division = divide; -export const compare = comparePrimitives; -export const compareTo = comparePrimitives; -export function duration(x) { - return Math.abs(x); -} -export function toString(ts, format = "c", _provider) { - if (["c", "g", "G"].indexOf(format) === -1) { - throw new Error("Custom formats are not supported"); - } - const d = Math.abs(days(ts)); - const h = Math.abs(hours(ts)); - const m = Math.abs(minutes(ts)); - const s = Math.abs(seconds(ts)); - const ms = Math.abs(milliseconds(ts)); - const sign = ts < 0 ? "-" : ""; - 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)}`; -} -export function parse(str) { - const firstDot = str.search("\\."); - const firstColon = str.search("\\:"); - if (firstDot === -1 && firstColon === -1) { // There is only a day ex: 4 - const d = parseInt(str, 0); - if (isNaN(d)) { - throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`); - } - else { - return create(d, 0, 0, 0, 0); - } - } - if (firstColon > 0) { // process time part - // WIP: (-?)(((\d+)\.)?([0-9]|0[0-9]|1[0-9]|2[0-3]):(\d+)(:\d+(\.\d{1,7})?)?|\d+(?:(?!\.))) - 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); - if (r != null && r[4] != null && r[5] != null) { - let d = 0; - let ms = 0; - let s = 0; - const sign = r[1] != null && r[1] === "-" ? -1 : 1; - const h = +r[4]; - const m = +r[5]; - if (r[3] != null) { - d = +r[3]; - } - if (r[7] != null) { - s = +r[7]; - } - if (r[8] != null) { - // Depending on the number of decimals passed, we need to adapt the numbers - switch (r[8].length) { - case 1: - ms = +r[8] * 100; - break; - case 2: - ms = +r[8] * 10; - break; - case 3: - ms = +r[8]; - break; - case 4: - ms = +r[8] / 10; - break; - case 5: - ms = +r[8] / 100; - break; - case 6: - ms = +r[8] / 1000; - break; - case 7: - ms = +r[8] / 10000; - break; - default: - throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`); - } - } - return sign * create(d, h, m, s, ms); - } - } - throw new Error(`String '${str}' was not recognized as a valid TimeSpan.`); -} -export function tryParse(v, defValue) { - try { - defValue.contents = parse(v); - return true; - } - catch { - return false; - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.d.ts deleted file mode 100644 index 8ffab520..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IDisposable } from "./Util.js"; -export declare class Timer implements IDisposable { - Interval: number; - AutoReset: boolean; - private _elapsed; - private _enabled; - private _isDisposed; - private _intervalId; - private _timeoutId; - constructor(interval?: number); - Elapsed(): import("./Event.js").IEvent$2, Date>; - get Enabled(): boolean; - set Enabled(x: boolean); - Dispose(): void; - Close(): void; - Start(): void; - Stop(): void; -} -export default Timer; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.js deleted file mode 100644 index b3a8fdd0..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Timer.js +++ /dev/null @@ -1,67 +0,0 @@ -import { Event } from "./Event.js"; -export class Timer { - constructor(interval) { - this._enabled = false; - this._isDisposed = false; - this._intervalId = 0; - this._timeoutId = 0; - this.Interval = interval && interval > 0 ? interval : 100; - this.AutoReset = true; - this._elapsed = new Event(); - } - Elapsed() { - return this._elapsed.Publish; - } - get Enabled() { - return this._enabled; - } - set Enabled(x) { - if (!this._isDisposed && this._enabled !== x) { - this._enabled = x; - if (this._enabled) { - if (this.AutoReset) { - this._intervalId = setInterval(() => { - if (!this.AutoReset) { - this.Enabled = false; - } - this._elapsed.Trigger(new Date()); - }, this.Interval); - } - else { - this._timeoutId = setTimeout(() => { - this.Enabled = false; - this._timeoutId = 0; - if (this.AutoReset) { - this.Enabled = true; - } - this._elapsed.Trigger(new Date()); - }, this.Interval); - } - } - else { - if (this._timeoutId) { - clearTimeout(this._timeoutId); - this._timeoutId = 0; - } - if (this._intervalId) { - clearInterval(this._intervalId); - this._intervalId = 0; - } - } - } - } - Dispose() { - this.Enabled = false; - this._isDisposed = true; - } - Close() { - this.Dispose(); - } - Start() { - this.Enabled = true; - } - Stop() { - this.Enabled = false; - } -} -export default Timer; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.d.ts deleted file mode 100644 index 434fa128..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { IComparable, IEquatable, IHashable } from "./Util.js"; -export type Result = { - tag: "ok"; - value: T; -} | { - tag: "error"; - error: string; -}; -export declare function seqToString(self: Iterable): string; -export declare function toString(x: any, callStack?: number): string; -export declare function unionToString(name: string, fields: any[]): string; -export declare abstract class Union implements IEquatable>, IComparable> { - abstract readonly tag: Tag; - abstract readonly fields: any[]; - abstract cases(): string[]; - get name(): Name; - toJSON(): Name | Name[]; - toString(): string; - GetHashCode(): number; - Equals(other: Union): boolean; - CompareTo(other: Union): number; -} -export declare abstract class Record implements IEquatable, IComparable, IHashable { - toJSON(): any; - toString(): string; - GetHashCode(): number; - Equals(other: Record): boolean; - CompareTo(other: Record): number; -} -export declare class FSharpRef { - private readonly getter; - private readonly setter; - get contents(): T; - set contents(v: T); - constructor(contentsOrGetter: T | (() => T), setter?: (v: T) => void); -} -export declare class Exception { - message?: string | undefined; - constructor(message?: string | undefined); -} -export declare function isException(x: any): boolean; -export declare function isPromise(x: any): boolean; -export declare function ensureErrorOrException(e: any): any; -export declare abstract class FSharpException extends Exception implements IEquatable, IComparable { - toJSON(): any; - toString(): string; - GetHashCode(): number; - Equals(other: FSharpException): boolean; - CompareTo(other: FSharpException): number; -} -export declare class MatchFailureException extends FSharpException { - arg1: string; - arg2: number; - arg3: number; - constructor(arg1: string, arg2: number, arg3: number); -} -export declare class Attribute { -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.js deleted file mode 100644 index e799310c..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Types.js +++ /dev/null @@ -1,208 +0,0 @@ -import { combineHashCodes, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from "./Util.js"; -export function seqToString(self) { - let count = 0; - let str = "["; - for (const x of self) { - if (count === 0) { - str += toString(x); - } - else if (count === 100) { - str += "; ..."; - break; - } - else { - str += "; " + toString(x); - } - count++; - } - return str + "]"; -} -export function toString(x, callStack = 0) { - if (x != null && typeof x === "object") { - if (typeof x.toString === "function") { - return x.toString(); - } - else if (Symbol.iterator in x) { - return seqToString(x); - } - else { // TODO: Date? - const cons = Object.getPrototypeOf(x)?.constructor; - return cons === Object && callStack < 10 - // Same format as recordToString - ? "{ " + Object.entries(x).map(([k, v]) => k + " = " + toString(v, callStack + 1)).join("\n ") + " }" - : cons?.name ?? ""; - } - } - return String(x); -} -export function unionToString(name, fields) { - if (fields.length === 0) { - return name; - } - else { - let fieldStr; - let withParens = true; - if (fields.length === 1) { - fieldStr = toString(fields[0]); - withParens = fieldStr.indexOf(" ") >= 0; - } - else { - fieldStr = fields.map((x) => toString(x)).join(", "); - } - return name + (withParens ? " (" : " ") + fieldStr + (withParens ? ")" : ""); - } -} -export class Union { - get name() { - return this.cases()[this.tag]; - } - toJSON() { - return this.fields.length === 0 ? this.name : [this.name].concat(this.fields); - } - toString() { - return unionToString(this.name, this.fields); - } - GetHashCode() { - const hashes = this.fields.map((x) => structuralHash(x)); - hashes.splice(0, 0, numberHash(this.tag)); - return combineHashCodes(hashes); - } - Equals(other) { - if (this === other) { - return true; - } - else if (!sameConstructor(this, other)) { - return false; - } - else if (this.tag === other.tag) { - return equalArrays(this.fields, other.fields); - } - else { - return false; - } - } - CompareTo(other) { - if (this === other) { - return 0; - } - else if (!sameConstructor(this, other)) { - return -1; - } - else if (this.tag === other.tag) { - return compareArrays(this.fields, other.fields); - } - else { - return this.tag < other.tag ? -1 : 1; - } - } -} -function recordToJSON(self) { - const o = {}; - const keys = Object.keys(self); - for (let i = 0; i < keys.length; i++) { - o[keys[i]] = self[keys[i]]; - } - return o; -} -function recordToString(self) { - return "{ " + Object.entries(self).map(([k, v]) => k + " = " + toString(v)).join("\n ") + " }"; -} -function recordGetHashCode(self) { - const hashes = Object.values(self).map((v) => structuralHash(v)); - return combineHashCodes(hashes); -} -function recordEquals(self, other) { - if (self === other) { - return true; - } - else if (!sameConstructor(self, other)) { - return false; - } - else { - const thisNames = Object.keys(self); - for (let i = 0; i < thisNames.length; i++) { - if (!equals(self[thisNames[i]], other[thisNames[i]])) { - return false; - } - } - return true; - } -} -function recordCompareTo(self, other) { - if (self === other) { - return 0; - } - else if (!sameConstructor(self, other)) { - return -1; - } - else { - const thisNames = Object.keys(self); - for (let i = 0; i < thisNames.length; i++) { - const result = compare(self[thisNames[i]], other[thisNames[i]]); - if (result !== 0) { - return result; - } - } - return 0; - } -} -export class Record { - toJSON() { return recordToJSON(this); } - toString() { return recordToString(this); } - GetHashCode() { return recordGetHashCode(this); } - Equals(other) { return recordEquals(this, other); } - CompareTo(other) { return recordCompareTo(this, other); } -} -export class FSharpRef { - get contents() { - return this.getter(); - } - set contents(v) { - this.setter(v); - } - constructor(contentsOrGetter, setter) { - if (typeof setter === "function") { - this.getter = contentsOrGetter; - this.setter = setter; - } - else { - this.getter = () => contentsOrGetter; - this.setter = (v) => { contentsOrGetter = v; }; - } - } -} -// EXCEPTIONS -// Exception is intentionally not derived from Error, for performance reasons (see #2160) -export class Exception { - constructor(message) { - this.message = message; - } -} -export function isException(x) { - return x instanceof Exception || x instanceof Error; -} -export function isPromise(x) { - return x instanceof Promise; -} -export function ensureErrorOrException(e) { - // Exceptionally admitting promises as errors for compatibility with React.suspense (see #3298) - return (isException(e) || isPromise(e)) ? e : new Error(String(e)); -} -export class FSharpException extends Exception { - toJSON() { return recordToJSON(this); } - toString() { return recordToString(this); } - GetHashCode() { return recordGetHashCode(this); } - Equals(other) { return recordEquals(this, other); } - CompareTo(other) { return recordCompareTo(this, other); } -} -export class MatchFailureException extends FSharpException { - constructor(arg1, arg2, arg3) { - super(); - this.arg1 = arg1; - this.arg2 = arg2 | 0; - this.arg3 = arg3 | 0; - this.message = "The match cases were incomplete"; - } -} -export class Attribute { -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.d.ts deleted file mode 100644 index 145a7cb4..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const rangeDeltas = "#C$&$&$$$$$$%-%&%=$$$$$$=$$$$D$$'$$$$$$$$$$$$%$$%$$$$&$:$*;$+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$&%$$$%$&%'$%$&&%$%$$$$$%$$%$$%$&$$$%%$$&'$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$%$$$$$&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*%$%%$$'$$$$$$$$h$>5'/1(*$$$4\u0093$$$$$$$$%$&$$'%$$&$$$%$4$,F$%&&$$$$$$$$$$$$$$$$$$$$$$$($$$$$%%VS$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$I%$)L$$%%$$P$$$%$%$$+>''%.)&%$%%.$$$%C$-8-'%$\u0086$$*$$)%%$'%-&%$1$$$$A>%|.$1-D,%$&$%$%9'$,$&$(%2$<&%$$.X8$5.2$C$Y$$$$&+'$%$*-%%-$$2$%$+%%%9$*$$&'%$$&'%%%%$$+$'%$&%%-%%)$$$$$%%$$)'%%9$*$%$%$%%$$&%'%%&&$*'$$*-%&$$-%$$,$&$9$*$%$(%$$&($%$$%$%$2%%%-$$*$)$$%$+%%%9$*$%$(%$$$$$'%%%%$*%$'%$&%%-$$)-$$$)&&$'&%$$$%&%&&&/'%$%&&$&$%$)$1-&)$$($&$+$&$:$3&$&'$&$'*%$&(%%%-*$*$$$%$+$&$:$-$(%$$$$($$%$%%*%*$$%%%-$%0%%,$&$L%$&'$&$&$$$'&$*&%%-,$)$$%$5&;$,$$%*&$'&&$$$+)-%%$/S$%*'$)$+$-%H%$$$($;$$$-$%,$%($$$)%-%'C$&2$$&%)--$$$$$$$$$$%+$G'1$($%(.$G$+$)$%('%HN%'$)$%%%$-))%%'&$&%*&'0$%%)$$$-&$%I$$($%N$$&\u016C$'%*$$$'%L$'%D$'%*$$$'%2$\\$'%f%&,7&3-)y%)%$\u028F$$4$=$$&n&&+*0$'&.5&%,5%/0$&$%/W%$*+$%.&$&$$$%-)-))$'&$$-)F$X*(%E$$(i-B$&'%&'%$)&'$&%-A%(.O'=)-$&E:%%$%%X$$$*$$$$%+)-%$-)-)*$)%1$%b'$R$$($$($%*'-*-,,&%$A$'%%$&%-O$$%&$$&%+'G++%%&(-&&-A)%,*N%&++&$0$*'$)$%$%$(Ob0$EH]$($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,+)%)%++++)%)%+$$$$$$$$++1%++++++($%'$$$&&$%'$&'%%'$&+(&%&$%'$%$.()%$$$%$$$+$$($,$$'%&$$$.$$$-$($-$$%)&$$$-&$$$0&C30'$&/2%$'$%$&%&$$$%$()$$$$$$'$$'$'$%%%($'$$%$$3F$$'$%'((%'$%$%$*$B%%$$$B\u012F+$$$$7%*$$t$A'C',7$+$(I((A$$G'+$(MKKq%-)G'G'K+W.$\u00B3\u015A,9-+\u00BB)%$$O$%&$%:$$+:%*B+,S6$%((9)&$=($c['%%3%Q$&$%(''$&$@%&'$,*,*@%$@&C+$?%'(*,Y&*9%+6(+5*'/*slZV0V*)G'+-\u0149B$M$%$%%q@-$+9.'(y8*7:,$$$X2*'7-2&$P&'%%%$'.$%<*-)&G($+$-'$%$+F$%$,%$S&,%'''$$$-$$$&$7.5$<&&%$$%)$d*$$$'$2$-$)R$&+(-)%%$+%%%9$*$%$($%$%$'%%%&%$)$((%%*&(\u00AEX&+%&$$'(-%$$$&AS&)$$'%$%%$$+-\u00C9R&'%'%$%:'%ES&+%$$%&$.-)06N$$$%)$$$*-Y>%&%'$('-%&$\u00E3O&,$%$\u0087CC-,/+%$%+$%$;)$%%%$$$$$$$&,-i+%J&'%%'$$$$$>$-K)$$'+$+$)%&Q0$%&$(@\\\u012A,$H$*$)$$$(--6&%A%9$$*$%$%l*$%$I)&$$%$*$$+-))$%$C($%$%$$$$*-\u01596%%%\u00DA$28+'40$\u03BD\u0089\u0092$(.\u00E7\u0ADF\u0452$,\u0FEA\u026A\u21DC\u025C*B$-'%\u0083A%($-S*(''$$--$*$8(6\u02D3CC:'\u0088n'$$Z*'0c%$$$.%1\u181B+\u04F9M,\u231A\u0142T&4'+\u01AF\u0927\u008E(0&,*-%$%$'\u137F\u0119-J%_%&&)++%*A'^:e&$\u00BD7/z,<\u00AA===*$5==$$%%$%%%'$+'$$$*$.==%$'%+$*$=%$'$($$&*$============?%<$<$)<$<$)<$<$)<$<$)<$<$)$$%U\u0223Z'U+$1$%(2($2\u0573*$4%*$%$(\u00F8P&**%-'$$\u0193O'-($\u0523\u00E8%,*LEE*$'-'%\u0334^$&$'oP$2\u00E5'$>$%$$%$$-$'$$$$)$'$$$$$$&$%$$%$$$$$$$$$$%$$%'$*$'$'$$$-$4(&$($4W%\u0131O'\u0087/2%2$2$H-0\u00C4[@0O',*%1)\u00BD\u011E(\u02FB+0&0&\u0097/|*/7/'[+-)K+A%%q\u009C$u$\u00AA/1%(&&(*,<**,&0*L\u00B6$ZH-\u0429\uA701E\u1058.\u0101%\u16A51\u1D54\u0C42\u0241\u0605\u136E\uDA7B\uDCD9$A\u0083\u00A3\u0113\uFE33\uD800\uDC21%\uD800\uDC21"; -export declare const categories = "1.;=;78;<;6;+;<;#7;8>5>$7<8<1.;=?;>?'9<2?>?<->$;>-':-;#<#$<$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'#$'#%$#%$#%$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#%$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'$&>&>&>&>&>(#$#$&>#$@&$;#@>#;#@#@#$#@#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$<#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$?(*#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#@&;$;6@?=@(6(;(;(;(@'@';@2<;=;?(;2@;'&'(+;'(';'(2?(&(?('+'?';@2'('(@'('@+'(&?;&@(='(&(&(&(@;@'(@;@'@'@'@(2()'()(')()()'('(;+;&'()@'@'@'@'@'@'@(')(@)@)('@)@'@'(@+'=-?=';(@()@'@'@'@'@'@'@'@(@)(@(@(@(@'@'@+('(;@()@'@'@'@'@'@'@(')(@()@)(@'@'(@+;=@'(@()@'@'@'@'@'@'@(')()(@)@)(@()@'@'(@+?'-@('@'@'@'@'@'@'@'@'@'@)()@)@)(@'@)@+-?=?@()('@'@'@'@'()@(@(@(@'@'(@+@;-?'();'@'@'@'@'@(')()@()@)(@)@'@'(@+@'@()'@'@'(')(@)@)('?@')-'(@+-?'@()@'@'@'@'@'@(@)(@(@)@+@);@'('(@='&(;+;@'@'@'@'@'@'('('@'@&@(@+@'@'?;?;?(?+-?(?(?(7878)'@'@()(;('(@(@?(?@?;?;@')()()()('+;')('(')')'('()()(')+)(?#@#@#@$;&$'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@(;-@'?@#@$@6'?;'.'78@';,'@'@'(@'(;@'(@'@'@(@'()()()(;&;='(@+@-@;6;(2@+@'&'@'('('@'@'@()()@)()(@?@;+'@'@'@'@+-@?'()(@;')()(@()()()(@(+@+@;&;@(*(@()'()()()()'@+;?(?@()')()()('+'()()()()@;')()(@;+@'+'&;$@#@#;@(;()('('(')('@$&$&$&(@(#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#@$#$#$@#@$@#@#@#@#$#$@$%$%$%$@$#%>$>$@$#%>$@$#@>$#>@$@$#%>@.26;9:79:79;/02.;9:;5;<78;<;5;.2@2-&@-<78&-<78@&@=@(*(*(@?#?#?$#$#$?#?<#?#?#?#?#?$#$'$?$#<#$?&'6';&'@'@'@?-?'?@'?@-?-?-?-?-?'?'@'&'@?@'&;'&;'+'@#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'(*;(;&#$#$#$#$#$#$#$#$#$#$#$#$#$#$&(',(;@>&>#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$&$#$#$#$#$#$#$#$&>#$#$'#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#$#$#$@#$'&$'('('(')()?(@-?=?@';@)')(@;+@(';';'(+'(;'()@;'@()'()()();@&+@;'(&'+'@'()()(@'('()@+@;'&'?')()'('('('('('@'&;')();'&)(@'@'@'@'@'@$>&$&>@$')()();)(@+@'@'@'@34'@'@$@$@'('<'@'@'@'@'@'>@'87@'@'@'=?@(;78;@(;657878787878787878;78;5;@;6787878;<6<@;=;@'@'@2@;=;78;<;6;+;<;#7;8>5>$7<8<78;78;'&'&'@'@'@'@'@=<>?=@??@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@+@'@'@'@'@'@'@'@2@2@(@4@4@"; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.js deleted file mode 100644 index 30945a91..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Unicode.13.0.0.js +++ /dev/null @@ -1,4 +0,0 @@ -// Unicode 13.0.0 codepoint ranges (delta encoded) and general categories. -// Integer delta values are offset by 35 and stored as Unicode characters. -export const rangeDeltas = "#C$&$&$$$$$$%-%&%=$$$$$$=$$$$D$$'$$$$$$$$$$$$%$$%$$$$&$:$*;$+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$&%$$$%$&%'$%$&&%$%$$$$$%$$%$$%$&$$$%%$$&'$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$%$$$$$&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*%$%%$$'$$$$$$$$h$>5'/1(*$$$4“$$$$$$$$%$&$$'%$$&$$$%$4$,F$%&&$$$$$$$$$$$$$$$$$$$$$$$($$$$$%%VS$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$I%$)L$$%%$$P$$$%$%$$+>''%.)&%$%%.$$$%C$-8-'%$†$$*$$)%%$'%-&%$1$$$$A>%|.$1-D,%$&$%$%9'$,$&$(%2$<&%$$.X8$5.2$C$Y$$$$&+'$%$*-%%-$$2$%$+%%%9$*$$&'%$$&'%%%%$$+$'%$&%%-%%)$$$$$%%$$)'%%9$*$%$%$%%$$&%'%%&&$*'$$*-%&$$-%$$,$&$9$*$%$(%$$&($%$$%$%$2%%%-$$*$)$$%$+%%%9$*$%$(%$$$$$'%%%%$*%$'%$&%%-$$)-$$$)&&$'&%$$$%&%&&&/'%$%&&$&$%$)$1-&)$$($&$+$&$:$3&$&'$&$'*%$&(%%%-*$*$$$%$+$&$:$-$(%$$$$($$%$%%*%*$$%%%-$%0%%,$&$L%$&'$&$&$$$'&$*&%%-,$)$$%$5&;$,$$%*&$'&&$$$+)-%%$/S$%*'$)$+$-%H%$$$($;$$$-$%,$%($$$)%-%'C$&2$$&%)--$$$$$$$$$$%+$G'1$($%(.$G$+$)$%('%HN%'$)$%%%$-))%%'&$&%*&'0$%%)$$$-&$%I$$($%N$$&Ŭ$'%*$$$'%L$'%D$'%*$$$'%2$\\$'%f%&,7&3-)y%)%$ʏ$$4$=$$&n&&+*0$'&.5&%,5%/0$&$%/W%$*+$%.&$&$$$%-)-))$'&$$-)F$X*(%E$$(i-B$&'%&'%$)&'$&%-A%(.O'=)-$&E:%%$%%X$$$*$$$$%+)-%$-)-)*$)%1$%b'$R$$($$($%*'-*-,,&%$A$'%%$&%-O$$%&$$&%+'G++%%&(-&&-A)%,*N%&++&$0$*'$)$%$%$(Ob0$EH]$($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,+)%)%++++)%)%+$$$$$$$$++1%++++++($%'$$$&&$%'$&'%%'$&+(&%&$%'$%$.()%$$$%$$$+$$($,$$'%&$$$.$$$-$($-$$%)&$$$-&$$$0&C30'$&/2%$'$%$&%&$$$%$()$$$$$$'$$'$'$%%%($'$$%$$3F$$'$%'((%'$%$%$*$B%%$$$Bį+$$$$7%*$$t$A'C',7$+$(I((A$$G'+$(MKKq%-)G'G'K+W.$³Ś,9-+»)%$$O$%&$%:$$+:%*B+,S6$%((9)&$=($c['%%3%Q$&$%(''$&$@%&'$,*,*@%$@&C+$?%'(*,Y&*9%+6(+5*'/*slZV0V*)G'+-ʼnB$M$%$%%q@-$+9.'(y8*7:,$$$X2*'7-2&$P&'%%%$'.$%<*-)&G($+$-'$%$+F$%$,%$S&,%'''$$$-$$$&$7.5$<&&%$$%)$d*$$$'$2$-$)R$&+(-)%%$+%%%9$*$%$($%$%$'%%%&%$)$((%%*&(®X&+%&$$'(-%$$$&AS&)$$'%$%%$$+-ÉR&'%'%$%:'%ES&+%$$%&$.-)06N$$$%)$$$*-Y>%&%'$('-%&$ãO&,$%$‡CC-,/+%$%+$%$;)$%%%$$$$$$$&,-i+%J&'%%'$$$$$>$-K)$$'+$+$)%&Q0$%&$(@\\Ī,$H$*$)$$$(--6&%A%9$$*$%$%l*$%$I)&$$%$*$$+-))$%$C($%$%$$$$*-ř6%%%Ú$28+'40$ν‰’$(.ç૟ђ$,࿪ɪ⇜ɜ*B$-'%ƒA%($-S*(''$$--$*$8(6˓CC:'ˆn'$$Z*'0c%$$$.%1᠛+ӹM,⌚łT&4'+ƯधŽ(0&,*-%$%$'፿ę-J%_%&&)++%*A'^:e&$½7/z,<ª===*$5==$$%%$%%%'$+'$$$*$.==%$'%+$*$=%$'$($$&*$============?%<$<$)<$<$)<$<$)<$<$)<$<$)$$%UȣZ'U+$1$%(2($2ճ*$4%*$%$(øP&**%-'$$ƓO'-($ԣè%,*LEE*$'-'%̴^$&$'oP$2å'$>$%$$%$$-$'$$$$)$'$$$$$$&$%$$%$$$$$$$$$$%$$%'$*$'$'$$$-$4(&$($4W%ıO'‡/2%2$2$H-0Ä[@0O',*%1)½Ğ(˻+0&0&—/|*/7/'[+-)K+A%%qœ$u$ª/1%(&&(*,<**,&0*L¶$ZH-Щ꜁Eၘ.ā%ᚥ1ᵔూɁ؅፮򮳙$Aƒ£ē︳𐀡%𐀡"; -export const categories = "1.;=;78;<;6;+;<;#7;8>5>$7<8<1.;=?;>?'9<2?>?<->$;>-':-;#<#$<$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'#$'#%$#%$#%$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#%$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'$&>&>&>&>&>(#$#$&>#$@&$;#@>#;#@#@#$#@#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$<#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$?(*#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#@&;$;6@?=@(6(;(;(;(@'@';@2<;=;?(;2@;'&'(+;'(';'(2?(&(?('+'?';@2'('(@'('@+'(&?;&@(='(&(&(&(@;@'(@;@'@'@'@(2()'()(')()()'('(;+;&'()@'@'@'@'@'@'@(')(@)@)('@)@'@'(@+'=-?=';(@()@'@'@'@'@'@'@'@(@)(@(@(@(@'@'@+('(;@()@'@'@'@'@'@'@(')(@()@)(@'@'(@+;=@'(@()@'@'@'@'@'@'@(')()(@)@)(@()@'@'(@+?'-@('@'@'@'@'@'@'@'@'@'@)()@)@)(@'@)@+-?=?@()('@'@'@'@'()@(@(@(@'@'(@+@;-?'();'@'@'@'@'@(')()@()@)(@)@'@'(@+@'@()'@'@'(')(@)@)('?@')-'(@+-?'@()@'@'@'@'@'@(@)(@(@)@+@);@'('(@='&(;+;@'@'@'@'@'@'('('@'@&@(@+@'@'?;?;?(?+-?(?(?(7878)'@'@()(;('(@(@?(?@?;?;@')()()()('+;')('(')')'('()()(')+)(?#@#@#@$;&$'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@(;-@'?@#@$@6'?;'.'78@';,'@'@'(@'(;@'(@'@'@(@'()()()(;&;='(@+@-@;6;(2@+@'&'@'('('@'@'@()()@)()(@?@;+'@'@'@'@+-@?'()(@;')()(@()()()(@(+@+@;&;@(*(@()'()()()()'@+;?(?@()')()()('+'()()()()@;')()(@;+@'+'&;$@#@#;@(;()('('(')('@$&$&$&(@(#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#@$#$#$@#@$@#@#@#@#$#$@$%$%$%$@$#%>$>$@$#%>$@$#@>$#>@$@$#%>@.26;9:79:79;/02.;9:;5;<78;<;5;.2@2-&@-<78&-<78@&@=@(*(*(@?#?#?$#$#$?#?<#?#?#?#?#?$#$'$?$#<#$?&'6';&'@'@'@?-?'?@'?@-?-?-?-?-?'?'@'&'@?@'&;'&;'+'@#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'(*;(;&#$#$#$#$#$#$#$#$#$#$#$#$#$#$&(',(;@>&>#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$&$#$#$#$#$#$#$#$&>#$#$'#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#$#$#$@#$'&$'('('(')()?(@-?=?@';@)')(@;+@(';';'(+'(;'()@;'@()'()()();@&+@;'(&'+'@'()()(@'('()@+@;'&'?')()'('('('('('@'&;')();'&)(@'@'@'@'@'@$>&$&>@$')()();)(@+@'@'@'@34'@'@$@$@'('<'@'@'@'@'@'>@'87@'@'@'=?@(;78;@(;657878787878787878;78;5;@;6787878;<6<@;=;@'@'@2@;=;78;<;6;+;<;#7;8>5>$7<8<78;78;'&'&'@'@'@'@'@=<>?=@??@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@+@'@'@'@'@'@'@'@2@2@(@4@4@"; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.d.ts deleted file mode 100644 index 361d0c95..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { FSharpRef } from "./Types.js"; -export declare const enum UriKind { - RelativeOrAbsolute = 0, - Absolute = 1, - Relative = 2 -} -export declare class Uri { - private uri; - private constructor(); - private static isAbsoluteUri; - private static tryCreateWithKind; - private static tryCreateWithBase; - private static tryCreateImpl; - static create(value: string | Uri, kindOrUri?: UriKind | string | Uri): Uri; - static tryCreate(baseUri: Uri, relativeUri: string | Uri, result: FSharpRef): boolean; - static tryCreate(uriString: string, uriKind: UriKind, result: FSharpRef): boolean; - toString(): string; - private asUrl; - get isAbsoluteUri(): boolean; - get absoluteUri(): string; - get scheme(): string; - get host(): string; - get absolutePath(): string; - get query(): string; - get pathAndQuery(): string; - get fragment(): string; - get originalString(): string; -} -export default Uri; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.js deleted file mode 100644 index 5d9f128f..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Uri.js +++ /dev/null @@ -1,142 +0,0 @@ -const ok = (value) => ({ - tag: "ok", - value, -}); -const error = (error) => ({ tag: "error", error }); -export class Uri { - constructor(state) { - this.uri = state; - } - static isAbsoluteUri(uri) { - try { - // tslint:disable-next-line no-unused-expression - new URL(uri); - return true; - } - catch { - return false; - } - } - static tryCreateWithKind(uri, kind) { - switch (kind) { - case 1 /* UriKind.Absolute */: - return Uri.isAbsoluteUri(uri) - ? ok(new Uri({ original: uri, value: new URL(uri), kind })) - : error("Invalid URI: The format of the URI could not be determined."); - case 2 /* UriKind.Relative */: - return Uri.isAbsoluteUri(uri) - ? error("URI is not a relative path.") - : ok(new Uri({ original: uri, value: uri, kind })); - case 0 /* UriKind.RelativeOrAbsolute */: - return Uri.isAbsoluteUri(uri) - ? ok(new Uri({ original: uri, value: new URL(uri), kind: 1 /* UriKind.Absolute */ })) - : ok(new Uri({ original: uri, value: uri, kind: 2 /* UriKind.Relative */ })); - default: - const never = kind; - return never; - } - } - static tryCreateWithBase(baseUri, relativeUri) { - return baseUri.uri.kind !== 1 /* UriKind.Absolute */ - ? error("Base URI should have Absolute kind") - : typeof relativeUri === "string" - ? ok(new Uri({ - original: new URL(relativeUri, baseUri.uri.value).toString(), - value: new URL(relativeUri, baseUri.uri.value), - kind: 1 /* UriKind.Absolute */, - })) - : relativeUri.uri.kind === 2 /* UriKind.Relative */ - ? ok(new Uri({ - original: new URL(relativeUri.uri.value, baseUri.uri.value).toString(), - value: new URL(relativeUri.uri.value, baseUri.uri.value), - kind: 1 /* UriKind.Absolute */, - })) - : ok(baseUri); - } - static tryCreateImpl(value, kindOrUri = 1 /* UriKind.Absolute */) { - return typeof value === "string" - ? typeof kindOrUri !== "number" - ? error("Kind must be specified when the baseUri is a string.") - : Uri.tryCreateWithKind(value, kindOrUri) - : typeof kindOrUri === "number" - ? error("Kind should not be specified when the baseUri is an absolute Uri.") - : Uri.tryCreateWithBase(value, kindOrUri); - } - static create(value, kindOrUri = 1 /* UriKind.Absolute */) { - const result = Uri.tryCreateImpl(value, kindOrUri); - switch (result.tag) { - case "ok": - return result.value; - case "error": - throw new Error(result.error); - default: - const never = result; - return never; - } - } - static tryCreate(value, kindOrUri = 1 /* UriKind.Absolute */, out) { - const result = Uri.tryCreateImpl(value, kindOrUri); - switch (result.tag) { - case "ok": - out.contents = result.value; - return true; - case "error": - return false; - default: - const never = result; - return never; - } - } - toString() { - switch (this.uri.kind) { - case 1 /* UriKind.Absolute */: - return decodeURIComponent(this.asUrl().toString()); - case 2 /* UriKind.Relative */: - return this.uri.value; - default: - const never = this.uri; - return never; - } - } - asUrl() { - switch (this.uri.kind) { - case 1 /* UriKind.Absolute */: - return this.uri.value; - case 2 /* UriKind.Relative */: - throw new Error("This operation is not supported for a relative URI."); - default: - const never = this.uri; - return never; - } - } - get isAbsoluteUri() { - return this.uri.kind === 1 /* UriKind.Absolute */; - } - get absoluteUri() { - return this.asUrl().href; - } - get scheme() { - const protocol = this.asUrl().protocol; - return protocol.slice(0, protocol.length - 1); - } - get host() { - return this.asUrl().host; - } - get absolutePath() { - return this.asUrl().pathname; - } - get query() { - return this.asUrl().search; - } - get pathAndQuery() { - const url = this.asUrl(); - return url.pathname + url.search; - } - get fragment() { - return this.asUrl().hash; - } - get originalString() { - return this.uri.original; - } -} -export default Uri; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.d.ts deleted file mode 100644 index 5e10b10d..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.d.ts +++ /dev/null @@ -1,207 +0,0 @@ -export declare const enum DateKind { - Unspecified = 0, - UTC = 1, - Local = 2 -} -export interface IDateTime extends Date { - kind?: DateKind; -} -export interface IDateTimeOffset extends Date { - offset?: number; -} -export interface IComparable extends IEquatable { - CompareTo(x: T): number; -} -export interface IEquatable { - Equals(x: T): boolean; -} -export interface IHashable { - GetHashCode(): number; -} -export interface IDisposable { - Dispose(): void; -} -export interface IComparer { - Compare(x: T, y: T): number; -} -export interface IEqualityComparer { - Equals(x: T, y: T): boolean; - GetHashCode(x: T): number; -} -export interface ICollection extends Iterable { - readonly Count: number; - readonly IsReadOnly: boolean; - Add(item: T): void; - Clear(): void; - Contains(item: T): boolean; - CopyTo(array: T[], arrayIndex: number): void; - Remove(item: T): boolean; -} -export declare function isArrayLike(x: T | ArrayLike | Iterable): x is T[]; -export declare function isIterable(x: T | ArrayLike | Iterable): x is Iterable; -export declare function isEnumerable(x: T | Iterable): x is IEnumerable; -export declare function isComparer(x: T | IComparer): x is IComparer; -export declare function isComparable(x: T | IComparable): x is IComparable; -export declare function isEquatable(x: T | IEquatable): x is IEquatable; -export declare function isHashable(x: T | IHashable): x is IHashable; -export declare function isDisposable(x: T | IDisposable): x is IDisposable; -export declare function disposeSafe(x: any): void; -export declare function defaultOf(): T; -export declare function sameConstructor(x: T, y: T): boolean; -export interface IEnumerator extends IDisposable { - ["System.Collections.Generic.IEnumerator`1.get_Current"](): T; - ["System.Collections.IEnumerator.get_Current"](): T; - ["System.Collections.IEnumerator.MoveNext"](): boolean; - ["System.Collections.IEnumerator.Reset"](): void; - Dispose(): void; -} -export interface IEnumerable extends Iterable { - GetEnumerator(): IEnumerator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; -} -export declare class Enumerable implements IEnumerable { - private en; - constructor(en: IEnumerator); - GetEnumerator(): IEnumerator; - "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator; - [Symbol.iterator](): this; - next(): IteratorResult; -} -export declare class Enumerator implements IEnumerator { - private iter; - private current; - constructor(iter: Iterator); - ["System.Collections.Generic.IEnumerator`1.get_Current"](): T; - ["System.Collections.IEnumerator.get_Current"](): T; - ["System.Collections.IEnumerator.MoveNext"](): boolean; - ["System.Collections.IEnumerator.Reset"](): void; - Dispose(): void; -} -export declare function toEnumerable(e: IEnumerable | Iterable): IEnumerable; -export declare function getEnumerator(e: IEnumerable | Iterable): IEnumerator; -export declare function toIterator(en: IEnumerator): Iterator; -export declare function enumerableToIterator(e: IEnumerable | Iterable): Iterator; -export interface ISet { - add(value: T): ISet; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, value2: T, set: ISet) => void, thisArg?: any): void; - has(value: T): boolean; - readonly size: number; - [Symbol.iterator](): Iterator; - entries(): Iterable<[T, T]>; - keys(): Iterable; - values(): Iterable; -} -export interface IMap { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, key: K, map: IMap) => void, thisArg?: any): void; - get(key: K): V | undefined; - has(key: K): boolean; - set(key: K, value: V): IMap; - readonly size: number; - [Symbol.iterator](): Iterator<[K, V]>; - entries(): Iterable<[K, V]>; - keys(): Iterable; - values(): Iterable; -} -export declare class Comparer implements IComparer { - Compare: (x: T, y: T) => number; - constructor(f?: (x: T, y: T) => number); -} -export declare function comparerFromEqualityComparer(comparer: IEqualityComparer): IComparer; -export declare function assertEqual(actual: T, expected: T, msg?: string): void; -export declare function assertNotEqual(actual: T, expected: T, msg?: string): void; -export declare class Lazy { - private factory; - private isValueCreated; - private createdValue?; - constructor(factory: () => T); - get Value(): T | undefined; - get IsValueCreated(): boolean; -} -export declare function lazyFromValue(v: T): Lazy; -export declare function padWithZeros(i: number, length: number): string; -export declare function padLeftAndRightWithZeros(i: number, lengthLeft: number, lengthRight: number): string; -export declare function dateOffset(date: IDateTime | IDateTimeOffset): number; -export declare function int16ToString(i: number, radix?: number): string; -export declare function int32ToString(i: number, radix?: number): string; -export declare function int64ToString(i: bigint, radix?: number): string; -export declare abstract class ObjectRef { - static id(o: any): any; - private static idMap; - private static count; -} -export declare function stringHash(s: string): number; -export declare function numberHash(x: number): number; -export declare function bigintHash(x: bigint): number; -export declare function combineHashCodes(hashes: ArrayLike): number; -export declare function physicalHash(x: T): number; -export declare function identityHash(x: T): number; -export declare function dateHash(x: Date): number; -export declare function arrayHash(x: ArrayLike): number; -export declare function structuralHash(x: T): number; -export declare function fastStructuralHash(x: T): number; -export declare function safeHash(x: T): number; -export declare function equalArraysWith(x: ArrayLike, y: ArrayLike, eq: (x: T, y: T) => boolean): boolean; -export declare function equalArrays(x: ArrayLike, y: ArrayLike): boolean; -export declare function physicalEquality(x: T, y: T): boolean; -export declare function equals(x: T, y: T): boolean; -export declare function compareDates(x: Date | IDateTime | IDateTimeOffset, y: Date | IDateTime | IDateTimeOffset): 0 | 1 | -1; -export declare function comparePrimitives(x: T, y: T): number; -export declare function compareArraysWith(x: ArrayLike, y: ArrayLike, comp: (x: T, y: T) => number): number; -export declare function compareArrays(x: ArrayLike, y: ArrayLike): number; -export declare function compare(x: T, y: T): number; -export declare function min(comparer: (x: T, y: T) => number, x: T, y: T): T; -export declare function max(comparer: (x: T, y: T) => number, x: T, y: T): T; -export declare function clamp(comparer: (x: T, y: T) => number, value: T, min: T, max: T): T; -export declare function createAtom(value: T): ((...args: Args) => Args extends [] ? T : void); -export declare function createObj(fields: Iterable<[string, any]>): any; -export declare function jsOptions(mutator: (x: object) => void): object; -export declare function round(value: number, digits?: number): number; -export declare function sign(x: number): number; -export declare function unescapeDataString(s: string): string; -export declare function escapeDataString(s: string): string; -export declare function escapeUriString(s: string): string; -export declare function count(col: Iterable): number; -export declare function clear(col: Iterable): void; -export declare function uncurry2(f: (a1: T1) => (a2: T2) => TResult): (a1: T1, a2: T2) => TResult; -export declare function curry2(f: (a1: T1, a2: T2) => TResult): (a1: T1) => (a2: T2) => TResult; -export declare function uncurry3(f: (a1: T1) => (a2: T2) => (a3: T3) => TResult): (a1: T1, a2: T2, a3: T3) => TResult; -export declare function curry3(f: (a1: T1, a2: T2, a3: T3) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => TResult; -export declare function uncurry4(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4) => TResult; -export declare function curry4(f: (a1: T1, a2: T2, a3: T3, a4: T4) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => TResult; -export declare function uncurry5(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => TResult; -export declare function curry5(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => TResult; -export declare function uncurry6(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => TResult; -export declare function curry6(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => TResult; -export declare function uncurry7(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7) => TResult; -export declare function curry7(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => TResult; -export declare function uncurry8(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8) => TResult; -export declare function curry8(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => TResult; -export declare function uncurry9(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => TResult; -export declare function curry9(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => TResult; -export declare function uncurry10(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10) => TResult; -export declare function curry10(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => TResult; -export declare function uncurry11(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11) => TResult; -export declare function curry11(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => TResult; -export declare function uncurry12(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12) => TResult; -export declare function curry12(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => TResult; -export declare function uncurry13(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13) => TResult; -export declare function curry13(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => TResult; -export declare function uncurry14(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14) => TResult; -export declare function curry14(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => TResult; -export declare function uncurry15(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15) => TResult; -export declare function curry15(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => TResult; -export declare function uncurry16(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16) => TResult; -export declare function curry16(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => TResult; -export declare function uncurry17(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17) => TResult; -export declare function curry17(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => TResult; -export declare function uncurry18(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18) => TResult; -export declare function curry18(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => TResult; -export declare function uncurry19(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => (a19: T19) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18, a19: T19) => TResult; -export declare function curry19(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18, a19: T19) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => (a19: T19) => TResult; -export declare function uncurry20(f: (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => (a19: T19) => (a20: T20) => TResult): (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18, a19: T19, a20: T20) => TResult; -export declare function curry20(f: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9, a10: T10, a11: T11, a12: T12, a13: T13, a14: T14, a15: T15, a16: T16, a17: T17, a18: T18, a19: T19, a20: T20) => TResult): (a1: T1) => (a2: T2) => (a3: T3) => (a4: T4) => (a5: T5) => (a6: T6) => (a7: T7) => (a8: T8) => (a9: T9) => (a10: T10) => (a11: T11) => (a12: T12) => (a13: T13) => (a14: T14) => (a15: T15) => (a16: T16) => (a17: T17) => (a18: T18) => (a19: T19) => (a20: T20) => TResult; -export declare function copyToArray(source: T[], sourceIndex: number, target: T[], targetIndex: number, count: number): void; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.js deleted file mode 100644 index 869f80d1..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/Util.js +++ /dev/null @@ -1,781 +0,0 @@ -// tslint:disable:ban-types -export function isArrayLike(x) { - return Array.isArray(x) || ArrayBuffer.isView(x); -} -export function isIterable(x) { - return x != null && typeof x === "object" && Symbol.iterator in x; -} -export function isEnumerable(x) { - return x != null && typeof x.GetEnumerator === "function"; -} -export function isComparer(x) { - return x != null && typeof x.Compare === "function"; -} -export function isComparable(x) { - return x != null && typeof x.CompareTo === "function"; -} -export function isEquatable(x) { - return x != null && typeof x.Equals === "function"; -} -export function isHashable(x) { - return x != null && typeof x.GetHashCode === "function"; -} -export function isDisposable(x) { - return x != null && typeof x.Dispose === "function"; -} -export function disposeSafe(x) { - if (isDisposable(x)) { - x.Dispose(); - } -} -export function defaultOf() { - return null; -} -export function sameConstructor(x, y) { - return Object.getPrototypeOf(x)?.constructor === Object.getPrototypeOf(y)?.constructor; -} -export class Enumerable { - constructor(en) { - this.en = en; - } - GetEnumerator() { return this.en; } - "System.Collections.IEnumerable.GetEnumerator"() { return this.en; } - [Symbol.iterator]() { - return this; - } - next() { - const hasNext = this.en["System.Collections.IEnumerator.MoveNext"](); - const current = hasNext ? this.en["System.Collections.Generic.IEnumerator`1.get_Current"]() : undefined; - return { done: !hasNext, value: current }; - } -} -export class Enumerator { - constructor(iter) { - this.iter = iter; - this.current = defaultOf(); - } - ["System.Collections.Generic.IEnumerator`1.get_Current"]() { - return this.current; - } - ["System.Collections.IEnumerator.get_Current"]() { - return this.current; - } - ["System.Collections.IEnumerator.MoveNext"]() { - const cur = this.iter.next(); - this.current = cur.value; - return !cur.done; - } - ["System.Collections.IEnumerator.Reset"]() { - throw new Error("JS iterators cannot be reset"); - } - Dispose() { - return; - } -} -export function toEnumerable(e) { - if (isEnumerable(e)) { - return e; - } - else { - return new Enumerable(new Enumerator(e[Symbol.iterator]())); - } -} -export function getEnumerator(e) { - if (isEnumerable(e)) { - return e.GetEnumerator(); - } - else { - return new Enumerator(e[Symbol.iterator]()); - } -} -export function toIterator(en) { - return { - next() { - const hasNext = en["System.Collections.IEnumerator.MoveNext"](); - const current = hasNext ? en["System.Collections.Generic.IEnumerator`1.get_Current"]() : undefined; - return { done: !hasNext, value: current }; - }, - }; -} -export function enumerableToIterator(e) { - return toIterator(toEnumerable(e).GetEnumerator()); -} -export class Comparer { - constructor(f) { - this.Compare = f || compare; - } -} -export function comparerFromEqualityComparer(comparer) { - // Sometimes IEqualityComparer also implements IComparer - if (isComparer(comparer)) { - return new Comparer(comparer.Compare); - } - else { - return new Comparer((x, y) => { - const xhash = comparer.GetHashCode(x); - const yhash = comparer.GetHashCode(y); - if (xhash === yhash) { - return comparer.Equals(x, y) ? 0 : -1; - } - else { - return xhash < yhash ? -1 : 1; - } - }); - } -} -export function assertEqual(actual, expected, msg) { - if (!equals(actual, expected)) { - throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), { - actual, - expected, - }); - } -} -export function assertNotEqual(actual, expected, msg) { - if (equals(actual, expected)) { - throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), { - actual, - expected, - }); - } -} -export class Lazy { - constructor(factory) { - this.factory = factory; - this.isValueCreated = false; - } - get Value() { - if (!this.isValueCreated) { - this.createdValue = this.factory(); - this.isValueCreated = true; - } - return this.createdValue; - } - get IsValueCreated() { - return this.isValueCreated; - } -} -export function lazyFromValue(v) { - return new Lazy(() => v); -} -export function padWithZeros(i, length) { - let str = i.toString(10); - while (str.length < length) { - str = "0" + str; - } - return str; -} -export function padLeftAndRightWithZeros(i, lengthLeft, lengthRight) { - let str = i.toString(10); - while (str.length < lengthLeft) { - str = "0" + str; - } - while (str.length < lengthRight) { - str = str + "0"; - } - return str; -} -export function dateOffset(date) { - const date1 = date; - return typeof date1.offset === "number" - ? date1.offset - : (date.kind === 1 /* DateKind.UTC */ - ? 0 : date.getTimezoneOffset() * -60000); -} -export function int16ToString(i, radix) { - i = i < 0 && radix != null && radix !== 10 ? 0xFFFF + i + 1 : i; - return i.toString(radix); -} -export function int32ToString(i, radix) { - i = i < 0 && radix != null && radix !== 10 ? 0xFFFFFFFF + i + 1 : i; - return i.toString(radix); -} -export function int64ToString(i, radix) { - i = i < 0 && radix != null && radix !== 10 ? 0xffffffffffffffffn + i + 1n : i; - return i.toString(radix); -} -export class ObjectRef { - static id(o) { - if (!ObjectRef.idMap.has(o)) { - ObjectRef.idMap.set(o, ++ObjectRef.count); - } - return ObjectRef.idMap.get(o); - } -} -ObjectRef.idMap = new WeakMap(); -ObjectRef.count = 0; -export function stringHash(s) { - let i = 0; - let h = 5381; - const len = s.length; - while (i < len) { - h = (h * 33) ^ s.charCodeAt(i++); - } - return h; -} -export function numberHash(x) { - return x * 2654435761 | 0; -} -export function bigintHash(x) { - return stringHash(x.toString(32)); -} -// From https://stackoverflow.com/a/37449594 -export function combineHashCodes(hashes) { - let h1 = 0; - const len = hashes.length; - for (let i = 0; i < len; i++) { - const h2 = hashes[i]; - h1 = ((h1 << 5) + h1) ^ h2; - } - return h1; -} -export function physicalHash(x) { - if (x == null) { - return 0; - } - switch (typeof x) { - case "boolean": - return x ? 1 : 0; - case "number": - return numberHash(x); - case "bigint": - return bigintHash(x); - case "string": - return stringHash(x); - default: - return numberHash(ObjectRef.id(x)); - } -} -export function identityHash(x) { - if (isHashable(x)) { - return x.GetHashCode(); - } - else { - return physicalHash(x); - } -} -export function dateHash(x) { - return x.getTime(); -} -export function arrayHash(x) { - const len = x.length; - const hashes = new Array(len); - for (let i = 0; i < len; i++) { - hashes[i] = structuralHash(x[i]); - } - return combineHashCodes(hashes); -} -export function structuralHash(x) { - if (x == null) { - return 0; - } - switch (typeof x) { - case "boolean": - return x ? 1 : 0; - case "number": - return numberHash(x); - case "bigint": - return bigintHash(x); - case "string": - return stringHash(x); - default: { - if (isHashable(x)) { - return x.GetHashCode(); - } - else if (isArrayLike(x)) { - return arrayHash(x); - } - else if (x instanceof Date) { - return dateHash(x); - } - else if (Object.getPrototypeOf(x)?.constructor === Object) { - // TODO: check call-stack to prevent cyclic objects? - const hashes = Object.values(x).map((v) => structuralHash(v)); - return combineHashCodes(hashes); - } - else { - // Classes don't implement GetHashCode by default, but must use identity hashing - return numberHash(ObjectRef.id(x)); - // return stringHash(String(x)); - } - } - } -} -// Intended for custom numeric types, like long or decimal -export function fastStructuralHash(x) { - return stringHash(String(x)); -} -// Intended for declared types that may or may not implement GetHashCode -export function safeHash(x) { - // return x == null ? 0 : isHashable(x) ? x.GetHashCode() : numberHash(ObjectRef.id(x)); - return identityHash(x); -} -export function equalArraysWith(x, y, eq) { - if (x == null) { - return y == null; - } - if (y == null) { - return false; - } - if (x.length !== y.length) { - return false; - } - for (let i = 0; i < x.length; i++) { - if (!eq(x[i], y[i])) { - return false; - } - } - return true; -} -export function equalArrays(x, y) { - return equalArraysWith(x, y, equals); -} -function equalObjects(x, y) { - const xKeys = Object.keys(x); - const yKeys = Object.keys(y); - if (xKeys.length !== yKeys.length) { - return false; - } - xKeys.sort(); - yKeys.sort(); - for (let i = 0; i < xKeys.length; i++) { - if (xKeys[i] !== yKeys[i] || !equals(x[xKeys[i]], y[yKeys[i]])) { - return false; - } - } - return true; -} -export function physicalEquality(x, y) { - return x === y; -} -export function equals(x, y) { - if (x === y) { - return true; - } - else if (x == null) { - return y == null; - } - else if (y == null) { - return false; - } - else if (isEquatable(x)) { - return x.Equals(y); - } - else if (isArrayLike(x)) { - return isArrayLike(y) && equalArrays(x, y); - } - else if (typeof x !== "object") { - return false; - } - else if (x instanceof Date) { - return (y instanceof Date) && compareDates(x, y) === 0; - } - else { - return Object.getPrototypeOf(x)?.constructor === Object && equalObjects(x, y); - } -} -export function compareDates(x, y) { - let xtime; - let ytime; - // DateTimeOffset and DateTime deals with equality differently. - if ("offset" in x && "offset" in y) { - xtime = x.getTime(); - ytime = y.getTime(); - } - else { - xtime = x.getTime() + dateOffset(x); - ytime = y.getTime() + dateOffset(y); - } - return xtime === ytime ? 0 : (xtime < ytime ? -1 : 1); -} -export function comparePrimitives(x, y) { - return x === y ? 0 : (x < y ? -1 : 1); -} -export function compareArraysWith(x, y, comp) { - if (x == null) { - return y == null ? 0 : 1; - } - if (y == null) { - return -1; - } - if (x.length !== y.length) { - return x.length < y.length ? -1 : 1; - } - for (let i = 0, j = 0; i < x.length; i++) { - j = comp(x[i], y[i]); - if (j !== 0) { - return j; - } - } - return 0; -} -export function compareArrays(x, y) { - return compareArraysWith(x, y, compare); -} -function compareObjects(x, y) { - const xKeys = Object.keys(x); - const yKeys = Object.keys(y); - if (xKeys.length !== yKeys.length) { - return xKeys.length < yKeys.length ? -1 : 1; - } - xKeys.sort(); - yKeys.sort(); - for (let i = 0, j = 0; i < xKeys.length; i++) { - const key = xKeys[i]; - if (key !== yKeys[i]) { - return key < yKeys[i] ? -1 : 1; - } - else { - j = compare(x[key], y[key]); - if (j !== 0) { - return j; - } - } - } - return 0; -} -export function compare(x, y) { - if (x === y) { - return 0; - } - else if (x == null) { - return y == null ? 0 : -1; - } - else if (y == null) { - return 1; - } - else if (isComparable(x)) { - return x.CompareTo(y); - } - else if (isArrayLike(x)) { - return isArrayLike(y) ? compareArrays(x, y) : -1; - } - else if (typeof x !== "object") { - return x < y ? -1 : 1; - } - else if (x instanceof Date) { - return y instanceof Date ? compareDates(x, y) : -1; - } - else { - return Object.getPrototypeOf(x)?.constructor === Object ? compareObjects(x, y) : -1; - } -} -export function min(comparer, x, y) { - return comparer(x, y) < 0 ? x : y; -} -export function max(comparer, x, y) { - return comparer(x, y) > 0 ? x : y; -} -export function clamp(comparer, value, min, max) { - return (comparer(value, min) < 0) ? min : (comparer(value, max) > 0) ? max : value; -} -export function createAtom(value) { - let atom = value; - return (...args) => { - if (args.length === 0) { - return atom; - } - else { - atom = args[0]; - } - }; -} -export function createObj(fields) { - const obj = {}; - for (const kv of fields) { - obj[kv[0]] = kv[1]; - } - return obj; -} -export function jsOptions(mutator) { - const opts = {}; - mutator(opts); - return opts; -} -export function round(value, digits = 0) { - const m = Math.pow(10, digits); - const n = +(digits ? value * m : value).toFixed(8); - const i = Math.floor(n); - const f = n - i; - const e = 1e-8; - const r = (f > 0.5 - e && f < 0.5 + e) ? ((i % 2 === 0) ? i : i + 1) : Math.round(n); - return digits ? r / m : r; -} -export function sign(x) { - return x > 0 ? 1 : x < 0 ? -1 : 0; -} -export function unescapeDataString(s) { - // https://stackoverflow.com/a/4458580/524236 - return decodeURIComponent((s).replace(/\+/g, "%20")); -} -export function escapeDataString(s) { - return encodeURIComponent(s).replace(/!/g, "%21") - .replace(/'/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A"); -} -export function escapeUriString(s) { - return encodeURI(s); -} -// ICollection.Clear and Count members can be called on Arrays -// or Dictionaries so we need a runtime check (see #1120) -export function count(col) { - if (isArrayLike(col)) { - return col.length; - } - else { - let count = 0; - for (const _ of col) { - count++; - } - return count; - } -} -export function clear(col) { - if (isArrayLike(col)) { - col.splice(0); - } - else { - col.clear(); - } -} -const curried = new WeakMap(); -export function uncurry2(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2) => f(a1)(a2); - curried.set(f2, f); - return f2; -} -export function curry2(f) { - return curried.get(f) ?? ((a1) => (a2) => f(a1, a2)); -} -export function uncurry3(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3) => f(a1)(a2)(a3); - curried.set(f2, f); - return f2; -} -export function curry3(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => f(a1, a2, a3)); -} -export function uncurry4(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4) => f(a1)(a2)(a3)(a4); - curried.set(f2, f); - return f2; -} -export function curry4(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => f(a1, a2, a3, a4)); -} -export function uncurry5(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5) => f(a1)(a2)(a3)(a4)(a5); - curried.set(f2, f); - return f2; -} -export function curry5(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => f(a1, a2, a3, a4, a5)); -} -export function uncurry6(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6) => f(a1)(a2)(a3)(a4)(a5)(a6); - curried.set(f2, f); - return f2; -} -export function curry6(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => f(a1, a2, a3, a4, a5, a6)); -} -export function uncurry7(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7); - curried.set(f2, f); - return f2; -} -export function curry7(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => f(a1, a2, a3, a4, a5, a6, a7)); -} -export function uncurry8(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8); - curried.set(f2, f); - return f2; -} -export function curry8(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => f(a1, a2, a3, a4, a5, a6, a7, a8)); -} -export function uncurry9(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9); - curried.set(f2, f); - return f2; -} -export function curry9(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} -export function uncurry10(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10); - curried.set(f2, f); - return f2; -} -export function curry10(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); -} -export function uncurry11(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11); - curried.set(f2, f); - return f2; -} -export function curry11(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)); -} -export function uncurry12(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12); - curried.set(f2, f); - return f2; -} -export function curry12(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)); -} -export function uncurry13(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13); - curried.set(f2, f); - return f2; -} -export function curry13(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)); -} -export function uncurry14(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14); - curried.set(f2, f); - return f2; -} -export function curry14(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14)); -} -export function uncurry15(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15); - curried.set(f2, f); - return f2; -} -export function curry15(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15)); -} -export function uncurry16(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15)(a16); - curried.set(f2, f); - return f2; -} -export function curry16(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => (a16) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16)); -} -export function uncurry17(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15)(a16)(a17); - curried.set(f2, f); - return f2; -} -export function curry17(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => (a16) => (a17) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17)); -} -export function uncurry18(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15)(a16)(a17)(a18); - curried.set(f2, f); - return f2; -} -export function curry18(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => (a16) => (a17) => (a18) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18)); -} -export function uncurry19(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15)(a16)(a17)(a18)(a19); - curried.set(f2, f); - return f2; -} -export function curry19(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => (a16) => (a17) => (a18) => (a19) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); -} -export function uncurry20(f) { - if (f == null) { - return null; - } - const f2 = (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) => f(a1)(a2)(a3)(a4)(a5)(a6)(a7)(a8)(a9)(a10)(a11)(a12)(a13)(a14)(a15)(a16)(a17)(a18)(a19)(a20); - curried.set(f2, f); - return f2; -} -export function curry20(f) { - return curried.get(f) - ?? ((a1) => (a2) => (a3) => (a4) => (a5) => (a6) => (a7) => (a8) => (a9) => (a10) => (a11) => (a12) => (a13) => (a14) => (a15) => (a16) => (a17) => (a18) => (a19) => (a20) => f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)); -} -// More performant method to copy arrays, see #2352 -export function copyToArray(source, sourceIndex, target, targetIndex, count) { - if (ArrayBuffer.isView(source) && ArrayBuffer.isView(target)) { - target.set(source.subarray(sourceIndex, sourceIndex + count), targetIndex); - } - else { - for (let i = 0; i < count; ++i) { - target[targetIndex + i] = source[sourceIndex + i]; - } - } -} diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.d.ts b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.d.ts deleted file mode 100644 index 27ed1e74..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @type object - */ -export const Big: object; -export default Big; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.js b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.js deleted file mode 100644 index b592471d..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/lib/big.js +++ /dev/null @@ -1,826 +0,0 @@ -// Adapted from https://github.com/MikeMcl/big.js/blob/0f94dc9110d55c4f324a47ba6a2e832ce23ac589/big.mjs -/* tslint:disable */ -var P = {}; -/* - * big.js v6.0.3 - * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic. - * Copyright (c) 2020 Michael Mclaughlin - * https://github.com/MikeMcl/big.js/LICENCE.md - */ -/************************************** EDITABLE DEFAULTS *****************************************/ -// The default values below must be integers within the stated ranges. -/* - * The maximum number of decimal places (DP) of the results of operations involving division: - * div and sqrt, and pow with negative exponents. - */ -var DP = 28, // 0 to MAX_DP -/* - * The rounding mode (RM) used when rounding to the above decimal places. - * - * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN) - * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP) - * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN) - * 3 Away from zero. (ROUND_UP) - */ -RM = 1, // 0, 1, 2 or 3 -// The maximum value of DP and Big.DP. -MAX_DP = 1E6, // 0 to 1000000 -// The maximum magnitude of the exponent argument to the pow method. -MAX_POWER = 1E6, // 1 to 1000000 -/* - * The negative exponent (NE) at and beneath which toString returns exponential notation. - * (JavaScript numbers: -7) - * -1000000 is the minimum recommended exponent value of a Big. - */ -NE = -29, // 0 to -1000000 -/* - * The positive exponent (PE) at and above which toString returns exponential notation. - * (JavaScript numbers: 21) - * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced. - */ -PE = 29, // 0 to 1000000 -/* - * When true, an error will be thrown if a primitive number is passed to the Big constructor, - * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a - * primitive number without a loss of precision. - */ -STRICT = false, // true or false -/**************************************************************************************************/ -// Error messages. -NAME = '[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; -/* - * Create and return a Big constructor. - */ -function _Big_() { - /* - * The Big constructor and exported function. - * Create and return a new instance of a Big number object. - * - * n {number|string|Big} A numeric value. - */ - function Big(n) { - var x = this; - // Enable constructor usage without new. - if (!(x instanceof Big)) - return n === UNDEFINED ? _Big_() : new Big(n); - // Duplicate. - if (n instanceof Big) { - x.s = n.s; - x.e = n.e; - x.c = n.c.slice(); - normalize(x); - } - else { - if (typeof n !== 'string') { - if (Big.strict === true) { - throw TypeError(INVALID + 'number'); - } - // Minus zero? - n = n === 0 && 1 / n < 0 ? '-0' : String(n); - } - parse(x, n); - } - // Retain a reference to this Big constructor. - // Shadow Big.prototype.constructor which points to Object. - x.constructor = Big; - } - Big.prototype = P; - Big.DP = DP; - Big.RM = RM; - Big.NE = NE; - Big.PE = PE; - Big.strict = STRICT; - return Big; -} -function normalize(x) { - // x = round(x, DP, 0); - if (x.c.length > 1 && !x.c[0]) { - let i = x.c.findIndex(x => x); - x.c = x.c.slice(i); - x.e = x.e - i; - } -} -/* - * Parse the number or string value passed to a Big constructor. - * - * x {Big} A Big number instance. - * n {number|string} A numeric value. - */ -function parse(x, n) { - var e, i, nl; - if (!NUMERIC.test(n)) { - throw Error(INVALID + 'number'); - } - // Determine sign. - x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1; - // Decimal point? - if ((e = n.indexOf('.')) > -1) - n = n.replace('.', ''); - // Exponential form? - if ((i = n.search(/e/i)) > 0) { - // Determine exponent. - if (e < 0) - e = i; - e += +n.slice(i + 1); - n = n.substring(0, i); - } - else if (e < 0) { - // Integer. - e = n.length; - } - nl = n.length; - // Determine leading zeros before decimal point. - for (i = 0; i < e && i < nl && n.charAt(i) == '0';) - ++i; - // original version (ignores decimal point). - // // Determine leading zeros. - // for (i = 0; i < nl && n.charAt(i) == '0';) ++i; - if (i == nl) { - // Zero. - x.c = [x.e = 0]; - } - else { - x.e = e - i - 1; - x.c = []; - // Convert string to array of digits without leading zeros - for (e = 0; i < nl;) - x.c[e++] = +n.charAt(i++); - // older version (doesn't keep trailing zeroes). - // // Determine trailing zeros. - // for (; nl > 0 && n.charAt(--nl) == '0';); - // // Convert string to array of digits without leading/trailing zeros. - // for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++); - } - x = round(x, Big.DP + 1, Big.RM); - return x; -} -/* - * Round Big x to a maximum of sd significant digits using rounding mode rm. - * - * x {Big} The Big to round. - * sd {number} Significant digits: integer, 0 to MAX_DP inclusive. - * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - * [more] {boolean} Whether the result of division was truncated. - */ -function round(x, sd, rm, more) { - var xc = x.c; - if (rm === UNDEFINED) - rm = Big.RM; - if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) { - throw Error(INVALID_RM); - } - if (sd < 1) { - more = - rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 || - rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED))); - xc.length = 1; - if (more) { - // 1, 0.1, 0.01, 0.001, 0.0001 etc. - x.e = x.e - sd + 1; - xc[0] = 1; - } - else { - // Zero. - xc[0] = x.e = 0; - } - } - else if (sd < xc.length) { - // xc[sd] is the digit after the digit that may be rounded up. - const isZero = xc.findIndex((xci, idx) => idx >= sd && xci > 0) < 0; - more = - rm === 1 && xc[sd] >= 5 || - rm === 2 && (xc[sd] > 5 || xc[sd] === 5 && - (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) || - rm === 3 && (more || !isZero); - // Remove any digits after the required precision. - xc.length = sd--; - // Round up? - if (more) { - // Rounding up may mean the previous digit has to be rounded up. - for (; ++xc[sd] > 9;) { - xc[sd] = 0; - if (!sd--) { - ++x.e; - xc.unshift(1); - } - } - } - // Remove trailing zeros. - for (sd = xc.length; !xc[--sd];) - xc.pop(); - } - return x; -} -/* - * Return a string representing the value of Big x in normal or exponential notation. - * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf. - */ -function stringify(x, doExponential, isNonzero) { - var e = x.e, s = x.c.join(''), n = s.length; - // Exponential notation? - if (doExponential) { - s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e; - // Normal notation. - } - else if (e < 0) { - for (; ++e;) - s = '0' + s; - s = '0.' + s; - } - else if (e > 0) { - if (++e > n) { - for (e -= n; e--;) - s += '0'; - } - else if (e < n) { - s = s.slice(0, e) + '.' + s.slice(e); - } - } - else if (n > 1) { - s = s.charAt(0) + '.' + s.slice(1); - } - return x.s < 0 && isNonzero ? '-' + s : s; -} -// Prototype/instance methods -/* - * Return a new Big whose value is the absolute value of this Big. - */ -P.abs = function () { - var x = new this.constructor(this); - x.s = 1; - return x; -}; -/* - * Return 1 if the value of this Big is greater than the value of Big y, - * -1 if the value of this Big is less than the value of Big y, or - * 0 if they have the same value. - */ -P.cmp = function (y) { - 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; - // Either zero? - if (!xc[0] || !yc[0]) - return !xc[0] ? !yc[0] ? 0 : -j : i; - // Signs differ? - if (i != j) - return i; - isneg = i < 0; - // Compare exponents. - if (k != l) - return k > l ^ isneg ? 1 : -1; - // Compare digit by digit. - j = Math.max(xc.length, yc.length); - for (i = 0; i < j; i++) { - k = i < xc.length ? xc[i] : 0; - l = i < yc.length ? yc[i] : 0; - if (k != l) - return k > l ^ isneg ? 1 : -1; - } - return 0; - // original version (doesn't compare well trailing zeroes, e.g. 1.0 with 1.00) - // j = (k = xc.length) < (l = yc.length) ? k : l; - // // Compare digit by digit. - // for (i = -1; ++i < j;) { - // if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1; - // } - // // Compare lengths. - // return k == l ? 0 : k > l ^ isneg ? 1 : -1; -}; -/* - * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded, - * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM. - */ -P.div = function (y) { - var Big = this.constructor, x = new Big(this), y = new Big(y), a = x.c, // dividend - b = y.c, // divisor - k = x.s == y.s ? 1 : -1, dp = Big.DP; - if (dp !== ~~dp || dp < 0 || dp > MAX_DP) { - throw Error(INVALID_DP); - } - // Divisor is zero? - if (!b[0]) { - throw Error(DIV_BY_ZERO); - } - // Dividend is 0? Return +-0. - if (!a[0]) { - y.s = k; - y.c = [y.e = 0]; - return y; - } - var bl, bt, n, cmp, ri, bz = b.slice(), ai = bl = b.length, al = a.length, r = a.slice(0, bl), // remainder - rl = r.length, q = y, // quotient - qc = q.c = [], qi = 0, p = dp + (q.e = x.e - y.e) + 1; // precision of the result - q.s = k; - k = p < 0 ? 0 : p; - // Create version of divisor with leading zero. - bz.unshift(0); - // Add zeros to make remainder as long as divisor. - for (; rl++ < bl;) - r.push(0); - do { - // n is how many times the divisor goes into current remainder. - for (n = 0; n < 10; n++) { - // Compare divisor and remainder. - if (bl != (rl = r.length)) { - cmp = bl > rl ? 1 : -1; - } - else { - for (ri = -1, cmp = 0; ++ri < bl;) { - if (b[ri] != r[ri]) { - cmp = b[ri] > r[ri] ? 1 : -1; - break; - } - } - } - // If divisor < remainder, subtract divisor from remainder. - if (cmp < 0) { - // Remainder can't be more than 1 digit longer than divisor. - // Equalise lengths using divisor with extra leading zero? - for (bt = rl == bl ? b : bz; rl;) { - if (r[--rl] < bt[rl]) { - ri = rl; - for (; ri && !r[--ri];) - r[ri] = 9; - --r[ri]; - r[rl] += 10; - } - r[rl] -= bt[rl]; - } - for (; !r[0];) - r.shift(); - } - else { - break; - } - } - // Add the digit n to the result array. - qc[qi++] = cmp ? n : ++n; - // Update the remainder. - if (r[0] && cmp) - r[rl] = a[ai] || 0; - else - r = [a[ai]]; - } while ((ai++ < al || r[0] !== UNDEFINED) && k--); - // Leading zero? Do not remove if result is simply zero (qi == 1). - if (!qc[0] && qi != 1) { - // There can't be more than one zero. - qc.shift(); - q.e--; - p--; - } - // Round? - if (qi > p) - round(q, p, Big.RM, r[0] !== UNDEFINED); - return q; -}; -/* - * Return true if the value of this Big is equal to the value of Big y, otherwise return false. - */ -P.eq = function (y) { - return this.cmp(y) === 0; -}; -/* - * Return true if the value of this Big is greater than the value of Big y, otherwise return - * false. - */ -P.gt = function (y) { - return this.cmp(y) > 0; -}; -/* - * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise - * return false. - */ -P.gte = function (y) { - return this.cmp(y) > -1; -}; -/* - * Return true if the value of this Big is less than the value of Big y, otherwise return false. - */ -P.lt = function (y) { - return this.cmp(y) < 0; -}; -/* - * Return true if the value of this Big is less than or equal to the value of Big y, otherwise - * return false. - */ -P.lte = function (y) { - return this.cmp(y) < 1; -}; -/* - * Return a new Big whose value is the value of this Big minus the value of Big y. - */ -P.minus = P.sub = function (y) { - var i, j, t, xlty, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s; - // Signs differ? - if (a != b) { - y.s = -b; - return x.plus(y); - } - var xc = x.c.slice(), xe = x.e, yc = y.c, ye = y.e; - // Either zero? - if (!xc[0] || !yc[0]) { - if (yc[0]) { - y.s = -b; - } - else if (xc[0]) { - y = new Big(x); - } - else { - y.s = 1; - } - return y; - } - // Determine which is the bigger number. Prepend zeros to equalise exponents. - if (a = xe - ye) { - if (xlty = a < 0) { - a = -a; - t = xc; - } - else { - ye = xe; - t = yc; - } - t.reverse(); - for (b = a; b--;) - t.push(0); - t.reverse(); - } - else { - // Exponents equal. Check digit by digit. - j = ((xlty = xc.length < yc.length) ? xc : yc).length; - for (a = b = 0; b < j; b++) { - if (xc[b] != yc[b]) { - xlty = xc[b] < yc[b]; - break; - } - } - } - // x < y? Point xc to the array of the bigger number. - if (xlty) { - t = xc; - xc = yc; - yc = t; - y.s = -y.s; - } - /* - * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only - * needs to start at yc.length. - */ - if ((b = (j = yc.length) - (i = xc.length)) > 0) - for (; b--;) - xc[i++] = 0; - // Subtract yc from xc. - for (b = i; j > a;) { - if (xc[--j] < yc[j]) { - for (i = j; i && !xc[--i];) - xc[i] = 9; - --xc[i]; - xc[j] += 10; - } - xc[j] -= yc[j]; - } - // Remove trailing zeros. - for (; xc[--b] === 0;) - xc.pop(); - // Remove leading zeros and adjust exponent accordingly. - for (; xc[0] === 0;) { - xc.shift(); - --ye; - } - if (!xc[0]) { - // n - n = +0 - y.s = 1; - // Result must be zero. - xc = [ye = 0]; - } - y.c = xc; - y.e = ye; - return y; -}; -/* - * Return a new Big whose value is the value of this Big modulo the value of Big y. - */ -P.mod = function (y) { - var ygtx, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s; - if (!y.c[0]) { - throw Error(DIV_BY_ZERO); - } - x.s = y.s = 1; - ygtx = y.cmp(x) == 1; - x.s = a; - y.s = b; - if (ygtx) - return new Big(x); - a = Big.DP; - b = Big.RM; - Big.DP = Big.RM = 0; - x = x.div(y); - Big.DP = a; - Big.RM = b; - return this.minus(x.times(y)); -}; -/* - * Return a new Big whose value is the value of this Big plus the value of Big y. - */ -P.plus = P.add = function (y) { - var e, k, t, Big = this.constructor, x = new Big(this), y = new Big(y); - // Signs differ? - if (x.s != y.s) { - y.s = -y.s; - return x.minus(y); - } - var xe = x.e, xc = x.c, ye = y.e, yc = y.c; - // Either zero? - if (!xc[0] || !yc[0]) { - if (!yc[0]) { - if (xc[0]) { - y = new Big(x); - } - else { - y.s = x.s; - } - } - return y; - } - xc = xc.slice(); - // Prepend zeros to equalise exponents. - // Note: reverse faster than unshifts. - if (e = xe - ye) { - if (e > 0) { - ye = xe; - t = yc; - } - else { - e = -e; - t = xc; - } - t.reverse(); - for (; e--;) - t.push(0); - t.reverse(); - } - // Point xc to the longer array. - if (xc.length - yc.length < 0) { - t = yc; - yc = xc; - xc = t; - } - e = yc.length; - // Only start adding at yc.length - 1 as the further digits of xc can be left as they are. - for (k = 0; e; xc[e] %= 10) - k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0; - // No need to check for zero, as +x + +y != 0 && -x + -y != 0 - if (k) { - xc.unshift(k); - ++ye; - } - // Remove trailing zeros. - for (e = xc.length; xc[--e] === 0;) - xc.pop(); - y.c = xc; - y.e = ye; - return y; -}; -/* - * Return a Big whose value is the value of this Big raised to the power n. - * If n is negative, round to a maximum of Big.DP decimal places using rounding - * mode Big.RM. - * - * n {number} Integer, -MAX_POWER to MAX_POWER inclusive. - */ -P.pow = function (n) { - var Big = this.constructor, x = new Big(this), y = new Big('1'), one = new Big('1'), isneg = n < 0; - if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) { - throw Error(INVALID + 'exponent'); - } - if (isneg) - n = -n; - for (;;) { - if (n & 1) - y = y.times(x); - n >>= 1; - if (!n) - break; - x = x.times(x); - } - return isneg ? one.div(y) : y; -}; -/* - * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd - * significant digits using rounding mode rm, or Big.RM if rm is not specified. - * - * sd {number} Significant digits: integer, 1 to MAX_DP inclusive. - * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - */ -P.prec = function (sd, rm) { - if (sd !== ~~sd || sd < 1 || sd > MAX_DP) { - throw Error(INVALID + 'precision'); - } - return round(new this.constructor(this), sd, rm); -}; -/* - * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places - * using rounding mode rm, or Big.RM if rm is not specified. - * If dp is negative, round to an integer which is a multiple of 10**-dp. - * If dp is not specified, round to 0 decimal places. - * - * dp? {number} Integer, -MAX_DP to MAX_DP inclusive. - * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - */ -P.round = function (dp, rm) { - if (dp === UNDEFINED) - dp = 0; - else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) { - throw Error(INVALID_DP); - } - return round(new this.constructor(this), dp + this.e + 1, rm); -}; -/* - * Return a new Big whose value is the square root of the value of this Big, rounded, if - * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM. - */ -P.sqrt = function () { - var r, c, t, Big = this.constructor, x = new Big(this), s = x.s, e = x.e, half = new Big('0.5'); - // Zero? - if (!x.c[0]) - return new Big(x); - // Negative? - if (s < 0) { - throw Error(NAME + 'No square root'); - } - // Estimate. - s = Math.sqrt(x + ''); - // Math.sqrt underflow/overflow? - // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent. - if (s === 0 || s === 1 / 0) { - c = x.c.join(''); - if (!(c.length + e & 1)) - c += '0'; - s = Math.sqrt(c); - e = ((e + 1) / 2 | 0) - (e < 0 || e & 1); - r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e); - } - else { - r = new Big(s + ''); - } - e = r.e + (Big.DP += 4); - // Newton-Raphson iteration. - do { - t = r; - r = half.times(t.plus(x.div(t))); - } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join('')); - return round(r, (Big.DP -= 4) + r.e + 1, Big.RM); -}; -/* - * Return a new Big whose value is the value of this Big times the value of Big y. - */ -P.times = P.mul = function (y) { - 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; - // Determine sign of result. - y.s = x.s == y.s ? 1 : -1; - // Return signed 0 if either 0. - if (!xc[0] || !yc[0]) { - y.c = [y.e = 0]; - return y; - } - // Initialise exponent of result as x.e + y.e. - y.e = i + j; - // If array xc has fewer digits than yc, swap xc and yc, and lengths. - if (a < b) { - c = xc; - xc = yc; - yc = c; - j = a; - a = b; - b = j; - } - // Initialise coefficient array of result with zeros. - for (c = new Array(j = a + b); j--;) - c[j] = 0; - // Multiply. - // i is initially xc.length. - for (i = b; i--;) { - b = 0; - // a is yc.length. - for (j = a + i; j > i;) { - // Current sum of products at this digit position, plus carry. - b = c[j] + yc[i] * xc[j - i - 1] + b; - c[j--] = b % 10; - // carry - b = b / 10 | 0; - } - c[j] = b; - } - // Increment result exponent if there is a final carry, otherwise remove leading zero. - if (b) - ++y.e; - else - c.shift(); - // Remove trailing zeros. - for (i = c.length; !c[--i];) - c.pop(); - y.c = c; - return y; -}; -/* - * Return a string representing the value of this Big in exponential notation rounded to dp fixed - * decimal places using rounding mode rm, or Big.RM if rm is not specified. - * - * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive. - * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - */ -P.toExponential = function (dp, rm) { - var x = this, n = x.c[0]; - if (dp !== UNDEFINED) { - if (dp !== ~~dp || dp < 0 || dp > MAX_DP) { - throw Error(INVALID_DP); - } - x = round(new x.constructor(x), ++dp, rm); - for (; x.c.length < dp;) - x.c.push(0); - } - return stringify(x, true, !!n); -}; -/* - * Return a string representing the value of this Big in normal notation rounded to dp fixed - * decimal places using rounding mode rm, or Big.RM if rm is not specified. - * - * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive. - * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - * - * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. - * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. - */ -P.toFixed = function (dp, rm) { - var x = this, n = x.c[0]; - if (dp !== UNDEFINED) { - if (dp !== ~~dp || dp < 0 || dp > MAX_DP) { - throw Error(INVALID_DP); - } - x = round(new x.constructor(x), dp + x.e + 1, rm); - // x.e may have changed if the value is rounded up. - for (dp = dp + x.e + 1; x.c.length < dp;) - x.c.push(0); - } - return stringify(x, false, !!n); -}; -/* - * Return a string representing the value of this Big. - * Return exponential notation if this Big has a positive exponent equal to or greater than - * Big.PE, or a negative exponent equal to or less than Big.NE. - * Omit the sign for negative zero. - */ -P.toJSON = P.toString = function () { - var x = this, Big = x.constructor; - return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]); -}; -/* - * Return the value of this Big as a primitve number. - */ -P.toNumber = function () { - var n = Number(stringify(this, true, true)); - if (this.constructor.strict === true && !this.eq(n.toString())) { - throw Error(NAME + 'Imprecise conversion'); - } - return n; -}; -/* - * Return a string representing the value of this Big rounded to sd significant digits using - * rounding mode rm, or Big.RM if rm is not specified. - * Use exponential notation if sd is less than the number of digits necessary to represent - * the integer part of the value in normal notation. - * - * sd {number} Significant digits: integer, 1 to MAX_DP inclusive. - * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up). - */ -P.toPrecision = function (sd, rm) { - var x = this, Big = x.constructor, n = x.c[0]; - if (sd !== UNDEFINED) { - if (sd !== ~~sd || sd < 1 || sd > MAX_DP) { - throw Error(INVALID + 'precision'); - } - x = round(new Big(x), sd, rm); - for (; x.c.length < sd;) - x.c.push(0); - } - return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n); -}; -/* - * Return a string representing the value of this Big. - * Return exponential notation if this Big has a positive exponent equal to or greater than - * Big.PE, or a negative exponent equal to or less than Big.NE. - * Include the sign for negative zero. - */ -P.valueOf = function () { - var x = this, Big = x.constructor; - if (Big.strict === true) { - throw Error(NAME + 'valueOf disallowed'); - } - return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true); -}; -// Export -/** - * @type object - */ -export var Big = _Big_(); -/// -export default Big; diff --git a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/package.json b/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/package.json deleted file mode 100644 index 43134762..00000000 --- a/Content/minimal/src/Client/fable_modules/fable-library.4.9.0/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "sideEffects": false, - "type": "module", - "name": "fable-library", - "version": "1.1.1", - "description": "Core library used by F# projects compiled with fable.io", - "author": "Fable Contributors", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/fable-compiler/Fable.git" - }, - "bugs": { - "url": "https://github.com/fable-compiler/Fable/issues" - }, - "homepage": "https://fable.io", - "keywords": [ - "fable", - "fable-compiler", - "fsharp", - "F#" - ] -} diff --git a/Content/minimal/src/Client/fable_modules/project_cracked_debug.json b/Content/minimal/src/Client/fable_modules/project_cracked_debug.json deleted file mode 100644 index eb0bba82..00000000 --- a/Content/minimal/src/Client/fable_modules/project_cracked_debug.json +++ /dev/null @@ -1 +0,0 @@ -{"Version":"4.9.0","FableOptions":{"TypedArrays":true,"ClampByteArrays":false,"Language":["JavaScript"],"Define":["FABLE_COMPILER","FABLE_COMPILER_4","FABLE_COMPILER_JAVASCRIPT"],"DebugMode":true,"OptimizeFSharpAst":false,"Verbosity":["Normal"],"FileExtension":".fs.js","TriggeredByDependency":false,"NoReflection":false},"ProjectPath":"C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/Client.fsproj","SourcePaths":["C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/Promise.fs","C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/fable_modules/Fable.Promise.2.2.2/PromiseImpl.fs","C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/fable_modules/Fable.Fetch.2.4.0/Fetch.fs","C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Shared/Shared.fs","C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/Client.fs"],"FSharpOptions":["--nowarn:1701,1702,1701,1702","--define:TRACE","--define:DEBUG","--define:NET","--define:NET8_0","--define:NETCOREAPP","--define:NET5_0_OR_GREATER","--define:NET6_0_OR_GREATER","--define:NET7_0_OR_GREATER","--define:NET8_0_OR_GREATER","--define:NETCOREAPP1_0_OR_GREATER","--define:NETCOREAPP1_1_OR_GREATER","--define:NETCOREAPP2_0_OR_GREATER","--define:NETCOREAPP2_1_OR_GREATER","--define:NETCOREAPP2_2_OR_GREATER","--define:NETCOREAPP3_0_OR_GREATER","--define:NETCOREAPP3_1_OR_GREATER","--define:FABLE_COMPILER","--noframework","--nologo","--simpleresolution","--nocopyfsharpcore","--nowin32manifest","--warn:3","--fullpaths","--flaterrors","--optimize-","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.ValueTuple.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Threading.Thread.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Threading.Tasks.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Threading.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Text.RegularExpressions.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Text.Encoding.Extensions.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Text.Encoding.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Runtime.Numerics.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Runtime.InteropServices.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Runtime.Extensions.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Runtime.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Reflection.TypeExtensions.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Reflection.Primitives.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Reflection.Metadata.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Reflection.Extensions.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Reflection.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Numerics.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Net.WebClient.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Net.Requests.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.IO.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Globalization.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Diagnostics.Tracing.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Diagnostics.Tools.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Diagnostics.Debug.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Core.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Console.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.ComponentModel.TypeConverter.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.ComponentModel.Primitives.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.ComponentModel.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Collections.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/System.Collections.Concurrent.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/netstandard.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/mscorlib.dll","-r:C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/8.0.1/ref/net8.0/Microsoft.Win32.Registry.dll","-r:C:/Users/Prash/.nuget/packages/fable.core/3.7.0/lib/netstandard2.0/Fable.Core.dll","-r:C:/Users/Prash/.nuget/packages/fable.browser.webstorage/1.1.0/lib/netstandard2.0/Browser.WebStorage.dll","-r:C:/Users/Prash/.nuget/packages/fable.browser.gamepad/1.1.0/lib/netstandard2.0/Browser.Gamepad.dll","-r:C:/Users/Prash/.nuget/packages/fable.browser.event/1.5.0/lib/netstandard2.0/Browser.Event.dll","-r:C:/Users/Prash/.nuget/packages/fable.browser.dom/2.10.0/lib/netstandard2.0/Browser.Dom.dll","-r:C:/Users/Prash/.nuget/packages/fable.browser.blob/1.2.0/lib/netstandard2.0/Browser.Blob.dll","-r:C:\\Users\\Prash\\.nuget\\packages\\fable\\4.9.0\\tools\\net6.0\\any\\FSharp.Core.dll"],"References":["C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Shared/Shared.fsproj"],"OutDir":null,"FableLibDir":"C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/fable_modules/fable-library.4.9.0","FableModulesDir":"C:/Users/Prash/dev/SAFE-template/Content/minimal/src/Client/fable_modules","OutputType":["Library"],"TargetFramework":"net8.0","Exclude":[],"SourceMaps":false,"SourceMapsRoot":null} \ No newline at end of file